@backstage/config-loader
Advanced tools
Comparing version 0.0.0-nightly-20241217023754 to 0.0.0-nightly-20241221023113
# @backstage/config-loader | ||
## 0.0.0-nightly-20241217023754 | ||
## 0.0.0-nightly-20241221023113 | ||
### Patch Changes | ||
- 8ecf8cb: Exclude `@backstage/backend-common` from schema collection if `@backstage/backend-defaults` is present | ||
- Updated dependencies | ||
- @backstage/cli-common@0.1.15 | ||
- @backstage/config@1.3.1 | ||
- @backstage/errors@1.2.6 | ||
- @backstage/types@1.2.0 | ||
## 1.9.3 | ||
### Patch Changes | ||
- 5c9cc05: Use native fetch instead of node-fetch | ||
- Updated dependencies | ||
- @backstage/errors@0.0.0-nightly-20241217023754 | ||
- @backstage/errors@1.2.6 | ||
- @backstage/cli-common@0.1.15 | ||
- @backstage/config@0.0.0-nightly-20241217023754 | ||
- @backstage/config@1.3.1 | ||
- @backstage/types@1.2.0 | ||
@@ -13,0 +24,0 @@ |
@@ -71,8 +71,9 @@ 'use strict'; | ||
if (isDts) { | ||
tsSchemaPaths.push( | ||
path.relative( | ||
tsSchemaPaths.push({ | ||
path: path.relative( | ||
currentDir, | ||
path.resolve(path.dirname(pkgPath), pkg.configSchema) | ||
) | ||
); | ||
), | ||
packageName: pkg.name | ||
}); | ||
} else { | ||
@@ -82,2 +83,3 @@ const path$1 = path.resolve(path.dirname(pkgPath), pkg.configSchema); | ||
schemas.push({ | ||
packageName: pkg.name, | ||
value, | ||
@@ -89,2 +91,3 @@ path: path.relative(currentDir, path$1) | ||
schemas.push({ | ||
packageName: pkg.name, | ||
value: pkg.configSchema, | ||
@@ -106,25 +109,37 @@ path: path.relative(currentDir, pkgPath) | ||
const tsSchemas = await compileTsSchemas(tsSchemaPaths); | ||
return schemas.concat(tsSchemas); | ||
const allSchemas = schemas.concat(tsSchemas); | ||
const hasBackendDefaults = allSchemas.some( | ||
({ packageName }) => packageName === "@backstage/backend-defaults" | ||
); | ||
if (hasBackendDefaults) { | ||
return allSchemas.filter( | ||
({ packageName }) => packageName !== "@backstage/backend-common" | ||
); | ||
} | ||
return allSchemas; | ||
} | ||
async function compileTsSchemas(paths) { | ||
if (paths.length === 0) { | ||
async function compileTsSchemas(entries) { | ||
if (entries.length === 0) { | ||
return []; | ||
} | ||
const { getProgramFromFiles, buildGenerator } = await import('typescript-json-schema'); | ||
const program = getProgramFromFiles(paths, { | ||
incremental: false, | ||
isolatedModules: true, | ||
lib: ["ES5"], | ||
// Skipping most libs speeds processing up a lot, we just need the primitive types anyway | ||
noEmit: true, | ||
noResolve: true, | ||
skipLibCheck: true, | ||
// Skipping lib checks speeds things up | ||
skipDefaultLibCheck: true, | ||
strict: true, | ||
typeRoots: [], | ||
// Do not include any additional types | ||
types: [] | ||
}); | ||
const tsSchemas = paths.map((path$1) => { | ||
const program = getProgramFromFiles( | ||
entries.map(({ path }) => path), | ||
{ | ||
incremental: false, | ||
isolatedModules: true, | ||
lib: ["ES5"], | ||
// Skipping most libs speeds processing up a lot, we just need the primitive types anyway | ||
noEmit: true, | ||
noResolve: true, | ||
skipLibCheck: true, | ||
// Skipping lib checks speeds things up | ||
skipDefaultLibCheck: true, | ||
strict: true, | ||
typeRoots: [], | ||
// Do not include any additional types | ||
types: [] | ||
} | ||
); | ||
const tsSchemas = entries.map(({ path: path$1, packageName }) => { | ||
let value; | ||
@@ -167,3 +182,3 @@ try { | ||
} | ||
return { path: path$1, value }; | ||
return { path: path$1, value, packageName }; | ||
}); | ||
@@ -170,0 +185,0 @@ return tsSchemas; |
{ | ||
"name": "@backstage/config-loader", | ||
"version": "0.0.0-nightly-20241217023754", | ||
"version": "0.0.0-nightly-20241221023113", | ||
"description": "Config loading functionality used by Backstage backend, and CLI", | ||
@@ -40,4 +40,4 @@ "backstage": { | ||
"@backstage/cli-common": "0.1.15", | ||
"@backstage/config": "0.0.0-nightly-20241217023754", | ||
"@backstage/errors": "0.0.0-nightly-20241217023754", | ||
"@backstage/config": "1.3.1", | ||
"@backstage/errors": "1.2.6", | ||
"@backstage/types": "1.2.0", | ||
@@ -57,4 +57,4 @@ "@types/json-schema": "^7.0.6", | ||
"devDependencies": { | ||
"@backstage/backend-test-utils": "0.0.0-nightly-20241217023754", | ||
"@backstage/cli": "0.0.0-nightly-20241217023754", | ||
"@backstage/backend-test-utils": "0.0.0-nightly-20241221023113", | ||
"@backstage/cli": "0.0.0-nightly-20241221023113", | ||
"@types/json-schema-merge-allof": "^0.6.0", | ||
@@ -61,0 +61,0 @@ "msw": "^1.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
263219
2396
+ Added@backstage/config@1.3.1(transitive)
+ Added@backstage/errors@1.2.6(transitive)
- Removed@backstage/config@0.0.0-nightly-20241217023754(transitive)
- Removed@backstage/errors@0.0.0-nightly-20241217023754(transitive)
Updated@backstage/config@1.3.1
Updated@backstage/errors@1.2.6