@akanjs/devkit 0.0.88 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/executors.cjs +9 -51
- package/src/executors.d.ts +3 -30
- package/src/executors.js +9 -48
- package/src/index.cjs +0 -2
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/src/installExternalLib.cjs +0 -33
- package/src/installExternalLib.d.ts +0 -2
- package/src/installExternalLib.js +0 -10
package/package.json
CHANGED
package/src/executors.cjs
CHANGED
|
@@ -28,9 +28,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
28
28
|
var executors_exports = {};
|
|
29
29
|
__export(executors_exports, {
|
|
30
30
|
AppExecutor: () => AppExecutor,
|
|
31
|
-
DistAppExecutor: () => DistAppExecutor,
|
|
32
|
-
DistLibExecutor: () => DistLibExecutor,
|
|
33
|
-
DistPkgExecutor: () => DistPkgExecutor,
|
|
34
31
|
Executor: () => Executor,
|
|
35
32
|
LibExecutor: () => LibExecutor,
|
|
36
33
|
PkgExecutor: () => PkgExecutor,
|
|
@@ -41,10 +38,10 @@ module.exports = __toCommonJS(executors_exports);
|
|
|
41
38
|
var import_common = require("@akanjs/common");
|
|
42
39
|
var import_config = require("@akanjs/config");
|
|
43
40
|
var import_child_process = require("child_process");
|
|
41
|
+
var import_dotenv = __toESM(require("dotenv"), 1);
|
|
44
42
|
var import_fs = __toESM(require("fs"), 1);
|
|
45
43
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
46
44
|
var import_path = __toESM(require("path"), 1);
|
|
47
|
-
var import_dotenv = __toESM(require("dotenv"), 1);
|
|
48
45
|
var import_dependencyScanner = require("./dependencyScanner");
|
|
49
46
|
class Executor {
|
|
50
47
|
logger;
|
|
@@ -335,10 +332,10 @@ class WorkspaceExecutor extends Executor {
|
|
|
335
332
|
}
|
|
336
333
|
async commit(message, { init = false, add = true } = {}) {
|
|
337
334
|
if (init)
|
|
338
|
-
await this.exec(`git init`);
|
|
335
|
+
await this.exec(`git init --quiet`);
|
|
339
336
|
if (add)
|
|
340
337
|
await this.exec(`git add .`);
|
|
341
|
-
await this.exec(`git commit -m "${message}"`);
|
|
338
|
+
await this.exec(`git commit --quiet -m "${message}"`);
|
|
342
339
|
}
|
|
343
340
|
async #getDirHasFile(basePath, targetFilename) {
|
|
344
341
|
const AVOID_DIRS = ["node_modules", "dist", "public", "./next"];
|
|
@@ -573,8 +570,10 @@ class SysExecutor extends Executor {
|
|
|
573
570
|
}
|
|
574
571
|
}
|
|
575
572
|
class AppExecutor extends SysExecutor {
|
|
573
|
+
dist;
|
|
576
574
|
constructor({ workspace, name }) {
|
|
577
575
|
super({ workspace, name, type: "app" });
|
|
576
|
+
this.dist = new Executor(`${name} Dist App Executor`, `${this.workspace.workspaceRoot}/dist/apps/${name}`);
|
|
578
577
|
}
|
|
579
578
|
static from(executor, name) {
|
|
580
579
|
if (executor instanceof WorkspaceExecutor)
|
|
@@ -604,23 +603,13 @@ class AppExecutor extends SysExecutor {
|
|
|
604
603
|
);
|
|
605
604
|
}
|
|
606
605
|
}
|
|
607
|
-
class DistAppExecutor extends Executor {
|
|
608
|
-
name;
|
|
609
|
-
constructor({ workspace, name }) {
|
|
610
|
-
super(`${name} Dist App Executor`, `${workspace.workspaceRoot}/dist/apps/${name}`);
|
|
611
|
-
this.name = name;
|
|
612
|
-
}
|
|
613
|
-
static from(executor, name) {
|
|
614
|
-
if (executor instanceof WorkspaceExecutor)
|
|
615
|
-
return new DistAppExecutor({ workspace: executor, name });
|
|
616
|
-
return new DistAppExecutor({ workspace: executor.workspace, name });
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
606
|
class LibExecutor extends SysExecutor {
|
|
620
607
|
workspaceRoot;
|
|
621
608
|
repoName;
|
|
609
|
+
dist;
|
|
622
610
|
constructor({ workspace, name }) {
|
|
623
611
|
super({ workspace, name, type: "lib" });
|
|
612
|
+
this.dist = new Executor(`${name} Dist Lib Executor`, `${this.workspace.workspaceRoot}/dist/libs/${name}`);
|
|
624
613
|
}
|
|
625
614
|
static from(executor, name) {
|
|
626
615
|
if (executor instanceof WorkspaceExecutor)
|
|
@@ -636,25 +625,15 @@ class LibExecutor extends SysExecutor {
|
|
|
636
625
|
});
|
|
637
626
|
}
|
|
638
627
|
}
|
|
639
|
-
class DistLibExecutor extends Executor {
|
|
640
|
-
name;
|
|
641
|
-
constructor({ workspace, name }) {
|
|
642
|
-
super(`${name} Dist Lib Executor`, `${workspace.workspaceRoot}/dist/libs/${name}`);
|
|
643
|
-
this.name = name;
|
|
644
|
-
}
|
|
645
|
-
static from(executor, name) {
|
|
646
|
-
if (executor instanceof WorkspaceExecutor)
|
|
647
|
-
return new DistAppExecutor({ workspace: executor, name });
|
|
648
|
-
return new DistLibExecutor({ workspace: executor.workspace, name });
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
628
|
class PkgExecutor extends Executor {
|
|
652
629
|
workspace;
|
|
653
630
|
name;
|
|
631
|
+
dist;
|
|
654
632
|
constructor({ workspace = WorkspaceExecutor.fromRoot(), name }) {
|
|
655
633
|
super(`${name} Pkg Executor`, `${workspace.workspaceRoot}/pkgs/${name}`);
|
|
656
634
|
this.workspace = workspace;
|
|
657
635
|
this.name = name;
|
|
636
|
+
this.dist = new Executor(`${name} Dist Pkg Executor`, `${this.workspace.workspaceRoot}/dist/pkgs/${name}`);
|
|
658
637
|
}
|
|
659
638
|
static from(executor, name) {
|
|
660
639
|
if (executor instanceof WorkspaceExecutor)
|
|
@@ -684,30 +663,9 @@ class PkgExecutor extends Executor {
|
|
|
684
663
|
return pkgScanResult;
|
|
685
664
|
}
|
|
686
665
|
}
|
|
687
|
-
class DistPkgExecutor extends Executor {
|
|
688
|
-
workspaceRoot;
|
|
689
|
-
repoName;
|
|
690
|
-
name;
|
|
691
|
-
constructor({ workspaceRoot, repoName, name }) {
|
|
692
|
-
super(`${name} Dist Pkg Executor`, `${workspaceRoot}/dist/pkgs/${name}`);
|
|
693
|
-
this.workspaceRoot = workspaceRoot;
|
|
694
|
-
this.repoName = repoName;
|
|
695
|
-
this.name = name;
|
|
696
|
-
}
|
|
697
|
-
static from(workspaceExecutor, name) {
|
|
698
|
-
return new DistPkgExecutor({
|
|
699
|
-
workspaceRoot: workspaceExecutor.workspaceRoot,
|
|
700
|
-
repoName: workspaceExecutor.repoName,
|
|
701
|
-
name
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
666
|
// Annotate the CommonJS export names for ESM import in node:
|
|
706
667
|
0 && (module.exports = {
|
|
707
668
|
AppExecutor,
|
|
708
|
-
DistAppExecutor,
|
|
709
|
-
DistLibExecutor,
|
|
710
|
-
DistPkgExecutor,
|
|
711
669
|
Executor,
|
|
712
670
|
LibExecutor,
|
|
713
671
|
PkgExecutor,
|
package/src/executors.d.ts
CHANGED
|
@@ -110,20 +110,12 @@ interface AppExecutorOptions {
|
|
|
110
110
|
name: string;
|
|
111
111
|
}
|
|
112
112
|
export declare class AppExecutor extends SysExecutor {
|
|
113
|
+
dist: Executor;
|
|
113
114
|
constructor({ workspace, name }: AppExecutorOptions);
|
|
114
115
|
static from(executor: SysExecutor | WorkspaceExecutor, name: string): AppExecutor;
|
|
115
116
|
getConfig(command?: string): Promise<AppConfigResult>;
|
|
116
117
|
syncAssets(libDeps: string[]): Promise<void>;
|
|
117
118
|
}
|
|
118
|
-
interface DistAppExecutorOptions {
|
|
119
|
-
workspace: WorkspaceExecutor;
|
|
120
|
-
name: string;
|
|
121
|
-
}
|
|
122
|
-
export declare class DistAppExecutor extends Executor {
|
|
123
|
-
name: string;
|
|
124
|
-
constructor({ workspace, name }: DistAppExecutorOptions);
|
|
125
|
-
static from(executor: SysExecutor | WorkspaceExecutor, name: string): DistAppExecutor;
|
|
126
|
-
}
|
|
127
119
|
interface LibExecutorOptions {
|
|
128
120
|
workspace?: WorkspaceExecutor;
|
|
129
121
|
name: string;
|
|
@@ -131,19 +123,11 @@ interface LibExecutorOptions {
|
|
|
131
123
|
export declare class LibExecutor extends SysExecutor {
|
|
132
124
|
workspaceRoot: string;
|
|
133
125
|
repoName: string;
|
|
126
|
+
dist: Executor;
|
|
134
127
|
constructor({ workspace, name }: LibExecutorOptions);
|
|
135
128
|
static from(executor: SysExecutor | WorkspaceExecutor, name: string): LibExecutor;
|
|
136
129
|
getConfig(command?: string): Promise<LibConfigResult>;
|
|
137
130
|
}
|
|
138
|
-
interface DistLibExecutorOptions {
|
|
139
|
-
workspace: WorkspaceExecutor;
|
|
140
|
-
name: string;
|
|
141
|
-
}
|
|
142
|
-
export declare class DistLibExecutor extends Executor {
|
|
143
|
-
name: string;
|
|
144
|
-
constructor({ workspace, name }: DistLibExecutorOptions);
|
|
145
|
-
static from(executor: SysExecutor | WorkspaceExecutor, name: string): DistAppExecutor | DistLibExecutor;
|
|
146
|
-
}
|
|
147
131
|
interface PkgExecutorOptions {
|
|
148
132
|
workspace?: WorkspaceExecutor;
|
|
149
133
|
name: string;
|
|
@@ -151,6 +135,7 @@ interface PkgExecutorOptions {
|
|
|
151
135
|
export declare class PkgExecutor extends Executor {
|
|
152
136
|
workspace: WorkspaceExecutor;
|
|
153
137
|
name: string;
|
|
138
|
+
dist: Executor;
|
|
154
139
|
constructor({ workspace, name }: PkgExecutorOptions);
|
|
155
140
|
static from(executor: SysExecutor | WorkspaceExecutor, name: string): PkgExecutor;
|
|
156
141
|
scan({ packageJson, tsconfig, }?: {
|
|
@@ -158,16 +143,4 @@ export declare class PkgExecutor extends Executor {
|
|
|
158
143
|
tsconfig?: TsConfigJson;
|
|
159
144
|
}): Promise<PkgScanResult>;
|
|
160
145
|
}
|
|
161
|
-
interface DistPkgExecutorOptions {
|
|
162
|
-
workspaceRoot: string;
|
|
163
|
-
repoName: string;
|
|
164
|
-
name: string;
|
|
165
|
-
}
|
|
166
|
-
export declare class DistPkgExecutor extends Executor {
|
|
167
|
-
workspaceRoot: string;
|
|
168
|
-
repoName: string;
|
|
169
|
-
name: string;
|
|
170
|
-
constructor({ workspaceRoot, repoName, name }: DistPkgExecutorOptions);
|
|
171
|
-
static from(workspaceExecutor: WorkspaceExecutor, name: string): DistPkgExecutor;
|
|
172
|
-
}
|
|
173
146
|
export {};
|
package/src/executors.js
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
getLibConfig
|
|
6
6
|
} from "@akanjs/config";
|
|
7
7
|
import { exec, fork, spawn } from "child_process";
|
|
8
|
+
import dotenv from "dotenv";
|
|
8
9
|
import fs from "fs";
|
|
9
10
|
import fsPromise from "fs/promises";
|
|
10
11
|
import path from "path";
|
|
11
|
-
import dotenv from "dotenv";
|
|
12
12
|
import { TypeScriptDependencyScanner } from "./dependencyScanner";
|
|
13
13
|
class Executor {
|
|
14
14
|
logger;
|
|
@@ -299,10 +299,10 @@ class WorkspaceExecutor extends Executor {
|
|
|
299
299
|
}
|
|
300
300
|
async commit(message, { init = false, add = true } = {}) {
|
|
301
301
|
if (init)
|
|
302
|
-
await this.exec(`git init`);
|
|
302
|
+
await this.exec(`git init --quiet`);
|
|
303
303
|
if (add)
|
|
304
304
|
await this.exec(`git add .`);
|
|
305
|
-
await this.exec(`git commit -m "${message}"`);
|
|
305
|
+
await this.exec(`git commit --quiet -m "${message}"`);
|
|
306
306
|
}
|
|
307
307
|
async #getDirHasFile(basePath, targetFilename) {
|
|
308
308
|
const AVOID_DIRS = ["node_modules", "dist", "public", "./next"];
|
|
@@ -537,8 +537,10 @@ class SysExecutor extends Executor {
|
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
class AppExecutor extends SysExecutor {
|
|
540
|
+
dist;
|
|
540
541
|
constructor({ workspace, name }) {
|
|
541
542
|
super({ workspace, name, type: "app" });
|
|
543
|
+
this.dist = new Executor(`${name} Dist App Executor`, `${this.workspace.workspaceRoot}/dist/apps/${name}`);
|
|
542
544
|
}
|
|
543
545
|
static from(executor, name) {
|
|
544
546
|
if (executor instanceof WorkspaceExecutor)
|
|
@@ -568,23 +570,13 @@ class AppExecutor extends SysExecutor {
|
|
|
568
570
|
);
|
|
569
571
|
}
|
|
570
572
|
}
|
|
571
|
-
class DistAppExecutor extends Executor {
|
|
572
|
-
name;
|
|
573
|
-
constructor({ workspace, name }) {
|
|
574
|
-
super(`${name} Dist App Executor`, `${workspace.workspaceRoot}/dist/apps/${name}`);
|
|
575
|
-
this.name = name;
|
|
576
|
-
}
|
|
577
|
-
static from(executor, name) {
|
|
578
|
-
if (executor instanceof WorkspaceExecutor)
|
|
579
|
-
return new DistAppExecutor({ workspace: executor, name });
|
|
580
|
-
return new DistAppExecutor({ workspace: executor.workspace, name });
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
573
|
class LibExecutor extends SysExecutor {
|
|
584
574
|
workspaceRoot;
|
|
585
575
|
repoName;
|
|
576
|
+
dist;
|
|
586
577
|
constructor({ workspace, name }) {
|
|
587
578
|
super({ workspace, name, type: "lib" });
|
|
579
|
+
this.dist = new Executor(`${name} Dist Lib Executor`, `${this.workspace.workspaceRoot}/dist/libs/${name}`);
|
|
588
580
|
}
|
|
589
581
|
static from(executor, name) {
|
|
590
582
|
if (executor instanceof WorkspaceExecutor)
|
|
@@ -600,25 +592,15 @@ class LibExecutor extends SysExecutor {
|
|
|
600
592
|
});
|
|
601
593
|
}
|
|
602
594
|
}
|
|
603
|
-
class DistLibExecutor extends Executor {
|
|
604
|
-
name;
|
|
605
|
-
constructor({ workspace, name }) {
|
|
606
|
-
super(`${name} Dist Lib Executor`, `${workspace.workspaceRoot}/dist/libs/${name}`);
|
|
607
|
-
this.name = name;
|
|
608
|
-
}
|
|
609
|
-
static from(executor, name) {
|
|
610
|
-
if (executor instanceof WorkspaceExecutor)
|
|
611
|
-
return new DistAppExecutor({ workspace: executor, name });
|
|
612
|
-
return new DistLibExecutor({ workspace: executor.workspace, name });
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
595
|
class PkgExecutor extends Executor {
|
|
616
596
|
workspace;
|
|
617
597
|
name;
|
|
598
|
+
dist;
|
|
618
599
|
constructor({ workspace = WorkspaceExecutor.fromRoot(), name }) {
|
|
619
600
|
super(`${name} Pkg Executor`, `${workspace.workspaceRoot}/pkgs/${name}`);
|
|
620
601
|
this.workspace = workspace;
|
|
621
602
|
this.name = name;
|
|
603
|
+
this.dist = new Executor(`${name} Dist Pkg Executor`, `${this.workspace.workspaceRoot}/dist/pkgs/${name}`);
|
|
622
604
|
}
|
|
623
605
|
static from(executor, name) {
|
|
624
606
|
if (executor instanceof WorkspaceExecutor)
|
|
@@ -648,29 +630,8 @@ class PkgExecutor extends Executor {
|
|
|
648
630
|
return pkgScanResult;
|
|
649
631
|
}
|
|
650
632
|
}
|
|
651
|
-
class DistPkgExecutor extends Executor {
|
|
652
|
-
workspaceRoot;
|
|
653
|
-
repoName;
|
|
654
|
-
name;
|
|
655
|
-
constructor({ workspaceRoot, repoName, name }) {
|
|
656
|
-
super(`${name} Dist Pkg Executor`, `${workspaceRoot}/dist/pkgs/${name}`);
|
|
657
|
-
this.workspaceRoot = workspaceRoot;
|
|
658
|
-
this.repoName = repoName;
|
|
659
|
-
this.name = name;
|
|
660
|
-
}
|
|
661
|
-
static from(workspaceExecutor, name) {
|
|
662
|
-
return new DistPkgExecutor({
|
|
663
|
-
workspaceRoot: workspaceExecutor.workspaceRoot,
|
|
664
|
-
repoName: workspaceExecutor.repoName,
|
|
665
|
-
name
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
633
|
export {
|
|
670
634
|
AppExecutor,
|
|
671
|
-
DistAppExecutor,
|
|
672
|
-
DistLibExecutor,
|
|
673
|
-
DistPkgExecutor,
|
|
674
635
|
Executor,
|
|
675
636
|
LibExecutor,
|
|
676
637
|
PkgExecutor,
|
package/src/index.cjs
CHANGED
|
@@ -29,7 +29,6 @@ __reExport(src_exports, require("./types"), module.exports);
|
|
|
29
29
|
__reExport(src_exports, require("./capacitorApp"), module.exports);
|
|
30
30
|
__reExport(src_exports, require("./extractDeps"), module.exports);
|
|
31
31
|
__reExport(src_exports, require("./commandDecorators"), module.exports);
|
|
32
|
-
__reExport(src_exports, require("./installExternalLib"), module.exports);
|
|
33
32
|
__reExport(src_exports, require("./aiEditor"), module.exports);
|
|
34
33
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
34
|
0 && (module.exports = {
|
|
@@ -48,6 +47,5 @@ __reExport(src_exports, require("./aiEditor"), module.exports);
|
|
|
48
47
|
...require("./capacitorApp"),
|
|
49
48
|
...require("./extractDeps"),
|
|
50
49
|
...require("./commandDecorators"),
|
|
51
|
-
...require("./installExternalLib"),
|
|
52
50
|
...require("./aiEditor")
|
|
53
51
|
});
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -1,33 +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 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
|
-
};
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
installExternalLib
|
|
33
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const utilGitRepo = "git@github.com:akan-team/util.git";
|
|
2
|
-
const sharedGitRepo = "git@github.com:akan-team/shared.git";
|
|
3
|
-
const installExternalLib = async (libName, workspace) => {
|
|
4
|
-
workspace.log(`Installing ${libName} library as git subtree...`);
|
|
5
|
-
await workspace.exec(`git remote add ${libName} git@github.com:akan-team/${libName}.git`);
|
|
6
|
-
await workspace.exec(`git subtree add --prefix=libs/${libName} ${libName} main`);
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
installExternalLib
|
|
10
|
-
};
|