@cedarjs/babel-config 5.0.0-canary.2340 → 5.0.0-canary.2343

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.
@@ -1 +1 @@
1
- {"version":3,"file":"babel-plugin-redwood-routes-auto-loader.d.ts","sourceRoot":"","sources":["../../src/plugins/babel-plugin-redwood-routes-auto-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAWnD,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAiDD,MAAM,CAAC,OAAO,WACZ,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,EACrC,EAAE,YAAoB,EAAE,EAAE,aAAa,GACtC,SAAS,CA2KX"}
1
+ {"version":3,"file":"babel-plugin-redwood-routes-auto-loader.d.ts","sourceRoot":"","sources":["../../src/plugins/babel-plugin-redwood-routes-auto-loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAWnD,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAiDD,MAAM,CAAC,OAAO,WACZ,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,EACrC,EAAE,YAAoB,EAAE,EAAE,aAAa,GACtC,SAAS,CA8LX"}
@@ -31,6 +31,7 @@ __export(babel_plugin_redwood_routes_auto_loader_exports, {
31
31
  default: () => babel_plugin_redwood_routes_auto_loader_default
32
32
  });
33
33
  module.exports = __toCommonJS(babel_plugin_redwood_routes_auto_loader_exports);
34
+ var import_node_fs = __toESM(require("node:fs"));
34
35
  var import_node_path = __toESM(require("node:path"));
35
36
  var import_project_config = require("@cedarjs/project-config");
36
37
  const getPathRelativeToSrc = (maybeAbsolutePath) => {
@@ -110,6 +111,18 @@ function babel_plugin_redwood_routes_auto_loader_default({ types: t }, { forPrer
110
111
  Program: {
111
112
  enter() {
112
113
  pages = (0, import_project_config.processPagesDir)().map(withRelativeImports);
114
+ const appPath = (0, import_project_config.resolveFile)(import_node_path.default.join((0, import_project_config.getPaths)().web.src, "App"));
115
+ if (appPath) {
116
+ const appSource = import_node_fs.default.readFileSync(appPath, "utf8");
117
+ const importRe = /^import\s+\w+\s+from\s+['"]([^'"]+)['"]/gm;
118
+ let m;
119
+ while ((m = importRe.exec(appSource)) !== null) {
120
+ const rel = (0, import_project_config.ensurePosixPath)(
121
+ getPathRelativeToSrc((0, import_project_config.importStatementPath)(m[1]))
122
+ );
123
+ pages = pages.filter((page) => page.relativeImport !== rel);
124
+ }
125
+ }
113
126
  },
114
127
  exit(p) {
115
128
  if (pages.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/babel-config",
3
- "version": "5.0.0-canary.2340",
3
+ "version": "5.0.0-canary.2343",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cedarjs/cedar.git",
@@ -32,7 +32,7 @@
32
32
  "@babel/preset-typescript": "7.28.5",
33
33
  "@babel/register": "7.29.3",
34
34
  "@babel/traverse": "7.29.0",
35
- "@cedarjs/project-config": "5.0.0-canary.2340",
35
+ "@cedarjs/project-config": "5.0.0-canary.2343",
36
36
  "babel-plugin-auto-import": "1.1.0",
37
37
  "babel-plugin-graphql-tag": "3.3.0",
38
38
  "babel-plugin-module-resolver": "5.0.3",
@@ -41,7 +41,7 @@
41
41
  "typescript": "5.9.3"
42
42
  },
43
43
  "devDependencies": {
44
- "@cedarjs/framework-tools": "5.0.0-canary.2340",
44
+ "@cedarjs/framework-tools": "5.0.0-canary.2343",
45
45
  "@types/babel-plugin-tester": "11.0.0",
46
46
  "@types/babel__core": "7.20.5",
47
47
  "@types/babel__register": "7.17.3",