Skip to content

Commit

Permalink
Use package.json "name" field to determine the output .nro file name
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Nov 8, 2024
1 parent f918c75 commit 58b3785
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/orange-readers-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nx.js/nro": patch
---

Use `package.json` "name" field to determine the output `.nro` file name
8 changes: 5 additions & 3 deletions packages/nro/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ console.log(await terminalImage.buffer(logoBuf, { height: 18 }));

// NACP
const nacp = new NACP(await nxjsNro.nacp!.arrayBuffer());
const packageJson = patchNACP(nacp, new URL('package.json', appRoot));
console.log();
console.log(chalk.bold('Setting metadata:'));
patchNACP(nacp, new URL('package.json', appRoot));
console.log(` ID: ${chalk.green(nacp.id.toString(16).padStart(16, '0'))}`);
console.log(` Title: ${chalk.green(nacp.title)}`);
console.log(` Version: ${chalk.green(nacp.version)}`);
Expand Down Expand Up @@ -100,7 +100,7 @@ try {
if (err.code !== 'ENOENT') throw err;
}

const outputNroName = `${nacp.title}.nro`;
const outputNroName = `${packageJson.name}.nro`;

if (!(romfs['main.js'] instanceof Blob)) {
console.log();
Expand All @@ -113,7 +113,9 @@ if (!(romfs['main.js'] instanceof Blob)) {
);
console.log(
chalk.yellow(
`The entrypoint file ${chalk.bold(`"${nacp.title}.js"`)} will need to`,
`The entrypoint file ${chalk.bold(
`"${packageJson.name}.js"`,
)} will need to`,
),
);
console.log(
Expand Down

0 comments on commit 58b3785

Please sign in to comment.