@cedarjs/internal 6.0.0-canary.2654 → 6.0.0-canary.2658
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/build/api.d.ts.map +1 -1
- package/dist/build/api.js +16 -0
- package/dist/build/esbuild-plugin-api-graphql.d.ts.map +1 -1
- package/dist/build/esbuild-plugin-api-graphql.js +6 -0
- package/dist/build/tsconfig-paths.d.ts +2 -0
- package/dist/build/tsconfig-paths.d.ts.map +1 -0
- package/dist/build/tsconfig-paths.js +72 -0
- package/dist/cjs/build/api.d.ts.map +1 -1
- package/dist/cjs/build/api.js +16 -0
- package/dist/cjs/build/esbuild-plugin-api-graphql.d.ts.map +1 -1
- package/dist/cjs/build/esbuild-plugin-api-graphql.js +6 -0
- package/dist/cjs/build/tsconfig-paths.d.ts +2 -0
- package/dist/cjs/build/tsconfig-paths.d.ts.map +1 -0
- package/dist/cjs/build/tsconfig-paths.js +106 -0
- package/package.json +12 -10
package/dist/build/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/build/api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,YAAY,EAAe,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/build/api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,YAAY,EAAe,MAAM,SAAS,CAAA;AA2CtE,eAAO,MAAM,QAAQ,4DAIpB,CAAA;AAED,eAAO,MAAM,UAAU,4DAStB,CAAA;AAED,eAAO,MAAM,aAAa,qBAGzB,CAAA;AAiQD,eAAO,MAAM,gBAAgB,iHAiE5B,CAAA;AAcD,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAoDf"}
|
package/dist/build/api.js
CHANGED
|
@@ -2,6 +2,12 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { build, context } from "esbuild";
|
|
4
4
|
import { build as viteBuild, normalizePath } from "vite";
|
|
5
|
+
import tsPathsMod from "vite-tsconfig-paths";
|
|
6
|
+
const tsconfigPaths = (
|
|
7
|
+
// @ts-expect-error – .default only exists at runtime in CJS double-wrap
|
|
8
|
+
// interop
|
|
9
|
+
tsPathsMod.default?.default || tsPathsMod.default || tsPathsMod
|
|
10
|
+
);
|
|
5
11
|
import {
|
|
6
12
|
getApiSideBabelPlugins,
|
|
7
13
|
transformWithBabel
|
|
@@ -24,6 +30,7 @@ import { applyOtelWrapping } from "./esbuild-plugin-cedar-otel-wrapping.js";
|
|
|
24
30
|
import { applyHandlerAlsWrapping } from "./esbuild-plugin-handler-als-wrapping.js";
|
|
25
31
|
import { applyImportDir } from "./import-dir.js";
|
|
26
32
|
import { applySrcAlias } from "./src-alias.js";
|
|
33
|
+
import { applyTsconfigPaths } from "./tsconfig-paths.js";
|
|
27
34
|
let BUILD_CTX = null;
|
|
28
35
|
const buildApi = async () => {
|
|
29
36
|
BUILD_CTX?.dispose();
|
|
@@ -55,6 +62,11 @@ const runCedarBabelTransformsPlugin = {
|
|
|
55
62
|
path.relative(build2.initialOptions.absWorkingDir + "/src", args.path)
|
|
56
63
|
)
|
|
57
64
|
);
|
|
65
|
+
fileContents = applyTsconfigPaths(
|
|
66
|
+
fileContents,
|
|
67
|
+
args.path,
|
|
68
|
+
getPaths().api.base
|
|
69
|
+
);
|
|
58
70
|
fileContents = applyDirectoryNamedImport(fileContents, args.path);
|
|
59
71
|
fileContents = applyAutoImports(fileContents);
|
|
60
72
|
fileContents = applyImportDir(fileContents, args.path)?.code ?? fileContents;
|
|
@@ -239,7 +251,11 @@ const buildApiWithVite = async () => {
|
|
|
239
251
|
// are expanded before Babel sees the code. The Babel import-dir plugin is
|
|
240
252
|
// disabled for forVite:true builds; this inline Vite plugin is its
|
|
241
253
|
// replacement for this code path (both CJS and ESM output via Rollup).
|
|
254
|
+
// tsconfigPaths resolves user-defined tsconfig.json `paths` aliases; it
|
|
255
|
+
// replaces the Babel module-resolver's tsconfig-paths handling for this
|
|
256
|
+
// code path.
|
|
242
257
|
plugins: [
|
|
258
|
+
tsconfigPaths(),
|
|
243
259
|
createImportDirVitePlugin(),
|
|
244
260
|
createDirectoryNamedImportVitePlugin(),
|
|
245
261
|
createCedarViteApiPlugin()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esbuild-plugin-api-graphql.d.ts","sourceRoot":"","sources":["../../src/build/esbuild-plugin-api-graphql.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"esbuild-plugin-api-graphql.d.ts","sourceRoot":"","sources":["../../src/build/esbuild-plugin-api-graphql.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAoB1C,eAAO,MAAM,qBAAqB;;iBAEnB,WAAW;CA0FzB,CAAA"}
|
|
@@ -15,6 +15,7 @@ import { applyOtelWrapping } from "./esbuild-plugin-cedar-otel-wrapping.js";
|
|
|
15
15
|
import { applyHandlerAlsWrapping } from "./esbuild-plugin-handler-als-wrapping.js";
|
|
16
16
|
import { applyImportDir } from "./import-dir.js";
|
|
17
17
|
import { applySrcAlias } from "./src-alias.js";
|
|
18
|
+
import { applyTsconfigPaths } from "./tsconfig-paths.js";
|
|
18
19
|
const cedarApiGraphqlPlugin = {
|
|
19
20
|
name: "cedar-api-graphql",
|
|
20
21
|
setup(build) {
|
|
@@ -27,6 +28,11 @@ const cedarApiGraphqlPlugin = {
|
|
|
27
28
|
path.relative(build.initialOptions.absWorkingDir + "/src", args.path)
|
|
28
29
|
)
|
|
29
30
|
);
|
|
31
|
+
fileContents = applyTsconfigPaths(
|
|
32
|
+
fileContents,
|
|
33
|
+
args.path,
|
|
34
|
+
getPaths().api.base
|
|
35
|
+
);
|
|
30
36
|
fileContents = applyDirectoryNamedImport(fileContents, args.path);
|
|
31
37
|
fileContents = applyGraphqlOptionsExtract(fileContents) ?? fileContents;
|
|
32
38
|
fileContents = applyGqlormInject(fileContents, args.path, ".js") ?? fileContents;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfig-paths.d.ts","sourceRoot":"","sources":["../../src/build/tsconfig-paths.ts"],"names":[],"mappings":"AA8FA,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAyCR"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { createMatchPath, loadConfig } from "tsconfig-paths";
|
|
3
|
+
import { importStatementPath, resolveFile } from "@cedarjs/project-config";
|
|
4
|
+
const EXCLUDED_PATH_KEY_RE = /src\/|\$api\/\*|types\/\*|@cedarjs\/.*/;
|
|
5
|
+
const RESOLVE_EXTENSIONS = [
|
|
6
|
+
".js",
|
|
7
|
+
".tsx",
|
|
8
|
+
".ts",
|
|
9
|
+
".jsx",
|
|
10
|
+
".mjs",
|
|
11
|
+
".mts",
|
|
12
|
+
".cjs"
|
|
13
|
+
];
|
|
14
|
+
const BARE_IMPORT_RE = /\bfrom\s+(['"])([^'"./][^'"]*)\1/g;
|
|
15
|
+
function getMatchPath(cwd) {
|
|
16
|
+
const config = loadConfig(cwd);
|
|
17
|
+
if (config.resultType === "failed") {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const paths = Object.fromEntries(
|
|
21
|
+
Object.entries(config.paths).filter(
|
|
22
|
+
([key]) => !EXCLUDED_PATH_KEY_RE.test(key)
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
if (Object.keys(paths).length === 0) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return createMatchPath(config.absoluteBaseUrl, paths);
|
|
29
|
+
}
|
|
30
|
+
function resolveToFile(candidate) {
|
|
31
|
+
if (resolveFile(candidate)) {
|
|
32
|
+
return candidate;
|
|
33
|
+
}
|
|
34
|
+
if (resolveFile(path.join(candidate, "index"))) {
|
|
35
|
+
return path.join(candidate, "index");
|
|
36
|
+
}
|
|
37
|
+
const basename = path.basename(candidate);
|
|
38
|
+
if (resolveFile(path.join(candidate, basename))) {
|
|
39
|
+
return path.join(candidate, basename);
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
function applyTsconfigPaths(code, filePath, cwd) {
|
|
44
|
+
const matchPath = getMatchPath(cwd);
|
|
45
|
+
if (!matchPath) {
|
|
46
|
+
return code;
|
|
47
|
+
}
|
|
48
|
+
return code.replace(
|
|
49
|
+
BARE_IMPORT_RE,
|
|
50
|
+
(full, quote, importPath) => {
|
|
51
|
+
const basename = importPath.split("/").pop();
|
|
52
|
+
const rawMatch = matchPath(importPath, void 0, void 0, RESOLVE_EXTENSIONS) ?? (basename && matchPath(
|
|
53
|
+
`${importPath}/${basename}`,
|
|
54
|
+
void 0,
|
|
55
|
+
void 0,
|
|
56
|
+
RESOLVE_EXTENSIONS
|
|
57
|
+
));
|
|
58
|
+
const resolved = rawMatch && resolveToFile(rawMatch);
|
|
59
|
+
if (!resolved) {
|
|
60
|
+
return full;
|
|
61
|
+
}
|
|
62
|
+
const relativePath = path.relative(path.dirname(filePath), resolved);
|
|
63
|
+
const formatted = importStatementPath(
|
|
64
|
+
relativePath.startsWith(".") ? relativePath : "./" + relativePath
|
|
65
|
+
);
|
|
66
|
+
return `from ${quote}${formatted}${quote}`;
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
applyTsconfigPaths
|
|
72
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/build/api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,YAAY,EAAe,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/build/api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,YAAY,EAAe,MAAM,SAAS,CAAA;AA2CtE,eAAO,MAAM,QAAQ,4DAIpB,CAAA;AAED,eAAO,MAAM,UAAU,4DAStB,CAAA;AAED,eAAO,MAAM,aAAa,qBAGzB,CAAA;AAiQD,eAAO,MAAM,gBAAgB,iHAiE5B,CAAA;AAcD,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAoDf"}
|
package/dist/cjs/build/api.js
CHANGED
|
@@ -39,6 +39,7 @@ var import_node_fs = __toESM(require("node:fs"), 1);
|
|
|
39
39
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
40
40
|
var import_esbuild = require("esbuild");
|
|
41
41
|
var import_vite = require("vite");
|
|
42
|
+
var import_vite_tsconfig_paths = __toESM(require("vite-tsconfig-paths"), 1);
|
|
42
43
|
var import_babel_config = require("@cedarjs/babel-config");
|
|
43
44
|
var import_project_config = require("@cedarjs/project-config");
|
|
44
45
|
var import_files = require("../files.js");
|
|
@@ -50,6 +51,12 @@ var import_esbuild_plugin_cedar_otel_wrapping = require("./esbuild-plugin-cedar-
|
|
|
50
51
|
var import_esbuild_plugin_handler_als_wrapping = require("./esbuild-plugin-handler-als-wrapping.js");
|
|
51
52
|
var import_import_dir = require("./import-dir.js");
|
|
52
53
|
var import_src_alias = require("./src-alias.js");
|
|
54
|
+
var import_tsconfig_paths = require("./tsconfig-paths.js");
|
|
55
|
+
const tsconfigPaths = (
|
|
56
|
+
// @ts-expect-error – .default only exists at runtime in CJS double-wrap
|
|
57
|
+
// interop
|
|
58
|
+
import_vite_tsconfig_paths.default.default?.default || import_vite_tsconfig_paths.default.default || import_vite_tsconfig_paths.default
|
|
59
|
+
);
|
|
53
60
|
let BUILD_CTX = null;
|
|
54
61
|
const buildApi = async () => {
|
|
55
62
|
BUILD_CTX?.dispose();
|
|
@@ -81,6 +88,11 @@ const runCedarBabelTransformsPlugin = {
|
|
|
81
88
|
import_node_path.default.relative(build2.initialOptions.absWorkingDir + "/src", args.path)
|
|
82
89
|
)
|
|
83
90
|
);
|
|
91
|
+
fileContents = (0, import_tsconfig_paths.applyTsconfigPaths)(
|
|
92
|
+
fileContents,
|
|
93
|
+
args.path,
|
|
94
|
+
(0, import_project_config.getPaths)().api.base
|
|
95
|
+
);
|
|
84
96
|
fileContents = (0, import_directory_named_import.applyDirectoryNamedImport)(fileContents, args.path);
|
|
85
97
|
fileContents = (0, import_auto_import.applyAutoImports)(fileContents);
|
|
86
98
|
fileContents = (0, import_import_dir.applyImportDir)(fileContents, args.path)?.code ?? fileContents;
|
|
@@ -265,7 +277,11 @@ const buildApiWithVite = async () => {
|
|
|
265
277
|
// are expanded before Babel sees the code. The Babel import-dir plugin is
|
|
266
278
|
// disabled for forVite:true builds; this inline Vite plugin is its
|
|
267
279
|
// replacement for this code path (both CJS and ESM output via Rollup).
|
|
280
|
+
// tsconfigPaths resolves user-defined tsconfig.json `paths` aliases; it
|
|
281
|
+
// replaces the Babel module-resolver's tsconfig-paths handling for this
|
|
282
|
+
// code path.
|
|
268
283
|
plugins: [
|
|
284
|
+
tsconfigPaths(),
|
|
269
285
|
createImportDirVitePlugin(),
|
|
270
286
|
createDirectoryNamedImportVitePlugin(),
|
|
271
287
|
createCedarViteApiPlugin()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esbuild-plugin-api-graphql.d.ts","sourceRoot":"","sources":["../../../src/build/esbuild-plugin-api-graphql.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"esbuild-plugin-api-graphql.d.ts","sourceRoot":"","sources":["../../../src/build/esbuild-plugin-api-graphql.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAoB1C,eAAO,MAAM,qBAAqB;;iBAEnB,WAAW;CA0FzB,CAAA"}
|
|
@@ -42,6 +42,7 @@ var import_esbuild_plugin_cedar_otel_wrapping = require("./esbuild-plugin-cedar-
|
|
|
42
42
|
var import_esbuild_plugin_handler_als_wrapping = require("./esbuild-plugin-handler-als-wrapping.js");
|
|
43
43
|
var import_import_dir = require("./import-dir.js");
|
|
44
44
|
var import_src_alias = require("./src-alias.js");
|
|
45
|
+
var import_tsconfig_paths = require("./tsconfig-paths.js");
|
|
45
46
|
const cedarApiGraphqlPlugin = {
|
|
46
47
|
name: "cedar-api-graphql",
|
|
47
48
|
setup(build) {
|
|
@@ -54,6 +55,11 @@ const cedarApiGraphqlPlugin = {
|
|
|
54
55
|
import_node_path.default.relative(build.initialOptions.absWorkingDir + "/src", args.path)
|
|
55
56
|
)
|
|
56
57
|
);
|
|
58
|
+
fileContents = (0, import_tsconfig_paths.applyTsconfigPaths)(
|
|
59
|
+
fileContents,
|
|
60
|
+
args.path,
|
|
61
|
+
(0, import_project_config.getPaths)().api.base
|
|
62
|
+
);
|
|
57
63
|
fileContents = (0, import_directory_named_import.applyDirectoryNamedImport)(fileContents, args.path);
|
|
58
64
|
fileContents = (0, import_api_graphql_transforms.applyGraphqlOptionsExtract)(fileContents) ?? fileContents;
|
|
59
65
|
fileContents = (0, import_api_graphql_transforms.applyGqlormInject)(fileContents, args.path, ".js") ?? fileContents;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfig-paths.d.ts","sourceRoot":"","sources":["../../../src/build/tsconfig-paths.ts"],"names":[],"mappings":"AA8FA,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAyCR"}
|
|
@@ -0,0 +1,106 @@
|
|
|
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 tsconfig_paths_exports = {};
|
|
30
|
+
__export(tsconfig_paths_exports, {
|
|
31
|
+
applyTsconfigPaths: () => applyTsconfigPaths
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(tsconfig_paths_exports);
|
|
34
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
|
+
var import_tsconfig_paths = require("tsconfig-paths");
|
|
36
|
+
var import_project_config = require("@cedarjs/project-config");
|
|
37
|
+
const EXCLUDED_PATH_KEY_RE = /src\/|\$api\/\*|types\/\*|@cedarjs\/.*/;
|
|
38
|
+
const RESOLVE_EXTENSIONS = [
|
|
39
|
+
".js",
|
|
40
|
+
".tsx",
|
|
41
|
+
".ts",
|
|
42
|
+
".jsx",
|
|
43
|
+
".mjs",
|
|
44
|
+
".mts",
|
|
45
|
+
".cjs"
|
|
46
|
+
];
|
|
47
|
+
const BARE_IMPORT_RE = /\bfrom\s+(['"])([^'"./][^'"]*)\1/g;
|
|
48
|
+
function getMatchPath(cwd) {
|
|
49
|
+
const config = (0, import_tsconfig_paths.loadConfig)(cwd);
|
|
50
|
+
if (config.resultType === "failed") {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const paths = Object.fromEntries(
|
|
54
|
+
Object.entries(config.paths).filter(
|
|
55
|
+
([key]) => !EXCLUDED_PATH_KEY_RE.test(key)
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
if (Object.keys(paths).length === 0) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return (0, import_tsconfig_paths.createMatchPath)(config.absoluteBaseUrl, paths);
|
|
62
|
+
}
|
|
63
|
+
function resolveToFile(candidate) {
|
|
64
|
+
if ((0, import_project_config.resolveFile)(candidate)) {
|
|
65
|
+
return candidate;
|
|
66
|
+
}
|
|
67
|
+
if ((0, import_project_config.resolveFile)(import_node_path.default.join(candidate, "index"))) {
|
|
68
|
+
return import_node_path.default.join(candidate, "index");
|
|
69
|
+
}
|
|
70
|
+
const basename = import_node_path.default.basename(candidate);
|
|
71
|
+
if ((0, import_project_config.resolveFile)(import_node_path.default.join(candidate, basename))) {
|
|
72
|
+
return import_node_path.default.join(candidate, basename);
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
function applyTsconfigPaths(code, filePath, cwd) {
|
|
77
|
+
const matchPath = getMatchPath(cwd);
|
|
78
|
+
if (!matchPath) {
|
|
79
|
+
return code;
|
|
80
|
+
}
|
|
81
|
+
return code.replace(
|
|
82
|
+
BARE_IMPORT_RE,
|
|
83
|
+
(full, quote, importPath) => {
|
|
84
|
+
const basename = importPath.split("/").pop();
|
|
85
|
+
const rawMatch = matchPath(importPath, void 0, void 0, RESOLVE_EXTENSIONS) ?? (basename && matchPath(
|
|
86
|
+
`${importPath}/${basename}`,
|
|
87
|
+
void 0,
|
|
88
|
+
void 0,
|
|
89
|
+
RESOLVE_EXTENSIONS
|
|
90
|
+
));
|
|
91
|
+
const resolved = rawMatch && resolveToFile(rawMatch);
|
|
92
|
+
if (!resolved) {
|
|
93
|
+
return full;
|
|
94
|
+
}
|
|
95
|
+
const relativePath = import_node_path.default.relative(import_node_path.default.dirname(filePath), resolved);
|
|
96
|
+
const formatted = (0, import_project_config.importStatementPath)(
|
|
97
|
+
relativePath.startsWith(".") ? relativePath : "./" + relativePath
|
|
98
|
+
);
|
|
99
|
+
return `from ${quote}${formatted}${quote}`;
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
+
0 && (module.exports = {
|
|
105
|
+
applyTsconfigPaths
|
|
106
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/internal",
|
|
3
|
-
"version": "6.0.0-canary.
|
|
3
|
+
"version": "6.0.0-canary.2658",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -169,13 +169,13 @@
|
|
|
169
169
|
"@babel/plugin-transform-react-jsx": "7.29.7",
|
|
170
170
|
"@babel/plugin-transform-typescript": "^7.26.8",
|
|
171
171
|
"@babel/traverse": "7.29.7",
|
|
172
|
-
"@cedarjs/babel-config": "6.0.0-canary.
|
|
173
|
-
"@cedarjs/cli-helpers": "6.0.0-canary.
|
|
174
|
-
"@cedarjs/graphql-server": "6.0.0-canary.
|
|
175
|
-
"@cedarjs/project-config": "6.0.0-canary.
|
|
176
|
-
"@cedarjs/router": "6.0.0-canary.
|
|
177
|
-
"@cedarjs/structure": "6.0.0-canary.
|
|
178
|
-
"@cedarjs/utils": "6.0.0-canary.
|
|
172
|
+
"@cedarjs/babel-config": "6.0.0-canary.2658",
|
|
173
|
+
"@cedarjs/cli-helpers": "6.0.0-canary.2658",
|
|
174
|
+
"@cedarjs/graphql-server": "6.0.0-canary.2658",
|
|
175
|
+
"@cedarjs/project-config": "6.0.0-canary.2658",
|
|
176
|
+
"@cedarjs/router": "6.0.0-canary.2658",
|
|
177
|
+
"@cedarjs/structure": "6.0.0-canary.2658",
|
|
178
|
+
"@cedarjs/utils": "6.0.0-canary.2658",
|
|
179
179
|
"@graphql-codegen/add": "6.0.1",
|
|
180
180
|
"@graphql-codegen/cli": "6.3.1",
|
|
181
181
|
"@graphql-codegen/client-preset": "5.3.0",
|
|
@@ -213,12 +213,14 @@
|
|
|
213
213
|
"systeminformation": "5.31.7",
|
|
214
214
|
"termi-link": "1.1.0",
|
|
215
215
|
"ts-node": "10.9.2",
|
|
216
|
+
"tsconfig-paths": "4.2.0",
|
|
216
217
|
"typescript": "5.9.3",
|
|
217
|
-
"vite": "7.3.5"
|
|
218
|
+
"vite": "7.3.5",
|
|
219
|
+
"vite-tsconfig-paths": "^6.1.1"
|
|
218
220
|
},
|
|
219
221
|
"devDependencies": {
|
|
220
222
|
"@arethetypeswrong/cli": "0.18.5",
|
|
221
|
-
"@cedarjs/framework-tools": "6.0.0-canary.
|
|
223
|
+
"@cedarjs/framework-tools": "6.0.0-canary.2658",
|
|
222
224
|
"concurrently": "9.2.1",
|
|
223
225
|
"graphql-tag": "2.12.6",
|
|
224
226
|
"publint": "0.3.21",
|