@staff0rd/assist 0.1089.1 → 0.1091.0
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/built-version +1 -1
- package/dist/commands/sessions/web/bundle.js +284 -284
- package/dist/index.js +56 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.1091.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -712,7 +712,9 @@ var runConfigSchema = z3.strictObject({
|
|
|
712
712
|
cwd: z3.string().optional(),
|
|
713
713
|
quiet: z3.boolean().optional(),
|
|
714
714
|
server: z3.union([z3.boolean(), z3.string().min(1)]).optional(),
|
|
715
|
-
port: z3.number().optional()
|
|
715
|
+
port: z3.number().optional(),
|
|
716
|
+
protocol: z3.enum(["http", "https"]).optional(),
|
|
717
|
+
path: z3.string().optional()
|
|
716
718
|
});
|
|
717
719
|
var runLinkSchema = z3.strictObject({
|
|
718
720
|
link: z3.string(),
|
|
@@ -15235,6 +15237,8 @@ function buildRunEntry(name, command, args, options2) {
|
|
|
15235
15237
|
if (options2?.cwd) entry.cwd = options2.cwd;
|
|
15236
15238
|
if (options2?.server !== void 0) entry.server = options2.server;
|
|
15237
15239
|
if (options2?.port !== void 0) entry.port = options2.port;
|
|
15240
|
+
if (options2?.protocol) entry.protocol = options2.protocol;
|
|
15241
|
+
if (options2?.path) entry.path = options2.path;
|
|
15238
15242
|
if (options2?.env) entry.env = options2.env;
|
|
15239
15243
|
if (options2?.pre) entry.pre = options2.pre;
|
|
15240
15244
|
if (options2?.filter) entry.filter = options2.filter;
|
|
@@ -50359,12 +50363,17 @@ function parseParamSpecs(specs) {
|
|
|
50359
50363
|
return specs.map(parseParamSpec);
|
|
50360
50364
|
}
|
|
50361
50365
|
|
|
50362
|
-
// src/commands/run/
|
|
50363
|
-
function
|
|
50364
|
-
|
|
50365
|
-
if (
|
|
50366
|
-
|
|
50366
|
+
// src/commands/run/parseProtocol.ts
|
|
50367
|
+
function parseProtocol(raw) {
|
|
50368
|
+
if (raw === void 0) return void 0;
|
|
50369
|
+
if (raw !== "http" && raw !== "https") {
|
|
50370
|
+
console.error(`--protocol must be http or https, got "${raw}"`);
|
|
50371
|
+
process.exit(1);
|
|
50372
|
+
}
|
|
50373
|
+
return raw;
|
|
50367
50374
|
}
|
|
50375
|
+
|
|
50376
|
+
// src/commands/run/parsePort.ts
|
|
50368
50377
|
function parsePort(raw) {
|
|
50369
50378
|
if (raw === void 0) return void 0;
|
|
50370
50379
|
const port = Number(raw);
|
|
@@ -50374,6 +50383,13 @@ function parsePort(raw) {
|
|
|
50374
50383
|
}
|
|
50375
50384
|
return port;
|
|
50376
50385
|
}
|
|
50386
|
+
|
|
50387
|
+
// src/commands/run/requireParsedArgs.ts
|
|
50388
|
+
function findAddIndex() {
|
|
50389
|
+
const addIndex = process.argv.indexOf("add");
|
|
50390
|
+
if (addIndex === -1 || addIndex + 2 >= process.argv.length) return -1;
|
|
50391
|
+
return addIndex;
|
|
50392
|
+
}
|
|
50377
50393
|
function extractAddArgs(addIndex) {
|
|
50378
50394
|
const rawArgs = process.argv.slice(addIndex + 3);
|
|
50379
50395
|
const env = extractRepeatedOption(rawArgs, "--env");
|
|
@@ -50383,7 +50399,9 @@ function extractAddArgs(addIndex) {
|
|
|
50383
50399
|
const filter = extractOption(quiet.remaining, "--filter");
|
|
50384
50400
|
const cwd = extractOption(filter.remaining, "--cwd");
|
|
50385
50401
|
const port = extractOption(cwd.remaining, "--port");
|
|
50386
|
-
const
|
|
50402
|
+
const protocol = extractOption(port.remaining, "--protocol");
|
|
50403
|
+
const path110 = extractOption(protocol.remaining, "--path");
|
|
50404
|
+
const server = extractOptionalValueFlag(path110.remaining, "--server");
|
|
50387
50405
|
const repo = extractOptionalValueFlag(server.remaining, "--repo");
|
|
50388
50406
|
return {
|
|
50389
50407
|
name: process.argv[addIndex + 1],
|
|
@@ -50393,6 +50411,8 @@ function extractAddArgs(addIndex) {
|
|
|
50393
50411
|
cwd: cwd.value,
|
|
50394
50412
|
server: server.value,
|
|
50395
50413
|
port: parsePort(port.value),
|
|
50414
|
+
protocol: parseProtocol(protocol.value),
|
|
50415
|
+
path: path110.value,
|
|
50396
50416
|
env: parseEnvPairs(env.values),
|
|
50397
50417
|
pre: pre.values.length > 0 ? pre.values : void 0,
|
|
50398
50418
|
filter: filter.value,
|
|
@@ -50477,6 +50497,16 @@ var properties = [
|
|
|
50477
50497
|
],
|
|
50478
50498
|
["server", "--server [group]", "singleton dev server, optionally grouped"],
|
|
50479
50499
|
["port", "--port <port>", "display-only port on the serving card"],
|
|
50500
|
+
[
|
|
50501
|
+
"protocol",
|
|
50502
|
+
"--protocol <http|https>",
|
|
50503
|
+
"protocol of the serving card's port link (default: http)"
|
|
50504
|
+
],
|
|
50505
|
+
[
|
|
50506
|
+
"path",
|
|
50507
|
+
"--path <path>",
|
|
50508
|
+
"path of the serving card's port link, e.g. /swagger (default: /)"
|
|
50509
|
+
],
|
|
50480
50510
|
[
|
|
50481
50511
|
"pre",
|
|
50482
50512
|
"--pre <command>",
|
|
@@ -50529,6 +50559,12 @@ function registerRunAdd(runCommand) {
|
|
|
50529
50559
|
"--server [group]",
|
|
50530
50560
|
"Mark as a singleton dev server, optionally in a named group (default group: default)"
|
|
50531
50561
|
).option("--port <port>", "Display-only port shown on the serving card").option(
|
|
50562
|
+
"--protocol <http|https>",
|
|
50563
|
+
"Protocol for the serving card's port link (default: http)"
|
|
50564
|
+
).option(
|
|
50565
|
+
"--path <path>",
|
|
50566
|
+
"Path for the serving card's port link, e.g. /swagger (default: /)"
|
|
50567
|
+
).option(
|
|
50532
50568
|
"--env <KEY=VALUE>",
|
|
50533
50569
|
"Environment variable for the command (repeatable)"
|
|
50534
50570
|
).option("--pre <command>", "Shell command run first (repeatable)").option(
|
|
@@ -51256,6 +51292,8 @@ function toSessionRunInfo({
|
|
|
51256
51292
|
runArgs,
|
|
51257
51293
|
server,
|
|
51258
51294
|
serverPort,
|
|
51295
|
+
serverProtocol,
|
|
51296
|
+
serverPath,
|
|
51259
51297
|
serverOrigin,
|
|
51260
51298
|
assistArgs,
|
|
51261
51299
|
cwd,
|
|
@@ -51274,6 +51312,8 @@ function toSessionRunInfo({
|
|
|
51274
51312
|
runArgs,
|
|
51275
51313
|
server,
|
|
51276
51314
|
port: serverPort,
|
|
51315
|
+
protocol: serverProtocol,
|
|
51316
|
+
urlPath: serverPath,
|
|
51277
51317
|
remoteOrigin: serverOrigin ?? originForCwd(cwd),
|
|
51278
51318
|
assistArgs,
|
|
51279
51319
|
activity: activity2,
|
|
@@ -52258,6 +52298,8 @@ function serverRunMeta(runName, cwd) {
|
|
|
52258
52298
|
server: true,
|
|
52259
52299
|
group: typeof config.server === "string" ? config.server : DEFAULT_SERVER_GROUP,
|
|
52260
52300
|
port: config.port,
|
|
52301
|
+
protocol: config.protocol,
|
|
52302
|
+
path: config.path,
|
|
52261
52303
|
origin: getCurrentOrigin(dir)
|
|
52262
52304
|
};
|
|
52263
52305
|
}
|
|
@@ -52335,6 +52377,8 @@ function createRunSession(id, { runName, runArgs, cwd, meta }) {
|
|
|
52335
52377
|
cwd,
|
|
52336
52378
|
server: serverMeta.server || void 0,
|
|
52337
52379
|
serverPort: serverMeta.port,
|
|
52380
|
+
serverProtocol: serverMeta.protocol,
|
|
52381
|
+
serverPath: serverMeta.path,
|
|
52338
52382
|
serverOrigin: serverMeta.origin,
|
|
52339
52383
|
serverGroup: serverMeta.group
|
|
52340
52384
|
};
|
|
@@ -56493,6 +56537,8 @@ function restoreServerRun(id, persisted, base) {
|
|
|
56493
56537
|
runArgs: persisted.runArgs,
|
|
56494
56538
|
server: true,
|
|
56495
56539
|
serverPort: meta.port,
|
|
56540
|
+
serverProtocol: meta.protocol,
|
|
56541
|
+
serverPath: meta.path,
|
|
56496
56542
|
serverOrigin: meta.origin,
|
|
56497
56543
|
serverGroup: meta.group
|
|
56498
56544
|
};
|
|
@@ -57012,6 +57058,8 @@ function stopServerSession(sessions, id) {
|
|
|
57012
57058
|
function tagServerSession(session, meta) {
|
|
57013
57059
|
session.server = meta.server || void 0;
|
|
57014
57060
|
session.serverPort = meta.port;
|
|
57061
|
+
session.serverProtocol = meta.protocol;
|
|
57062
|
+
session.serverPath = meta.path;
|
|
57015
57063
|
session.serverOrigin = meta.origin;
|
|
57016
57064
|
session.serverGroup = meta.group;
|
|
57017
57065
|
}
|