@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.
Files changed (195) hide show
  1. package/README.ko.md +65 -0
  2. package/README.md +62 -6
  3. package/aiEditor.ts +304 -0
  4. package/akanApp/akanApp.host.ts +393 -0
  5. package/akanApp/index.ts +1 -0
  6. package/akanConfig/akanConfig.test.ts +236 -0
  7. package/akanConfig/akanConfig.ts +384 -0
  8. package/akanConfig/index.ts +2 -0
  9. package/akanConfig/types.ts +23 -0
  10. package/applicationBuildReporter.ts +69 -0
  11. package/applicationBuildRunner.ts +302 -0
  12. package/applicationReleasePackager.ts +206 -0
  13. package/artifact/implicitRootLayout.ts +155 -0
  14. package/artifact/index.ts +1 -0
  15. package/artifact/routeSeedIndex.test.ts +98 -0
  16. package/artifact/routeSeedIndex.ts +130 -0
  17. package/auth.ts +41 -0
  18. package/builder.ts +164 -0
  19. package/capacitor.base.config.ts +88 -0
  20. package/capacitorApp.ts +440 -0
  21. package/commandDecorators/argMeta.ts +102 -0
  22. package/commandDecorators/command.ts +351 -0
  23. package/commandDecorators/commandBuilder.ts +224 -0
  24. package/commandDecorators/commandDecorators.test.ts +212 -0
  25. package/commandDecorators/commandMeta.ts +7 -0
  26. package/commandDecorators/dependencyBuilder.ts +100 -0
  27. package/{esm/src/commandDecorators/helpFormatter.js → commandDecorators/helpFormatter.ts} +100 -47
  28. package/{esm/src/commandDecorators/index.js → commandDecorators/index.ts} +4 -2
  29. package/commandDecorators/targetMeta.ts +31 -0
  30. package/commandDecorators/types.ts +10 -0
  31. package/constants.ts +25 -0
  32. package/createTunnel.ts +36 -0
  33. package/dependencyScanner.ts +357 -0
  34. package/devkitUtils.test.ts +259 -0
  35. package/executors.test.ts +315 -0
  36. package/executors.ts +1390 -0
  37. package/{esm/src/extractDeps.js → extractDeps.ts} +26 -20
  38. package/{esm/src/fileEditor.js → fileEditor.ts} +51 -32
  39. package/fileSys.ts +39 -0
  40. package/frontendBuild/allRoutesBuilder.ts +103 -0
  41. package/frontendBuild/buildRouteClient.test.ts +190 -0
  42. package/frontendBuild/clientBuildTypes.ts +114 -0
  43. package/frontendBuild/clientEntriesBundler.ts +303 -0
  44. package/frontendBuild/clientEntryDiscovery.ts +199 -0
  45. package/frontendBuild/csrArtifactBuilder.ts +237 -0
  46. package/frontendBuild/cssCompiler.ts +286 -0
  47. package/frontendBuild/cssImportResolver.ts +116 -0
  48. package/frontendBuild/fontOptimizer.ts +427 -0
  49. package/frontendBuild/frontendBuild.test.ts +204 -0
  50. package/frontendBuild/hmrChangeClassifier.ts +28 -0
  51. package/frontendBuild/hmrWatcher.ts +102 -0
  52. package/frontendBuild/index.ts +18 -0
  53. package/frontendBuild/pagesBundleBuilder.ts +137 -0
  54. package/frontendBuild/pagesEntrySourceGenerator.ts +37 -0
  55. package/frontendBuild/precompressArtifacts.ts +59 -0
  56. package/frontendBuild/routeClientBuilder.ts +290 -0
  57. package/frontendBuild/routesManifestArtifactSerializer.ts +62 -0
  58. package/frontendBuild/ssrBaseArtifactBuilder.ts +139 -0
  59. package/frontendBuild/vendorSpecifiers.ts +16 -0
  60. package/frontendBuild/watchRootResolver.ts +28 -0
  61. package/getCredentials.ts +19 -0
  62. package/getDirname.ts +3 -0
  63. package/getModelFileData.ts +59 -0
  64. package/getRelatedCnsts.ts +313 -0
  65. package/guideline.ts +19 -0
  66. package/incrementalBuilder/incrementalBuilder.host.test.ts +51 -0
  67. package/incrementalBuilder/incrementalBuilder.host.ts +152 -0
  68. package/incrementalBuilder/incrementalBuilder.proc.ts +331 -0
  69. package/incrementalBuilder/index.ts +1 -0
  70. package/{esm/src/index.js → index.ts} +28 -15
  71. package/lint/no-deep-internal-import.grit +25 -0
  72. package/lint/no-import-client-functions.grit +32 -0
  73. package/lint/no-import-external-library.grit +21 -0
  74. package/lint/no-js-private-class-method.grit +42 -0
  75. package/lint/no-use-client-in-server.grit +7 -0
  76. package/lint/non-scalar-props-restricted.grit +13 -0
  77. package/linter.ts +271 -0
  78. package/mobile/index.ts +1 -0
  79. package/mobile/mobileTarget.test.ts +53 -0
  80. package/mobile/mobileTarget.ts +88 -0
  81. package/package.json +48 -31
  82. package/prompter.ts +72 -0
  83. package/scanInfo.ts +606 -0
  84. package/selectModel.ts +11 -0
  85. package/{esm/src/spinner.js → spinner.ts} +22 -28
  86. package/{esm/src/capacitorApp.js → src/capacitorApp.ts} +82 -81
  87. package/sshTunnel.ts +152 -0
  88. package/{esm/src/streamAi.js → streamAi.ts} +18 -12
  89. package/transforms/barrelAnalyzer.ts +278 -0
  90. package/transforms/barrelImportsPlugin.ts +504 -0
  91. package/transforms/externalizeFrameworkPlugin.ts +185 -0
  92. package/transforms/index.ts +5 -0
  93. package/transforms/rscUseClientTransform.ts +59 -0
  94. package/transforms/transforms.test.ts +208 -0
  95. package/transforms/useClientBundlePlugin.ts +47 -0
  96. package/tsconfig.json +37 -0
  97. package/typeChecker.ts +264 -0
  98. package/types.ts +44 -0
  99. package/ui/MultiScrollList.tsx +242 -0
  100. package/ui/ScrollList.tsx +107 -0
  101. package/ui/index.ts +2 -0
  102. package/{esm/src/uploadRelease.js → uploadRelease.ts} +50 -34
  103. package/{esm/src/useStdoutDimensions.js → useStdoutDimensions.ts} +5 -5
  104. package/cjs/index.js +0 -21
  105. package/cjs/src/aiEditor.js +0 -311
  106. package/cjs/src/auth.js +0 -72
  107. package/cjs/src/builder.js +0 -114
  108. package/cjs/src/capacitorApp.js +0 -313
  109. package/cjs/src/commandDecorators/argMeta.js +0 -88
  110. package/cjs/src/commandDecorators/command.js +0 -324
  111. package/cjs/src/commandDecorators/commandMeta.js +0 -30
  112. package/cjs/src/commandDecorators/helpFormatter.js +0 -211
  113. package/cjs/src/commandDecorators/index.js +0 -31
  114. package/cjs/src/commandDecorators/targetMeta.js +0 -57
  115. package/cjs/src/commandDecorators/types.js +0 -15
  116. package/cjs/src/constants.js +0 -46
  117. package/cjs/src/createTunnel.js +0 -49
  118. package/cjs/src/dependencyScanner.js +0 -220
  119. package/cjs/src/executors.js +0 -964
  120. package/cjs/src/extractDeps.js +0 -103
  121. package/cjs/src/fileEditor.js +0 -120
  122. package/cjs/src/getCredentials.js +0 -44
  123. package/cjs/src/getDirname.js +0 -38
  124. package/cjs/src/getModelFileData.js +0 -66
  125. package/cjs/src/getRelatedCnsts.js +0 -260
  126. package/cjs/src/guideline.js +0 -15
  127. package/cjs/src/index.js +0 -65
  128. package/cjs/src/linter.js +0 -238
  129. package/cjs/src/prompter.js +0 -85
  130. package/cjs/src/scanInfo.js +0 -491
  131. package/cjs/src/selectModel.js +0 -46
  132. package/cjs/src/spinner.js +0 -93
  133. package/cjs/src/streamAi.js +0 -62
  134. package/cjs/src/typeChecker.js +0 -207
  135. package/cjs/src/types.js +0 -15
  136. package/cjs/src/uploadRelease.js +0 -112
  137. package/cjs/src/useStdoutDimensions.js +0 -43
  138. package/esm/index.js +0 -1
  139. package/esm/src/aiEditor.js +0 -282
  140. package/esm/src/auth.js +0 -42
  141. package/esm/src/builder.js +0 -81
  142. package/esm/src/commandDecorators/argMeta.js +0 -54
  143. package/esm/src/commandDecorators/command.js +0 -290
  144. package/esm/src/commandDecorators/commandMeta.js +0 -7
  145. package/esm/src/commandDecorators/targetMeta.js +0 -33
  146. package/esm/src/commandDecorators/types.js +0 -0
  147. package/esm/src/constants.js +0 -17
  148. package/esm/src/createTunnel.js +0 -26
  149. package/esm/src/dependencyScanner.js +0 -187
  150. package/esm/src/executors.js +0 -928
  151. package/esm/src/getCredentials.js +0 -11
  152. package/esm/src/getDirname.js +0 -5
  153. package/esm/src/getModelFileData.js +0 -33
  154. package/esm/src/getRelatedCnsts.js +0 -221
  155. package/esm/src/guideline.js +0 -0
  156. package/esm/src/linter.js +0 -205
  157. package/esm/src/prompter.js +0 -51
  158. package/esm/src/scanInfo.js +0 -455
  159. package/esm/src/selectModel.js +0 -13
  160. package/esm/src/typeChecker.js +0 -174
  161. package/esm/src/types.js +0 -0
  162. package/index.d.ts +0 -1
  163. package/src/aiEditor.d.ts +0 -50
  164. package/src/auth.d.ts +0 -9
  165. package/src/builder.d.ts +0 -18
  166. package/src/capacitorApp.d.ts +0 -39
  167. package/src/commandDecorators/argMeta.d.ts +0 -67
  168. package/src/commandDecorators/command.d.ts +0 -2
  169. package/src/commandDecorators/commandMeta.d.ts +0 -2
  170. package/src/commandDecorators/helpFormatter.d.ts +0 -3
  171. package/src/commandDecorators/index.d.ts +0 -6
  172. package/src/commandDecorators/targetMeta.d.ts +0 -19
  173. package/src/commandDecorators/types.d.ts +0 -1
  174. package/src/constants.d.ts +0 -26
  175. package/src/createTunnel.d.ts +0 -8
  176. package/src/dependencyScanner.d.ts +0 -23
  177. package/src/executors.d.ts +0 -296
  178. package/src/extractDeps.d.ts +0 -7
  179. package/src/fileEditor.d.ts +0 -16
  180. package/src/getCredentials.d.ts +0 -12
  181. package/src/getDirname.d.ts +0 -1
  182. package/src/getModelFileData.d.ts +0 -16
  183. package/src/getRelatedCnsts.d.ts +0 -53
  184. package/src/guideline.d.ts +0 -19
  185. package/src/index.d.ts +0 -23
  186. package/src/linter.d.ts +0 -109
  187. package/src/prompter.d.ts +0 -14
  188. package/src/scanInfo.d.ts +0 -82
  189. package/src/selectModel.d.ts +0 -1
  190. package/src/spinner.d.ts +0 -20
  191. package/src/streamAi.d.ts +0 -6
  192. package/src/typeChecker.d.ts +0 -52
  193. package/src/types.d.ts +0 -31
  194. package/src/uploadRelease.d.ts +0 -10
  195. package/src/useStdoutDimensions.d.ts +0 -1
