chore: add .npmignore file and update package.json to include specific files in the "files" field

The .npmignore file is added to the project. It currently includes the file "out/github-action.cjs" to be ignored when publishing the package to npm.

In the package.json file, the "files" field is updated to include the files "out/cli.cjs" and "out/tiktoken_bg.wasm". This ensures that these files are included when publishing the package to npm.

The "deploy" script in the package.json file is also updated to include pushing tags to the remote repository using "git push --tags". This ensures that the newly created version tags are pushed along with the code changes.
This commit is contained in:
di-sukharev
2023-09-03 15:29:29 +08:00
parent 0460a252e2
commit 08fb4d801f
2 changed files with 4 additions and 2 deletions

1
.npmignore Normal file
View File

@@ -0,0 +1 @@
out/github-action.cjs

View File

@@ -26,7 +26,8 @@
"author": "https://github.com/di-sukharev",
"license": "MIT",
"files": [
"out/**/*"
"out/cli.cjs",
"out/tiktoken_bg.wasm"
],
"release": {
"branches": [
@@ -42,7 +43,7 @@
"dev": "ts-node ./src/cli.ts",
"build": "rimraf out && node esbuild.config.js",
"build:push": "npm run build && git add . && git commit -m 'build' && git push",
"deploy": "npm run build:push && npm version patch && git push --follow-tags && npm publish --tag latest",
"deploy": "npm run build:push && npm version patch && git push --tags && npm publish --tag latest",
"lint": "eslint src --ext ts && tsc --noEmit",
"format": "prettier --write src"
},