@cedarjs/prerender 5.0.0-canary.2585 → 5.0.0-canary.2587

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":"buildAndImport.d.ts","sourceRoot":"","sources":["../../src/build-and-import/buildAndImport.ts"],"names":[],"mappings":"AAoCA,UAAU,OAAO;IACf,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAqJlD"}
1
+ {"version":3,"file":"buildAndImport.d.ts","sourceRoot":"","sources":["../../src/build-and-import/buildAndImport.ts"],"names":[],"mappings":"AAqCA,UAAU,OAAO;IACf,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAsJlD"}
@@ -12,6 +12,7 @@ import {
12
12
  getPathsFromTypeScriptConfig,
13
13
  parseTypeScriptConfigFiles
14
14
  } from "../internal.js";
15
+ import { cedarRemoveDevFatalErrorPagePlugin } from "./rollupPlugins/rollup-plugin-cedar-remove-dev-fatal-error-page.js";
15
16
  import { cellTransformPlugin } from "./rollupPlugins/rollup-plugin-cedarjs-cell.js";
16
17
  import { cedarjsDirectoryNamedImportPlugin } from "./rollupPlugins/rollup-plugin-cedarjs-directory-named-imports.js";
17
18
  import { externalPlugin } from "./rollupPlugins/rollup-plugin-cedarjs-external.js";
@@ -96,6 +97,7 @@ async function buildAndImport(options) {
96
97
  }
97
98
  }
98
99
  },
100
+ cedarRemoveDevFatalErrorPagePlugin(),
99
101
  ignoreHtmlAndCssImportsPlugin(),
100
102
  cellTransformPlugin(),
101
103
  cedarjsRoutesAutoLoaderPlugin(),
@@ -0,0 +1,14 @@
1
+ import type { Plugin as RollupPlugin } from 'rollup';
2
+ /**
3
+ * Rollup plugin to remove the DevFatalErrorPage import during prerendering.
4
+ *
5
+ * Replaces:
6
+ * import { DevFatalErrorPage } from '@cedarjs/web/dist/components/DevFatalErrorPage'
7
+ * with:
8
+ * const DevFatalErrorPage = undefined
9
+ *
10
+ * Prerendering runs in a production context and should not include the
11
+ * dev-only error page component in the bundle.
12
+ */
13
+ export declare const cedarRemoveDevFatalErrorPagePlugin: () => RollupPlugin;
14
+ //# sourceMappingURL=rollup-plugin-cedar-remove-dev-fatal-error-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup-plugin-cedar-remove-dev-fatal-error-page.d.ts","sourceRoot":"","sources":["../../../src/build-and-import/rollupPlugins/rollup-plugin-cedar-remove-dev-fatal-error-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAA;AAcpD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kCAAkC,QAAO,YAqBrD,CAAA"}
@@ -0,0 +1,29 @@
1
+ const DEV_FATAL_ERROR_PAGE_MODULE = "@cedarjs/web/dist/components/DevFatalErrorPage";
2
+ function escapeRegExp(s) {
3
+ return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4
+ }
5
+ const ESCAPED_MODULE = escapeRegExp(DEV_FATAL_ERROR_PAGE_MODULE);
6
+ const IMPORT_PATTERN = new RegExp(
7
+ `import\\s*\\{[^}]*\\bDevFatalErrorPage\\b[^}]*\\}\\s*from\\s*['"]${ESCAPED_MODULE}['"]`
8
+ );
9
+ const cedarRemoveDevFatalErrorPagePlugin = () => {
10
+ return {
11
+ name: "cedar-remove-dev-fatal-error-page",
12
+ transform(code) {
13
+ if (!code.includes(DEV_FATAL_ERROR_PAGE_MODULE)) {
14
+ return null;
15
+ }
16
+ const newCode = code.replace(
17
+ IMPORT_PATTERN,
18
+ "const DevFatalErrorPage = undefined"
19
+ );
20
+ if (newCode === code) {
21
+ return null;
22
+ }
23
+ return { code: newCode, map: null };
24
+ }
25
+ };
26
+ };
27
+ export {
28
+ cedarRemoveDevFatalErrorPagePlugin
29
+ };
@@ -42,6 +42,7 @@ var import_rollup_plugin_swc3 = require("rollup-plugin-swc3");
42
42
  var import_unplugin = __toESM(require("unimport/unplugin"), 1);
43
43
  var import_project_config = require("@cedarjs/project-config");
44
44
  var import_internal = require("../internal.js");
45
+ var import_rollup_plugin_cedar_remove_dev_fatal_error_page = require("./rollupPlugins/rollup-plugin-cedar-remove-dev-fatal-error-page.js");
45
46
  var import_rollup_plugin_cedarjs_cell = require("./rollupPlugins/rollup-plugin-cedarjs-cell.js");
