Skip to content

Commit b2b414b

Browse files
feat: initialize pnpm workspace and add fastkit modules
- Created pnpm workspace configuration in `pnpm-workspace.yaml`. - Added `fastkit-auth`, `fastkit-config`, and `fastkit-dbconfig` packages with their respective `package.json` files. - Implemented core functionalities in `fastkit-auth` including authentication constants, controller, and service. - Developed configuration management in `fastkit-config` with environment setup and type definitions. - Removed deprecated files and cleaned up the project structure. - Updated TypeScript configuration for all packages to ensure consistent compilation settings.
1 parent ba5e12d commit b2b414b

43 files changed

Lines changed: 699 additions & 1635 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.npmignore

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,30 @@ src/
33
*.ts
44
!*.d.ts
55

6-
# Development files
6+
# Development config files
77
.eslintrc.*
88
.prettierrc*
99
tsconfig*.json
1010
jest.config.*
1111
*.test.*
1212
*.spec.*
1313

14-
1514
# Documentation (except README)
1615
docs/
1716
CONTRIBUTING.md
1817
CHANGELOG.md
1918

20-
# Git files
19+
# Git files and folders
2120
.git/
2221
.gitignore
2322
Environment/
2423

25-
# CI/CD
24+
# CI/CD config
2625
.github/
2726
.travis.yml
2827
.circleci/
2928

30-
# Editor files
29+
# Editor and IDE files
3130
.vscode/
3231
.idea/
3332
*.sublime-*
@@ -36,7 +35,7 @@ Environment/
3635
.DS_Store
3736
Thumbs.db
3837

39-
# Package manager
38+
# Package manager lock files and folders
4039
pnpm-lock.yaml
4140
yarn.lock
4241
.pnp.*
@@ -46,23 +45,23 @@ yarn.lock
4645
logs/
4746
*.log
4847

49-
# Runtime data
48+
# Runtime data files
5049
pids/
5150
*.pid
5251
*.seed
5352
*.pid.lock
5453

55-
# Coverage
54+
# Coverage reports
5655
coverage/
5756
.nyc_output/
5857

5958
# Dependencies
6059
node_modules/
6160

62-
# Build tools
61+
# Build tools and cache
6362
.tsbuildinfo
6463

65-
# Temporary files
64+
# Temporary files and folders
6665
tmp/
6766
temp/
6867

.pnpmfile.mjs

Lines changed: 0 additions & 18 deletions
This file was deleted.

.pnpmrc

Whitespace-only changes.

.prettierignore

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
# Ignore artifacts:
2-
build
3-
coverage
4-
node_modules
5-
dist
6-
.env
1+
# Ignore build output
2+
build/
3+
dist/
4+
5+
# Ignore coverage reports
6+
coverage/
7+
8+
# Ignore dependencies
9+
node_modules/
10+
11+
# Ignore environment files
12+
.env
13+
.env.local
14+
.env.development.local

PACKAGE_MANAGERS.md

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,38 @@ yarn add @nexgenstudiodev/fastkit
2929

3030
The following scripts are available via `npm run <script>` or `pnpm run <script>`:
3131

32-
| Script | Description |
33-
|------------------|--------------------------------------------------|
34-
| `build` | Compile TypeScript to JavaScript using `tsc` |
35-
| `clean` | Delete the `dist` directory using `rimraf` |
36-
| `rebuild` | Clean and then build (npm version) |
37-
| `rebuild:pnpm` | Clean and then build (pnpm version) |
38-
| `lint` | Run ESLint on all `.ts` and `.tsx` files in `src/` |
39-
| `lint:fix` | Automatically fix linting issues |
40-
| `test` | Run tests with Jest |
41-
| `test:watch` | Watch files and re-run tests on change |
42-
| `test:coverage` | Run tests and generate coverage report |
43-
| `start:dev` | Start development mode using `ts-node-dev` |
44-
| `format` | Format all supported files in `src/` using Prettier |
45-
| `prepublishOnly` | Format, lint, and build before publishing (npm lifecycle hook) |
46-
| `publish:npm` | Publish the package to npm (with public access) |
47-
| `publish:pnpm` | Publish the package using pnpm (skip git checks) |
48-
| `version:patch` | Bump patch version using npm |
49-
| `version:minor` | Bump minor version using npm |
50-
| `version:major` | Bump major version using npm |
32+
## 🔧 Development Scripts
5133

34+
The following scripts are available via `npm run <script>` or `pnpm run <script>`:
5235

