@cedarjs/babel-config 3.1.2-next.0 → 3.1.2-next.128
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 +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +7 -7
- package/dist/common.d.ts +1 -1
- package/dist/common.d.ts.map +1 -1
- package/dist/common.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/plugins/babel-plugin-redwood-routes-auto-loader.d.ts.map +1 -1
- package/dist/plugins/babel-plugin-redwood-routes-auto-loader.js +12 -3
- package/dist/web.d.ts +12 -2
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +14 -10
- package/package.json +6 -5
- package/dist/plugins/__tests__/babel-plugin-redwood-src-alias.test.d.ts +0 -2
- package/dist/plugins/__tests__/babel-plugin-redwood-src-alias.test.d.ts.map +0 -1
- package/dist/plugins/babel-plugin-redwood-src-alias.d.ts +0 -8
- package/dist/plugins/babel-plugin-redwood-src-alias.d.ts.map +0 -1
- package/dist/plugins/babel-plugin-redwood-src-alias.js +0 -72
package/dist/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PluginOptions, PluginTarget, TransformOptions } from '@babel/core';
|
|
2
|
-
import type { RegisterHookOptions } from './common';
|
|
2
|
+
import type { RegisterHookOptions } from './common.js';
|
|
3
3
|
export declare const TARGETS_NODE = "24";
|
|
4
4
|
export declare const getApiSideBabelPresets: ({ presetEnv }?: {
|
|
5
5
|
presetEnv: boolean;
|
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,
|
|
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;AActD,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;;CAA6B,KA6BhD,gBAAgB,EACrC,CAAA;AAED,eAAO,MAAM,4BAA4B,GAAI;;CAA6B;;;;;;;CASzE,CAAA;AAGD,eAAO,MAAM,wBAAwB,GAAI,uBAGtC,mBAAwB,SAe1B,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,SAAS,MAAM,EACf,SAAS,gBAAgB,CAAC,SAAS,CAAC,0DAoBrC,CAAA"}
|
package/dist/api.js
CHANGED
|
@@ -43,13 +43,13 @@ var import_node_path = __toESM(require("node:path"));
|
|
|
43
43
|
var import_core = require("@babel/core");
|
|
44
44
|
var import_babel_plugin_module_resolver = require("babel-plugin-module-resolver");
|
|
45
45
|
var import_project_config = require("@cedarjs/project-config");
|
|
46
|
-
var import_common = require("./common");
|
|
47
|
-
var import_babel_plugin_redwood_context_wrapping = __toESM(require("./plugins/babel-plugin-redwood-context-wrapping"));
|
|
48
|
-
var import_babel_plugin_redwood_directory_named_import = __toESM(require("./plugins/babel-plugin-redwood-directory-named-import"));
|
|
49
|
-
var import_babel_plugin_redwood_graphql_options_extract = __toESM(require("./plugins/babel-plugin-redwood-graphql-options-extract"));
|
|
50
|
-
var import_babel_plugin_redwood_import_dir = __toESM(require("./plugins/babel-plugin-redwood-import-dir"));
|
|
51
|
-
var import_babel_plugin_redwood_job_path_injector = __toESM(require("./plugins/babel-plugin-redwood-job-path-injector"));
|
|
52
|
-
var import_babel_plugin_redwood_otel_wrapping = __toESM(require("./plugins/babel-plugin-redwood-otel-wrapping"));
|
|
46
|
+
var import_common = require("./common.js");
|
|
47
|
+
var import_babel_plugin_redwood_context_wrapping = __toESM(require("./plugins/babel-plugin-redwood-context-wrapping.js"));
|
|
48
|
+
var import_babel_plugin_redwood_directory_named_import = __toESM(require("./plugins/babel-plugin-redwood-directory-named-import.js"));
|
|
49
|
+
var import_babel_plugin_redwood_graphql_options_extract = __toESM(require("./plugins/babel-plugin-redwood-graphql-options-extract.js"));
|
|
50
|
+
var import_babel_plugin_redwood_import_dir = __toESM(require("./plugins/babel-plugin-redwood-import-dir.js"));
|
|
51
|
+
var import_babel_plugin_redwood_job_path_injector = __toESM(require("./plugins/babel-plugin-redwood-job-path-injector.js"));
|
|
52
|
+
var import_babel_plugin_redwood_otel_wrapping = __toESM(require("./plugins/babel-plugin-redwood-otel-wrapping.js"));
|
|
53
53
|
const TARGETS_NODE = "24";
|
|
54
54
|
const getApiSideBabelPresets = ({ presetEnv } = { presetEnv: false }) => {
|
|
55
55
|
return [
|
package/dist/common.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PluginItem, PluginOptions, TransformOptions } from '@babel/core';
|
|
2
2
|
import type { RegisterOptions } from '@babel/register';
|
|
3
|
-
import type { Flags as WebFlags } from './web';
|
|
3
|
+
import type { Flags as WebFlags } from './web.js';
|
|
4
4
|
export interface RegisterHookOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Be careful: plugins are a nested array e.g. [[plug1, x, x], [plug2, y, y]].
|
package/dist/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAMtD,OAAO,KAAK,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAMtD,OAAO,KAAK,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;IACtB,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAA;IACzC,OAAO,CAAC,EAAE,QAAQ,CAAA;CACnB;AAED,sEAAsE;AACtE,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAkBD,eAAO,MAAM,aAAa,GAAI,SAAS,eAAe,SAOrD,CAAA;AAED,eAAO,MAAM,gBAAgB,QAAO,CAAC,MAAM,EAAE,aAAa,CAAC,EAE1D,CAAA;AAID,eAAO,MAAM,wBAAwB;;;;;;;OAgBpC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;CAuBtC,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,eAAe,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CACtE,CAAA;AACD;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GACvC,QAAQ,uBAAuB,EAC/B,SAAS,MAAM,KACd,MAAM,CAAC,MAAM,EAAE,MAAM,CAqCvB,CAAA"}
|
package/dist/common.js
CHANGED
|
@@ -39,7 +39,7 @@ var import_node_fs = __toESM(require("node:fs"));
|
|
|
39
39
|
var import_path = __toESM(require("path"));
|
|
40
40
|
var import_typescript = require("typescript");
|
|
41
41
|
var import_project_config = require("@cedarjs/project-config");
|
|
42
|
-
var import_web = require("./web");
|
|
42
|
+
var import_web = require("./web.js");
|
|
43
43
|
const registerBabel = (options) => {
|
|
44
44
|
require("@babel/register")(options);
|
|
45
45
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ getApiSideDefaultBabelConfig,
|
|
|
18
18
|
/** Used by @cedarjs/cli, @remix/cli-helpers and @cedarjs/prerender */
|
|
19
19
|
registerApiSideBabelHook,
|
|
20
20
|
/** Used by @cedarjs/internal and @cedarjs/vite */
|
|
21
|
-
transformWithBabel, } from './api';
|
|
21
|
+
transformWithBabel, } from './api.js';
|
|
22
22
|
export {
|
|
23
23
|
/**
|
|
24
24
|
* @deprecated This export isn't used by the framework, so it'll be removed
|
|
@@ -43,8 +43,8 @@ getWebSideDefaultBabelConfig,
|
|
|
43
43
|
*/
|
|
44
44
|
getWebSideOverrides,
|
|
45
45
|
/** Used by @cedarjs/prerender */
|
|
46
|
-
registerWebSideBabelHook, } from './web';
|
|
47
|
-
export type { Flags } from './web';
|
|
46
|
+
registerWebSideBabelHook, } from './web.js';
|
|
47
|
+
export type { Flags } from './web.js';
|
|
48
48
|
export {
|
|
49
49
|
/** Used by our eslint-config */
|
|
50
50
|
getCommonPlugins,
|
|
@@ -64,5 +64,5 @@ parseTypeScriptConfigFiles,
|
|
|
64
64
|
* @deprecated This export isn't used by the framework, so it'll be removed
|
|
65
65
|
* in a future version.
|
|
66
66
|
*/
|
|
67
|
-
registerBabel, } from './common';
|
|
67
|
+
registerBabel, } from './common.js';
|
|
68
68
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO;AACL;;;GAGG;AACH,YAAY;AACZ;;;GAGG;AACH,yBAAyB;AACzB,qDAAqD;AACrD,sBAAsB;AACtB,+BAA+B;AAC/B,sBAAsB;AACtB,0DAA0D;AAC1D,4BAA4B;AAC5B,sEAAsE;AACtE,wBAAwB;AACxB,kDAAkD;AAClD,kBAAkB,GACnB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO;AACL;;;GAGG;AACH,YAAY;AACZ;;;GAGG;AACH,yBAAyB;AACzB,qDAAqD;AACrD,sBAAsB;AACtB,+BAA+B;AAC/B,sBAAsB;AACtB,0DAA0D;AAC1D,4BAA4B;AAC5B,sEAAsE;AACtE,wBAAwB;AACxB,kDAAkD;AAClD,kBAAkB,GACnB,MAAM,UAAU,CAAA;AAEjB,OAAO;AACL;;;GAGG;AACH,yBAAyB;AACzB;;;GAGG;AACH,sBAAsB;AACtB;;;GAGG;AACH,sBAAsB;AACtB,mEAAmE;AACnE,4BAA4B;AAC5B;;;GAGG;AACH,mBAAmB;AACnB,iCAAiC;AACjC,wBAAwB,GACzB,MAAM,UAAU,CAAA;AAEjB,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAErC,OAAO;AACL,iCAAiC;AACjC,gBAAgB;AAChB;;;GAGG;AACH,4BAA4B,IAAI,kBAAkB;AAClD,mBAAmB;AACnB,wBAAwB;AACxB;;;GAGG;AACH,0BAA0B;AAC1B;;;GAGG;AACH,aAAa,GACd,MAAM,aAAa,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -16,8 +16,8 @@ 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(
|
|
19
|
+
var index_exports = {};
|
|
20
|
+
__export(index_exports, {
|
|
21
21
|
TARGETS_NODE: () => import_api.TARGETS_NODE,
|
|
22
22
|
getApiSideBabelConfigPath: () => import_api.getApiSideBabelConfigPath,
|
|
23
23
|
getApiSideBabelPlugins: () => import_api.getApiSideBabelPlugins,
|
|
@@ -37,10 +37,10 @@ __export(src_exports, {
|
|
|
37
37
|
registerWebSideBabelHook: () => import_web.registerWebSideBabelHook,
|
|
38
38
|
transformWithBabel: () => import_api.transformWithBabel
|
|
39
39
|
});
|
|
40
|
-
module.exports = __toCommonJS(
|
|
41
|
-
var import_api = require("./api");
|
|
42
|
-
var import_web = require("./web");
|
|
43
|
-
var import_common = require("./common");
|
|
40
|
+
module.exports = __toCommonJS(index_exports);
|
|
41
|
+
var import_api = require("./api.js");
|
|
42
|
+
var import_web = require("./web.js");
|
|
43
|
+
var import_common = require("./common.js");
|
|
44
44
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45
45
|
0 && (module.exports = {
|
|
46
46
|
TARGETS_NODE,
|
|
@@ -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;
|
|
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"}
|
|
@@ -31,13 +31,22 @@ __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
|
|
34
|
+
var import_node_path = __toESM(require("node:path"));
|
|
35
35
|
var import_project_config = require("@cedarjs/project-config");
|
|
36
36
|
const getPathRelativeToSrc = (maybeAbsolutePath) => {
|
|
37
|
-
if (
|
|
37
|
+
if (maybeAbsolutePath.startsWith("src/")) {
|
|
38
|
+
const basePath = import_node_path.default.join((0, import_project_config.getPaths)().web.base, maybeAbsolutePath);
|
|
39
|
+
const resolved = (0, import_project_config.resolveFile)(basePath) || (0, import_project_config.resolveFile)(import_node_path.default.join(basePath, "index")) || (0, import_project_config.resolveFile)(import_node_path.default.join(basePath, import_node_path.default.basename(basePath)));
|
|
40
|
+
if (resolved) {
|
|
41
|
+
const withoutExt = resolved.replace(/\.[^/.]+$/, "");
|
|
42
|
+
return "./" + import_node_path.default.relative((0, import_project_config.getPaths)().web.src, withoutExt);
|
|
43
|
+
}
|
|
44
|
+
return "./" + maybeAbsolutePath.slice("src/".length);
|
|
45
|
+
}
|
|
46
|
+
if (!import_node_path.default.isAbsolute(maybeAbsolutePath)) {
|
|
38
47
|
return maybeAbsolutePath;
|
|
39
48
|
}
|
|
40
|
-
return `./${
|
|
49
|
+
return `./${import_node_path.default.relative((0, import_project_config.getPaths)().web.src, maybeAbsolutePath)}`;
|
|
41
50
|
};
|
|
42
51
|
const withRelativeImports = (page) => {
|
|
43
52
|
return {
|
package/dist/web.d.ts
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import type { TransformOptions } from '@babel/core';
|
|
2
|
-
import type { RegisterHookOptions } from './common';
|
|
2
|
+
import type { RegisterHookOptions } from './common.js';
|
|
3
3
|
export interface Flags {
|
|
4
4
|
/**
|
|
5
5
|
* Will change the alias for module-resolver plugin and include a few extra
|
|
6
6
|
* babel plugins
|
|
7
7
|
*/
|
|
8
8
|
forJest?: boolean;
|
|
9
|
+
/** changes what babel-plugin-redwood-routes-auto-loader does */
|
|
9
10
|
forPrerender?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* will enable presets to supporting linting in the absence of typescript
|
|
13
|
+
* related presets/plugins/parsers
|
|
14
|
+
*/
|
|
10
15
|
forJavaScriptLinting?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* skip src/ alias and directory-named-import handling. The Vite
|
|
18
|
+
* `cedarjs-directory-named-import` plugin covers these
|
|
19
|
+
*/
|
|
20
|
+
forVite?: boolean;
|
|
11
21
|
}
|
|
12
|
-
export declare const getWebSideBabelPlugins: ({ forJest }?: Flags) => TransformOptions[];
|
|
22
|
+
export declare const getWebSideBabelPlugins: ({ forJest, forVite }?: Flags) => TransformOptions[];
|
|
13
23
|
export declare const getWebSideOverrides: ({ forPrerender }?: Flags) => TransformOptions[];
|
|
14
24
|
export declare const getWebSideBabelPresets: (options: Flags) => ((string | undefined)[] | (string | object)[])[];
|
|
15
25
|
export declare const getWebSideBabelConfigPath: () => string | undefined;
|
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;
|
|
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,uBAkGjD,CAAA;AAED,eAAO,MAAM,mBAAmB,GAC9B,mBAAkB,KAA+B,KAChD,gBAAgB,EAoClB,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
|
@@ -37,11 +37,11 @@ __export(web_exports, {
|
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(web_exports);
|
|
39
39
|
var import_node_fs = __toESM(require("node:fs"));
|
|
40
|
-
var
|
|
40
|
+
var import_node_path = __toESM(require("node:path"));
|
|
41
41
|
var import_babel_plugin_module_resolver = require("babel-plugin-module-resolver");
|
|
42
42
|
var import_project_config = require("@cedarjs/project-config");
|
|
43
|
-
var import_common = require("./common");
|
|
44
|
-
const getWebSideBabelPlugins = ({ forJest } = { forJest: false }) => {
|
|
43
|
+
var import_common = require("./common.js");
|
|
44
|
+
const getWebSideBabelPlugins = ({ forJest, forVite } = { forJest: false }) => {
|
|
45
45
|
const config = (0, import_project_config.getConfig)();
|
|
46
46
|
const useReactCompiler = config.experimental?.reactCompiler?.enabled && config.experimental?.reactCompiler?.lintOnly === false;
|
|
47
47
|
const useTrustedDocumentsGqlTag = config.graphql.trustedDocuments;
|
|
@@ -56,11 +56,12 @@ const getWebSideBabelPlugins = ({ forJest } = { forJest: false }) => {
|
|
|
56
56
|
"babel-plugin-module-resolver",
|
|
57
57
|
{
|
|
58
58
|
alias: {
|
|
59
|
-
|
|
60
|
-
// Jest monorepo and multi project runner is not correctly
|
|
61
|
-
// the `cwd`:
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
...!forVite && {
|
|
60
|
+
// Jest monorepo and multi project runner is not correctly
|
|
61
|
+
// determining the `cwd`:
|
|
62
|
+
// https://github.com/facebook/jest/issues/7359
|
|
63
|
+
src: forJest ? rwjsPaths.web.src : "./src"
|
|
64
|
+
},
|
|
64
65
|
// adds the paths from [ts|js]config.json to the module resolver
|
|
65
66
|
...(0, import_common.getPathsFromTypeScriptConfig)(tsConfigs.web, rwjsPaths.web.base),
|
|
66
67
|
$api: rwjsPaths.api.base
|
|
@@ -76,7 +77,10 @@ const getWebSideBabelPlugins = ({ forJest } = { forJest: false }) => {
|
|
|
76
77
|
},
|
|
77
78
|
"rwjs-module-resolver"
|
|
78
79
|
],
|
|
79
|
-
|
|
80
|
+
// Vite uses
|
|
81
|
+
// packages/vite/src/plugins/vite-plugin-cedarjs-directory-named-import.ts
|
|
82
|
+
// instead of this babel plugin
|
|
83
|
+
!forVite && [
|
|
80
84
|
require("./plugins/babel-plugin-redwood-directory-named-import").default,
|
|
81
85
|
void 0,
|
|
82
86
|
"rwjs-directory-named-modules"
|
|
@@ -186,7 +190,7 @@ const getWebSideBabelPresets = (options) => {
|
|
|
186
190
|
return [];
|
|
187
191
|
};
|
|
188
192
|
const getWebSideBabelConfigPath = () => {
|
|
189
|
-
const customBabelConfig =
|
|
193
|
+
const customBabelConfig = import_node_path.default.join((0, import_project_config.getPaths)().web.base, "babel.config.js");
|
|
190
194
|
if (import_node_fs.default.existsSync(customBabelConfig)) {
|
|
191
195
|
return customBabelConfig;
|
|
192
196
|
} else {
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/babel-config",
|
|
3
|
-
"version": "3.1.2-next.
|
|
3
|
+
"version": "3.1.2-next.128+165de00ea8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
7
7
|
"directory": "packages/babel-config"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
|
+
"type": "commonjs",
|
|
10
11
|
"exports": "./dist/index.js",
|
|
11
12
|
"types": "./dist/index.d.ts",
|
|
12
13
|
"files": [
|
|
@@ -31,16 +32,16 @@
|
|
|
31
32
|
"@babel/preset-typescript": "7.28.5",
|
|
32
33
|
"@babel/register": "7.28.6",
|
|
33
34
|
"@babel/traverse": "7.29.0",
|
|
34
|
-
"@cedarjs/project-config": "3.1.2-next.
|
|
35
|
+
"@cedarjs/project-config": "3.1.2-next.128+165de00ea8",
|
|
35
36
|
"babel-plugin-auto-import": "1.1.0",
|
|
36
37
|
"babel-plugin-graphql-tag": "3.3.0",
|
|
37
38
|
"babel-plugin-module-resolver": "5.0.3",
|
|
38
39
|
"fast-glob": "3.3.3",
|
|
39
|
-
"graphql": "16.13.
|
|
40
|
+
"graphql": "16.13.2",
|
|
40
41
|
"typescript": "5.9.3"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"@cedarjs/framework-tools": "3.1.2-next.
|
|
44
|
+
"@cedarjs/framework-tools": "3.1.2-next.128",
|
|
44
45
|
"@types/babel-plugin-tester": "11.0.0",
|
|
45
46
|
"@types/babel__core": "7.20.5",
|
|
46
47
|
"@types/babel__register": "7.17.3",
|
|
@@ -55,5 +56,5 @@
|
|
|
55
56
|
"publishConfig": {
|
|
56
57
|
"access": "public"
|
|
57
58
|
},
|
|
58
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "165de00ea86321332d0905102862b1165bcb726f"
|
|
59
60
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-redwood-src-alias.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/__tests__/babel-plugin-redwood-src-alias.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { PluginObj, types } from '@babel/core';
|
|
2
|
-
export default function ({ types: t }: {
|
|
3
|
-
types: typeof types;
|
|
4
|
-
}, options: {
|
|
5
|
-
/** absolute path to the `src` directory */
|
|
6
|
-
srcAbsPath: string;
|
|
7
|
-
}): PluginObj;
|
|
8
|
-
//# sourceMappingURL=babel-plugin-redwood-src-alias.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-redwood-src-alias.d.ts","sourceRoot":"","sources":["../../src/plugins/babel-plugin-redwood-src-alias.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnD,MAAM,CAAC,OAAO,WACZ,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,EACrC,OAAO,EAAE;IACP,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAA;CACnB,GACA,SAAS,CA6DX"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var babel_plugin_redwood_src_alias_exports = {};
|
|
30
|
-
__export(babel_plugin_redwood_src_alias_exports, {
|
|
31
|
-
default: () => babel_plugin_redwood_src_alias_default
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(babel_plugin_redwood_src_alias_exports);
|
|
34
|
-
var import_path = __toESM(require("path"));
|
|
35
|
-
function babel_plugin_redwood_src_alias_default({ types: t }, options) {
|
|
36
|
-
return {
|
|
37
|
-
name: "babel-plugin-redwood-src-alias",
|
|
38
|
-
visitor: {
|
|
39
|
-
ImportDeclaration(p, state) {
|
|
40
|
-
const { value } = p.node.source;
|
|
41
|
-
const { filename } = state.file.opts;
|
|
42
|
-
if (!filename || filename?.includes("/node_modules/") || !value.startsWith("src/")) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const absPath = import_path.default.join(options.srcAbsPath, value.substr(4));
|
|
46
|
-
let newImport = import_path.default.relative(import_path.default.dirname(filename), absPath);
|
|
47
|
-
if (process.platform === "win32") {
|
|
48
|
-
newImport = newImport.replaceAll("\\", "/");
|
|
49
|
-
}
|
|
50
|
-
if (!newImport.startsWith(".")) {
|
|
51
|
-
newImport = "./" + newImport;
|
|
52
|
-
}
|
|
53
|
-
const newSource = t.stringLiteral(newImport);
|
|
54
|
-
p.node.source = newSource;
|
|
55
|
-
},
|
|
56
|
-
ExportDeclaration(p, state) {
|
|
57
|
-
if (!p?.node?.source) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const { value } = p.node.source;
|
|
61
|
-
const { filename } = state.file.opts;
|
|
62
|
-
if (!filename || filename?.includes("/node_modules/") || !value.startsWith("src/")) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const absPath = import_path.default.join(options.srcAbsPath, value.substr(4));
|
|
66
|
-
const newImport = import_path.default.relative(import_path.default.dirname(filename), absPath);
|
|
67
|
-
const newSource = t.stringLiteral(newImport);
|
|
68
|
-
p.node.source = newSource;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
}
|