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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"node": ">=24"
},
"scripts": {
"build": "pika build",
"build": "pika build && node scripts/fix-package-json.js",
"prerelease": "pnpm install --force && pnpm run lint && pnpm run tsc && pnpm run build",
"release": "npm publish ./pkg",
"lint": "js-tools lint",
Expand Down
21 changes: 21 additions & 0 deletions scripts/fix-package-json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Script to fix the package.json files map. This is needed because npm changed the file matching behavior in npm@9.
// And pika does not support the new behavior.
// @see https://github.com/octokit/plugin-retry.js/issues/405

'use strict';

const fs = require('fs');
const path = require('path');
const { EOL } = require('os');

const pkgPath = path.join(__dirname, '../pkg/package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));

pkg.files = pkg.files.map((file) => {
if (file.endsWith('/')) {
return file + '**';
}
return file;
});

fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + EOL, 'utf8');
Loading