Skip to content

Commit 5441215

Browse files
feat: implement authentication and authorization middleware, add JWT utilities, and enhance user validation
1 parent 1bb4116 commit 5441215

21 files changed

Lines changed: 1354 additions & 2887 deletions

PACKAGE_MANAGERS.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ If you're working on a new feature or a major update and want users to test it *
141141
4. Bump version (choose one):
142142

143143
```bash
144-
npm run version:patch # Small bugfixes, no new features
145-
npm run version:minor # New features, no breaking changes
146-
npm run version:major # Breaking changes, major updates
144+
npm run version:patch # Patch release: small bug fixes, no new features
145+
npm run version:minor # Minor release: new features, no breaking changes
146+
npm run version:major # Major release: breaking changes and significant updates
147+
147148
```
148149

149150
5. Publish:

jest.config.json

Whitespace-only changes.

jest.config.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
// jest.config.cjs
2-
export default {
3-
preset: 'ts-jest/presets/default-esm', // use ESM preset for ts-jest
2+
import type { Config } from 'jest';
3+
4+
const config: Config = {
5+
preset: 'ts-jest/presets/default-esm', // Use ESM preset for ts-jest
46
testEnvironment: 'node',
57
extensionsToTreatAsEsm: ['.ts'],
68
transform: {
79
'^.+\\.ts$': ['ts-jest', { useESM: true }],
810
},
911
moduleNameMapper: {
10-
'^(\\.{1,2}/.*)\\.js$': '$1', // fix import extensions
12+
'^(\\.{1,2}/.*)\\.js$': '$1', // Fix import extensions for ESM
1113
},
14+
moduleFileExtensions: ['ts', 'js', 'json', 'node'], // Ensure TypeScript files are resolved
15+
collectCoverage: true, // Enable test coverage collection
16+
collectCoverageFrom: ['src/**/*.{ts,js}', '!src/**/*.d.ts'], // Include only relevant files for coverage
17+
coverageDirectory: 'coverage', // Output directory for coverage reports
18+
coverageReporters: ['text', 'lcov'], // Coverage report formats
19+
testMatch: ['<rootDir>/src/**/*.test.ts', '<rootDir>/src/**/*.spec.ts'], // Explicit test file patterns
1220
};
21+
22+
export default config;

package.json

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,30 @@
1010
],
1111
"scripts": {
1212
"clean": "rimraf dist",
13-
"build": "pnpm -r run build && tsc && tsc-alias",
13+
"build": "tsc && tsc-alias",
1414
"dev": "ts-node-dev --respawn --transpile-only --ignore-watch node_modules --ignore-watch dist src/FastKit.ts",
15-
"build:main": "tsc && tsc-alias",
16-
"rebuild": "pnpm -r run clean && pnpm -r run build",
17-
"lint": "pnpm -r run lint",
18-
"lint:fix": "pnpm -r run lint:fix",
19-
"format": "npx prettier . --write",
20-
"test": "pnpm -r run test",
21-
"test:watch": "pnpm -r run test:watch",
22-
"test:coverage": "pnpm -r run test:coverage",
23-
"sync:versions": "npx npm-check-updates --workspace --dep=prod --upgrade --filter /@nexgenstudiodev/*/",
24-
"sync:dev-versions": "npx npm-check-updates --workspace --dep=dev --upgrade --filter /@nexgenstudiodev/*/",
15+
"rebuild": "pnpm run clean && pnpm run build",
16+
"lint": "eslint . --ext .ts",
17+
"lint:fix": "eslint . --ext .ts --fix",
18+
"format": "prettier --write .",
19+
"test": "jest",
20+
"test:watch": "jest --watch",
21+
"test:coverage": "jest --coverage",
22+
"sync:versions": "npx npm-check-updates --dep=prod --upgrade",
23+
"sync:dev-versions": "npx npm-check-updates --dep=dev --upgrade",
2524
"sync:all-versions": "pnpm run sync:versions && pnpm run sync:dev-versions",
2625
"publish:all": "pnpm -r publish --access public --no-git-checks",
27-
"postinstall": "pnpm -r run build"
26+
"postinstall": "pnpm run build"
2827
},
2928
"keywords": [
3029
"fastkit",
3130
"auth",
3231
"database",
3332
"config",
3433
"utilities",
35-
"typescript"
34+
"typescript",
35+
"express",
36+
"api"
3637
],
3738
"author": "NexGenStudioDev",
3839
"license": "MIT",
@@ -41,18 +42,17 @@
4142
"url": "https://github.com/nexgenstudiodev/fastkit.git"
4243
},
4344
"packageManager": "pnpm@10.12.1",
44-
"workspaces": [
45-
"packages/*"
46-
],
4745
"dependencies": {
4846
"@types/figlet": "^1.7.0",
47+
"@types/jsonwebtoken": "^9.0.10",
48+
"argon2": "^0.43.0",
4949
"boxen": "^8.0.1",
5050
"chalk": "^5.4.1",
5151
"dotenv": "^16.4.5",
5252
"enquirer": "^2.4.1",
5353
"express": "^5.1.0",
5454
"figlet": "^1.8.2",
55-
"fs": "0.0.1-security",
55+
"jsonwebtoken": "^9.0.2",
5656
"listr2": "^9.0.1",
5757
"mongoose": "^8.16.3",
5858
"ts-node": "^10.9.2",
@@ -73,14 +73,13 @@
7373
"prompts": "^2.4.2",
7474
"rimraf": "^6.0.1",
7575
"ts-jest": "^29.4.0",
76-
"ts-node": "^10.9.2",
7776
"ts-node-dev": "^2.0.0",
7877
"tsc-alias": "^1.8.16",
7978
"tsconfig-paths": "^4.2.0",
8079
"typescript": "^5.8.3"
8180
},
8281
"lint-staged": {
83-
"packages/**/*.{ts,tsx}": [
82+
"**/*.{ts,tsx}": [
8483
"eslint --fix",
8584
"prettier --write"
8685
]

0 commit comments

Comments
 (0)