36+
| Script | Description |
37+
|--------------------|------------------------------------------------------------------|
38+
| **build** | Compile TypeScript using `tsc` and fix paths using `tsc-alias` |
39+
| **clean** | Delete the `dist` directory using `rimraf` |
40+
| **rebuild** | Clean and then build the project |
41+
| **lint** | Run ESLint on all `.ts` and `.tsx` files in `src/` |
42+
| **lint:fix** | Automatically fix lint issues |
43+
| **format** | Format source files using Prettier |
44+
| **test** | Run all tests using Jest |
45+
| **test:watch** | Watch and re-run tests on file changes |
46+
| **test:coverage** | Generate code coverage report |
47+
| **start:dev** | Start dev server using `ts-node-dev` |
48+
| **prepublishOnly** | Hook to format, lint, and build before publishing |
49+
| **publish:npm** | Publish package to npm using npm CLI |
50+
| **publish:pnpm** | Publish package to npm using pnpm (skip git checks) |
51+
| **version:patch** | Bump patch version |
52+
| **version:minor** | Bump minor version |
53+
| **version:major** | Bump major version |
54+
| **add** | *(Your custom script — specify its function if needed)* |
55+
56+
57+
### 🎯 Filter Usage (Workspace Targeting)
5358

59+
````bash
60+
pnpm build --filter @nexgenstudiodev/fastkit-config
61+
pnpm add -D @types/express --filter @nexgenstudiodev/fastkit-config
62+
63+
````
5464

5565
### 🚀 Publishing Workflow
5666

README.md

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,16 @@ FastKit is a **developer-first**, **class-based**, and **plug-and-play** toolkit
2323
## 🗂️ Folder Structure
2424

2525
```text
26-
src/
27-
├── server.ts # Create express app and FastKit instance
28-
├── fastkit.ts # The FastKit core class
29-
├── config/
30-
│ └── fastkit.config.ts # Global config
31-
├── utils/
32-
│ └── SendResponse.ts # Standard response wrapper
33-
├── middlewares/
34-
│ └── verifyToken.ts # JWT middleware
35-
│ └── validateBody.ts # Schema validation middleware
36-
├── services/
37-
│ └── email/v1/Email.service.ts
38-
├── features/
39-
│ └── Auth/v1/
40-
│ ├── Auth.controller.ts
41-
│ ├── Auth.service.ts
42-
│ ├── Auth.validators.ts
43-
26+
FastKit/
27+
├── package.json (root)
28+
├── pnpm-workspace.yaml
29+
└── src/
30+
└── packages/
31+
├── fastkit
32+
├── fastkit-config
33+
├── fastkit-db-config
34+
└── fastkit-auth
35+
4436
```
4537

4638

