Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
15 changes: 10 additions & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ jobs:
skip-push: "true"
skip-commit: "true"
bump-policy: "ignore"

- name: Setup .npmrc
run: |
echo "@fundwave:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
echo "ignore-scripts=true" >> ~/.npmrc
Comment on lines +61 to +65
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The .npmrc configuration is set up before 'npm ci' but the package still needs to be published. The 'ignore-scripts=true' setting will prevent lifecycle scripts from running during install, but this configuration will also affect the 'npm publish' command later. Consider moving this setup to just before the publish step, or use a more targeted approach like creating a separate .npmrc for publishing.

Copilot uses AI. Check for mistakes.

- name: Install dependencies
run: npm ci
Expand All @@ -72,12 +78,11 @@ jobs:
git config user.name "fundabot"
git commit -a -m "CI: bumps @fundwave/fetch-queue to $VERSION" -m "[skip ci]"

- name: Publish package to gitlab
env:
GITLAB_TOKEN: ${{secrets.GITLAB_TOKEN}}
- name: Build package
run: npm run build

Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The publish command relies on the .npmrc configured earlier, but there's no explicit '--registry' flag or scope verification. Since the package scope is '@fundwave', ensure the package.json includes '"name": "@fundwave/fetch-queue"' to match the registry configuration. Without proper scoping, the publish may fail or publish to the wrong registry.

Suggested change
- name: Verify package name scope
run: |
PKG_NAME=$(jq -r .name package.json)
if [ "$PKG_NAME" != "@fundwave/fetch-queue" ]; then
echo "Error: package.json name must be '@fundwave/fetch-queue', found '$PKG_NAME'"
exit 1
fi

Copilot uses AI. Check for mistakes.
- name: Publish package to github
run: |
echo @fundwave:registry=https://gitlab.com/api/v4/projects/24877554/packages/npm/ > ~/.npmrc
echo //gitlab.com/api/v4/projects/24877554/packages/npm/:_authToken=$GITLAB_TOKEN >> ~/.npmrc
npm publish --tag $BRANCH_TAG

- name: Publish package to npm
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
},
"scripts": {
"build:esm": "tsc --module NodeNext --outDir ./dist/esm",
"build": "tsc --module commonjs --outDir ./dist/cjs",
"prepare": "npm run build && npm run build:esm",
"build:cjs": "tsc --module commonjs --outDir ./dist/cjs",
"build": "npm run build:cjs && npm run build:esm",
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The removal of the 'prepare' script may cause issues for package consumers. The 'prepare' script automatically runs during 'npm install' and ensures the package is built before use. Without it, developers installing this package from git or using 'npm link' won't have built artifacts available. Consider keeping the 'prepare' script or documenting this breaking change.

Suggested change
"build": "npm run build:cjs && npm run build:esm",
"build": "npm run build:cjs && npm run build:esm",
"prepare": "npm run build",

Copilot uses AI. Check for mistakes.
"pretest": "jest --clearCache",
"test": "jest --detectOpenHandles",
"lint": "npx eslint src/index.ts",
"docs": "npx jsdoc-to-markdown ./src/index.ts --configure ./jsdoc2md.json > DOCUMENTATION.md"
},
"repository": {
"type": "git",
"url": "git+https://github.com/getfundwave/fetch-queue.git"
"url": "git+https://github.com/fundwave/fetch-queue.git"
},
"keywords": [
"js",
Expand All @@ -30,9 +30,9 @@
"author": "The Fundwave Authors",
"license": "MIT",
"bugs": {
"url": "https://github.com/getfundwave/fetch-queue/issues"
"url": "https://github.com/fundwave/fetch-queue/issues"
},
"homepage": "https://github.com/getfundwave/fetch-queue#readme",
"homepage": "https://github.com/fundwave/fetch-queue#readme",
"devDependencies": {
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.2",
Expand Down
Loading