@akanjs/devkit 0.0.53 → 0.0.55
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/index.cjs +17 -0
- package/index.js +1 -17
- package/package.json +8 -2
- package/src/aiEditor.cjs +46 -0
- package/src/aiEditor.js +8 -27
- package/src/auth.cjs +64 -0
- package/src/auth.js +23 -45
- package/src/baseDevEnv.cjs +45 -0
- package/src/baseDevEnv.js +4 -23
- package/src/capacitorApp.cjs +153 -0
- package/src/capacitorApp.js +10 -39
- package/src/commandDecorators/argMeta.cjs +67 -0
- package/src/commandDecorators/argMeta.js +12 -31
- package/src/commandDecorators/command.cjs +160 -0
- package/src/commandDecorators/command.js +30 -49
- package/src/commandDecorators/commandMeta.cjs +26 -0
- package/src/commandDecorators/commandMeta.js +3 -22
- package/src/commandDecorators/index.cjs +21 -0
- package/src/commandDecorators/index.js +5 -21
- package/src/commandDecorators/targetMeta.cjs +52 -0
- package/src/commandDecorators/targetMeta.js +4 -23
- package/src/commandDecorators/types.cjs +15 -0
- package/src/commandDecorators/types.js +0 -15
- package/src/constants.cjs +37 -0
- package/src/constants.js +11 -30
- package/src/createTunnel.cjs +37 -0
- package/src/createTunnel.js +7 -26
- package/src/dependencyScanner.cjs +159 -0
- package/src/dependencyScanner.js +6 -35
- package/src/executors.cjs +592 -0
- package/src/executors.js +91 -116
- package/src/extractDeps.cjs +99 -0
- package/src/extractDeps.js +3 -22
- package/src/getCredentials.cjs +40 -0
- package/src/getCredentials.js +7 -36
- package/src/getDependencies.cjs +51 -0
- package/src/getDependencies.js +5 -24
- package/src/getModelFileData.cjs +62 -0
- package/src/getModelFileData.js +7 -36
- package/src/getRelatedCnsts.cjs +138 -0
- package/src/getRelatedCnsts.js +8 -37
- package/src/index.cjs +34 -0
- package/src/index.js +18 -34
- package/src/installExternalLib.cjs +29 -0
- package/src/installExternalLib.js +3 -22
- package/src/selectModel.cjs +42 -0
- package/src/selectModel.js +7 -36
- package/src/streamAi.cjs +56 -0
- package/src/streamAi.js +8 -27
- package/src/types.cjs +15 -0
- package/src/types.d.ts +2 -0
- package/src/types.js +0 -15
- package/src/uploadRelease.cjs +81 -0
- package/src/uploadRelease.js +16 -45
|
@@ -0,0 +1,51 @@
|
|
|
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 getDependencies_exports = {};
|
|
19
|
+
__export(getDependencies_exports, {
|
|
20
|
+
getDependencies: () => getDependencies
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(getDependencies_exports);
|
|
23
|
+
var import_devkit = require("@nx/devkit");
|
|
24
|
+
const addLibDepSet = (depName, { libDepSet, npmDepSet, dependencies }) => {
|
|
25
|
+
const deps = dependencies[depName];
|
|
26
|
+
if (!deps)
|
|
27
|
+
throw new Error(`No dependencies found for project or library ${depName}`);
|
|
28
|
+
for (const dep of deps) {
|
|
29
|
+
if (dep.target.startsWith("npm:"))
|
|
30
|
+
npmDepSet.add(dep.target);
|
|
31
|
+
else if (libDepSet.has(dep.target))
|
|
32
|
+
continue;
|
|
33
|
+
else {
|
|
34
|
+
libDepSet.add(dep.target);
|
|
35
|
+
addLibDepSet(dep.target, { libDepSet, npmDepSet, dependencies });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const getDependencies = async (projectName) => {
|
|
40
|
+
const graph = await (0, import_devkit.createProjectGraphAsync)();
|
|
41
|
+
const [libDepSet, npmDepSet] = [/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()];
|
|
42
|
+
const dependencies = graph.dependencies;
|
|
43
|
+
const projectDeps = dependencies[projectName];
|
|
44
|
+
if (!projectDeps)
|
|
45
|
+
throw new Error(`No dependencies found for project ${projectName}`);
|
|
46
|
+
addLibDepSet(projectName, { libDepSet, npmDepSet, dependencies });
|
|
47
|
+
return {
|
|
48
|
+
libDeps: [...libDepSet.values()],
|
|
49
|
+
npmDeps: [...npmDepSet.values()].map((depName) => depName.replace("npm:", ""))
|
|
50
|
+
};
|
|
51
|
+
};
|
package/src/getDependencies.js
CHANGED
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
|
|
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 getDependencies_exports = {};
|
|
19
|
-
__export(getDependencies_exports, {
|
|
20
|
-
getDependencies: () => getDependencies
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(getDependencies_exports);
|
|
23
|
-
var import_devkit = require("@nx/devkit");
|
|
1
|
+
import { createProjectGraphAsync } from "@nx/devkit";
|
|
24
2
|
const addLibDepSet = (depName, { libDepSet, npmDepSet, dependencies }) => {
|
|
25
3
|
const deps = dependencies[depName];
|
|
26
4
|
if (!deps)
|
|
@@ -37,7 +15,7 @@ const addLibDepSet = (depName, { libDepSet, npmDepSet, dependencies }) => {
|
|
|
37
15
|
}
|
|
38
16
|
};
|
|
39
17
|
const getDependencies = async (projectName) => {
|
|
40
|
-
const graph = await
|
|
18
|
+
const graph = await createProjectGraphAsync();
|
|
41
19
|
const [libDepSet, npmDepSet] = [/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()];
|
|
42
20
|
const dependencies = graph.dependencies;
|
|
43
21
|
const projectDeps = dependencies[projectName];
|
|
@@ -49,3 +27,6 @@ const getDependencies = async (projectName) => {
|
|
|
49
27
|
npmDeps: [...npmDepSet.values()].map((depName) => depName.replace("npm:", ""))
|
|
50
28
|
};
|
|
51
29
|
};
|
|
30
|
+
export {
|
|
31
|
+
getDependencies
|
|
32
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
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"), 1);
|
|
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
|
+
};
|
package/src/getModelFileData.js
CHANGED
|
@@ -1,45 +1,13 @@
|
|
|
1
|
-
|
|
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"));
|
|
1
|
+
import fs from "fs";
|
|
34
2
|
const getModelFileData = (modulePath, modelName) => {
|
|
35
3
|
const moduleType = modulePath.startsWith("apps") ? "app" : "lib";
|
|
36
4
|
const moduleName = modulePath.split("/")[1];
|
|
37
5
|
const constantFilePath = `${modulePath}/lib/${modelName}/${modelName}.constant.ts`;
|
|
38
6
|
const unitFilePath = `${modulePath}/lib/${modelName}/${modelName}.Unit.tsx`;
|
|
39
7
|
const viewFilePath = `${modulePath}/lib/${modelName}/${modelName}.View.tsx`;
|
|
40
|
-
const constantFileStr =
|
|
41
|
-
const unitFileStr =
|
|
42
|
-
const viewFileStr =
|
|
8
|
+
const constantFileStr = fs.readFileSync(constantFilePath, "utf8");
|
|
9
|
+
const unitFileStr = fs.readFileSync(unitFilePath, "utf8");
|
|
10
|
+
const viewFileStr = fs.readFileSync(viewFilePath, "utf8");
|
|
43
11
|
const constantFileLines = constantFileStr.split("\n");
|
|
44
12
|
const importLibNames = constantFileLines.filter((line) => line.startsWith("import { cnst as ")).map((line) => line.split("cnst as ")[1].split(" ")[0]);
|
|
45
13
|
const importLocalPaths = constantFileLines.filter((line) => line.startsWith("import { ") && line.includes('from "../')).map((line) => line.split("from ")[1].split('"')[1]);
|
|
@@ -60,3 +28,6 @@ const getModelFileData = (modulePath, modelName) => {
|
|
|
60
28
|
viewFileStr
|
|
61
29
|
};
|
|
62
30
|
};
|
|
31
|
+
export {
|
|
32
|
+
getModelFileData
|
|
33
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
getRelatedCnsts: () => getRelatedCnsts
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(getRelatedCnsts_exports);
|
|
33
|
+
var import_fs = __toESM(require("fs"), 1);
|
|
34
|
+
var import_ora = __toESM(require("ora"), 1);
|
|
35
|
+
var ts = __toESM(require("typescript"), 1);
|
|
36
|
+
const getRelatedCnsts = (constantFilePath) => {
|
|
37
|
+
const tsConfigPath = `./tsconfig.json`;
|
|
38
|
+
const configFile = ts.readConfigFile(tsConfigPath, (path) => {
|
|
39
|
+
return ts.sys.readFile(path);
|
|
40
|
+
});
|
|
41
|
+
const parsedConfig = ts.parseJsonConfigFileContent(
|
|
42
|
+
configFile.config,
|
|
43
|
+
ts.sys,
|
|
44
|
+
import_fs.default.realpathSync(tsConfigPath).replace(/[^/\\]+$/, "")
|
|
45
|
+
);
|
|
46
|
+
const propertyMap = /* @__PURE__ */ new Map();
|
|
47
|
+
function findPropertyOriginAll(filePath) {
|
|
48
|
+
const program = ts.createProgram([filePath], parsedConfig.options);
|
|
49
|
+
const checker = program.getTypeChecker();
|
|
50
|
+
const source = program.getSourceFile(filePath);
|
|
51
|
+
if (!source)
|
|
52
|
+
return null;
|
|
53
|
+
function visit(node) {
|
|
54
|
+
if (!source)
|
|
55
|
+
return;
|
|
56
|
+
if (ts.isPropertyAccessExpression(node)) {
|
|
57
|
+
const left = node.expression;
|
|
58
|
+
const right = node.name;
|
|
59
|
+
const { line } = ts.getLineAndCharacterOfPosition(source, node.getStart());
|
|
60
|
+
//!Field.Prop 거르기가 빡세네.
|
|
61
|
+
const sourceLines = source.getFullText().split("\n");
|
|
62
|
+
if (ts.isIdentifier(left) && sourceLines.length && (sourceLines[line].includes(`@Field.Prop(() => ${left.text}.${right.text}`) || sourceLines[line].includes(`base.Filter(${left.text}.${right.text},`))) {
|
|
63
|
+
const symbol = checker.getSymbolAtLocation(right);
|
|
64
|
+
if (symbol?.declarations && symbol.declarations.length > 0) {
|
|
65
|
+
const key = symbol.declarations[0].getSourceFile().fileName.split("/").pop()?.split(".")[0] ?? "";
|
|
66
|
+
const property = propertyMap.get(key);
|
|
67
|
+
const isScalar = symbol.declarations[0].getSourceFile().fileName.includes("_");
|
|
68
|
+
const filePath2 = symbol.declarations[0].getSourceFile().fileName.replace(`${ts.sys.getCurrentDirectory()}/`, "");
|
|
69
|
+
if (property) {
|
|
70
|
+
propertyMap.set(`${left.text}.${right.text}`, {
|
|
71
|
+
filePath: filePath2,
|
|
72
|
+
isLibModule: true,
|
|
73
|
+
isImport: false,
|
|
74
|
+
libName: left.text,
|
|
75
|
+
isScalar
|
|
76
|
+
});
|
|
77
|
+
} else
|
|
78
|
+
propertyMap.set(key, {
|
|
79
|
+
filePath: filePath2,
|
|
80
|
+
isLibModule: true,
|
|
81
|
+
isImport: false,
|
|
82
|
+
libName: left.text,
|
|
83
|
+
isScalar
|
|
84
|
+
});
|
|
85
|
+
findPropertyOriginAll(filePath2);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
} else if (ts.isImportDeclaration(node)) {
|
|
89
|
+
const importPath = node.moduleSpecifier.getText().slice(1, -1);
|
|
90
|
+
if (importPath.startsWith(".")) {
|
|
91
|
+
const resolved = ts.resolveModuleName(importPath, filePath, parsedConfig.options, ts.sys).resolvedModule?.resolvedFileName;
|
|
92
|
+
const moduleName = importPath.split("/").pop()?.split(".")[0] ?? "";
|
|
93
|
+
const property = propertyMap.get(moduleName);
|
|
94
|
+
const isScalar = importPath.includes("_");
|
|
95
|
+
if (moduleName && resolved && (!property || property.filePath !== resolved)) {
|
|
96
|
+
propertyMap.set(moduleName, {
|
|
97
|
+
filePath: resolved,
|
|
98
|
+
isLibModule: false,
|
|
99
|
+
isImport: true,
|
|
100
|
+
isScalar
|
|
101
|
+
});
|
|
102
|
+
findPropertyOriginAll(resolved);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
ts.forEachChild(node, visit);
|
|
107
|
+
}
|
|
108
|
+
visit(source);
|
|
109
|
+
return propertyMap;
|
|
110
|
+
}
|
|
111
|
+
function findPropertyOrigin(filePath, aliasName, libName) {
|
|
112
|
+
const program = ts.createProgram([filePath], parsedConfig.options);
|
|
113
|
+
const checker = program.getTypeChecker();
|
|
114
|
+
const source = program.getSourceFile(filePath);
|
|
115
|
+
const propertyMap2 = /* @__PURE__ */ new Map();
|
|
116
|
+
if (!source)
|
|
117
|
+
return null;
|
|
118
|
+
function visit(node) {
|
|
119
|
+
if (ts.isPropertyAccessExpression(node)) {
|
|
120
|
+
const left = node.expression;
|
|
121
|
+
const right = node.name;
|
|
122
|
+
if (ts.isIdentifier(left) && left.text === aliasName && right.text === libName) {
|
|
123
|
+
const symbol = checker.getSymbolAtLocation(right);
|
|
124
|
+
if (symbol?.declarations && symbol.declarations.length > 0) {
|
|
125
|
+
return symbol.declarations[0].getSourceFile().fileName;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return ts.forEachChild(node, visit) || null;
|
|
130
|
+
}
|
|
131
|
+
return visit(source);
|
|
132
|
+
}
|
|
133
|
+
const spinner = (0, import_ora.default)("Finding property origin...");
|
|
134
|
+
spinner.start();
|
|
135
|
+
const paths = findPropertyOriginAll(constantFilePath);
|
|
136
|
+
spinner.succeed("property origin found.");
|
|
137
|
+
return { paths };
|
|
138
|
+
};
|
package/src/getRelatedCnsts.js
CHANGED
|
@@ -1,38 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
getRelatedCnsts: () => getRelatedCnsts
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(getRelatedCnsts_exports);
|
|
33
|
-
var import_fs = __toESM(require("fs"));
|
|
34
|
-
var import_ora = __toESM(require("ora"));
|
|
35
|
-
var ts = __toESM(require("typescript"));
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import ora from "ora";
|
|
3
|
+
import * as ts from "typescript";
|
|
36
4
|
const getRelatedCnsts = (constantFilePath) => {
|
|
37
5
|
const tsConfigPath = `./tsconfig.json`;
|
|
38
6
|
const configFile = ts.readConfigFile(tsConfigPath, (path) => {
|
|
@@ -41,7 +9,7 @@ const getRelatedCnsts = (constantFilePath) => {
|
|
|
41
9
|
const parsedConfig = ts.parseJsonConfigFileContent(
|
|
42
10
|
configFile.config,
|
|
43
11
|
ts.sys,
|
|
44
|
-
|
|
12
|
+
fs.realpathSync(tsConfigPath).replace(/[^/\\]+$/, "")
|
|
45
13
|
);
|
|
46
14
|
const propertyMap = /* @__PURE__ */ new Map();
|
|
47
15
|
function findPropertyOriginAll(filePath) {
|
|
@@ -130,9 +98,12 @@ const getRelatedCnsts = (constantFilePath) => {
|
|
|
130
98
|
}
|
|
131
99
|
return visit(source);
|
|
132
100
|
}
|
|
133
|
-
const spinner = (
|
|
101
|
+
const spinner = ora("Finding property origin...");
|
|
134
102
|
spinner.start();
|
|
135
103
|
const paths = findPropertyOriginAll(constantFilePath);
|
|
136
104
|
spinner.succeed("property origin found.");
|
|
137
105
|
return { paths };
|
|
138
106
|
};
|
|
107
|
+
export {
|
|
108
|
+
getRelatedCnsts
|
|
109
|
+
};
|
package/src/index.cjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var src_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(src_exports);
|
|
17
|
+
__reExport(src_exports, require("./baseDevEnv"), module.exports);
|
|
18
|
+
__reExport(src_exports, require("./createTunnel"), module.exports);
|
|
19
|
+
__reExport(src_exports, require("./getCredentials"), module.exports);
|
|
20
|
+
__reExport(src_exports, require("./getDependencies"), module.exports);
|
|
21
|
+
__reExport(src_exports, require("./uploadRelease"), module.exports);
|
|
22
|
+
__reExport(src_exports, require("./getModelFileData"), module.exports);
|
|
23
|
+
__reExport(src_exports, require("./getRelatedCnsts"), module.exports);
|
|
24
|
+
__reExport(src_exports, require("./selectModel"), module.exports);
|
|
25
|
+
__reExport(src_exports, require("./streamAi"), module.exports);
|
|
26
|
+
__reExport(src_exports, require("./executors"), module.exports);
|
|
27
|
+
__reExport(src_exports, require("./dependencyScanner"), module.exports);
|
|
28
|
+
__reExport(src_exports, require("./constants"), module.exports);
|
|
29
|
+
__reExport(src_exports, require("./auth"), module.exports);
|
|
30
|
+
__reExport(src_exports, require("./types"), module.exports);
|
|
31
|
+
__reExport(src_exports, require("./capacitorApp"), module.exports);
|
|
32
|
+
__reExport(src_exports, require("./extractDeps"), module.exports);
|
|
33
|
+
__reExport(src_exports, require("./commandDecorators"), module.exports);
|
|
34
|
+
__reExport(src_exports, require("./installExternalLib"), module.exports);
|
package/src/index.js
CHANGED
|
@@ -1,34 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
__reExport(src_exports, require("./getCredentials"), module.exports);
|
|
20
|
-
__reExport(src_exports, require("./getDependencies"), module.exports);
|
|
21
|
-
__reExport(src_exports, require("./uploadRelease"), module.exports);
|
|
22
|
-
__reExport(src_exports, require("./getModelFileData"), module.exports);
|
|
23
|
-
__reExport(src_exports, require("./getRelatedCnsts"), module.exports);
|
|
24
|
-
__reExport(src_exports, require("./selectModel"), module.exports);
|
|
25
|
-
__reExport(src_exports, require("./streamAi"), module.exports);
|
|
26
|
-
__reExport(src_exports, require("./executors"), module.exports);
|
|
27
|
-
__reExport(src_exports, require("./dependencyScanner"), module.exports);
|
|
28
|
-
__reExport(src_exports, require("./constants"), module.exports);
|
|
29
|
-
__reExport(src_exports, require("./auth"), module.exports);
|
|
30
|
-
__reExport(src_exports, require("./types"), module.exports);
|
|
31
|
-
__reExport(src_exports, require("./capacitorApp"), module.exports);
|
|
32
|
-
__reExport(src_exports, require("./extractDeps"), module.exports);
|
|
33
|
-
__reExport(src_exports, require("./commandDecorators"), module.exports);
|
|
34
|
-
__reExport(src_exports, require("./installExternalLib"), module.exports);
|
|
1
|
+
export * from "./baseDevEnv";
|
|
2
|
+
export * from "./createTunnel";
|
|
3
|
+
export * from "./getCredentials";
|
|
4
|
+
export * from "./getDependencies";
|
|
5
|
+
export * from "./uploadRelease";
|
|
6
|
+
export * from "./getModelFileData";
|
|
7
|
+
export * from "./getRelatedCnsts";
|
|
8
|
+
export * from "./selectModel";
|
|
9
|
+
export * from "./streamAi";
|
|
10
|
+
export * from "./executors";
|
|
11
|
+
export * from "./dependencyScanner";
|
|
12
|
+
export * from "./constants";
|
|
13
|
+
export * from "./auth";
|
|
14
|
+
export * from "./types";
|
|
15
|
+
export * from "./capacitorApp";
|
|
16
|
+
export * from "./extractDeps";
|
|
17
|
+
export * from "./commandDecorators";
|
|
18
|
+
export * from "./installExternalLib";
|
|
@@ -0,0 +1,29 @@
|
|
|
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 installExternalLib_exports = {};
|
|
19
|
+
__export(installExternalLib_exports, {
|
|
20
|
+
installExternalLib: () => installExternalLib
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(installExternalLib_exports);
|
|
23
|
+
const utilGitRepo = "git@github.com:akan-team/util.git";
|
|
24
|
+
const sharedGitRepo = "git@github.com:akan-team/shared.git";
|
|
25
|
+
const installExternalLib = async (libName, workspace) => {
|
|
26
|
+
workspace.log(`Installing ${libName} library as git subtree...`);
|
|
27
|
+
await workspace.exec(`git remote add ${libName} git@github.com:akan-team/${libName}.git`);
|
|
28
|
+
await workspace.exec(`git subtree add --prefix=libs/${libName} ${libName} main`);
|
|
29
|
+
};
|
|
@@ -1,25 +1,3 @@
|
|
|
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 installExternalLib_exports = {};
|
|
19
|
-
__export(installExternalLib_exports, {
|
|
20
|
-
installExternalLib: () => installExternalLib
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(installExternalLib_exports);
|
|
23
1
|
const utilGitRepo = "git@github.com:akan-team/util.git";
|
|
24
2
|
const sharedGitRepo = "git@github.com:akan-team/shared.git";
|
|
25
3
|
const installExternalLib = async (libName, workspace) => {
|
|
@@ -27,3 +5,6 @@ const installExternalLib = async (libName, workspace) => {
|
|
|
27
5
|
await workspace.exec(`git remote add ${libName} git@github.com:akan-team/${libName}.git`);
|
|
28
6
|
await workspace.exec(`git subtree add --prefix=libs/${libName} ${libName} main`);
|
|
29
7
|
};
|
|
8
|
+
export {
|
|
9
|
+
installExternalLib
|
|
10
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
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 selectModel_exports = {};
|
|
29
|
+
__export(selectModel_exports, {
|
|
30
|
+
selectModel: () => selectModel
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(selectModel_exports);
|
|
33
|
+
var import_prompts = require("@inquirer/prompts");
|
|
34
|
+
var import_fs = __toESM(require("fs"), 1);
|
|
35
|
+
const selectModel = async (modulePath) => {
|
|
36
|
+
const modelNames = import_fs.default.readdirSync(`${modulePath}/lib`).filter((dir) => !dir.includes(".") && !dir.startsWith("_"));
|
|
37
|
+
const modelName = await (0, import_prompts.select)({
|
|
38
|
+
message: "Select the model to create the unit for",
|
|
39
|
+
choices: modelNames.map((name) => ({ name, value: name }))
|
|
40
|
+
});
|
|
41
|
+
return modelName;
|
|
42
|
+
};
|