@@ -58,6 +50,8 @@ yarn add @nexgenstudiodev/fastkit
5850
```
5951

6052

53+
54+
6155
## 🛠️ Getting Started
6256

6357
### 1. Create FastKit App
@@ -172,6 +166,9 @@ EmailService.sendReminder(userId, date, content);
172166

173167
````
174168

169+
170+
171+
175172
## 📁 Folder Module Examples
176173

177174
- Create Folder
@@ -185,6 +182,31 @@ EmailService.sendReminder(userId, date, content);
185182
- Works with both HTTP and Socket.io
186183
- Real-time APIs using FastKit + Socket.io events supported
187184

185+
## 🧪 Troubleshooting
186+
187+
#### 1. Missing TypeScript Config
188+
189+
- ✅ Ensure all packages extend the root tsconfig.base.json:
190+
````json
191+
{
192+
"extends": "../../tsconfig.base.json"
193+
}
194+
````
195+
#### 2. Publish Errors
196+
197+
````bash
198+
npm version patch # Bump version first using:
199+
pnpm publish --tag beta # publish with a tag:
200+
201+
````
202+
203+
#### 3. Mixed Lockfiles
204+
205+
````bash
206+
rm -rf node_modules pnpm-lock.yaml package-lock.json
207+
pnpm install
208+
````
209+
188210

189211
## 👥 Authors
190212

jest.setup.ts

Whitespace-only changes.

package.json

Lines changed: 30 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,36 @@
11
{
22
"name": "@nexgenstudiodev/fastkit",
3-
"type": "commonjs",
4-
"version": "1.0.2",
5-
"description": "A modular, class-based toolkit for fast API development with TypeScript and Express.",
6-
"main": "dist/FastKit.js",
7-
"types": "dist/FastKit.d.ts",
8-
"files": [
9-
"dist"
3+
"version": "1.0.0",
4+
"private": true,
5+
"description": "A modular monorepo for FastKit and related tools",
6+
"packageManager": "pnpm@10.12.1",
7+
"workspaces": [
8+
"packages/*"
109
],
1110
"scripts": {
1211
"clean": "rimraf dist",
13-
"build": "tsc && pnpm exec tsc-alias",
14-
"rebuild": "pnpm run clean && pnpm run build",
15-
"lint": "eslint src/**/*.{ts,tsx}",
16-
"lint:fix": "eslint src/**/*.{ts,tsx} --fix",
17-
"test": "jest",
18-
"test:watch": "jest --watch",
19-
"test:coverage": "jest --coverage",
20-
"start:dev": "ts-node -r tsconfig-paths/register src/FastKit.ts",
21-
"start:test": "ts-node --transpile-only src/test.ts",
22-
"format": "prettier --write 'src/**/*.{ts,tsx,js,json,md}'",
23-
"prepublishOnly": "pnpm run format && pnpm run lint && pnpm run build",
24-
"publish:npm": "npm publish --access public",
25-
"publish:pnpm": "pnpm publish --access public --no-git-checks",
26-
"version:patch": "npm version patch",
27-
"version:minor": "npm version minor",
28-
"version:major": "npm version major"
29-
},
30-
"keywords": [
31-
"api",
32-
"typescript",
33-
"auth",
34-
"utils",
35-
"class-based",
36-
"modular",
37-
"toolkit",
38-
"headless",
39-
"nodejs"
40-
],
41-
"author": "Abhishek Kumar <abhishek.nexgen.dev@gmail.com>",
42-
"license": "MIT",
43-
"lint-staged": {
44-
"src/**/*.{ts,tsx}": [
45-
"eslint --fix",
46-
"prettier --write"
47-
]
48-
},
49-
"repository": {
50-
"type": "git",
51-
"url": "https://github.com/NexGenStudioDev/FastKit"
52-
},
53-
"bugs": {
54-
"url": "https://github.com/NexGenStudioDev/FastKit/issues"
55-
},
56-
"homepage": "https://github.com/NexGenStudioDev/FastKit#readme",
57-
"publishConfig": {
58-
"access": "public"
12+
"build": "pnpm -r run build",
13+
"rebuild": "pnpm -r run clean && pnpm -r run build",
14+
"lint": "pnpm -r run lint",
15+
"lint:fix": "pnpm -r run lint:fix",
16+
"format": "pnpm -r run format",
17+
"test": "pnpm -r run test",
18+
"test:watch": "pnpm -r run test:watch",
19+
"test:coverage": "pnpm -r run test:coverage",
20+
"sync:versions": "npx npm-check-updates --workspace --dep=prod --upgrade --filter /@nexgenstudiodev/*/",
21+
"sync:dev-versions": "npx npm-check-updates --workspace --dep=dev --upgrade --filter /@nexgenstudiodev/*/",
22+
"sync:all-versions": "pnpm run sync:versions && pnpm run sync:dev-versions",
23+
"publish:all": "pnpm -r publish --access public --no-git-checks",
24+
"postinstall": "pnpm -r run build"
5925
},
60-
"packageManager": "pnpm@10.12.1",
6126
"devDependencies": {
62-
"@babel/core": "^7.27.7",
63-
"@babel/preset-env": "^7.27.2",
64-
"@eslint/js": "^9.29.0",
65-
"@jest/globals": "^30.0.3",
66-
"@types/express": "^5.0.3",
67-
"@types/jest": "^30.0.0",
68-
"@types/node": "^24.0.4",
6927
"@typescript-eslint/eslint-plugin": "^8.35.0",
7028
"@typescript-eslint/parser": "^8.35.0",
71-
"babel-jest": "^30.0.2",
29+
"@types/jest": "^30.0.0",
30+
"@types/node": "^24.0.4",
7231
"eslint": "^9.29.0",
7332
"eslint-config-prettier": "^10.1.5",
7433
"eslint-plugin-prettier": "^5.5.1",
75-
"globals": "^16.2.0",
76-
"husky": "^9.1.7",
77-
"i": "^0.3.7",
7834
"jest": "^30.0.3",
7935
"lint-staged": "^16.1.2",
8036
"prettier": "^3.6.2",
@@ -83,13 +39,15 @@
8339
"ts-node-dev": "^2.0.0",
8440
"tsc-alias": "^1.8.16",
8541
"tsconfig-paths": "^4.2.0",
86-
"typescript": "^5.8.3",
87-
"typescript-eslint": "^8.35.0"
42+
"typescript": "^5.8.3"
43+
},
44+
"lint-staged": {
45+
"packages/**/*.{ts,tsx}": [
46+
"eslint --fix",
47+
"prettier --write"
48+
]
8849
},
89-
"dependencies": {
90-
"@types/dotenv": "^8.2.3",
91-
"dotenv": "^16.6.0",
92-
"express": "^5.1.0",
93-
"zod": "^3.25.67"
50+
"engines": {
51+
"pnpm": ">=8.0.0"
9452
}
9553
}

0 commit comments

Comments
 (0)