Skip to content

Commit 92d0df9

Browse files
feat: Update publish workflow and configuration files for improved npm publishing
1 parent 9704d30 commit 92d0df9

6 files changed

Lines changed: 31 additions & 44 deletions

File tree

.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: false,
16+
}
17+
},
18+
}

.pnpmrc

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

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@abhishek-nexgen-dev/fastkit",
2+
"name": "@nexgenstudiodev/fastkit",
33
"type": "commonjs",
4-
"version": "2.0.0",
4+
"version": "1.0.0",
55
"description": "A modular, class-based toolkit for fast API development with TypeScript and Express.",
66
"main": "dist/FastKit.js",
77
"types": "dist/FastKit.d.ts",
@@ -20,8 +20,8 @@
2020
"start:dev": "ts-node-dev --respawn --transpile-only src/FastKit.ts",
2121
"format": "prettier --write 'src/**/*.{ts,tsx,js,json,md}'",
2222
"prepublishOnly": "npm run format && npm run lint && npm run build",
23-
"publish:npm": "npm publish --access public",
24-
"publish:pnpm": "pnpm publish --access public",
23+
"publish:npm": "npm publish --access public",
24+
"publish:pnpm": "pnpm publish --access public --no-git-checks",
2525
"version:patch": "npm version patch",
2626
"version:minor": "npm version minor",
2727
"version:major": "npm version major",

0 commit comments

Comments
 (0)