-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build as proper NPM module #7
base: master
Are you sure you want to change the base?
Conversation
Restructure according to the guide here: https://pauloe-me.medium.com/typescript-npm-package-publishing-a-beginners-guide-40b95908e69c
index.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to src/index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(With small changes due to the import ./types
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole file was reindented due to Prettier. I believe this is a more stable formatting going forward, but the diff will be ugly.
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key changes
"build": "yarn build:module && yarn build:symbol && yarn build:package", | ||
"build:module": "npx pegjs -o src/module-parser.js --allowed-start-rules module,board ./src/module.pegjs", | ||
"build:symbol": "npx pegjs -o src/symbol-parser.js --allowed-start-rules kicad_symbol_lib ./src/symbol.pegjs", | ||
"build:package": "tsup", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key change
src/utils.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No-op change due to reruning tsc. Next step would be to not check this file in at all.
Impact
Description
Testing
test/
TODO:
pnpm build:copilot
works on in fluxNotes
flux-app
, since we're referencing this module by exact commits already, not pointing to HEAD here.