@semiont/cli 0.2.36 → 0.2.37
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/dist/cli.mjs +272 -201
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -13319,18 +13319,18 @@ import * as path from "path";
|
|
|
13319
13319
|
import { fileURLToPath } from "url";
|
|
13320
13320
|
function getTemplatesDir(importMetaUrl) {
|
|
13321
13321
|
const filename = fileURLToPath(importMetaUrl);
|
|
13322
|
-
const
|
|
13323
|
-
if (
|
|
13324
|
-
let dir =
|
|
13322
|
+
const dirname12 = path.dirname(filename);
|
|
13323
|
+
if (dirname12.includes(path.sep + "src" + path.sep)) {
|
|
13324
|
+
let dir = dirname12;
|
|
13325
13325
|
while (dir !== path.dirname(dir)) {
|
|
13326
13326
|
if (path.basename(dir) === "src") {
|
|
13327
13327
|
return path.join(path.dirname(dir), "templates");
|
|
13328
13328
|
}
|
|
13329
13329
|
dir = path.dirname(dir);
|
|
13330
13330
|
}
|
|
13331
|
-
throw new Error(`Cannot locate templates directory from source path: ${
|
|
13331
|
+
throw new Error(`Cannot locate templates directory from source path: ${dirname12}`);
|
|
13332
13332
|
}
|
|
13333
|
-
return path.join(
|
|
13333
|
+
return path.join(dirname12, "templates");
|
|
13334
13334
|
}
|
|
13335
13335
|
var init_cli_paths = __esm({
|
|
13336
13336
|
"src/core/io/cli-paths.ts"() {
|
|
@@ -15815,12 +15815,31 @@ var init_graph_check = __esm({
|
|
|
15815
15815
|
|
|
15816
15816
|
// src/platforms/posix/handlers/backend-paths.ts
|
|
15817
15817
|
import * as path10 from "path";
|
|
15818
|
+
import { createRequire } from "module";
|
|
15819
|
+
function resolveNpmPackage() {
|
|
15820
|
+
try {
|
|
15821
|
+
const require2 = createRequire(import.meta.url);
|
|
15822
|
+
const pkgPath = require2.resolve("@semiont/backend/package.json");
|
|
15823
|
+
return path10.dirname(pkgPath);
|
|
15824
|
+
} catch {
|
|
15825
|
+
return null;
|
|
15826
|
+
}
|
|
15827
|
+
}
|
|
15818
15828
|
function getBackendPaths(context) {
|
|
15819
15829
|
const semiontRepo = context.options?.semiontRepo;
|
|
15820
|
-
if (
|
|
15821
|
-
|
|
15830
|
+
if (semiontRepo) {
|
|
15831
|
+
const sourceDir = path10.join(semiontRepo, "apps", "backend");
|
|
15832
|
+
return buildPaths(sourceDir, false);
|
|
15833
|
+
}
|
|
15834
|
+
const npmDir = resolveNpmPackage();
|
|
15835
|
+
if (npmDir) {
|
|
15836
|
+
return buildPaths(npmDir, true);
|
|
15822
15837
|
}
|
|
15823
|
-
|
|
15838
|
+
throw new Error(
|
|
15839
|
+
"Cannot find backend source. Either:\n - Set SEMIONT_REPO to your semiont clone, or\n - Run: npm install @semiont/backend"
|
|
15840
|
+
);
|
|
15841
|
+
}
|
|
15842
|
+
function buildPaths(sourceDir, fromNpmPackage) {
|
|
15824
15843
|
return {
|
|
15825
15844
|
sourceDir,
|
|
15826
15845
|
pidFile: path10.join(sourceDir, ".pid"),
|
|
@@ -15829,7 +15848,8 @@ function getBackendPaths(context) {
|
|
|
15829
15848
|
appLogFile: path10.join(sourceDir, "logs", "app.log"),
|
|
15830
15849
|
errorLogFile: path10.join(sourceDir, "logs", "error.log"),
|
|
15831
15850
|
tmpDir: path10.join(sourceDir, "tmp"),
|
|
15832
|
-
distDir: path10.join(sourceDir, "dist")
|
|
15851
|
+
distDir: path10.join(sourceDir, "dist"),
|
|
15852
|
+
fromNpmPackage
|
|
15833
15853
|
};
|
|
15834
15854
|
}
|
|
15835
15855
|
var init_backend_paths = __esm({
|
|
@@ -15995,22 +16015,41 @@ var init_backend_check = __esm({
|
|
|
15995
16015
|
|
|
15996
16016
|
// src/platforms/posix/handlers/frontend-paths.ts
|
|
15997
16017
|
import * as path11 from "path";
|
|
16018
|
+
import { createRequire as createRequire2 } from "module";
|
|
16019
|
+
function resolveNpmPackage2() {
|
|
16020
|
+
try {
|
|
16021
|
+
const require2 = createRequire2(import.meta.url);
|
|
16022
|
+
const pkgPath = require2.resolve("@semiont/frontend/package.json");
|
|
16023
|
+
return path11.dirname(pkgPath);
|
|
16024
|
+
} catch {
|
|
16025
|
+
return null;
|
|
16026
|
+
}
|
|
16027
|
+
}
|
|
15998
16028
|
function getFrontendPaths(context) {
|
|
15999
16029
|
const semiontRepo = context.options?.semiontRepo;
|
|
16000
|
-
if (
|
|
16001
|
-
|
|
16030
|
+
if (semiontRepo) {
|
|
16031
|
+
const sourceDir = path11.join(semiontRepo, "apps", "frontend");
|
|
16032
|
+
return buildPaths2(sourceDir, false);
|
|
16033
|
+
}
|
|
16034
|
+
const npmDir = resolveNpmPackage2();
|
|
16035
|
+
if (npmDir) {
|
|
16036
|
+
return buildPaths2(npmDir, true);
|
|
16002
16037
|
}
|
|
16003
|
-
|
|
16038
|
+
throw new Error(
|
|
16039
|
+
"Cannot find frontend source. Either:\n - Set SEMIONT_REPO to your semiont clone, or\n - Run: npm install @semiont/frontend"
|
|
16040
|
+
);
|
|
16041
|
+
}
|
|
16042
|
+
function buildPaths2(sourceDir, fromNpmPackage) {
|
|
16004
16043
|
return {
|
|
16005
16044
|
sourceDir,
|
|
16006
16045
|
pidFile: path11.join(sourceDir, ".pid"),
|
|
16007
16046
|
envLocalFile: path11.join(sourceDir, ".env.local"),
|
|
16008
|
-
// Frontend uses .env.local
|
|
16009
16047
|
logsDir: path11.join(sourceDir, "logs"),
|
|
16010
16048
|
appLogFile: path11.join(sourceDir, "logs", "app.log"),
|
|
16011
16049
|
errorLogFile: path11.join(sourceDir, "logs", "error.log"),
|
|
16012
16050
|
tmpDir: path11.join(sourceDir, "tmp"),
|
|
16013
|
-
nextDir: path11.join(sourceDir, ".next")
|
|
16051
|
+
nextDir: path11.join(sourceDir, ".next"),
|
|
16052
|
+
fromNpmPackage
|
|
16014
16053
|
};
|
|
16015
16054
|
}
|
|
16016
16055
|
var init_frontend_paths = __esm({
|
|
@@ -16956,8 +16995,18 @@ var init_backend_start = __esm({
|
|
|
16956
16995
|
printInfo(`Port: ${port}`);
|
|
16957
16996
|
printInfo(`Mode: ${config2.devMode ? "development" : "production"}`);
|
|
16958
16997
|
}
|
|
16959
|
-
|
|
16960
|
-
|
|
16998
|
+
let command;
|
|
16999
|
+
let args;
|
|
17000
|
+
if (paths.fromNpmPackage) {
|
|
17001
|
+
command = "node";
|
|
17002
|
+
args = [path15.join(backendSourceDir, "dist", "index.js")];
|
|
17003
|
+
} else if (config2.devMode) {
|
|
17004
|
+
command = "npm";
|
|
17005
|
+
args = ["run", "dev"];
|
|
17006
|
+
} else {
|
|
17007
|
+
command = "npm";
|
|
17008
|
+
args = ["start"];
|
|
17009
|
+
}
|
|
16961
17010
|
try {
|
|
16962
17011
|
const appLogFd = fs16.openSync(appLogPath, "a");
|
|
16963
17012
|
const errorLogFd = fs16.openSync(errorLogPath, "a");
|
|
@@ -16994,7 +17043,7 @@ var init_backend_start = __esm({
|
|
|
16994
17043
|
}
|
|
16995
17044
|
};
|
|
16996
17045
|
}
|
|
16997
|
-
const commandStr = config2.devMode ? "npm run dev" : "npm start";
|
|
17046
|
+
const commandStr = paths.fromNpmPackage ? `node dist/index.js` : config2.devMode ? "npm run dev" : "npm start";
|
|
16998
17047
|
const resources = {
|
|
16999
17048
|
platform: "posix",
|
|
17000
17049
|
data: {
|
|
@@ -17051,10 +17100,9 @@ var init_backend_start = __esm({
|
|
|
17051
17100
|
};
|
|
17052
17101
|
preflightBackendStart = async (context) => {
|
|
17053
17102
|
const config2 = context.service.config;
|
|
17103
|
+
const paths = getBackendPaths(context);
|
|
17054
17104
|
const port = config2.port;
|
|
17055
|
-
const checks = [
|
|
17056
|
-
checkCommandAvailable("npm")
|
|
17057
|
-
];
|
|
17105
|
+
const checks = paths.fromNpmPackage ? [checkCommandAvailable("node")] : [checkCommandAvailable("npm")];
|
|
17058
17106
|
if (port) {
|
|
17059
17107
|
checks.push(await checkPortFree(port));
|
|
17060
17108
|
}
|
|
@@ -17164,8 +17212,18 @@ var init_frontend_start = __esm({
|
|
|
17164
17212
|
printInfo(`Port: ${port}`);
|
|
17165
17213
|
printInfo(`Mode: ${config2.devMode ? "development" : "production"}`);
|
|
17166
17214
|
}
|
|
17167
|
-
|
|
17168
|
-
|
|
17215
|
+
let command;
|
|
17216
|
+
let args;
|
|
17217
|
+
if (paths.fromNpmPackage) {
|
|
17218
|
+
command = "node";
|
|
17219
|
+
args = [path16.join(frontendSourceDir, "standalone", "apps", "frontend", "server.js")];
|
|
17220
|
+
} else if (config2.devMode) {
|
|
17221
|
+
command = "npm";
|
|
17222
|
+
args = ["run", "dev"];
|
|
17223
|
+
} else {
|
|
17224
|
+
command = "npm";
|
|
17225
|
+
args = ["start"];
|
|
17226
|
+
}
|
|
17169
17227
|
try {
|
|
17170
17228
|
const appLogFd = fs17.openSync(appLogPath, "a");
|
|
17171
17229
|
const errorLogFd = fs17.openSync(errorLogPath, "a");
|
|
@@ -17202,7 +17260,7 @@ var init_frontend_start = __esm({
|
|
|
17202
17260
|
}
|
|
17203
17261
|
};
|
|
17204
17262
|
}
|
|
17205
|
-
const commandStr = config2.devMode ? "npm run dev" : "npm start";
|
|
17263
|
+
const commandStr = paths.fromNpmPackage ? `node standalone/apps/frontend/server.js` : config2.devMode ? "npm run dev" : "npm start";
|
|
17206
17264
|
const resources = {
|
|
17207
17265
|
platform: "posix",
|
|
17208
17266
|
data: {
|
|
@@ -17259,10 +17317,9 @@ var init_frontend_start = __esm({
|
|
|
17259
17317
|
};
|
|
17260
17318
|
preflightFrontendStart = async (context) => {
|
|
17261
17319
|
const config2 = context.service.config;
|
|
17320
|
+
const paths = getFrontendPaths(context);
|
|
17262
17321
|
const port = config2.port;
|
|
17263
|
-
const checks = [
|
|
17264
|
-
checkCommandAvailable("npm")
|
|
17265
|
-
];
|
|
17322
|
+
const checks = paths.fromNpmPackage ? [checkCommandAvailable("node")] : [checkCommandAvailable("npm")];
|
|
17266
17323
|
if (port) {
|
|
17267
17324
|
checks.push(await checkPortFree(port));
|
|
17268
17325
|
}
|
|
@@ -17928,13 +17985,6 @@ var init_backend_provision = __esm({
|
|
|
17928
17985
|
const { service, options } = context;
|
|
17929
17986
|
const config2 = service.config;
|
|
17930
17987
|
const paths = getBackendPaths(context);
|
|
17931
|
-
if (!paths) {
|
|
17932
|
-
return {
|
|
17933
|
-
success: false,
|
|
17934
|
-
error: "Semiont repository path is required. Use --semiont-repo or set SEMIONT_REPO environment variable",
|
|
17935
|
-
metadata: { serviceType: "backend" }
|
|
17936
|
-
};
|
|
17937
|
-
}
|
|
17938
17988
|
const { sourceDir: backendSourceDir, envFile, logsDir, tmpDir } = paths;
|
|
17939
17989
|
if (!fs22.existsSync(backendSourceDir)) {
|
|
17940
17990
|
return {
|
|
@@ -17945,8 +17995,11 @@ var init_backend_provision = __esm({
|
|
|
17945
17995
|
}
|
|
17946
17996
|
if (!service.quiet) {
|
|
17947
17997
|
printInfo(`Provisioning backend service ${service.name}...`);
|
|
17948
|
-
|
|
17949
|
-
|
|
17998
|
+
if (paths.fromNpmPackage) {
|
|
17999
|
+
printInfo(`Using installed npm package: ${paths.sourceDir}`);
|
|
18000
|
+
} else {
|
|
18001
|
+
printInfo(`Using semiont repo: ${options.semiontRepo}`);
|
|
18002
|
+
}
|
|
17950
18003
|
}
|
|
17951
18004
|
fs22.mkdirSync(logsDir, { recursive: true });
|
|
17952
18005
|
fs22.mkdirSync(tmpDir, { recursive: true });
|
|
@@ -18041,111 +18094,117 @@ var init_backend_provision = __esm({
|
|
|
18041
18094
|
if (!service.quiet) {
|
|
18042
18095
|
printSuccess("Created .env with configuration from environment file");
|
|
18043
18096
|
}
|
|
18044
|
-
|
|
18045
|
-
|
|
18046
|
-
|
|
18047
|
-
|
|
18048
|
-
|
|
18049
|
-
|
|
18050
|
-
|
|
18051
|
-
|
|
18052
|
-
|
|
18053
|
-
|
|
18054
|
-
|
|
18055
|
-
|
|
18056
|
-
|
|
18097
|
+
const prismaSchemaPath = path18.join(backendSourceDir, "prisma", "schema.prisma");
|
|
18098
|
+
if (paths.fromNpmPackage) {
|
|
18099
|
+
if (!service.quiet) {
|
|
18100
|
+
printInfo("Using pre-built npm package \u2014 skipping install, build, and prisma generate");
|
|
18101
|
+
}
|
|
18102
|
+
} else {
|
|
18103
|
+
if (!service.quiet) {
|
|
18104
|
+
printInfo("Installing npm dependencies...");
|
|
18105
|
+
}
|
|
18106
|
+
try {
|
|
18107
|
+
const semiontRepo = context.options?.semiontRepo;
|
|
18108
|
+
if (!semiontRepo) {
|
|
18109
|
+
throw new Error("SEMIONT_REPO not configured");
|
|
18110
|
+
}
|
|
18111
|
+
const monorepoRoot = path18.resolve(semiontRepo);
|
|
18112
|
+
const rootPackageJsonPath = path18.join(monorepoRoot, "package.json");
|
|
18113
|
+
if (fs22.existsSync(rootPackageJsonPath)) {
|
|
18114
|
+
const rootPackageJson = JSON.parse(fs22.readFileSync(rootPackageJsonPath, "utf-8"));
|
|
18115
|
+
if (rootPackageJson.workspaces) {
|
|
18116
|
+
execSync11("npm install", {
|
|
18117
|
+
cwd: monorepoRoot,
|
|
18118
|
+
stdio: service.verbose ? "inherit" : "pipe"
|
|
18119
|
+
});
|
|
18120
|
+
} else {
|
|
18121
|
+
execSync11("npm install", {
|
|
18122
|
+
cwd: backendSourceDir,
|
|
18123
|
+
stdio: service.verbose ? "inherit" : "pipe"
|
|
18124
|
+
});
|
|
18125
|
+
}
|
|
18126
|
+
} else {
|
|
18057
18127
|
execSync11("npm install", {
|
|
18058
|
-
cwd:
|
|
18128
|
+
cwd: backendSourceDir,
|
|
18059
18129
|
stdio: service.verbose ? "inherit" : "pipe"
|
|
18060
18130
|
});
|
|
18061
|
-
}
|
|
18062
|
-
|
|
18131
|
+
}
|
|
18132
|
+
if (!service.quiet) {
|
|
18133
|
+
printSuccess("Dependencies installed successfully");
|
|
18134
|
+
}
|
|
18135
|
+
} catch (error46) {
|
|
18136
|
+
printError(`Failed to install dependencies: ${error46}`);
|
|
18137
|
+
return {
|
|
18138
|
+
success: false,
|
|
18139
|
+
error: `Failed to install dependencies: ${error46}`,
|
|
18140
|
+
metadata: { serviceType: "backend", backendSourceDir }
|
|
18141
|
+
};
|
|
18142
|
+
}
|
|
18143
|
+
if (fs22.existsSync(prismaSchemaPath)) {
|
|
18144
|
+
if (!service.quiet) {
|
|
18145
|
+
printInfo("Generating Prisma client...");
|
|
18146
|
+
}
|
|
18147
|
+
try {
|
|
18148
|
+
execSync11("npx prisma generate", {
|
|
18063
18149
|
cwd: backendSourceDir,
|
|
18064
18150
|
stdio: service.verbose ? "inherit" : "pipe"
|
|
18065
18151
|
});
|
|
18152
|
+
if (!service.quiet) {
|
|
18153
|
+
printSuccess("Prisma client generated");
|
|
18154
|
+
}
|
|
18155
|
+
} catch (error46) {
|
|
18156
|
+
printWarning(`Failed to generate Prisma client: ${error46}`);
|
|
18066
18157
|
}
|
|
18067
|
-
} else {
|
|
18068
|
-
execSync11("npm install", {
|
|
18069
|
-
cwd: backendSourceDir,
|
|
18070
|
-
stdio: service.verbose ? "inherit" : "pipe"
|
|
18071
|
-
});
|
|
18072
18158
|
}
|
|
18073
18159
|
if (!service.quiet) {
|
|
18074
|
-
|
|
18160
|
+
printInfo("Building workspace dependencies...");
|
|
18161
|
+
}
|
|
18162
|
+
try {
|
|
18163
|
+
const monorepoRoot = path18.dirname(path18.dirname(backendSourceDir));
|
|
18164
|
+
const rootPackageJsonPath = path18.join(monorepoRoot, "package.json");
|
|
18165
|
+
if (fs22.existsSync(rootPackageJsonPath)) {
|
|
18166
|
+
const rootPackageJson = JSON.parse(fs22.readFileSync(rootPackageJsonPath, "utf-8"));
|
|
18167
|
+
if (rootPackageJson.workspaces) {
|
|
18168
|
+
execSync11("npm run build --workspace=@semiont/core --if-present", {
|
|
18169
|
+
cwd: monorepoRoot,
|
|
18170
|
+
stdio: service.verbose ? "inherit" : "pipe"
|
|
18171
|
+
});
|
|
18172
|
+
execSync11("npm run build --workspace=@semiont/event-sourcing --if-present", {
|
|
18173
|
+
cwd: monorepoRoot,
|
|
18174
|
+
stdio: service.verbose ? "inherit" : "pipe"
|
|
18175
|
+
});
|
|
18176
|
+
execSync11("npm run build --workspace=@semiont/api-client --if-present", {
|
|
18177
|
+
cwd: monorepoRoot,
|
|
18178
|
+
stdio: service.verbose ? "inherit" : "pipe"
|
|
18179
|
+
});
|
|
18180
|
+
if (!service.quiet) {
|
|
18181
|
+
printSuccess("Workspace dependencies built successfully");
|
|
18182
|
+
}
|
|
18183
|
+
}
|
|
18184
|
+
}
|
|
18185
|
+
} catch (error46) {
|
|
18186
|
+
printWarning(`Failed to build workspace dependencies: ${error46}`);
|
|
18187
|
+
printInfo("You may need to build manually: npm run build --workspace=@semiont/core");
|
|
18075
18188
|
}
|
|
18076
|
-
} catch (error46) {
|
|
18077
|
-
printError(`Failed to install dependencies: ${error46}`);
|
|
18078
|
-
return {
|
|
18079
|
-
success: false,
|
|
18080
|
-
error: `Failed to install dependencies: ${error46}`,
|
|
18081
|
-
metadata: { serviceType: "backend", backendSourceDir }
|
|
18082
|
-
};
|
|
18083
|
-
}
|
|
18084
|
-
const prismaSchemaPath = path18.join(backendSourceDir, "prisma", "schema.prisma");
|
|
18085
|
-
if (fs22.existsSync(prismaSchemaPath)) {
|
|
18086
18189
|
if (!service.quiet) {
|
|
18087
|
-
printInfo("
|
|
18190
|
+
printInfo("Building backend application...");
|
|
18088
18191
|
}
|
|
18089
18192
|
try {
|
|
18090
|
-
execSync11("
|
|
18193
|
+
execSync11("npm run build", {
|
|
18091
18194
|
cwd: backendSourceDir,
|
|
18092
18195
|
stdio: service.verbose ? "inherit" : "pipe"
|
|
18093
18196
|
});
|
|
18094
18197
|
if (!service.quiet) {
|
|
18095
|
-
printSuccess("
|
|
18198
|
+
printSuccess("Backend application built successfully");
|
|
18096
18199
|
}
|
|
18097
18200
|
} catch (error46) {
|
|
18098
|
-
|
|
18099
|
-
|
|
18100
|
-
|
|
18101
|
-
|
|
18102
|
-
|
|
18103
|
-
|
|
18104
|
-
try {
|
|
18105
|
-
const monorepoRoot = path18.dirname(path18.dirname(backendSourceDir));
|
|
18106
|
-
const rootPackageJsonPath = path18.join(monorepoRoot, "package.json");
|
|
18107
|
-
if (fs22.existsSync(rootPackageJsonPath)) {
|
|
18108
|
-
const rootPackageJson = JSON.parse(fs22.readFileSync(rootPackageJsonPath, "utf-8"));
|
|
18109
|
-
if (rootPackageJson.workspaces) {
|
|
18110
|
-
execSync11("npm run build --workspace=@semiont/core --if-present", {
|
|
18111
|
-
cwd: monorepoRoot,
|
|
18112
|
-
stdio: service.verbose ? "inherit" : "pipe"
|
|
18113
|
-
});
|
|
18114
|
-
execSync11("npm run build --workspace=@semiont/event-sourcing --if-present", {
|
|
18115
|
-
cwd: monorepoRoot,
|
|
18116
|
-
stdio: service.verbose ? "inherit" : "pipe"
|
|
18117
|
-
});
|
|
18118
|
-
execSync11("npm run build --workspace=@semiont/api-client --if-present", {
|
|
18119
|
-
cwd: monorepoRoot,
|
|
18120
|
-
stdio: service.verbose ? "inherit" : "pipe"
|
|
18121
|
-
});
|
|
18122
|
-
if (!service.quiet) {
|
|
18123
|
-
printSuccess("Workspace dependencies built successfully");
|
|
18124
|
-
}
|
|
18125
|
-
}
|
|
18126
|
-
}
|
|
18127
|
-
} catch (error46) {
|
|
18128
|
-
printWarning(`Failed to build workspace dependencies: ${error46}`);
|
|
18129
|
-
printInfo("You may need to build manually: npm run build --workspace=@semiont/core");
|
|
18130
|
-
}
|
|
18131
|
-
if (!service.quiet) {
|
|
18132
|
-
printInfo("Building backend application...");
|
|
18133
|
-
}
|
|
18134
|
-
try {
|
|
18135
|
-
execSync11("npm run build", {
|
|
18136
|
-
cwd: backendSourceDir,
|
|
18137
|
-
stdio: service.verbose ? "inherit" : "pipe"
|
|
18138
|
-
});
|
|
18139
|
-
if (!service.quiet) {
|
|
18140
|
-
printSuccess("Backend application built successfully");
|
|
18201
|
+
printError(`Failed to build backend application: ${error46}`);
|
|
18202
|
+
return {
|
|
18203
|
+
success: false,
|
|
18204
|
+
error: `Failed to build backend application: ${error46}`,
|
|
18205
|
+
metadata: { serviceType: "backend", backendSourceDir }
|
|
18206
|
+
};
|
|
18141
18207
|
}
|
|
18142
|
-
} catch (error46) {
|
|
18143
|
-
printError(`Failed to build backend application: ${error46}`);
|
|
18144
|
-
return {
|
|
18145
|
-
success: false,
|
|
18146
|
-
error: `Failed to build backend application: ${error46}`,
|
|
18147
|
-
metadata: { serviceType: "backend", backendSourceDir }
|
|
18148
|
-
};
|
|
18149
18208
|
}
|
|
18150
18209
|
if (options.migrate !== false && fs22.existsSync(prismaSchemaPath)) {
|
|
18151
18210
|
if (!service.quiet) {
|
|
@@ -18246,14 +18305,13 @@ ${backendSourceDir}
|
|
|
18246
18305
|
};
|
|
18247
18306
|
preflightBackendProvision = async (context) => {
|
|
18248
18307
|
const paths = getBackendPaths(context);
|
|
18249
|
-
const checks = [
|
|
18308
|
+
const checks = paths.fromNpmPackage ? [
|
|
18309
|
+
checkFileExists(path18.join(paths.sourceDir, "dist", "index.js"), "backend dist/index.js")
|
|
18310
|
+
] : [
|
|
18250
18311
|
checkCommandAvailable("npm"),
|
|
18251
18312
|
checkCommandAvailable("npx"),
|
|
18252
18313
|
checkFileExists(path18.join(paths.sourceDir, "package.json"), "backend package.json")
|
|
18253
18314
|
];
|
|
18254
|
-
if (!context.options?.semiontRepo) {
|
|
18255
|
-
checks.push({ name: "semiontRepo", pass: false, message: "semiontRepo is required (use --semiont-repo or set SEMIONT_REPO)" });
|
|
18256
|
-
}
|
|
18257
18315
|
return preflightFromChecks(checks);
|
|
18258
18316
|
};
|
|
18259
18317
|
backendProvisionDescriptor = {
|
|
@@ -18291,7 +18349,11 @@ var init_frontend_provision = __esm({
|
|
|
18291
18349
|
}
|
|
18292
18350
|
if (!service.quiet) {
|
|
18293
18351
|
printInfo(`Provisioning frontend service ${service.name}...`);
|
|
18294
|
-
|
|
18352
|
+
if (paths.fromNpmPackage) {
|
|
18353
|
+
printInfo(`Using installed npm package: ${frontendSourceDir}`);
|
|
18354
|
+
} else {
|
|
18355
|
+
printInfo(`Using source directory: ${frontendSourceDir}`);
|
|
18356
|
+
}
|
|
18295
18357
|
}
|
|
18296
18358
|
fs23.mkdirSync(logsDir, { recursive: true });
|
|
18297
18359
|
fs23.mkdirSync(tmpDir, { recursive: true });
|
|
@@ -18416,90 +18478,96 @@ NEXT_PUBLIC_OAUTH_ALLOWED_DOMAINS=${oauthAllowedDomains.join(",")}
|
|
|
18416
18478
|
printSuccess(`Generated secure NEXTAUTH_SECRET (32 bytes)`);
|
|
18417
18479
|
}
|
|
18418
18480
|
}
|
|
18419
|
-
if (
|
|
18420
|
-
|
|
18421
|
-
|
|
18422
|
-
|
|
18423
|
-
|
|
18424
|
-
|
|
18425
|
-
|
|
18426
|
-
|
|
18427
|
-
|
|
18428
|
-
|
|
18429
|
-
|
|
18430
|
-
|
|
18431
|
-
|
|
18481
|
+
if (paths.fromNpmPackage) {
|
|
18482
|
+
if (!service.quiet) {
|
|
18483
|
+
printInfo("Using pre-built npm package \u2014 skipping install, build, and workspace steps");
|
|
18484
|
+
}
|
|
18485
|
+
} else {
|
|
18486
|
+
if (!service.quiet) {
|
|
18487
|
+
printInfo("Installing npm dependencies...");
|
|
18488
|
+
}
|
|
18489
|
+
try {
|
|
18490
|
+
const monorepoRoot = path19.dirname(path19.dirname(frontendSourceDir));
|
|
18491
|
+
const rootPackageJsonPath = path19.join(monorepoRoot, "package.json");
|
|
18492
|
+
if (fs23.existsSync(rootPackageJsonPath)) {
|
|
18493
|
+
const rootPackageJson = JSON.parse(fs23.readFileSync(rootPackageJsonPath, "utf-8"));
|
|
18494
|
+
if (rootPackageJson.workspaces) {
|
|
18495
|
+
execSync12("npm install", {
|
|
18496
|
+
cwd: monorepoRoot,
|
|
18497
|
+
stdio: service.verbose ? "inherit" : "pipe"
|
|
18498
|
+
});
|
|
18499
|
+
} else {
|
|
18500
|
+
execSync12("npm install", {
|
|
18501
|
+
cwd: frontendSourceDir,
|
|
18502
|
+
stdio: service.verbose ? "inherit" : "pipe"
|
|
18503
|
+
});
|
|
18504
|
+
}
|
|
18432
18505
|
} else {
|
|
18433
18506
|
execSync12("npm install", {
|
|
18434
18507
|
cwd: frontendSourceDir,
|
|
18435
18508
|
stdio: service.verbose ? "inherit" : "pipe"
|
|
18436
18509
|
});
|
|
18437
18510
|
}
|
|
18438
|
-
|
|
18439
|
-
|
|
18440
|
-
cwd: frontendSourceDir,
|
|
18441
|
-
stdio: service.verbose ? "inherit" : "pipe"
|
|
18442
|
-
});
|
|
18443
|
-
}
|
|
18444
|
-
if (!service.quiet) {
|
|
18445
|
-
printSuccess("Dependencies installed successfully");
|
|
18446
|
-
}
|
|
18447
|
-
} catch (error46) {
|
|
18448
|
-
printError(`Failed to install dependencies: ${error46}`);
|
|
18449
|
-
return {
|
|
18450
|
-
success: false,
|
|
18451
|
-
error: `Failed to install dependencies: ${error46}`,
|
|
18452
|
-
metadata: { serviceType: "frontend", frontendSourceDir }
|
|
18453
|
-
};
|
|
18454
|
-
}
|
|
18455
|
-
if (!service.quiet) {
|
|
18456
|
-
printInfo("Building workspace dependencies...");
|
|
18457
|
-
}
|
|
18458
|
-
try {
|
|
18459
|
-
const monorepoRoot = path19.dirname(path19.dirname(frontendSourceDir));
|
|
18460
|
-
const rootPackageJsonPath = path19.join(monorepoRoot, "package.json");
|
|
18461
|
-
if (fs23.existsSync(rootPackageJsonPath)) {
|
|
18462
|
-
const rootPackageJson = JSON.parse(fs23.readFileSync(rootPackageJsonPath, "utf-8"));
|
|
18463
|
-
if (rootPackageJson.workspaces) {
|
|
18464
|
-
execSync12("npm run build --workspace=@semiont/react-ui --if-present", {
|
|
18465
|
-
cwd: monorepoRoot,
|
|
18466
|
-
stdio: service.verbose ? "inherit" : "pipe"
|
|
18467
|
-
});
|
|
18468
|
-
if (!service.quiet) {
|
|
18469
|
-
printSuccess("Workspace dependencies built successfully");
|
|
18470
|
-
}
|
|
18511
|
+
if (!service.quiet) {
|
|
18512
|
+
printSuccess("Dependencies installed successfully");
|
|
18471
18513
|
}
|
|
18514
|
+
} catch (error46) {
|
|
18515
|
+
printError(`Failed to install dependencies: ${error46}`);
|
|
18516
|
+
return {
|
|
18517
|
+
success: false,
|
|
18518
|
+
error: `Failed to install dependencies: ${error46}`,
|
|
18519
|
+
metadata: { serviceType: "frontend", frontendSourceDir }
|
|
18520
|
+
};
|
|
18472
18521
|
}
|
|
18473
|
-
} catch (error46) {
|
|
18474
|
-
printWarning(`Failed to build workspace dependencies: ${error46}`);
|
|
18475
|
-
printInfo("You may need to build manually: npm run build --workspace=@semiont/react-ui");
|
|
18476
|
-
}
|
|
18477
|
-
if (service.environment === "prod") {
|
|
18478
18522
|
if (!service.quiet) {
|
|
18479
|
-
printInfo("Building
|
|
18523
|
+
printInfo("Building workspace dependencies...");
|
|
18480
18524
|
}
|
|
18481
18525
|
try {
|
|
18482
|
-
const
|
|
18483
|
-
|
|
18484
|
-
|
|
18485
|
-
|
|
18486
|
-
|
|
18487
|
-
|
|
18488
|
-
|
|
18526
|
+
const monorepoRoot = path19.dirname(path19.dirname(frontendSourceDir));
|
|
18527
|
+
const rootPackageJsonPath = path19.join(monorepoRoot, "package.json");
|
|
18528
|
+
if (fs23.existsSync(rootPackageJsonPath)) {
|
|
18529
|
+
const rootPackageJson = JSON.parse(fs23.readFileSync(rootPackageJsonPath, "utf-8"));
|
|
18530
|
+
if (rootPackageJson.workspaces) {
|
|
18531
|
+
execSync12("npm run build --workspace=@semiont/react-ui --if-present", {
|
|
18532
|
+
cwd: monorepoRoot,
|
|
18533
|
+
stdio: service.verbose ? "inherit" : "pipe"
|
|
18534
|
+
});
|
|
18535
|
+
if (!service.quiet) {
|
|
18536
|
+
printSuccess("Workspace dependencies built successfully");
|
|
18489
18537
|
}
|
|
18490
|
-
}
|
|
18538
|
+
}
|
|
18491
18539
|
}
|
|
18492
|
-
|
|
18493
|
-
|
|
18494
|
-
|
|
18495
|
-
|
|
18496
|
-
|
|
18540
|
+
} catch (error46) {
|
|
18541
|
+
printWarning(`Failed to build workspace dependencies: ${error46}`);
|
|
18542
|
+
printInfo("You may need to build manually: npm run build --workspace=@semiont/react-ui");
|
|
18543
|
+
}
|
|
18544
|
+
if (service.environment === "prod") {
|
|
18497
18545
|
if (!service.quiet) {
|
|
18498
|
-
|
|
18546
|
+
printInfo("Building frontend for production...");
|
|
18547
|
+
}
|
|
18548
|
+
try {
|
|
18549
|
+
const envVars = {};
|
|
18550
|
+
if (fs23.existsSync(envFile)) {
|
|
18551
|
+
const envContent = fs23.readFileSync(envFile, "utf-8");
|
|
18552
|
+
envContent.split("\n").forEach((line) => {
|
|
18553
|
+
if (!line.startsWith("#") && line.includes("=")) {
|
|
18554
|
+
const [key, ...valueParts] = line.split("=");
|
|
18555
|
+
envVars[key.trim()] = valueParts.join("=").trim();
|
|
18556
|
+
}
|
|
18557
|
+
});
|
|
18558
|
+
}
|
|
18559
|
+
execSync12("npm run build", {
|
|
18560
|
+
cwd: frontendSourceDir,
|
|
18561
|
+
env: { ...process.env, ...envVars },
|
|
18562
|
+
stdio: service.verbose ? "inherit" : "pipe"
|
|
18563
|
+
});
|
|
18564
|
+
if (!service.quiet) {
|
|
18565
|
+
printSuccess("Frontend built successfully");
|
|
18566
|
+
}
|
|
18567
|
+
} catch (error46) {
|
|
18568
|
+
printWarning(`Failed to build frontend: ${error46}`);
|
|
18569
|
+
printInfo("You may need to build manually: npm run build");
|
|
18499
18570
|
}
|
|
18500
|
-
} catch (error46) {
|
|
18501
|
-
printWarning(`Failed to build frontend: ${error46}`);
|
|
18502
|
-
printInfo("You may need to build manually: npm run build");
|
|
18503
18571
|
}
|
|
18504
18572
|
}
|
|
18505
18573
|
const readmePath = path19.join(frontendSourceDir, "RUNTIME.md");
|
|
@@ -18571,10 +18639,13 @@ ${frontendSourceDir}
|
|
|
18571
18639
|
};
|
|
18572
18640
|
preflightFrontendProvision = async (context) => {
|
|
18573
18641
|
const paths = getFrontendPaths(context);
|
|
18574
|
-
|
|
18642
|
+
const checks = paths.fromNpmPackage ? [
|
|
18643
|
+
checkFileExists(path19.join(paths.sourceDir, "standalone", "apps", "frontend", "server.js"), "frontend standalone server.js")
|
|
18644
|
+
] : [
|
|
18575
18645
|
checkCommandAvailable("npm"),
|
|
18576
18646
|
checkFileExists(path19.join(paths.sourceDir, "package.json"), "frontend package.json")
|
|
18577
|
-
]
|
|
18647
|
+
];
|
|
18648
|
+
return preflightFromChecks(checks);
|
|
18578
18649
|
};
|
|
18579
18650
|
frontendProvisionDescriptor = {
|
|
18580
18651
|
command: "provision",
|
|
@@ -41852,7 +41923,7 @@ import express from "express";
|
|
|
41852
41923
|
import { createServer as createServer4 } from "http";
|
|
41853
41924
|
import { Server as SocketIOServer } from "socket.io";
|
|
41854
41925
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
41855
|
-
import { dirname as
|
|
41926
|
+
import { dirname as dirname11, join as join35 } from "path";
|
|
41856
41927
|
import fs41 from "fs";
|
|
41857
41928
|
var __filename, __dirname, embeddedJS, embeddedCSS, WebDashboardServer;
|
|
41858
41929
|
var init_web_dashboard_server = __esm({
|
|
@@ -41861,7 +41932,7 @@ var init_web_dashboard_server = __esm({
|
|
|
41861
41932
|
init_dashboard_data();
|
|
41862
41933
|
init_embedded_assets();
|
|
41863
41934
|
__filename = fileURLToPath2(import.meta.url);
|
|
41864
|
-
__dirname =
|
|
41935
|
+
__dirname = dirname11(__filename);
|
|
41865
41936
|
embeddedJS = dashboardAssetsEmbedded ? embeddedDashboardJS : void 0;
|
|
41866
41937
|
embeddedCSS = dashboardAssetsEmbedded ? embeddedDashboardCSS : void 0;
|
|
41867
41938
|
WebDashboardServer = class {
|
|
@@ -42312,7 +42383,7 @@ var require_package = __commonJS({
|
|
|
42312
42383
|
"package.json"(exports, module) {
|
|
42313
42384
|
module.exports = {
|
|
42314
42385
|
name: "@semiont/cli",
|
|
42315
|
-
version: "0.2.
|
|
42386
|
+
version: "0.2.37",
|
|
42316
42387
|
description: "Semiont CLI - Unified environment management tool",
|
|
42317
42388
|
_comment: "AWS SDK dependencies (@aws-sdk/*) are only used by platforms/aws",
|
|
42318
42389
|
type: "module",
|
|
@@ -42377,8 +42448,8 @@ var require_package = __commonJS({
|
|
|
42377
42448
|
"@aws-sdk/client-sts": "^3.859.0",
|
|
42378
42449
|
"@aws-sdk/client-wafv2": "^3.859.0",
|
|
42379
42450
|
"@prisma/client": "^6.13.0",
|
|
42380
|
-
"@semiont/api-client": "^0.2.
|
|
42381
|
-
"@semiont/core": "^0.2.
|
|
42451
|
+
"@semiont/api-client": "^0.2.37",
|
|
42452
|
+
"@semiont/core": "^0.2.37",
|
|
42382
42453
|
"@testcontainers/postgresql": "^11.5.1",
|
|
42383
42454
|
arg: "^5.0.2",
|
|
42384
42455
|
argon2: "^0.43.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semiont/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.37",
|
|
4
4
|
"description": "Semiont CLI - Unified environment management tool",
|
|
5
5
|
"_comment": "AWS SDK dependencies (@aws-sdk/*) are only used by platforms/aws",
|
|
6
6
|
"type": "module",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"@aws-sdk/client-sts": "^3.859.0",
|
|
66
66
|
"@aws-sdk/client-wafv2": "^3.859.0",
|
|
67
67
|
"@prisma/client": "^6.13.0",
|
|
68
|
-
"@semiont/api-client": "0.2.
|
|
69
|
-
"@semiont/core": "0.2.
|
|
68
|
+
"@semiont/api-client": "0.2.37",
|
|
69
|
+
"@semiont/core": "0.2.37",
|
|
70
70
|
"@testcontainers/postgresql": "^11.5.1",
|
|
71
71
|
"arg": "^5.0.2",
|
|
72
72
|
"argon2": "^0.43.0",
|