@backstage/repo-tools 0.16.4-next.1 → 0.16.4-next.2

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,5 +1,17 @@
1
1
  # @backstage/repo-tools
2
2
 
3
+ ## 0.16.4-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - be7ebad: Updated package-docs exclude list to reflect renamed example app packages.
8
+ - df59ee6: The `type-deps` command now follows relative imports and re-exports into declaration chunk files, and detects ambient global types such as the `jest` namespace.
9
+ - a7e0d50: Prepare for React Router v7 migration by updating to v6.30.2 across all NFS packages and enabling v7 future flags. Convert routes from splat paths to parent/child structure with Outlet components.
10
+ - Updated dependencies
11
+ - @backstage/backend-plugin-api@1.7.0-next.1
12
+ - @backstage/cli-node@0.2.18-next.1
13
+ - @backstage/config-loader@1.10.8-next.0
14
+
3
15
  ## 0.16.4-next.1
4
16
 
5
17
  ### Patch Changes
@@ -22,8 +22,8 @@ const limit = pLimit__default.default(8);
22
22
  const execAsync = node_util.promisify(node_child_process.exec);
23
23
  const EXCLUDE = [
24
24
  "packages/app",
25
- "packages/app-next",
26
- "packages/app-next-example-plugin",
25
+ "packages/app-legacy",
26
+ "packages/app-example-plugin",
27
27
  "packages/cli",
28
28
  "packages/cli-common",
29
29
  "packages/cli-node",
@@ -10,13 +10,13 @@ const desiredLocalVersionsOfDependencies = {
10
10
  "@types/react": "^18.0.0",
11
11
  react: "^18.0.2",
12
12
  "react-dom": "^18.0.2",
13
- "react-router-dom": "^6.3.0"
13
+ "react-router-dom": "^6.30.2"
14
14
  };
15
15
  const peerDependencies = {
16
16
  "@types/react": "^17.0.0 || ^18.0.0",
17
17
  react: "^17.0.0 || ^18.0.0",
18
18
  "react-dom": "^17.0.0 || ^18.0.0",
19
- "react-router-dom": "^6.3.0"
19
+ "react-router-dom": "^6.30.2"
20
20
  };
21
21
  const groupsOfPeerDependencies = [["@types/react", "react", "react-dom"]];
22
22
  const optionalPeerDependencies = /* @__PURE__ */ new Set(["@types/react"]);
@@ -54,18 +54,49 @@ var typeDeps = async () => {
54
54
  function shouldCheckTypes(pkg) {
55
55
  return !pkg.packageJson.private && pkg.packageJson.types && fs__default.default.existsSync(path.resolve(pkg.dir, "dist/index.d.ts"));
56
56
  }
57
+ function collectDeclSources(entryPath) {
58
+ const visited = /* @__PURE__ */ new Set();
59
+ const sources = [];
60
+ function visit(filePath) {
61
+ const resolved = path.resolve(filePath);
62
+ if (visited.has(resolved)) {
63
+ return;
64
+ }
65
+ visited.add(resolved);
66
+ let actualPath = resolved;
67
+ if (!fs__default.default.existsSync(actualPath)) {
68
+ actualPath = resolved.replace(/\.js$/, ".d.ts");
69
+ }
70
+ if (!fs__default.default.existsSync(actualPath)) {
71
+ return;
72
+ }
73
+ const src = fs__default.default.readFileSync(actualPath, "utf8");
74
+ sources.push(src);
75
+ const relativeRefs = (src.match(/^(?:import|export) .* from '\..*';$/gm) || []).map((match) => match.match(/from '(.*)'/)?.[1] ?? "").filter((n) => n.startsWith("."));
76
+ const dir = path.resolve(actualPath, "..");
77
+ for (const ref of relativeRefs) {
78
+ visit(path.resolve(dir, ref));
79
+ }
80
+ }
81
+ visit(entryPath);
82
+ return sources;
83
+ }
57
84
  function findAllDeps(declSrc) {
58
85
  const importedDeps = (declSrc.match(/^import .* from '.*';$/gm) || []).map((match) => match.match(/from '(.*)'/)?.[1] ?? "").filter((n) => !n.startsWith("."));
59
86
  const referencedDeps = (declSrc.match(/^\/\/\/ <reference types=".*" \/>$/gm) || []).map((match) => match.match(/types="(.*)"/)?.[1] ?? "").filter((n) => !n.startsWith(".")).filter((n) => !["node", "react"].includes(n));
60
- return Array.from(/* @__PURE__ */ new Set([...importedDeps, ...referencedDeps]));
87
+ const strippedSrc = declSrc.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/.*$/gm, "");
88
+ const ambientDeps = [];
89
+ if (/\bjest\.\w/.test(strippedSrc)) {
90
+ ambientDeps.push("jest");
91
+ }
92
+ return Array.from(
93
+ /* @__PURE__ */ new Set([...importedDeps, ...referencedDeps, ...ambientDeps])
94
+ );
61
95
  }
62
96
  function checkTypes(pkg) {
63
97
  const allDeps = getPackageExportDetails.getPackageExportDetails(pkg.packageJson).flatMap((exp) => {
64
- const typeDecl = fs__default.default.readFileSync(
65
- path.resolve(pkg.dir, "dist", exp.distPath),
66
- "utf8"
67
- );
68
- return findAllDeps(typeDecl);
98
+ const entryPath = path.resolve(pkg.dir, "dist", exp.distPath);
99
+ return collectDeclSources(entryPath).flatMap((src) => findAllDeps(src));
69
100
  });
70
101
  const deps = Array.from(new Set(allDeps));
71
102
  const errors = [];
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.16.4-next.1";
3
+ var version = "0.16.4-next.2";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/repo-tools",
3
- "version": "0.16.4-next.1",
3
+ "version": "0.16.4-next.2",
4
4
  "description": "CLI for Backstage repo tooling ",
5
5
  "backstage": {
6
6
  "role": "cli"
@@ -87,8 +87,8 @@
87
87
  "zod": "^3.25.76"
88
88
  },
89
89
  "devDependencies": {
90
- "@backstage/backend-test-utils": "1.10.5-next.0",
91
- "@backstage/cli": "0.35.4-next.1",
90
+ "@backstage/backend-test-utils": "1.11.0-next.1",
91
+ "@backstage/cli": "0.35.4-next.2",
92
92
  "@backstage/types": "1.2.2",
93
93
  "@types/is-glob": "^4.0.2",
94
94
  "@types/node": "^22.13.14",