Skip to content

Commit f051aef

Browse files
feat: Remove deprecated funding and publish workflows, update package manager documentation
1 parent bfce2a4 commit f051aef

9 files changed

Lines changed: 267 additions & 137 deletions

File tree

PACKAGE_MANAGERS.md

Lines changed: 178 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -14,120 +14,157 @@
1414
npm install @nexgenstudiodev/fastkit
1515
```
1616

17-
18-
### Using npm
19-
17+
### Using pnpm
2018
```bash
2119
pnpm add @nexgenstudiodev/fastkit
2220
```
23-
2421
### Using yarn
2522

2623
```bash
2724
yarn add @nexgenstudiodev/fastkit
2825
```
2926

3027

31-
# 🔧 Development Scripts
28+
## 🔧 Development Scripts
3229

3330
The following scripts are available via `npm run <script>` or `pnpm run <script>`:
3431

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

55-
---
5652

57-
# 🚀 Publishing Workflow
5853

59-
### Using npm
60-
1. Make your changes
61-
2. Run tests: `npm test`
62-
3. Build the project: `npm run build`
63-
4. Bump version:
64-
- `npm run version:patch` (or use `version:minor` / `version:major`)
65-
5. Publish: `npm run publish:npm`
54+
55+
### 🚀 Publishing Workflow
56+
57+
58+
#### Using npm
59+
60+
1. Make your changes
61+
2. Run tests:
62+
63+
```bash
64+
npm test
65+
```
66+
3. Build the project:
67+
68+
```bash
69+
npm run build
70+
```
71+
72+
4. Bump version (choose one):
73+
74+
```bash
75+
npm run version:patch
76+
npm run version:minor
77+
npm run version:major
78+
```
79+
80+
5. Publish package:
81+
82+
```bash
83+
npm run publish:npm
84+
```
6685

6786
### Using pnpm
68-
1. Make your changes
69-
2. Run tests: `pnpm test`
70-
3. Build the project: `pnpm run build`
71-
4. Bump version:
72-
- `npm run version:patch` (or use `version:minor` / `version:major`)
73-
5. Publish: `pnpm run publish:pnpm`
87+
1. Make your changes
88+
2. Run tests:
7489

75-
---
90+
```bash
91+
pnpm test
92+
```
93+
94+
3. Build the project:
95+
96+
```bash
97+
pnpm run build
98+
```
99+
100+
4. Bump version (choose one):
101+
102+
````bash
103+
npm run version:patch
104+
npm run version:minor
105+
npm run version:major
106+
````
107+
108+
5. Publish:
109+
110+
````bash
111+
pnpm run publish:pnpm
112+
````
76113

77-
# ⚙️ Configuration Files
114+
## ⚙️ Configuration Files
78115

79-
| File | Description |
80-
|------------------|---------------------------------|
81-
| `package.json` | Project configuration (shared) |
82-
| `.pnpmrc` | pnpm-specific config |
83-
| `.npmignore` | Exclude files from npm package |
84-
| `pnpm-lock.yaml` | pnpm lockfile (auto-generated) |
85-
| `package-lock.json` | npm lockfile (auto-generated) |
116+
| File | Description |
117+
|--------------------|---------------------------------|
118+
| `package.json` | Project configuration (shared) |
119+
| `.pnpmrc` | pnpm-specific configuration |
120+
| `.npmignore` | Files to exclude from npm package|
121+
| `pnpm-lock.yaml` | pnpm lockfile (auto-generated) |
122+
| `package-lock.json` | npm lockfile (auto-generated) |
86123

87124
---
88125

89-
# ✅ Best Practices
126+
## ✅ Best Practices
90127

91128
- Use a single package manager throughout your project
92129
- Commit lockfiles to ensure consistent builds
93-
- Use correct CLI scripts based on your manager
94-
- Use npm for version management
95-
- Use either npm or pnpm to publish, **not both**
130+
- Use the correct CLI scripts based on your package manager
131+
- Use **npm** for version management
132+
- Use either **npm** or **pnpm** to publish — do not mix both
96133

97134
---
98135

99-
# 📊 Package Manager Comparison
136+
## 📊 Package Manager Comparison
100137

101-
| Feature | npm | pnpm |
102-
|-----------------|------------|--------------|
103-
| Speed | Moderate | Fast |
104-
| Disk Usage | High | Low |
105-
| Node Modules | Full copy | Symlinked |
106-
| Lockfile | package-lock.json | pnpm-lock.yaml |
107-
| Workspace Support |||
108-
| Compatibility | Universal | Growing |
138+
| Feature | npm | pnpm |
139+
|-------------------|--------------|----------------|
140+
| Speed | Moderate | Fast |
141+
| Disk Usage | High | Low |
142+
| Node Modules | Full copy | Symlinked |
143+
| Lockfile | package-lock.json | pnpm-lock.yaml |
144+
| Workspace Support | | |
145+
| Compatibility | Universal | Growing |
109146

147+
---
110148

111-
# 🛠️ Troubleshooting
112-
113-
## Common Issues
149+
## 🛠️ Troubleshooting
114150

115-
### Mixed lockfiles
116-
Delete both `pnpm-lock.yaml` and `package-lock.json`, then reinstall dependencies.
151+
### Common Issues
117152

118-
### Permission errors
119-
Use `npm login` or configure your npm registry properly.
153+
- **Mixed lockfiles**
154+
Delete both `pnpm-lock.yaml` and `package-lock.json`, then reinstall dependencies.
120155

121-
### Version conflicts
122-
Bump the version before attempting to publish.
156+
- **Permission errors**
157+
Use `npm login` or configure your npm registry properly.
123158

124-
### Build errors
125-
Try:
126-
- Checking for syntax errors or missing dependencies
127-
- Deleting `node_modules` and reinstalling packages
128-
- Ensuring your TypeScript configuration is correct
129-
- Running `npm run clean` before building again
159+
- **Version conflicts**
160+
Bump the version before attempting to publish.
130161

162+
- **Build errors**
163+
Try the following:
164+
- Check for syntax errors or missing dependencies
165+
- Delete `node_modules` and reinstall packages
166+
- Ensure your TypeScript configuration is correct
167+
- Run `npm run clean` before building again
131168

132169
```bash
133170
npm run clean
@@ -137,7 +174,6 @@ npm run build
137174

