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
This lib gachchan
use _intersection from 'lodash/intersection'
to import function from lodash
-
_intersection
will not be bundled intogachchan
by default. When you writeimport \_intersection from 'lodash/intersection'
, it creates a dependency that expectslodash
to be available at runtime. -
Specify
"peerDependencies": { "lodash": "^4.17.21" }
ingachchan
.You're using
lodash
but want to allow the consuming project to control thelodash
version It prevents multiple copies oflodash
in the final application It makes it clear to users ofgachchan
that they need to installlodash
-
Do
tts-wallet
(which usegachchan
) need to depend onlodash
?- Yes,
tts-wallet
needs to installlodash
as a direct dependency because: - It's a peer dependency of
gachchan
The import statements ingachchan
expect to findlodash
innode_modules
- If
tts-wallet
doesn't installlodash
, you'll get runtime errors about missing modules
- Yes,
https://github.com/sponsors/lockevn
-
pnpm build
build the output package withtsup
-
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.
- 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.