@akanjs/devkit 0.0.40 → 0.0.41

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.
Files changed (47) hide show
  1. package/index.d.ts +1 -24
  2. package/index.js +1950 -21
  3. package/package.json +20 -2
  4. package/src/auth.d.ts +6 -9
  5. package/src/baseDevEnv.d.ts +4 -6
  6. package/src/capacitorApp.d.ts +5 -11
  7. package/src/commandDecorators/argMeta.d.ts +55 -0
  8. package/src/commandDecorators/command.d.ts +2 -0
  9. package/src/commandDecorators/commandMeta.d.ts +2 -0
  10. package/src/commandDecorators/index.d.ts +5 -0
  11. package/src/commandDecorators/targetMeta.d.ts +18 -0
  12. package/src/commandDecorators/types.d.ts +1 -0
  13. package/src/constants.d.ts +9 -11
  14. package/src/createTunnel.d.ts +2 -3
  15. package/src/dependencyScanner.d.ts +1 -3
  16. package/src/executors.d.ts +14 -157
  17. package/src/extractDeps.d.ts +2 -5
  18. package/src/getCredentials.d.ts +3 -9
  19. package/src/getDependencies.d.ts +1 -3
  20. package/src/getModelFileData.d.ts +2 -3
  21. package/src/getRelatedCnsts.d.ts +1 -3
  22. package/src/index.d.ts +18 -101
  23. package/src/installExternalLib.d.ts +2 -8
  24. package/src/selectModel.d.ts +1 -3
  25. package/src/streamAi.d.ts +2 -3
  26. package/src/types.d.ts +2 -4
  27. package/src/uploadRelease.d.ts +1 -3
  28. package/src/aiEditor.d.ts +0 -10
  29. package/src/aiEditor.js +0 -61
  30. package/src/auth.js +0 -79
  31. package/src/baseDevEnv.js +0 -50
  32. package/src/capacitorApp.js +0 -186
  33. package/src/constants.js +0 -47
  34. package/src/createTunnel.js +0 -47
  35. package/src/dependencyScanner.js +0 -171
  36. package/src/executors.js +0 -715
  37. package/src/extractDeps.js +0 -114
  38. package/src/getCredentials.js +0 -43
  39. package/src/getDependencies.js +0 -67
  40. package/src/getModelFileData.js +0 -67
  41. package/src/getRelatedCnsts.js +0 -145
  42. package/src/index.js +0 -55
  43. package/src/installExternalLib.js +0 -34
  44. package/src/selectModel.js +0 -50
  45. package/src/streamAi.js +0 -69
  46. package/src/types.js +0 -15
  47. package/src/uploadRelease.js +0 -82
