@cedarjs/babel-config 4.2.1-next.0 → 4.2.1-next.269
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/api.d.ts +5 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +22 -16
- package/dist/plugins/{babel-plugin-redwood-graphql-options-extract.d.ts → babel-plugin-cedar-graphql-options-extract.d.ts} +1 -1
- package/dist/plugins/babel-plugin-cedar-graphql-options-extract.d.ts.map +1 -0
- package/dist/plugins/{babel-plugin-redwood-graphql-options-extract.js → babel-plugin-cedar-graphql-options-extract.js} +7 -7
- package/dist/plugins/babel-plugin-redwood-routes-auto-loader.d.ts.map +1 -1
- package/dist/plugins/babel-plugin-redwood-routes-auto-loader.js +13 -0
- package/dist/web.d.ts +1 -1
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +6 -3
- package/package.json +17 -14
- package/dist/__tests__/api.test.d.ts +0 -2
- package/dist/__tests__/api.test.d.ts.map +0 -1
- package/dist/__tests__/common.test.d.ts +0 -2
- package/dist/__tests__/common.test.d.ts.map +0 -1
- package/dist/__tests__/prebuildApiFile.test.d.ts +0 -6
- package/dist/__tests__/prebuildApiFile.test.d.ts.map +0 -1
- package/dist/__tests__/tsconfigParsing.test.d.ts +0 -2
- package/dist/__tests__/tsconfigParsing.test.d.ts.map +0 -1
- package/dist/plugins/__tests__/babel-plugin-redwood-context-wrapping.test.d.ts +0 -2
- package/dist/plugins/__tests__/babel-plugin-redwood-context-wrapping.test.d.ts.map +0 -1
- package/dist/plugins/__tests__/babel-plugin-redwood-directory-named-imports.test.d.ts +0 -2
- package/dist/plugins/__tests__/babel-plugin-redwood-directory-named-imports.test.d.ts.map +0 -1
- package/dist/plugins/__tests__/babel-plugin-redwood-graphql-options-extract.test.d.ts +0 -2
- package/dist/plugins/__tests__/babel-plugin-redwood-graphql-options-extract.test.d.ts.map +0 -1
- package/dist/plugins/__tests__/babel-plugin-redwood-import-dir.test.d.ts +0 -2
- package/dist/plugins/__tests__/babel-plugin-redwood-import-dir.test.d.ts.map +0 -1
- package/dist/plugins/__tests__/babel-plugin-redwood-mock-cell-data.test.d.ts +0 -2
- package/dist/plugins/__tests__/babel-plugin-redwood-mock-cell-data.test.d.ts.map +0 -1
- package/dist/plugins/__tests__/babel-plugin-redwood-otel-wrapping.test.d.ts +0 -2
- package/dist/plugins/__tests__/babel-plugin-redwood-otel-wrapping.test.d.ts.map +0 -1
- package/dist/plugins/__tests__/babel-plugin-redwood-remove-dev-fatal-error-page.test.d.ts +0 -2
- package/dist/plugins/__tests__/babel-plugin-redwood-remove-dev-fatal-error-page.test.d.ts.map +0 -1
- package/dist/plugins/__tests__/babel-plugin-redwood-routes-auto-loader.test.d.ts +0 -2
- package/dist/plugins/__tests__/babel-plugin-redwood-routes-auto-loader.test.d.ts.map +0 -1
- package/dist/plugins/babel-plugin-redwood-graphql-options-extract.d.ts.map +0 -1
package/dist/api.d.ts
CHANGED
|
@@ -11,11 +11,13 @@ export declare const getApiSideBabelPlugins: ({ openTelemetry, projectIsEsm, }?:
|
|
|
11
11
|
projectIsEsm?: boolean | undefined;
|
|
12
12
|
}) => ([PluginTarget, PluginOptions, string | undefined] | [PluginTarget, PluginOptions])[];
|
|
13
13
|
export declare const getApiSideBabelConfigPath: () => string | undefined;
|
|
14
|
-
export declare const getApiSideBabelOverrides: ({ projectIsEsm }?: {
|
|
14
|
+
export declare const getApiSideBabelOverrides: ({ projectIsEsm, forJest, }?: {
|
|
15
15
|
projectIsEsm?: boolean | undefined;
|
|
16
|
+
forJest?: boolean | undefined;
|
|
16
17
|
}) => TransformOptions[];
|
|
17
|
-
export declare const getApiSideDefaultBabelConfig: ({ projectIsEsm }?: {
|
|
18
|
+
export declare const getApiSideDefaultBabelConfig: ({ projectIsEsm, forJest, }?: {
|
|
18
19
|
projectIsEsm?: boolean | undefined;
|
|
20
|
+
forJest?: boolean | undefined;
|
|
19
21
|
}) => {
|
|
20
22
|
presets: import("@babel/core").PluginItem[] | null | undefined;
|
|
21
23
|
plugins: ([PluginTarget, PluginOptions, string | undefined] | [PluginTarget, PluginOptions])[];
|
|
@@ -25,6 +27,6 @@ export declare const getApiSideDefaultBabelConfig: ({ projectIsEsm }?: {
|
|
|
25
27
|
ignore: string[];
|
|
26
28
|
};
|
|
27
29
|
export declare const registerApiSideBabelHook: ({ plugins, ...rest }?: RegisterHookOptions) => void;
|
|
28
|
-
export declare const transformWithBabel: (
|
|
30
|
+
export declare const transformWithBabel: (sourceCode: string, filename: string, plugins: TransformOptions["plugins"], sourceMaps?: TransformOptions["sourceMaps"]) => Promise<import("@babel/core").BabelFileResult | null>;
|
|
29
31
|
export {};
|
|
30
32
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAMhF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAetD,eAAO,MAAM,YAAY,OAAO,CAAA;AAEhC,eAAO,MAAM,sBAAsB,GACjC;;CAAoC,KAqBf,gBAAgB,CAAC,SAAS,CAChD,CAAA;AAKD,MAAM,MAAM,UAAU,GAAG,WAAW,EAAE,CAAA;AACtC,KAAK,WAAW,GACZ,CAAC,YAAY,EAAE,aAAa,EAAE,SAAS,GAAG,MAAM,CAAC,GACjD,CAAC,YAAY,EAAE,aAAa,CAAC,CAAA;AAEjC,eAAO,MAAM,sBAAsB,GAAI;;;CAGjC,0FAiGL,CAAA;AAED,eAAO,MAAM,yBAAyB,0BAOrC,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAMhF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAetD,eAAO,MAAM,YAAY,OAAO,CAAA;AAEhC,eAAO,MAAM,sBAAsB,GACjC;;CAAoC,KAqBf,gBAAgB,CAAC,SAAS,CAChD,CAAA;AAKD,MAAM,MAAM,UAAU,GAAG,WAAW,EAAE,CAAA;AACtC,KAAK,WAAW,GACZ,CAAC,YAAY,EAAE,aAAa,EAAE,SAAS,GAAG,MAAM,CAAC,GACjD,CAAC,YAAY,EAAE,aAAa,CAAC,CAAA;AAEjC,eAAO,MAAM,sBAAsB,GAAI;;;CAGjC,0FAiGL,CAAA;AAED,eAAO,MAAM,yBAAyB,0BAOrC,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI;;;CAGnC,KA8BgB,gBAAgB,EACrC,CAAA;AAED,eAAO,MAAM,4BAA4B,GAAI;;;CAGvC;;;;;;;CASL,CAAA;AAGD,eAAO,MAAM,wBAAwB,GAAI,uBAGtC,mBAAwB,SAe1B,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,YAAY,MAAM,EAClB,UAAU,MAAM,EAChB,SAAS,gBAAgB,CAAC,SAAS,CAAC,EACpC,aAAY,gBAAgB,CAAC,YAAY,CAAY,0DAmBtD,CAAA"}
|
package/dist/api.js
CHANGED
|
@@ -45,9 +45,9 @@ var import_babel_plugin_module_resolver = require("babel-plugin-module-resolver"
|
|
|
45
45
|
var import_project_config = require("@cedarjs/project-config");
|
|
46
46
|
var import_common = require("./common.js");
|
|
47
47
|
var import_babel_plugin_cedar_gqlorm_inject = __toESM(require("./plugins/babel-plugin-cedar-gqlorm-inject.js"));
|
|
48
|
+
var import_babel_plugin_cedar_graphql_options_extract = __toESM(require("./plugins/babel-plugin-cedar-graphql-options-extract.js"));
|
|
48
49
|
var import_babel_plugin_redwood_context_wrapping = __toESM(require("./plugins/babel-plugin-redwood-context-wrapping.js"));
|
|
49
50
|
var import_babel_plugin_redwood_directory_named_import = __toESM(require("./plugins/babel-plugin-redwood-directory-named-import.js"));
|
|
50
|
-
var import_babel_plugin_redwood_graphql_options_extract = __toESM(require("./plugins/babel-plugin-redwood-graphql-options-extract.js"));
|
|
51
51
|
var import_babel_plugin_redwood_import_dir = __toESM(require("./plugins/babel-plugin-redwood-import-dir.js"));
|
|
52
52
|
var import_babel_plugin_redwood_job_path_injector = __toESM(require("./plugins/babel-plugin-redwood-job-path-injector.js"));
|
|
53
53
|
var import_babel_plugin_redwood_otel_wrapping = __toESM(require("./plugins/babel-plugin-redwood-otel-wrapping.js"));
|
|
@@ -160,17 +160,21 @@ const getApiSideBabelConfigPath = () => {
|
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
|
-
const getApiSideBabelOverrides = ({
|
|
163
|
+
const getApiSideBabelOverrides = ({
|
|
164
|
+
projectIsEsm = false,
|
|
165
|
+
forJest = false
|
|
166
|
+
} = {}) => {
|
|
164
167
|
const overrides = [
|
|
165
168
|
// Extract graphql options from the graphql function
|
|
166
169
|
// NOTE: this must come before the context wrapping
|
|
167
170
|
{
|
|
168
171
|
// match */api/src/functions/graphql.js|ts
|
|
169
172
|
test: /.+api(?:[\\|/])src(?:[\\|/])functions(?:[\\|/])graphql\.(?:js|ts)$/,
|
|
170
|
-
plugins: [
|
|
173
|
+
plugins: [import_babel_plugin_cedar_graphql_options_extract.default, import_babel_plugin_cedar_gqlorm_inject.default]
|
|
171
174
|
},
|
|
172
|
-
// Apply context wrapping to all functions
|
|
173
|
-
|
|
175
|
+
// Apply context wrapping to all functions (Jest only; Vite uses
|
|
176
|
+
// cedarContextWrappingPlugin instead)
|
|
177
|
+
forJest && {
|
|
174
178
|
// match */api/src/functions/*.js|ts
|
|
175
179
|
test: /.+api(?:[\\|/])src(?:[\\|/])functions(?:[\\|/]).+.(?:js|ts)$/,
|
|
176
180
|
plugins: [
|
|
@@ -191,11 +195,14 @@ const getApiSideBabelOverrides = ({ projectIsEsm = false } = {}) => {
|
|
|
191
195
|
].filter(Boolean);
|
|
192
196
|
return overrides;
|
|
193
197
|
};
|
|
194
|
-
const getApiSideDefaultBabelConfig = ({
|
|
198
|
+
const getApiSideDefaultBabelConfig = ({
|
|
199
|
+
projectIsEsm = false,
|
|
200
|
+
forJest = false
|
|
201
|
+
} = {}) => {
|
|
195
202
|
return {
|
|
196
203
|
presets: getApiSideBabelPresets(),
|
|
197
204
|
plugins: getApiSideBabelPlugins({ projectIsEsm }),
|
|
198
|
-
overrides: getApiSideBabelOverrides({ projectIsEsm }),
|
|
205
|
+
overrides: getApiSideBabelOverrides({ projectIsEsm, forJest }),
|
|
199
206
|
extends: getApiSideBabelConfigPath(),
|
|
200
207
|
babelrc: false,
|
|
201
208
|
ignore: ["node_modules"]
|
|
@@ -219,20 +226,19 @@ const registerApiSideBabelHook = ({
|
|
|
219
226
|
...rest
|
|
220
227
|
});
|
|
221
228
|
};
|
|
222
|
-
const transformWithBabel = async (
|
|
223
|
-
const code = await import_node_fs.default.promises.readFile(srcPath, "utf-8");
|
|
229
|
+
const transformWithBabel = async (sourceCode, filename, plugins, sourceMaps = "inline") => {
|
|
224
230
|
const defaultOptions = getApiSideDefaultBabelConfig({
|
|
225
231
|
projectIsEsm: (0, import_project_config.projectSideIsEsm)("api")
|
|
226
232
|
});
|
|
227
|
-
const result = (0, import_core.transformAsync)(
|
|
233
|
+
const result = (0, import_core.transformAsync)(sourceCode, {
|
|
228
234
|
...defaultOptions,
|
|
229
235
|
cwd: (0, import_project_config.getPaths)().api.base,
|
|
230
|
-
filename
|
|
231
|
-
//
|
|
232
|
-
//
|
|
233
|
-
//
|
|
234
|
-
//
|
|
235
|
-
sourceMaps
|
|
236
|
+
filename,
|
|
237
|
+
// The default 'inline' embeds the map as a data URL in result.code,
|
|
238
|
+
// which esbuild consumes when it reads from the result. Vite callers
|
|
239
|
+
// pass sourceMaps: true because they extract result.map separately for
|
|
240
|
+
// SSR source map chaining.
|
|
241
|
+
sourceMaps,
|
|
236
242
|
plugins
|
|
237
243
|
});
|
|
238
244
|
return result;
|
|
@@ -2,4 +2,4 @@ import type { PluginObj, types } from '@babel/core';
|
|
|
2
2
|
export default function ({ types: t }: {
|
|
3
3
|
types: typeof types;
|
|
4
4
|
}): PluginObj;
|
|
5
|
-
//# sourceMappingURL=babel-plugin-
|
|
5
|
+
//# sourceMappingURL=babel-plugin-cedar-graphql-options-extract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babel-plugin-cedar-graphql-options-extract.d.ts","sourceRoot":"","sources":["../../src/plugins/babel-plugin-cedar-graphql-options-extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,SAAS,EAAc,KAAK,EAAE,MAAM,aAAa,CAAA;AAkCzE,MAAM,CAAC,OAAO,WAAW,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,GAAG,SAAS,CAyEzE"}
|
|
@@ -16,12 +16,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
default: () =>
|
|
19
|
+
var babel_plugin_cedar_graphql_options_extract_exports = {};
|
|
20
|
+
__export(babel_plugin_cedar_graphql_options_extract_exports, {
|
|
21
|
+
default: () => babel_plugin_cedar_graphql_options_extract_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
const exportVariableName = "
|
|
23
|
+
module.exports = __toCommonJS(babel_plugin_cedar_graphql_options_extract_exports);
|
|
24
|
+
const exportVariableName = "__cedar_graphqlOptions";
|
|
25
25
|
function optionsConstNode(t, value, state) {
|
|
26
26
|
if (t.isIdentifier(value) || t.isObjectExpression(value) || t.isCallExpression(value) || t.isConditionalExpression(value)) {
|
|
27
27
|
return t.exportNamedDeclaration(
|
|
@@ -35,9 +35,9 @@ function optionsConstNode(t, value, state) {
|
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function babel_plugin_cedar_graphql_options_extract_default({ types: t }) {
|
|
39
39
|
return {
|
|
40
|
-
name: "babel-plugin-
|
|
40
|
+
name: "babel-plugin-cedar-graphql-options-extract",
|
|
41
41
|
visitor: {
|
|
42
42
|
Program(path, state) {
|
|
43
43
|
const importNames = /* @__PURE__ */ new Set();
|
|
@@ -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":"
|
|
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/dist/web.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface Flags {
|
|
|
20
20
|
forVite?: boolean;
|
|
21
21
|
}
|
|
22
22
|
export declare const getWebSideBabelPlugins: ({ forJest, forVite }?: Flags) => TransformOptions[];
|
|
23
|
-
export declare const getWebSideOverrides: ({ forPrerender }?: Flags) => TransformOptions[];
|
|
23
|
+
export declare const getWebSideOverrides: ({ forPrerender, forVite }?: Flags) => TransformOptions[];
|
|
24
24
|
export declare const getWebSideBabelPresets: (options: Flags) => ((string | undefined)[] | (string | object)[])[];
|
|
25
25
|
export declare const getWebSideBabelConfigPath: () => string | undefined;
|
|
26
26
|
export declare const getWebSideDefaultBabelConfig: (options?: Flags) => {
|
package/dist/web.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAKnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAUtD,MAAM,WAAW,KAAK;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gEAAgE;IAChE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,sBAAsB,GACjC,uBAAsB,KAA0B,
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAKnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAUtD,MAAM,WAAW,KAAK;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gEAAgE;IAChE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,sBAAsB,GACjC,uBAAsB,KAA0B,uBAqGjD,CAAA;AAED,eAAO,MAAM,mBAAmB,GAC9B,4BAA2B,KAA+B,KACzD,gBAAgB,EAqClB,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,SAAS,KAAK,qDAwCpD,CAAA;AAED,eAAO,MAAM,yBAAyB,0BAOrC,CAAA;AAED,eAAO,MAAM,4BAA4B,GAAI,UAAS,KAAU;;;;;;;CAa/D,CAAA;AAGD,eAAO,MAAM,wBAAwB,GAAI,mCAItC,mBAAwB,SAY1B,CAAA"}
|
package/dist/web.js
CHANGED
|
@@ -115,7 +115,9 @@ const getWebSideBabelPlugins = ({ forJest, forVite } = { forJest: false }) => {
|
|
|
115
115
|
"rwjs-web-auto-import"
|
|
116
116
|
],
|
|
117
117
|
["babel-plugin-graphql-tag", void 0, "rwjs-babel-graphql-tag"],
|
|
118
|
-
|
|
118
|
+
// Prerender uses rollup-plugin-cedar-remove-dev-fatal-error-page
|
|
119
|
+
// Vite uses vite-plugin-cedar-remove-dev-fatal-error-page
|
|
120
|
+
forJest && process.env.NODE_ENV !== "development" && [
|
|
119
121
|
require("./plugins/babel-plugin-redwood-remove-dev-fatal-error-page").default,
|
|
120
122
|
void 0,
|
|
121
123
|
"rwjs-remove-dev-fatal-error-page"
|
|
@@ -123,11 +125,12 @@ const getWebSideBabelPlugins = ({ forJest, forVite } = { forJest: false }) => {
|
|
|
123
125
|
].filter(Boolean);
|
|
124
126
|
return plugins;
|
|
125
127
|
};
|
|
126
|
-
const getWebSideOverrides = ({ forPrerender } = { forPrerender: false }) => {
|
|
128
|
+
const getWebSideOverrides = ({ forPrerender, forVite } = { forPrerender: false }) => {
|
|
127
129
|
const overrides = [
|
|
128
130
|
// Automatically import files in `./web/src/pages/*` in to
|
|
129
131
|
// the `./web/src/Routes.[ts|jsx]` file.
|
|
130
|
-
|
|
132
|
+
// Vite uses vite-plugin-cedar-routes-auto-loader instead
|
|
133
|
+
!forVite && {
|
|
131
134
|
test: /src[\/\\]Routes.(js|tsx|jsx)$/,
|
|
132
135
|
plugins: [
|
|
133
136
|
[
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/babel-config",
|
|
3
|
-
"version": "4.2.1-next.
|
|
3
|
+
"version": "4.2.1-next.269",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -8,13 +8,16 @@
|
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"type": "commonjs",
|
|
11
|
-
"exports":
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./dist/index.js",
|
|
13
|
+
"./dist/plugins/*": "./dist/plugins/*"
|
|
14
|
+
},
|
|
12
15
|
"types": "./dist/index.d.ts",
|
|
13
16
|
"files": [
|
|
14
17
|
"dist"
|
|
15
18
|
],
|
|
16
19
|
"scripts": {
|
|
17
|
-
"build": "
|
|
20
|
+
"build": "node ./build.mts && run build:types",
|
|
18
21
|
"build:pack": "yarn pack -o cedarjs-babel-config.tgz",
|
|
19
22
|
"build:types": "tsc --build --verbose",
|
|
20
23
|
"build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"",
|
|
@@ -24,31 +27,31 @@
|
|
|
24
27
|
},
|
|
25
28
|
"dependencies": {
|
|
26
29
|
"@babel/core": "^7.26.10",
|
|
27
|
-
"@babel/parser": "7.29.
|
|
28
|
-
"@babel/plugin-transform-react-jsx": "7.
|
|
29
|
-
"@babel/plugin-transform-runtime": "7.29.
|
|
30
|
-
"@babel/preset-env": "7.29.
|
|
31
|
-
"@babel/preset-react": "7.
|
|
32
|
-
"@babel/preset-typescript": "7.
|
|
33
|
-
"@babel/register": "7.29.
|
|
34
|
-
"@babel/traverse": "7.29.
|
|
30
|
+
"@babel/parser": "7.29.7",
|
|
31
|
+
"@babel/plugin-transform-react-jsx": "7.29.7",
|
|
32
|
+
"@babel/plugin-transform-runtime": "7.29.7",
|
|
33
|
+
"@babel/preset-env": "7.29.7",
|
|
34
|
+
"@babel/preset-react": "7.29.7",
|
|
35
|
+
"@babel/preset-typescript": "7.29.7",
|
|
36
|
+
"@babel/register": "7.29.7",
|
|
37
|
+
"@babel/traverse": "7.29.7",
|
|
35
38
|
"@cedarjs/project-config": "4.2.0",
|
|
36
39
|
"babel-plugin-auto-import": "1.1.0",
|
|
37
40
|
"babel-plugin-graphql-tag": "3.3.0",
|
|
38
41
|
"babel-plugin-module-resolver": "5.0.3",
|
|
39
42
|
"fast-glob": "3.3.3",
|
|
40
|
-
"graphql": "16.
|
|
43
|
+
"graphql": "16.14.2",
|
|
41
44
|
"typescript": "5.9.3"
|
|
42
45
|
},
|
|
43
46
|
"devDependencies": {
|
|
44
47
|
"@cedarjs/framework-tools": "4.2.0",
|
|
48
|
+
"@jridgewell/trace-mapping": "0.3.31",
|
|
45
49
|
"@types/babel-plugin-tester": "11.0.0",
|
|
46
50
|
"@types/babel__core": "7.20.5",
|
|
47
51
|
"@types/babel__register": "7.17.3",
|
|
48
52
|
"@types/node": "24.10.4",
|
|
49
53
|
"babel-plugin-tester": "11.0.4",
|
|
50
|
-
"
|
|
51
|
-
"vitest": "3.2.4"
|
|
54
|
+
"vitest": "3.2.6"
|
|
52
55
|
},
|
|
53
56
|
"engines": {
|
|
54
57
|
"node": ">=24"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/api.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/common.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* We no longer prebuild files as part of the build process
|
|
3
|
-
* This is so we can test the babel configuration in isolation
|
|
4
|
-
*/
|
|
5
|
-
export declare const prebuildApiFileWrapper: (srcFile: string) => Promise<string>;
|
|
6
|
-
//# sourceMappingURL=prebuildApiFile.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prebuildApiFile.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/prebuildApiFile.test.ts"],"names":[],"mappings":"AAqCA;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAU,SAAS,MAAM,oBAY3D,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tsconfigParsing.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/tsconfigParsing.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-redwood-context-wrapping.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/__tests__/babel-plugin-redwood-context-wrapping.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-redwood-directory-named-imports.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/__tests__/babel-plugin-redwood-directory-named-imports.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-redwood-graphql-options-extract.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/__tests__/babel-plugin-redwood-graphql-options-extract.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-redwood-import-dir.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/__tests__/babel-plugin-redwood-import-dir.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-redwood-mock-cell-data.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/__tests__/babel-plugin-redwood-mock-cell-data.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-redwood-otel-wrapping.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/__tests__/babel-plugin-redwood-otel-wrapping.test.ts"],"names":[],"mappings":""}
|
package/dist/plugins/__tests__/babel-plugin-redwood-remove-dev-fatal-error-page.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-redwood-remove-dev-fatal-error-page.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/__tests__/babel-plugin-redwood-remove-dev-fatal-error-page.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-redwood-routes-auto-loader.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/__tests__/babel-plugin-redwood-routes-auto-loader.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-redwood-graphql-options-extract.d.ts","sourceRoot":"","sources":["../../src/plugins/babel-plugin-redwood-graphql-options-extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,SAAS,EAAc,KAAK,EAAE,MAAM,aAAa,CAAA;AAkCzE,MAAM,CAAC,OAAO,WAAW,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,GAAG,SAAS,CAyEzE"}
|