@lightward/mechanic-cli 0.1.14 → 0.1.15
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/commands/globals/delete.js +1 -1
- package/dist/commands/globals/set.js +1 -1
- package/dist/commands/secrets/delete.js +1 -1
- package/dist/commands/secrets/set.js +1 -1
- package/dist/commands/shop/deprecations.d.ts.map +1 -1
- package/dist/commands/shop/deprecations.js +1 -0
- package/dist/commands/tasks/bundle.js +1 -1
- package/dist/commands/tasks/diff.js +1 -1
- package/dist/commands/tasks/new.js +1 -1
- package/dist/commands/tasks/open.js +1 -1
- package/dist/commands/tasks/preview.js +1 -1
- package/dist/commands/tasks/publish.js +1 -1
- package/dist/commands/tasks/pull.js +1 -1
- package/dist/commands/tasks/push.js +1 -1
- package/dist/commands/tasks/status.js +1 -1
- package/dist/commands/tasks/unbundle.js +1 -1
- package/dist/commands/tasks/validate.js +1 -1
- package/dist/errors.d.ts +3 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +4 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ export default class GlobalsDelete extends BaseCommand {
|
|
|
9
9
|
"$ mechanic globals delete warehouse_id --force",
|
|
10
10
|
];
|
|
11
11
|
static args = {
|
|
12
|
-
key: Args.string({ required: true, description: "Global key, using lower snake-case." }),
|
|
12
|
+
key: Args.string({ ignoreStdin: true, required: true, description: "Global key, using lower snake-case." }),
|
|
13
13
|
};
|
|
14
14
|
static flags = {
|
|
15
15
|
force: Flags.boolean({
|
|
@@ -11,7 +11,7 @@ export default class GlobalsSet extends BaseCommand {
|
|
|
11
11
|
"$ mechanic globals set reorder_threshold --json 5",
|
|
12
12
|
];
|
|
13
13
|
static args = {
|
|
14
|
-
key: Args.string({ required: true, description: "Global key, using lower snake-case." }),
|
|
14
|
+
key: Args.string({ ignoreStdin: true, required: true, description: "Global key, using lower snake-case." }),
|
|
15
15
|
};
|
|
16
16
|
static flags = {
|
|
17
17
|
json: Flags.string({
|
|
@@ -9,7 +9,7 @@ export default class SecretsDelete extends BaseCommand {
|
|
|
9
9
|
"$ mechanic secrets delete api_token --force",
|
|
10
10
|
];
|
|
11
11
|
static args = {
|
|
12
|
-
key: Args.string({ required: true, description: "Secret key, using lower snake-case." }),
|
|
12
|
+
key: Args.string({ ignoreStdin: true, required: true, description: "Secret key, using lower snake-case." }),
|
|
13
13
|
};
|
|
14
14
|
static flags = {
|
|
15
15
|
force: Flags.boolean({
|
|
@@ -32,7 +32,7 @@ export default class SecretsSet extends BaseCommand {
|
|
|
32
32
|
"$ mechanic secrets set api_token --value-env API_TOKEN --force",
|
|
33
33
|
];
|
|
34
34
|
static args = {
|
|
35
|
-
key: Args.string({ required: true, description: "Secret key, using lower snake-case." }),
|
|
35
|
+
key: Args.string({ ignoreStdin: true, required: true, description: "Secret key, using lower snake-case." }),
|
|
36
36
|
};
|
|
37
37
|
static flags = {
|
|
38
38
|
"from-stdin": Flags.boolean({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecations.d.ts","sourceRoot":"","sources":["../../../src/commands/shop/deprecations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,KAAK,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAExE,KAAK,eAAe,GAAG,wBAAwB,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAUxE,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACvD,OAAgB,OAAO,SAA6D;IACpF,OAAgB,WAAW,SAAqH;IAEhJ,OAAgB,IAAI;;
|
|
1
|
+
{"version":3,"file":"deprecations.d.ts","sourceRoot":"","sources":["../../../src/commands/shop/deprecations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,KAAK,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAExE,KAAK,eAAe,GAAG,wBAAwB,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAUxE,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACvD,OAAgB,OAAO,SAA6D;IACpF,OAAgB,WAAW,SAAqH;IAEhJ,OAAgB,IAAI;;MAMlB;IAEF,OAAgB,KAAK;;MAInB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAyCpB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAUzE,iBAAiB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,MAAM,EAAE,EAAE;IAcjE,uBAAuB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,MAAM;IAOnE,cAAc,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM;CAcrD"}
|
|
@@ -13,6 +13,7 @@ export default class ShopDeprecations extends BaseCommand {
|
|
|
13
13
|
static description = "Show unresolved Shopify API deprecations reported by this shop's tasks, optionally filtered to one linked task.";
|
|
14
14
|
static args = {
|
|
15
15
|
task: Args.string({
|
|
16
|
+
ignoreStdin: true,
|
|
16
17
|
description: "Optional task selector, linked task ID, local slug, task JSON file, or helper directory.",
|
|
17
18
|
required: false,
|
|
18
19
|
}),
|
|
@@ -25,7 +25,7 @@ export default class TasksBundle extends BaseCommand {
|
|
|
25
25
|
"$ mechanic tasks bundle order-tagger --out tasks/order-tagger.json",
|
|
26
26
|
];
|
|
27
27
|
static args = {
|
|
28
|
-
dir: Args.string({ required: false, description: "Local task slug, helper task directory, or matching task JSON file." }),
|
|
28
|
+
dir: Args.string({ ignoreStdin: true, required: false, description: "Local task slug, helper task directory, or matching task JSON file." }),
|
|
29
29
|
};
|
|
30
30
|
static flags = {
|
|
31
31
|
json: Flags.boolean({
|
|
@@ -6,7 +6,7 @@ export default class TasksDiff extends BaseCommand {
|
|
|
6
6
|
static summary = "Diff one task, or use --all to diff every local task.";
|
|
7
7
|
static description = "Compare one local task with its linked remote task, or use --all to compare every local task JSON file.";
|
|
8
8
|
static args = {
|
|
9
|
-
file: Args.string({ required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
|
|
9
|
+
file: Args.string({ ignoreStdin: true, required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
|
|
10
10
|
};
|
|
11
11
|
static flags = {
|
|
12
12
|
all: Flags.boolean({ description: "Diff every task JSON file in this project." }),
|
|
@@ -43,7 +43,7 @@ export default class TasksNew extends BaseCommand {
|
|
|
43
43
|
"$ mechanic tasks new \"Order tagger\"",
|
|
44
44
|
];
|
|
45
45
|
static args = {
|
|
46
|
-
name: Args.string({ required: true, description: "Task name or slug for the new local task." }),
|
|
46
|
+
name: Args.string({ ignoreStdin: true, required: true, description: "Task name or slug for the new local task." }),
|
|
47
47
|
};
|
|
48
48
|
static flags = {
|
|
49
49
|
force: Flags.boolean({ description: "Overwrite the local starter task JSON file and helper directory files." }),
|
|
@@ -17,7 +17,7 @@ export default class TasksOpen extends BaseCommand {
|
|
|
17
17
|
static summary = "Open a remote task in Mechanic.";
|
|
18
18
|
static description = "Open a remote Mechanic task by local task slug, task ID, linked local task JSON file, or helper directory.";
|
|
19
19
|
static args = {
|
|
20
|
-
target: Args.string({ required: true, description: "Local task slug, remote task ID, linked local task JSON file, or helper directory." }),
|
|
20
|
+
target: Args.string({ ignoreStdin: true, required: true, description: "Local task slug, remote task ID, linked local task JSON file, or helper directory." }),
|
|
21
21
|
};
|
|
22
22
|
async taskIdForTarget(project, target) {
|
|
23
23
|
const selector = await resolveTaskSelector(project, target, {
|
|
@@ -39,7 +39,7 @@ export default class TasksPreview extends BaseCommand {
|
|
|
39
39
|
"$ generate-task | mechanic tasks preview --stdin --json",
|
|
40
40
|
];
|
|
41
41
|
static args = {
|
|
42
|
-
target: Args.string({ description: "Local task slug, task file, helper directory, or linked task ID. Optional with --stdin." }),
|
|
42
|
+
target: Args.string({ ignoreStdin: true, description: "Local task slug, task file, helper directory, or linked task ID. Optional with --stdin." }),
|
|
43
43
|
};
|
|
44
44
|
static flags = {
|
|
45
45
|
json: Flags.boolean({ description: "Print the raw preview response as JSON for agents or CI." }),
|
|
@@ -5,7 +5,7 @@ export default class TasksPublish extends TasksPush {
|
|
|
5
5
|
static summary = "Publish one local task to Mechanic.";
|
|
6
6
|
static description = "Publish one local task to Mechanic, or use --all to publish every local task JSON file.";
|
|
7
7
|
static args = {
|
|
8
|
-
file: Args.string({ required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
|
|
8
|
+
file: Args.string({ ignoreStdin: true, required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
|
|
9
9
|
};
|
|
10
10
|
static flags = {
|
|
11
11
|
all: Flags.boolean({ description: "Publish every task JSON file in this project." }),
|
|
@@ -11,7 +11,7 @@ export default class TasksPull extends BaseCommand {
|
|
|
11
11
|
static summary = "Pull remote tasks into local task JSON files.";
|
|
12
12
|
static description = "Pull every remote task into local canonical task JSON files, or pass a task ID, linked file, or linked slug to pull one task.";
|
|
13
13
|
static args = {
|
|
14
|
-
task: Args.string({ required: false, description: "Local task slug, remote task ID, or linked local task JSON file." }),
|
|
14
|
+
task: Args.string({ ignoreStdin: true, required: false, description: "Local task slug, remote task ID, or linked local task JSON file." }),
|
|
15
15
|
};
|
|
16
16
|
static flags = {
|
|
17
17
|
all: Flags.boolean({ description: "Pull every remote task for this shop. This is the default when no task ID is passed." }),
|
|
@@ -42,7 +42,7 @@ export default class TasksPush extends BaseCommand {
|
|
|
42
42
|
static summary = "Publish one local task, or use --all to publish every local task.";
|
|
43
43
|
static description = "Publish one local task to Mechanic, or use --all to publish every local task JSON file in this project.";
|
|
44
44
|
static args = {
|
|
45
|
-
file: Args.string({ required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
|
|
45
|
+
file: Args.string({ ignoreStdin: true, required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
|
|
46
46
|
};
|
|
47
47
|
static flags = {
|
|
48
48
|
all: Flags.boolean({ description: "Publish every task JSON file in this project." }),
|
|
@@ -27,7 +27,7 @@ export default class TasksStatus extends BaseCommand {
|
|
|
27
27
|
static summary = "Show whether local task files are ready and in sync with Mechanic.";
|
|
28
28
|
static description = `Show whether local task files are linked, ready to publish, and in sync with their remote Mechanic tasks. Repo-wide status checks remote state for up to ${IMPLICIT_REMOTE_CHECK_LIMIT} tasks; larger projects show local status only. Use --local to skip remote checks.`;
|
|
29
29
|
static args = {
|
|
30
|
-
file: Args.string({ required: false, description: "Local task slug, task file, helper directory, or linked task ID. Defaults to every task JSON file." }),
|
|
30
|
+
file: Args.string({ ignoreStdin: true, required: false, description: "Local task slug, task file, helper directory, or linked task ID. Defaults to every task JSON file." }),
|
|
31
31
|
};
|
|
32
32
|
static flags = {
|
|
33
33
|
json: Flags.boolean({
|
|
@@ -14,7 +14,7 @@ export default class TasksUnbundle extends BaseCommand {
|
|
|
14
14
|
"$ mechanic tasks unbundle order-tagger --out helpers/order-tagger",
|
|
15
15
|
];
|
|
16
16
|
static args = {
|
|
17
|
-
file: Args.string({ required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
|
|
17
|
+
file: Args.string({ ignoreStdin: true, required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
|
|
18
18
|
};
|
|
19
19
|
static flags = {
|
|
20
20
|
json: Flags.boolean({
|
|
@@ -15,7 +15,7 @@ export default class TasksValidate extends BaseCommand {
|
|
|
15
15
|
static summary = "Validate one local task or directory of task JSON files.";
|
|
16
16
|
static description = "Validate one local task slug, canonical task JSON file, helper task directory, or directory of task JSON files.";
|
|
17
17
|
static args = {
|
|
18
|
-
target: Args.string({ required: true, description: "Local task slug, task JSON file, helper dir, or directory of task JSON files." }),
|
|
18
|
+
target: Args.string({ ignoreStdin: true, required: true, description: "Local task slug, task JSON file, helper dir, or directory of task JSON files." }),
|
|
19
19
|
};
|
|
20
20
|
static flags = {
|
|
21
21
|
json: Flags.boolean({
|
package/dist/errors.d.ts
CHANGED
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;gBAErB,OAAO,EAAE,MAAM,EAAE,QAAQ,SAAI;CAQ1C;AAED,qBAAa,SAAU,SAAQ,QAAQ;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;gBAExB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,MAAM;CAOvF;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAanD"}
|
package/dist/errors.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export class CliError extends Error {
|
|
2
2
|
exitCode;
|
|
3
|
+
oclif;
|
|
3
4
|
constructor(message, exitCode = 1) {
|
|
4
5
|
super(message);
|
|
5
6
|
this.name = "Error";
|
|
6
7
|
this.exitCode = exitCode;
|
|
8
|
+
// oclif's top-level error handler exits with `error.oclif.exit ?? 1`, so
|
|
9
|
+
// exitCode alone does not survive to the real process exit status.
|
|
10
|
+
this.oclif = { exit: exitCode };
|
|
7
11
|
}
|
|
8
12
|
}
|
|
9
13
|
export class HttpError extends CliError {
|