@akanjs/devkit 1.0.20 → 2.1.0-rc.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/README.ko.md +65 -0
- package/README.md +62 -6
- package/aiEditor.ts +304 -0
- package/akanApp/akanApp.host.ts +393 -0
- package/akanApp/index.ts +1 -0
- package/akanConfig/akanConfig.test.ts +236 -0
- package/akanConfig/akanConfig.ts +384 -0
- package/akanConfig/index.ts +2 -0
- package/akanConfig/types.ts +23 -0
- package/applicationBuildReporter.ts +69 -0
- package/applicationBuildRunner.ts +302 -0
- package/applicationReleasePackager.ts +206 -0
- package/artifact/implicitRootLayout.ts +155 -0
- package/artifact/index.ts +1 -0
- package/artifact/routeSeedIndex.test.ts +98 -0
- package/artifact/routeSeedIndex.ts +130 -0
- package/auth.ts +41 -0
- package/builder.ts +164 -0
- package/capacitor.base.config.ts +88 -0
- package/capacitorApp.ts +440 -0
- package/commandDecorators/argMeta.ts +102 -0
- package/commandDecorators/command.ts +351 -0
- package/commandDecorators/commandBuilder.ts +224 -0
- package/commandDecorators/commandDecorators.test.ts +212 -0
- package/commandDecorators/commandMeta.ts +7 -0
- package/commandDecorators/dependencyBuilder.ts +100 -0
- package/{esm/src/commandDecorators/helpFormatter.js → commandDecorators/helpFormatter.ts} +100 -47
- package/{esm/src/commandDecorators/index.js → commandDecorators/index.ts} +4 -2
- package/commandDecorators/targetMeta.ts +31 -0
- package/commandDecorators/types.ts +10 -0
- package/constants.ts +25 -0
- package/createTunnel.ts +36 -0
- package/dependencyScanner.ts +357 -0
- package/devkitUtils.test.ts +259 -0
- package/executors.test.ts +315 -0
- package/executors.ts +1390 -0
- package/{esm/src/extractDeps.js → extractDeps.ts} +26 -20
- package/{esm/src/fileEditor.js → fileEditor.ts} +51 -32
- package/fileSys.ts +39 -0
- package/frontendBuild/allRoutesBuilder.ts +103 -0
- package/frontendBuild/buildRouteClient.test.ts +190 -0
- package/frontendBuild/clientBuildTypes.ts +114 -0
- package/frontendBuild/clientEntriesBundler.ts +303 -0
- package/frontendBuild/clientEntryDiscovery.ts +199 -0
- package/frontendBuild/csrArtifactBuilder.ts +237 -0
- package/frontendBuild/cssCompiler.ts +286 -0
- package/frontendBuild/cssImportResolver.ts +116 -0
- package/frontendBuild/fontOptimizer.ts +427 -0
- package/frontendBuild/frontendBuild.test.ts +204 -0
- package/frontendBuild/hmrChangeClassifier.ts +28 -0
- package/frontendBuild/hmrWatcher.ts +102 -0
- package/frontendBuild/index.ts +18 -0
- package/frontendBuild/pagesBundleBuilder.ts +137 -0
- package/frontendBuild/pagesEntrySourceGenerator.ts +37 -0
- package/frontendBuild/precompressArtifacts.ts +59 -0
- package/frontendBuild/routeClientBuilder.ts +290 -0
- package/frontendBuild/routesManifestArtifactSerializer.ts +62 -0
- package/frontendBuild/ssrBaseArtifactBuilder.ts +139 -0
- package/frontendBuild/vendorSpecifiers.ts +16 -0
- package/frontendBuild/watchRootResolver.ts +28 -0
- package/getCredentials.ts +19 -0
- package/getDirname.ts +3 -0
- package/getModelFileData.ts +59 -0
- package/getRelatedCnsts.ts +313 -0
- package/guideline.ts +19 -0
- package/incrementalBuilder/incrementalBuilder.host.test.ts +51 -0
- package/incrementalBuilder/incrementalBuilder.host.ts +152 -0
- package/incrementalBuilder/incrementalBuilder.proc.ts +331 -0
- package/incrementalBuilder/index.ts +1 -0
- package/{esm/src/index.js → index.ts} +28 -15
- package/lint/no-deep-internal-import.grit +25 -0
- package/lint/no-import-client-functions.grit +32 -0
- package/lint/no-import-external-library.grit +21 -0
- package/lint/no-js-private-class-method.grit +42 -0
- package/lint/no-use-client-in-server.grit +7 -0
- package/lint/non-scalar-props-restricted.grit +13 -0
- package/linter.ts +271 -0
- package/mobile/index.ts +1 -0
- package/mobile/mobileTarget.test.ts +53 -0
- package/mobile/mobileTarget.ts +88 -0
- package/package.json +48 -31
- package/prompter.ts +72 -0
- package/scanInfo.ts +606 -0
- package/selectModel.ts +11 -0
- package/{esm/src/spinner.js → spinner.ts} +22 -28
- package/{esm/src/capacitorApp.js → src/capacitorApp.ts} +82 -81
- package/sshTunnel.ts +152 -0
- package/{esm/src/streamAi.js → streamAi.ts} +18 -12
- package/transforms/barrelAnalyzer.ts +278 -0
- package/transforms/barrelImportsPlugin.ts +504 -0
- package/transforms/externalizeFrameworkPlugin.ts +185 -0
- package/transforms/index.ts +5 -0
- package/transforms/rscUseClientTransform.ts +59 -0
- package/transforms/transforms.test.ts +208 -0
- package/transforms/useClientBundlePlugin.ts +47 -0
- package/tsconfig.json +37 -0
- package/typeChecker.ts +264 -0
- package/types.ts +44 -0
- package/ui/MultiScrollList.tsx +242 -0
- package/ui/ScrollList.tsx +107 -0
- package/ui/index.ts +2 -0
- package/{esm/src/uploadRelease.js → uploadRelease.ts} +50 -34
- package/{esm/src/useStdoutDimensions.js → useStdoutDimensions.ts} +5 -5
- package/cjs/index.js +0 -21
- package/cjs/src/aiEditor.js +0 -311
- package/cjs/src/auth.js +0 -72
- package/cjs/src/builder.js +0 -114
- package/cjs/src/capacitorApp.js +0 -313
- package/cjs/src/commandDecorators/argMeta.js +0 -88
- package/cjs/src/commandDecorators/command.js +0 -324
- package/cjs/src/commandDecorators/commandMeta.js +0 -30
- package/cjs/src/commandDecorators/helpFormatter.js +0 -211
- package/cjs/src/commandDecorators/index.js +0 -31
- package/cjs/src/commandDecorators/targetMeta.js +0 -57
- package/cjs/src/commandDecorators/types.js +0 -15
- package/cjs/src/constants.js +0 -46
- package/cjs/src/createTunnel.js +0 -49
- package/cjs/src/dependencyScanner.js +0 -220
- package/cjs/src/executors.js +0 -964
- package/cjs/src/extractDeps.js +0 -103
- package/cjs/src/fileEditor.js +0 -120
- package/cjs/src/getCredentials.js +0 -44
- package/cjs/src/getDirname.js +0 -38
- package/cjs/src/getModelFileData.js +0 -66
- package/cjs/src/getRelatedCnsts.js +0 -260
- package/cjs/src/guideline.js +0 -15
- package/cjs/src/index.js +0 -65
- package/cjs/src/linter.js +0 -238
- package/cjs/src/prompter.js +0 -85
- package/cjs/src/scanInfo.js +0 -491
- package/cjs/src/selectModel.js +0 -46
- package/cjs/src/spinner.js +0 -93
- package/cjs/src/streamAi.js +0 -62
- package/cjs/src/typeChecker.js +0 -207
- package/cjs/src/types.js +0 -15
- package/cjs/src/uploadRelease.js +0 -112
- package/cjs/src/useStdoutDimensions.js +0 -43
- package/esm/index.js +0 -1
- package/esm/src/aiEditor.js +0 -282
- package/esm/src/auth.js +0 -42
- package/esm/src/builder.js +0 -81
- package/esm/src/commandDecorators/argMeta.js +0 -54
- package/esm/src/commandDecorators/command.js +0 -290
- package/esm/src/commandDecorators/commandMeta.js +0 -7
- package/esm/src/commandDecorators/targetMeta.js +0 -33
- package/esm/src/commandDecorators/types.js +0 -0
- package/esm/src/constants.js +0 -17
- package/esm/src/createTunnel.js +0 -26
- package/esm/src/dependencyScanner.js +0 -187
- package/esm/src/executors.js +0 -928
- package/esm/src/getCredentials.js +0 -11
- package/esm/src/getDirname.js +0 -5
- package/esm/src/getModelFileData.js +0 -33
- package/esm/src/getRelatedCnsts.js +0 -221
- package/esm/src/guideline.js +0 -0
- package/esm/src/linter.js +0 -205
- package/esm/src/prompter.js +0 -51
- package/esm/src/scanInfo.js +0 -455
- package/esm/src/selectModel.js +0 -13
- package/esm/src/typeChecker.js +0 -174
- package/esm/src/types.js +0 -0
- package/index.d.ts +0 -1
- package/src/aiEditor.d.ts +0 -50
- package/src/auth.d.ts +0 -9
- package/src/builder.d.ts +0 -18
- package/src/capacitorApp.d.ts +0 -39
- package/src/commandDecorators/argMeta.d.ts +0 -67
- package/src/commandDecorators/command.d.ts +0 -2
- package/src/commandDecorators/commandMeta.d.ts +0 -2
- package/src/commandDecorators/helpFormatter.d.ts +0 -3
- package/src/commandDecorators/index.d.ts +0 -6
- package/src/commandDecorators/targetMeta.d.ts +0 -19
- package/src/commandDecorators/types.d.ts +0 -1
- package/src/constants.d.ts +0 -26
- package/src/createTunnel.d.ts +0 -8
- package/src/dependencyScanner.d.ts +0 -23
- package/src/executors.d.ts +0 -296
- package/src/extractDeps.d.ts +0 -7
- package/src/fileEditor.d.ts +0 -16
- package/src/getCredentials.d.ts +0 -12
- package/src/getDirname.d.ts +0 -1
- package/src/getModelFileData.d.ts +0 -16
- package/src/getRelatedCnsts.d.ts +0 -53
- package/src/guideline.d.ts +0 -19
- package/src/index.d.ts +0 -23
- package/src/linter.d.ts +0 -109
- package/src/prompter.d.ts +0 -14
- package/src/scanInfo.d.ts +0 -82
- package/src/selectModel.d.ts +0 -1
- package/src/spinner.d.ts +0 -20
- package/src/streamAi.d.ts +0 -6
- package/src/typeChecker.d.ts +0 -52
- package/src/types.d.ts +0 -31
- package/src/uploadRelease.d.ts +0 -10
- package/src/useStdoutDimensions.d.ts +0 -1
package/cjs/src/extractDeps.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var extractDeps_exports = {};
|
|
19
|
-
__export(extractDeps_exports, {
|
|
20
|
-
extractDependencies: () => extractDependencies
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(extractDeps_exports);
|
|
23
|
-
const NODE_NATIVE_MODULE_SET = /* @__PURE__ */ new Set([
|
|
24
|
-
"assert",
|
|
25
|
-
"async_hooks",
|
|
26
|
-
"buffer",
|
|
27
|
-
"child_process",
|
|
28
|
-
"cluster",
|
|
29
|
-
"console",
|
|
30
|
-
"constants",
|
|
31
|
-
"crypto",
|
|
32
|
-
"dgram",
|
|
33
|
-
"dns",
|
|
34
|
-
"domain",
|
|
35
|
-
"events",
|
|
36
|
-
"fs",
|
|
37
|
-
"http",
|
|
38
|
-
"http2",
|
|
39
|
-
"https",
|
|
40
|
-
"inspector",
|
|
41
|
-
"module",
|
|
42
|
-
"net",
|
|
43
|
-
"os",
|
|
44
|
-
"path",
|
|
45
|
-
"perf_hooks",
|
|
46
|
-
"process",
|
|
47
|
-
"punycode",
|
|
48
|
-
"querystring",
|
|
49
|
-
"readline",
|
|
50
|
-
"repl",
|
|
51
|
-
"stream",
|
|
52
|
-
"string_decoder",
|
|
53
|
-
"timers",
|
|
54
|
-
"tls",
|
|
55
|
-
"trace_events",
|
|
56
|
-
"tty",
|
|
57
|
-
"url",
|
|
58
|
-
"util",
|
|
59
|
-
"v8",
|
|
60
|
-
"vm",
|
|
61
|
-
"wasi",
|
|
62
|
-
"worker_threads",
|
|
63
|
-
"zlib"
|
|
64
|
-
]);
|
|
65
|
-
const extractDependencies = (filepaths, pacakgeJson, defaultDependencies = []) => {
|
|
66
|
-
if (!pacakgeJson.dependencies)
|
|
67
|
-
throw new Error("No dependencies found in package.json");
|
|
68
|
-
const dependencies = new Set(defaultDependencies);
|
|
69
|
-
const existingDependencies = /* @__PURE__ */ new Set([
|
|
70
|
-
...Object.keys(pacakgeJson.dependencies ?? {}),
|
|
71
|
-
...Object.keys(pacakgeJson.devDependencies ?? {})
|
|
72
|
-
]);
|
|
73
|
-
const versionObj = {
|
|
74
|
-
...pacakgeJson.dependencies ?? {},
|
|
75
|
-
...pacakgeJson.devDependencies ?? {}
|
|
76
|
-
};
|
|
77
|
-
const requireRegex = /(?:require\s*\(|import\s*(?:[\w\s{},*]*\s+from\s*)?|import\s*\()\s*['"`]([^'"`]+)['"`]/g;
|
|
78
|
-
for (const { text } of filepaths.filter(({ path }) => path.endsWith(".js") || path.endsWith(".ts"))) {
|
|
79
|
-
let requireMatch;
|
|
80
|
-
while ((requireMatch = requireRegex.exec(text)) !== null) {
|
|
81
|
-
const moduleName = requireMatch[1];
|
|
82
|
-
const moduleNameParts = moduleName.split("/");
|
|
83
|
-
const subModuleLength = moduleNameParts.length;
|
|
84
|
-
for (let i = 0; i < subModuleLength; i++) {
|
|
85
|
-
const libName = moduleNameParts.slice(0, i + 1).join("/");
|
|
86
|
-
if (!NODE_NATIVE_MODULE_SET.has(libName) && existingDependencies.has(libName))
|
|
87
|
-
dependencies.add(libName);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return Object.fromEntries(
|
|
92
|
-
[...dependencies].sort().map((dep) => {
|
|
93
|
-
const version = versionObj[dep];
|
|
94
|
-
if (!version)
|
|
95
|
-
throw new Error(`No version found for ${dep}`);
|
|
96
|
-
return [dep, version];
|
|
97
|
-
})
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
101
|
-
0 && (module.exports = {
|
|
102
|
-
extractDependencies
|
|
103
|
-
});
|
package/cjs/src/fileEditor.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var fileEditor_exports = {};
|
|
29
|
-
__export(fileEditor_exports, {
|
|
30
|
-
FileEditor: () => FileEditor
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(fileEditor_exports);
|
|
33
|
-
var import_fs = __toESM(require("fs"));
|
|
34
|
-
class FileEditor {
|
|
35
|
-
filePath;
|
|
36
|
-
content;
|
|
37
|
-
constructor(filePath) {
|
|
38
|
-
this.filePath = filePath;
|
|
39
|
-
this.content = this.#readFile();
|
|
40
|
-
}
|
|
41
|
-
#readFile() {
|
|
42
|
-
try {
|
|
43
|
-
return import_fs.default.readFileSync(this.filePath, "utf-8");
|
|
44
|
-
} catch (error) {
|
|
45
|
-
throw new Error(`Failed to read file: ${this.filePath}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
find(pattern) {
|
|
49
|
-
const lines = this.content.split("\n");
|
|
50
|
-
const regex = typeof pattern === "string" ? new RegExp(pattern) : pattern;
|
|
51
|
-
for (let i = 0; i < lines.length; i++) {
|
|
52
|
-
if (regex.test(lines[i])) {
|
|
53
|
-
return i;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return -1;
|
|
57
|
-
}
|
|
58
|
-
findAll(pattern) {
|
|
59
|
-
const lines = this.content.split("\n");
|
|
60
|
-
const regex = typeof pattern === "string" ? new RegExp(pattern) : pattern;
|
|
61
|
-
const matches = [];
|
|
62
|
-
for (let i = 0; i < lines.length; i++) {
|
|
63
|
-
if (regex.test(lines[i])) {
|
|
64
|
-
matches.push(i);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return matches;
|
|
68
|
-
}
|
|
69
|
-
insertAfter(pattern, data) {
|
|
70
|
-
const lineIndex = this.find(pattern);
|
|
71
|
-
if (lineIndex === -1) {
|
|
72
|
-
throw new Error(`Pattern not found: ${pattern}`);
|
|
73
|
-
}
|
|
74
|
-
const lines = this.content.split("\n");
|
|
75
|
-
lines.splice(lineIndex + 1, 0, data);
|
|
76
|
-
this.content = lines.join("\n");
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
insertBefore(pattern, data) {
|
|
80
|
-
const lineIndex = this.find(pattern);
|
|
81
|
-
if (lineIndex === -1) {
|
|
82
|
-
throw new Error(`Pattern not found: ${pattern}`);
|
|
83
|
-
}
|
|
84
|
-
const lines = this.content.split("\n");
|
|
85
|
-
lines.splice(lineIndex, 0, data);
|
|
86
|
-
this.content = lines.join("\n");
|
|
87
|
-
return this;
|
|
88
|
-
}
|
|
89
|
-
replace(pattern, replacement) {
|
|
90
|
-
const regex = typeof pattern === "string" ? new RegExp(pattern, "g") : pattern;
|
|
91
|
-
this.content = this.content.replace(regex, replacement);
|
|
92
|
-
return this;
|
|
93
|
-
}
|
|
94
|
-
append(data) {
|
|
95
|
-
this.content += "\n" + data;
|
|
96
|
-
return this;
|
|
97
|
-
}
|
|
98
|
-
prepend(data) {
|
|
99
|
-
this.content = data + "\n" + this.content;
|
|
100
|
-
return this;
|
|
101
|
-
}
|
|
102
|
-
save() {
|
|
103
|
-
try {
|
|
104
|
-
import_fs.default.writeFileSync(this.filePath, this.content, "utf-8");
|
|
105
|
-
} catch (error) {
|
|
106
|
-
throw new Error(`Failed to save file: ${this.filePath}`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
getContent() {
|
|
110
|
-
return this.content;
|
|
111
|
-
}
|
|
112
|
-
setContent(content) {
|
|
113
|
-
this.content = content;
|
|
114
|
-
return this;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
118
|
-
0 && (module.exports = {
|
|
119
|
-
FileEditor
|
|
120
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var getCredentials_exports = {};
|
|
29
|
-
__export(getCredentials_exports, {
|
|
30
|
-
getCredentials: () => getCredentials
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(getCredentials_exports);
|
|
33
|
-
var import_fs = __toESM(require("fs"));
|
|
34
|
-
var import_js_yaml = __toESM(require("js-yaml"));
|
|
35
|
-
const getCredentials = (app, environment) => {
|
|
36
|
-
const secret = import_js_yaml.default.load(
|
|
37
|
-
import_fs.default.readFileSync(`${app.workspace.workspaceRoot}/infra/app/values/${app.name}-secret.yaml`, "utf-8")
|
|
38
|
-
);
|
|
39
|
-
return secret[environment];
|
|
40
|
-
};
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
getCredentials
|
|
44
|
-
});
|
package/cjs/src/getDirname.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var getDirname_exports = {};
|
|
29
|
-
__export(getDirname_exports, {
|
|
30
|
-
getDirname: () => getDirname
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(getDirname_exports);
|
|
33
|
-
var import_path = __toESM(require("path"));
|
|
34
|
-
const getDirname = (url) => import_path.default.dirname(new URL(url).pathname);
|
|
35
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
-
0 && (module.exports = {
|
|
37
|
-
getDirname
|
|
38
|
-
});
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var getModelFileData_exports = {};
|
|
29
|
-
__export(getModelFileData_exports, {
|
|
30
|
-
getModelFileData: () => getModelFileData
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(getModelFileData_exports);
|
|
33
|
-
var import_fs = __toESM(require("fs"));
|
|
34
|
-
const getModelFileData = (modulePath, modelName) => {
|
|
35
|
-
const moduleType = modulePath.startsWith("apps") ? "app" : "lib";
|
|
36
|
-
const moduleName = modulePath.split("/")[1];
|
|
37
|
-
const constantFilePath = `${modulePath}/lib/${modelName}/${modelName}.constant.ts`;
|
|
38
|
-
const unitFilePath = `${modulePath}/lib/${modelName}/${modelName}.Unit.tsx`;
|
|
39
|
-
const viewFilePath = `${modulePath}/lib/${modelName}/${modelName}.View.tsx`;
|
|
40
|
-
const constantFileStr = import_fs.default.readFileSync(constantFilePath, "utf8");
|
|
41
|
-
const unitFileStr = import_fs.default.readFileSync(unitFilePath, "utf8");
|
|
42
|
-
const viewFileStr = import_fs.default.readFileSync(viewFilePath, "utf8");
|
|
43
|
-
const constantFileLines = constantFileStr.split("\n");
|
|
44
|
-
const importLibNames = constantFileLines.filter((line) => line.startsWith("import { cnst as ")).map((line) => line.split("cnst as ")[1].split(" ")[0]);
|
|
45
|
-
const importLocalPaths = constantFileLines.filter((line) => line.startsWith("import { ") && line.includes('from "../')).map((line) => line.split("from ")[1].split('"')[1]);
|
|
46
|
-
const importModelNames = importLocalPaths.map((path) => path.split("/")[1]).filter((name) => !name.startsWith("_"));
|
|
47
|
-
const hasImportScalar = !!importLocalPaths.map((path) => path.split("/")[1]).filter((name) => name.startsWith("_")).length;
|
|
48
|
-
return {
|
|
49
|
-
moduleType,
|
|
50
|
-
moduleName,
|
|
51
|
-
modelName,
|
|
52
|
-
constantFilePath,
|
|
53
|
-
unitFilePath,
|
|
54
|
-
viewFilePath,
|
|
55
|
-
importModelNames,
|
|
56
|
-
hasImportScalar,
|
|
57
|
-
importLibNames,
|
|
58
|
-
constantFileStr,
|
|
59
|
-
unitFileStr,
|
|
60
|
-
viewFileStr
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
-
0 && (module.exports = {
|
|
65
|
-
getModelFileData
|
|
66
|
-
});
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var getRelatedCnsts_exports = {};
|
|
29
|
-
__export(getRelatedCnsts_exports, {
|
|
30
|
-
analyzeProperties: () => analyzeProperties,
|
|
31
|
-
collectExportedFiles: () => collectExportedFiles,
|
|
32
|
-
collectImportedFiles: () => collectImportedFiles,
|
|
33
|
-
createSymbolCache: () => createSymbolCache,
|
|
34
|
-
createTsProgram: () => createTsProgram,
|
|
35
|
-
getRelatedCnsts: () => getRelatedCnsts,
|
|
36
|
-
parseTsConfig: () => parseTsConfig
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(getRelatedCnsts_exports);
|
|
39
|
-
var fs = __toESM(require("fs"));
|
|
40
|
-
var import_ora = __toESM(require("ora"));
|
|
41
|
-
var ts = __toESM(require("typescript"));
|
|
42
|
-
const parseTsConfig = (tsConfigPath = "./tsconfig.json") => {
|
|
43
|
-
const configFile = ts.readConfigFile(tsConfigPath, (path) => {
|
|
44
|
-
return ts.sys.readFile(path);
|
|
45
|
-
});
|
|
46
|
-
return ts.parseJsonConfigFileContent(
|
|
47
|
-
configFile.config,
|
|
48
|
-
ts.sys,
|
|
49
|
-
fs.realpathSync(tsConfigPath).replace(/[^/\\]+$/, "")
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
const collectImportedFiles = (constantFilePath, parsedConfig) => {
|
|
53
|
-
const allFilesToAnalyze = /* @__PURE__ */ new Set([constantFilePath]);
|
|
54
|
-
const analyzedFiles = /* @__PURE__ */ new Set();
|
|
55
|
-
const spinner = (0, import_ora.default)("Collecting related files...");
|
|
56
|
-
spinner.start();
|
|
57
|
-
function collectImported(filePath) {
|
|
58
|
-
if (analyzedFiles.has(filePath))
|
|
59
|
-
return;
|
|
60
|
-
analyzedFiles.add(filePath);
|
|
61
|
-
const tempProgram = ts.createProgram([filePath], parsedConfig.options);
|
|
62
|
-
const source = tempProgram.getSourceFile(filePath);
|
|
63
|
-
if (!source)
|
|
64
|
-
return;
|
|
65
|
-
function collectImports(node) {
|
|
66
|
-
if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
|
|
67
|
-
const importPath = node.moduleSpecifier.text;
|
|
68
|
-
if (importPath.startsWith(".")) {
|
|
69
|
-
const resolved = ts.resolveModuleName(importPath, filePath, parsedConfig.options, ts.sys).resolvedModule?.resolvedFileName;
|
|
70
|
-
if (resolved && !allFilesToAnalyze.has(resolved)) {
|
|
71
|
-
allFilesToAnalyze.add(resolved);
|
|
72
|
-
collectImported(resolved);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
ts.forEachChild(node, collectImports);
|
|
77
|
-
}
|
|
78
|
-
collectImports(source);
|
|
79
|
-
}
|
|
80
|
-
collectImported(constantFilePath);
|
|
81
|
-
spinner.succeed(`Found ${allFilesToAnalyze.size} related files.`);
|
|
82
|
-
return {
|
|
83
|
-
allFilesToAnalyze,
|
|
84
|
-
analyzedFiles
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
const collectExportedFiles = (constantFilePath, parsedConfig) => {
|
|
88
|
-
const allFilesToAnalyze = /* @__PURE__ */ new Set([constantFilePath]);
|
|
89
|
-
const analyzedFiles = /* @__PURE__ */ new Set();
|
|
90
|
-
const spinner = (0, import_ora.default)("Collecting files from exports...");
|
|
91
|
-
spinner.start();
|
|
92
|
-
function collectExported(filePath) {
|
|
93
|
-
if (analyzedFiles.has(filePath))
|
|
94
|
-
return;
|
|
95
|
-
analyzedFiles.add(filePath);
|
|
96
|
-
const tempProgram = ts.createProgram([filePath], parsedConfig.options);
|
|
97
|
-
const source = tempProgram.getSourceFile(filePath);
|
|
98
|
-
if (!source)
|
|
99
|
-
return;
|
|
100
|
-
function collectExports(node) {
|
|
101
|
-
if (ts.isExportDeclaration(node) && node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier) && !node.exportClause) {
|
|
102
|
-
const exportPath = node.moduleSpecifier.text;
|
|
103
|
-
if (exportPath.startsWith(".")) {
|
|
104
|
-
const resolved = ts.resolveModuleName(exportPath, filePath, parsedConfig.options, ts.sys).resolvedModule?.resolvedFileName;
|
|
105
|
-
if (resolved && !allFilesToAnalyze.has(resolved)) {
|
|
106
|
-
allFilesToAnalyze.add(resolved);
|
|
107
|
-
collectExported(resolved);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
} else if (ts.isExportDeclaration(node) && node.exportClause && ts.isNamedExports(node.exportClause) && node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) {
|
|
111
|
-
const exportPath = node.moduleSpecifier.text;
|
|
112
|
-
if (exportPath.startsWith(".")) {
|
|
113
|
-
const resolved = ts.resolveModuleName(exportPath, filePath, parsedConfig.options, ts.sys).resolvedModule?.resolvedFileName;
|
|
114
|
-
if (resolved && !allFilesToAnalyze.has(resolved)) {
|
|
115
|
-
allFilesToAnalyze.add(resolved);
|
|
116
|
-
collectExported(resolved);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
} else if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
|
|
120
|
-
const importPath = node.moduleSpecifier.text;
|
|
121
|
-
if (importPath.startsWith(".")) {
|
|
122
|
-
const resolved = ts.resolveModuleName(importPath, filePath, parsedConfig.options, ts.sys).resolvedModule?.resolvedFileName;
|
|
123
|
-
if (resolved && !allFilesToAnalyze.has(resolved)) {
|
|
124
|
-
allFilesToAnalyze.add(resolved);
|
|
125
|
-
collectExported(resolved);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if ((ts.isVariableStatement(node) || ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node)) && node.modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)) {
|
|
130
|
-
}
|
|
131
|
-
ts.forEachChild(node, collectExports);
|
|
132
|
-
}
|
|
133
|
-
collectExports(source);
|
|
134
|
-
}
|
|
135
|
-
collectExported(constantFilePath);
|
|
136
|
-
spinner.succeed(`Found ${allFilesToAnalyze.size} related files from exports.`);
|
|
137
|
-
return {
|
|
138
|
-
allFilesToAnalyze,
|
|
139
|
-
analyzedFiles
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
const createTsProgram = (filePaths, options) => {
|
|
143
|
-
const spinner = (0, import_ora.default)("Creating TypeScript program for all files...");
|
|
144
|
-
spinner.start();
|
|
145
|
-
const program = ts.createProgram(Array.from(filePaths), options);
|
|
146
|
-
const checker = program.getTypeChecker();
|
|
147
|
-
spinner.succeed("TypeScript program created.");
|
|
148
|
-
return {
|
|
149
|
-
program,
|
|
150
|
-
checker
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
const createSymbolCache = (checker) => {
|
|
154
|
-
const symbolCache = /* @__PURE__ */ new Map();
|
|
155
|
-
return (node) => {
|
|
156
|
-
const cacheKey = `${node.getSourceFile().fileName}:${node.pos}:${node.end}`;
|
|
157
|
-
if (!symbolCache.has(cacheKey)) {
|
|
158
|
-
symbolCache.set(cacheKey, checker.getSymbolAtLocation(node));
|
|
159
|
-
}
|
|
160
|
-
return symbolCache.get(cacheKey);
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
const analyzeProperties = (filesToAnalyze, program, checker) => {
|
|
164
|
-
const propertyMap = /* @__PURE__ */ new Map();
|
|
165
|
-
const analyzedFiles = /* @__PURE__ */ new Set();
|
|
166
|
-
const sourceLineCache = /* @__PURE__ */ new Map();
|
|
167
|
-
const getCachedSymbol = createSymbolCache(checker);
|
|
168
|
-
const spinner = (0, import_ora.default)("Analyzing property relationships...");
|
|
169
|
-
spinner.start();
|
|
170
|
-
function analyzeFileProperties(filePath) {
|
|
171
|
-
if (analyzedFiles.has(filePath))
|
|
172
|
-
return;
|
|
173
|
-
analyzedFiles.add(filePath);
|
|
174
|
-
const source = program.getSourceFile(filePath);
|
|
175
|
-
if (!source)
|
|
176
|
-
return;
|
|
177
|
-
if (!sourceLineCache.has(filePath)) {
|
|
178
|
-
sourceLineCache.set(filePath, source.getFullText().split("\n"));
|
|
179
|
-
}
|
|
180
|
-
const sourceLines = sourceLineCache.get(filePath);
|
|
181
|
-
function visit(node) {
|
|
182
|
-
if (!source)
|
|
183
|
-
return;
|
|
184
|
-
if (ts.isPropertyAccessExpression(node)) {
|
|
185
|
-
const left = node.expression;
|
|
186
|
-
const right = node.name;
|
|
187
|
-
const { line } = ts.getLineAndCharacterOfPosition(source, node.getStart());
|
|
188
|
-
if (ts.isIdentifier(left) && sourceLines && sourceLines.length > line && (sourceLines[line].includes(`@Field.Prop(() => ${left.text}.${right.text}`) || sourceLines[line].includes(`base.Filter(${left.text}.${right.text},`))) {
|
|
189
|
-
const symbol = getCachedSymbol(right);
|
|
190
|
-
if (symbol?.declarations && symbol.declarations.length > 0) {
|
|
191
|
-
const key = symbol.declarations[0].getSourceFile().fileName.split("/").pop()?.split(".")[0] ?? "";
|
|
192
|
-
const property = propertyMap.get(key);
|
|
193
|
-
const isScalar = symbol.declarations[0].getSourceFile().fileName.includes("_");
|
|
194
|
-
const symbolFilePath = symbol.declarations[0].getSourceFile().fileName.replace(`${ts.sys.getCurrentDirectory()}/`, "");
|
|
195
|
-
if (property) {
|
|
196
|
-
propertyMap.set(`${left.text}.${right.text}`, {
|
|
197
|
-
filePath: symbolFilePath,
|
|
198
|
-
isLibModule: true,
|
|
199
|
-
isImport: false,
|
|
200
|
-
libName: left.text,
|
|
201
|
-
source: fs.readFileSync(symbolFilePath, "utf-8"),
|
|
202
|
-
isScalar
|
|
203
|
-
});
|
|
204
|
-
} else {
|
|
205
|
-
propertyMap.set(key, {
|
|
206
|
-
filePath: symbolFilePath,
|
|
207
|
-
isLibModule: true,
|
|
208
|
-
isImport: false,
|
|
209
|
-
libName: left.text,
|
|
210
|
-
isScalar,
|
|
211
|
-
source: fs.readFileSync(symbolFilePath, "utf-8")
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
} else if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
|
|
217
|
-
const importPath = node.moduleSpecifier.text;
|
|
218
|
-
if (importPath.startsWith(".")) {
|
|
219
|
-
const resolved = ts.resolveModuleName(importPath, filePath, program.getCompilerOptions(), ts.sys).resolvedModule?.resolvedFileName;
|
|
220
|
-
const moduleName = importPath.split("/").pop()?.split(".")[0] ?? "";
|
|
221
|
-
const property = propertyMap.get(moduleName);
|
|
222
|
-
const isScalar = importPath.includes("_");
|
|
223
|
-
if (moduleName && resolved && (!property || property.filePath !== resolved)) {
|
|
224
|
-
propertyMap.set(moduleName, {
|
|
225
|
-
filePath: resolved,
|
|
226
|
-
isLibModule: false,
|
|
227
|
-
isImport: true,
|
|
228
|
-
isScalar,
|
|
229
|
-
source: fs.readFileSync(resolved, "utf-8")
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
ts.forEachChild(node, visit);
|
|
235
|
-
}
|
|
236
|
-
visit(source);
|
|
237
|
-
}
|
|
238
|
-
for (const filePath of filesToAnalyze) {
|
|
239
|
-
analyzeFileProperties(filePath);
|
|
240
|
-
}
|
|
241
|
-
spinner.succeed(`Analysis complete. Found ${propertyMap.size} properties.`);
|
|
242
|
-
return propertyMap;
|
|
243
|
-
};
|
|
244
|
-
const getRelatedCnsts = (constantFilePath) => {
|
|
245
|
-
const parsedConfig = parseTsConfig();
|
|
246
|
-
const { allFilesToAnalyze } = collectImportedFiles(constantFilePath, parsedConfig);
|
|
247
|
-
const { program, checker } = createTsProgram(allFilesToAnalyze, parsedConfig.options);
|
|
248
|
-
const propertyMap = analyzeProperties(allFilesToAnalyze, program, checker);
|
|
249
|
-
return Array.from(propertyMap.entries()).map(([key, value]) => ({ key, ...value }));
|
|
250
|
-
};
|
|
251
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
252
|
-
0 && (module.exports = {
|
|
253
|
-
analyzeProperties,
|
|
254
|
-
collectExportedFiles,
|
|
255
|
-
collectImportedFiles,
|
|
256
|
-
createSymbolCache,
|
|
257
|
-
createTsProgram,
|
|
258
|
-
getRelatedCnsts,
|
|
259
|
-
parseTsConfig
|
|
260
|
-
});
|
package/cjs/src/guideline.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
-
var guideline_exports = {};
|
|
15
|
-
module.exports = __toCommonJS(guideline_exports);
|