Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,22 @@ on:
branches:
- master
tags:
- 'v*' # Optional: run on version tags like v1.0.0
- 'v*' # optional: publish on version tags like v1.0.0

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

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js 18
- name: Setup Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org/'
registry-url: https://registry.npmjs.org/

- name: Setup pnpm
uses: pnpm/action-setup@v2
Expand All @@ -37,16 +36,10 @@ jobs:
# - name: Run tests (optional)
# run: pnpm test

- name: Authenticate with npm
- name: Authenticate to npm
run: npm config set //registry.npmjs.org/:_authToken=${NPM_TOKEN}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

# Optional: Authenticate with GitHub Packages
# - name: Authenticate with GitHub Packages
# run: npm config set //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to npm
run: pnpm publish --access public
run: pnpm publish --access public --no-git-checks
5 changes: 1 addition & 4 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ tsconfig*.json
jest.config.*
*.test.*
*.spec.*
__tests__/
test/
tests/


# Documentation (except README)
docs/
Expand All @@ -22,7 +20,6 @@ CHANGELOG.md
# Git files
.git/
.gitignore
.env
Environment/

# CI/CD
Expand Down
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
save-prefix=^
18 changes: 18 additions & 0 deletions .pnpmfile.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// pnpmfile.mjs
export const hooks = {
updateConfig(config) {
return {
...config,
shamefullyHoist: false,
strictPeerDependencies: false,
autoInstallPeers: true,
saveExact: false,
savePrefix: '^',
nodeLinker: 'isolated',
preferWorkspacePackages: true,
sharedWorkspaceLockfile: true,
publishBranch: 'master',
gitChecks: false,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Disabling gitChecks globally is risky as it allows publishing from a dirty working directory, which could lead to uncommitted or experimental code being published accidentally. It's safer to keep this enabled by default and use the --no-git-checks flag for specific commands when necessary, as you've done in package.json.

      gitChecks: true,

}
},
}
24 changes: 0 additions & 24 deletions .pnpmrc

This file was deleted.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@abhishek-nexgen-dev/fastkit",
"name": "@nexgenstudiodev/fastkit",
"type": "commonjs",
"version": "1.0.1",
"version": "1.0.0",
"description": "A modular, class-based toolkit for fast API development with TypeScript and Express.",
"main": "dist/FastKit.js",
"types": "dist/FastKit.d.ts",
Expand All @@ -20,8 +20,8 @@
"start:dev": "ts-node-dev --respawn --transpile-only src/FastKit.ts",
"format": "prettier --write 'src/**/*.{ts,tsx,js,json,md}'",
"prepublishOnly": "npm run format && npm run lint && npm run build",
"publish:npm": "npm publish --access public",
"publish:pnpm": "pnpm publish --access public",
"publish:npm": "npm publish --access public",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This line has a leading space, which makes the package.json file invalid JSON. This will cause parsing errors for package managers and other tools. Please remove the leading space.

    "publish:npm": "npm publish --access public",

"publish:pnpm": "pnpm publish --access public --no-git-checks",
"version:patch": "npm version patch",
"version:minor": "npm version minor",
"version:major": "npm version major",
Expand Down