@workflow/builders 4.0.1-beta.5 → 4.0.1-beta.50
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/apply-swc-transform.d.ts +14 -4
- package/dist/apply-swc-transform.d.ts.map +1 -1
- package/dist/apply-swc-transform.js +59 -9
- package/dist/apply-swc-transform.js.map +1 -1
- package/dist/base-builder.d.ts +65 -22
- package/dist/base-builder.d.ts.map +1 -1
- package/dist/base-builder.js +438 -115
- package/dist/base-builder.js.map +1 -1
- package/dist/build-queue.d.ts +18 -0
- package/dist/build-queue.d.ts.map +1 -0
- package/dist/build-queue.js +26 -0
- package/dist/build-queue.js.map +1 -0
- package/dist/config-helpers.d.ts +31 -0
- package/dist/config-helpers.d.ts.map +1 -1
- package/dist/config-helpers.js +60 -0
- package/dist/config-helpers.js.map +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +2 -2
- package/dist/discover-entries-esbuild-plugin.d.ts +2 -3
- package/dist/discover-entries-esbuild-plugin.d.ts.map +1 -1
- package/dist/discover-entries-esbuild-plugin.js +57 -26
- package/dist/discover-entries-esbuild-plugin.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/module-specifier.d.ts +85 -0
- package/dist/module-specifier.d.ts.map +1 -0
- package/dist/module-specifier.js +437 -0
- package/dist/module-specifier.js.map +1 -0
- package/dist/module-specifier.test.d.ts +2 -0
- package/dist/module-specifier.test.d.ts.map +1 -0
- package/dist/module-specifier.test.js +169 -0
- package/dist/module-specifier.test.js.map +1 -0
- package/dist/node-module-esbuild-plugin.d.ts +37 -0
- package/dist/node-module-esbuild-plugin.d.ts.map +1 -1
- package/dist/node-module-esbuild-plugin.js +289 -9
- package/dist/node-module-esbuild-plugin.js.map +1 -1
- package/dist/node-module-esbuild-plugin.test.js +359 -88
- package/dist/node-module-esbuild-plugin.test.js.map +1 -1
- package/dist/pseudo-package-esbuild-plugin.d.ts +20 -0
- package/dist/pseudo-package-esbuild-plugin.d.ts.map +1 -0
- package/dist/pseudo-package-esbuild-plugin.js +47 -0
- package/dist/pseudo-package-esbuild-plugin.js.map +1 -0
- package/dist/pseudo-package-esbuild-plugin.test.d.ts +2 -0
- package/dist/pseudo-package-esbuild-plugin.test.d.ts.map +1 -0
- package/dist/pseudo-package-esbuild-plugin.test.js +315 -0
- package/dist/pseudo-package-esbuild-plugin.test.js.map +1 -0
- package/dist/request-converter.d.ts +3 -0
- package/dist/request-converter.d.ts.map +1 -0
- package/dist/request-converter.js +14 -0
- package/dist/request-converter.js.map +1 -0
- package/dist/standalone.d.ts +3 -0
- package/dist/standalone.d.ts.map +1 -1
- package/dist/standalone.js +37 -13
- package/dist/standalone.js.map +1 -1
- package/dist/swc-esbuild-plugin.d.ts +0 -2
- package/dist/swc-esbuild-plugin.d.ts.map +1 -1
- package/dist/swc-esbuild-plugin.js +33 -15
- package/dist/swc-esbuild-plugin.js.map +1 -1
- package/dist/transform-utils.d.ts +68 -0
- package/dist/transform-utils.d.ts.map +1 -0
- package/dist/transform-utils.js +97 -0
- package/dist/transform-utils.js.map +1 -0
- package/dist/transform-utils.test.d.ts +2 -0
- package/dist/transform-utils.test.d.ts.map +1 -0
- package/dist/transform-utils.test.js +266 -0
- package/dist/transform-utils.test.js.map +1 -0
- package/dist/types.d.ts +26 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -1
- package/dist/vercel-build-output-api.d.ts.map +1 -1
- package/dist/vercel-build-output-api.js +36 -14
- package/dist/vercel-build-output-api.js.map +1 -1
- package/dist/workflow-alias.d.ts +3 -0
- package/dist/workflow-alias.d.ts.map +1 -0
- package/dist/workflow-alias.js +46 -0
- package/dist/workflow-alias.js.map +1 -0
- package/dist/workflow-alias.test.d.ts +2 -0
- package/dist/workflow-alias.test.d.ts.map +1 -0
- package/dist/workflow-alias.test.js +46 -0
- package/dist/workflow-alias.test.js.map +1 -0
- package/dist/workflows-extractor.d.ts +92 -0
- package/dist/workflows-extractor.d.ts.map +1 -0
- package/dist/workflows-extractor.js +1476 -0
- package/dist/workflows-extractor.js.map +1 -0
- package/package.json +10 -9
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result of resolving a module specifier for a file.
|
|
3
|
+
*/
|
|
4
|
+
export interface ModuleSpecifierResult {
|
|
5
|
+
/**
|
|
6
|
+
* The module specifier to use for ID generation.
|
|
7
|
+
* - For packages: "{name}@{version}" or "{name}/{subpath}@{version}"
|
|
8
|
+
* (e.g., "point@1.0.0", "@myorg/shared@2.0.0", "workflow/internal/builtins@4.0.0")
|
|
9
|
+
* - For local files: undefined (plugin will use default "./relative/path" format)
|
|
10
|
+
*/
|
|
11
|
+
moduleSpecifier: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolve the module specifier for a file.
|
|
15
|
+
*
|
|
16
|
+
* @param filePath - Absolute path to the file being transformed
|
|
17
|
+
* @param projectRoot - Absolute path to the project root (usually process.cwd())
|
|
18
|
+
* @returns The module specifier result
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // File in node_modules (root export)
|
|
22
|
+
* resolveModuleSpecifier('/project/node_modules/point/dist/index.js', '/project')
|
|
23
|
+
* // => { moduleSpecifier: 'point@1.0.0' }
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // File in node_modules (subpath export)
|
|
27
|
+
* resolveModuleSpecifier('/project/node_modules/workflow/dist/internal/builtins.js', '/project')
|
|
28
|
+
* // => { moduleSpecifier: 'workflow/internal/builtins@4.0.0' }
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // File in workspace package
|
|
32
|
+
* resolveModuleSpecifier('/project/packages/shared/src/utils.ts', '/project')
|
|
33
|
+
* // => { moduleSpecifier: '@myorg/shared@0.0.0' }
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // Local app file
|
|
37
|
+
* resolveModuleSpecifier('/project/src/workflows/order.ts', '/project')
|
|
38
|
+
* // => { moduleSpecifier: undefined }
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolveModuleSpecifier(filePath: string, projectRoot: string): ModuleSpecifierResult;
|
|
41
|
+
/**
|
|
42
|
+
* Clear the package.json cache. Useful for testing or when package.json files may have changed.
|
|
43
|
+
*/
|
|
44
|
+
export declare function clearModuleSpecifierCache(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Result of resolving an import path for a file.
|
|
47
|
+
*/
|
|
48
|
+
export interface ImportPathResult {
|
|
49
|
+
/**
|
|
50
|
+
* The import path to use.
|
|
51
|
+
* - For workspace packages: the package name (e.g., "@myorg/shared")
|
|
52
|
+
* - For node_modules packages: the package name
|
|
53
|
+
* - For local files: a relative path (e.g., "./src/workflows/order.ts")
|
|
54
|
+
*/
|
|
55
|
+
importPath: string;
|
|
56
|
+
/**
|
|
57
|
+
* Whether this file is from a package (workspace or node_modules).
|
|
58
|
+
* When true, the import should go through package resolution which respects export conditions.
|
|
59
|
+
*/
|
|
60
|
+
isPackage: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get the import path to use for a file in a bundle's virtual entry.
|
|
64
|
+
*
|
|
65
|
+
* For workspace packages and node_modules packages, returns the package name
|
|
66
|
+
* so that bundler resolution will respect package.json exports and conditions.
|
|
67
|
+
*
|
|
68
|
+
* For local app files, returns a relative path.
|
|
69
|
+
*
|
|
70
|
+
* @param filePath - Absolute path to the file
|
|
71
|
+
* @param projectRoot - Absolute path to the project root
|
|
72
|
+
* @returns The import path and whether it's a package
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* // Workspace package
|
|
76
|
+
* getImportPath('/project/packages/shared/src/index.ts', '/project')
|
|
77
|
+
* // => { importPath: '@myorg/shared', isPackage: true }
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* // Local app file
|
|
81
|
+
* getImportPath('/project/src/workflows/order.ts', '/project')
|
|
82
|
+
* // => { importPath: './src/workflows/order.ts', isPackage: false }
|
|
83
|
+
*/
|
|
84
|
+
export declare function getImportPath(filePath: string, projectRoot: string): ImportPathResult;
|
|
85
|
+
//# sourceMappingURL=module-specifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-specifier.d.ts","sourceRoot":"","sources":["../src/module-specifier.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAgQD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,qBAAqB,CA6BvB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAGhD;AA0HD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,gBAAgB,CA8ClB"}
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, relative, resolve, sep } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Cache for package.json lookups to avoid repeated filesystem reads.
|
|
5
|
+
* Maps directory path to parsed package.json info or null if not found.
|
|
6
|
+
*/
|
|
7
|
+
const packageJsonCache = new Map();
|
|
8
|
+
/**
|
|
9
|
+
* Find and read the nearest package.json for a given file path.
|
|
10
|
+
* Results are cached for performance.
|
|
11
|
+
*/
|
|
12
|
+
function findPackageJson(filePath) {
|
|
13
|
+
let dir = dirname(filePath);
|
|
14
|
+
// Track directories we've visited so we can back-fill the cache
|
|
15
|
+
const visitedDirs = [];
|
|
16
|
+
// Walk up the directory tree until we hit the root
|
|
17
|
+
while (dir !== dirname(dir)) {
|
|
18
|
+
// Check cache first
|
|
19
|
+
const cached = packageJsonCache.get(dir);
|
|
20
|
+
if (cached !== undefined) {
|
|
21
|
+
// Back-fill cache for all visited directories with the same result
|
|
22
|
+
for (const visitedDir of visitedDirs) {
|
|
23
|
+
packageJsonCache.set(visitedDir, cached);
|
|
24
|
+
}
|
|
25
|
+
return cached;
|
|
26
|
+
}
|
|
27
|
+
visitedDirs.push(dir);
|
|
28
|
+
const packageJsonPath = join(dir, 'package.json');
|
|
29
|
+
if (existsSync(packageJsonPath)) {
|
|
30
|
+
try {
|
|
31
|
+
const content = readFileSync(packageJsonPath, 'utf-8');
|
|
32
|
+
const parsed = JSON.parse(content);
|
|
33
|
+
if (parsed.name && parsed.version) {
|
|
34
|
+
const result = {
|
|
35
|
+
name: parsed.name,
|
|
36
|
+
version: parsed.version,
|
|
37
|
+
dir,
|
|
38
|
+
exports: parsed.exports,
|
|
39
|
+
main: parsed.main,
|
|
40
|
+
module: parsed.module,
|
|
41
|
+
};
|
|
42
|
+
// Cache the result for this directory and all visited directories
|
|
43
|
+
packageJsonCache.set(dir, result);
|
|
44
|
+
for (const visitedDir of visitedDirs) {
|
|
45
|
+
packageJsonCache.set(visitedDir, result);
|
|
46
|
+
}
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// Invalid JSON or missing fields, continue searching
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
dir = dirname(dir);
|
|
55
|
+
}
|
|
56
|
+
// No package.json found - cache null for all visited directories
|
|
57
|
+
for (const visitedDir of visitedDirs) {
|
|
58
|
+
packageJsonCache.set(visitedDir, null);
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Resolve the export subpath for a file within a package.
|
|
64
|
+
* Looks up the package.json exports field to find which subpath maps to the file.
|
|
65
|
+
*
|
|
66
|
+
* @param filePath - Absolute path to the file
|
|
67
|
+
* @param pkg - Package info from findPackageJson
|
|
68
|
+
* @returns The subpath (e.g., "/internal/builtins") or empty string for root export
|
|
69
|
+
*/
|
|
70
|
+
function resolveExportSubpath(filePath, pkg) {
|
|
71
|
+
if (!pkg.exports || typeof pkg.exports !== 'object') {
|
|
72
|
+
return '';
|
|
73
|
+
}
|
|
74
|
+
// Get the relative path from package root to the file
|
|
75
|
+
const normalizedFilePath = filePath.replace(/\\/g, '/');
|
|
76
|
+
const normalizedPkgDir = pkg.dir.replace(/\\/g, '/');
|
|
77
|
+
const relativePath = normalizedFilePath.startsWith(normalizedPkgDir + '/')
|
|
78
|
+
? './' + normalizedFilePath.substring(normalizedPkgDir.length + 1)
|
|
79
|
+
: null;
|
|
80
|
+
if (!relativePath) {
|
|
81
|
+
return '';
|
|
82
|
+
}
|
|
83
|
+
// Search through exports to find a matching subpath
|
|
84
|
+
for (const [subpath, target] of Object.entries(pkg.exports)) {
|
|
85
|
+
const resolvedTarget = resolveExportTarget(target);
|
|
86
|
+
if (resolvedTarget &&
|
|
87
|
+
normalizeExportPath(resolvedTarget) === relativePath) {
|
|
88
|
+
// Found a match - return the subpath without the leading "."
|
|
89
|
+
// e.g., "./internal/builtins" -> "/internal/builtins"
|
|
90
|
+
return subpath === '.' ? '' : subpath.substring(1);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return '';
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Resolve an export target to a file path, handling conditional exports and arrays.
|
|
97
|
+
*/
|
|
98
|
+
function resolveExportTarget(target) {
|
|
99
|
+
if (typeof target === 'string') {
|
|
100
|
+
return target;
|
|
101
|
+
}
|
|
102
|
+
// Handle array exports (fallback chains)
|
|
103
|
+
if (Array.isArray(target)) {
|
|
104
|
+
for (const item of target) {
|
|
105
|
+
const resolved = resolveExportTarget(item);
|
|
106
|
+
if (resolved)
|
|
107
|
+
return resolved;
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
if (target && typeof target === 'object') {
|
|
112
|
+
// Conditional export - try common conditions in order of preference
|
|
113
|
+
const conditions = ['workflow', 'default', 'require', 'import', 'node'];
|
|
114
|
+
for (const condition of conditions) {
|
|
115
|
+
const value = target[condition];
|
|
116
|
+
if (typeof value === 'string') {
|
|
117
|
+
return value;
|
|
118
|
+
}
|
|
119
|
+
// Handle nested conditionals or arrays
|
|
120
|
+
if (value && typeof value === 'object') {
|
|
121
|
+
const nested = resolveExportTarget(value);
|
|
122
|
+
if (nested)
|
|
123
|
+
return nested;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Normalize an export path for comparison.
|
|
131
|
+
*/
|
|
132
|
+
function normalizeExportPath(path) {
|
|
133
|
+
// Ensure it starts with ./
|
|
134
|
+
if (!path.startsWith('./')) {
|
|
135
|
+
return './' + path;
|
|
136
|
+
}
|
|
137
|
+
return path;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Check if a file path is inside node_modules.
|
|
141
|
+
*/
|
|
142
|
+
function isInNodeModules(filePath) {
|
|
143
|
+
const normalizedPath = filePath.split(sep).join('/');
|
|
144
|
+
return normalizedPath.includes('/node_modules/');
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Cache for project dependencies to avoid repeated filesystem reads.
|
|
148
|
+
* Maps project root to set of dependency package names.
|
|
149
|
+
*/
|
|
150
|
+
const projectDepsCache = new Map();
|
|
151
|
+
/**
|
|
152
|
+
* Get all dependencies (including devDependencies) for a project.
|
|
153
|
+
*/
|
|
154
|
+
function getProjectDependencies(projectRoot) {
|
|
155
|
+
const cached = projectDepsCache.get(projectRoot);
|
|
156
|
+
if (cached) {
|
|
157
|
+
return cached;
|
|
158
|
+
}
|
|
159
|
+
const deps = new Set();
|
|
160
|
+
const pkgPath = join(projectRoot, 'package.json');
|
|
161
|
+
if (existsSync(pkgPath)) {
|
|
162
|
+
try {
|
|
163
|
+
const content = readFileSync(pkgPath, 'utf-8');
|
|
164
|
+
const parsed = JSON.parse(content);
|
|
165
|
+
// Collect all dependency types
|
|
166
|
+
for (const depType of [
|
|
167
|
+
'dependencies',
|
|
168
|
+
'devDependencies',
|
|
169
|
+
'peerDependencies',
|
|
170
|
+
'optionalDependencies',
|
|
171
|
+
]) {
|
|
172
|
+
const depObj = parsed[depType];
|
|
173
|
+
if (depObj && typeof depObj === 'object') {
|
|
174
|
+
for (const name of Object.keys(depObj)) {
|
|
175
|
+
deps.add(name);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
// Invalid JSON or file not readable
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
projectDepsCache.set(projectRoot, deps);
|
|
185
|
+
return deps;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Check if a file path is inside a workspace package that is a dependency of the project.
|
|
189
|
+
* This is a heuristic - we check if the file is in a directory with a package.json
|
|
190
|
+
* that has a "name" field, is NOT in node_modules, and is listed as a dependency
|
|
191
|
+
* of the project.
|
|
192
|
+
*/
|
|
193
|
+
function isWorkspacePackage(filePath, projectRoot) {
|
|
194
|
+
if (isInNodeModules(filePath)) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
const pkg = findPackageJson(filePath);
|
|
198
|
+
if (!pkg) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
// Check if the package.json is not the root package.json
|
|
202
|
+
// Use resolve() to normalize paths for cross-platform comparison
|
|
203
|
+
const rootPkgDir = resolve(projectRoot);
|
|
204
|
+
const pkgDir = resolve(pkg.dir);
|
|
205
|
+
// If the package directory is the project root, it's not a workspace package
|
|
206
|
+
if (pkgDir === rootPkgDir) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
// Found a package.json that's not the root.
|
|
210
|
+
// Only treat it as a workspace package if it's actually a dependency
|
|
211
|
+
// of the current project. This prevents sibling apps in a monorepo
|
|
212
|
+
// from being incorrectly treated as importable packages.
|
|
213
|
+
const projectDeps = getProjectDependencies(projectRoot);
|
|
214
|
+
return projectDeps.has(pkg.name);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Resolve the module specifier for a file.
|
|
218
|
+
*
|
|
219
|
+
* @param filePath - Absolute path to the file being transformed
|
|
220
|
+
* @param projectRoot - Absolute path to the project root (usually process.cwd())
|
|
221
|
+
* @returns The module specifier result
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* // File in node_modules (root export)
|
|
225
|
+
* resolveModuleSpecifier('/project/node_modules/point/dist/index.js', '/project')
|
|
226
|
+
* // => { moduleSpecifier: 'point@1.0.0' }
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* // File in node_modules (subpath export)
|
|
230
|
+
* resolveModuleSpecifier('/project/node_modules/workflow/dist/internal/builtins.js', '/project')
|
|
231
|
+
* // => { moduleSpecifier: 'workflow/internal/builtins@4.0.0' }
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* // File in workspace package
|
|
235
|
+
* resolveModuleSpecifier('/project/packages/shared/src/utils.ts', '/project')
|
|
236
|
+
* // => { moduleSpecifier: '@myorg/shared@0.0.0' }
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* // Local app file
|
|
240
|
+
* resolveModuleSpecifier('/project/src/workflows/order.ts', '/project')
|
|
241
|
+
* // => { moduleSpecifier: undefined }
|
|
242
|
+
*/
|
|
243
|
+
export function resolveModuleSpecifier(filePath, projectRoot) {
|
|
244
|
+
// Check if file is in node_modules or a workspace package
|
|
245
|
+
const inNodeModules = isInNodeModules(filePath);
|
|
246
|
+
const inWorkspace = !inNodeModules && isWorkspacePackage(filePath, projectRoot);
|
|
247
|
+
if (!inNodeModules && !inWorkspace) {
|
|
248
|
+
// Local app file - use default relative path format
|
|
249
|
+
return { moduleSpecifier: undefined };
|
|
250
|
+
}
|
|
251
|
+
// Find the package.json for this file
|
|
252
|
+
const pkg = findPackageJson(filePath);
|
|
253
|
+
if (!pkg) {
|
|
254
|
+
// Couldn't find package.json - fall back to default
|
|
255
|
+
return { moduleSpecifier: undefined };
|
|
256
|
+
}
|
|
257
|
+
// Resolve the export subpath (e.g., "/internal/builtins" for "workflow/internal/builtins")
|
|
258
|
+
const subpath = resolveExportSubpath(filePath, pkg);
|
|
259
|
+
// Return the module specifier as "name/subpath@version" or "name@version"
|
|
260
|
+
const specifier = subpath
|
|
261
|
+
? `${pkg.name}${subpath}@${pkg.version}`
|
|
262
|
+
: `${pkg.name}@${pkg.version}`;
|
|
263
|
+
return {
|
|
264
|
+
moduleSpecifier: specifier,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Clear the package.json cache. Useful for testing or when package.json files may have changed.
|
|
269
|
+
*/
|
|
270
|
+
export function clearModuleSpecifierCache() {
|
|
271
|
+
packageJsonCache.clear();
|
|
272
|
+
projectDepsCache.clear();
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Convert a file path to a relative import path from project root.
|
|
276
|
+
*/
|
|
277
|
+
function toRelativeImportPath(filePath, projectRoot) {
|
|
278
|
+
const normalizedProjectRoot = projectRoot.replace(/\\/g, '/');
|
|
279
|
+
const normalizedFilePath = filePath.replace(/\\/g, '/');
|
|
280
|
+
let relativePath;
|
|
281
|
+
if (normalizedFilePath.startsWith(normalizedProjectRoot + '/')) {
|
|
282
|
+
relativePath = normalizedFilePath.substring(normalizedProjectRoot.length + 1);
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
// File is outside project root, use the full path segments after common ancestor
|
|
286
|
+
relativePath = relative(projectRoot, filePath).replace(/\\/g, '/');
|
|
287
|
+
}
|
|
288
|
+
// Ensure relative paths start with ./
|
|
289
|
+
if (!relativePath.startsWith('.')) {
|
|
290
|
+
relativePath = `./${relativePath}`;
|
|
291
|
+
}
|
|
292
|
+
return relativePath;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Returns true when package exports include a root entry (".").
|
|
296
|
+
* String/array/conditional object exports are all considered root exports.
|
|
297
|
+
*/
|
|
298
|
+
function hasRootExport(exportsField) {
|
|
299
|
+
if (typeof exportsField === 'string' || Array.isArray(exportsField)) {
|
|
300
|
+
return true;
|
|
301
|
+
}
|
|
302
|
+
if (!exportsField || typeof exportsField !== 'object') {
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
const keys = Object.keys(exportsField);
|
|
306
|
+
// Conditional exports object (e.g. { "import": "...", "default": "..." })
|
|
307
|
+
// represents the root export.
|
|
308
|
+
if (keys.length > 0 && keys.every((key) => !key.startsWith('.'))) {
|
|
309
|
+
return true;
|
|
310
|
+
}
|
|
311
|
+
return '.' in exportsField;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Normalize a package target path to a comparable package-relative path.
|
|
315
|
+
* Returns null for invalid/unsupported paths.
|
|
316
|
+
*/
|
|
317
|
+
function normalizePackageTargetPath(path) {
|
|
318
|
+
const normalized = path.replace(/\\/g, '/');
|
|
319
|
+
if (normalized.startsWith('./')) {
|
|
320
|
+
return normalized.substring(2);
|
|
321
|
+
}
|
|
322
|
+
if (normalized.startsWith('/')) {
|
|
323
|
+
return normalized.substring(1);
|
|
324
|
+
}
|
|
325
|
+
return normalized;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Returns true if filePath is the package root entrypoint.
|
|
329
|
+
* This checks root exports first, then main/module/index fallbacks when exports are absent.
|
|
330
|
+
*/
|
|
331
|
+
function isRootEntrypointFile(filePath, pkg) {
|
|
332
|
+
const normalizedFilePath = filePath.replace(/\\/g, '/');
|
|
333
|
+
const normalizedPkgDir = pkg.dir.replace(/\\/g, '/');
|
|
334
|
+
if (!normalizedFilePath.startsWith(normalizedPkgDir + '/')) {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
const relativeFilePath = normalizedFilePath.substring(normalizedPkgDir.length + 1);
|
|
338
|
+
if (pkg.exports) {
|
|
339
|
+
let rootTarget;
|
|
340
|
+
if (typeof pkg.exports === 'object' &&
|
|
341
|
+
!Array.isArray(pkg.exports) &&
|
|
342
|
+
'.' in pkg.exports) {
|
|
343
|
+
rootTarget = pkg.exports['.'];
|
|
344
|
+
}
|
|
345
|
+
else if (hasRootExport(pkg.exports)) {
|
|
346
|
+
rootTarget = pkg.exports;
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
const resolvedTarget = resolveExportTarget(rootTarget);
|
|
352
|
+
if (!resolvedTarget) {
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
const normalizedTarget = normalizePackageTargetPath(resolvedTarget);
|
|
356
|
+
return normalizedTarget === relativeFilePath;
|
|
357
|
+
}
|
|
358
|
+
const rootCandidates = [
|
|
359
|
+
pkg.module,
|
|
360
|
+
pkg.main,
|
|
361
|
+
'index.js',
|
|
362
|
+
'index.mjs',
|
|
363
|
+
'index.cjs',
|
|
364
|
+
'index.ts',
|
|
365
|
+
'index.mts',
|
|
366
|
+
'index.cts',
|
|
367
|
+
]
|
|
368
|
+
.filter((candidate) => typeof candidate === 'string')
|
|
369
|
+
.map((candidate) => normalizePackageTargetPath(candidate))
|
|
370
|
+
.filter((candidate) => candidate !== null);
|
|
371
|
+
return rootCandidates.includes(relativeFilePath);
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Get the import path to use for a file in a bundle's virtual entry.
|
|
375
|
+
*
|
|
376
|
+
* For workspace packages and node_modules packages, returns the package name
|
|
377
|
+
* so that bundler resolution will respect package.json exports and conditions.
|
|
378
|
+
*
|
|
379
|
+
* For local app files, returns a relative path.
|
|
380
|
+
*
|
|
381
|
+
* @param filePath - Absolute path to the file
|
|
382
|
+
* @param projectRoot - Absolute path to the project root
|
|
383
|
+
* @returns The import path and whether it's a package
|
|
384
|
+
*
|
|
385
|
+
* @example
|
|
386
|
+
* // Workspace package
|
|
387
|
+
* getImportPath('/project/packages/shared/src/index.ts', '/project')
|
|
388
|
+
* // => { importPath: '@myorg/shared', isPackage: true }
|
|
389
|
+
*
|
|
390
|
+
* @example
|
|
391
|
+
* // Local app file
|
|
392
|
+
* getImportPath('/project/src/workflows/order.ts', '/project')
|
|
393
|
+
* // => { importPath: './src/workflows/order.ts', isPackage: false }
|
|
394
|
+
*/
|
|
395
|
+
export function getImportPath(filePath, projectRoot) {
|
|
396
|
+
// Check if file is in node_modules or a workspace package
|
|
397
|
+
const inNodeModules = isInNodeModules(filePath);
|
|
398
|
+
const inWorkspace = !inNodeModules && isWorkspacePackage(filePath, projectRoot);
|
|
399
|
+
if (inNodeModules || inWorkspace) {
|
|
400
|
+
// Find the package.json for this file
|
|
401
|
+
const pkg = findPackageJson(filePath);
|
|
402
|
+
if (pkg) {
|
|
403
|
+
// Prefer a package subpath import when this file maps to an export.
|
|
404
|
+
// This preserves the exact module being bundled while still respecting
|
|
405
|
+
// package export conditions.
|
|
406
|
+
// Note: resolveExportSubpath returns "" for both root "." matches and
|
|
407
|
+
// no match; root entrypoints are intentionally handled below via
|
|
408
|
+
// isRootEntrypointFile().
|
|
409
|
+
const subpath = resolveExportSubpath(filePath, pkg);
|
|
410
|
+
if (subpath) {
|
|
411
|
+
return {
|
|
412
|
+
importPath: `${pkg.name}${subpath}`,
|
|
413
|
+
isPackage: true,
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
// Only import package root when this file is the root entrypoint.
|
|
417
|
+
// For deep/internal files, fall back to direct relative imports so we
|
|
418
|
+
// don't accidentally import a non-existent or different module.
|
|
419
|
+
if (!isRootEntrypointFile(filePath, pkg)) {
|
|
420
|
+
return {
|
|
421
|
+
importPath: toRelativeImportPath(filePath, projectRoot),
|
|
422
|
+
isPackage: false,
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
return {
|
|
426
|
+
importPath: pkg.name,
|
|
427
|
+
isPackage: true,
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
// Local app file - use relative path
|
|
432
|
+
return {
|
|
433
|
+
importPath: toRelativeImportPath(filePath, projectRoot),
|
|
434
|
+
isPackage: false,
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
//# sourceMappingURL=module-specifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-specifier.js","sourceRoot":"","sources":["../src/module-specifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AA2BlE;;;GAGG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA8B,CAAC;AAE/D;;;GAGG;AACH,SAAS,eAAe,CAAC,QAAgB;IACvC,IAAI,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE5B,gEAAgE;IAChE,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,mDAAmD;IACnD,OAAO,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,oBAAoB;QACpB,MAAM,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,mEAAmE;YACnE,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;gBACrC,gBAAgB,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,WAAW,CAAC,I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