package/src/auth.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { AkanGlobalConfig, type HostConfig } from "./constants";
2
- export declare const getAkanGlobalConfig: () => AkanGlobalConfig;
3
- export declare const setAkanGlobalConfig: (akanConfig: AkanGlobalConfig) => void;
4
- export declare const getHostConfig: (host?: string) => HostConfig;
5
- export declare const setHostConfig: (host?: string, config?: HostConfig) => void;
6
- export declare const getSelf: (token: string) => Promise<{
7
- id: string;
8
- nickname: string;
9
- } | null>;
package/src/builder.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import { Executor } from "./executors";
2
- import { PackageJson } from "./types";
3
- interface BuildOptions {
4
- bundle?: boolean;
5
- additionalEntryPoints?: string[];
6
- }
7
- interface BuilderOptions {
8
- executor: Executor;
9
- distExecutor: Executor;
10
- pkgJson: PackageJson;
11
- rootPackageJson: PackageJson;
12
- }
13
- export declare class Builder {
14
- #private;
15
- constructor({ executor, distExecutor, pkgJson, rootPackageJson }: BuilderOptions);
16
- build(options?: BuildOptions): Promise<void>;
17
- }
18
- export {};
@@ -1,39 +0,0 @@
1
- import type { AppExecutor } from "@akanjs/devkit";
2
- import { CapacitorConfig } from "@capacitor/cli";
3
- import { MobileProject } from "@trapezedev/project";
4
- import type { AndroidProject } from "@trapezedev/project/dist/android/project";
5
- import type { IosProject } from "@trapezedev/project/dist/ios/project";
6
- interface RunConfig extends CapacitorConfig {
7
- operation: "local" | "release";
8
- version: string;
9
- buildNum: number;
10
- appId?: string;
11
- host?: "local" | "debug" | "develop" | "main";
12
- }
13
- export declare class CapacitorApp {
14
- #private;
15
- private readonly app;
16
- project: MobileProject & {
17
- ios: IosProject;
18
- android: AndroidProject;
19
- };
20
- iosTargetName: string;
21
- constructor(app: AppExecutor);
22
- init(): Promise<this>;
23
- save(): Promise<void>;
24
- buildIos(): Promise<void>;
25
- syncIos(): Promise<void>;
26
- openIos(): Promise<void>;
27
- runIos({ operation, appId, version, buildNum, host }: RunConfig): Promise<void>;
28
- buildAndroid(assembleType: "apk" | "aab"): Promise<void>;
29
- openAndroid(): Promise<void>;
30
- syncAndroid(): Promise<void>;
31
- runAndroid({ operation, appName, appId, version, buildNum, host }: RunConfig): Promise<void>;
32
- updateAndroidVersion(version: string, buildNum: number): Promise<void>;
33
- releaseIos(): Promise<void>;
34
- releaseAndroid(): Promise<void>;
35
- addCamera(): Promise<void>;
36
- addContact(): Promise<void>;
37
- addLocation(): Promise<void>;
38
- }
39
- export {};
@@ -1,67 +0,0 @@
1
- import "reflect-metadata";
2
- import type { AppExecutor, Executor, LibExecutor, ModuleExecutor, PkgExecutor, SysExecutor, WorkspaceExecutor } from "../executors";
3
- import type { Type } from "./types";
4
- export declare const argTypes: readonly ["Argument", "Option"];
5
- export type ArgType = (typeof argTypes)[number];
6
- export declare const internalArgTypes: readonly ["Workspace", "App", "Lib", "Sys", "Pkg", "Module", "Exec"];
7
- export type InternalArgType = (typeof internalArgTypes)[number];
8
- interface ArgsOption {
9
- type?: "string" | "number" | "boolean";
10
- flag?: string;
11
- desc?: string;
12
- default?: string | number | boolean;
13
- nullable?: boolean;
14
- example?: string | number | boolean;
15
- enum?: (string | number)[] | readonly (string | number)[] | {
16
- label: string;
17
- value: string | number | boolean;
18
- }[];
19
- ask?: string;
20
- }
21
- export interface ArgMeta {
22
- name: string;
23
- argsOption: ArgsOption;
24
- key: string;
25
- idx: number;
26
- type: ArgType;
27
- }
28
- export interface InternalArgMeta {
29
- key: string;
30
- idx: number;
31
- type: InternalArgType;
32
- option?: {
33
- nullable?: boolean;
34
- };
35
- }
36
- export declare const getArgMetas: (command: Type, key: string) => [(ArgMeta | InternalArgMeta)[], ArgMeta[], InternalArgMeta[]];
37
- export declare const Argument: (name: string, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
38
- export declare const Option: (name: string, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
39
- export declare const App: (option?: {
40
- nullable?: boolean;
41
- }) => (prototype: object, key: string, idx: number) => void;
42
- export type App = AppExecutor;
43
- export declare const Lib: (option?: {
44
- nullable?: boolean;
45
- }) => (prototype: object, key: string, idx: number) => void;
46
- export type Lib = LibExecutor;
47
- export declare const Sys: (option?: {
48
- nullable?: boolean;
49
- }) => (prototype: object, key: string, idx: number) => void;
50
- export type Sys = SysExecutor;
51
- export declare const Exec: (option?: {
52
- nullable?: boolean;
53
- }) => (prototype: object, key: string, idx: number) => void;
54
- export type Exec = Executor;
55
- export declare const Pkg: (option?: {
56
- nullable?: boolean;
57
- }) => (prototype: object, key: string, idx: number) => void;
58
- export type Pkg = PkgExecutor;
59
- export declare const Module: (option?: {
60
- nullable?: boolean;
61
- }) => (prototype: object, key: string, idx: number) => void;
62
- export type Module = ModuleExecutor;
63
- export declare const Workspace: (option?: {
64
- nullable?: boolean;
65
- }) => (prototype: object, key: string, idx: number) => void;
66
- export type Workspace = WorkspaceExecutor;
67
- export {};
@@ -1,2 +0,0 @@
1
- import type { Type } from "./types";
2
- export declare const runCommands: (...commands: Type[]) => Promise<void>;
@@ -1,2 +0,0 @@
1
- import type { Type } from "./types";
2
- export declare const Commands: () => (target: Type) => void;
@@ -1,3 +0,0 @@
1
- import type { Type } from "./types";
2
- export declare const formatHelp: (commands: Type[], version: string) => string;
3
- export declare const formatCommandHelp: (command: Type, key: string) => string;
@@ -1,6 +0,0 @@
1
- export * from "./argMeta";
2
- export * from "./commandMeta";
3
- export * from "./targetMeta";
4
- export * from "./types";
5
- export * from "./helpFormatter";
6
- export * from "./command";
@@ -1,19 +0,0 @@
1
- import type { Type } from "./types";
2
- interface TargetMeta {
3
- key: string;
4
- descriptor: PropertyDescriptor;
5
- targetOption: TargetOption;
6
- }
7
- export declare const getTargetMetas: (command: Type) => TargetMeta[];
8
- interface TargetOption {
9
- type: "public" | "cloud" | "dev";
10
- short?: string | true;
11
- devOnly?: boolean;
12
- desc?: string;
13
- }
14
- export declare const Target: {
15
- Public: (targetOption?: Omit<TargetOption, "type">) => (prototype: object, key: string, descriptor: PropertyDescriptor) => void;
16
- Cloud: (targetOption?: Omit<TargetOption, "type">) => (prototype: object, key: string, descriptor: PropertyDescriptor) => void;
17
- Dev: (targetOption?: Omit<TargetOption, "type">) => (prototype: object, key: string, descriptor: PropertyDescriptor) => void;
18
- };
19
- export {};
@@ -1 +0,0 @@
1
- export type Type<T = any> = new (...args: any[]) => T;
@@ -1,26 +0,0 @@
1
- import type { SupportedLlmModel } from "./aiEditor";
2
- export declare const basePath: string;
3
- export declare const configPath: string;
4
- export declare const akanCloudHost: string;
5
- export declare const akanCloudBackendUrl: string;
6
- export declare const akanCloudClientUrl: string;
7
- export interface HostConfig {
8
- auth?: {
9
- token: string;
10
- self: {
11
- id: string;
12
- nickname: string;
13
- };
14
- };
15
- }
16
- export declare const defaultHostConfig: HostConfig;
17
- export interface AkanGlobalConfig {
18
- cloudHost: {
19
- [key: string]: HostConfig;
20
- };
21
- llm: {
22
- model: SupportedLlmModel;
23
- apiKey: string;
24
- } | null;
25
- }
26
- export declare const defaultAkanGlobalConfig: AkanGlobalConfig;
@@ -1,8 +0,0 @@
1
- import type { AppExecutor } from "./executors";
2
- interface TunnelOption {
3
- app: AppExecutor;
4
- environment: string;
5
- port?: number;
6
- }
7
- export declare const createTunnel: ({ app, environment, port }: TunnelOption) => Promise<string>;
8
- export {};
@@ -1,23 +0,0 @@
1
- import type { PackageJson, TsConfigJson } from "./types";
2
- export declare class TypeScriptDependencyScanner {
3
- #private;
4
- private readonly directory;
5
- private readonly tsconfig;
6
- private readonly rootPackageJson;
7
- private readonly ig;
8
- private readonly workspaceRoot;
9
- constructor(directory: string, { workspaceRoot, tsconfig, rootPackageJson, gitignorePatterns, }: {
10
- workspaceRoot: string;
11
- tsconfig: TsConfigJson;
12
- rootPackageJson: PackageJson;
13
- gitignorePatterns?: string[];
14
- });
15
- getMonorepoDependencies(projectName: string): Promise<{
16
- pkgDeps: string[];
17
- libDeps: string[];
18
- npmDeps: string[];
19
- }>;
20
- getImportSets(depSets: Set<string>[]): Promise<Set<string>[]>;
21
- getDependencies(): Promise<Map<string, string[]>>;
22
- generateDependencyGraph(): string;
23
- }
@@ -1,296 +0,0 @@
1
- import { Logger } from "@akanjs/common";
2
- import { type AppConfigResult, type LibConfigResult } from "@akanjs/config";
3
- import { ChildProcess, type ExecOptions, type ForkOptions, type SpawnOptions } from "child_process";
4
- import { ESLint, Linter as ESLintLinter } from "eslint";
5
- import { Linter } from "./linter";
6
- import { AppInfo, LibInfo, PkgInfo, WorkspaceInfo } from "./scanInfo";
7
- import { Spinner } from "./spinner";
8
- import { TypeChecker } from "./typeChecker";
9
- import type { FileContent, PackageJson, TsConfigJson } from "./types";
10
- export declare const execEmoji: {
11
- workspace: string;
12
- app: string;
13
- lib: string;
14
- pkg: string;
15
- dist: string;
16
- module: string;
17
- default: string;
18
- };
19
- export declare class Executor {
20
- #private;
21
- static verbose: boolean;
22
- static setVerbose(verbose: boolean): void;
23
- name: string;
24
- logger: Logger;
25
- logs: string[];
26
- cwdPath: string;
27
- emoji: string;
28
- typeChecker: TypeChecker | null;
29
- linter: Linter | null;
30
- constructor(name: string, cwdPath: string);
31
- exec(command: string, options?: ExecOptions): Promise<unknown>;
32
- spawn(command: string, args?: string[], options?: SpawnOptions): Promise<string>;
33
- spawnSync(command: string, args?: string[], options?: SpawnOptions): ChildProcess;
34
- fork(modulePath: string, args?: string[], options?: ForkOptions): Promise<unknown>;
35
- getPath(filePath: string): string;
36
- mkdir(dirPath: string): this;
37
- readdir(dirPath: string): Promise<string[]>;
38
- getFilesAndDirs(dirPath: string): Promise<{
39
- files: string[];
40
- dirs: string[];
41
- }>;
42
- exists(filePath: string): boolean;
43
- remove(filePath: string): this;
44
- removeDir(dirPath: string): Promise<this>;
45
- writeFile(filePath: string, content: string | object, { overwrite }?: {
46
- overwrite?: boolean;
47
- }): FileContent;
48
- writeJson(filePath: string, content: object): this;
49
- getLocalFile(targetPath: string): {
50
- filePath: string;
51
- content: string;
52
- };
53
- readFile(filePath: string): string;
54
- readJson(filePath: string): object;
55
- cp(srcPath: string, destPath: string): Promise<void>;
56
- log(msg: string): this;
57
- verbose(msg: string): this;
58
- debug(msg: string): this;
59
- spinning(msg: string, { prefix, indent, enableSpin }?: {
60
- prefix?: string | undefined;
61
- indent?: number | undefined;
62
- enableSpin?: boolean | undefined;
63
- }): Spinner;
64
- getTsConfig(pathname?: string, { refresh }?: {
65
- refresh?: boolean;
66
- }): TsConfigJson;
67
- setTsConfig(tsconfig: TsConfigJson): void;
68
- getPackageJson({ refresh }?: {
69
- refresh?: boolean;
70
- }): PackageJson;
71
- setPackageJson(packageJson: PackageJson): void;
72
- getGitignorePatterns(): string[];
73
- _applyTemplate({ basePath, template, scanInfo, dict, options, overwrite, }: {
74
- basePath: string;
75
- template: string;
76
- scanInfo?: AppInfo | LibInfo | null;
77
- dict?: {
78
- [key: string]: string;
79
- };
80
- options?: {
81
- [key: string]: any;
82
- };
83
- overwrite?: boolean;
84
- }): Promise<FileContent[]>;
85
- applyTemplate(options: {
86
- basePath: string;
87
- template: string;
88
- dict?: {
89
- [key: string]: string;
90
- };
91
- options?: {
92
- [key: string]: any;
93
- };
94
- overwrite?: boolean;
95
- }): Promise<FileContent[]>;
96
- getTypeChecker(): TypeChecker;
97
- typeCheck(filePath: string): {
98
- fileDiagnostics: import("typescript").Diagnostic[];
99
- fileErrors: import("typescript").Diagnostic[];
100
- fileWarnings: import("typescript").Diagnostic[];
101
- message: string;
102
- };
103
- getLinter(): Linter;
104
- lint(filePath: string, { fix, dryRun }?: {
105
- fix?: boolean;
106
- dryRun?: boolean;
107
- }): Promise<{
108
- results: ESLint.LintResult[];
109
- message: string;
110
- errors: ESLintLinter.LintMessage[];
111
- warnings: ESLintLinter.LintMessage[];
112
- }>;
113
- }
114
- interface ExecutorOptions {
115
- workspaceRoot: string;
116
- repoName: string;
117
- }
118
- export declare class WorkspaceExecutor extends Executor {
119
- #private;
120
- workspaceRoot: string;
121
- repoName: string;
122
- emoji: string;
123
- constructor({ workspaceRoot, repoName }: ExecutorOptions);
124
- static fromRoot({ workspaceRoot, repoName, }?: {
125
- workspaceRoot?: string;
126
- repoName?: string;
127
- }): WorkspaceExecutor;
128
- getBaseDevEnv(): {
129
- repoName: string;
130
- serveDomain: string;
131
- env: "debug" | "testing" | "local" | "develop" | "main";
132
- portOffset: number;
133
- name?: string | undefined;
134
- };
135
- scan(): Promise<WorkspaceInfo>;
136
- getApps(): Promise<string[]>;
137
- getLibs(): Promise<string[]>;
138
- getSyss(): Promise<[string[], string[]]>;
139
- getPkgs(): Promise<string[]>;
140
- getExecs(): Promise<[string[], string[], string[]]>;
141
- setTsPaths(type: "app" | "lib" | "pkg", name: string): this;
142
- unsetTsPaths(type: "app" | "lib" | "pkg", name: string): this;
143
- getDirInModule(basePath: string, name: string): Promise<string[]>;
144
- commit(message: string, { init, add }?: {
145
- init?: boolean;
146
- add?: boolean;
147
- }): Promise<void>;
148
- getScalarConstantFiles(): Promise<{
149
- filePath: string;
150
- content: string;
151
- }[]>;
152
- getConstantFiles(): Promise<{
153
- filePath: string;
154
- content: string;
155
- }[]>;
156
- getDictionaryFiles(): Promise<{
157
- filePath: string;
158
- content: string;
159
- }[]>;
160
- getViewFiles(): Promise<{
161
- filePath: string;
162
- content: string;
163
- }[]>;
164
- }
165
- interface SysExecutorOptions {
166
- workspace?: WorkspaceExecutor;
167
- name: string;
168
- type: "app" | "lib";
169
- }
170
- export declare class SysExecutor extends Executor {
171
- #private;
172
- workspace: WorkspaceExecutor;
173
- name: string;
174
- type: "app" | "lib";
175
- emoji: string;
176
- constructor({ workspace, name, type }: SysExecutorOptions);
177
- getConfig({ refresh }?: {
178
- refresh?: boolean;
179
- }): Promise<LibConfigResult>;
180
- getModules(): Promise<string[]>;
181
- scan({ refresh, write, writeLib, }?: {
182
- refresh?: boolean;
183
- write?: boolean;
184
- writeLib?: boolean;
185
- }): Promise<AppInfo | LibInfo>;
186
- getLocalFile(targetPath: string): {
187
- filePath: string;
188
- content: string;
189
- };
190
- getDatabaseModules(): Promise<string[]>;
191
- getServiceModules(): Promise<string[]>;
192
- getScalarModules(): Promise<string[]>;
193
- getViewComponents(): Promise<string[]>;
194
- getUnitComponents(): Promise<string[]>;
195
- getTemplateComponents(): Promise<string[]>;
196
- getViewsSourceCode(): Promise<{
197
- filePath: string;
198
- content: string;
199
- }[]>;
200
- getUnitsSourceCode(): Promise<{
201
- filePath: string;
202
- content: string;
203
- }[]>;
204
- getTemplatesSourceCode(): Promise<{
205
- filePath: string;
206
- content: string;
207
- }[]>;
208
- getScalarConstantFiles(): Promise<{
209
- filePath: string;
210
- content: string;
211
- }[]>;
212
- getScalarDictionaryFiles(): Promise<{
213
- filePath: string;
214
- content: string;
215
- }[]>;
216
- getConstantFiles(): Promise<{
217
- filePath: string;
218
- content: string;
219
- }[]>;
220
- getConstantFilesWithLibs(): Promise<{
221
- filePath: string;
222
- content: string;
223
- }[]>;
224
- getDictionaryFiles(): Promise<{
225
- filePath: string;
226
- content: string;
227
- }[]>;
228
- applyTemplate(options: {
229
- basePath: string;
230
- template: string;
231
- dict?: {
232
- [key: string]: string;
233
- };
234
- overwrite?: boolean;
235
- }): Promise<FileContent[]>;
236
- setTsPaths(): this;
237
- }
238
- interface AppExecutorOptions {
239
- workspace?: WorkspaceExecutor;
240
- name: string;
241
- }
242
- export declare class AppExecutor extends SysExecutor {
243
- #private;
244
- dist: Executor;
245
- emoji: string;
246
- constructor({ workspace, name }: AppExecutorOptions);
247
- static from(executor: SysExecutor | WorkspaceExecutor, name: string): AppExecutor;
248
- getEnv(): "debug" | "testing" | "local" | "develop" | "main";
249
- getConfig({ refresh }?: {
250
- refresh?: boolean;
251
- }): Promise<AppConfigResult>;
252
- syncAssets(libDeps: string[]): Promise<void>;
253
- increaseBuildNum(): Promise<void>;
254
- decreaseBuildNum(): Promise<void>;
255
- }
256
- interface LibExecutorOptions {
257
- workspace?: WorkspaceExecutor;
258
- name: string;
259
- }
260
- export declare class LibExecutor extends SysExecutor {
261
- #private;
262
- dist: Executor;
263
- emoji: string;
264
- constructor({ workspace, name }: LibExecutorOptions);
265
- static from(executor: SysExecutor | WorkspaceExecutor, name: string): LibExecutor;
266
- getConfig({ refresh }?: {
267
- refresh?: boolean;
268
- }): Promise<LibConfigResult>;
269
- }
270
- interface PkgExecutorOptions {
271
- workspace?: WorkspaceExecutor;
272
- name: string;
273
- }
274
- export declare class PkgExecutor extends Executor {
275
- #private;
276
- workspace: WorkspaceExecutor;
277
- name: string;
278
- dist: Executor;
279
- emoji: string;
280
- constructor({ workspace, name }: PkgExecutorOptions);
281
- static from(executor: SysExecutor | WorkspaceExecutor, name: string): PkgExecutor;
282
- scan({ refresh }?: {
283
- refresh?: boolean;
284
- }): Promise<PkgInfo>;
285
- }
286
- interface ModuleExecutorOptions {
287
- sys: SysExecutor;
288
- name: string;
289
- }
290
- export declare class ModuleExecutor extends Executor {
291
- sys: SysExecutor;
292
- emoji: string;
293
- constructor({ sys, name }: ModuleExecutorOptions);
294
- static from(sysExecutor: SysExecutor, name: string): ModuleExecutor;
295
- }
296
- export {};
@@ -1,7 +0,0 @@
1
- import type { PackageJson } from "./types";
2
- export declare const extractDependencies: (filepaths: {
3
- path: string;
4
- text: string;
5
- }[], pacakgeJson: PackageJson, defaultDependencies?: string[]) => {
6
- [k: string]: string;
7
- };
@@ -1,16 +0,0 @@
1
- export declare class FileEditor {
2
- #private;
3
- private filePath;
4
- private content;
5
- constructor(filePath: string);
6
- find(pattern: string | RegExp): number;
7
- findAll(pattern: string | RegExp): number[];
8
- insertAfter(pattern: string | RegExp, data: string): this;
9
- insertBefore(pattern: string | RegExp, data: string): this;
10
- replace(pattern: string | RegExp, replacement: string): this;
11
- append(data: string): this;
12
- prepend(data: string): this;
13
- save(): void;
14
- getContent(): string;
15
- setContent(content: string): this;
16
- }
@@ -1,12 +0,0 @@
1
- import type { AppExecutor } from "./executors";
2
- export interface AppSecret {
3
- mongo: {
4
- account: {
5
- user: {
6
- username: string;
7
- password: string;
8
- };
9
- };
10
- };
11
- }
12
- export declare const getCredentials: (app: AppExecutor, environment: string) => AppSecret;
@@ -1 +0,0 @@
1
- export declare const getDirname: (url: string) => string;
@@ -1,16 +0,0 @@
1
- interface ModelFileData {
2
- moduleType: "lib" | "app";
3
- moduleName: string;
4
- modelName: string;
5
- constantFilePath: string;
6
- importModelNames: string[];
7
- hasImportScalar: boolean;
8
- importLibNames: string[];
9
- constantFileStr: string;
10
- unitFilePath: string;
11
- unitFileStr: string;
12
- viewFilePath: string;
13
- viewFileStr: string;
14
- }
15
- export declare const getModelFileData: (modulePath: string, modelName: string) => ModelFileData;
16
- export {};
@@ -1,53 +0,0 @@
1
- import * as ts from "typescript";
2
- /**
3
- * TypeScript 설정 파일을 읽고 파싱하는 함수
4
- */
5
- export declare const parseTsConfig: (tsConfigPath?: string) => ts.ParsedCommandLine;
6
- /**
7
- * 파일 내의 임포트를 기반으로 관련 파일을 수집하는 함수
8
- */
9
- export declare const collectImportedFiles: (constantFilePath: string, parsedConfig: ts.ParsedCommandLine) => {
10
- allFilesToAnalyze: Set<string>;
11
- analyzedFiles: Set<string>;
12
- };
13
- /**
14
- * export 선언을 기반으로 관련 파일을 수집하는 함수
15
- */
16
- export declare const collectExportedFiles: (constantFilePath: string, parsedConfig: ts.ParsedCommandLine) => {
17
- allFilesToAnalyze: Set<string>;
18
- analyzedFiles: Set<string>;
19
- };
20
- /**
21
- * TypeScript 프로그램 생성 함수
22
- */
23
- export declare const createTsProgram: (filePaths: Set<string>, options: ts.CompilerOptions) => {
24
- program: ts.Program;
25
- checker: ts.TypeChecker;
26
- };
27
- /**
28
- * 심볼 캐싱 및 조회 함수 생성기
29
- */
30
- export declare const createSymbolCache: (checker: ts.TypeChecker) => (node: ts.Node) => ts.Symbol | undefined;
31
- /**
32
- * 파일 속성 분석 함수
33
- */
34
- export declare const analyzeProperties: (filesToAnalyze: Set<string>, program: ts.Program, checker: ts.TypeChecker) => Map<string, {
35
- filePath: string;
36
- isLibModule: boolean;
37
- isImport: boolean;
38
- isScalar: boolean;
39
- source: string;
40
- libName?: string;
41
- }>;
42
- /**
43
- * 메인 함수: 상수 파일 관련 요소 분석
44
- */
45
- export declare const getRelatedCnsts: (constantFilePath: string) => {
46
- filePath: string;
47
- isLibModule: boolean;
48
- isImport: boolean;
49
- isScalar: boolean;
50
- source: string;
51
- libName?: string;
52
- key: string;
53
- }[];
@@ -1,19 +0,0 @@
1
- export interface GuideScan {
2
- type: "example" | "source" | "usage" | (string & {});
3
- description: string;
4
- path: string;
5
- filterText?: string;
6
- sample?: number;
7
- }
8
- export interface GuideUpdate {
9
- filePath: string;
10
- contents: string[];
11
- rules: string[];
12
- }
13
- export interface GuideGenerateJson {
14
- title: string;
15
- description: string;
16
- scans: GuideScan[];
17
- update: GuideUpdate;
18
- page?: string;
19
- }