@dereekb/dbx-cli 13.11.17 → 13.12.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/firebase-api-manifest/main.js +70 -9
- package/firebase-api-manifest/package.json +1 -1
- package/firestore-indexes/src/firestore-indexes-generate.d.ts +125 -0
- package/firestore-indexes/src/firestore-model-identity-resolver.d.ts +93 -0
- package/firestore-indexes/src/firestore-query-helpers.d.ts +108 -0
- package/firestore-indexes/src/generate-firestore-indexes-cli.d.ts +94 -0
- package/firestore-indexes/src/index.d.ts +7 -0
- package/firestore-indexes/src/model-firebase-index-analyze.d.ts +68 -0
- package/firestore-indexes/src/model-firebase-index-build-manifest.d.ts +123 -0
- package/firestore-indexes/src/model-firebase-index-extract.d.ts +246 -0
- package/firestore-indexes/src/model-firebase-index-runtime.d.ts +126 -0
- package/firestore-indexes/src/model-firebase-index-scan-config-schema.d.ts +58 -0
- package/firestore-indexes/src/model-firebase-index-schema.d.ts +366 -0
- package/generate-firestore-indexes/main.js +1 -1
- package/generate-firestore-indexes/package.json +1 -1
- package/generate-mcp-manifest/src/generate-mcp-manifest/main.d.ts +26 -0
- package/generate-mcp-manifest/src/generate-mcp-manifest/render.d.ts +38 -0
- package/generated/firebase-models.generated.d.ts +3 -0
- package/index.cjs.js +45234 -640
- package/index.esm.js +44941 -643
- package/lint-cache/main.js +19 -19
- package/lint-cache/package.json +2 -2
- package/manifest-extract/index.cjs.js +169 -4
- package/manifest-extract/index.esm.js +169 -4
- package/manifest-extract/package.json +1 -1
- package/manifest-extract/src/lib/types.d.ts +26 -1
- package/package.json +14 -10
- package/src/lib/index.d.ts +3 -0
- package/src/lib/manifest/types.d.ts +155 -0
- package/src/lib/mcp-scan/config/config-schema.d.ts +226 -0
- package/src/lib/mcp-scan/config/load-config.d.ts +63 -0
- package/src/lib/mcp-scan/index.d.ts +16 -0
- package/src/lib/mcp-scan/manifest/actions-loader.d.ts +49 -0
- package/src/lib/mcp-scan/manifest/actions-schema.d.ts +328 -0
- package/src/lib/mcp-scan/manifest/core-topics.d.ts +38 -0
- package/src/lib/mcp-scan/manifest/css-utilities-loader.d.ts +55 -0
- package/src/lib/mcp-scan/manifest/css-utilities-schema.d.ts +168 -0
- package/src/lib/mcp-scan/manifest/dbx-docs-ui-examples-loader.d.ts +33 -0
- package/src/lib/mcp-scan/manifest/dbx-docs-ui-examples-schema.d.ts +133 -0
- package/src/lib/mcp-scan/manifest/filters-loader.d.ts +61 -0
- package/src/lib/mcp-scan/manifest/filters-schema.d.ts +190 -0
- package/src/lib/mcp-scan/manifest/forge-fields-loader.d.ts +53 -0
- package/src/lib/mcp-scan/manifest/forge-fields-schema.d.ts +170 -0
- package/src/lib/mcp-scan/manifest/index.d.ts +43 -0
- package/src/lib/mcp-scan/manifest/load-actions-registry.d.ts +38 -0
- package/src/lib/mcp-scan/manifest/load-auth-registry.d.ts +82 -0
- package/src/lib/mcp-scan/manifest/load-css-utilities-registry.d.ts +67 -0
- package/src/lib/mcp-scan/manifest/load-dbx-docs-ui-examples-registry.d.ts +45 -0
- package/src/lib/mcp-scan/manifest/load-filters-registry.d.ts +69 -0
- package/src/lib/mcp-scan/manifest/load-forge-fields-registry.d.ts +70 -0
- package/src/lib/mcp-scan/manifest/load-model-firebase-index-registry.d.ts +61 -0
- package/src/lib/mcp-scan/manifest/load-model-snapshot-fields-registry.d.ts +74 -0
- package/src/lib/mcp-scan/manifest/load-pipes-registry.d.ts +69 -0
- package/src/lib/mcp-scan/manifest/load-registry.d.ts +76 -0
- package/src/lib/mcp-scan/manifest/load-tokens-registry.d.ts +69 -0
- package/src/lib/mcp-scan/manifest/load-ui-components-registry.d.ts +70 -0
- package/src/lib/mcp-scan/manifest/load-utils-registry.d.ts +73 -0
- package/src/lib/mcp-scan/manifest/loader.d.ts +120 -0
- package/src/lib/mcp-scan/manifest/manifest-loader-base.d.ts +130 -0
- package/src/lib/mcp-scan/manifest/model-firebase-index-loader.d.ts +53 -0
- package/src/lib/mcp-scan/manifest/model-snapshot-fields-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/model-snapshot-fields-schema.d.ts +127 -0
- package/src/lib/mcp-scan/manifest/pipes-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/pipes-schema.d.ts +125 -0
- package/src/lib/mcp-scan/manifest/semantic-types-schema.d.ts +108 -0
- package/src/lib/mcp-scan/manifest/tokens-loader.d.ts +55 -0
- package/src/lib/mcp-scan/manifest/tokens-schema.d.ts +116 -0
- package/src/lib/mcp-scan/manifest/ui-components-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/ui-components-schema.d.ts +149 -0
- package/src/lib/mcp-scan/manifest/utils-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/utils-schema.d.ts +120 -0
- package/src/lib/mcp-scan/registry/actions-runtime.d.ts +173 -0
- package/src/lib/mcp-scan/registry/archetypes.d.ts +235 -0
- package/src/lib/mcp-scan/registry/auth-builtin.d.ts +59 -0
- package/src/lib/mcp-scan/registry/auth-runtime.d.ts +343 -0
- package/src/lib/mcp-scan/registry/css-utilities-runtime.d.ts +133 -0
- package/src/lib/mcp-scan/registry/dbx-docs-ui-examples-runtime.d.ts +58 -0
- package/src/lib/mcp-scan/registry/downstream-models-runtime.d.ts +93 -0
- package/src/lib/mcp-scan/registry/filters-runtime.d.ts +128 -0
- package/src/lib/mcp-scan/registry/firebase-models.d.ts +387 -0
- package/src/lib/mcp-scan/registry/forge-fields.d.ts +101 -0
- package/src/lib/mcp-scan/registry/form-fields.d.ts +203 -0
- package/src/lib/mcp-scan/registry/index.d.ts +165 -0
- package/src/lib/mcp-scan/registry/model-snapshot-fields-runtime.d.ts +138 -0
- package/src/lib/mcp-scan/registry/pipes-runtime.d.ts +136 -0
- package/src/lib/mcp-scan/registry/reserved-model-folders.d.ts +29 -0
- package/src/lib/mcp-scan/registry/semantic-types.d.ts +81 -0
- package/src/lib/mcp-scan/registry/tokens-runtime.d.ts +96 -0
- package/src/lib/mcp-scan/registry/ui-components-runtime.d.ts +90 -0
- package/src/lib/mcp-scan/registry/utils-runtime.d.ts +136 -0
- package/src/lib/mcp-scan/scan/_jsdoc-tagged-export/extract-base.d.ts +245 -0
- package/src/lib/mcp-scan/scan/actions-build-manifest.d.ts +58 -0
- package/src/lib/mcp-scan/scan/actions-cli.d.ts +38 -0
- package/src/lib/mcp-scan/scan/actions-extract.d.ts +99 -0
- package/src/lib/mcp-scan/scan/actions-scan-config-schema.d.ts +42 -0
- package/src/lib/mcp-scan/scan/auth-extract.d.ts +120 -0
- package/src/lib/mcp-scan/scan/build-manifest.d.ts +76 -0
- package/src/lib/mcp-scan/scan/cli.d.ts +60 -0
- package/src/lib/mcp-scan/scan/css-utilities-build-manifest.d.ts +76 -0
- package/src/lib/mcp-scan/scan/css-utilities-cli.d.ts +36 -0
- package/src/lib/mcp-scan/scan/css-utilities-extract.d.ts +187 -0
- package/src/lib/mcp-scan/scan/css-utilities-scan-config-schema.d.ts +57 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-build-manifest.d.ts +68 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-cli.d.ts +20 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-extract.d.ts +160 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-scan-config-schema.d.ts +56 -0
- package/src/lib/mcp-scan/scan/discover-downstream-packages.d.ts +76 -0
- package/src/lib/mcp-scan/scan/discover-firebase-packages.d.ts +58 -0
- package/src/lib/mcp-scan/scan/extract-models/assemble.d.ts +105 -0
- package/src/lib/mcp-scan/scan/extract-models/collect-inherited.d.ts +22 -0
- package/src/lib/mcp-scan/scan/extract-models/find-converters.d.ts +19 -0
- package/src/lib/mcp-scan/scan/extract-models/find-enums.d.ts +19 -0
- package/src/lib/mcp-scan/scan/extract-models/find-identities.d.ts +25 -0
- package/src/lib/mcp-scan/scan/extract-models/find-interfaces.d.ts +31 -0
- package/src/lib/mcp-scan/scan/extract-models/find-model-groups.d.ts +21 -0
- package/src/lib/mcp-scan/scan/extract-models/find-service-factories.d.ts +19 -0
- package/src/lib/mcp-scan/scan/extract-models/find-sub-object-consts.d.ts +20 -0
- package/src/lib/mcp-scan/scan/extract-models/index.d.ts +74 -0
- package/src/lib/mcp-scan/scan/extract-models/infer-collection-kind.d.ts +22 -0
- package/src/lib/mcp-scan/scan/extract-models/service-factory-constants.d.ts +6 -0
- package/src/lib/mcp-scan/scan/extract-models/types.d.ts +171 -0
- package/src/lib/mcp-scan/scan/extract.d.ts +82 -0
- package/src/lib/mcp-scan/scan/filters-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/filters-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/filters-extract.d.ts +101 -0
- package/src/lib/mcp-scan/scan/filters-scan-config-schema.d.ts +56 -0
- package/src/lib/mcp-scan/scan/forge-fields-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/forge-fields-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/forge-fields-extract.d.ts +165 -0
- package/src/lib/mcp-scan/scan/forge-fields-scan-config-schema.d.ts +61 -0
- package/src/lib/mcp-scan/scan/index.d.ts +60 -0
- package/src/lib/mcp-scan/scan/model-firebase-index-cli.d.ts +22 -0
- package/src/lib/mcp-scan/scan/model-firebase-index-dispatcher-credit.d.ts +47 -0
- package/src/lib/mcp-scan/scan/model-firebase-index-reference-scan.d.ts +100 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-build-manifest.d.ts +79 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-extract.d.ts +115 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-scan-config-schema.d.ts +59 -0
- package/src/lib/mcp-scan/scan/pipes-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/pipes-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/pipes-extract.d.ts +90 -0
- package/src/lib/mcp-scan/scan/pipes-scan-config-schema.d.ts +56 -0
- package/src/lib/mcp-scan/scan/scan-angular-io.d.ts +89 -0
- package/src/lib/mcp-scan/scan/scan-cli-base.d.ts +162 -0
- package/src/lib/mcp-scan/scan/scan-config-schema.d.ts +44 -0
- package/src/lib/mcp-scan/scan/ui-components-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/ui-components-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/ui-components-extract.d.ts +124 -0
- package/src/lib/mcp-scan/scan/ui-components-scan-config-schema.d.ts +62 -0
- package/src/lib/mcp-scan/scan/utils-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/utils-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/utils-extract.d.ts +103 -0
- package/src/lib/mcp-scan/scan/utils-scan-config-schema.d.ts +57 -0
- package/test/package.json +9 -9
- package/index.cjs.default.js +0 -1
- package/index.cjs.mjs +0 -2
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SCSS extractor for the `scan-css-utilities` pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Scans a flat `.scss` source string for top-level utility-class rules
|
|
5
|
+
* annotated with `/// @dbx-utility …`. Returns one
|
|
6
|
+
* {@link ExtractedCssUtilityEntry} per annotated selector plus
|
|
7
|
+
* {@link ExtractWarning}s for malformed annotation blocks.
|
|
8
|
+
*
|
|
9
|
+
* Supported annotation tags (each on its own `///` line, immediately
|
|
10
|
+
* preceding the selector):
|
|
11
|
+
*
|
|
12
|
+
* - `@dbx-utility <slug>` — required curation gate; defaults the slug to
|
|
13
|
+
* `<host-class minus leading dot>` when the value is omitted.
|
|
14
|
+
* - `@intent <plain-english>` — short description used by intent search.
|
|
15
|
+
* - `@role <role>` — one of `layout`, `flex`, `text`, `spacing`, `state`,
|
|
16
|
+
* `interaction`, `color`, `text-color`, `surface`, `size`, `radius`,
|
|
17
|
+
* `misc`. Drives role filters and structural-property weighting in the
|
|
18
|
+
* equivalency engine.
|
|
19
|
+
* - `@see-also <slug>[, <slug>, …]` — comma-separated related slugs.
|
|
20
|
+
* - `@anti-use <plain-english>` — when NOT to use this utility.
|
|
21
|
+
* - `@since <version>` — version tag.
|
|
22
|
+
* - `@parent <slug>` — group this utility as a child of another utility.
|
|
23
|
+
* Children (entries with a `parent` field) are filtered out of bulk
|
|
24
|
+
* browse / search / intent results in the runtime registry by default;
|
|
25
|
+
* callers can opt in with `parent="<slug>"` (scope to that parent's
|
|
26
|
+
* children) or `includeChildren=true`. Use this for helper classes that
|
|
27
|
+
* compose around a parent class (e.g. `dbx-list-two-line-item-icon`
|
|
28
|
+
* carries `@parent dbx-list-two-line-item`). The leading dot on a parent
|
|
29
|
+
* value is stripped, so `@parent .dbx-foo` and `@parent dbx-foo` are
|
|
30
|
+
* equivalent. Parent slugs are NOT validated against the registry at
|
|
31
|
+
* extract time — cross-source references and forward references both
|
|
32
|
+
* work.
|
|
33
|
+
* - `@component <ClassName>` — names the Angular component class that
|
|
34
|
+
* owns this rule (e.g. `@component DbxIconTileComponent`). Surfaces in
|
|
35
|
+
* the lookup output so consumers know which component to use instead
|
|
36
|
+
* of applying the class by hand.
|
|
37
|
+
* - `@scope <utility|component-class>` — defaults to `utility` when
|
|
38
|
+
* omitted. Set to `component-class` when the rule ships as part of a
|
|
39
|
+
* component template and should not be applied to arbitrary elements.
|
|
40
|
+
* The lookup tool renders a "use the component, not the class" hint in
|
|
41
|
+
* that case while still surfacing tokens.
|
|
42
|
+
*
|
|
43
|
+
* Two arrays are derived automatically from the rule's body during
|
|
44
|
+
* extraction (no annotation needed):
|
|
45
|
+
*
|
|
46
|
+
* - `tokensRead` — every CSS custom property referenced via `var(--name,
|
|
47
|
+
* …)` inside any declaration value (including nested `var()` calls in
|
|
48
|
+
* fallbacks). Sorted, deduped.
|
|
49
|
+
* - `tokensSet` — every CSS custom property declared by the rule (a
|
|
50
|
+
* declaration whose property starts with `--`). Sorted, deduped.
|
|
51
|
+
*
|
|
52
|
+
* Curation gate: only selectors whose preceding comment block contains
|
|
53
|
+
* `/// @dbx-utility` make it into the output.
|
|
54
|
+
*
|
|
55
|
+
* Selector shapes accepted:
|
|
56
|
+
*
|
|
57
|
+
* - **Flat single-class** (`.dbx-foo`) — the canonical case. Slug defaults
|
|
58
|
+
* to `dbx-foo`; `selectorContext` is omitted.
|
|
59
|
+
* - **Flat comma-list** (`.text-center, .dbx-text-center`) — picks the
|
|
60
|
+
* `.dbx-*` variant as canonical; the chosen class is the host. Each
|
|
61
|
+
* comma-separated part must be a flat single-class selector.
|
|
62
|
+
* - **Compound descendant chain** (`.dbx-list-no-item-padding .dbx-list >
|
|
63
|
+
* .dbx-list-content …`) — the FIRST flat class in the chain becomes the
|
|
64
|
+
* host (canonical) selector; the full original text is preserved on the
|
|
65
|
+
* entry as `selectorContext` so consumers see the usage context. The
|
|
66
|
+
* first segment must be a flat single class (no compound `.foo.bar`,
|
|
67
|
+
* pseudo-classes, or attribute selectors as the host); everything after
|
|
68
|
+
* the first whitespace combinator can be arbitrary CSS. This lets a
|
|
69
|
+
* curator annotate a rule like `.dbx-list-no-item-padding .dbx-list …
|
|
70
|
+
* { padding: 0 }` directly without rewriting it as nested SCSS.
|
|
71
|
+
*
|
|
72
|
+
* Nested SCSS rules inside an annotated block (e.g. `.item-icon` inside a
|
|
73
|
+
* `.dbx-list-two-line-item` rule) are NOT cataloged; lift them to flat
|
|
74
|
+
* top-level classes if they should be discoverable as utilities, then
|
|
75
|
+
* carry `@parent` to group them under their conceptual parent.
|
|
76
|
+
*
|
|
77
|
+
* Implementation: a lightweight line-based scanner. The SCSS family this
|
|
78
|
+
* package targets uses flat top-level rules (or rules nested one level deep
|
|
79
|
+
* inside a `@mixin core()` block); brace-counting is sufficient for both.
|
|
80
|
+
* No PostCSS dependency.
|
|
81
|
+
*/
|
|
82
|
+
import type { Maybe } from '@dereekb/util';
|
|
83
|
+
import { type CssUtilityRoleValue, type CssUtilityScopeValue } from '../manifest/css-utilities-schema.js';
|
|
84
|
+
/**
|
|
85
|
+
* One declaration captured from the annotated rule.
|
|
86
|
+
*/
|
|
87
|
+
export interface ExtractedCssDeclaration {
|
|
88
|
+
readonly property: string;
|
|
89
|
+
readonly value: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* One annotated-utility entry produced by {@link extractCssUtilityEntries}.
|
|
93
|
+
* `file` is the relative file path supplied by the caller; `line` is the
|
|
94
|
+
* 1-based line number where the selector begins.
|
|
95
|
+
*/
|
|
96
|
+
export interface ExtractedCssUtilityEntry {
|
|
97
|
+
readonly slug: string;
|
|
98
|
+
readonly selector: string;
|
|
99
|
+
readonly file: string;
|
|
100
|
+
readonly line: number;
|
|
101
|
+
readonly declarations: readonly ExtractedCssDeclaration[];
|
|
102
|
+
readonly role?: CssUtilityRoleValue;
|
|
103
|
+
readonly intent?: string;
|
|
104
|
+
readonly seeAlso?: readonly string[];
|
|
105
|
+
readonly antiUse?: string;
|
|
106
|
+
readonly since?: string;
|
|
107
|
+
readonly parent?: string;
|
|
108
|
+
readonly selectorContext?: string;
|
|
109
|
+
readonly component?: string;
|
|
110
|
+
readonly scope?: CssUtilityScopeValue;
|
|
111
|
+
readonly tokensRead?: readonly string[];
|
|
112
|
+
readonly tokensSet?: readonly string[];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Discriminated union of warning kinds produced by the extractor. Strict
|
|
116
|
+
* curation errors (like a `/// @dbx-utility` block followed by a non-class
|
|
117
|
+
* selector) are surfaced as warnings rather than thrown so a single bad
|
|
118
|
+
* annotation does not break the whole scan.
|
|
119
|
+
*/
|
|
120
|
+
export type ExtractWarning = {
|
|
121
|
+
readonly kind: 'unsupported-selector';
|
|
122
|
+
readonly file: string;
|
|
123
|
+
readonly line: number;
|
|
124
|
+
readonly selector: string;
|
|
125
|
+
} | {
|
|
126
|
+
readonly kind: 'unknown-role';
|
|
127
|
+
readonly file: string;
|
|
128
|
+
readonly line: number;
|
|
129
|
+
readonly slug: string;
|
|
130
|
+
readonly role: string;
|
|
131
|
+
} | {
|
|
132
|
+
readonly kind: 'unknown-scope';
|
|
133
|
+
readonly file: string;
|
|
134
|
+
readonly line: number;
|
|
135
|
+
readonly slug: string;
|
|
136
|
+
readonly scope: string;
|
|
137
|
+
} | {
|
|
138
|
+
readonly kind: 'orphan-annotation';
|
|
139
|
+
readonly file: string;
|
|
140
|
+
readonly line: number;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Input to {@link extractCssUtilityEntries}.
|
|
144
|
+
*/
|
|
145
|
+
export interface ExtractCssUtilityEntriesInput {
|
|
146
|
+
readonly file: string;
|
|
147
|
+
readonly source: string;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Result of one extraction run.
|
|
151
|
+
*/
|
|
152
|
+
export interface ExtractCssUtilityEntriesResult {
|
|
153
|
+
readonly entries: readonly ExtractedCssUtilityEntry[];
|
|
154
|
+
readonly warnings: readonly ExtractWarning[];
|
|
155
|
+
}
|
|
156
|
+
interface ParsedAnnotation {
|
|
157
|
+
readonly utilitySlug: Maybe<string>;
|
|
158
|
+
readonly intent?: string;
|
|
159
|
+
readonly role?: string;
|
|
160
|
+
readonly seeAlso?: readonly string[];
|
|
161
|
+
readonly antiUse?: string;
|
|
162
|
+
readonly since?: string;
|
|
163
|
+
readonly parent?: string;
|
|
164
|
+
readonly component?: string;
|
|
165
|
+
readonly scope?: string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Parses a buffer of `///` annotation lines (each already stripped of the
|
|
169
|
+
* leading `/// `) into a structured shape. Lines without a recognised tag
|
|
170
|
+
* are ignored — the curation marker itself is the only required line.
|
|
171
|
+
*
|
|
172
|
+
* @param lines - The annotation lines belonging to one block.
|
|
173
|
+
* @returns The parsed annotation; `utilitySlug` is `null` when no
|
|
174
|
+
* `@dbx-utility` line appears.
|
|
175
|
+
*/
|
|
176
|
+
export declare function parseAnnotation(lines: readonly string[]): ParsedAnnotation;
|
|
177
|
+
/**
|
|
178
|
+
* Walks the supplied SCSS source and extracts every `/// @dbx-utility`
|
|
179
|
+
* annotated rule. Only flat single-class selectors are supported in v1 —
|
|
180
|
+
* compound or descendant selectors are reported via the
|
|
181
|
+
* `unsupported-selector` warning.
|
|
182
|
+
*
|
|
183
|
+
* @param input - The file label (relative path) and the SCSS source string.
|
|
184
|
+
* @returns The extracted entries plus deterministic warnings.
|
|
185
|
+
*/
|
|
186
|
+
export declare function extractCssUtilityEntries(input: ExtractCssUtilityEntriesInput): ExtractCssUtilityEntriesResult;
|
|
187
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arktype schema for the `cssUtilities` section of `dbx-mcp.scan.json`.
|
|
3
|
+
*
|
|
4
|
+
* CSS-utility scanning lives next to the existing semantic-types,
|
|
5
|
+
* ui-components, forge-fields, and pipes sections — they all use the same
|
|
6
|
+
* `dbx-mcp.scan.json` filename so a project that opts into multiple
|
|
7
|
+
* pipelines keeps a single config file.
|
|
8
|
+
*
|
|
9
|
+
* The schema is intentionally permissive at the root (extra keys are
|
|
10
|
+
* preserved untouched) so co-located scan sections don't trigger
|
|
11
|
+
* cross-section validation.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Inner config that drives one css-utilities scan run. `source` becomes the
|
|
15
|
+
* manifest's `source` label (used for collision detection across loaded
|
|
16
|
+
* sources); `module` becomes the npm package name attached to every produced
|
|
17
|
+
* entry. Both default to the project's `package.json#name` when omitted.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CssUtilitiesScanSection: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
20
|
+
include: string[];
|
|
21
|
+
source?: string | undefined;
|
|
22
|
+
module?: string | undefined;
|
|
23
|
+
exclude?: string[] | undefined;
|
|
24
|
+
out?: string | undefined;
|
|
25
|
+
}, {}>;
|
|
26
|
+
/**
|
|
27
|
+
* Static type inferred from {@link CssUtilitiesScanSection}.
|
|
28
|
+
*/
|
|
29
|
+
export type CssUtilitiesScanSection = typeof CssUtilitiesScanSection.infer;
|
|
30
|
+
/**
|
|
31
|
+
* Top-level shape used by the css-utilities builder. Only the
|
|
32
|
+
* `cssUtilities` key is consumed; the rest of the document is ignored so a
|
|
33
|
+
* single `dbx-mcp.scan.json` can house multiple cluster configurations.
|
|
34
|
+
*/
|
|
35
|
+
export declare const CssUtilitiesScanConfig: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
36
|
+
version: 1;
|
|
37
|
+
cssUtilities: {
|
|
38
|
+
include: string[];
|
|
39
|
+
source?: string | undefined;
|
|
40
|
+
module?: string | undefined;
|
|
41
|
+
exclude?: string[] | undefined;
|
|
42
|
+
out?: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
}, {}>;
|
|
45
|
+
/**
|
|
46
|
+
* Static type inferred from {@link CssUtilitiesScanConfig}.
|
|
47
|
+
*/
|
|
48
|
+
export type CssUtilitiesScanConfig = typeof CssUtilitiesScanConfig.infer;
|
|
49
|
+
/**
|
|
50
|
+
* Default value used when the scan config does not specify `out`. Lives
|
|
51
|
+
* next to the scan config in the project root.
|
|
52
|
+
*/
|
|
53
|
+
export declare const DEFAULT_CSS_UTILITIES_SCAN_OUT_PATH = "css-utilities.mcp.generated.json";
|
|
54
|
+
/**
|
|
55
|
+
* Filename the loader looks for at `${projectRoot}/`.
|
|
56
|
+
*/
|
|
57
|
+
export declare const CSS_UTILITIES_SCAN_CONFIG_FILENAME = "dbx-mcp.scan.json";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestrator for the `scan-dbx-docs-ui-examples` generator.
|
|
3
|
+
*
|
|
4
|
+
* Composes a complete {@link DbxDocsUiExampleManifest} from a project root
|
|
5
|
+
* by reading `dbx-mcp.scan.json` against
|
|
6
|
+
* {@link DbxDocsUiExamplesScanConfig}, resolving include/exclude globs,
|
|
7
|
+
* loading matched example files into a ts-morph project, extracting
|
|
8
|
+
* entries via {@link extractDbxDocsUiExampleEntries}, and assembling the
|
|
9
|
+
* manifest envelope. I/O is fully injectable for tests.
|
|
10
|
+
*/
|
|
11
|
+
import { DbxDocsUiExampleManifest } from '../manifest/dbx-docs-ui-examples-schema.js';
|
|
12
|
+
import { type DbxDocsUiExamplesExtractWarning } from './dbx-docs-ui-examples-extract.js';
|
|
13
|
+
import { type ScanGlobber, type ScanReadFile } from '../../scan-helpers/scan-io.js';
|
|
14
|
+
export type BuildDbxDocsUiExamplesManifestReadFile = ScanReadFile;
|
|
15
|
+
export type BuildDbxDocsUiExamplesManifestGlobber = ScanGlobber;
|
|
16
|
+
/**
|
|
17
|
+
* Input to {@link buildDbxDocsUiExamplesManifest}.
|
|
18
|
+
*/
|
|
19
|
+
export interface BuildDbxDocsUiExamplesManifestInput {
|
|
20
|
+
readonly projectRoot: string;
|
|
21
|
+
readonly generator: string;
|
|
22
|
+
readonly now?: () => Date;
|
|
23
|
+
readonly readFile?: BuildDbxDocsUiExamplesManifestReadFile;
|
|
24
|
+
readonly globber?: BuildDbxDocsUiExamplesManifestGlobber;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Outcome of one generator run.
|
|
28
|
+
*/
|
|
29
|
+
export type BuildDbxDocsUiExamplesManifestOutcome = {
|
|
30
|
+
readonly kind: 'success';
|
|
31
|
+
readonly manifest: DbxDocsUiExampleManifest;
|
|
32
|
+
readonly outPath: string;
|
|
33
|
+
readonly scannedFileCount: number;
|
|
34
|
+
readonly extractWarnings: readonly DbxDocsUiExamplesExtractWarning[];
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: 'no-config';
|
|
37
|
+
readonly configPath: string;
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: 'invalid-scan-config';
|
|
40
|
+
readonly configPath: string;
|
|
41
|
+
readonly error: string;
|
|
42
|
+
} | {
|
|
43
|
+
readonly kind: 'no-package';
|
|
44
|
+
readonly packagePath: string;
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: 'invalid-package';
|
|
47
|
+
readonly packagePath: string;
|
|
48
|
+
readonly error: string;
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: 'invalid-manifest';
|
|
51
|
+
readonly error: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Builds a {@link DbxDocsUiExampleManifest} from the supplied project root.
|
|
55
|
+
*
|
|
56
|
+
* @param input - The project root + injection hooks for testing.
|
|
57
|
+
* @returns A discriminated outcome describing the result.
|
|
58
|
+
*/
|
|
59
|
+
export declare function buildDbxDocsUiExamplesManifest(input: BuildDbxDocsUiExamplesManifestInput): Promise<BuildDbxDocsUiExamplesManifestOutcome>;
|
|
60
|
+
/**
|
|
61
|
+
* JSON-stringifies a manifest with stable key ordering and trailing newline
|
|
62
|
+
* so `--check` mode can byte-compare against a committed file without
|
|
63
|
+
* false-positive diffs from key reordering.
|
|
64
|
+
*
|
|
65
|
+
* @param manifest - The validated manifest to serialize.
|
|
66
|
+
* @returns A pretty-printed JSON string terminated with a newline.
|
|
67
|
+
*/
|
|
68
|
+
export declare function serializeDbxDocsUiExamplesManifest(manifest: DbxDocsUiExampleManifest): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `scan-dbx-docs-ui-examples` subcommand entry point.
|
|
3
|
+
*
|
|
4
|
+
* Thin wrapper around {@link runScanCliBase} that supplies the
|
|
5
|
+
* dbx-docs-ui-examples domain config.
|
|
6
|
+
*/
|
|
7
|
+
import { type BuildDbxDocsUiExamplesManifestGlobber } from './dbx-docs-ui-examples-build-manifest.js';
|
|
8
|
+
import { type RunScanCliBaseInput, type RunScanCliResult, type ScanCliBaseLogger, type ScanCliBaseReadFile, type ScanCliBaseWriteFile } from './scan-cli-base.js';
|
|
9
|
+
export type DbxDocsUiExamplesScanCliReadFile = ScanCliBaseReadFile;
|
|
10
|
+
export type DbxDocsUiExamplesScanCliWriteFile = ScanCliBaseWriteFile;
|
|
11
|
+
export type DbxDocsUiExamplesScanCliLogger = ScanCliBaseLogger;
|
|
12
|
+
export type RunDbxDocsUiExamplesScanCliInput = RunScanCliBaseInput<BuildDbxDocsUiExamplesManifestGlobber>;
|
|
13
|
+
export type RunDbxDocsUiExamplesScanCliResult = RunScanCliResult;
|
|
14
|
+
/**
|
|
15
|
+
* Runs one invocation of `scan-dbx-docs-ui-examples`.
|
|
16
|
+
*
|
|
17
|
+
* @param input - Parsed CLI input including project root, optional `--out` override, and `--check` flag.
|
|
18
|
+
* @returns The CLI exit code, written file paths, and any warnings produced by the scan.
|
|
19
|
+
*/
|
|
20
|
+
export declare function runDbxDocsUiExamplesScanCli(input: RunDbxDocsUiExamplesScanCliInput): Promise<RunDbxDocsUiExamplesScanCliResult>;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AST extraction for the `scan-dbx-docs-ui-examples` generator.
|
|
3
|
+
*
|
|
4
|
+
* Walks every source file in the supplied ts-morph `Project` looking for
|
|
5
|
+
* top-level exported class declarations tagged with the `@dbxDocsUiExample`
|
|
6
|
+
* JSDoc marker. Each match is normalised into an
|
|
7
|
+
* {@link ExtractedDbxDocsUiExampleEntry} that
|
|
8
|
+
* {@link buildDbxDocsUiExamplesManifest} will assemble into a
|
|
9
|
+
* `DbxDocsUiExampleManifest` entry.
|
|
10
|
+
*
|
|
11
|
+
* The extractor parses the example component's `@Component` template to find
|
|
12
|
+
* the well-known `<dbx-docs-ui-example*>` element tree (header attribute,
|
|
13
|
+
* info/content/imports/notes children) and resolves every
|
|
14
|
+
* `@dbxDocsUiExampleUses` tag through the example file's import declarations,
|
|
15
|
+
* lazily loading the referenced source files so each supporting class /
|
|
16
|
+
* interface declaration and (for components) its template body land in the
|
|
17
|
+
* entry's `uses[]` array. The tag accepts either a bare identifier
|
|
18
|
+
* (`@dbxDocsUiExampleUses Foo role`) or a JSDoc link
|
|
19
|
+
* (`@dbxDocsUiExampleUses {@link Foo} role`), so authors get IDE
|
|
20
|
+
* cross-referencing on supporting types.
|
|
21
|
+
*/
|
|
22
|
+
import { type Project } from 'ts-morph';
|
|
23
|
+
import { type DbxDocsUiExampleEntry, type DbxDocsUiExampleUseEntry } from '../manifest/dbx-docs-ui-examples-schema.js';
|
|
24
|
+
import { type ScanReadFile } from '../../scan-helpers/scan-io.js';
|
|
25
|
+
/**
|
|
26
|
+
* One example entry extracted from a source file. Mirrors
|
|
27
|
+
* {@link DbxDocsUiExampleEntry} minus `module` and `appRef` (defaulted in
|
|
28
|
+
* build-manifest). The originating `filePath` and `line` are kept so
|
|
29
|
+
* extract warnings can point a developer back to the source file —
|
|
30
|
+
* neither is persisted to the manifest because downstream consumers
|
|
31
|
+
* never have access to the source tree.
|
|
32
|
+
*/
|
|
33
|
+
export interface ExtractedDbxDocsUiExampleEntry {
|
|
34
|
+
readonly slug: string;
|
|
35
|
+
readonly category: DbxDocsUiExampleEntry['category'];
|
|
36
|
+
readonly summary: string;
|
|
37
|
+
readonly header: string;
|
|
38
|
+
readonly hint?: string;
|
|
39
|
+
readonly className: string;
|
|
40
|
+
readonly selector: string;
|
|
41
|
+
readonly appRef?: string;
|
|
42
|
+
readonly relatedSlugs?: readonly string[];
|
|
43
|
+
readonly skillRefs?: readonly string[];
|
|
44
|
+
readonly info: string;
|
|
45
|
+
readonly snippet: string;
|
|
46
|
+
readonly imports?: string;
|
|
47
|
+
readonly notes?: string;
|
|
48
|
+
readonly uses: readonly DbxDocsUiExampleUseEntry[];
|
|
49
|
+
readonly filePath: string;
|
|
50
|
+
readonly line: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Discriminated union of the non-fatal events the extractor emits. The
|
|
54
|
+
* caller (build-manifest) collates these into a structured warning array
|
|
55
|
+
* so missing/invalid tag combinations surface during generation rather
|
|
56
|
+
* than silently dropping entries.
|
|
57
|
+
*/
|
|
58
|
+
export type DbxDocsUiExamplesExtractWarning = {
|
|
59
|
+
readonly kind: 'missing-required-tag';
|
|
60
|
+
readonly className: string;
|
|
61
|
+
readonly tag: string;
|
|
62
|
+
readonly filePath: string;
|
|
63
|
+
readonly line: number;
|
|
64
|
+
} | {
|
|
65
|
+
readonly kind: 'unknown-category';
|
|
66
|
+
readonly className: string;
|
|
67
|
+
readonly category: string;
|
|
68
|
+
readonly filePath: string;
|
|
69
|
+
readonly line: number;
|
|
70
|
+
} | {
|
|
71
|
+
readonly kind: 'missing-component-decorator';
|
|
72
|
+
readonly className: string;
|
|
73
|
+
readonly filePath: string;
|
|
74
|
+
readonly line: number;
|
|
75
|
+
} | {
|
|
76
|
+
readonly kind: 'missing-template';
|
|
77
|
+
readonly className: string;
|
|
78
|
+
readonly filePath: string;
|
|
79
|
+
readonly line: number;
|
|
80
|
+
} | {
|
|
81
|
+
readonly kind: 'missing-example-root';
|
|
82
|
+
readonly className: string;
|
|
83
|
+
readonly filePath: string;
|
|
84
|
+
readonly line: number;
|
|
85
|
+
} | {
|
|
86
|
+
readonly kind: 'missing-example-content';
|
|
87
|
+
readonly className: string;
|
|
88
|
+
readonly filePath: string;
|
|
89
|
+
readonly line: number;
|
|
90
|
+
} | {
|
|
91
|
+
readonly kind: 'template-url-unreadable';
|
|
92
|
+
readonly className: string;
|
|
93
|
+
readonly templatePath: string;
|
|
94
|
+
readonly filePath: string;
|
|
95
|
+
readonly line: number;
|
|
96
|
+
} | {
|
|
97
|
+
readonly kind: 'uses-unresolved';
|
|
98
|
+
readonly className: string;
|
|
99
|
+
readonly identifier: string;
|
|
100
|
+
readonly filePath: string;
|
|
101
|
+
readonly line: number;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Input to {@link extractDbxDocsUiExampleEntries}. The caller is responsible
|
|
105
|
+
* for adding example source files to `project`; the extractor will lazily
|
|
106
|
+
* pull in additional source files referenced by `@dbxDocsUiExampleUses` tags
|
|
107
|
+
* via the supplied `readFile` injection.
|
|
108
|
+
*/
|
|
109
|
+
export interface ExtractDbxDocsUiExampleEntriesInput {
|
|
110
|
+
readonly project: Project;
|
|
111
|
+
readonly readFile: ScanReadFile;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Result of {@link extractDbxDocsUiExampleEntries}.
|
|
115
|
+
*/
|
|
116
|
+
export interface ExtractDbxDocsUiExampleEntriesResult {
|
|
117
|
+
readonly entries: readonly ExtractedDbxDocsUiExampleEntry[];
|
|
118
|
+
readonly warnings: readonly DbxDocsUiExamplesExtractWarning[];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Walks the supplied project and returns every class tagged with the
|
|
122
|
+
* `@dbxDocsUiExample` JSDoc marker. Order is stable: source files in the
|
|
123
|
+
* order ts-morph reports them, declarations within a file in source
|
|
124
|
+
* order.
|
|
125
|
+
*
|
|
126
|
+
* @param input - The ts-morph project plus a readFile for resolving
|
|
127
|
+
* supporting sources referenced by `@dbxDocsUiExampleUses` tags.
|
|
128
|
+
* @returns The extracted entries plus any non-fatal warnings.
|
|
129
|
+
*/
|
|
130
|
+
export declare function extractDbxDocsUiExampleEntries(input: ExtractDbxDocsUiExampleEntriesInput): Promise<ExtractDbxDocsUiExampleEntriesResult>;
|
|
131
|
+
/**
|
|
132
|
+
* Arktype validator that mirrors {@link ExtractedDbxDocsUiExampleEntry}.
|
|
133
|
+
* Useful for tests that want to runtime-validate hand-crafted fixtures.
|
|
134
|
+
*/
|
|
135
|
+
export declare const ExtractedDbxDocsUiExampleEntrySchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
136
|
+
slug: string;
|
|
137
|
+
category: "action" | "list" | "screen" | "text" | "layout" | "button" | "card" | "feedback" | "overlay" | "navigation" | "router" | "misc";
|
|
138
|
+
summary: string;
|
|
139
|
+
header: string;
|
|
140
|
+
className: string;
|
|
141
|
+
selector: string;
|
|
142
|
+
info: string;
|
|
143
|
+
snippet: string;
|
|
144
|
+
uses: {
|
|
145
|
+
kind: "function" | "pipe" | "component" | "directive" | "service" | "class" | "const" | "interface" | "typeAlias";
|
|
146
|
+
className: string;
|
|
147
|
+
classSource: string;
|
|
148
|
+
role?: string | undefined;
|
|
149
|
+
selector?: string | undefined;
|
|
150
|
+
pipeName?: string | undefined;
|
|
151
|
+
}[];
|
|
152
|
+
filePath: string;
|
|
153
|
+
line: number;
|
|
154
|
+
hint?: string | undefined;
|
|
155
|
+
appRef?: string | undefined;
|
|
156
|
+
relatedSlugs?: string[] | undefined;
|
|
157
|
+
skillRefs?: string[] | undefined;
|
|
158
|
+
imports?: string | undefined;
|
|
159
|
+
notes?: string | undefined;
|
|
160
|
+
}, {}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arktype schema for the `dbxDocsUiExamples` section of `dbx-mcp.scan.json`.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the `uiComponents` cluster contract — same `dbx-mcp.scan.json`
|
|
5
|
+
* filename, same `include`/`exclude`/`out`/`source`/`module` shape — so a
|
|
6
|
+
* project that wants to ship downstream-app UI examples alongside any other
|
|
7
|
+
* scan cluster keeps a single config file. The CLI subcommand
|
|
8
|
+
* `scan-dbx-docs-ui-examples` reads only the `dbxDocsUiExamples` field; other
|
|
9
|
+
* cluster CLIs continue to read their respective sections unchanged.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Inner config that drives one dbx-docs-ui-examples scan run. `source` becomes
|
|
13
|
+
* the manifest's `source` label (used for collision detection across loaded
|
|
14
|
+
* sources); `module` becomes the entry-level `module` field attached to every
|
|
15
|
+
* produced entry. Both default to the project's `package.json#name` when
|
|
16
|
+
* omitted.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DbxDocsUiExamplesScanSection: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
19
|
+
include: string[];
|
|
20
|
+
source?: string | undefined;
|
|
21
|
+
module?: string | undefined;
|
|
22
|
+
exclude?: string[] | undefined;
|
|
23
|
+
out?: string | undefined;
|
|
24
|
+
}, {}>;
|
|
25
|
+
/**
|
|
26
|
+
* Static type inferred from {@link DbxDocsUiExamplesScanSection}.
|
|
27
|
+
*/
|
|
28
|
+
export type DbxDocsUiExamplesScanSection = typeof DbxDocsUiExamplesScanSection.infer;
|
|
29
|
+
/**
|
|
30
|
+
* Top-level shape used by the dbx-docs-ui-examples builder. Only the
|
|
31
|
+
* `dbxDocsUiExamples` key is consumed; the rest of the document is ignored so
|
|
32
|
+
* a single `dbx-mcp.scan.json` can house multiple cluster configurations.
|
|
33
|
+
*/
|
|
34
|
+
export declare const DbxDocsUiExamplesScanConfig: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
35
|
+
version: 1;
|
|
36
|
+
dbxDocsUiExamples: {
|
|
37
|
+
include: string[];
|
|
38
|
+
source?: string | undefined;
|
|
39
|
+
module?: string | undefined;
|
|
40
|
+
exclude?: string[] | undefined;
|
|
41
|
+
out?: string | undefined;
|
|
42
|
+
};
|
|
43
|
+
}, {}>;
|
|
44
|
+
/**
|
|
45
|
+
* Static type inferred from {@link DbxDocsUiExamplesScanConfig}.
|
|
46
|
+
*/
|
|
47
|
+
export type DbxDocsUiExamplesScanConfig = typeof DbxDocsUiExamplesScanConfig.infer;
|
|
48
|
+
/**
|
|
49
|
+
* Default value used when the scan config does not specify `out`.
|
|
50
|
+
* Lives next to the scan config in the project root.
|
|
51
|
+
*/
|
|
52
|
+
export declare const DEFAULT_DBX_DOCS_UI_EXAMPLES_SCAN_OUT_PATH = "dbx-docs-ui-examples.mcp.generated.json";
|
|
53
|
+
/**
|
|
54
|
+
* Filename the loader looks for at `${projectRoot}/`.
|
|
55
|
+
*/
|
|
56
|
+
export declare const DBX_DOCS_UI_EXAMPLES_SCAN_CONFIG_FILENAME = "dbx-mcp.scan.json";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discovery for downstream packages that may contribute manifests to the
|
|
3
|
+
* `dbx-components-mcp` registries (forms, UI, pipes, actions, filters,
|
|
4
|
+
* semantic types).
|
|
5
|
+
*
|
|
6
|
+
* Generalises {@link discoverDownstreamFirebasePackages} from one cluster
|
|
7
|
+
* (Firebase models) to the full set so the new `dbx_mcp_config` tool can
|
|
8
|
+
* inspect a workspace, suggest where to add scan configs, and feed the
|
|
9
|
+
* startup-warning hook in `server.ts`.
|
|
10
|
+
*
|
|
11
|
+
* Discovery axes:
|
|
12
|
+
* - `components/*-{firebase,shared,web,core}` — the conventional dbx
|
|
13
|
+
* component layout.
|
|
14
|
+
* - `apps/*` — included only when the app already has a
|
|
15
|
+
* `dbx-mcp.scan.json`, since most apps don't author exportable types.
|
|
16
|
+
* - Any folder with a `dbx-mcp.scan.json` — explicit opt-in always wins.
|
|
17
|
+
*
|
|
18
|
+
* Cluster candidacy is decided by cheap file-suffix heuristics over
|
|
19
|
+
* `src/**\/*.ts` (e.g. `*.component.ts` → `uiComponents`). The scan CLIs
|
|
20
|
+
* themselves do the real extraction; this helper only narrows which scan
|
|
21
|
+
* sections `init` writes and which startup hints fire.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* The six cluster keys also used by `dbx-mcp.config.json` and the per-cluster
|
|
25
|
+
* registry loaders. Kept in sync with `DbxMcpConfig` (`config-schema.ts`).
|
|
26
|
+
*/
|
|
27
|
+
export type DownstreamCluster = 'semanticTypes' | 'uiComponents' | 'forgeFields' | 'pipes' | 'actions' | 'filters';
|
|
28
|
+
/**
|
|
29
|
+
* Every cluster in the order the config schema declares them. Re-exported for
|
|
30
|
+
* the tool and the startup warning so they don't redeclare the list.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DOWNSTREAM_CLUSTERS: readonly DownstreamCluster[];
|
|
33
|
+
/**
|
|
34
|
+
* One downstream package discovered under the workspace root. `slug` is the
|
|
35
|
+
* conventional manifest-filename token derived from the package name (lowered,
|
|
36
|
+
* `@scope/` stripped, slashes collapsed to dashes) so two packages from
|
|
37
|
+
* different scopes never collide on disk.
|
|
38
|
+
*/
|
|
39
|
+
export interface DownstreamPackage {
|
|
40
|
+
readonly packageName: string;
|
|
41
|
+
readonly slug: string;
|
|
42
|
+
readonly relDir: string;
|
|
43
|
+
readonly absDir: string;
|
|
44
|
+
readonly hasScanConfig: boolean;
|
|
45
|
+
readonly candidateClusters: readonly DownstreamCluster[];
|
|
46
|
+
readonly declaredScanClusters: readonly DownstreamCluster[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Input to {@link discoverDownstreamPackages}.
|
|
50
|
+
*/
|
|
51
|
+
export interface DiscoverDownstreamPackagesInput {
|
|
52
|
+
readonly workspaceRoot: string;
|
|
53
|
+
/**
|
|
54
|
+
* Optional explicit list of workspace-relative dirs to inspect. When set,
|
|
55
|
+
* the default glob discovery is skipped — only these dirs are returned
|
|
56
|
+
* (filtered to those that actually look like packages).
|
|
57
|
+
*/
|
|
58
|
+
readonly explicitDirs?: readonly string[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Globs the workspace for downstream packages and returns one entry per
|
|
62
|
+
* package with the heuristic candidate-cluster list attached.
|
|
63
|
+
*
|
|
64
|
+
* @param input - Workspace root (absolute) plus optional explicit override.
|
|
65
|
+
* @returns The discovered packages sorted by `packageName`
|
|
66
|
+
*/
|
|
67
|
+
export declare function discoverDownstreamPackages(input: DiscoverDownstreamPackagesInput): Promise<readonly DownstreamPackage[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Converts a package name (possibly scoped) into a slug suitable for a
|
|
70
|
+
* manifest filename. `@dereekb/dbx-form` becomes `dereekb-dbx-form`; bare
|
|
71
|
+
* names become themselves lowered.
|
|
72
|
+
*
|
|
73
|
+
* @param packageName - The raw package.json `name` value to slugify.
|
|
74
|
+
* @returns The lowered, scope-stripped, separator-normalised slug.
|
|
75
|
+
*/
|
|
76
|
+
export declare function packageNameToSlug(packageName: string): string;
|