In your project (which you want to use gachchan
), Specify "gachchan": "github:lockevn/gachchan#v6.7.2"
in your project, which v6.7.2
is the version (a tag on gachchan
repo)
Then run
npm i gachchan
We use _intersection from 'lodash/intersection'
to import function from lodash
-
_intersection
will not be bundled into gachchan by default. When you use import _intersection from 'lodash/intersection', it creates a dependency that expects lodash to be available at runtime. -
Yes, specify
"peerDependencies": { "lodash": "^4.17.21" }
ingachchan
.
You're using lodash but want to allow the consuming project to control the lodash version It prevents multiple copies of lodash in the final application It makes it clear to users of gachchan that they need to install lodash
- Do
tts-wallet
(which usegachchan
) need to depend on lodash?
Yes, tts-wallet needs to install lodash as a direct dependency because:
- It's a peer dependency of gachchan The import statements in gachchan expect to find lodash in node_modules
- If tts-wallet doesn't install lodash, you'll get runtime errors about missing modules Here's how you should set up your package.json files:
https://github.com/sponsors/lockevn
-
pnpm build
-
commit code (along with
/dist
folder) to repo -
Create git tag and publish the git tag
git tag -a v7.0.0
git push origin v7.0.0
- We got https://github.com/lockevn/gachchan/tree/v7.0.0
Search for my-ts-lib
and replace it with your custom package name.
Features:
- Package manager pnpm, safe and fast
- Release with semantic-release
- Bundle with tsup
- Test with vitest
To skip CI (GitHub action), add skip-ci
to commit message. To skip release, add skip-release
to commit message.