@@ -1,171 +0,0 @@
1
- #!/usr/bin/env ts-node
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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
- var dependencyScanner_exports = {};
31
- __export(dependencyScanner_exports, {
32
- TypeScriptDependencyScanner: () => TypeScriptDependencyScanner
33
- });
34
- module.exports = __toCommonJS(dependencyScanner_exports);
35
- var fs = __toESM(require("fs"));
36
- var path = __toESM(require("path"));
37
- var ts = __toESM(require("typescript"));
38
- class TypeScriptDependencyScanner {
39
- static {
40
- __name(this, "TypeScriptDependencyScanner");
41
- }
42
- directory;
43
- #fileDependencies;
44
- #visitedFiles;
45
- constructor(directory) {
46
- this.directory = directory;
47
- this.#fileDependencies = /* @__PURE__ */ new Map();
48
- this.#visitedFiles = /* @__PURE__ */ new Set();
49
- }
50
- async getImportSets(depSets) {
51
- const fileDependencies = await this.getDependencies();
52
- const importedDepSets = new Array(depSets.length);
53
- for (let i = 0; i < depSets.length; i++) importedDepSets[i] = /* @__PURE__ */ new Set();
54
- fileDependencies.forEach((imps) => {
55
- imps.forEach((imp) => {
56
- if (imp.startsWith(".")) return;
57
- const moduleName = imp;
58
- const moduleNameParts = moduleName.split("/");
59
- const subModuleLength = moduleNameParts.length;
60
- for (let i = 0; i < subModuleLength; i++) {
61
- const importName = moduleNameParts.slice(0, i + 1).join("/");
62
- for (let j = 0; j < depSets.length; j++) {
63
- if (depSets[j].has(importName)) {
64
- importedDepSets[j].add(importName);
65
- return;
66
- }
67
- }
68
- }
69
- });
70
- });
71
- return importedDepSets;
72
- }
73
- async getDependencies() {
74
- this.#fileDependencies.clear();
75
- this.#visitedFiles.clear();
76
- const files = await this.#findTypeScriptFiles(this.directory);
77
- for (const file of files) await this.#analyzeFile(file, this.directory);
78
- return this.#fileDependencies;
79
- }
80
- async #findTypeScriptFiles(directory) {
81
- const files = [];
82
- const processDirectory = /* @__PURE__ */ __name(async (dir) => {
83
- const entries = await fs.promises.readdir(dir, {
84
- withFileTypes: true
85
- });
86
- for (const entry of entries) {
87
- const fullPath = path.join(dir, entry.name);
88
- if (entry.isDirectory()) {
89
- if (![
90
- "node_modules",
91
- "dist",
92
- "build",
93
- ".git",
94
- ".next",
95
- "public",
96
- "ios",
97
- "android"
98
- ].includes(entry.name)) await processDirectory(fullPath);
99
- } else if (entry.isFile() && (entry.name.endsWith(".ts") || entry.name.endsWith(".tsx"))) files.push(fullPath);
100
- }
101
- }, "processDirectory");
102
- await processDirectory(directory);
103
- return files;
104
- }
105
- async #analyzeFile(filePath, baseDir) {
106
- if (this.#visitedFiles.has(filePath)) return;
107
- this.#visitedFiles.add(filePath);
108
- try {
109
- const fileContent = await fs.promises.readFile(filePath, "utf-8");
110
- const imports = this.#extractImports(fileContent, filePath);
111
- const resolvedImports = imports.map((importPath) => {
112
- if (importPath.startsWith(".")) {
113
- const resolvedPath = "./" + path.join(path.relative(baseDir, filePath), importPath);
114
- return this.#ensureExtension(resolvedPath);
115
- }
116
- return importPath;
117
- });
118
- const relativePath = path.relative(baseDir, filePath);
119
- this.#fileDependencies.set(relativePath, resolvedImports);
120
- } catch (error) {
121
- }
122
- }
123
- #ensureExtension(filePath) {
124
- if (fs.existsSync(`${filePath}.ts`)) return `${filePath}.ts`;
125
- else if (fs.existsSync(`${filePath}.tsx`)) return `${filePath}.tsx`;
126
- else if (fs.existsSync(filePath)) return filePath;
127
- return `${filePath}.ts`;
128
- }
129
- #extractImports(source, filePath) {
130
- const imports = [];
131
- const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);
132
- const visit = /* @__PURE__ */ __name((node) => {
133
- if (ts.isImportDeclaration(node)) {
134
- const moduleSpecifier = node.moduleSpecifier;
135
- if (ts.isStringLiteral(moduleSpecifier)) imports.push(moduleSpecifier.text);
136
- }
137
- ts.forEachChild(node, visit);
138
- }, "visit");
139
- visit(sourceFile);
140
- return imports;
141
- }
142
- generateDependencyGraph() {
143
- let graph = "Dependency Graph:\n\n";
144
- for (const [file, imports] of this.#fileDependencies.entries()) {
145
- graph += `${file}:
146
- `;
147
- const projectImports = imports.filter((i) => !i.startsWith("react") && !i.startsWith("@"));
148
- const externalImports = imports.filter((i) => i.startsWith("react") || i.startsWith("@"));
149
- if (projectImports.length > 0) {
150
- graph += " Project dependencies:\n";
151
- projectImports.forEach((imp) => {
152
- graph += ` \u2192 ${imp}
153
- `;
154
- });
155
- }
156
- if (externalImports.length > 0) {
157
- graph += " External dependencies:\n";
158
- externalImports.forEach((imp) => {
159
- graph += ` \u2192 ${imp}
160
- `;
161
- });
162
- }
163
- graph += "\n";
164
- }
165
- return graph;
166
- }
167
- }
168
- // Annotate the CommonJS export names for ESM import in node:
169
- 0 && (module.exports = {
170
- TypeScriptDependencyScanner
171
- });