138175
### Environment Setup
139176

140-
141177
```bash
142178
# Check versions
143179
node --version
@@ -147,4 +183,68 @@ pnpm --version
147183
# Configure registries
148184
npm config set registry https://registry.npmjs.org/
149185
pnpm config set registry https://registry.npmjs.org/
150-
```
186+
187+
```
188+
189+
## 🔑 Authentication and Token Management
190+
191+
### Using Git Credential Manager
192+
193+
Git Credential Manager securely stores your GitHub and npm tokens, so you don’t have to enter them repeatedly.
194+
195+
- **Windows:**
196+
It comes bundled with [Git for Windows](https://git-scm.com/download/win).
197+
198+
- **macOS / Linux:**
199+
Install Git Credential Manager via your package manager or from the official releases:
200+
- For macOS (using Homebrew):
201+
```bash
202+
brew install --cask git-credential-manager-core
203+
```
204+
- For Linux, follow instructions here:
205+
[https://aka.ms/gcm/linux](https://aka.ms/gcm/linux)
206+
207+
### Configuration
208+
209+
Once installed, you can enable Git Credential Manager by running:
210+
```bash
211+
git-credential-manager-core configure
212+
```
213+
214+
215+
### Setting NPM Token in .npmrc
216+
217+
```bash
218+
registry=https://registry.npmjs.org/
219+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
220+
save-prefix=^
221+
222+
```
223+
224+
- Set your NPM_TOKEN as an environment variable in your shell or CI environment:
225+
226+
```bash
227+
export NPM_TOKEN=your_actual_token_here
228+
```
229+
230+
## 📦 Downloading and Using the Package
231+
232+
After installation, import FastKit modules in your code:
233+
234+
```typescript
235+
import { fastKitConfig } from '@nexgenstudiodev/fastkit/config';
236+
```
237+
238+
Or simply require if using CommonJS:
239+
240+
```ts
241+
const { fastKitConfig } = require('@nexgenstudiodev/fastkit/config');
242+
```
243+
244+
## 🤝 Contribution and Support
245+
246+
We welcome contributions! Feel free to submit pull requests or open issues on the [GitHub repository]().
247+
248+
For support or questions, please open an issue or reach out to the maintainers directly.
249+
250+
Happy coding with FastKit! 🚀

src/FastKit.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export { default as fastKitConfig } from './config/FastKit-Config/FastKit.config';
22
export { setup_FastKit_EnvFiles } from './config/FastKit-Config/env.manager';
3-
Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
11
import { config } from 'dotenv';
2-
import express, { Express , RequestHandler } from 'express';
2+
import express, { Express, RequestHandler } from 'express';
33
import * as path from 'path';
44
config({ path: path.join(process.cwd(), '.env') });
55

6-
76
class FastKit {
87
public expressApp: Express;
98

10-
constructor( expressApp?: Express) {
11-
9+
constructor(expressApp?: Express) {
1210
this.expressApp = expressApp || express();
13-
1411
}
1512

16-
// Express route methods
17-
public get(path: string, handler: RequestHandler): void {
18-
this.expressApp.get(path, handler);
19-
}
13+
// Express route methods
14+
public get(path: string, handler: RequestHandler): void {
15+
this.expressApp.get(path, handler);
16+
}
2017

21-
public post(path: string, handler: RequestHandler): void {
22-
this.expressApp.post(path, handler);
23-
}
18+
public post(path: string, handler: RequestHandler): void {
19+
this.expressApp.post(path, handler);
20+
}
2421

25-
public put(path: string, handler: RequestHandler): void {
26-
this.expressApp.put(path, handler);
27-
}
22+
public put(path: string, handler: RequestHandler): void {
23+
this.expressApp.put(path, handler);
24+
}
2825

29-
public delete(path: string, handler: RequestHandler): void {
30-
this.expressApp.delete(path, handler);
31-
}
26+
public delete(path: string, handler: RequestHandler): void {
27+
this.expressApp.delete(path, handler);
28+
}
3229

33-
public use(...args: Parameters<Express['use']>): void {
30+
public use(...args: Parameters<Express['use']>): void {
3431
this.expressApp.use(...args);
3532
}
3633

@@ -39,5 +36,4 @@ public use(...args: Parameters<Express['use']>): void {
3936
}
4037
}
4138

42-
43-
export default FastKit;
39+
export default FastKit;

src/config/FastKit-Config/env.manager.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ function CreateFastKit_EnvFiles(): void {
104104
const cwd = process.cwd();
105105
const baseEnv = path.join(cwd, '.env.fastkit');
106106

107-
108107
// Step 1: create .env if it doesn't exist
109108
if (!fs.existsSync(baseEnv)) {
110109
const demoContent = buildDemoEnv();
@@ -113,12 +112,9 @@ function CreateFastKit_EnvFiles(): void {
113112
}
114113

115114
// Step 2: read .env
116-
fs.readFileSync(baseEnv, 'utf8');
117-
118-
115+
fs.readFileSync(baseEnv, 'utf8');
119116

120117
console.log(`✅ Generated .env.production and .env.test`);
121118
}
122119

123120
export { CreateFastKit_EnvFiles as setup_FastKit_EnvFiles };
124-

0 commit comments

Comments
 (0)