Skip to content

Commit

Permalink
Fix NPM + Publint scripts (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
MacFJA authored Aug 4, 2024
1 parent 58dadaa commit 0204ad8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/updateNpm.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ writeFileSync('src/lib/data/npm.json', JSON.stringify(output));

/** @param {import('zod').infer<typeof packagesSchema>[0]} pkg */
async function processPackage(pkg) {
if (!('npm' in pkg)) {
return {};
}
const { stdout } = await execAsync(`npm view ${pkg.npm} --json`);
const data = JSON.parse(stdout.toString());
const version = data.version;
Expand Down
3 changes: 3 additions & 0 deletions scripts/updatePublint.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import { chunk } from './chunk.js';
const injectVersions = (input) => {
const output = [];
for (const item of input) {
if (!('npm' in item)) {
continue;
}
/** @type {string} */
const version = npm[item.npm]?.version;
if (version) {
Expand Down

0 comments on commit 0204ad8

Please sign in to comment.