Skip to content
Merged
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
9 changes: 8 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,12 @@ jobs:
registry-url: 'https://registry.npmjs.org'
node-version: lts/*

- name: 📦 Pack package
run: nix develop --command pnpm pack

- name: 🚀 Publish package
run: nix develop --command pnpm publish --provenance --no-git-checks --access public
shell: bash
run: |
PACKAGE_TGZ=$(ls *.tgz | head -n 1)
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

Missing error handling if no .tgz file is found. The script should verify that PACKAGE_TGZ is not empty before attempting to publish, otherwise npm publish will fail with a confusing error message.

Suggested change
PACKAGE_TGZ=$(ls *.tgz | head -n 1)
PACKAGE_TGZ=$(ls *.tgz | head -n 1)
if [ -z "$PACKAGE_TGZ" ]; then
echo "Error: No .tgz package file found to publish."
exit 1
fi

Copilot uses AI. Check for mistakes.
echo "Publishing package: $PACKAGE_TGZ"
npm publish "$PACKAGE_TGZ" --access public
Comment on lines +50 to +52
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

Using ls to capture filenames is fragile and can break with unexpected filenames or when no .tgz files exist. Use shell globbing with array assignment instead: PACKAGE_TGZ=(*.tgz) and then reference ${PACKAGE_TGZ[0]}.

Suggested change
PACKAGE_TGZ=$(ls *.tgz | head -n 1)
echo "Publishing package: $PACKAGE_TGZ"
npm publish "$PACKAGE_TGZ" --access public
PACKAGE_TGZ=( *.tgz )
echo "Publishing package: ${PACKAGE_TGZ[0]}"
npm publish "${PACKAGE_TGZ[0]}" --access public

Copilot uses AI. Check for mistakes.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
nodejs_24
pnpm_10
nixfmt-rfc-style
];
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"lint:oxfmt": "oxfmt --no-error-on-unmatched-pattern --check .",
"lint:oxlint": "oxlint --max-warnings=0 --type-aware --type-check",
"lint:knip": "knip",
"preinstall": "npx only-allow pnpm",
"prepack": "npm pkg delete scripts.preinstall && pnpm run build",
"test": "vitest",
"coverage": "vitest run --coverage"
Expand Down
Loading