@backstage/cli-node 0.0.0-nightly-20261031021925 → 0.0.0-nightly-20261106022102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,16 +1,30 @@
1
1
  # @backstage/cli-node
2
2
 
3
- ## 0.0.0-nightly-20261031021925
3
+ ## 0.0.0-nightly-20261106022102
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - 4294614: Commands run through `runCli` now exit with the exit code they set, instead of always exiting with `0` on completion. For example, `catalog validate` and `template dry-run` now exit with a non-zero code when the input is invalid.
8
8
  - a96b99c: The Node.js module transform now uses the synchronous `module.registerHooks()` API when it is available, which avoids the `module.register()` deprecation warning printed by Node.js 26. On older Node.js versions it continues to use `module.register()`.
9
+ - 8069934: Fixed the Node.js module transform loading ES module JavaScript files from packages without a `"type"` field as CommonJS, which broke named imports such as `import { DefaultGithubCredentialsProvider } from '@backstage/integration'` during local development. The format of these files is now detected by Node.js, while TypeScript files in such packages are still treated as CommonJS.
10
+ - 04a54e2: Switched the compilation target to ES2024, which all supported Node.js versions fully support. Package builds, app bundles, and the backend development server now compile code for ES2024, and the TypeScript `target` and `lib` options in `@backstage/cli/config/tsconfig.json` are set to `ES2024`. This requires TypeScript 5.9 or later, which is now the oldest supported version according to the [versioning policy](https://backstage.io/docs/overview/versioning-policy#typescript-releases).
11
+
12
+ The `lib` change allows code to use ES2024 built-in APIs such as `Object.groupBy` and `Promise.withResolvers`. Backstage doesn't include polyfills, so frontend code that uses these APIs needs at least Chrome or Edge 119, Firefox 121, or Safari 17.4.
13
+
9
14
  - Updated dependencies
10
15
  - @backstage/cli-common@0.3.2
11
16
  - @backstage/errors@1.3.2
12
17
  - @backstage/types@1.2.2
13
18
 
19
+ ## 0.3.6-next.1
20
+
21
+ ### Patch Changes
22
+
23
+ - a96b99c: The Node.js module transform now uses the synchronous `module.registerHooks()` API when it is available, which avoids the `module.register()` deprecation warning printed by Node.js 26. On older Node.js versions it continues to use `module.register()`.
24
+ - 04a54e2: Switched the compilation target to ES2024, which all supported Node.js versions fully support. Package builds, app bundles, and the backend development server now compile code for ES2024, and the TypeScript `target` and `lib` options in `@backstage/cli/config/tsconfig.json` are set to `ES2024`. This requires TypeScript 5.9 or later, which is now the oldest supported version according to the [versioning policy](https://backstage.io/docs/overview/versioning-policy#typescript-releases).
25
+
26
+ The `lib` change allows code to use ES2024 built-in APIs such as `Object.groupBy` and `Promise.withResolvers`. Backstage doesn't include polyfills, so frontend code that uses these APIs needs at least Chrome or Edge 119, Firefox 121, or Safari 17.4.
27
+
14
28
  ## 0.3.6-next.0
15
29
 
16
30
  ### Patch Changes
@@ -61,7 +61,7 @@ addHook(
61
61
  ignoreDynamic: true,
62
62
  },
63
63
  jsc: {
64
- target: 'es2023',
64
+ target: 'es2024',
65
65
  parser: {
66
66
  syntax: 'typescript',
67
67
  },
@@ -112,13 +112,14 @@ function withDetectedModuleType(resolved) {
112
112
  if (resolved.format) {
113
113
  return resolved;
114
114
  }
115
- // Happens in Node.js v22 when there's a package.json without an explicit "type" field. Use the default.
116
- if (resolved.format === null) {
117
- return { ...resolved, format: DEFAULT_MODULE_FORMAT };
118
- }
119
115
 
120
116
  const ext = extname(resolved.url);
121
117
 
118
+ // Happens when there's a package.json without an explicit "type" field
119
+ if (resolved.format === null) {
120
+ return withTypelessFormat(resolved, ext);
121
+ }
122
+
122
123
  const explicitFormat = moduleTypeTable[ext];
123
124
  if (explicitFormat) {
124
125
  return {
@@ -139,10 +140,24 @@ function withDetectedModuleType(resolved) {
139
140
  }
140
141
 
141
142
  const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
142
- return {
143
- ...resolved,
144
- format: packageJson.type ?? DEFAULT_MODULE_FORMAT,
145
- };
143
+ if (packageJson.type) {
144
+ return { ...resolved, format: packageJson.type };
145
+ }
146
+ return withTypelessFormat(resolved, ext);
147
+ }
148
+
149
+ /**
150
+ * Leaves the format of JavaScript files in typeless packages to Node.js syntax
151
+ * detection, but keeps TypeScript as CommonJS so it goes through our transform.
152
+ *
153
+ * @param {import('module').ResolveFnOutput} resolved
154
+ * @param {string} ext
155
+ * @returns {import('module').ResolveFnOutput}
156
+ */
157
+ function withTypelessFormat(resolved, ext) {
158
+ return TS_EXTS.includes(ext)
159
+ ? { ...resolved, format: DEFAULT_MODULE_FORMAT }
160
+ : resolved;
146
161
  }
147
162
 
148
163
  /**
@@ -281,7 +296,7 @@ function loadImpl(url, context, nextLoad) {
281
296
  exportInteropAnnotation: true,
282
297
  },
283
298
  jsc: {
284
- target: 'es2023',
299
+ target: 'es2024',
285
300
  parser: {
286
301
  syntax: 'typescript',
287
302
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/cli-node",
3
- "version": "0.0.0-nightly-20261031021925",
3
+ "version": "0.0.0-nightly-20261106022102",
4
4
  "description": "Node.js library for Backstage CLIs",
5
5
  "backstage": {
6
6
  "role": "node-library"
@@ -48,9 +48,9 @@
48
48
  "zod": "^3.25.76 || ^4.0.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@backstage/backend-test-utils": "0.0.0-nightly-20261031021925",
52
- "@backstage/cli": "0.0.0-nightly-20261031021925",
53
- "@backstage/test-utils": "0.0.0-nightly-20261031021925",
51
+ "@backstage/backend-test-utils": "0.0.0-nightly-20261106022102",
52
+ "@backstage/cli": "0.0.0-nightly-20261106022102",
53
+ "@backstage/test-utils": "0.0.0-nightly-20261106022102",
54
54
  "@types/proper-lockfile": "^4",
55
55
  "@types/yarnpkg__lockfile": "^1.1.4"
56
56
  },