46
47
  var import_rollup_plugin_cedarjs_directory_named_imports = require("./rollupPlugins/rollup-plugin-cedarjs-directory-named-imports.js");
47
48
  var import_rollup_plugin_cedarjs_external = require("./rollupPlugins/rollup-plugin-cedarjs-external.js");
@@ -126,6 +127,7 @@ async function buildAndImport(options) {
126
127
  }
127
128
  }
128
129
  },
130
+ (0, import_rollup_plugin_cedar_remove_dev_fatal_error_page.cedarRemoveDevFatalErrorPagePlugin)(),
129
131
  (0, import_rollup_plugin_cedarjs_ignore_html_and_css_imports.ignoreHtmlAndCssImportsPlugin)(),
130
132
  (0, import_rollup_plugin_cedarjs_cell.cellTransformPlugin)(),
131
133
  (0, import_rollup_plugin_cedarjs_routes_auto_loader.cedarjsRoutesAutoLoaderPlugin)(),
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var rollup_plugin_cedar_remove_dev_fatal_error_page_exports = {};
20
+ __export(rollup_plugin_cedar_remove_dev_fatal_error_page_exports, {
21
+ cedarRemoveDevFatalErrorPagePlugin: () => cedarRemoveDevFatalErrorPagePlugin
22
+ });
23
+ module.exports = __toCommonJS(rollup_plugin_cedar_remove_dev_fatal_error_page_exports);
24
+ const DEV_FATAL_ERROR_PAGE_MODULE = "@cedarjs/web/dist/components/DevFatalErrorPage";
25
+ function escapeRegExp(s) {
26
+ return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
27
+ }
28
+ const ESCAPED_MODULE = escapeRegExp(DEV_FATAL_ERROR_PAGE_MODULE);
29
+ const IMPORT_PATTERN = new RegExp(
30
+ `import\\s*\\{[^}]*\\bDevFatalErrorPage\\b[^}]*\\}\\s*from\\s*['"]${ESCAPED_MODULE}['"]`
31
+ );
32
+ const cedarRemoveDevFatalErrorPagePlugin = () => {
33
+ return {
34
+ name: "cedar-remove-dev-fatal-error-page",
35
+ transform(code) {
36
+ if (!code.includes(DEV_FATAL_ERROR_PAGE_MODULE)) {
37
+ return null;
38
+ }
39
+ const newCode = code.replace(
40
+ IMPORT_PATTERN,
41
+ "const DevFatalErrorPage = undefined"
42
+ );
43
+ if (newCode === code) {
44
+ return null;
45
+ }
46
+ return { code: newCode, map: null };
47
+ }
48
+ };
49
+ };
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ cedarRemoveDevFatalErrorPagePlugin
53
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/prerender",
3
- "version": "5.0.0-canary.2585",
3
+ "version": "5.0.0-canary.2587",
4
4
  "description": "CedarJS prerender",
5
5
  "repository": {
6
6
  "type": "git",
@@ -71,10 +71,10 @@
71
71
  "@babel/generator": "7.29.7",
72
72
  "@babel/parser": "7.29.7",
73
73
  "@babel/traverse": "7.29.7",
74
- "@cedarjs/babel-config": "5.0.0-canary.2585",
75
- "@cedarjs/project-config": "5.0.0-canary.2585",
76
- "@cedarjs/structure": "5.0.0-canary.2585",
77
- "@cedarjs/vite": "5.0.0-canary.2585",
74
+ "@cedarjs/babel-config": "5.0.0-canary.2587",
75
+ "@cedarjs/project-config": "5.0.0-canary.2587",
76
+ "@cedarjs/structure": "5.0.0-canary.2587",
77
+ "@cedarjs/vite": "5.0.0-canary.2587",
78
78
  "@rollup/plugin-alias": "5.1.1",
79
79
  "@rollup/plugin-commonjs": "28.0.9",
80
80
  "@rollup/plugin-node-resolve": "16.0.3",
@@ -92,9 +92,9 @@
92
92
  "vite": "7.3.5"
93
93
  },
94
94
  "devDependencies": {
95
- "@cedarjs/framework-tools": "5.0.0-canary.2585",
96
- "@cedarjs/router": "5.0.0-canary.2585",
97
- "@cedarjs/web": "5.0.0-canary.2585",
95
+ "@cedarjs/framework-tools": "5.0.0-canary.2587",
96
+ "@cedarjs/router": "5.0.0-canary.2587",
97
+ "@cedarjs/web": "5.0.0-canary.2587",
98
98
  "@types/mime-types": "2.1.4",
99
99
  "@types/react": "^18.2.55",
100
100
  "babel-plugin-tester": "11.0.4",