Thanks to Matt Pocock for his video on how to set up a modern TypeScript library: https://youtu.be/eh89VE3Mk5g
npm i
in the project root to install dependenciesCommand | Description |
---|---|
npm run lint |
Run TSC and ESLint to lint the code |
npm run build |
Build the project with tsup, outputting CJS and ESM bundles as well as TypeScript declarations to dist/ |
npm run build-all |
Build the project with tsup, outputting a bundle that exports as CJS, ESM and global declaration bundles (for publishing to GreasyFork and OpenUserJS) to dist/ |
npm run dev |
Watch for changes and build the project with sourcemaps |
npm link
in the root of UserUtils to create a global symlink to the packagenpm link @sv443-network/userutils
in the root of the project you want to test the package in to bind to the symlinknpm run dev
in the root of UserUtils to watch for changes and rebuild the package automaticallynpx changeset
(modify the description in .changeset/random-name.md
if needed)main