@deftai/directive 0.83.0 → 0.84.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/check.d.ts +1 -0
- package/dist/check.js +6 -5
- package/dist/cli-router/route-argv.js +1 -0
- package/dist/hook-dispatch.js +2 -4
- package/package.json +3 -3
package/dist/check.d.ts
CHANGED
package/dist/check.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* check.ts -- CLI wrapper for the context-aware `task check` orchestrator (#1854).
|
|
3
|
+
* check.ts -- CLI wrapper for the context-aware `task check` orchestrator (#1854, #1713).
|
|
4
4
|
*
|
|
5
|
-
* Usage: deft-ts check --framework-root <path> --project-root <path>
|
|
6
|
-
*
|
|
7
|
-
* Thin shim: parses args and delegates to dispatchTaskCheck in @deftai/directive-core/check.
|
|
5
|
+
* Usage: deft-ts check --framework-root <path> --project-root <path> [--no-cache]
|
|
8
6
|
*/
|
|
9
7
|
import { fileURLToPath } from "node:url";
|
|
10
8
|
import { dispatchTaskCheck } from "@deftai/directive-core/check";
|
|
@@ -34,6 +32,9 @@ export function parseArgs(argv) {
|
|
|
34
32
|
else if (arg.startsWith("--project-root=")) {
|
|
35
33
|
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
36
34
|
}
|
|
35
|
+
else if (arg === "--no-cache") {
|
|
36
|
+
parsed.noCache = true;
|
|
37
|
+
}
|
|
37
38
|
else {
|
|
38
39
|
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
39
40
|
}
|
|
@@ -50,7 +51,7 @@ export function run(argv) {
|
|
|
50
51
|
process.stderr.write("check: --framework-root and --project-root are required\n");
|
|
51
52
|
return 2;
|
|
52
53
|
}
|
|
53
|
-
return dispatchTaskCheck(args.frameworkRoot, args.projectRoot);
|
|
54
|
+
return dispatchTaskCheck(args.frameworkRoot, args.projectRoot, { noCache: args.noCache });
|
|
54
55
|
}
|
|
55
56
|
/* v8 ignore start -- entry guard */
|
|
56
57
|
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
@@ -68,6 +68,7 @@ export const SUBCOMMAND_ROUTES = {
|
|
|
68
68
|
"cache:invalidate": ["cache", "invalidate"],
|
|
69
69
|
"cache:fetch-all": ["cache", "fetch-all"],
|
|
70
70
|
"cache:prune": ["cache", "prune"],
|
|
71
|
+
"cache:clear": ["cache", "clear"],
|
|
71
72
|
"policy:show": ["policy", "show"],
|
|
72
73
|
"policy:enforce-branches": ["policy", "enforce-branches"],
|
|
73
74
|
"policy:allow-direct-commits": ["policy", "allow-direct-commits"],
|
package/dist/hook-dispatch.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { decideHook, hookPayloadTopLevelKeys, isHookEvent, isHookHost, projectRootFromHookPayload, renderHostDecision, } from "@deftai/directive-core/hooks";
|
|
5
|
+
import { decideHook, hookPayloadTopLevelKeys, isHookEvent, isHookHost, normalizeHookProjectRoot, projectRootFromHookPayload, renderHostDecision, } from "@deftai/directive-core/hooks";
|
|
6
6
|
function takeValue(argv, index, flag) {
|
|
7
7
|
const token = argv[index];
|
|
8
8
|
const prefix = `${flag}=`;
|
|
@@ -122,9 +122,7 @@ export function run(argv, seams = {}) {
|
|
|
122
122
|
const readStdin = seams.readStdin ?? (() => readFileSync(0, "utf8"));
|
|
123
123
|
const cwd = (seams.cwd ?? process.cwd)();
|
|
124
124
|
const { payload, context: payloadContext } = parsePayload(readStdin());
|
|
125
|
-
const projectRoot = args.projectRoot
|
|
126
|
-
? resolve(args.projectRoot)
|
|
127
|
-
: projectRootFromHookPayload(payload, cwd);
|
|
125
|
+
const projectRoot = normalizeHookProjectRoot(args.projectRoot ? resolve(args.projectRoot) : projectRootFromHookPayload(payload, cwd));
|
|
128
126
|
const decision = decideHook({
|
|
129
127
|
host: args.host,
|
|
130
128
|
event: args.event,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.84.0",
|
|
4
4
|
"description": "Directive CLI — npm install path for the Deft Directive framework.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"provenance": true
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@deftai/directive-core": "^0.
|
|
35
|
-
"@deftai/directive-content": "^0.
|
|
34
|
+
"@deftai/directive-core": "^0.84.0",
|
|
35
|
+
"@deftai/directive-content": "^0.84.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsc -b"
|