@cad0p/pi-steering 0.1.0 → 0.2.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/CHANGELOG.md +27 -4
- package/README.md +20 -6
- package/dist/__test-helpers__.d.ts +5 -4
- package/dist/__test-helpers__.d.ts.map +1 -1
- package/dist/__test-helpers__.js +5 -4
- package/dist/__test-helpers__.js.map +1 -1
- package/dist/bin/pi-steering.d.ts.map +1 -1
- package/dist/bin/pi-steering.js +22 -16
- package/dist/bin/pi-steering.js.map +1 -1
- package/dist/evaluator.d.ts +0 -41
- package/dist/evaluator.d.ts.map +1 -1
- package/dist/evaluator.js +42 -1
- package/dist/evaluator.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/ref-text.d.ts.map +1 -1
- package/dist/internal/ref-text.js +1 -1
- package/dist/internal/ref-text.js.map +1 -1
- package/dist/internal/session-runtime.d.ts.map +1 -1
- package/dist/internal/session-runtime.js +3 -2
- package/dist/internal/session-runtime.js.map +1 -1
- package/dist/loader.d.ts +23 -18
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +91 -87
- package/dist/loader.js.map +1 -1
- package/dist/plugins/git/cwd-extensions.d.ts.map +1 -1
- package/dist/plugins/git/cwd-extensions.js.map +1 -1
- package/dist/schema.d.ts +4 -4
- package/dist/testing/index.d.ts +4 -5
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +4 -4
- package/dist/testing/index.js.map +1 -1
- package/examples/README.md +3 -3
- package/examples/combined-git-discipline/README.md +2 -2
- package/examples/combined-git-discipline/node_modules/.bin/pi-steering +16 -4
- package/examples/combined-git-discipline/package.json +16 -16
- package/examples/draft-prs-only/README.md +2 -2
- package/examples/draft-prs-only/node_modules/.bin/pi-steering +16 -4
- package/examples/draft-prs-only/package.json +16 -16
- package/examples/dynamic-reason-runtime-cwd/node_modules/.bin/pi-steering +16 -4
- package/examples/dynamic-reason-runtime-cwd/package.json +16 -16
- package/examples/dynamic-reason-runtime-cwd/steering.ts +5 -1
- package/examples/force-push-strict/README.md +1 -1
- package/examples/force-push-strict/node_modules/.bin/pi-steering +16 -4
- package/examples/force-push-strict/package.json +16 -16
- package/examples/no-amend/README.md +2 -2
- package/examples/no-amend/node_modules/.bin/pi-steering +16 -4
- package/examples/no-amend/package.json +16 -16
- package/examples/work-item-plugin/node_modules/.bin/pi-steering +16 -4
- package/examples/work-item-plugin/package.json +17 -17
- package/examples/work-item-plugin/src/observers/npm-test-tracker.ts +5 -1
- package/examples/work-item-plugin/src/observers/retest-required-tracker.ts +5 -1
- package/examples/work-item-plugin/src/rules/commit-requires-work-item.test.ts +5 -1
- package/package.json +2 -2
- package/src/__test-helpers__.ts +5 -4
- package/src/bin/pi-steering.test.ts +14 -4
- package/src/bin/pi-steering.ts +22 -16
- package/src/evaluator.ts +6 -6
- package/src/factory-time-load.test.ts +24 -18
- package/src/index.test.ts +4 -4
- package/src/index.ts +1 -1
- package/src/internal/ref-text.ts +5 -1
- package/src/internal/session-runtime.test.ts +2 -2
- package/src/internal/session-runtime.ts +3 -2
- package/src/loader.test.ts +226 -74
- package/src/loader.ts +99 -82
- package/src/plugins/git/cwd-extensions.ts +1 -1
- package/src/schema.ts +4 -4
- package/src/testing/index.ts +7 -7
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
*/
|
|
83
83
|
|
|
84
84
|
import * as path from "node:path";
|
|
85
|
-
import type { Word } from "unbash";
|
|
86
85
|
import { isStaticallyResolvable, type Modifier } from "@cad0p/unbash-walker";
|
|
86
|
+
import type { Word } from "unbash";
|
|
87
87
|
|
|
88
88
|
/** Regex matched against each `git`-command argument token. */
|
|
89
89
|
const GIT_DIR_RE = /^--git-dir=(.+)$/;
|
package/src/schema.ts
CHANGED
|
@@ -1631,8 +1631,8 @@ export interface SteeringConfig {
|
|
|
1631
1631
|
* specify its own. Defaults to `true` (fail-closed - overrides
|
|
1632
1632
|
* must be explicit opt-in per rule).
|
|
1633
1633
|
*
|
|
1634
|
-
*
|
|
1635
|
-
* leaves the running value alone.
|
|
1634
|
+
* Layer merge: inner (project) layer wins when specified; missing
|
|
1635
|
+
* layer leaves the running value alone.
|
|
1636
1636
|
*
|
|
1637
1637
|
* `buildConfig` preserves `undefined` in the merged output so
|
|
1638
1638
|
* downstream evaluators can distinguish "user didn't specify" from
|
|
@@ -1698,7 +1698,7 @@ export interface SteeringConfig {
|
|
|
1698
1698
|
* to distinguish shape at a glance from the past-participle
|
|
1699
1699
|
* {@link disabledRules} / {@link disabledPlugins} lists.
|
|
1700
1700
|
*
|
|
1701
|
-
*
|
|
1701
|
+
* Layer merge: inner (project) layer wins when specified.
|
|
1702
1702
|
*/
|
|
1703
1703
|
disableDefaults?: boolean;
|
|
1704
1704
|
|
|
@@ -1714,7 +1714,7 @@ export interface SteeringConfig {
|
|
|
1714
1714
|
* (e.g. tracker name collision, reserved name violation) — the
|
|
1715
1715
|
* engine cannot operate safely with those issues present.
|
|
1716
1716
|
*
|
|
1717
|
-
*
|
|
1717
|
+
* Layer merge: inner (project) layer wins when specified, identical to
|
|
1718
1718
|
* {@link disableDefaults}.
|
|
1719
1719
|
*
|
|
1720
1720
|
* Prior art: Rollup's `failAfterWarnings`, Maven's `failOnWarning`.
|
package/src/testing/index.ts
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
*
|
|
13
13
|
* - {@link loadHarness} — build an evaluator + dispatcher
|
|
14
14
|
* pair from a static
|
|
15
|
-
* {@link SteeringConfig}. No
|
|
16
|
-
*
|
|
17
|
-
* config.
|
|
15
|
+
* {@link SteeringConfig}. No
|
|
16
|
+
* filesystem discovery — tests
|
|
17
|
+
* pass explicit config.
|
|
18
18
|
* - {@link mockContext} — build a {@link PredicateContext}
|
|
19
19
|
* for unit-testing predicate
|
|
20
20
|
* handlers in isolation.
|
|
@@ -246,16 +246,16 @@ export interface LoadHarnessOptions {
|
|
|
246
246
|
/**
|
|
247
247
|
* Build an evaluator + observer dispatcher pair from a static
|
|
248
248
|
* {@link SteeringConfig}. Tests drive rules through the same pipeline
|
|
249
|
-
* production uses, without
|
|
250
|
-
* loading.
|
|
249
|
+
* production uses, without filesystem discovery.
|
|
251
250
|
*/
|
|
252
251
|
export function loadHarness(options: LoadHarnessOptions): Harness {
|
|
253
252
|
const inputConfig = options.config;
|
|
254
253
|
const includeDefaults = options.includeDefaults ?? false;
|
|
255
254
|
|
|
256
255
|
// Run the same merge that production does (single layer here, since
|
|
257
|
-
// loadHarness operates on an in-memory config rather than a
|
|
258
|
-
// chain). The shared helper short-circuits
|
|
256
|
+
// loadHarness operates on an in-memory config rather than a
|
|
257
|
+
// filesystem discovery chain). The shared helper short-circuits
|
|
258
|
+
// between buildConfig and
|
|
259
259
|
// resolvePlugins on error-class merge diagnostics so a
|
|
260
260
|
// `tracker-name-collision` flagged by `buildConfig` is not also
|
|
261
261
|
// re-flagged by `resolvePlugins`. The diagnostics surface within-
|