Skip to content

Commit e93cf3f

Browse files
committed
chore: Added npm build scripts & updated .gitignore & .npmignore files.
1 parent af27fe0 commit e93cf3f

4 files changed

Lines changed: 59 additions & 11 deletions

File tree

.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
node_modules/
2-
dist/
32
.DS_Store
4-
.env
3+
.env
4+
*.log
5+
coverage/
6+
.nyc_output/
7+
.vscode/
8+
.idea/
9+
10+
# Build output
11+
dist/

.npmignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Source files - only publish built files
2+
src/
3+
tsconfig.json
4+
eslint.config.js
5+
.lintstagedrc.json
6+
7+
# Development files
8+
.git/
9+
.github/
10+
.vscode/
11+
.idea/
12+
.DS_Store
13+
.env
14+
*.log
15+
coverage/
16+
.nyc_output/
17+
18+
# Documentation and config files
19+
CONTRIBUTING.md
20+
.gitignore
21+
.prettierrc
22+
.eslintrc*
23+
24+
# Dependencies
25+
node_modules/
26+
27+
# Keep these files for npm package
28+
# LICENSE
29+
# README.md
30+
# package.json
31+
# dist/

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
{
22
"name": "contentstack-webhook-verify",
33
"version": "1.0.0",
4-
"description": "contentstack-webhook-verify",
4+
"description": "A secure Node.js library for verifying Contentstack webhook authenticity with signature verification and replay attack prevention",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"type": "module",
88
"scripts": {
99
"build": "tsc",
10+
"clean": "rm -rf dist",
11+
"rebuild": "npm run clean && npm run build",
1012
"prepare": "npm run build",
11-
"lint:fix": "eslint --fix ./*.js",
13+
"prepublishOnly": "npm run rebuild && npm run lint:check",
14+
"lint:check": "eslint src/**/*.ts",
15+
"lint:fix": "eslint --fix src/**/*.ts",
1216
"precommit": "lint-staged --concurrent false",
13-
"prettify": "prettier --write ."
17+
"prettify": "prettier --write .",
18+
"check-types": "tsc --noEmit",
19+
"test": "echo \"Tests not implemented yet\" && exit 1"
1420
},
1521
"repository": {
1622
"type": "git",
@@ -30,12 +36,7 @@
3036
"files": [
3137
"dist"
3238
],
33-
"licenses": [
34-
{
35-
"type": "MIT",
36-
"url": "http://www.opensource.org/licenses/MIT"
37-
}
38-
],
39+
"license": "MIT",
3940
"bugs": {
4041
"url": "https://github.com/hanoak/contentstack-webhook-verify/issues"
4142
},

src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,12 @@ const verify = async (
4848
};
4949

5050
export default verify;
51+
52+
// Export types for TypeScript users
53+
export type {
54+
WebhookRequestBody,
55+
Config,
56+
ConfigOptions,
57+
RegionKey,
58+
} from "./types/index.js";
59+
export { default as WebhookError } from "./utils/error.js";

0 commit comments

Comments
 (0)