Skip to content

Commit e23e73d

Browse files
Merge pull request #5 from NexGenStudioDev/dev
Dev
2 parents 4ad7421 + 49dd84b commit e23e73d

10 files changed

Lines changed: 139 additions & 179 deletions

File tree

.github/workflows/FUNDING.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# FUNDING.yml
2+
3+
github: abhishek-nexgen-dev
4+
buymeacoffee: abhishek96z
5+
open_collective: NexGenStudioDev

.github/workflows/publish.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,22 @@ on:
55
branches:
66
- master
77
tags:
8-
- 'v*' # Optional: run on version tags like v1.0.0
8+
- 'v*' # optional: publish on version tags like v1.0.0
99

1010
jobs:
1111
publish:
12-
name: Publish to npm
1312
runs-on: ubuntu-latest
1413
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
1514

1615
steps:
1716
- name: Checkout code
1817
uses: actions/checkout@v4
1918

20-
- name: Use Node.js 18
19+
- name: Setup Node.js 18
2120
uses: actions/setup-node@v4
2221
with:
2322
node-version: 18
24-
registry-url: 'https://registry.npmjs.org/'
23+
registry-url: https://registry.npmjs.org/
2524

2625
- name: Setup pnpm
2726
uses: pnpm/action-setup@v2
@@ -37,16 +36,10 @@ jobs:
3736
# - name: Run tests (optional)
3837
# run: pnpm test
3938

40-
- name: Authenticate with npm
39+
- name: Authenticate to npm
4140
run: npm config set //registry.npmjs.org/:_authToken=${NPM_TOKEN}
4241
env:
4342
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4443

45-
# Optional: Authenticate with GitHub Packages
46-
# - name: Authenticate with GitHub Packages
47-
# run: npm config set //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
48-
# env:
49-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
5144
- name: Publish to npm
52-
run: pnpm publish --access public
45+
run: pnpm publish --access public --no-git-checks

.npmignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ tsconfig*.json
1010
jest.config.*
1111
*.test.*
1212
*.spec.*
13-
__tests__/
14-
test/
15-
tests/
13+
1614

1715
# Documentation (except README)
1816
docs/
@@ -22,7 +20,6 @@ CHANGELOG.md
2220
# Git files
2321
.git/
2422
.gitignore
25-
.env
2623
Environment/
2724

2825
# CI/CD

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
registry=https://registry.npmjs.org/
2+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
3+
save-prefix=^

.pnpmfile.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// pnpmfile.mjs
2+
export const hooks = {
3+
updateConfig(config) {
4+
return {
5+
...config,
6+
shamefullyHoist: false,
7+
strictPeerDependencies: false,
8+
autoInstallPeers: true,
9+
saveExact: false,
10+
savePrefix: '^',
11+
nodeLinker: 'isolated',
12+
preferWorkspacePackages: true,
13+
sharedWorkspaceLockfile: true,
14+
publishBranch: 'master',
15+
gitChecks: true,
16+
}
17+
},
18+
}

.pnpmrc

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

PACKAGE_MANAGERS.md

Lines changed: 98 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,150 @@
11
# FastKit - Package Manager Usage Guide
22

3-
This document explains how to use FastKit with both npm and pnpm package managers.
3+
**FastKit** is a development toolkit that supports both `npm` and `pnpm` for installation, development, and publishing workflows.
44

5-
## Installation
5+
📦 Available on npm:
6+
[@nexgenstudiodev/fastkit](https://www.npmjs.com/package/@nexgenstudiodev/fastkit)
7+
8+
---
9+
10+
## 📥 Installation
611

712
### Using npm
813
```bash
9-
npm install @abhishek-nexgen-dev/fastkit
14+
npm install @nexgenstudiodev/fastkit
1015
```
1116

12-
### Using pnpm
13-
```bash
14-
pnpm add @abhishek-nexgen-dev/fastkit
15-
```
1617

17-
### Using yarn
18+
### Using npm
19+
1820
```bash
19-
yarn add @abhishek-nexgen-dev/fastkit
21+
pnpm add @nexgenstudiodev/fastkit
2022
```
2123

22-
## Development Scripts
24+
### Using yarn
2325

24-
### For npm users
2526
```bash
26-
# Install dependencies
27-
npm install
28-
29-
# Build the project
30-
npm run build
31-
32-
# Clean build artifacts
33-
npm run clean
34-
35-
# Rebuild (clean + build)
36-
npm run rebuild
37-
38-
# Start development server
39-
npm run start:dev
27+
yarn add @nexgenstudiodev/fastkit
28+
```
4029

41-
# Format code
42-
npm run format
4330

44-
# Lint code
45-
npm run lint
31+
# 🔧 Development Scripts
4632

47-
# Fix linting issues
48-
npm run lint:fix
33+
The following scripts are available via `npm run <script>` or `pnpm run <script>`:
4934

50-
# Publish to npm
51-
npm run publish:npm
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 |
5254

53-
# Version bumping
54-
npm run version:patch
55-
npm run version:minor
56-
npm run version:major
57-
```
55+
---
5856

59-
### For pnpm users
60-
```bash
61-
# Install dependencies
62-
pnpm install
57+
# 🚀 Publishing Workflow
6358

64-
# Build the project
65-
pnpm run build
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`
6666

67-
# Clean build artifacts
68-
pnpm run clean
67+
### 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`
6974

70-
# Rebuild (clean + build) - pnpm optimized
71-
pnpm run rebuild:pnpm
75+
---
7276

73-
# Start development server
74-
pnpm run start:dev
77+
# ⚙️ Configuration Files
7578

76-
# Format code
77-
pnpm run format
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) |
7886

