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
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@dfinity/identity": "^2.3.0",
"@dfinity/principal": "^2.3.0",
"@junobuild/admin": "^0.1.6",
"@junobuild/cli-tools": "^0.1.7",
"@junobuild/cli-tools": "^0.1.7-next-2025-04-05.2",
"@junobuild/config-loader": "^0.2.0",
"@junobuild/core": "^0.1.9",
"@junobuild/did-tools": "^0.2.0",
Expand Down
14 changes: 6 additions & 8 deletions src/services/build/build.javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const prepareMetadata = async (): Promise<BuildMetadata> => {
}

try {
const {juno, version} = await readPackageJson();
const {juno, version, name} = await readPackageJson();

if (isEmptyString(juno?.functions?.version) && isEmptyString(version)) {
// No version detected therefore no metadata to the build in the container.
Expand All @@ -135,14 +135,13 @@ const prepareMetadata = async (): Promise<BuildMetadata> => {
const functionsVersion = juno?.functions?.version;

return {
...(notEmptyString(name) && {name}),
...(notEmptyString(version) && {version}),
...(notEmptyString(functionsVersion) && {juno})
};
} catch (_err: unknown) {
// We want to continue the build process even if copying package.json fails,
// since it's only used to set the extended custom version.
console.log('⚠️ Could not read build metadata from package.json.');
return undefined;
console.log(red('⚠️ Could not read build metadata from package.json.'));
process.exit(1);
}
};

Expand All @@ -155,9 +154,8 @@ const copyMetadata = async (metadata: BuildMetadata): Promise<void> => {
try {
await writeFile(PACKAGE_JSON_SPUTNIK_PATH, JSON.stringify(metadata, null, 2), 'utf-8');
} catch (_err: unknown) {
// We want to continue the build process even if copying package.json fails,
// since it's only used to set the extended custom version.
console.log('⚠️ Could not copy package.json for the build.');
console.log(red('⚠️ Could not copy package.json metadata for the build.'));
process.exit(1);
}
};

Expand Down