Skip to content

Commit

Permalink
fix: package only the dist dir; drastically cuts bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
andenacitelli committed Apr 21, 2023
1 parent 83e1643 commit 185e722
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 80 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
node-version: 'lts/*'
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.env
node_modules/
.idea/
.vscode/
.vscode/
dist/
70 changes: 0 additions & 70 deletions bin/index.js

This file was deleted.

22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
"name": "openapi-endpoint-trimmer",
"version": "1.1.0",
"description": "",
"bin": "./bin/index.js",
"type": "module",
"files": [
"dist/**"
],
"bin": "dist/index.js",
"scripts": {
"start": "tsc && node ./bin/index.js --url https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.yaml --output generated/output.yaml --paths /search/repositories",
"start": "tsc && node ./dist/index.js --url https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.yaml --output generated/output.yaml --paths /search/repositories",
"commit": "npm run lint && git add --all && cz && git pull && git push",
"build": "tsc",
"lint": "eslint ./src/**/*.{ts,tsx} --fix",
Expand All @@ -15,8 +18,8 @@
"demo:generate:zod": "openapi-zod-client generated/schema.yaml --output generated/types.ts",
"demo": "run-s demo:mkdir demo:trimmer demo:validate demo:generate:zod"
},
"author": "",
"license": "ISC",
"author": "Anden Acitelli",
"license": "MIT",
"dependencies": {
"chalk": "^5.2.0",
"commander": "^10.0.1",
Expand All @@ -33,9 +36,7 @@
"@semantic-release/npm": "^10.0.3",
"@semantic-release/release-notes-generator": "^10.0.3",
"@types/eslint": "^8.37.0",
"@types/js-yaml": "^4.0.5",
"@types/node": "^18.15.13",
"@types/yaml": "^1.9.7",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"commitizen": "^4.3.0",
Expand Down Expand Up @@ -81,12 +82,17 @@
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/npm",
{
"pkgRoot": "dist"
}
],
[
"@semantic-release/git",
{
"assets": [
"bin/**/*.*",
"dist/**/*.*",
"package.json",
"package-lock.json"
],
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
"outDir": "./bin", /* Specify an output folder for all emitted files. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
Expand Down

0 comments on commit 185e722

Please sign in to comment.