From 8a10a5a80b5e5fd1dcfe0599eafe3f02c49c8fbb Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Sun, 16 Aug 2026 12:40:16 +0200 Subject: [PATCH 1/2] wip Signed-off-by: Jan Kowalleck --- tools/src/main/js/bundler/bundle-schemas.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/src/main/js/bundler/bundle-schemas.js b/tools/src/main/js/bundler/bundle-schemas.js index 4e947307..71e4167e 100644 --- a/tools/src/main/js/bundler/bundle-schemas.js +++ b/tools/src/main/js/bundler/bundle-schemas.js @@ -342,7 +342,9 @@ async function bundleSchemas(modelsDirectory, rootSchemaPath, options = {}) { } } + // Write bundled (pretty) version + // TODO: set schema name console.log('\nWriting bundled schema...'); const prettyJson = JSON.stringify(finalSchema, null, 2); await fs.writeFile(bundledPath, prettyJson); @@ -351,6 +353,7 @@ async function bundleSchemas(modelsDirectory, rootSchemaPath, options = {}) { console.log(`✓ Bundled schema: ${bundledFilename} (${bundledSizeKB} KB)`); // Write minified version + // TODO: set schema name console.log('Writing minified schema...'); const minifiedSchema = removeComments(finalSchema, true); const minifiedJson = JSON.stringify(minifiedSchema); @@ -397,4 +400,4 @@ if (require.main === module) { .catch(err => process.exit(1)); } -module.exports = { bundleSchemas }; \ No newline at end of file +module.exports = { bundleSchemas }; From 427cef7d3c936f026235a87a65402e2877259832 Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Sun, 16 Aug 2026 13:14:33 +0200 Subject: [PATCH 2/2] chore(bundler): fix bundledresult schema ids matching file name Signed-off-by: Jan Kowalleck --- tools/src/main/js/bundler/bundle-schemas.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/src/main/js/bundler/bundle-schemas.js b/tools/src/main/js/bundler/bundle-schemas.js index 71e4167e..9143c2b4 100644 --- a/tools/src/main/js/bundler/bundle-schemas.js +++ b/tools/src/main/js/bundler/bundle-schemas.js @@ -344,19 +344,23 @@ async function bundleSchemas(modelsDirectory, rootSchemaPath, options = {}) { // Write bundled (pretty) version - // TODO: set schema name console.log('\nWriting bundled schema...'); - const prettyJson = JSON.stringify(finalSchema, null, 2); + const prettyJson = JSON.stringify({ + ...finalSchema, + "$id": new URL(bundledFilename, finalSchema['$id']).toString() + }, null, 2); await fs.writeFile(bundledPath, prettyJson); const bundledStats = await fs.stat(bundledPath); const bundledSizeKB = (bundledStats.size / 1024).toFixed(2); console.log(`✓ Bundled schema: ${bundledFilename} (${bundledSizeKB} KB)`); // Write minified version - // TODO: set schema name console.log('Writing minified schema...'); const minifiedSchema = removeComments(finalSchema, true); - const minifiedJson = JSON.stringify(minifiedSchema); + const minifiedJson = JSON.stringify({ + ...minifiedSchema, + "$id": new URL(minifiedFilename, finalSchema['$id']).toString() + }); // Verify it's a single line const lineCount = minifiedJson.split('\n').length;