@cedarjs/vite 5.0.0-canary.2586 → 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.
- package/dist/cjs/index.js +5 -0
- package/dist/cjs/plugins/vite-plugin-cedar-remove-dev-fatal-error-page.js +61 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/plugins/vite-plugin-cedar-remove-dev-fatal-error-page.d.ts +15 -0
- package/dist/plugins/vite-plugin-cedar-remove-dev-fatal-error-page.d.ts.map +1 -0
- package/dist/plugins/vite-plugin-cedar-remove-dev-fatal-error-page.js +37 -0
- package/package.json +13 -13
package/dist/cjs/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
cedarImportDirPlugin: () => import_vite_plugin_cedar_import_dir.cedarImportDirPlugin,
|
|
38
38
|
cedarMergedConfig: () => import_vite_plugin_merged_config2.cedarMergedConfig,
|
|
39
39
|
cedarNodePolyfills: () => import_vite_plugin_cedar_node_polyfills2.cedarNodePolyfills,
|
|
40
|
+
cedarRemoveDevFatalErrorPage: () => import_vite_plugin_cedar_remove_dev_fatal_error_page2.cedarRemoveDevFatalErrorPage,
|
|
40
41
|
cedarRemoveFromBundle: () => import_vite_plugin_cedar_remove_from_bundle2.cedarRemoveFromBundle,
|
|
41
42
|
cedarSwapApolloProvider: () => import_vite_plugin_swap_apollo_provider2.cedarSwapApolloProvider,
|
|
42
43
|
cedarTransformJsAsJsx: () => import_vite_plugin_jsx_loader2.cedarTransformJsAsJsx,
|
|
@@ -55,6 +56,7 @@ var import_vite_plugin_cedar_cell = require("./plugins/vite-plugin-cedar-cell.js
|
|
|
55
56
|
var import_vite_plugin_cedar_entry_injection = require("./plugins/vite-plugin-cedar-entry-injection.js");
|
|
56
57
|
var import_vite_plugin_cedar_html_env = require("./plugins/vite-plugin-cedar-html-env.js");
|
|
57
58
|
var import_vite_plugin_cedar_node_polyfills = require("./plugins/vite-plugin-cedar-node-polyfills.js");
|
|
59
|
+
var import_vite_plugin_cedar_remove_dev_fatal_error_page = require("./plugins/vite-plugin-cedar-remove-dev-fatal-error-page.js");
|
|
58
60
|
var import_vite_plugin_cedar_remove_from_bundle = require("./plugins/vite-plugin-cedar-remove-from-bundle.js");
|
|
59
61
|
var import_vite_plugin_cedar_wait_for_api_server = require("./plugins/vite-plugin-cedar-wait-for-api-server.js");
|
|
60
62
|
var import_vite_plugin_cedarjs_resolve_cedar_style_imports = require("./plugins/vite-plugin-cedarjs-resolve-cedar-style-imports.js");
|
|
@@ -68,6 +70,7 @@ var import_vite_plugin_cedar_entry_injection2 = require("./plugins/vite-plugin-c
|
|
|
68
70
|
var import_vite_plugin_cedar_html_env2 = require("./plugins/vite-plugin-cedar-html-env.js");
|
|
69
71
|
var import_vite_plugin_cedar_import_dir = require("./plugins/vite-plugin-cedar-import-dir.js");
|
|
70
72
|
var import_vite_plugin_cedar_node_polyfills2 = require("./plugins/vite-plugin-cedar-node-polyfills.js");
|
|
73
|
+
var import_vite_plugin_cedar_remove_dev_fatal_error_page2 = require("./plugins/vite-plugin-cedar-remove-dev-fatal-error-page.js");
|
|
71
74
|
var import_vite_plugin_cedar_remove_from_bundle2 = require("./plugins/vite-plugin-cedar-remove-from-bundle.js");
|
|
72
75
|
var import_vite_plugin_cedarjs_resolve_cedar_style_imports2 = require("./plugins/vite-plugin-cedarjs-resolve-cedar-style-imports.js");
|
|
73
76
|
var import_vite_plugin_cedarjs_job_path_injector = require("./plugins/vite-plugin-cedarjs-job-path-injector.js");
|
|
@@ -106,6 +109,7 @@ function cedar({ mode } = {}) {
|
|
|
106
109
|
(0, import_vite_plugin_cedar_cell.cedarCellTransform)(),
|
|
107
110
|
(0, import_vite_plugin_jsx_loader.cedarTransformJsAsJsx)(),
|
|
108
111
|
(0, import_vite_plugin_cedar_remove_from_bundle.cedarRemoveFromBundle)(),
|
|
112
|
+
(0, import_vite_plugin_cedar_remove_dev_fatal_error_page.cedarRemoveDevFatalErrorPage)(),
|
|
109
113
|
(0, import_plugin_react.default)({ babel: babelConfig })
|
|
110
114
|
];
|
|
111
115
|
}
|
|
@@ -121,6 +125,7 @@ var index_default = cedar;
|
|
|
121
125
|
cedarImportDirPlugin,
|
|
122
126
|
cedarMergedConfig,
|
|
123
127
|
cedarNodePolyfills,
|
|
128
|
+
cedarRemoveDevFatalErrorPage,
|
|
124
129
|
cedarRemoveFromBundle,
|
|
125
130
|
cedarSwapApolloProvider,
|
|
126
131
|
cedarTransformJsAsJsx,
|
|
@@ -0,0 +1,61 @@
|
|
|
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 vite_plugin_cedar_remove_dev_fatal_error_page_exports = {};
|
|
20
|
+
__export(vite_plugin_cedar_remove_dev_fatal_error_page_exports, {
|
|
21
|
+
cedarRemoveDevFatalErrorPage: () => cedarRemoveDevFatalErrorPage
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(vite_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
|
+
function cedarRemoveDevFatalErrorPage() {
|
|
33
|
+
let config;
|
|
34
|
+
return {
|
|
35
|
+
name: "cedar-remove-dev-fatal-error-page",
|
|
36
|
+
apply: "build",
|
|
37
|
+
configResolved(resolvedConfig) {
|
|
38
|
+
config = resolvedConfig;
|
|
39
|
+
},
|
|
40
|
+
transform(code) {
|
|
41
|
+
if (config.command === "build" && config.mode === "development") {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
if (!code.includes(DEV_FATAL_ERROR_PAGE_MODULE)) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const newCode = code.replace(
|
|
48
|
+
IMPORT_PATTERN,
|
|
49
|
+
"const DevFatalErrorPage = undefined"
|
|
50
|
+
);
|
|
51
|
+
if (newCode === code) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return { code: newCode, map: null };
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
+
0 && (module.exports = {
|
|
60
|
+
cedarRemoveDevFatalErrorPage
|
|
61
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { cedarEntryInjectionPlugin } from './plugins/vite-plugin-cedar-entry-inj
|
|
|
6
6
|
export { cedarHtmlEnvPlugin } from './plugins/vite-plugin-cedar-html-env.js';
|
|
7
7
|
export { cedarImportDirPlugin } from './plugins/vite-plugin-cedar-import-dir.js';
|
|
8
8
|
export { cedarNodePolyfills } from './plugins/vite-plugin-cedar-node-polyfills.js';
|
|
9
|
+
export { cedarRemoveDevFatalErrorPage } from './plugins/vite-plugin-cedar-remove-dev-fatal-error-page.js';
|
|
9
10
|
export { cedarRemoveFromBundle } from './plugins/vite-plugin-cedar-remove-from-bundle.js';
|
|
10
11
|
export { cedarjsResolveCedarStyleImportsPlugin } from './plugins/vite-plugin-cedarjs-resolve-cedar-style-imports.js';
|
|
11
12
|
export { cedarjsJobPathInjectorPlugin } from './plugins/vite-plugin-cedarjs-job-path-injector.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAsBxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAA;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAA;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAA;AAClF,OAAO,EAAE,4BAA4B,EAAE,MAAM,4DAA4D,CAAA;AACzG,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAA;AACzF,OAAO,EAAE,qCAAqC,EAAE,MAAM,8DAA8D,CAAA;AACpH,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAA;AACvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAA;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAA;AAE1F,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAA;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,GAAE,aAAkB,GAAG,YAAY,EAAE,CA0ClE;AAED,8DAA8D;AAC9D,eAAe,KAAK,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { cedarCellTransform } from "./plugins/vite-plugin-cedar-cell.js";
|
|
|
10
10
|
import { cedarEntryInjectionPlugin } from "./plugins/vite-plugin-cedar-entry-injection.js";
|
|
11
11
|
import { cedarHtmlEnvPlugin } from "./plugins/vite-plugin-cedar-html-env.js";
|
|
12
12
|
import { cedarNodePolyfills } from "./plugins/vite-plugin-cedar-node-polyfills.js";
|
|
13
|
+
import { cedarRemoveDevFatalErrorPage } from "./plugins/vite-plugin-cedar-remove-dev-fatal-error-page.js";
|
|
13
14
|
import { cedarRemoveFromBundle } from "./plugins/vite-plugin-cedar-remove-from-bundle.js";
|
|
14
15
|
import { cedarWaitForApiServer } from "./plugins/vite-plugin-cedar-wait-for-api-server.js";
|
|
15
16
|
import { cedarjsResolveCedarStyleImportsPlugin } from "./plugins/vite-plugin-cedarjs-resolve-cedar-style-imports.js";
|
|
@@ -23,6 +24,7 @@ import { cedarEntryInjectionPlugin as cedarEntryInjectionPlugin2 } from "./plugi
|
|
|
23
24
|
import { cedarHtmlEnvPlugin as cedarHtmlEnvPlugin2 } from "./plugins/vite-plugin-cedar-html-env.js";
|
|
24
25
|
import { cedarImportDirPlugin } from "./plugins/vite-plugin-cedar-import-dir.js";
|
|
25
26
|
import { cedarNodePolyfills as cedarNodePolyfills2 } from "./plugins/vite-plugin-cedar-node-polyfills.js";
|
|
27
|
+
import { cedarRemoveDevFatalErrorPage as cedarRemoveDevFatalErrorPage2 } from "./plugins/vite-plugin-cedar-remove-dev-fatal-error-page.js";
|
|
26
28
|
import { cedarRemoveFromBundle as cedarRemoveFromBundle2 } from "./plugins/vite-plugin-cedar-remove-from-bundle.js";
|
|
27
29
|
import { cedarjsResolveCedarStyleImportsPlugin as cedarjsResolveCedarStyleImportsPlugin2 } from "./plugins/vite-plugin-cedarjs-resolve-cedar-style-imports.js";
|
|
28
30
|
import { cedarjsJobPathInjectorPlugin } from "./plugins/vite-plugin-cedarjs-job-path-injector.js";
|
|
@@ -61,6 +63,7 @@ function cedar({ mode } = {}) {
|
|
|
61
63
|
cedarCellTransform(),
|
|
62
64
|
cedarTransformJsAsJsx(),
|
|
63
65
|
cedarRemoveFromBundle(),
|
|
66
|
+
cedarRemoveDevFatalErrorPage(),
|
|
64
67
|
react({ babel: babelConfig })
|
|
65
68
|
];
|
|
66
69
|
}
|
|
@@ -75,6 +78,7 @@ export {
|
|
|
75
78
|
cedarImportDirPlugin,
|
|
76
79
|
cedarMergedConfig2 as cedarMergedConfig,
|
|
77
80
|
cedarNodePolyfills2 as cedarNodePolyfills,
|
|
81
|
+
cedarRemoveDevFatalErrorPage2 as cedarRemoveDevFatalErrorPage,
|
|
78
82
|
cedarRemoveFromBundle2 as cedarRemoveFromBundle,
|
|
79
83
|
cedarSwapApolloProvider2 as cedarSwapApolloProvider,
|
|
80
84
|
cedarTransformJsAsJsx2 as cedarTransformJsAsJsx,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Vite plugin to remove the DevFatalErrorPage import in production builds.
|
|
4
|
+
*
|
|
5
|
+
* Replaces:
|
|
6
|
+
* import { DevFatalErrorPage } from '@cedarjs/web/dist/components/DevFatalErrorPage'
|
|
7
|
+
* with:
|
|
8
|
+
* const DevFatalErrorPage = undefined
|
|
9
|
+
*
|
|
10
|
+
* This ensures the DevFatalErrorPage component is not shipped in the
|
|
11
|
+
* production bundle. In development, the import is kept so the page
|
|
12
|
+
* renders when an unhandled error bubbles to the top of the app.
|
|
13
|
+
*/
|
|
14
|
+
export declare function cedarRemoveDevFatalErrorPage(): Plugin;
|
|
15
|
+
//# sourceMappingURL=vite-plugin-cedar-remove-dev-fatal-error-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-plugin-cedar-remove-dev-fatal-error-page.d.ts","sourceRoot":"","sources":["../../src/plugins/vite-plugin-cedar-remove-dev-fatal-error-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAA;AAclD;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAgCrD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
function cedarRemoveDevFatalErrorPage() {
|
|
10
|
+
let config;
|
|
11
|
+
return {
|
|
12
|
+
name: "cedar-remove-dev-fatal-error-page",
|
|
13
|
+
apply: "build",
|
|
14
|
+
configResolved(resolvedConfig) {
|
|
15
|
+
config = resolvedConfig;
|
|
16
|
+
},
|
|
17
|
+
transform(code) {
|
|
18
|
+
if (config.command === "build" && config.mode === "development") {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
if (!code.includes(DEV_FATAL_ERROR_PAGE_MODULE)) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const newCode = code.replace(
|
|
25
|
+
IMPORT_PATTERN,
|
|
26
|
+
"const DevFatalErrorPage = undefined"
|
|
27
|
+
);
|
|
28
|
+
if (newCode === code) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return { code: newCode, map: null };
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
cedarRemoveDevFatalErrorPage
|
|
37
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/vite",
|
|
3
|
-
"version": "5.0.0-canary.
|
|
3
|
+
"version": "5.0.0-canary.2587",
|
|
4
4
|
"description": "Vite configuration package for CedarJS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -67,15 +67,15 @@
|
|
|
67
67
|
"@babel/parser": "7.29.7",
|
|
68
68
|
"@babel/traverse": "7.29.7",
|
|
69
69
|
"@babel/types": "7.29.7",
|
|
70
|
-
"@cedarjs/api": "5.0.0-canary.
|
|
71
|
-
"@cedarjs/babel-config": "5.0.0-canary.
|
|
72
|
-
"@cedarjs/context": "5.0.0-canary.
|
|
73
|
-
"@cedarjs/cookie-jar": "5.0.0-canary.
|
|
74
|
-
"@cedarjs/graphql-server": "5.0.0-canary.
|
|
75
|
-
"@cedarjs/internal": "5.0.0-canary.
|
|
76
|
-
"@cedarjs/project-config": "5.0.0-canary.
|
|
77
|
-
"@cedarjs/server-store": "5.0.0-canary.
|
|
78
|
-
"@cedarjs/testing": "5.0.0-canary.
|
|
70
|
+
"@cedarjs/api": "5.0.0-canary.2587",
|
|
71
|
+
"@cedarjs/babel-config": "5.0.0-canary.2587",
|
|
72
|
+
"@cedarjs/context": "5.0.0-canary.2587",
|
|
73
|
+
"@cedarjs/cookie-jar": "5.0.0-canary.2587",
|
|
74
|
+
"@cedarjs/graphql-server": "5.0.0-canary.2587",
|
|
75
|
+
"@cedarjs/internal": "5.0.0-canary.2587",
|
|
76
|
+
"@cedarjs/project-config": "5.0.0-canary.2587",
|
|
77
|
+
"@cedarjs/server-store": "5.0.0-canary.2587",
|
|
78
|
+
"@cedarjs/testing": "5.0.0-canary.2587",
|
|
79
79
|
"@fastify/url-data": "6.0.3",
|
|
80
80
|
"@swc/core": "1.15.41",
|
|
81
81
|
"@universal-deploy/store": "^0.2.1",
|
|
@@ -109,9 +109,9 @@
|
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@arethetypeswrong/cli": "0.18.3",
|
|
112
|
-
"@cedarjs/auth": "5.0.0-canary.
|
|
113
|
-
"@cedarjs/router": "5.0.0-canary.
|
|
114
|
-
"@cedarjs/web": "5.0.0-canary.
|
|
112
|
+
"@cedarjs/auth": "5.0.0-canary.2587",
|
|
113
|
+
"@cedarjs/router": "5.0.0-canary.2587",
|
|
114
|
+
"@cedarjs/web": "5.0.0-canary.2587",
|
|
115
115
|
"@hyrious/esbuild-plugin-commonjs": "0.2.6",
|
|
116
116
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
117
117
|
"@types/aws-lambda": "8.10.162",
|