@refrakt-md/plan 0.14.4 → 0.16.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/cli-plugin.js +1 -1
- package/dist/cli-plugin.js.map +1 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +5 -0
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/plan-behaviors.js +5 -4
- package/dist/commands/plan-behaviors.js.map +1 -1
- package/dist/commands/render-pipeline.d.ts.map +1 -1
- package/dist/commands/render-pipeline.js +40 -9
- package/dist/commands/render-pipeline.js.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +5 -0
- package/dist/commands/serve.js.map +1 -1
- package/dist/filter.d.ts +6 -11
- package/dist/filter.d.ts.map +1 -1
- package/dist/filter.js +7 -65
- package/dist/filter.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/dist/pipeline.d.ts +10 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +279 -441
- package/dist/pipeline.js.map +1 -1
- package/dist/scanner-core.d.ts.map +1 -1
- package/dist/scanner-core.js +10 -2
- package/dist/scanner-core.js.map +1 -1
- package/dist/tags/backlog.d.ts +0 -1
- package/dist/tags/backlog.d.ts.map +1 -1
- package/dist/tags/backlog.js +62 -28
- package/dist/tags/backlog.js.map +1 -1
- package/dist/tags/decision-log.d.ts +0 -1
- package/dist/tags/decision-log.d.ts.map +1 -1
- package/dist/tags/decision-log.js +54 -22
- package/dist/tags/decision-log.js.map +1 -1
- package/dist/tags/plan-activity.d.ts +0 -1
- package/dist/tags/plan-activity.d.ts.map +1 -1
- package/dist/tags/plan-activity.js +49 -18
- package/dist/tags/plan-activity.js.map +1 -1
- package/package.json +8 -8
- package/dist/cards.d.ts +0 -23
- package/dist/cards.d.ts.map +0 -1
- package/dist/cards.js +0 -150
- package/dist/cards.js.map +0 -1
- package/dist/entity-tabs-behavior.d.ts +0 -13
- package/dist/entity-tabs-behavior.d.ts.map +0 -1
- package/dist/entity-tabs-behavior.js +0 -94
- package/dist/entity-tabs-behavior.js.map +0 -1
package/dist/filter.js
CHANGED
|
@@ -1,72 +1,14 @@
|
|
|
1
|
+
import { parseFieldMatch, matchesFieldMatch } from '@refrakt-md/runes';
|
|
1
2
|
/**
|
|
2
|
-
* Parse a filter expression
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Parse a filter expression using the shared field-match grammar (SPEC-070).
|
|
4
|
+
* Same field → OR; different fields → AND. Supports exact / glob / regex,
|
|
5
|
+
* quoted values, and `url`-alias resolution.
|
|
5
6
|
*/
|
|
6
7
|
export function parseFilter(expr) {
|
|
7
|
-
|
|
8
|
-
if (!expr)
|
|
9
|
-
return filter;
|
|
10
|
-
for (const part of expr.split(/\s+/)) {
|
|
11
|
-
const colon = part.indexOf(':');
|
|
12
|
-
if (colon === -1)
|
|
13
|
-
continue;
|
|
14
|
-
const field = part.slice(0, colon);
|
|
15
|
-
if (!field)
|
|
16
|
-
continue;
|
|
17
|
-
const value = part.slice(colon + 1);
|
|
18
|
-
if (!filter[field])
|
|
19
|
-
filter[field] = [];
|
|
20
|
-
filter[field].push(value);
|
|
21
|
-
}
|
|
22
|
-
return filter;
|
|
8
|
+
return parseFieldMatch(expr);
|
|
23
9
|
}
|
|
24
|
-
/** Test whether an entity
|
|
10
|
+
/** Test whether an entity matches all filter conditions (shared matcher). */
|
|
25
11
|
export function matchesFilter(entity, filter) {
|
|
26
|
-
|
|
27
|
-
const entityValue = String(entity.data[field] ?? '');
|
|
28
|
-
// For comma-separated fields like tags, check if any filter value is contained
|
|
29
|
-
if (field === 'tags') {
|
|
30
|
-
const entityTags = entityValue.split(',').map(t => t.trim().toLowerCase());
|
|
31
|
-
if (!values.some(v => entityTags.includes(v.toLowerCase())))
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
if (!values.includes(entityValue))
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
const PRIORITY_ORDER = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
42
|
-
const COMPLEXITY_ORDER = { trivial: 0, simple: 1, moderate: 2, complex: 3, unknown: 4 };
|
|
43
|
-
/** Sort entities by a field. Returns a new sorted array. */
|
|
44
|
-
export function sortEntities(entities, sortField) {
|
|
45
|
-
return [...entities].sort((a, b) => {
|
|
46
|
-
const aVal = String(a.data[sortField] ?? '');
|
|
47
|
-
const bVal = String(b.data[sortField] ?? '');
|
|
48
|
-
if (sortField === 'priority') {
|
|
49
|
-
return (PRIORITY_ORDER[aVal] ?? 99) - (PRIORITY_ORDER[bVal] ?? 99);
|
|
50
|
-
}
|
|
51
|
-
if (sortField === 'complexity') {
|
|
52
|
-
return (COMPLEXITY_ORDER[aVal] ?? 99) - (COMPLEXITY_ORDER[bVal] ?? 99);
|
|
53
|
-
}
|
|
54
|
-
if (sortField === 'date') {
|
|
55
|
-
// Reverse chronological
|
|
56
|
-
return bVal.localeCompare(aVal);
|
|
57
|
-
}
|
|
58
|
-
return aVal.localeCompare(bVal);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/** Group entities by a field. Returns Map preserving insertion order. */
|
|
62
|
-
export function groupEntities(entities, groupField) {
|
|
63
|
-
const groups = new Map();
|
|
64
|
-
for (const entity of entities) {
|
|
65
|
-
const key = String(entity.data[groupField] ?? '') || '(none)';
|
|
66
|
-
if (!groups.has(key))
|
|
67
|
-
groups.set(key, []);
|
|
68
|
-
groups.get(key).push(entity);
|
|
69
|
-
}
|
|
70
|
-
return groups;
|
|
12
|
+
return matchesFieldMatch(entity, filter);
|
|
71
13
|
}
|
|
72
14
|
//# sourceMappingURL=filter.js.map
|
package/dist/filter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../src/filter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../src/filter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAyB,MAAM,mBAAmB,CAAC;AAI9F;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACvC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAAC,MAA0B,EAAE,MAAoB;IAC7E,OAAO,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAchD,eAAO,MAAM,IAAI,EAAE,MAqIlB,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { tabsBehavior } from '@refrakt-md/behaviors';
|
|
2
|
-
import { entityTabsBehavior } from './entity-tabs-behavior.js';
|
|
3
1
|
import { spec } from './tags/spec.js';
|
|
4
2
|
import { work } from './tags/work.js';
|
|
5
3
|
import { bug } from './tags/bug.js';
|
|
@@ -15,7 +13,7 @@ import { planPipelineHooks } from './pipeline.js';
|
|
|
15
13
|
export const plan = {
|
|
16
14
|
name: 'plan',
|
|
17
15
|
displayName: 'Plan',
|
|
18
|
-
version: '0.
|
|
16
|
+
version: '0.16.0',
|
|
19
17
|
runes: {
|
|
20
18
|
'spec': {
|
|
21
19
|
transform: spec,
|
|
@@ -130,12 +128,21 @@ Custom properties cascade naturally without JavaScript.
|
|
|
130
128
|
},
|
|
131
129
|
theme: {
|
|
132
130
|
runes: config,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
// SPEC-072 — dashboard (actionable-first) status order, which diverges
|
|
132
|
+
// from each rune's lifecycle `matches`. priority/severity fall out of
|
|
133
|
+
// `matches` automatically and need no override.
|
|
134
|
+
orderings: {
|
|
135
|
+
work: { status: ['blocked', 'in-progress', 'review', 'ready', 'pending', 'draft', 'done'] },
|
|
136
|
+
bug: { status: ['in-progress', 'confirmed', 'reported', 'fixed', 'wontfix', 'duplicate'] },
|
|
137
|
+
},
|
|
137
138
|
},
|
|
138
139
|
pipeline: planPipelineHooks,
|
|
140
|
+
// File-root opt-in (SPEC-063) is wired dynamically via the plugin's
|
|
141
|
+
// `configure` hook (not as a static `Plugin.fileRoots` declaration).
|
|
142
|
+
// The plan plugin doesn't ship plan content — users have their own
|
|
143
|
+
// `plan.dir` configured in refrakt.config.json — so the namespace needs
|
|
144
|
+
// to point at the user's actual plan directory, not at a path relative
|
|
145
|
+
// to the plugin package. See `planPipelineHooks.configure` in pipeline.ts.
|
|
139
146
|
};
|
|
140
147
|
export default plan;
|
|
141
148
|
export { planPipelineHooks } from './pipeline.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.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BAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/pipeline.d.ts
CHANGED
|
@@ -6,13 +6,22 @@ export type { EntityRelationship } from './relationships.js';
|
|
|
6
6
|
export declare function setScannerDependencies(deps: Map<string, string[]>): void;
|
|
7
7
|
/** Set the plan directory path for the pipeline's aggregate() hook to consume */
|
|
8
8
|
export declare function setPlanDir(dir: string): void;
|
|
9
|
+
/** Set the project root used for `sourceFile` path computation. Mirrors
|
|
10
|
+
* {@link setPlanDir}; the configure hook sets both, CLI paths can set
|
|
11
|
+
* whichever they need. */
|
|
12
|
+
export declare function setProjectRoot(root: string): void;
|
|
9
13
|
export interface PlanAggregatedData {
|
|
10
14
|
workEntities: EntityRegistration[];
|
|
11
15
|
bugEntities: EntityRegistration[];
|
|
12
16
|
decisionEntities: EntityRegistration[];
|
|
13
17
|
specEntities: EntityRegistration[];
|
|
14
18
|
milestoneEntities: EntityRegistration[];
|
|
15
|
-
/** Bidirectional relationship index: entityId →
|
|
19
|
+
/** Bidirectional relationship index: entityId → edges. SPEC-072's
|
|
20
|
+
* `registry.relate()` graph is the authoritative store for rendering
|
|
21
|
+
* (the `relationships` rune queries it via `getRelated()`); this map
|
|
22
|
+
* remains exposed for the legacy `plan build` render-pipeline, which
|
|
23
|
+
* consumes it to mark nav items blocked by unresolved deps. Removable
|
|
24
|
+
* when `plan build` retires (out of scope for v0.16.0). */
|
|
16
25
|
relationships: Map<string, EntityRelationship[]>;
|
|
17
26
|
/** Git-derived history events per entity file path */
|
|
18
27
|
history: Map<string, HistoryEvent[]>;
|
package/dist/pipeline.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAOjF,OAAO,EAIN,KAAK,YAAY,EAEjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAwHjF,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAS7D,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAGxE;AAeD,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE5C;AAED;;2BAE2B;AAC3B,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEjD;AAED,MAAM,WAAW,kBAAkB;IAClC,YAAY,EAAE,kBAAkB,EAAE,CAAC;IACnC,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAClC,gBAAgB,EAAE,kBAAkB,EAAE,CAAC;IACvC,YAAY,EAAE,kBAAkB,EAAE,CAAC;IACnC,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;IACxC;;;;;gEAK4D;IAC5D,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACjD,sDAAsD;IACtD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;IACrC,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAoOD,eAAO,MAAM,iBAAiB,EAAE,mBAqO/B,CAAC"}
|