79-
# Lint code
80-
pnpm run lint
87+
---
8188

82-
# Fix linting issues
83-
pnpm run lint:fix
89+
# ✅ Best Practices
8490

85-
# Publish to npm
86-
pnpm run publish:pnpm
91+
- Use a single package manager throughout your project
92+
- 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**
8796

88-
# Version bumping (still uses npm for version management)
89-
npm run version:patch
90-
npm run version:minor
91-
npm run version:major
92-
```
97+
---
9398

94-
## Publishing Workflow
99+
# 📊 Package Manager Comparison
95100

96-
### Using npm
97-
1. Make your changes
98-
2. Run tests: `npm test`
99-
3. Build: `npm run build`
100-
4. Bump version: `npm run version:patch` (or minor/major)
101-
5. Publish: `npm run publish:npm`
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 |
102109

103-
### Using pnpm
104-
1. Make your changes
105-
2. Run tests: `pnpm test`
106-
3. Build: `pnpm run build`
107-
4. Bump version: `npm run version:patch` (or minor/major)
108-
5. Publish: `pnpm run publish:pnpm`
109110

110-
## Configuration Files
111+
# 🛠️ Troubleshooting
111112

112-
- **package.json**: Main package configuration (works with both)
113-
- **.pnpmrc**: pnpm-specific configuration
114-
- **.npmignore**: Files to exclude from npm package
115-
- **pnpm-lock.yaml**: pnpm lockfile (auto-generated)
116-
- **package-lock.json**: npm lockfile (auto-generated)
113+
## Common Issues
117114

118-
## Best Practices
115+
### Mixed lockfiles
116+
Delete both `pnpm-lock.yaml` and `package-lock.json`, then reinstall dependencies.
119117

120-
1. **Choose one package manager** for your project and stick with it
121-
2. **Commit lockfiles** to ensure reproducible builds
122-
3. **Use the correct scripts** for your chosen package manager
123-
4. **Version management** should use npm commands regardless of package manager
124-
5. **Publishing** can use either npm or pnpm commands
118+
### Permission errors
119+
Use `npm login` or configure your npm registry properly.
125120

126-
## Package Manager Comparison
121+
### Version conflicts
122+
Bump the version before attempting to publish.
127123

128-
| Feature | npm | pnpm |
129-
|---------|-----|------|
130-
| Speed | Moderate | Fast |
131-
| Disk Usage | High | Low (symlinks) |
132-
| Node Modules | Full copy | Symlinked |
133-
| Lockfile | package-lock.json | pnpm-lock.yaml |
134-
| Workspace Support |||
135-
| Compatibility | Universal | Growing |
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
136130

137-
## Troubleshooting
138131

139-
### Common Issues
132+
```bash
133+
npm run clean
134+
npm run build
135+
```
140136

141-
1. **Mixed lockfiles**: Delete both lockfiles and reinstall with your chosen package manager
142-
2. **Permission errors**: Use `npm login` or configure registry authentication
143-
3. **Version conflicts**: Ensure version is bumped before publishing
144-
4. **Build errors**: Run `npm run clean` then `npm run build`
145137

146138
### Environment Setup
147139

140+
148141
```bash
149142
# Check versions
150143
node --version
151144
npm --version
152145
pnpm --version
153146

154-
# Configure npm registry (if needed)
147+
# Configure registries
155148
npm config set registry https://registry.npmjs.org/
156-
157-
# Configure pnpm registry (if needed)
158149
pnpm config set registry https://registry.npmjs.org/
159-
```
160-
161-
## Links
162-
163-
- [npm Documentation](https://docs.npmjs.com/)
164-
- [pnpm Documentation](https://pnpm.io/)
165-
- [Package on npm](https://www.npmjs.com/package/@abhishek-nexgen-dev/fastkit)
166-
- [GitHub Repository](https://github.com/NexGenStudioDev/FastKit)
150+
```

0 commit comments

Comments
 (0)