@akanjs/cli 0.0.87 → 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/index.js +191 -197
- package/package.json +1 -1
- package/pkgs/@akanjs/cli/src/application/application.command.d.ts +5 -5
- package/pkgs/@akanjs/cli/src/application/application.runner.d.ts +13 -7
- package/pkgs/@akanjs/cli/src/application/application.script.d.ts +44 -16
- package/pkgs/@akanjs/cli/src/package/package.runner.d.ts +2 -2
- package/pkgs/@akanjs/cli/src/package/package.script.d.ts +2 -2
- package/pkgs/@akanjs/config/src/akanConfig.d.ts +2 -2
- package/pkgs/@akanjs/config/src/types.d.ts +7 -2
- package/pkgs/@akanjs/devkit/src/executors.d.ts +4 -31
- package/pkgs/@akanjs/devkit/src/index.d.ts +0 -1
- package/pkgs/@akanjs/config/src/baseConfigEnv.d.ts +0 -8
- package/pkgs/@akanjs/devkit/src/installExternalLib.d.ts +0 -2
package/index.js
CHANGED
|
@@ -486,22 +486,6 @@ var sleep = async (ms) => {
|
|
|
486
486
|
var import_fs6 = __toESM(require("fs"));
|
|
487
487
|
var import_path2 = __toESM(require("path"));
|
|
488
488
|
|
|
489
|
-
// pkgs/@akanjs/config/src/baseConfigEnv.ts
|
|
490
|
-
var getBaseConfigEnv = (appName = process.env.NEXT_PUBLIC_APP_NAME) => {
|
|
491
|
-
if (!appName)
|
|
492
|
-
throw new Error("NEXT_PUBLIC_APP_NAME is not set");
|
|
493
|
-
const repoName = process.env.NEXT_PUBLIC_REPO_NAME;
|
|
494
|
-
if (!repoName)
|
|
495
|
-
throw new Error("NEXT_PUBLIC_REPO_NAME is not set");
|
|
496
|
-
const serveDomain = process.env.NEXT_PUBLIC_SERVE_DOMAIN;
|
|
497
|
-
if (!serveDomain)
|
|
498
|
-
throw new Error("NEXT_PUBLIC_SERVE_DOMAIN is not set");
|
|
499
|
-
const env = process.env.NEXT_PUBLIC_ENV ?? "debug";
|
|
500
|
-
if (!env)
|
|
501
|
-
throw new Error("NEXT_PUBLIC_ENV is not set");
|
|
502
|
-
return { appName, repoName, serveDomain, env };
|
|
503
|
-
};
|
|
504
|
-
|
|
505
489
|
// pkgs/@akanjs/config/src/nextConfig.ts
|
|
506
490
|
var import_bundle_analyzer = __toESM(require("@next/bundle-analyzer"));
|
|
507
491
|
var import_next_pwa = __toESM(require("next-pwa"));
|
|
@@ -656,15 +640,8 @@ export default getNextConfig(config, appInfo);
|
|
|
656
640
|
`;
|
|
657
641
|
|
|
658
642
|
// pkgs/@akanjs/config/src/akanConfig.ts
|
|
659
|
-
var makeAppConfig = (config, props
|
|
660
|
-
const
|
|
661
|
-
const {
|
|
662
|
-
appName = baseConfigEnv.appName,
|
|
663
|
-
repoName = baseConfigEnv.repoName,
|
|
664
|
-
serveDomain = baseConfigEnv.serveDomain,
|
|
665
|
-
env = baseConfigEnv.env,
|
|
666
|
-
command = "build"
|
|
667
|
-
} = props;
|
|
643
|
+
var makeAppConfig = (config, props) => {
|
|
644
|
+
const { name, repoName, serveDomain, env, command = "build" } = props;
|
|
668
645
|
return {
|
|
669
646
|
rootLib: config.rootLib,
|
|
670
647
|
libs: config.libs ?? [],
|
|
@@ -686,7 +663,7 @@ ENV PORT 8080
|
|
|
686
663
|
ENV NODE_OPTIONS=--max_old_space_size=8192
|
|
687
664
|
ENV NEXT_PUBLIC_REPO_NAME=${repoName}
|
|
688
665
|
ENV NEXT_PUBLIC_SERVE_DOMAIN=${serveDomain}
|
|
689
|
-
ENV NEXT_PUBLIC_APP_NAME=${
|
|
666
|
+
ENV NEXT_PUBLIC_APP_NAME=${name}
|
|
690
667
|
ENV NEXT_PUBLIC_ENV=${env}
|
|
691
668
|
ENV NEXT_PUBLIC_OPERATION_MODE=cloud
|
|
692
669
|
CMD ["node", "main.js"]`,
|
|
@@ -705,12 +682,12 @@ ENV PORT 4200
|
|
|
705
682
|
ENV NODE_OPTIONS=--max_old_space_size=8192
|
|
706
683
|
ENV NEXT_PUBLIC_REPO_NAME=${repoName}
|
|
707
684
|
ENV NEXT_PUBLIC_SERVE_DOMAIN=${serveDomain}
|
|
708
|
-
ENV NEXT_PUBLIC_APP_NAME=${
|
|
685
|
+
ENV NEXT_PUBLIC_APP_NAME=${name}
|
|
709
686
|
ENV NEXT_PUBLIC_ENV=${env}
|
|
710
687
|
ENV NEXT_PUBLIC_OPERATION_MODE=cloud
|
|
711
688
|
CMD ["npm", "start"]`,
|
|
712
689
|
nextConfig: withBase(
|
|
713
|
-
|
|
690
|
+
name,
|
|
714
691
|
config.frontend?.nextConfig ? typeof config.frontend.nextConfig === "function" ? config.frontend.nextConfig() : config.frontend.nextConfig : {},
|
|
715
692
|
config.libs ?? [],
|
|
716
693
|
config.frontend?.routes
|
|
@@ -727,7 +704,7 @@ var getAppConfig = async (appRoot, props) => {
|
|
|
727
704
|
const config = typeof configImp === "function" ? configImp(props) : configImp;
|
|
728
705
|
return makeAppConfig(config, props);
|
|
729
706
|
};
|
|
730
|
-
var makeLibConfig = (config, props
|
|
707
|
+
var makeLibConfig = (config, props) => {
|
|
731
708
|
return {
|
|
732
709
|
rootLib: config.rootLib,
|
|
733
710
|
libs: config.libs ?? [],
|
|
@@ -787,10 +764,10 @@ var getDefaultFileScan = () => ({
|
|
|
787
764
|
|
|
788
765
|
// pkgs/@akanjs/devkit/src/executors.ts
|
|
789
766
|
var import_child_process = require("child_process");
|
|
767
|
+
var import_dotenv = __toESM(require("dotenv"), 1);
|
|
790
768
|
var import_fs7 = __toESM(require("fs"), 1);
|
|
791
769
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
792
770
|
var import_path3 = __toESM(require("path"), 1);
|
|
793
|
-
var import_dotenv = __toESM(require("dotenv"), 1);
|
|
794
771
|
|
|
795
772
|
// pkgs/@akanjs/devkit/src/dependencyScanner.ts
|
|
796
773
|
var fs7 = __toESM(require("fs"), 1);
|
|
@@ -1172,7 +1149,7 @@ var WorkspaceExecutor = class _WorkspaceExecutor extends Executor {
|
|
|
1172
1149
|
const env = process.env.NEXT_PUBLIC_ENV ?? envFile.NEXT_PUBLIC_ENV ?? "debug";
|
|
1173
1150
|
if (!env)
|
|
1174
1151
|
throw new Error("NEXT_PUBLIC_ENV is not set");
|
|
1175
|
-
return { ...appName ? { appName } : {}, repoName, serveDomain, env };
|
|
1152
|
+
return { ...appName ? { name: appName } : {}, repoName, serveDomain, env };
|
|
1176
1153
|
}
|
|
1177
1154
|
async scan() {
|
|
1178
1155
|
const [appNames, libNames, pkgNames] = await Promise.all([this.getApps(), this.getLibs(), this.getPkgs()]);
|
|
@@ -1229,10 +1206,10 @@ var WorkspaceExecutor = class _WorkspaceExecutor extends Executor {
|
|
|
1229
1206
|
}
|
|
1230
1207
|
async commit(message, { init = false, add = true } = {}) {
|
|
1231
1208
|
if (init)
|
|
1232
|
-
await this.exec(`git init`);
|
|
1209
|
+
await this.exec(`git init --quiet`);
|
|
1233
1210
|
if (add)
|
|
1234
1211
|
await this.exec(`git add .`);
|
|
1235
|
-
await this.exec(`git commit -m "${message}"`);
|
|
1212
|
+
await this.exec(`git commit --quiet -m "${message}"`);
|
|
1236
1213
|
}
|
|
1237
1214
|
async #getDirHasFile(basePath2, targetFilename) {
|
|
1238
1215
|
const AVOID_DIRS = ["node_modules", "dist", "public", "./next"];
|
|
@@ -1276,7 +1253,7 @@ var SysExecutor = class extends Executor {
|
|
|
1276
1253
|
this.type = type;
|
|
1277
1254
|
}
|
|
1278
1255
|
async getConfig(command) {
|
|
1279
|
-
return this.type === "app" ? await getAppConfig(this.cwdPath, { ...this.workspace.getBaseDevEnv(),
|
|
1256
|
+
return this.type === "app" ? await getAppConfig(this.cwdPath, { ...this.workspace.getBaseDevEnv(), type: "app", name: this.name, command }) : await getLibConfig(this.cwdPath, { ...this.workspace.getBaseDevEnv(), type: "lib", name: this.name, command });
|
|
1280
1257
|
}
|
|
1281
1258
|
async scan({
|
|
1282
1259
|
tsconfig = this.getTsConfig(`${this.cwdPath}/tsconfig.json`),
|
|
@@ -1392,6 +1369,8 @@ var SysExecutor = class extends Executor {
|
|
|
1392
1369
|
const scanResult = {
|
|
1393
1370
|
name: this.name,
|
|
1394
1371
|
type: this.type,
|
|
1372
|
+
repoName: this.workspace.repoName,
|
|
1373
|
+
serveDomain: this.workspace.getBaseDevEnv().serveDomain,
|
|
1395
1374
|
akanConfig,
|
|
1396
1375
|
files,
|
|
1397
1376
|
libDeps,
|
|
@@ -1465,8 +1444,10 @@ var SysExecutor = class extends Executor {
|
|
|
1465
1444
|
}
|
|
1466
1445
|
};
|
|
1467
1446
|
var AppExecutor = class _AppExecutor extends SysExecutor {
|
|
1447
|
+
dist;
|
|
1468
1448
|
constructor({ workspace, name }) {
|
|
1469
1449
|
super({ workspace, name, type: "app" });
|
|
1450
|
+
this.dist = new Executor(`${name} Dist App Executor`, `${this.workspace.workspaceRoot}/dist/apps/${name}`);
|
|
1470
1451
|
}
|
|
1471
1452
|
static from(executor, name) {
|
|
1472
1453
|
if (executor instanceof WorkspaceExecutor)
|
|
@@ -1474,7 +1455,12 @@ var AppExecutor = class _AppExecutor extends SysExecutor {
|
|
|
1474
1455
|
return new _AppExecutor({ workspace: executor.workspace, name });
|
|
1475
1456
|
}
|
|
1476
1457
|
async getConfig(command) {
|
|
1477
|
-
return await getAppConfig(this.cwdPath, {
|
|
1458
|
+
return await getAppConfig(this.cwdPath, {
|
|
1459
|
+
...this.workspace.getBaseDevEnv(),
|
|
1460
|
+
type: "app",
|
|
1461
|
+
name: this.name,
|
|
1462
|
+
command
|
|
1463
|
+
});
|
|
1478
1464
|
}
|
|
1479
1465
|
async syncAssets(libDeps) {
|
|
1480
1466
|
const projectPublicLibPath = `${this.cwdPath}/public/libs`;
|
|
@@ -1491,23 +1477,13 @@ var AppExecutor = class _AppExecutor extends SysExecutor {
|
|
|
1491
1477
|
);
|
|
1492
1478
|
}
|
|
1493
1479
|
};
|
|
1494
|
-
var DistAppExecutor = class _DistAppExecutor extends Executor {
|
|
1495
|
-
name;
|
|
1496
|
-
constructor({ workspace, name }) {
|
|
1497
|
-
super(`${name} Dist App Executor`, `${workspace.workspaceRoot}/dist/apps/${name}`);
|
|
1498
|
-
this.name = name;
|
|
1499
|
-
}
|
|
1500
|
-
static from(executor, name) {
|
|
1501
|
-
if (executor instanceof WorkspaceExecutor)
|
|
1502
|
-
return new _DistAppExecutor({ workspace: executor, name });
|
|
1503
|
-
return new _DistAppExecutor({ workspace: executor.workspace, name });
|
|
1504
|
-
}
|
|
1505
|
-
};
|
|
1506
1480
|
var LibExecutor = class _LibExecutor extends SysExecutor {
|
|
1507
1481
|
workspaceRoot;
|
|
1508
1482
|
repoName;
|
|
1483
|
+
dist;
|
|
1509
1484
|
constructor({ workspace, name }) {
|
|
1510
1485
|
super({ workspace, name, type: "lib" });
|
|
1486
|
+
this.dist = new Executor(`${name} Dist Lib Executor`, `${this.workspace.workspaceRoot}/dist/libs/${name}`);
|
|
1511
1487
|
}
|
|
1512
1488
|
static from(executor, name) {
|
|
1513
1489
|
if (executor instanceof WorkspaceExecutor)
|
|
@@ -1515,16 +1491,23 @@ var LibExecutor = class _LibExecutor extends SysExecutor {
|
|
|
1515
1491
|
return new _LibExecutor({ workspace: executor.workspace, name });
|
|
1516
1492
|
}
|
|
1517
1493
|
async getConfig(command) {
|
|
1518
|
-
return await getLibConfig(this.cwdPath, {
|
|
1494
|
+
return await getLibConfig(this.cwdPath, {
|
|
1495
|
+
...this.workspace.getBaseDevEnv(),
|
|
1496
|
+
type: "lib",
|
|
1497
|
+
name: this.name,
|
|
1498
|
+
command
|
|
1499
|
+
});
|
|
1519
1500
|
}
|
|
1520
1501
|
};
|
|
1521
1502
|
var PkgExecutor = class _PkgExecutor extends Executor {
|
|
1522
1503
|
workspace;
|
|
1523
1504
|
name;
|
|
1505
|
+
dist;
|
|
1524
1506
|
constructor({ workspace = WorkspaceExecutor.fromRoot(), name }) {
|
|
1525
1507
|
super(`${name} Pkg Executor`, `${workspace.workspaceRoot}/pkgs/${name}`);
|
|
1526
1508
|
this.workspace = workspace;
|
|
1527
1509
|
this.name = name;
|
|
1510
|
+
this.dist = new Executor(`${name} Dist Pkg Executor`, `${this.workspace.workspaceRoot}/dist/pkgs/${name}`);
|
|
1528
1511
|
}
|
|
1529
1512
|
static from(executor, name) {
|
|
1530
1513
|
if (executor instanceof WorkspaceExecutor)
|
|
@@ -1554,24 +1537,6 @@ var PkgExecutor = class _PkgExecutor extends Executor {
|
|
|
1554
1537
|
return pkgScanResult;
|
|
1555
1538
|
}
|
|
1556
1539
|
};
|
|
1557
|
-
var DistPkgExecutor = class _DistPkgExecutor extends Executor {
|
|
1558
|
-
workspaceRoot;
|
|
1559
|
-
repoName;
|
|
1560
|
-
name;
|
|
1561
|
-
constructor({ workspaceRoot, repoName, name }) {
|
|
1562
|
-
super(`${name} Dist Pkg Executor`, `${workspaceRoot}/dist/pkgs/${name}`);
|
|
1563
|
-
this.workspaceRoot = workspaceRoot;
|
|
1564
|
-
this.repoName = repoName;
|
|
1565
|
-
this.name = name;
|
|
1566
|
-
}
|
|
1567
|
-
static from(workspaceExecutor, name) {
|
|
1568
|
-
return new _DistPkgExecutor({
|
|
1569
|
-
workspaceRoot: workspaceExecutor.workspaceRoot,
|
|
1570
|
-
repoName: workspaceExecutor.repoName,
|
|
1571
|
-
name
|
|
1572
|
-
});
|
|
1573
|
-
}
|
|
1574
|
-
};
|
|
1575
1540
|
|
|
1576
1541
|
// pkgs/@akanjs/devkit/src/constants.ts
|
|
1577
1542
|
var import_os = require("os");
|
|
@@ -2111,7 +2076,9 @@ var LibraryRunner = class {
|
|
|
2111
2076
|
}
|
|
2112
2077
|
async installLibrary(workspace, libName) {
|
|
2113
2078
|
workspace.log(`Installing ${libName} library as git subtree...`);
|
|
2114
|
-
await workspace.exec(
|
|
2079
|
+
await workspace.exec(
|
|
2080
|
+
`git subtree add --quiet --prefix=libs/${libName} git@github.com:akan-team/${libName}.git main`
|
|
2081
|
+
);
|
|
2115
2082
|
await workspace.cp(`libs/${libName}/env/env.server.example.ts`, `libs/${libName}/env/env.server.testing.ts`);
|
|
2116
2083
|
workspace.setTsPaths("lib", libName);
|
|
2117
2084
|
await workspace.commit(`Add ${libName} library`);
|
|
@@ -2140,18 +2107,18 @@ var LibraryRunner = class {
|
|
|
2140
2107
|
});
|
|
2141
2108
|
const newRootPackageJson = { ...rootPackageJson, dependencies, devDependencies };
|
|
2142
2109
|
lib.workspace.writeJson("package.json", newRootPackageJson);
|
|
2143
|
-
await lib.workspace.spawn("pnpm", ["install"]);
|
|
2110
|
+
await lib.workspace.spawn("pnpm", ["install", "--reporter=silent"]);
|
|
2144
2111
|
await lib.workspace.commit(`Merge ${lib.name} library dependencies`);
|
|
2145
2112
|
}
|
|
2146
2113
|
async pushLibrary(lib, branch) {
|
|
2147
2114
|
await lib.workspace.exec(
|
|
2148
|
-
`git subtree push --prefix=libs/${lib.name} git@github.com:akan-team/${lib.name}.git ${branch}`
|
|
2115
|
+
`git subtree push --quiet --prefix=libs/${lib.name} git@github.com:akan-team/${lib.name}.git ${branch}`
|
|
2149
2116
|
);
|
|
2150
2117
|
lib.logger.log(`${lib.name} library pushed to ${branch} branch`);
|
|
2151
2118
|
}
|
|
2152
2119
|
async pullLibrary(lib, branch) {
|
|
2153
2120
|
await lib.workspace.exec(
|
|
2154
|
-
`git subtree pull --prefix=libs/${lib.name} git@github.com:akan-team/${lib.name}.git ${branch}`
|
|
2121
|
+
`git subtree pull --quiet --prefix=libs/${lib.name} git@github.com:akan-team/${lib.name}.git ${branch}`
|
|
2155
2122
|
);
|
|
2156
2123
|
lib.logger.log(`${lib.name} library pulled from ${branch} branch`);
|
|
2157
2124
|
}
|
|
@@ -2227,6 +2194,7 @@ var esbuild = __toESM(require("esbuild"));
|
|
|
2227
2194
|
var import_fs12 = __toESM(require("fs"));
|
|
2228
2195
|
var import_promises2 = __toESM(require("fs/promises"));
|
|
2229
2196
|
var import_js_yaml2 = __toESM(require("js-yaml"));
|
|
2197
|
+
var import_open = __toESM(require("open"));
|
|
2230
2198
|
var import_ora2 = __toESM(require("ora"));
|
|
2231
2199
|
var import_path4 = __toESM(require("path"));
|
|
2232
2200
|
var vite = __toESM(require("vite"));
|
|
@@ -3209,7 +3177,8 @@ var ApplicationRunner = class {
|
|
|
3209
3177
|
async scanSync(app) {
|
|
3210
3178
|
const akanConfig = await getAppConfig(app.cwdPath, {
|
|
3211
3179
|
...app.workspace.getBaseDevEnv(),
|
|
3212
|
-
|
|
3180
|
+
type: "app",
|
|
3181
|
+
name: app.name,
|
|
3213
3182
|
command: "serve"
|
|
3214
3183
|
});
|
|
3215
3184
|
const scanResult = await app.scan({ akanConfig });
|
|
@@ -3226,16 +3195,16 @@ var ApplicationRunner = class {
|
|
|
3226
3195
|
...env
|
|
3227
3196
|
};
|
|
3228
3197
|
}
|
|
3229
|
-
async #prepareCommand(app,
|
|
3230
|
-
await
|
|
3198
|
+
async #prepareCommand(app, type, target) {
|
|
3199
|
+
await app.dist.exec(`rm -rf ${target}`);
|
|
3231
3200
|
if (target === "frontend") {
|
|
3232
3201
|
await app.exec("rm -rf .next");
|
|
3233
3202
|
app.writeFile("next.config.ts", defaultNextConfigFile);
|
|
3234
3203
|
}
|
|
3235
3204
|
return { env: this.#getEnv(app, { AKAN_COMMAND_TYPE: type }) };
|
|
3236
3205
|
}
|
|
3237
|
-
async buildBackend(app
|
|
3238
|
-
await this.#prepareCommand(app,
|
|
3206
|
+
async buildBackend(app) {
|
|
3207
|
+
await this.#prepareCommand(app, "serve", "backend");
|
|
3239
3208
|
const akanConfig = await app.getConfig("build");
|
|
3240
3209
|
const buildResult = await esbuild.build({
|
|
3241
3210
|
write: false,
|
|
@@ -3243,12 +3212,12 @@ var ApplicationRunner = class {
|
|
|
3243
3212
|
bundle: true,
|
|
3244
3213
|
packages: "external",
|
|
3245
3214
|
platform: "node",
|
|
3246
|
-
outdir: `${
|
|
3215
|
+
outdir: `${app.dist.cwdPath}/backend`,
|
|
3247
3216
|
logLevel: "warning"
|
|
3248
3217
|
});
|
|
3249
3218
|
const rootPackageJson = app.workspace.readJson("package.json");
|
|
3250
3219
|
const dependencies = extractDependencies(buildResult.outputFiles, rootPackageJson);
|
|
3251
|
-
buildResult.outputFiles.map((file) =>
|
|
3220
|
+
buildResult.outputFiles.map((file) => app.dist.writeFile(file.path, file.text));
|
|
3252
3221
|
const appPackageJson = {
|
|
3253
3222
|
name: `${app.name}/backend`,
|
|
3254
3223
|
description: `${app.name} backend`,
|
|
@@ -3257,31 +3226,33 @@ var ApplicationRunner = class {
|
|
|
3257
3226
|
engines: { node: ">=22" },
|
|
3258
3227
|
dependencies
|
|
3259
3228
|
};
|
|
3260
|
-
|
|
3261
|
-
|
|
3229
|
+
app.dist.writeJson("backend/package.json", appPackageJson);
|
|
3230
|
+
app.dist.writeFile(import_path4.default.join(app.dist.cwdPath, "backend", "Dockerfile"), akanConfig.backend.dockerfile);
|
|
3262
3231
|
}
|
|
3263
|
-
async serveBackend(app,
|
|
3264
|
-
const { env } = await this.#prepareCommand(app,
|
|
3232
|
+
async serveBackend(app, { open: open2 = false } = {}) {
|
|
3233
|
+
const { env } = await this.#prepareCommand(app, "serve", "backend");
|
|
3265
3234
|
const ctx = await esbuild.context({
|
|
3266
3235
|
write: true,
|
|
3267
3236
|
entryPoints: [`${app.cwdPath}/main.ts`],
|
|
3268
3237
|
bundle: true,
|
|
3269
3238
|
packages: "external",
|
|
3270
3239
|
platform: "node",
|
|
3271
|
-
outdir: import_path4.default.join(
|
|
3240
|
+
outdir: import_path4.default.join(app.dist.cwdPath, "backend"),
|
|
3272
3241
|
logLevel: "warning"
|
|
3273
3242
|
});
|
|
3274
3243
|
await ctx.watch();
|
|
3275
3244
|
await sleep(100);
|
|
3276
|
-
|
|
3245
|
+
if (open2)
|
|
3246
|
+
setTimeout(() => (0, import_open.default)("http://localhost:8080/backend/graphql"), 3e3);
|
|
3247
|
+
await app.dist.spawn("node", ["--watch", "backend/main.js"], { env });
|
|
3277
3248
|
}
|
|
3278
|
-
async buildFrontend(app
|
|
3279
|
-
const { env } = await this.#prepareCommand(app,
|
|
3249
|
+
async buildFrontend(app) {
|
|
3250
|
+
const { env } = await this.#prepareCommand(app, "build", "frontend");
|
|
3280
3251
|
const akanConfig = await app.getConfig("build");
|
|
3281
3252
|
await app.spawn("npx", ["next", "build", "--no-lint"], { env });
|
|
3282
3253
|
const buildResult = await esbuild.build({
|
|
3283
3254
|
entryPoints: [`${app.cwdPath}/next.config.ts`],
|
|
3284
|
-
outdir: `${
|
|
3255
|
+
outdir: `${app.dist.cwdPath}/frontend`,
|
|
3285
3256
|
bundle: true,
|
|
3286
3257
|
packages: "external",
|
|
3287
3258
|
platform: "node",
|
|
@@ -3292,7 +3263,7 @@ var ApplicationRunner = class {
|
|
|
3292
3263
|
});
|
|
3293
3264
|
const rootPackageJson = app.workspace.readJson("package.json");
|
|
3294
3265
|
const dependencies = extractDependencies(buildResult.outputFiles, rootPackageJson, ["next", "react", "react-dom"]);
|
|
3295
|
-
buildResult.outputFiles.map((file) =>
|
|
3266
|
+
buildResult.outputFiles.map((file) => app.dist.writeFile(file.path, file.text));
|
|
3296
3267
|
const appPackageJson = {
|
|
3297
3268
|
name: `${app.name}/frontend`,
|
|
3298
3269
|
description: `${app.name} frontend`,
|
|
@@ -3303,26 +3274,28 @@ var ApplicationRunner = class {
|
|
|
3303
3274
|
start: "next start"
|
|
3304
3275
|
}
|
|
3305
3276
|
};
|
|
3306
|
-
|
|
3277
|
+
app.dist.writeJson("frontend/package.json", appPackageJson);
|
|
3307
3278
|
await Promise.all([
|
|
3308
|
-
app.cp(".next", import_path4.default.join(
|
|
3309
|
-
app.cp("public", import_path4.default.join(
|
|
3279
|
+
app.cp(".next", import_path4.default.join(app.dist.cwdPath, "frontend", ".next")),
|
|
3280
|
+
app.cp("public", import_path4.default.join(app.dist.cwdPath, "frontend", "public"))
|
|
3310
3281
|
]);
|
|
3311
|
-
|
|
3282
|
+
app.dist.writeFile("frontend/Dockerfile", akanConfig.frontend.dockerfile);
|
|
3312
3283
|
}
|
|
3313
|
-
async serveFrontend(app,
|
|
3314
|
-
const { env } = await this.#prepareCommand(app,
|
|
3284
|
+
async serveFrontend(app, { open: open2 = false } = {}) {
|
|
3285
|
+
const { env } = await this.#prepareCommand(app, "serve", "frontend");
|
|
3286
|
+
if (open2)
|
|
3287
|
+
setTimeout(() => (0, import_open.default)("http://localhost:4200"), 3e3);
|
|
3315
3288
|
await app.spawn("npx", ["next", "dev", "-p", "4200"], { env });
|
|
3316
3289
|
}
|
|
3317
|
-
async #getViteConfig(app
|
|
3318
|
-
const { env } = await this.#prepareCommand(app,
|
|
3290
|
+
async #getViteConfig(app) {
|
|
3291
|
+
const { env } = await this.#prepareCommand(app, "build", "csr");
|
|
3319
3292
|
const processEnv = env;
|
|
3320
3293
|
const akanjsPrefix = process.env.USE_AKANJS_PKGS === "true" ? "../../../../pkgs/" : "";
|
|
3321
3294
|
const config = vite.defineConfig({
|
|
3322
3295
|
root: `${app.cwdPath}/app`,
|
|
3323
3296
|
base: "/",
|
|
3324
3297
|
build: {
|
|
3325
|
-
outDir: `${
|
|
3298
|
+
outDir: `${app.dist.cwdPath}/csr`,
|
|
3326
3299
|
sourcemap: false,
|
|
3327
3300
|
emptyOutDir: true,
|
|
3328
3301
|
rollupOptions: { external: ["next/server"], input: `${app.cwdPath}/app/index.html` }
|
|
@@ -3380,15 +3353,17 @@ var ApplicationRunner = class {
|
|
|
3380
3353
|
});
|
|
3381
3354
|
return config;
|
|
3382
3355
|
}
|
|
3383
|
-
async buildCsr(app
|
|
3384
|
-
const config = await this.#getViteConfig(app
|
|
3356
|
+
async buildCsr(app) {
|
|
3357
|
+
const config = await this.#getViteConfig(app);
|
|
3385
3358
|
await vite.build(config);
|
|
3386
3359
|
}
|
|
3387
|
-
async serveCsr(app,
|
|
3388
|
-
const config = await this.#getViteConfig(app
|
|
3360
|
+
async serveCsr(app, { open: open2 = false } = {}) {
|
|
3361
|
+
const config = await this.#getViteConfig(app);
|
|
3389
3362
|
const server = await vite.createServer(config);
|
|
3390
3363
|
await server.listen(4201);
|
|
3391
3364
|
app.log(`CSR server is running on http://localhost:4201`);
|
|
3365
|
+
if (open2)
|
|
3366
|
+
setTimeout(() => (0, import_open.default)("http://localhost:4201"), 3e3);
|
|
3392
3367
|
}
|
|
3393
3368
|
async #prepareIos(app) {
|
|
3394
3369
|
const isAdded = import_fs12.default.existsSync(`${app.cwdPath}/ios/App/Podfile`);
|
|
@@ -3505,24 +3480,23 @@ var ApplicationRunner = class {
|
|
|
3505
3480
|
await capacitorApp.save();
|
|
3506
3481
|
}
|
|
3507
3482
|
async releaseSource(app, { rebuild, buildNum = 0, environment = "debug", local = true } = {}) {
|
|
3508
|
-
const distApp = DistAppExecutor.from(app, app.name);
|
|
3509
3483
|
const buildRoot = `${app.workspace.workspaceRoot}/releases/builds/${app.name}`;
|
|
3510
3484
|
const appVersionInfo = import_js_yaml2.default.load(app.readFile("config.yaml"));
|
|
3511
3485
|
const platformVersion = appVersionInfo.platforms.android.versionName;
|
|
3512
3486
|
if (import_fs12.default.existsSync(buildRoot))
|
|
3513
3487
|
await import_promises2.default.rm(buildRoot, { recursive: true, force: true });
|
|
3514
3488
|
await import_promises2.default.mkdir(buildRoot, { recursive: true });
|
|
3515
|
-
if (rebuild || !import_fs12.default.existsSync(`${
|
|
3516
|
-
await this.buildBackend(app
|
|
3517
|
-
if (rebuild || !import_fs12.default.existsSync(`${
|
|
3518
|
-
await this.buildFrontend(app
|
|
3519
|
-
if (rebuild || !import_fs12.default.existsSync(`${
|
|
3520
|
-
await this.buildCsr(app
|
|
3489
|
+
if (rebuild || !import_fs12.default.existsSync(`${app.dist.cwdPath}/backend`))
|
|
3490
|
+
await this.buildBackend(app);
|
|
3491
|
+
if (rebuild || !import_fs12.default.existsSync(`${app.dist.cwdPath}/frontend`))
|
|
3492
|
+
await this.buildFrontend(app);
|
|
3493
|
+
if (rebuild || !import_fs12.default.existsSync(`${app.dist.cwdPath}/csr`))
|
|
3494
|
+
await this.buildCsr(app);
|
|
3521
3495
|
const buildVersion = `${platformVersion}-${buildNum}`;
|
|
3522
3496
|
const buildPath = `${buildRoot}/${buildVersion}`;
|
|
3523
3497
|
await import_promises2.default.mkdir(buildPath, { recursive: true });
|
|
3524
|
-
await import_promises2.default.cp(`${
|
|
3525
|
-
await import_promises2.default.cp(
|
|
3498
|
+
await import_promises2.default.cp(`${app.dist.cwdPath}/backend`, `${buildPath}/backend`, { recursive: true });
|
|
3499
|
+
await import_promises2.default.cp(app.dist.cwdPath, buildRoot, { recursive: true });
|
|
3526
3500
|
await import_promises2.default.rm(`${buildRoot}/frontend/.next`, { recursive: true, force: true });
|
|
3527
3501
|
await app.workspace.spawn("tar", [
|
|
3528
3502
|
"-zcf",
|
|
@@ -3531,8 +3505,8 @@ var ApplicationRunner = class {
|
|
|
3531
3505
|
buildRoot,
|
|
3532
3506
|
"./"
|
|
3533
3507
|
]);
|
|
3534
|
-
if (import_fs12.default.existsSync(`${
|
|
3535
|
-
await import_promises2.default.cp(`${
|
|
3508
|
+
if (import_fs12.default.existsSync(`${app.dist.cwdPath}/csr`)) {
|
|
3509
|
+
await import_promises2.default.cp(`${app.dist.cwdPath}/csr`, "./csr", { recursive: true });
|
|
3536
3510
|
await app.workspace.spawn("zip", [
|
|
3537
3511
|
"-r",
|
|
3538
3512
|
`${app.workspace.workspaceRoot}/releases/builds/${app.name}-appBuild.zip`,
|
|
@@ -3551,7 +3525,7 @@ var ApplicationRunner = class {
|
|
|
3551
3525
|
}
|
|
3552
3526
|
}
|
|
3553
3527
|
await import_promises2.default.mkdir(sourceRoot, { recursive: true });
|
|
3554
|
-
await import_promises2.default.cp(
|
|
3528
|
+
await import_promises2.default.cp(app.dist.cwdPath, `${sourceRoot}/apps/${app.name}`, { recursive: true });
|
|
3555
3529
|
const libDeps = ["social", "shared", "platform", "util"];
|
|
3556
3530
|
await Promise.all(
|
|
3557
3531
|
libDeps.map(
|
|
@@ -3690,9 +3664,11 @@ var ApplicationRunner = class {
|
|
|
3690
3664
|
var ApplicationScript = class {
|
|
3691
3665
|
#runner = new ApplicationRunner();
|
|
3692
3666
|
libraryScript = new LibraryScript();
|
|
3693
|
-
async createApplication(appName, workspace) {
|
|
3667
|
+
async createApplication(appName, workspace, { serve = false } = {}) {
|
|
3694
3668
|
const app = await this.#runner.createApplication(appName, workspace);
|
|
3695
3669
|
await this.syncApplication(app);
|
|
3670
|
+
if (serve)
|
|
3671
|
+
await this.serve(app, { open: true });
|
|
3696
3672
|
}
|
|
3697
3673
|
async scanApplication(app, verbose = false) {
|
|
3698
3674
|
const scanResult = await this.#runner.scanSync(app);
|
|
@@ -3707,64 +3683,78 @@ var ApplicationScript = class {
|
|
|
3707
3683
|
for (const libName of scanResult.akanConfig.libs)
|
|
3708
3684
|
await this.libraryScript.syncLibrary(LibExecutor.from(app, libName), { recursive: false });
|
|
3709
3685
|
}
|
|
3710
|
-
async build(app
|
|
3711
|
-
await this.syncApplication(app);
|
|
3712
|
-
await Promise.all([this.buildBackend(app, distApp), this.buildFrontend(app, distApp)]);
|
|
3713
|
-
}
|
|
3714
|
-
async serve(app, distApp = DistAppExecutor.from(app, app.name)) {
|
|
3715
|
-
await this.syncApplication(app);
|
|
3716
|
-
await Promise.all([this.#runner.serveBackend(app, distApp), this.#runner.serveFrontend(app, distApp)]);
|
|
3717
|
-
}
|
|
3718
|
-
async buildBackend(app, distApp = DistAppExecutor.from(app, app.name)) {
|
|
3719
|
-
await this.syncApplication(app);
|
|
3720
|
-
await this.#runner.buildBackend(app, distApp);
|
|
3721
|
-
}
|
|
3722
|
-
async serveBackend(app, distApp = DistAppExecutor.from(app, app.name)) {
|
|
3723
|
-
await this.syncApplication(app);
|
|
3724
|
-
await this.#runner.serveBackend(app, distApp);
|
|
3725
|
-
}
|
|
3726
|
-
async buildFrontend(app, distApp = DistAppExecutor.from(app, app.name)) {
|
|
3727
|
-
await this.syncApplication(app);
|
|
3728
|
-
await this.#runner.buildFrontend(app, distApp);
|
|
3729
|
-
}
|
|
3730
|
-
async serveFrontend(app, distApp = DistAppExecutor.from(app, app.name)) {
|
|
3731
|
-
await this.syncApplication(app);
|
|
3732
|
-
await this.#runner.serveFrontend(app, distApp);
|
|
3733
|
-
}
|
|
3734
|
-
async buildCsr(app, distApp = DistAppExecutor.from(app, app.name)) {
|
|
3735
|
-
await this.syncApplication(app);
|
|
3736
|
-
await this.#runner.buildCsr(app, distApp);
|
|
3737
|
-
}
|
|
3738
|
-
async serveCsr(app, distApp = DistAppExecutor.from(app, app.name)) {
|
|
3686
|
+
async build(app) {
|
|
3739
3687
|
await this.syncApplication(app);
|
|
3740
|
-
await this
|
|
3688
|
+
await Promise.all([this.buildBackend(app), this.buildFrontend(app)]);
|
|
3741
3689
|
}
|
|
3742
|
-
async
|
|
3690
|
+
async serve(app, { open: open2 = false } = {}) {
|
|
3743
3691
|
await this.syncApplication(app);
|
|
3744
|
-
await this
|
|
3692
|
+
await Promise.all([this.serveBackend(app, { open: open2, sync: false }), this.serveFrontend(app, { open: open2, sync: false })]);
|
|
3693
|
+
}
|
|
3694
|
+
async buildBackend(app, { sync = true } = {}) {
|
|
3695
|
+
if (sync)
|
|
3696
|
+
await this.syncApplication(app);
|
|
3697
|
+
await this.#runner.buildBackend(app);
|
|
3698
|
+
}
|
|
3699
|
+
async serveBackend(app, { open: open2 = false, sync = true } = {}) {
|
|
3700
|
+
if (sync)
|
|
3701
|
+
await this.syncApplication(app);
|
|
3702
|
+
await this.#runner.serveBackend(app, { open: open2 });
|
|
3703
|
+
}
|
|
3704
|
+
async buildFrontend(app, { sync = true } = {}) {
|
|
3705
|
+
if (sync)
|
|
3706
|
+
await this.syncApplication(app);
|
|
3707
|
+
await this.#runner.buildFrontend(app);
|
|
3708
|
+
}
|
|
3709
|
+
async serveFrontend(app, { open: open2 = false, sync = true } = {}) {
|
|
3710
|
+
if (sync)
|
|
3711
|
+
await this.syncApplication(app);
|
|
3712
|
+
await this.#runner.serveFrontend(app, { open: open2 });
|
|
3713
|
+
}
|
|
3714
|
+
async buildCsr(app, { sync = true } = {}) {
|
|
3715
|
+
if (sync)
|
|
3716
|
+
await this.syncApplication(app);
|
|
3717
|
+
await this.#runner.buildCsr(app);
|
|
3718
|
+
}
|
|
3719
|
+
async serveCsr(app, { open: open2 = false, sync = true } = {}) {
|
|
3720
|
+
if (sync)
|
|
3721
|
+
await this.syncApplication(app);
|
|
3722
|
+
await this.#runner.serveCsr(app, { open: open2 });
|
|
3723
|
+
}
|
|
3724
|
+
async buildIos(app, { sync = true } = {}) {
|
|
3725
|
+
if (sync)
|
|
3726
|
+
await this.syncApplication(app);
|
|
3745
3727
|
await this.#runner.buildIos(app);
|
|
3746
3728
|
}
|
|
3747
|
-
async serveIos(app, {
|
|
3748
|
-
|
|
3749
|
-
|
|
3729
|
+
async serveIos(app, {
|
|
3730
|
+
open: open2 = false,
|
|
3731
|
+
operation = "local",
|
|
3732
|
+
sync = true
|
|
3733
|
+
} = {}) {
|
|
3734
|
+
if (sync)
|
|
3735
|
+
await this.syncApplication(app);
|
|
3750
3736
|
await this.#runner.serveIos(app, { open: open2, operation });
|
|
3751
3737
|
}
|
|
3752
|
-
async releaseIos(app) {
|
|
3753
|
-
await this.buildCsr(app);
|
|
3738
|
+
async releaseIos(app, { sync = true } = {}) {
|
|
3739
|
+
await this.buildCsr(app, { sync });
|
|
3754
3740
|
await this.#runner.releaseIos(app);
|
|
3755
3741
|
}
|
|
3756
|
-
async buildAndroid(app) {
|
|
3757
|
-
|
|
3758
|
-
|
|
3742
|
+
async buildAndroid(app, { sync = true } = {}) {
|
|
3743
|
+
if (sync)
|
|
3744
|
+
await this.syncApplication(app);
|
|
3759
3745
|
await this.#runner.buildAndroid(app);
|
|
3760
3746
|
}
|
|
3761
|
-
async serveAndroid(app, {
|
|
3762
|
-
|
|
3763
|
-
|
|
3747
|
+
async serveAndroid(app, {
|
|
3748
|
+
open: open2 = false,
|
|
3749
|
+
operation = "local",
|
|
3750
|
+
sync = true
|
|
3751
|
+
} = {}) {
|
|
3752
|
+
if (sync)
|
|
3753
|
+
await this.syncApplication(app);
|
|
3764
3754
|
await this.#runner.serveAndroid(app, { open: open2, operation });
|
|
3765
3755
|
}
|
|
3766
|
-
async releaseAndroid(app) {
|
|
3767
|
-
await this.buildCsr(app);
|
|
3756
|
+
async releaseAndroid(app, { sync = true } = {}) {
|
|
3757
|
+
await this.buildCsr(app, { sync });
|
|
3768
3758
|
await this.#runner.releaseAndroid(app);
|
|
3769
3759
|
}
|
|
3770
3760
|
async dumpDatabase(app, environment) {
|
|
@@ -3807,8 +3797,8 @@ var ApplicationScript = class {
|
|
|
3807
3797
|
// pkgs/@akanjs/cli/src/application/application.command.ts
|
|
3808
3798
|
var ApplicationCommand = class {
|
|
3809
3799
|
applicationScript = new ApplicationScript();
|
|
3810
|
-
async createApplication(name, workspace) {
|
|
3811
|
-
await this.applicationScript.createApplication(name, workspace);
|
|
3800
|
+
async createApplication(name, serve, workspace) {
|
|
3801
|
+
await this.applicationScript.createApplication(name, workspace, { serve });
|
|
3812
3802
|
}
|
|
3813
3803
|
async removeApplication(app, workspace) {
|
|
3814
3804
|
}
|
|
@@ -3833,17 +3823,17 @@ var ApplicationCommand = class {
|
|
|
3833
3823
|
async buildAndroid(app) {
|
|
3834
3824
|
await this.applicationScript.buildAndroid(app);
|
|
3835
3825
|
}
|
|
3836
|
-
async serve(app) {
|
|
3837
|
-
await this.applicationScript.serve(app);
|
|
3826
|
+
async serve(app, open2) {
|
|
3827
|
+
await this.applicationScript.serve(app, { open: open2 });
|
|
3838
3828
|
}
|
|
3839
|
-
async serveBackend(app) {
|
|
3840
|
-
await this.applicationScript.serveBackend(app);
|
|
3829
|
+
async serveBackend(app, open2) {
|
|
3830
|
+
await this.applicationScript.serveBackend(app, { open: open2 });
|
|
3841
3831
|
}
|
|
3842
|
-
async serveFrontend(app) {
|
|
3843
|
-
await this.applicationScript.serveFrontend(app);
|
|
3832
|
+
async serveFrontend(app, open2) {
|
|
3833
|
+
await this.applicationScript.serveFrontend(app, { open: open2 });
|
|
3844
3834
|
}
|
|
3845
|
-
async serveCsr(app) {
|
|
3846
|
-
await this.applicationScript.serveCsr(app);
|
|
3835
|
+
async serveCsr(app, open2) {
|
|
3836
|
+
await this.applicationScript.serveCsr(app, { open: open2 });
|
|
3847
3837
|
}
|
|
3848
3838
|
async serveIos(app, open2, release) {
|
|
3849
3839
|
await this.applicationScript.serveIos(app, { open: open2, operation: release ? "release" : "local" });
|
|
@@ -3885,7 +3875,8 @@ var ApplicationCommand = class {
|
|
|
3885
3875
|
__decorateClass([
|
|
3886
3876
|
Target.Public(),
|
|
3887
3877
|
__decorateParam(0, Option("name", { desc: "name of application" })),
|
|
3888
|
-
__decorateParam(1,
|
|
3878
|
+
__decorateParam(1, Option("serve", { type: "boolean", desc: "serve application", default: false })),
|
|
3879
|
+
__decorateParam(2, Workspace())
|
|
3889
3880
|
], ApplicationCommand.prototype, "createApplication", 1);
|
|
3890
3881
|
__decorateClass([
|
|
3891
3882
|
Target.Public(),
|
|
@@ -3922,31 +3913,35 @@ __decorateClass([
|
|
|
3922
3913
|
], ApplicationCommand.prototype, "buildAndroid", 1);
|
|
3923
3914
|
__decorateClass([
|
|
3924
3915
|
Target.Public({ short: true }),
|
|
3925
|
-
__decorateParam(0, App())
|
|
3916
|
+
__decorateParam(0, App()),
|
|
3917
|
+
__decorateParam(1, Option("open", { type: "boolean", desc: "open web browser", default: false }))
|
|
3926
3918
|
], ApplicationCommand.prototype, "serve", 1);
|
|
3927
3919
|
__decorateClass([
|
|
3928
3920
|
Target.Public({ short: true }),
|
|
3929
|
-
__decorateParam(0, App())
|
|
3921
|
+
__decorateParam(0, App()),
|
|
3922
|
+
__decorateParam(1, Option("open", { type: "boolean", desc: "open graphql playground", default: false }))
|
|
3930
3923
|
], ApplicationCommand.prototype, "serveBackend", 1);
|
|
3931
3924
|
__decorateClass([
|
|
3932
3925
|
Target.Public({ short: true }),
|
|
3933
|
-
__decorateParam(0, App())
|
|
3926
|
+
__decorateParam(0, App()),
|
|
3927
|
+
__decorateParam(1, Option("open", { type: "boolean", desc: "open web browser", default: false }))
|
|
3934
3928
|
], ApplicationCommand.prototype, "serveFrontend", 1);
|
|
3935
3929
|
__decorateClass([
|
|
3936
3930
|
Target.Public({ short: true }),
|
|
3937
|
-
__decorateParam(0, App())
|
|
3931
|
+
__decorateParam(0, App()),
|
|
3932
|
+
__decorateParam(1, Option("open", { type: "boolean", desc: "open web browser", default: false }))
|
|
3938
3933
|
], ApplicationCommand.prototype, "serveCsr", 1);
|
|
3939
3934
|
__decorateClass([
|
|
3940
3935
|
Target.Public({ short: true }),
|
|
3941
3936
|
__decorateParam(0, App()),
|
|
3942
|
-
__decorateParam(1, Option("open", { desc: "open ios simulator", default: false })),
|
|
3943
|
-
__decorateParam(2, Option("release", { desc: "release mode", default: false }))
|
|
3937
|
+
__decorateParam(1, Option("open", { type: "boolean", desc: "open ios simulator", default: false })),
|
|
3938
|
+
__decorateParam(2, Option("release", { type: "boolean", desc: "release mode", default: false }))
|
|
3944
3939
|
], ApplicationCommand.prototype, "serveIos", 1);
|
|
3945
3940
|
__decorateClass([
|
|
3946
3941
|
Target.Public({ short: true }),
|
|
3947
3942
|
__decorateParam(0, App()),
|
|
3948
|
-
__decorateParam(1, Option("open", { desc: "open android simulator", default: false })),
|
|
3949
|
-
__decorateParam(2, Option("release", { desc: "release mode", default: false }))
|
|
3943
|
+
__decorateParam(1, Option("open", { type: "boolean", desc: "open android simulator", default: false })),
|
|
3944
|
+
__decorateParam(2, Option("release", { type: "boolean", desc: "release mode", default: false }))
|
|
3950
3945
|
], ApplicationCommand.prototype, "serveAndroid", 1);
|
|
3951
3946
|
__decorateClass([
|
|
3952
3947
|
Target.Public(),
|
|
@@ -3959,10 +3954,10 @@ __decorateClass([
|
|
|
3959
3954
|
__decorateClass([
|
|
3960
3955
|
Target.Public(),
|
|
3961
3956
|
__decorateParam(0, App()),
|
|
3962
|
-
__decorateParam(1, Option("rebuild", { desc: "rebuild", default: false })),
|
|
3957
|
+
__decorateParam(1, Option("rebuild", { type: "boolean", desc: "rebuild", default: false })),
|
|
3963
3958
|
__decorateParam(2, Option("buildNum", { desc: "build number", default: 0 })),
|
|
3964
3959
|
__decorateParam(3, Option("environment", { desc: "environment", default: "debug" })),
|
|
3965
|
-
__decorateParam(4, Option("local", { desc: "local", default: true }))
|
|
3960
|
+
__decorateParam(4, Option("local", { type: "boolean", desc: "local", default: true }))
|
|
3966
3961
|
], ApplicationCommand.prototype, "releaseSource", 1);
|
|
3967
3962
|
__decorateClass([
|
|
3968
3963
|
Target.Public(),
|
|
@@ -4036,11 +4031,11 @@ var PackageRunner = class {
|
|
|
4036
4031
|
const scanResult = await pkg.scan();
|
|
4037
4032
|
return scanResult;
|
|
4038
4033
|
}
|
|
4039
|
-
async buildPackage(pkg
|
|
4034
|
+
async buildPackage(pkg) {
|
|
4040
4035
|
const rootPackageJson = pkg.workspace.readJson("package.json");
|
|
4041
4036
|
const pkgJson = pkg.readJson("package.json");
|
|
4042
|
-
if (import_fs13.default.existsSync(
|
|
4043
|
-
await pkg.workspace.exec(`rm -rf ${
|
|
4037
|
+
if (import_fs13.default.existsSync(pkg.dist.cwdPath))
|
|
4038
|
+
await pkg.workspace.exec(`rm -rf ${pkg.dist.cwdPath}`);
|
|
4044
4039
|
let buildResult;
|
|
4045
4040
|
if (pkg.name === "@akanjs/config") {
|
|
4046
4041
|
buildResult = await esbuild2.build({
|
|
@@ -4049,7 +4044,7 @@ var PackageRunner = class {
|
|
|
4049
4044
|
bundle: false,
|
|
4050
4045
|
packages: "external",
|
|
4051
4046
|
format: "cjs",
|
|
4052
|
-
outdir:
|
|
4047
|
+
outdir: pkg.dist.cwdPath,
|
|
4053
4048
|
logLevel: "error",
|
|
4054
4049
|
outExtension: { ".js": pkgJson.type === "module" ? ".cjs" : ".js" },
|
|
4055
4050
|
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
|
|
@@ -4060,10 +4055,9 @@ var PackageRunner = class {
|
|
|
4060
4055
|
bundle: false,
|
|
4061
4056
|
packages: "external",
|
|
4062
4057
|
format: "esm",
|
|
4063
|
-
outdir:
|
|
4058
|
+
outdir: pkg.dist.cwdPath,
|
|
4064
4059
|
logLevel: "error",
|
|
4065
4060
|
outExtension: { ".js": pkgJson.type === "module" ? ".js" : ".mjs" },
|
|
4066
|
-
// copy css files
|
|
4067
4061
|
loader: { ".css": "copy", ".js": "copy" }
|
|
4068
4062
|
});
|
|
4069
4063
|
} else if (pkg.name === "@akanjs/cli") {
|
|
@@ -4073,7 +4067,7 @@ var PackageRunner = class {
|
|
|
4073
4067
|
bundle: true,
|
|
4074
4068
|
format: "cjs",
|
|
4075
4069
|
packages: "external",
|
|
4076
|
-
outdir:
|
|
4070
|
+
outdir: pkg.dist.cwdPath,
|
|
4077
4071
|
logLevel: "error",
|
|
4078
4072
|
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
|
|
4079
4073
|
});
|
|
@@ -4081,14 +4075,14 @@ var PackageRunner = class {
|
|
|
4081
4075
|
write: true,
|
|
4082
4076
|
entryPoints: [`${pkg.cwdPath}/src/templates/**/*.ts`, `${pkg.cwdPath}/src/templates/**/*.tsx`],
|
|
4083
4077
|
packages: "external",
|
|
4084
|
-
outdir: `${
|
|
4078
|
+
outdir: `${pkg.dist.cwdPath}/src/templates`,
|
|
4085
4079
|
outbase: `${pkg.cwdPath}/src/templates`,
|
|
4086
4080
|
format: "cjs",
|
|
4087
4081
|
platform: "node",
|
|
4088
4082
|
footer: { js: "module.exports = module.exports.default;" }
|
|
4089
4083
|
});
|
|
4090
4084
|
await pkg.workspace.exec(
|
|
4091
|
-
`rsync -aq --exclude="*.ts" --exclude="*.tsx" ${pkg.cwdPath}/src/templates/ ${
|
|
4085
|
+
`rsync -aq --exclude="*.ts" --exclude="*.tsx" ${pkg.cwdPath}/src/templates/ ${pkg.dist.cwdPath}/src/templates/`
|
|
4092
4086
|
);
|
|
4093
4087
|
} else {
|
|
4094
4088
|
const platform = [
|
|
@@ -4107,7 +4101,7 @@ var PackageRunner = class {
|
|
|
4107
4101
|
splitting: false,
|
|
4108
4102
|
platform,
|
|
4109
4103
|
format: "cjs",
|
|
4110
|
-
outdir:
|
|
4104
|
+
outdir: pkg.dist.cwdPath,
|
|
4111
4105
|
outExtension: { ".js": pkgJson.type === "module" ? ".cjs" : ".js" },
|
|
4112
4106
|
logLevel: "error",
|
|
4113
4107
|
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
|
|
@@ -4120,7 +4114,7 @@ var PackageRunner = class {
|
|
|
4120
4114
|
splitting: false,
|
|
4121
4115
|
platform,
|
|
4122
4116
|
format: "esm",
|
|
4123
|
-
outdir:
|
|
4117
|
+
outdir: pkg.dist.cwdPath,
|
|
4124
4118
|
outExtension: { ".js": pkgJson.type === "module" ? ".js" : ".mjs" },
|
|
4125
4119
|
logLevel: "error",
|
|
4126
4120
|
plugins: []
|
|
@@ -4143,8 +4137,8 @@ var PackageRunner = class {
|
|
|
4143
4137
|
}
|
|
4144
4138
|
};
|
|
4145
4139
|
if (buildResult.outputFiles)
|
|
4146
|
-
buildResult.outputFiles.map((file) =>
|
|
4147
|
-
|
|
4140
|
+
buildResult.outputFiles.map((file) => pkg.dist.writeFile(file.path, file.text));
|
|
4141
|
+
pkg.dist.writeJson("package.json", pkgPackageJson);
|
|
4148
4142
|
pkg.writeJson("package.json", pkgPackageJson);
|
|
4149
4143
|
}
|
|
4150
4144
|
};
|
|
@@ -4162,8 +4156,8 @@ var PackageScript = class {
|
|
|
4162
4156
|
const scanResult = await this.#runner.scanSync(pkg);
|
|
4163
4157
|
pkg.logger.rawLog(JSON.stringify(scanResult, null, 2));
|
|
4164
4158
|
}
|
|
4165
|
-
async buildPackage(pkg
|
|
4166
|
-
await this.#runner.buildPackage(pkg
|
|
4159
|
+
async buildPackage(pkg) {
|
|
4160
|
+
await this.#runner.buildPackage(pkg);
|
|
4167
4161
|
}
|
|
4168
4162
|
};
|
|
4169
4163
|
|
|
@@ -4171,7 +4165,7 @@ var PackageScript = class {
|
|
|
4171
4165
|
var import_prompts7 = require("@inquirer/prompts");
|
|
4172
4166
|
var import_chalk = __toESM(require("chalk"));
|
|
4173
4167
|
var import_latest_version = __toESM(require("latest-version"));
|
|
4174
|
-
var
|
|
4168
|
+
var import_open2 = __toESM(require("open"));
|
|
4175
4169
|
var QRcode = __toESM(require("qrcode"));
|
|
4176
4170
|
var import_uuid = require("uuid");
|
|
4177
4171
|
var CloudRunner = class {
|
|
@@ -4199,7 +4193,7 @@ ${import_chalk.default.green("\u27A4")} Authentication Required`));
|
|
|
4199
4193
|
});
|
|
4200
4194
|
});
|
|
4201
4195
|
Logger.rawLog(qrcode);
|
|
4202
|
-
await (0,
|
|
4196
|
+
await (0, import_open2.default)(signinUrl);
|
|
4203
4197
|
Logger.rawLog(import_chalk.default.dim("Opening browser..."));
|
|
4204
4198
|
} catch {
|
|
4205
4199
|
Logger.rawLog(import_chalk.default.yellow("Could not open browser. Please visit the URL manually."));
|
|
@@ -4849,7 +4843,7 @@ var WorkspaceScript = class {
|
|
|
4849
4843
|
};
|
|
4850
4844
|
workspace.writeFile("package.json", packageJson);
|
|
4851
4845
|
workspace.log("Installing dependencies...");
|
|
4852
|
-
await workspace.spawn("pnpm", ["
|
|
4846
|
+
await workspace.spawn("pnpm", ["install", "--reporter=silent"]);
|
|
4853
4847
|
workspace.log("Initializing git repository and commit...");
|
|
4854
4848
|
await workspace.commit("Initial commit", { init: true });
|
|
4855
4849
|
await this.libraryScript.installLibrary(workspace, "util");
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { App, Sys, Workspace } from "@akanjs/devkit";
|
|
|
2
2
|
import { ApplicationScript } from "./application.script";
|
|
3
3
|
export declare class ApplicationCommand {
|
|
4
4
|
applicationScript: ApplicationScript;
|
|
5
|
-
createApplication(name: string, workspace: Workspace): Promise<void>;
|
|
5
|
+
createApplication(name: string, serve: boolean, workspace: Workspace): Promise<void>;
|
|
6
6
|
removeApplication(app: App, workspace: Workspace): Promise<void>;
|
|
7
7
|
scanApplication(app: App): Promise<void>;
|
|
8
8
|
build(app: App): Promise<void>;
|
|
@@ -11,10 +11,10 @@ export declare class ApplicationCommand {
|
|
|
11
11
|
buildCsr(app: App): Promise<void>;
|
|
12
12
|
buildIos(app: App): Promise<void>;
|
|
13
13
|
buildAndroid(app: App): Promise<void>;
|
|
14
|
-
serve(app: App): Promise<void>;
|
|
15
|
-
serveBackend(app: App): Promise<void>;
|
|
16
|
-
serveFrontend(app: App): Promise<void>;
|
|
17
|
-
serveCsr(app: App): Promise<void>;
|
|
14
|
+
serve(app: App, open: boolean): Promise<void>;
|
|
15
|
+
serveBackend(app: App, open: boolean): Promise<void>;
|
|
16
|
+
serveFrontend(app: App, open: boolean): Promise<void>;
|
|
17
|
+
serveCsr(app: App, open: boolean): Promise<void>;
|
|
18
18
|
serveIos(app: App, open: boolean, release: boolean): Promise<void>;
|
|
19
19
|
serveAndroid(app: App, open: boolean, release: boolean): Promise<void>;
|
|
20
20
|
releaseIos(app: App): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { App, AppExecutor,
|
|
1
|
+
import { App, AppExecutor, type Workspace } from "@akanjs/devkit";
|
|
2
2
|
export interface ReleaseSourceOptions {
|
|
3
3
|
rebuild?: boolean;
|
|
4
4
|
buildNum?: number;
|
|
@@ -9,12 +9,18 @@ export declare class ApplicationRunner {
|
|
|
9
9
|
#private;
|
|
10
10
|
createApplication(appName: string, workspace: Workspace): Promise<AppExecutor>;
|
|
11
11
|
scanSync(app: App): Promise<import("@akanjs/config").AppScanResult | import("@akanjs/config").LibScanResult>;
|
|
12
|
-
buildBackend(app: App
|
|
13
|
-
serveBackend(app: App,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
buildBackend(app: App): Promise<void>;
|
|
13
|
+
serveBackend(app: App, { open }?: {
|
|
14
|
+
open?: boolean;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
buildFrontend(app: App): Promise<void>;
|
|
17
|
+
serveFrontend(app: App, { open }?: {
|
|
18
|
+
open?: boolean;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
buildCsr(app: App): Promise<void>;
|
|
21
|
+
serveCsr(app: App, { open }?: {
|
|
22
|
+
open?: boolean;
|
|
23
|
+
}): Promise<void>;
|
|
18
24
|
buildIos(app: App): Promise<void>;
|
|
19
25
|
serveIos(app: App, { open, operation }?: {
|
|
20
26
|
open?: boolean;
|
|
@@ -1,35 +1,63 @@
|
|
|
1
1
|
import type { App, Sys, Workspace } from "@akanjs/devkit";
|
|
2
|
-
import { DistAppExecutor } from "@akanjs/devkit";
|
|
3
2
|
import { LibraryScript } from "../library/library.script";
|
|
4
3
|
import { type ReleaseSourceOptions } from "./application.runner";
|
|
5
4
|
export declare class ApplicationScript {
|
|
6
5
|
#private;
|
|
7
6
|
libraryScript: LibraryScript;
|
|
8
|
-
createApplication(appName: string, workspace: Workspace
|
|
7
|
+
createApplication(appName: string, workspace: Workspace, { serve }?: {
|
|
8
|
+
serve?: boolean;
|
|
9
|
+
}): Promise<void>;
|
|
9
10
|
scanApplication(app: App, verbose?: boolean): Promise<import("@akanjs/config").AppScanResult | import("@akanjs/config").LibScanResult>;
|
|
10
11
|
syncApplication(app: App, { recursive }?: {
|
|
11
12
|
recursive?: boolean;
|
|
12
13
|
}): Promise<void>;
|
|
13
|
-
build(app: App
|
|
14
|
-
serve(app: App,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
build(app: App): Promise<void>;
|
|
15
|
+
serve(app: App, { open }?: {
|
|
16
|
+
open?: boolean;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
buildBackend(app: App, { sync }?: {
|
|
19
|
+
sync?: boolean;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
serveBackend(app: App, { open, sync }?: {
|
|
22
|
+
open?: boolean;
|
|
23
|
+
sync?: boolean;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
buildFrontend(app: App, { sync }?: {
|
|
26
|
+
sync?: boolean;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
serveFrontend(app: App, { open, sync }?: {
|
|
29
|
+
open?: boolean;
|
|
30
|
+
sync?: boolean;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
buildCsr(app: App, { sync }?: {
|
|
33
|
+
sync?: boolean;
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
serveCsr(app: App, { open, sync }?: {
|
|
36
|
+
open?: boolean;
|
|
37
|
+
sync?: boolean;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
buildIos(app: App, { sync }?: {
|
|
40
|
+
sync?: boolean;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
serveIos(app: App, { open, operation, sync, }?: {
|
|
23
43
|
open?: boolean;
|
|
24
44
|
operation?: "local" | "release";
|
|
45
|
+
sync?: boolean;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
releaseIos(app: App, { sync }?: {
|
|
48
|
+
sync?: boolean;
|
|
25
49
|
}): Promise<void>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
50
|
+
buildAndroid(app: App, { sync }?: {
|
|
51
|
+
sync?: boolean;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
serveAndroid(app: App, { open, operation, sync, }?: {
|
|
29
54
|
open?: boolean;
|
|
30
55
|
operation?: "local" | "release";
|
|
56
|
+
sync?: boolean;
|
|
57
|
+
}): Promise<void>;
|
|
58
|
+
releaseAndroid(app: App, { sync }?: {
|
|
59
|
+
sync?: boolean;
|
|
31
60
|
}): Promise<void>;
|
|
32
|
-
releaseAndroid(app: App): Promise<void>;
|
|
33
61
|
dumpDatabase(app: App, environment: string): Promise<void>;
|
|
34
62
|
restoreDatabase(app: App, source: string, target: string): Promise<void>;
|
|
35
63
|
pullDatabase(app: App, environment: string, dump?: boolean): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Pkg, type Workspace } from "@akanjs/devkit";
|
|
2
2
|
export declare class PackageRunner {
|
|
3
3
|
version(workspace: Workspace): Promise<void>;
|
|
4
4
|
createPackage(workspace: Workspace, pkgName: string): Promise<void>;
|
|
5
5
|
scanSync(pkg: Pkg): Promise<import("@akanjs/config").PkgScanResult>;
|
|
6
|
-
buildPackage(pkg: Pkg
|
|
6
|
+
buildPackage(pkg: Pkg): Promise<void>;
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Pkg, type Workspace } from "@akanjs/devkit";
|
|
2
2
|
export declare class PackageScript {
|
|
3
3
|
#private;
|
|
4
4
|
version(workspace: Workspace): Promise<void>;
|
|
5
5
|
createPackage(workspace: Workspace, pkgName: string): Promise<void>;
|
|
6
6
|
scanPackage(pkg: Pkg): Promise<void>;
|
|
7
|
-
buildPackage(pkg: Pkg
|
|
7
|
+
buildPackage(pkg: Pkg): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppConfig, AppConfigResult, DeepPartial, LibConfigResult, RunnerProps } from "@akanjs/config";
|
|
2
2
|
import type { NextConfig } from "next";
|
|
3
|
-
export declare const makeAppConfig: (config: DeepPartial<AppConfigResult>, props
|
|
3
|
+
export declare const makeAppConfig: (config: DeepPartial<AppConfigResult>, props: RunnerProps) => AppConfigResult;
|
|
4
4
|
export declare const getAppConfig: (appRoot: string, props: RunnerProps) => Promise<AppConfigResult>;
|
|
5
|
-
export declare const makeLibConfig: (config: DeepPartial<LibConfigResult>, props
|
|
5
|
+
export declare const makeLibConfig: (config: DeepPartial<LibConfigResult>, props: RunnerProps) => LibConfigResult;
|
|
6
6
|
export declare const getLibConfig: (libRoot: string, props: RunnerProps) => Promise<LibConfigResult>;
|
|
7
7
|
export declare const getNextConfig: (configImp: AppConfig, appData: any) => NextConfig | (() => Promise<NextConfig> | NextConfig);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
export interface RunnerProps {
|
|
3
|
-
|
|
3
|
+
type: "app" | "lib";
|
|
4
|
+
name: string;
|
|
4
5
|
repoName: string;
|
|
5
6
|
serveDomain: string;
|
|
6
|
-
env: "testing" | "debug" | "develop" | "main";
|
|
7
|
+
env: "testing" | "local" | "debug" | "develop" | "main";
|
|
7
8
|
command?: string;
|
|
8
9
|
}
|
|
9
10
|
export type Arch = "amd64" | "arm64";
|
|
@@ -88,6 +89,8 @@ export declare const getDefaultFileScan: () => FileConventionScanResult;
|
|
|
88
89
|
export interface AppScanResult {
|
|
89
90
|
name: string;
|
|
90
91
|
type: "app" | "lib";
|
|
92
|
+
repoName: string;
|
|
93
|
+
serveDomain: string;
|
|
91
94
|
akanConfig: AppConfigResult;
|
|
92
95
|
files: FileConventionScanResult;
|
|
93
96
|
libDeps: string[];
|
|
@@ -100,6 +103,8 @@ export interface AppScanResult {
|
|
|
100
103
|
export interface LibScanResult {
|
|
101
104
|
name: string;
|
|
102
105
|
type: "app" | "lib";
|
|
106
|
+
repoName: string;
|
|
107
|
+
serveDomain: string;
|
|
103
108
|
akanConfig: LibConfigResult;
|
|
104
109
|
files: FileConventionScanResult;
|
|
105
110
|
libDeps: string[];
|
|
@@ -53,7 +53,7 @@ export declare class WorkspaceExecutor extends Executor {
|
|
|
53
53
|
repoName: string;
|
|
54
54
|
serveDomain: string;
|
|
55
55
|
env: "debug" | "testing" | "develop" | "main";
|
|
56
|
-
|
|
56
|
+
name?: string | undefined;
|
|
57
57
|
};
|
|
58
58
|
scan(): Promise<WorkspaceScanResult>;
|
|
59
59
|
getApps(): Promise<string[]>;
|
|
@@ -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 {};
|