@webiny/project 6.4.11 → 6.4.12-beta.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/project",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.12-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -13,37 +13,37 @@
|
|
|
13
13
|
"description": "An SDK for managing Webiny projects.",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@webiny/aws-sdk": "6.4.
|
|
17
|
-
"@webiny/build-tools": "6.4.
|
|
18
|
-
"@webiny/di": "1.0
|
|
19
|
-
"@webiny/feature-flags": "6.4.
|
|
20
|
-
"@webiny/global-config": "6.4.
|
|
21
|
-
"@webiny/pulumi-sdk": "6.4.
|
|
22
|
-
"@webiny/react-properties": "6.4.
|
|
23
|
-
"@webiny/system-requirements": "6.4.
|
|
24
|
-
"@webiny/telemetry": "6.4.
|
|
25
|
-
"@webiny/utils": "6.4.
|
|
26
|
-
"@webiny/wcp": "6.4.
|
|
27
|
-
"chalk": "
|
|
16
|
+
"@webiny/aws-sdk": "6.4.12-beta.1",
|
|
17
|
+
"@webiny/build-tools": "6.4.12-beta.1",
|
|
18
|
+
"@webiny/di": "1.1.0",
|
|
19
|
+
"@webiny/feature-flags": "6.4.12-beta.1",
|
|
20
|
+
"@webiny/global-config": "6.4.12-beta.1",
|
|
21
|
+
"@webiny/pulumi-sdk": "6.4.12-beta.1",
|
|
22
|
+
"@webiny/react-properties": "6.4.12-beta.1",
|
|
23
|
+
"@webiny/system-requirements": "6.4.12-beta.1",
|
|
24
|
+
"@webiny/telemetry": "6.4.12-beta.1",
|
|
25
|
+
"@webiny/utils": "6.4.12-beta.1",
|
|
26
|
+
"@webiny/wcp": "6.4.12-beta.1",
|
|
27
|
+
"chalk": "6.0.0",
|
|
28
28
|
"chokidar": "5.0.0",
|
|
29
29
|
"ci-info": "4.4.0",
|
|
30
30
|
"debounce": "3.0.0",
|
|
31
31
|
"deepmerge": "4.3.1",
|
|
32
|
-
"dotenv": "
|
|
32
|
+
"dotenv": "18.0.0",
|
|
33
33
|
"execa": "5.1.1",
|
|
34
34
|
"exit-hook": "5.1.0",
|
|
35
35
|
"fast-glob": "3.3.3",
|
|
36
36
|
"find-up": "8.0.0",
|
|
37
|
-
"get-tsconfig": "4.14.
|
|
37
|
+
"get-tsconfig": "4.14.3",
|
|
38
38
|
"graphql-request": "7.4.0",
|
|
39
|
-
"humanize-duration": "3.
|
|
40
|
-
"jsdom": "
|
|
39
|
+
"humanize-duration": "3.35.0",
|
|
40
|
+
"jsdom": "30.1.0",
|
|
41
41
|
"load-json-file": "7.0.1",
|
|
42
42
|
"lodash": "4.18.1",
|
|
43
|
-
"minimatch": "10.2.
|
|
44
|
-
"mqtt": "5.
|
|
43
|
+
"minimatch": "10.2.6",
|
|
44
|
+
"mqtt": "5.16.0",
|
|
45
45
|
"neverthrow": "8.2.0",
|
|
46
|
-
"p-retry": "8.0.
|
|
46
|
+
"p-retry": "8.0.1",
|
|
47
47
|
"pino": "10.3.1",
|
|
48
48
|
"pino-pretty": "13.1.3",
|
|
49
49
|
"react": "18.3.1",
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
"replace-in-path": "1.1.0",
|
|
52
52
|
"serialize-error": "13.0.1",
|
|
53
53
|
"ts-morph": "28.0.0",
|
|
54
|
-
"tsx": "4.23.
|
|
54
|
+
"tsx": "4.23.13",
|
|
55
55
|
"write-json-file": "7.0.0",
|
|
56
|
-
"zod": "4.
|
|
56
|
+
"zod": "4.6.5"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/debounce": "1.2.4",
|
|
60
60
|
"@types/humanize-duration": "3.27.4",
|
|
61
|
-
"@types/jsdom": "
|
|
62
|
-
"@types/lodash": "4.17.
|
|
61
|
+
"@types/jsdom": "30.0.0",
|
|
62
|
+
"@types/lodash": "4.17.25",
|
|
63
63
|
"rimraf": "6.1.3",
|
|
64
|
-
"type-fest": "5.
|
|
64
|
+
"type-fest": "5.10.0",
|
|
65
65
|
"typescript": "6.0.3"
|
|
66
66
|
},
|
|
67
67
|
"adio": {
|
|
@@ -14,10 +14,10 @@ class ExtensionSrcResolver {
|
|
|
14
14
|
}
|
|
15
15
|
static resolvePath(filePath, project) {
|
|
16
16
|
if (filePath.startsWith("/extensions/")) return project.paths.rootFolder.join(filePath).toString();
|
|
17
|
-
{
|
|
17
|
+
else {
|
|
18
18
|
const resolved = this.resolvePathAlias(filePath, project);
|
|
19
19
|
if (resolved) return resolved;
|
|
20
|
-
return filePath;
|
|
20
|
+
else return filePath;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
static existsSync(filePath, project) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils/ExtensionSrcResolver.js","sources":["../../src/utils/ExtensionSrcResolver.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs\";\nimport { getTsconfig } from \"get-tsconfig\";\nimport { toImportSpecifier } from \"./toImportSpecifier.js\";\nimport { type IProjectModel } from \"~/abstractions/models/index.js\";\n\nexport class ExtensionSrcResolver {\n private static pathMappings: { [key: string]: string[] } | null = null;\n\n /**\n * Import a module from a given file path.\n * - If path starts with \"/extensions/\", it resolves from project root\n * - If path matches tsconfig path alias (e.g., \"@/*\"), it resolves using tsconfig\n * - Otherwise, treats path as absolute\n * Returns the default export or named export matching the filename.\n */\n static async importFromPath(filePath: string, project: IProjectModel) {\n const importPath = this.resolvePath(filePath, project);\n const exportName = path.basename(filePath).replace(path.extname(filePath), \"\");\n\n const importedModule = await import(toImportSpecifier(importPath));\n\n // Support both default and named exports.\n // Check for 'default' property existence rather than truthiness.\n return (\n (\"default\" in importedModule && importedModule.default) || importedModule[exportName]\n );\n }\n\n /**\n * Resolve a file path to an absolute path.\n * - If path starts with \"/extensions/\", it resolves from project root\n * - If path matches tsconfig path alias (e.g., \"@/*\"), it resolves using tsconfig\n * - Otherwise, treats path as absolute\n * Returns the absolute path without importing.\n */\n static resolvePath(filePath: string, project: IProjectModel): string {\n if (filePath.startsWith(\"/extensions/\")) {\n // Resolve from project root.\n return project.paths.rootFolder.join(filePath).toString();\n } else {\n // Try to resolve using tsconfig path aliases.\n const resolved = this.resolvePathAlias(filePath, project);\n if (resolved) {\n return resolved;\n } else {\n // Treat as absolute path.\n return filePath;\n }\n }\n }\n\n /**\n * Check if a file exists at the given path.\n * Resolves the path using the same logic as resolvePath before checking.\n * - If path starts with \"/extensions/\", it resolves from project root\n * - If path matches tsconfig path alias (e.g., \"@/*\"), it resolves using tsconfig\n * - Otherwise, treats path as absolute\n * Returns true if the file exists, false otherwise.\n */\n static existsSync(filePath: string, project: IProjectModel): boolean {\n const absolutePath = this.resolvePath(filePath, project);\n return fs.existsSync(absolutePath);\n }\n\n private static resolvePathAlias(filePath: string, project: IProjectModel): string | null {\n const projectRoot = project.paths.rootFolder.toString();\n\n // Load path mappings from tsconfig if not already cached.\n if (this.pathMappings === null) {\n this.loadPathMappings(project);\n }\n\n if (!this.pathMappings) {\n return null;\n }\n\n // Try to match against each path pattern.\n for (const [pattern, targets] of Object.entries(this.pathMappings)) {\n const match = this.matchPattern(filePath, pattern);\n if (match !== null) {\n // Use the first mapping.\n const target = targets[0];\n const resolvedPath = this.replacePlaceholder(target, match);\n return path.resolve(projectRoot, resolvedPath);\n }\n }\n\n return null;\n }\n\n private static loadPathMappings(project: IProjectModel): void {\n const tsConfigPath = project.paths.tsConfigFile.toString();\n\n try {\n // Use get-tsconfig to parse tsconfig with extends resolution.\n const tsconfig = getTsconfig(tsConfigPath);\n\n if (tsconfig?.config.compilerOptions?.paths) {\n this.pathMappings = tsconfig.config.compilerOptions.paths;\n } else {\n this.pathMappings = {};\n }\n } catch {\n // Ignore tsconfig parsing errors.\n this.pathMappings = {};\n }\n }\n\n private static matchPattern(importPath: string, pattern: string): string | null {\n // Handle wildcard patterns like \"@/*\" or \"@extensions/*\".\n if (pattern.endsWith(\"/*\")) {\n const prefix = pattern.slice(0, -2);\n // Only match if there's a slash after the prefix.\n if (importPath.startsWith(prefix + \"/\")) {\n return importPath.slice(prefix.length + 1);\n }\n } else if (pattern === importPath) {\n return \"\";\n }\n\n return null;\n }\n\n private static replacePlaceholder(mapping: string, match: string): string {\n // Replace wildcard with the matched part.\n if (mapping.endsWith(\"/*\")) {\n return mapping.slice(0, -2) + \"/\" + match;\n }\n return mapping;\n }\n}\n"],"names":["ExtensionSrcResolver","filePath","project","importPath","exportName","path","importedModule","toImportSpecifier","resolved","absolutePath","fs","projectRoot","pattern","targets","Object","match","target","resolvedPath","tsConfigPath","tsconfig","getTsconfig","prefix","mapping"],"mappings":";;;;AAMO,MAAMA;;aACM,YAAY,GAAuC;;IASlE,aAAa,eAAeC,QAAgB,EAAEC,OAAsB,EAAE;QAClE,MAAMC,aAAa,IAAI,CAAC,WAAW,CAACF,UAAUC;QAC9C,MAAME,aAAaC,KAAK,QAAQ,CAACJ,UAAU,OAAO,CAACI,KAAK,OAAO,CAACJ,WAAW;QAE3E,MAAMK,iBAAiB,MAAM,MAAM,CAACC,kBAAkBJ;QAItD,OACK,aAAaG,kBAAkBA,eAAe,OAAO,IAAKA,cAAc,CAACF,WAAW;IAE7F;IASA,OAAO,YAAYH,QAAgB,EAAEC,OAAsB,EAAU;QACjE,IAAID,SAAS,UAAU,CAAC,iBAEpB,OAAOC,QAAQ,KAAK,CAAC,UAAU,CAAC,IAAI,CAACD,UAAU,QAAQ;
|
|
1
|
+
{"version":3,"file":"utils/ExtensionSrcResolver.js","sources":["../../src/utils/ExtensionSrcResolver.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs\";\nimport { getTsconfig } from \"get-tsconfig\";\nimport { toImportSpecifier } from \"./toImportSpecifier.js\";\nimport { type IProjectModel } from \"~/abstractions/models/index.js\";\n\nexport class ExtensionSrcResolver {\n private static pathMappings: { [key: string]: string[] } | null = null;\n\n /**\n * Import a module from a given file path.\n * - If path starts with \"/extensions/\", it resolves from project root\n * - If path matches tsconfig path alias (e.g., \"@/*\"), it resolves using tsconfig\n * - Otherwise, treats path as absolute\n * Returns the default export or named export matching the filename.\n */\n static async importFromPath(filePath: string, project: IProjectModel) {\n const importPath = this.resolvePath(filePath, project);\n const exportName = path.basename(filePath).replace(path.extname(filePath), \"\");\n\n const importedModule = await import(toImportSpecifier(importPath));\n\n // Support both default and named exports.\n // Check for 'default' property existence rather than truthiness.\n return (\n (\"default\" in importedModule && importedModule.default) || importedModule[exportName]\n );\n }\n\n /**\n * Resolve a file path to an absolute path.\n * - If path starts with \"/extensions/\", it resolves from project root\n * - If path matches tsconfig path alias (e.g., \"@/*\"), it resolves using tsconfig\n * - Otherwise, treats path as absolute\n * Returns the absolute path without importing.\n */\n static resolvePath(filePath: string, project: IProjectModel): string {\n if (filePath.startsWith(\"/extensions/\")) {\n // Resolve from project root.\n return project.paths.rootFolder.join(filePath).toString();\n } else {\n // Try to resolve using tsconfig path aliases.\n const resolved = this.resolvePathAlias(filePath, project);\n if (resolved) {\n return resolved;\n } else {\n // Treat as absolute path.\n return filePath;\n }\n }\n }\n\n /**\n * Check if a file exists at the given path.\n * Resolves the path using the same logic as resolvePath before checking.\n * - If path starts with \"/extensions/\", it resolves from project root\n * - If path matches tsconfig path alias (e.g., \"@/*\"), it resolves using tsconfig\n * - Otherwise, treats path as absolute\n * Returns true if the file exists, false otherwise.\n */\n static existsSync(filePath: string, project: IProjectModel): boolean {\n const absolutePath = this.resolvePath(filePath, project);\n return fs.existsSync(absolutePath);\n }\n\n private static resolvePathAlias(filePath: string, project: IProjectModel): string | null {\n const projectRoot = project.paths.rootFolder.toString();\n\n // Load path mappings from tsconfig if not already cached.\n if (this.pathMappings === null) {\n this.loadPathMappings(project);\n }\n\n if (!this.pathMappings) {\n return null;\n }\n\n // Try to match against each path pattern.\n for (const [pattern, targets] of Object.entries(this.pathMappings)) {\n const match = this.matchPattern(filePath, pattern);\n if (match !== null) {\n // Use the first mapping.\n const target = targets[0];\n const resolvedPath = this.replacePlaceholder(target, match);\n return path.resolve(projectRoot, resolvedPath);\n }\n }\n\n return null;\n }\n\n private static loadPathMappings(project: IProjectModel): void {\n const tsConfigPath = project.paths.tsConfigFile.toString();\n\n try {\n // Use get-tsconfig to parse tsconfig with extends resolution.\n const tsconfig = getTsconfig(tsConfigPath);\n\n if (tsconfig?.config.compilerOptions?.paths) {\n this.pathMappings = tsconfig.config.compilerOptions.paths;\n } else {\n this.pathMappings = {};\n }\n } catch {\n // Ignore tsconfig parsing errors.\n this.pathMappings = {};\n }\n }\n\n private static matchPattern(importPath: string, pattern: string): string | null {\n // Handle wildcard patterns like \"@/*\" or \"@extensions/*\".\n if (pattern.endsWith(\"/*\")) {\n const prefix = pattern.slice(0, -2);\n // Only match if there's a slash after the prefix.\n if (importPath.startsWith(prefix + \"/\")) {\n return importPath.slice(prefix.length + 1);\n }\n } else if (pattern === importPath) {\n return \"\";\n }\n\n return null;\n }\n\n private static replacePlaceholder(mapping: string, match: string): string {\n // Replace wildcard with the matched part.\n if (mapping.endsWith(\"/*\")) {\n return mapping.slice(0, -2) + \"/\" + match;\n }\n return mapping;\n }\n}\n"],"names":["ExtensionSrcResolver","filePath","project","importPath","exportName","path","importedModule","toImportSpecifier","resolved","absolutePath","fs","projectRoot","pattern","targets","Object","match","target","resolvedPath","tsConfigPath","tsconfig","getTsconfig","prefix","mapping"],"mappings":";;;;AAMO,MAAMA;;aACM,YAAY,GAAuC;;IASlE,aAAa,eAAeC,QAAgB,EAAEC,OAAsB,EAAE;QAClE,MAAMC,aAAa,IAAI,CAAC,WAAW,CAACF,UAAUC;QAC9C,MAAME,aAAaC,KAAK,QAAQ,CAACJ,UAAU,OAAO,CAACI,KAAK,OAAO,CAACJ,WAAW;QAE3E,MAAMK,iBAAiB,MAAM,MAAM,CAACC,k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