@dereekb/firebase 13.12.3 → 13.12.5
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/eslint/index.cjs.js +1586 -50
- package/eslint/index.esm.js +1540 -7
- package/eslint/package.json +3 -3
- package/eslint/src/lib/index.d.ts +2 -0
- package/eslint/src/lib/plugin.d.ts +4 -0
- package/eslint/src/lib/require-api-crud-spec-for-group.rule.d.ts +47 -0
- package/eslint/src/lib/require-canonical-api-spec-filename.rule.d.ts +55 -0
- package/eslint/src/lib/require-complete-crud-function-config-map.rule.d.ts +1 -1
- package/index.cjs.js +304 -85
- package/index.esm.js +299 -87
- package/package.json +5 -5
- package/src/lib/client/error/error.d.ts +6 -0
- package/src/lib/client/function/error.d.ts +6 -0
- package/src/lib/client/function/function.callable.d.ts +6 -0
- package/src/lib/common/auth/auth.d.ts +70 -0
- package/src/lib/common/auth/auth.error.d.ts +6 -0
- package/src/lib/model/oidcmodel/oidcmodel.api.d.ts +4 -2
- package/src/lib/model/oidcmodel/oidcmodel.interaction.d.ts +106 -2
- package/test/package.json +6 -6
package/eslint/index.esm.js
CHANGED
|
@@ -1,10 +1,1133 @@
|
|
|
1
|
-
import { leadingJsdocFor, parseJsdocComment, getStatementAnchor, findFamilyTags, checkDbxTagFamily, reportOnJsdocLine, parseBooleanTagValue, buildLowercaseTagsFix } from '@dereekb/util/eslint';
|
|
2
1
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { existsSync, readFileSync, globSync } from 'node:fs';
|
|
4
|
-
import { join, dirname, isAbsolute, resolve } from 'node:path';
|
|
2
|
+
import { existsSync, readFileSync, globSync, readdirSync } from 'node:fs';
|
|
3
|
+
import { join, dirname, isAbsolute, resolve, sep, basename } from 'node:path';
|
|
5
4
|
import { parse as parse$1 } from '@typescript-eslint/typescript-estree';
|
|
6
5
|
import { parse as parse$2 } from '@typescript-eslint/parser';
|
|
7
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Returns the outermost statement node for a FunctionDeclaration — its `ExportNamedDeclaration`
|
|
9
|
+
* or `ExportDefaultDeclaration` parent if exported, otherwise the declaration itself. This is the
|
|
10
|
+
* node ESLint attaches leading comments to.
|
|
11
|
+
*
|
|
12
|
+
* @param node - The FunctionDeclaration AST node.
|
|
13
|
+
* @returns The statement node ESLint attaches leading comments to.
|
|
14
|
+
*/ function getStatementAnchor(node) {
|
|
15
|
+
return node.parent && (node.parent.type === 'ExportNamedDeclaration' || node.parent.type === 'ExportDefaultDeclaration') ? node.parent : node;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns the JSDoc Block comment immediately preceding `anchor`, or `null` when
|
|
19
|
+
* the anchor has no JSDoc leader. Used by the `@dbx<Family>` companion-tag rules
|
|
20
|
+
* to locate the tagged declaration's documentation.
|
|
21
|
+
*
|
|
22
|
+
* @param sourceCode - The ESLint `SourceCode` object.
|
|
23
|
+
* @param anchor - The statement-level node ESLint attaches leading comments to.
|
|
24
|
+
* @returns The JSDoc block comment, or null when none is present.
|
|
25
|
+
*/ function leadingJsdocFor(sourceCode, anchor) {
|
|
26
|
+
var comments = sourceCode.getCommentsBefore(anchor) || [];
|
|
27
|
+
var result = null;
|
|
28
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
29
|
+
try {
|
|
30
|
+
for(var _iterator = comments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
31
|
+
var comment = _step.value;
|
|
32
|
+
if (comment.type === 'Block' && typeof comment.value === 'string' && comment.value.startsWith('*')) {
|
|
33
|
+
result = comment;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
} catch (err) {
|
|
37
|
+
_didIteratorError = true;
|
|
38
|
+
_iteratorError = err;
|
|
39
|
+
} finally{
|
|
40
|
+
try {
|
|
41
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
42
|
+
_iterator.return();
|
|
43
|
+
}
|
|
44
|
+
} finally{
|
|
45
|
+
if (_didIteratorError) {
|
|
46
|
+
throw _iteratorError;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Default maximum positional parameters before the warn-level rule suggests a config object.
|
|
55
|
+
* Triggers a warning when a function has more than 2 positional parameters (i.e. 3+ args).
|
|
56
|
+
*/ var DEFAULT_MAX_PARAMS_WARN = 2;
|
|
57
|
+
/**
|
|
58
|
+
* Default maximum positional parameters before the hard-error rule rejects the signature.
|
|
59
|
+
* Triggers an error when a function has more than 4 positional parameters (i.e. 5+ args).
|
|
60
|
+
*/ var DEFAULT_MAX_PARAMS_HARD = 4;
|
|
61
|
+
/**
|
|
62
|
+
* Default JSDoc tag that opts a function out of this rule.
|
|
63
|
+
*/ var DEFAULT_ALLOW_JSDOC_TAG = '@dbxAllowMultiParams';
|
|
64
|
+
/**
|
|
65
|
+
* Returns a human-readable display name for the function-like node, or `<anonymous>`.
|
|
66
|
+
*
|
|
67
|
+
* @param node - The function-like AST node.
|
|
68
|
+
* @returns The identifier string used in diagnostic messages.
|
|
69
|
+
*/ function getFunctionDisplayName(node) {
|
|
70
|
+
var _node_id;
|
|
71
|
+
var name = '<anonymous>';
|
|
72
|
+
if (((_node_id = node.id) === null || _node_id === void 0 ? void 0 : _node_id.type) === 'Identifier') {
|
|
73
|
+
name = node.id.name;
|
|
74
|
+
} else if (node.parent) {
|
|
75
|
+
var _parent_id, _parent_key, _parent_key1, _parent_left;
|
|
76
|
+
var parent = node.parent;
|
|
77
|
+
if (parent.type === 'VariableDeclarator' && ((_parent_id = parent.id) === null || _parent_id === void 0 ? void 0 : _parent_id.type) === 'Identifier') {
|
|
78
|
+
name = parent.id.name;
|
|
79
|
+
} else if (parent.type === 'Property' && ((_parent_key = parent.key) === null || _parent_key === void 0 ? void 0 : _parent_key.type) === 'Identifier') {
|
|
80
|
+
name = parent.key.name;
|
|
81
|
+
} else if (parent.type === 'MethodDefinition' && ((_parent_key1 = parent.key) === null || _parent_key1 === void 0 ? void 0 : _parent_key1.type) === 'Identifier') {
|
|
82
|
+
name = parent.key.name;
|
|
83
|
+
} else if (parent.type === 'AssignmentExpression' && ((_parent_left = parent.left) === null || _parent_left === void 0 ? void 0 : _parent_left.type) === 'Identifier') {
|
|
84
|
+
name = parent.left.name;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return name;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Returns true if a parameter has any decorators (NestJS handler/Inject pattern).
|
|
91
|
+
*
|
|
92
|
+
* @param param - The parameter AST node.
|
|
93
|
+
* @returns True when the parameter carries at least one decorator.
|
|
94
|
+
*/ function paramHasDecorator(param) {
|
|
95
|
+
var _param_decorators;
|
|
96
|
+
var decorators = (_param_decorators = param.decorators) !== null && _param_decorators !== void 0 ? _param_decorators : [];
|
|
97
|
+
return Array.isArray(decorators) && decorators.length > 0;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Returns true when the function is the constructor of a class.
|
|
101
|
+
*
|
|
102
|
+
* @param node - The function-like AST node.
|
|
103
|
+
* @returns True if `node` is the `constructor` body of a class.
|
|
104
|
+
*/ function isConstructor(node) {
|
|
105
|
+
var _node_parent;
|
|
106
|
+
return ((_node_parent = node.parent) === null || _node_parent === void 0 ? void 0 : _node_parent.type) === 'MethodDefinition' && node.parent.kind === 'constructor';
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Returns true if any leading JSDoc block above `anchor` contains the allow tag.
|
|
110
|
+
*
|
|
111
|
+
* @param sourceCode - The ESLint `SourceCode` instance.
|
|
112
|
+
* @param anchor - The AST node whose leading comments are scanned.
|
|
113
|
+
* @param allowTag - The JSDoc tag string that opts the function out.
|
|
114
|
+
* @returns True when a JSDoc with the allow tag is present.
|
|
115
|
+
*/ function hasAllowJsdoc(sourceCode, anchor, allowTag) {
|
|
116
|
+
var comments = sourceCode.getCommentsBefore(anchor) || [];
|
|
117
|
+
var allow = false;
|
|
118
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
119
|
+
try {
|
|
120
|
+
for(var _iterator = comments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
121
|
+
var comment = _step.value;
|
|
122
|
+
if (comment.type === 'Block' && comment.value.startsWith('*') && comment.value.includes(allowTag)) {
|
|
123
|
+
allow = true;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
} catch (err) {
|
|
127
|
+
_didIteratorError = true;
|
|
128
|
+
_iteratorError = err;
|
|
129
|
+
} finally{
|
|
130
|
+
try {
|
|
131
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
132
|
+
_iterator.return();
|
|
133
|
+
}
|
|
134
|
+
} finally{
|
|
135
|
+
if (_didIteratorError) {
|
|
136
|
+
throw _iteratorError;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return allow;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Builds a prefer-config-object-style rule with a configurable default `maxParams` threshold.
|
|
144
|
+
* Class constructors and decorated parameters (e.g. NestJS `@Inject`) are exempted. Functions can
|
|
145
|
+
* opt out via a leading JSDoc block carrying the configured allow tag (default `@dbxAllowMultiParams`).
|
|
146
|
+
*
|
|
147
|
+
* @param config - Default threshold and rule description.
|
|
148
|
+
* @returns A complete ESLint rule definition that emits `tooManyParams` reports.
|
|
149
|
+
*/ function createPreferConfigObjectRule(config) {
|
|
150
|
+
return {
|
|
151
|
+
meta: {
|
|
152
|
+
type: 'suggestion',
|
|
153
|
+
docs: {
|
|
154
|
+
description: config.description,
|
|
155
|
+
recommended: true
|
|
156
|
+
},
|
|
157
|
+
messages: {
|
|
158
|
+
tooManyParams: "Function '{{name}}' takes {{count}} positional parameters; use a single config object instead (see dbx__note__typescript-programming → Prefer Single Config Object)."
|
|
159
|
+
},
|
|
160
|
+
schema: [
|
|
161
|
+
{
|
|
162
|
+
type: 'object',
|
|
163
|
+
properties: {
|
|
164
|
+
maxParams: {
|
|
165
|
+
type: 'number',
|
|
166
|
+
minimum: 0,
|
|
167
|
+
description: 'Maximum number of positional parameters before the rule fires.'
|
|
168
|
+
},
|
|
169
|
+
allowJsdocTag: {
|
|
170
|
+
type: 'string',
|
|
171
|
+
description: 'JSDoc tag that opts a function out of this rule.'
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
additionalProperties: false
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
create: function create(context) {
|
|
179
|
+
var _context_options_, _options_maxParams, _options_allowJsdocTag;
|
|
180
|
+
var options = (_context_options_ = context.options[0]) !== null && _context_options_ !== void 0 ? _context_options_ : {};
|
|
181
|
+
var maxParams = (_options_maxParams = options.maxParams) !== null && _options_maxParams !== void 0 ? _options_maxParams : config.defaultMaxParams;
|
|
182
|
+
var allowTag = (_options_allowJsdocTag = options.allowJsdocTag) !== null && _options_allowJsdocTag !== void 0 ? _options_allowJsdocTag : DEFAULT_ALLOW_JSDOC_TAG;
|
|
183
|
+
var sourceCode = context.sourceCode;
|
|
184
|
+
function checkFunction(node) {
|
|
185
|
+
if (!isConstructor(node)) {
|
|
186
|
+
var _node_params;
|
|
187
|
+
var params = (_node_params = node.params) !== null && _node_params !== void 0 ? _node_params : [];
|
|
188
|
+
// Decorated parameters indicate framework-driven signatures (NestJS handlers, Angular DI inside
|
|
189
|
+
// constructors which we already skip — but standalone decorated functions exist too).
|
|
190
|
+
if (!params.some(paramHasDecorator) && params.length > maxParams) {
|
|
191
|
+
var _node_parent, _node_parent_parent;
|
|
192
|
+
// Anchor for JSDoc lookup: prefer the enclosing export statement, then a VariableDeclaration
|
|
193
|
+
// (for `const fn = () => ...`), otherwise the function node itself.
|
|
194
|
+
var anchor = node;
|
|
195
|
+
if (((_node_parent = node.parent) === null || _node_parent === void 0 ? void 0 : _node_parent.type) === 'VariableDeclarator' && ((_node_parent_parent = node.parent.parent) === null || _node_parent_parent === void 0 ? void 0 : _node_parent_parent.type) === 'VariableDeclaration') {
|
|
196
|
+
anchor = node.parent.parent;
|
|
197
|
+
}
|
|
198
|
+
if (anchor.parent && (anchor.parent.type === 'ExportNamedDeclaration' || anchor.parent.type === 'ExportDefaultDeclaration')) {
|
|
199
|
+
anchor = anchor.parent;
|
|
200
|
+
}
|
|
201
|
+
if (!hasAllowJsdoc(sourceCode, anchor, allowTag)) {
|
|
202
|
+
var _node_id;
|
|
203
|
+
var name = getFunctionDisplayName(node);
|
|
204
|
+
context.report({
|
|
205
|
+
node: (_node_id = node.id) !== null && _node_id !== void 0 ? _node_id : node,
|
|
206
|
+
messageId: 'tooManyParams',
|
|
207
|
+
data: {
|
|
208
|
+
name: name,
|
|
209
|
+
count: String(params.length)
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
FunctionDeclaration: checkFunction,
|
|
218
|
+
FunctionExpression: checkFunction,
|
|
219
|
+
ArrowFunctionExpression: checkFunction
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* ESLint rule recommending a single config object when a function takes more than two positional
|
|
226
|
+
* parameters (default `maxParams: 2`, i.e. fires at 3+ args). Intended to be configured at the
|
|
227
|
+
* `warn` severity. Pair with `prefer-config-object-hard` for a stricter cap.
|
|
228
|
+
*
|
|
229
|
+
* @see `dbx__note__typescript-programming` → Prefer Single Config Object
|
|
230
|
+
*/ createPreferConfigObjectRule({
|
|
231
|
+
defaultMaxParams: DEFAULT_MAX_PARAMS_WARN,
|
|
232
|
+
description: 'Prefer a single config object when a function takes more than two positional parameters.'
|
|
233
|
+
});
|
|
234
|
+
/**
|
|
235
|
+
* Hard-stop variant of `prefer-config-object`. Fires when a function takes more than four positional
|
|
236
|
+
* parameters (default `maxParams: 4`, i.e. fires at 5+ args). Intended to be configured at the
|
|
237
|
+
* `error` severity so genuinely unwieldy signatures break the build even when the softer warn-level
|
|
238
|
+
* rule is disabled or downgraded.
|
|
239
|
+
*
|
|
240
|
+
* @see `dbx__note__typescript-programming` → Prefer Single Config Object
|
|
241
|
+
*/ createPreferConfigObjectRule({
|
|
242
|
+
defaultMaxParams: DEFAULT_MAX_PARAMS_HARD,
|
|
243
|
+
description: 'Reject function signatures with more than four positional parameters; require a single config object.'
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
function _array_like_to_array$h(arr, len) {
|
|
247
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
248
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
249
|
+
return arr2;
|
|
250
|
+
}
|
|
251
|
+
function _array_with_holes$a(arr) {
|
|
252
|
+
if (Array.isArray(arr)) return arr;
|
|
253
|
+
}
|
|
254
|
+
function _iterable_to_array_limit$a(arr, i) {
|
|
255
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
256
|
+
if (_i == null) return;
|
|
257
|
+
var _arr = [];
|
|
258
|
+
var _n = true;
|
|
259
|
+
var _d = false;
|
|
260
|
+
var _s, _e;
|
|
261
|
+
try {
|
|
262
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
263
|
+
_arr.push(_s.value);
|
|
264
|
+
if (i && _arr.length === i) break;
|
|
265
|
+
}
|
|
266
|
+
} catch (err) {
|
|
267
|
+
_d = true;
|
|
268
|
+
_e = err;
|
|
269
|
+
} finally{
|
|
270
|
+
try {
|
|
271
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
272
|
+
} finally{
|
|
273
|
+
if (_d) throw _e;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return _arr;
|
|
277
|
+
}
|
|
278
|
+
function _non_iterable_rest$a() {
|
|
279
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
280
|
+
}
|
|
281
|
+
function _sliced_to_array$a(arr, i) {
|
|
282
|
+
return _array_with_holes$a(arr) || _iterable_to_array_limit$a(arr, i) || _unsupported_iterable_to_array$h(arr, i) || _non_iterable_rest$a();
|
|
283
|
+
}
|
|
284
|
+
function _unsupported_iterable_to_array$h(o, minLen) {
|
|
285
|
+
if (!o) return;
|
|
286
|
+
if (typeof o === "string") return _array_like_to_array$h(o, minLen);
|
|
287
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
288
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
289
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
290
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$h(o, minLen);
|
|
291
|
+
}
|
|
292
|
+
var TAG_LINE_REGEX = /^@([A-Za-z_]\w*)\s*(.*)$/;
|
|
293
|
+
var TYPE_ANNOTATION_REGEX = /^\{([^}]*)\}\s*(.*)$/;
|
|
294
|
+
var PARAM_NAME_REGEX = /^([A-Za-z_$][A-Za-z0-9_$.[\]]*)\s*(.*)$/;
|
|
295
|
+
var LINE_PREFIX_REGEX = /^(\s*\*?\s?)(.*)$/;
|
|
296
|
+
/**
|
|
297
|
+
* Strips the leading whitespace + `*` + optional space prefix from a JSDoc body line and reports the length stripped.
|
|
298
|
+
*
|
|
299
|
+
* @param raw - The raw line as it appears in `comment.value`.
|
|
300
|
+
* @returns A `{ text, prefixLength }` pair.
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* ```ts
|
|
304
|
+
* stripPrefix(' * @param x - desc'); // { text: '@param x - desc', prefixLength: 3 }
|
|
305
|
+
* stripPrefix(' *'); // { text: '', prefixLength: 2 }
|
|
306
|
+
* stripPrefix('* hello'); // { text: 'hello', prefixLength: 2 }
|
|
307
|
+
* ```
|
|
308
|
+
*/ function stripPrefix(raw) {
|
|
309
|
+
var match = LINE_PREFIX_REGEX.exec(raw);
|
|
310
|
+
var result = {
|
|
311
|
+
text: raw,
|
|
312
|
+
prefixLength: 0
|
|
313
|
+
};
|
|
314
|
+
if (match) {
|
|
315
|
+
result.text = match[2];
|
|
316
|
+
result.prefixLength = match[1].length;
|
|
317
|
+
}
|
|
318
|
+
return result;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Splits the raw comment value into per-line views with prefix/offset metadata.
|
|
322
|
+
*
|
|
323
|
+
* @param commentValue - The `value` of an ESLint Block comment.
|
|
324
|
+
* @returns Array of parsed line records in source order.
|
|
325
|
+
*/ function buildParsedLines(commentValue) {
|
|
326
|
+
var rawLines = commentValue.split('\n');
|
|
327
|
+
var runningOffset = 0;
|
|
328
|
+
return rawLines.map(function(raw, index) {
|
|
329
|
+
var _stripPrefix = stripPrefix(raw), stripped = _stripPrefix.text, prefixLength = _stripPrefix.prefixLength;
|
|
330
|
+
var text = stripped.trimEnd();
|
|
331
|
+
var blank = text.length === 0;
|
|
332
|
+
var valueOffsetStart = runningOffset;
|
|
333
|
+
var textOffsetStart = runningOffset + prefixLength;
|
|
334
|
+
runningOffset += raw.length + 1; // +1 for the consumed `\n` (overshoots on last line, harmless)
|
|
335
|
+
return {
|
|
336
|
+
raw: raw,
|
|
337
|
+
text: text,
|
|
338
|
+
blank: blank,
|
|
339
|
+
index: index,
|
|
340
|
+
valueOffsetStart: valueOffsetStart,
|
|
341
|
+
textOffsetStart: textOffsetStart
|
|
342
|
+
};
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Computes, per line, whether it sits inside a fenced code block (a ```` ``` ```` block, typically
|
|
347
|
+
* an `@example` body) and therefore must not be treated as a tag boundary. Fence delimiter lines
|
|
348
|
+
* themselves are flagged too. Without this, `@`-prefixed lines inside a fence — decorators like
|
|
349
|
+
* `@Global()` / `@Module()`, or JSDoc snippets — would be mis-parsed as standalone JSDoc tags.
|
|
350
|
+
*
|
|
351
|
+
* @param lines - Parsed lines in source order.
|
|
352
|
+
* @returns Boolean mask where `true` marks a line that must not start a tag.
|
|
353
|
+
*/ function computeFenceMask(lines) {
|
|
354
|
+
var mask = lines.map(function() {
|
|
355
|
+
return false;
|
|
356
|
+
});
|
|
357
|
+
var fenceOpen = false;
|
|
358
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
359
|
+
try {
|
|
360
|
+
for(var _iterator = lines.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
361
|
+
var _step_value = _sliced_to_array$a(_step.value, 2), i = _step_value[0], line = _step_value[1];
|
|
362
|
+
var isDelimiter = line.text.trimStart().startsWith('```');
|
|
363
|
+
if (isDelimiter) {
|
|
364
|
+
mask[i] = true;
|
|
365
|
+
fenceOpen = !fenceOpen;
|
|
366
|
+
} else {
|
|
367
|
+
mask[i] = fenceOpen;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
} catch (err) {
|
|
371
|
+
_didIteratorError = true;
|
|
372
|
+
_iteratorError = err;
|
|
373
|
+
} finally{
|
|
374
|
+
try {
|
|
375
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
376
|
+
_iterator.return();
|
|
377
|
+
}
|
|
378
|
+
} finally{
|
|
379
|
+
if (_didIteratorError) {
|
|
380
|
+
throw _iteratorError;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return mask;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Returns true when the line at `index` opens a JSDoc tag and is not masked out by a code fence.
|
|
388
|
+
*
|
|
389
|
+
* @param lines - Parsed lines in source order.
|
|
390
|
+
* @param fenceMask - Mask from {@link computeFenceMask} marking fenced lines.
|
|
391
|
+
* @param index - Line index to test.
|
|
392
|
+
* @returns True when the line begins a tag that should be treated as a tag boundary.
|
|
393
|
+
*/ function isTagStart(lines, fenceMask, index) {
|
|
394
|
+
return !fenceMask[index] && TAG_LINE_REGEX.test(lines[index].text);
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Returns the index of the first line that begins with a JSDoc `@tag`, or `-1` when none exists.
|
|
398
|
+
*
|
|
399
|
+
* @param lines - Parsed lines in source order.
|
|
400
|
+
* @param fenceMask - Mask from {@link computeFenceMask} marking fenced lines.
|
|
401
|
+
* @returns Zero-based line index of the first tag, or `-1` when no tag is present.
|
|
402
|
+
*/ function findFirstTagIndex(lines, fenceMask) {
|
|
403
|
+
var firstTagIndex = -1;
|
|
404
|
+
for(var i = 0; i < lines.length; i += 1){
|
|
405
|
+
if (isTagStart(lines, fenceMask, i)) {
|
|
406
|
+
firstTagIndex = i;
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return firstTagIndex;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Trims leading and trailing blank lines from a contiguous run of description lines.
|
|
414
|
+
*
|
|
415
|
+
* @param descriptionLines - Description-section lines before any tag.
|
|
416
|
+
* @returns Sub-array with surrounding blank lines stripped.
|
|
417
|
+
*/ function trimBlankBoundaries(descriptionLines) {
|
|
418
|
+
var descStart = 0;
|
|
419
|
+
var descEnd = descriptionLines.length;
|
|
420
|
+
while(descStart < descEnd && descriptionLines[descStart].blank)descStart += 1;
|
|
421
|
+
while(descEnd > descStart && descriptionLines[descEnd - 1].blank)descEnd -= 1;
|
|
422
|
+
return descriptionLines.slice(descStart, descEnd);
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Splits the trimmed description lines into paragraphs separated by blank-line runs.
|
|
426
|
+
*
|
|
427
|
+
* @param trimmedDescription - Description lines with surrounding blank lines removed.
|
|
428
|
+
* @returns Paragraph strings joined by `\n`.
|
|
429
|
+
*/ function buildDescriptionParagraphs(trimmedDescription) {
|
|
430
|
+
var descriptionParagraphs = [];
|
|
431
|
+
var paragraphBuffer = [];
|
|
432
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
433
|
+
try {
|
|
434
|
+
for(var _iterator = trimmedDescription[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
435
|
+
var line = _step.value;
|
|
436
|
+
if (line.blank) {
|
|
437
|
+
if (paragraphBuffer.length > 0) {
|
|
438
|
+
descriptionParagraphs.push(paragraphBuffer.join('\n'));
|
|
439
|
+
paragraphBuffer = [];
|
|
440
|
+
}
|
|
441
|
+
} else {
|
|
442
|
+
paragraphBuffer.push(line.text);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
} catch (err) {
|
|
446
|
+
_didIteratorError = true;
|
|
447
|
+
_iteratorError = err;
|
|
448
|
+
} finally{
|
|
449
|
+
try {
|
|
450
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
451
|
+
_iterator.return();
|
|
452
|
+
}
|
|
453
|
+
} finally{
|
|
454
|
+
if (_didIteratorError) {
|
|
455
|
+
throw _iteratorError;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if (paragraphBuffer.length > 0) {
|
|
460
|
+
descriptionParagraphs.push(paragraphBuffer.join('\n'));
|
|
461
|
+
}
|
|
462
|
+
return descriptionParagraphs;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Pulls an optional `{Type}` annotation off the front of a tag remainder.
|
|
466
|
+
*
|
|
467
|
+
* @param remainder - The tag-line text after the `@tagName` prefix.
|
|
468
|
+
* @returns The annotation (or `undefined`) plus the remaining text.
|
|
469
|
+
*/ function extractTypeAnnotation(remainder) {
|
|
470
|
+
var type;
|
|
471
|
+
var rest = remainder;
|
|
472
|
+
var typeMatch = TYPE_ANNOTATION_REGEX.exec(remainder);
|
|
473
|
+
if (typeMatch) {
|
|
474
|
+
type = typeMatch[1];
|
|
475
|
+
rest = typeMatch[2];
|
|
476
|
+
}
|
|
477
|
+
return {
|
|
478
|
+
type: type,
|
|
479
|
+
rest: rest
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Pulls an optional parameter name off the front of a `@param` tag remainder.
|
|
484
|
+
*
|
|
485
|
+
* @param tagName - Tag name (only `'param'` extracts a name; other tags pass through).
|
|
486
|
+
* @param remainder - The tag-line text after the optional `{Type}` annotation.
|
|
487
|
+
* @returns The parameter name (or `undefined`) plus the remaining text.
|
|
488
|
+
*/ function extractParamName(tagName, remainder) {
|
|
489
|
+
var name;
|
|
490
|
+
var rest = remainder;
|
|
491
|
+
if (tagName === 'param') {
|
|
492
|
+
var nameMatch = PARAM_NAME_REGEX.exec(remainder);
|
|
493
|
+
if (nameMatch) {
|
|
494
|
+
name = nameMatch[1];
|
|
495
|
+
rest = nameMatch[2];
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return {
|
|
499
|
+
name: name,
|
|
500
|
+
rest: rest
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Collects the tag line at `startIndex` plus every following non-tag continuation line.
|
|
505
|
+
*
|
|
506
|
+
* @param lines - All parsed lines in the comment.
|
|
507
|
+
* @param fenceMask - Mask from {@link computeFenceMask} marking fenced lines.
|
|
508
|
+
* @param startIndex - Index of the `@tag` opening line.
|
|
509
|
+
* @returns The collected tag lines and the index of the next unconsumed line.
|
|
510
|
+
*/ function collectTagLines(lines, fenceMask, startIndex) {
|
|
511
|
+
var tagLines = [
|
|
512
|
+
lines[startIndex]
|
|
513
|
+
];
|
|
514
|
+
var j = startIndex + 1;
|
|
515
|
+
while(j < lines.length){
|
|
516
|
+
if (isTagStart(lines, fenceMask, j)) break;
|
|
517
|
+
tagLines.push(lines[j]);
|
|
518
|
+
j += 1;
|
|
519
|
+
}
|
|
520
|
+
return {
|
|
521
|
+
tagLines: tagLines,
|
|
522
|
+
nextIndex: j
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Joins the on-line remainder and continuation-line text into a tag description, dropping trailing
|
|
527
|
+
* blank lines while preserving interior blanks.
|
|
528
|
+
*
|
|
529
|
+
* @param remainder - The on-line remainder after stripping `@tagName {Type} name`.
|
|
530
|
+
* @param tagLines - All lines that belong to the tag (including the header line at index 0).
|
|
531
|
+
* @returns Description text joined by `\n`.
|
|
532
|
+
*/ function buildTagDescription(remainder, tagLines) {
|
|
533
|
+
var descriptionParts = [];
|
|
534
|
+
if (remainder.length > 0) descriptionParts.push(remainder);
|
|
535
|
+
for(var k = 1; k < tagLines.length; k += 1){
|
|
536
|
+
descriptionParts.push(tagLines[k].text);
|
|
537
|
+
}
|
|
538
|
+
while(descriptionParts.length > 0 && descriptionParts.at(-1).trim().length === 0){
|
|
539
|
+
descriptionParts.pop();
|
|
540
|
+
}
|
|
541
|
+
return descriptionParts.join('\n');
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Builds a single parsed-tag record starting at `startIndex` in the line array.
|
|
545
|
+
*
|
|
546
|
+
* @param lines - All parsed lines in the comment.
|
|
547
|
+
* @param fenceMask - Mask from {@link computeFenceMask} marking fenced lines.
|
|
548
|
+
* @param startIndex - Index of the `@tag` opening line.
|
|
549
|
+
* @returns The parsed tag and the next unconsumed line index.
|
|
550
|
+
*/ function parseTagAt(lines, fenceMask, startIndex) {
|
|
551
|
+
var line = lines[startIndex];
|
|
552
|
+
var match = TAG_LINE_REGEX.exec(line.text);
|
|
553
|
+
var tagName = match[1];
|
|
554
|
+
var _extractTypeAnnotation = extractTypeAnnotation(match[2]), type = _extractTypeAnnotation.type, afterType = _extractTypeAnnotation.rest;
|
|
555
|
+
var _extractParamName = extractParamName(tagName, afterType), name = _extractParamName.name, afterName = _extractParamName.rest;
|
|
556
|
+
var _collectTagLines = collectTagLines(lines, fenceMask, startIndex), tagLines = _collectTagLines.tagLines, nextIndex = _collectTagLines.nextIndex;
|
|
557
|
+
var description = buildTagDescription(afterName, tagLines);
|
|
558
|
+
return {
|
|
559
|
+
tag: {
|
|
560
|
+
tag: tagName,
|
|
561
|
+
name: name,
|
|
562
|
+
type: type,
|
|
563
|
+
description: description,
|
|
564
|
+
lines: tagLines,
|
|
565
|
+
startLineIndex: startIndex,
|
|
566
|
+
endLineIndex: nextIndex - 1
|
|
567
|
+
},
|
|
568
|
+
nextIndex: nextIndex
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Parses every `@tag` block starting from `firstTagIndex` to the end of the line array.
|
|
573
|
+
*
|
|
574
|
+
* @param lines - All parsed lines in the comment.
|
|
575
|
+
* @param fenceMask - Mask from {@link computeFenceMask} marking fenced lines.
|
|
576
|
+
* @param firstTagIndex - Index where tag parsing should begin (`-1` skips entirely).
|
|
577
|
+
* @returns All parsed tags in source order.
|
|
578
|
+
*/ function parseTags(lines, fenceMask, firstTagIndex) {
|
|
579
|
+
var tags = [];
|
|
580
|
+
if (firstTagIndex !== -1) {
|
|
581
|
+
var i = firstTagIndex;
|
|
582
|
+
while(i < lines.length){
|
|
583
|
+
if (!isTagStart(lines, fenceMask, i)) {
|
|
584
|
+
i += 1;
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
var _parseTagAt = parseTagAt(lines, fenceMask, i), tag = _parseTagAt.tag, nextIndex = _parseTagAt.nextIndex;
|
|
588
|
+
tags.push(tag);
|
|
589
|
+
i = nextIndex;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
return tags;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Parses the value of an ESLint Block comment that represents a JSDoc into a structured form.
|
|
596
|
+
*
|
|
597
|
+
* @param commentValue - The `value` of an ESLint Block comment (text between `/*` and `*\/`, including the leading `*`).
|
|
598
|
+
* @returns A structured view of the JSDoc with description, paragraphs, and tags.
|
|
599
|
+
*
|
|
600
|
+
* @example
|
|
601
|
+
* ```ts
|
|
602
|
+
* const parsed = parseJsdocComment('*\n * Hello.\n *\n * @param x - The value.\n ');
|
|
603
|
+
* // parsed.description === 'Hello.'
|
|
604
|
+
* // parsed.tags[0].tag === 'param'
|
|
605
|
+
* // parsed.tags[0].name === 'x'
|
|
606
|
+
* // parsed.tags[0].description === 'The value.'
|
|
607
|
+
* ```
|
|
608
|
+
*/ function parseJsdocComment(commentValue) {
|
|
609
|
+
var singleLine = !commentValue.includes('\n');
|
|
610
|
+
var lines = buildParsedLines(commentValue);
|
|
611
|
+
var fenceMask = computeFenceMask(lines);
|
|
612
|
+
var firstTagIndex = findFirstTagIndex(lines, fenceMask);
|
|
613
|
+
var descriptionLines = firstTagIndex === -1 ? lines.slice() : lines.slice(0, firstTagIndex);
|
|
614
|
+
var trimmedDescription = trimBlankBoundaries(descriptionLines);
|
|
615
|
+
var description = trimmedDescription.map(function(l) {
|
|
616
|
+
return l.text;
|
|
617
|
+
}).join('\n');
|
|
618
|
+
var descriptionParagraphs = buildDescriptionParagraphs(trimmedDescription);
|
|
619
|
+
var tags = parseTags(lines, fenceMask, firstTagIndex);
|
|
620
|
+
return {
|
|
621
|
+
lines: lines,
|
|
622
|
+
descriptionLines: descriptionLines,
|
|
623
|
+
description: description,
|
|
624
|
+
descriptionParagraphs: descriptionParagraphs,
|
|
625
|
+
tags: tags,
|
|
626
|
+
singleLine: singleLine
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Shared helpers for the `@dbx<Family>` companion-tag ESLint rules. Mirrors the
|
|
632
|
+
* scanner schemas in `packages/dbx-cli/src/lib/mcp-scan/scan/*-extract.ts` so
|
|
633
|
+
* violations surface at lint time instead of at manifest-regeneration time.
|
|
634
|
+
*
|
|
635
|
+
* Each per-family rule supplies a {@link DbxTagFamilySpec} describing which
|
|
636
|
+
* companions are required/optional, what value format each accepts, and which
|
|
637
|
+
* messageId to emit when a check fails. The rule body itself only wires the
|
|
638
|
+
* visitors and message map; all value-format validation lives here.
|
|
639
|
+
*/ function _array_like_to_array$g(arr, len) {
|
|
640
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
641
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
642
|
+
return arr2;
|
|
643
|
+
}
|
|
644
|
+
function _array_with_holes$9(arr) {
|
|
645
|
+
if (Array.isArray(arr)) return arr;
|
|
646
|
+
}
|
|
647
|
+
function _iterable_to_array_limit$9(arr, i) {
|
|
648
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
649
|
+
if (_i == null) return;
|
|
650
|
+
var _arr = [];
|
|
651
|
+
var _n = true;
|
|
652
|
+
var _d = false;
|
|
653
|
+
var _s, _e;
|
|
654
|
+
try {
|
|
655
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
656
|
+
_arr.push(_s.value);
|
|
657
|
+
if (i && _arr.length === i) break;
|
|
658
|
+
}
|
|
659
|
+
} catch (err) {
|
|
660
|
+
_d = true;
|
|
661
|
+
_e = err;
|
|
662
|
+
} finally{
|
|
663
|
+
try {
|
|
664
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
665
|
+
} finally{
|
|
666
|
+
if (_d) throw _e;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
return _arr;
|
|
670
|
+
}
|
|
671
|
+
function _non_iterable_rest$9() {
|
|
672
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
673
|
+
}
|
|
674
|
+
function _sliced_to_array$9(arr, i) {
|
|
675
|
+
return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$g(arr, i) || _non_iterable_rest$9();
|
|
676
|
+
}
|
|
677
|
+
function _unsupported_iterable_to_array$g(o, minLen) {
|
|
678
|
+
if (!o) return;
|
|
679
|
+
if (typeof o === "string") return _array_like_to_array$g(o, minLen);
|
|
680
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
681
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
682
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
683
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Kebab-case slug pattern: lowercase letters/digits, words separated by single hyphens,
|
|
687
|
+
* starts with a letter. Used to validate slug/related/skill-ref values.
|
|
688
|
+
*/ var KEBAB_SLUG_PATTERN = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
|
|
689
|
+
/**
|
|
690
|
+
* Pascal-case TypeScript identifier pattern (starts uppercase). Used for model
|
|
691
|
+
* identifiers and other `<ModelName>` style tag values.
|
|
692
|
+
*/ var PASCAL_IDENTIFIER_PATTERN$1 = /^[A-Z][A-Za-z0-9_$]*$/;
|
|
693
|
+
/**
|
|
694
|
+
* Boolean tag-value vocabulary (case-insensitive). `''` and `true|yes` map to
|
|
695
|
+
* true; `false|no` map to false. Anything else is flagged as invalid.
|
|
696
|
+
*/ var TRUE_TAG_VALUES = new Set([
|
|
697
|
+
'',
|
|
698
|
+
'true',
|
|
699
|
+
'yes'
|
|
700
|
+
]);
|
|
701
|
+
var FALSE_TAG_VALUES = new Set([
|
|
702
|
+
'false',
|
|
703
|
+
'no'
|
|
704
|
+
]);
|
|
705
|
+
/**
|
|
706
|
+
* Splits a comma-separated tag-value string into trimmed items, preserving order.
|
|
707
|
+
*
|
|
708
|
+
* @param value - Raw text following the tag name on a single line.
|
|
709
|
+
* @returns Non-empty trimmed segments in declaration order.
|
|
710
|
+
*/ function splitCommaSeparated(value) {
|
|
711
|
+
return value.split(',').map(function(item) {
|
|
712
|
+
return item.trim();
|
|
713
|
+
}).filter(function(item) {
|
|
714
|
+
return item.length > 0;
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Parses a boolean tag value using the workspace vocabulary
|
|
719
|
+
* (`''`/`true`/`yes` → true; `false`/`no` → false). Other inputs return `undefined`.
|
|
720
|
+
*
|
|
721
|
+
* @param text - The trimmed tag value text.
|
|
722
|
+
* @returns The parsed boolean, or `undefined` when the text is not in the vocabulary.
|
|
723
|
+
*/ function parseBooleanTagValue(text) {
|
|
724
|
+
var lowered = text.trim().toLowerCase();
|
|
725
|
+
var result;
|
|
726
|
+
if (TRUE_TAG_VALUES.has(lowered)) {
|
|
727
|
+
result = true;
|
|
728
|
+
} else if (FALSE_TAG_VALUES.has(lowered)) {
|
|
729
|
+
result = false;
|
|
730
|
+
}
|
|
731
|
+
return result;
|
|
732
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* Returns the source-text offset of an offset-within-comment-value, given a Block comment node.
|
|
735
|
+
*
|
|
736
|
+
* @param commentNode - The ESLint Block comment AST node.
|
|
737
|
+
* @param valueOffset - The character offset within `comment.value`.
|
|
738
|
+
* @returns The character offset in the source file.
|
|
739
|
+
*/ function commentValueToSourceOffset(commentNode, valueOffset) {
|
|
740
|
+
return commentNode.range[0] + 2 + valueOffset;
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* Returns the family marker + companion tag list for the given parsed JSDoc.
|
|
744
|
+
* Family membership is determined by tag-name prefix.
|
|
745
|
+
*
|
|
746
|
+
* @param parsed - The parsed JSDoc.
|
|
747
|
+
* @param marker - The bare family marker (e.g. `'dbxPipe'`).
|
|
748
|
+
* @returns The marker tag (if present), and all companion tags in source order.
|
|
749
|
+
*/ function findFamilyTags(parsed, marker) {
|
|
750
|
+
var familyTags = parsed.tags.filter(function(t) {
|
|
751
|
+
return t.tag === marker || t.tag.startsWith(marker);
|
|
752
|
+
});
|
|
753
|
+
var markerTag = parsed.tags.find(function(t) {
|
|
754
|
+
return t.tag === marker;
|
|
755
|
+
});
|
|
756
|
+
return {
|
|
757
|
+
markerTag: markerTag,
|
|
758
|
+
familyTags: familyTags
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Groups companion tags (those after the marker) by suffix. Marker entries are excluded.
|
|
763
|
+
*
|
|
764
|
+
* @param familyTags - The family tag list from {@link findFamilyTags}.
|
|
765
|
+
* @param marker - The bare family marker.
|
|
766
|
+
* @returns Lookup keyed by companion-suffix listing matching tags in declaration order.
|
|
767
|
+
*/ function groupCompanionsBySuffix(familyTags, marker) {
|
|
768
|
+
var result = new Map();
|
|
769
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
770
|
+
try {
|
|
771
|
+
for(var _iterator = familyTags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
772
|
+
var tag = _step.value;
|
|
773
|
+
var _result_get;
|
|
774
|
+
if (tag.tag === marker) continue;
|
|
775
|
+
var suffix = tag.tag.slice(marker.length);
|
|
776
|
+
var list = (_result_get = result.get(suffix)) !== null && _result_get !== void 0 ? _result_get : [];
|
|
777
|
+
list.push(tag);
|
|
778
|
+
result.set(suffix, list);
|
|
779
|
+
}
|
|
780
|
+
} catch (err) {
|
|
781
|
+
_didIteratorError = true;
|
|
782
|
+
_iteratorError = err;
|
|
783
|
+
} finally{
|
|
784
|
+
try {
|
|
785
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
786
|
+
_iterator.return();
|
|
787
|
+
}
|
|
788
|
+
} finally{
|
|
789
|
+
if (_didIteratorError) {
|
|
790
|
+
throw _iteratorError;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
return result;
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Per-format validators dispatched from {@link validateCompanionValue}. Each entry validates
|
|
798
|
+
* a single non-empty tag value and emits zero or more violations.
|
|
799
|
+
*/ var VALUE_VALIDATORS = {
|
|
800
|
+
marker: function marker() {
|
|
801
|
+
return undefined;
|
|
802
|
+
},
|
|
803
|
+
'free-text': function() {
|
|
804
|
+
return undefined;
|
|
805
|
+
},
|
|
806
|
+
'comma-list-free-text': function() {
|
|
807
|
+
return undefined;
|
|
808
|
+
},
|
|
809
|
+
'kebab-slug': function(param) {
|
|
810
|
+
var spec = param.spec, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
|
|
811
|
+
if (!KEBAB_SLUG_PATTERN.test(value)) emit({
|
|
812
|
+
kind: 'invalid-kebab',
|
|
813
|
+
suffix: spec.suffix,
|
|
814
|
+
value: value,
|
|
815
|
+
lineIndex: lineIndex
|
|
816
|
+
});
|
|
817
|
+
},
|
|
818
|
+
enum: function _enum(param) {
|
|
819
|
+
var spec = param.spec, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
|
|
820
|
+
var format = spec.format;
|
|
821
|
+
if (!format.values.includes(value)) emit({
|
|
822
|
+
kind: 'invalid-enum',
|
|
823
|
+
suffix: spec.suffix,
|
|
824
|
+
value: value,
|
|
825
|
+
allowed: format.values,
|
|
826
|
+
lineIndex: lineIndex
|
|
827
|
+
});
|
|
828
|
+
},
|
|
829
|
+
'pascal-identifier': function(param) {
|
|
830
|
+
var spec = param.spec, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
|
|
831
|
+
if (!PASCAL_IDENTIFIER_PATTERN$1.test(value)) emit({
|
|
832
|
+
kind: 'invalid-pascal',
|
|
833
|
+
suffix: spec.suffix,
|
|
834
|
+
value: value,
|
|
835
|
+
lineIndex: lineIndex
|
|
836
|
+
});
|
|
837
|
+
},
|
|
838
|
+
'comma-list-kebab-slug': function(param) {
|
|
839
|
+
var spec = param.spec, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
|
|
840
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
841
|
+
try {
|
|
842
|
+
for(var _iterator = splitCommaSeparated(value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
843
|
+
var item = _step.value;
|
|
844
|
+
if (!KEBAB_SLUG_PATTERN.test(item)) emit({
|
|
845
|
+
kind: 'comma-item-not-kebab',
|
|
846
|
+
suffix: spec.suffix,
|
|
847
|
+
value: item,
|
|
848
|
+
lineIndex: lineIndex
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
} catch (err) {
|
|
852
|
+
_didIteratorError = true;
|
|
853
|
+
_iteratorError = err;
|
|
854
|
+
} finally{
|
|
855
|
+
try {
|
|
856
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
857
|
+
_iterator.return();
|
|
858
|
+
}
|
|
859
|
+
} finally{
|
|
860
|
+
if (_didIteratorError) {
|
|
861
|
+
throw _iteratorError;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
},
|
|
866
|
+
'comma-list-lowercase': function(param) {
|
|
867
|
+
var spec = param.spec, tag = param.tag, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
|
|
868
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
869
|
+
try {
|
|
870
|
+
for(var _iterator = splitCommaSeparated(value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
871
|
+
var item = _step.value;
|
|
872
|
+
if (/[A-Z]/.test(item)) emit({
|
|
873
|
+
kind: 'tags-not-lowercase',
|
|
874
|
+
suffix: spec.suffix,
|
|
875
|
+
value: item,
|
|
876
|
+
lineIndex: lineIndex,
|
|
877
|
+
raw: tag
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
} catch (err) {
|
|
881
|
+
_didIteratorError = true;
|
|
882
|
+
_iteratorError = err;
|
|
883
|
+
} finally{
|
|
884
|
+
try {
|
|
885
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
886
|
+
_iterator.return();
|
|
887
|
+
}
|
|
888
|
+
} finally{
|
|
889
|
+
if (_didIteratorError) {
|
|
890
|
+
throw _iteratorError;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
},
|
|
895
|
+
boolean: function boolean(param) {
|
|
896
|
+
var spec = param.spec, value = param.value, lineIndex = param.lineIndex, emit = param.emit;
|
|
897
|
+
if (parseBooleanTagValue(value) === undefined) emit({
|
|
898
|
+
kind: 'invalid-boolean',
|
|
899
|
+
suffix: spec.suffix,
|
|
900
|
+
value: value,
|
|
901
|
+
lineIndex: lineIndex
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
/**
|
|
906
|
+
* Validates one companion tag's value against the configured {@link DbxTagFormat}
|
|
907
|
+
* and emits zero-or-more violations. Used by {@link checkDbxTagFamily} to keep
|
|
908
|
+
* each rule's body small.
|
|
909
|
+
*
|
|
910
|
+
* @param spec - The companion spec being validated.
|
|
911
|
+
* @param tags - All occurrences of the companion in source order.
|
|
912
|
+
* @param emit - Callback for each violation.
|
|
913
|
+
*/ function validateCompanionValue(spec, tags, emit) {
|
|
914
|
+
if (spec.format.kind === 'marker') return;
|
|
915
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
916
|
+
try {
|
|
917
|
+
for(var _iterator = tags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
918
|
+
var tag = _step.value;
|
|
919
|
+
var value = tag.description.trim();
|
|
920
|
+
var lineIndex = tag.startLineIndex;
|
|
921
|
+
if (value.length === 0) {
|
|
922
|
+
if (spec.format.kind !== 'boolean') emit({
|
|
923
|
+
kind: 'empty',
|
|
924
|
+
suffix: spec.suffix,
|
|
925
|
+
lineIndex: lineIndex
|
|
926
|
+
});
|
|
927
|
+
continue;
|
|
928
|
+
}
|
|
929
|
+
var validator = VALUE_VALIDATORS[spec.format.kind];
|
|
930
|
+
if (validator) validator({
|
|
931
|
+
spec: spec,
|
|
932
|
+
tag: tag,
|
|
933
|
+
value: value,
|
|
934
|
+
lineIndex: lineIndex,
|
|
935
|
+
emit: emit
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
} catch (err) {
|
|
939
|
+
_didIteratorError = true;
|
|
940
|
+
_iteratorError = err;
|
|
941
|
+
} finally{
|
|
942
|
+
try {
|
|
943
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
944
|
+
_iterator.return();
|
|
945
|
+
}
|
|
946
|
+
} finally{
|
|
947
|
+
if (_didIteratorError) {
|
|
948
|
+
throw _iteratorError;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
function emitUnknownCompanions(groups, knownSuffixes, emit) {
|
|
954
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
955
|
+
try {
|
|
956
|
+
for(var _iterator = groups.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
957
|
+
var _step_value = _sliced_to_array$9(_step.value, 2), suffix = _step_value[0], instances = _step_value[1];
|
|
958
|
+
if (knownSuffixes.has(suffix)) continue;
|
|
959
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
960
|
+
try {
|
|
961
|
+
for(var _iterator1 = instances[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
962
|
+
var tag = _step1.value;
|
|
963
|
+
emit({
|
|
964
|
+
kind: 'unknown',
|
|
965
|
+
suffix: suffix,
|
|
966
|
+
lineIndex: tag.startLineIndex
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
} catch (err) {
|
|
970
|
+
_didIteratorError1 = true;
|
|
971
|
+
_iteratorError1 = err;
|
|
972
|
+
} finally{
|
|
973
|
+
try {
|
|
974
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
975
|
+
_iterator1.return();
|
|
976
|
+
}
|
|
977
|
+
} finally{
|
|
978
|
+
if (_didIteratorError1) {
|
|
979
|
+
throw _iteratorError1;
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
} catch (err) {
|
|
985
|
+
_didIteratorError = true;
|
|
986
|
+
_iteratorError = err;
|
|
987
|
+
} finally{
|
|
988
|
+
try {
|
|
989
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
990
|
+
_iterator.return();
|
|
991
|
+
}
|
|
992
|
+
} finally{
|
|
993
|
+
if (_didIteratorError) {
|
|
994
|
+
throw _iteratorError;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
function emitDuplicateCompanions(companion, instances, emit) {
|
|
1000
|
+
for(var i = 1; i < instances.length; i += 1){
|
|
1001
|
+
emit({
|
|
1002
|
+
kind: 'duplicate',
|
|
1003
|
+
suffix: companion.suffix,
|
|
1004
|
+
lineIndex: instances[i].startLineIndex
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
function checkCompanion(input) {
|
|
1009
|
+
var companion = input.companion, instances = input.instances, markerLineIndex = input.markerLineIndex, emit = input.emit;
|
|
1010
|
+
if (instances.length === 0) {
|
|
1011
|
+
if (companion.required) emit({
|
|
1012
|
+
kind: 'missing',
|
|
1013
|
+
suffix: companion.suffix,
|
|
1014
|
+
lineIndex: markerLineIndex
|
|
1015
|
+
});
|
|
1016
|
+
return;
|
|
1017
|
+
}
|
|
1018
|
+
if (!companion.multiple && instances.length > 1) emitDuplicateCompanions(companion, instances, emit);
|
|
1019
|
+
validateCompanionValue(companion, instances, emit);
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Validates a `@dbx<Family>` marker plus its companion tags against the supplied spec.
|
|
1023
|
+
* Reports unknown companions, missing required companions, duplicates, and per-companion
|
|
1024
|
+
* value violations through `input.emit`.
|
|
1025
|
+
*
|
|
1026
|
+
* @param input - Parsed JSDoc, family spec, resolved marker/companion tags, and emit sink.
|
|
1027
|
+
*
|
|
1028
|
+
* @example
|
|
1029
|
+
* ```ts
|
|
1030
|
+
* checkDbxTagFamily({ parsed, spec, markerTag, familyTags, emit });
|
|
1031
|
+
* ```
|
|
1032
|
+
*/ function checkDbxTagFamily(input) {
|
|
1033
|
+
var spec = input.spec, markerTag = input.markerTag, familyTags = input.familyTags, emit = input.emit;
|
|
1034
|
+
var knownSuffixes = new Set(spec.companions.map(function(c) {
|
|
1035
|
+
return c.suffix;
|
|
1036
|
+
}));
|
|
1037
|
+
var groups = groupCompanionsBySuffix(familyTags, spec.marker);
|
|
1038
|
+
emitUnknownCompanions(groups, knownSuffixes, emit);
|
|
1039
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1040
|
+
try {
|
|
1041
|
+
for(var _iterator = spec.companions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1042
|
+
var companion = _step.value;
|
|
1043
|
+
var _groups_get;
|
|
1044
|
+
var instances = (_groups_get = groups.get(companion.suffix)) !== null && _groups_get !== void 0 ? _groups_get : [];
|
|
1045
|
+
checkCompanion({
|
|
1046
|
+
companion: companion,
|
|
1047
|
+
instances: instances,
|
|
1048
|
+
markerLineIndex: markerTag.startLineIndex,
|
|
1049
|
+
emit: emit
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
} catch (err) {
|
|
1053
|
+
_didIteratorError = true;
|
|
1054
|
+
_iteratorError = err;
|
|
1055
|
+
} finally{
|
|
1056
|
+
try {
|
|
1057
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1058
|
+
_iterator.return();
|
|
1059
|
+
}
|
|
1060
|
+
} finally{
|
|
1061
|
+
if (_didIteratorError) {
|
|
1062
|
+
throw _iteratorError;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Translates a JSDoc-line violation into an ESLint `context.report()` call by computing the
|
|
1069
|
+
* source range of the offending line and attaching the supplied message + optional fixer.
|
|
1070
|
+
*
|
|
1071
|
+
* @param input - Reporting context (comment node, parsed JSDoc, source code, line index, message id, optional data + fixer, report sink).
|
|
1072
|
+
*
|
|
1073
|
+
* @example
|
|
1074
|
+
* ```ts
|
|
1075
|
+
* reportOnJsdocLine({ commentNode, parsed, sourceCode, lineIndex: tag.startLineIndex, messageId: 'unknown', report: context.report });
|
|
1076
|
+
* ```
|
|
1077
|
+
*/ function reportOnJsdocLine(input) {
|
|
1078
|
+
var _ref, _ref1;
|
|
1079
|
+
var _line_text;
|
|
1080
|
+
var commentNode = input.commentNode, parsed = input.parsed, sourceCode = input.sourceCode, lineIndex = input.lineIndex, messageId = input.messageId, data = input.data, report = input.report, fix = input.fix;
|
|
1081
|
+
var line = parsed.lines[lineIndex];
|
|
1082
|
+
var startInValue = (_ref = line === null || line === void 0 ? void 0 : line.textOffsetStart) !== null && _ref !== void 0 ? _ref : 0;
|
|
1083
|
+
var endInValue = startInValue + ((_ref1 = line === null || line === void 0 ? void 0 : (_line_text = line.text) === null || _line_text === void 0 ? void 0 : _line_text.length) !== null && _ref1 !== void 0 ? _ref1 : 0);
|
|
1084
|
+
var start = commentValueToSourceOffset(commentNode, startInValue);
|
|
1085
|
+
var end = commentValueToSourceOffset(commentNode, endInValue);
|
|
1086
|
+
report({
|
|
1087
|
+
loc: {
|
|
1088
|
+
type: 'SourceLocation',
|
|
1089
|
+
start: sourceCode.getLocFromIndex(start),
|
|
1090
|
+
end: sourceCode.getLocFromIndex(end)
|
|
1091
|
+
},
|
|
1092
|
+
messageId: messageId,
|
|
1093
|
+
data: data,
|
|
1094
|
+
fix: fix
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Computes an auto-fix descriptor that lowercases every token after a `@dbx<Family>Tags` tag
|
|
1099
|
+
* name. Returns `undefined` when the line is already canonical so the caller can short-circuit.
|
|
1100
|
+
*
|
|
1101
|
+
* @param input - Fix context (comment node, parsed JSDoc, source code, target tag).
|
|
1102
|
+
* @returns Replacement range + text when a rewrite is needed; otherwise `undefined`.
|
|
1103
|
+
*
|
|
1104
|
+
* @example
|
|
1105
|
+
* ```ts
|
|
1106
|
+
* const fix = buildLowercaseTagsFix({ commentNode, parsed, sourceCode, tag });
|
|
1107
|
+
* ```
|
|
1108
|
+
*/ function buildLowercaseTagsFix(input) {
|
|
1109
|
+
var commentNode = input.commentNode, parsed = input.parsed, sourceCode = input.sourceCode, tag = input.tag;
|
|
1110
|
+
var tagLine = parsed.lines[tag.startLineIndex];
|
|
1111
|
+
var result;
|
|
1112
|
+
if (tagLine) {
|
|
1113
|
+
var tagLineSourceStart = commentValueToSourceOffset(commentNode, tagLine.textOffsetStart);
|
|
1114
|
+
var tagLineSourceEnd = tagLineSourceStart + tagLine.text.length;
|
|
1115
|
+
var sourceText = sourceCode.getText();
|
|
1116
|
+
var lineSource = sourceText.slice(tagLineSourceStart, tagLineSourceEnd);
|
|
1117
|
+
var lowered = lineSource.replace(/^(@[A-Za-z]+\s+)(.*)$/, function(_match, prefix, body) {
|
|
1118
|
+
return "".concat(prefix).concat(body.toLowerCase());
|
|
1119
|
+
});
|
|
1120
|
+
if (lowered !== lineSource) {
|
|
1121
|
+
result = {
|
|
1122
|
+
startOffset: tagLineSourceStart,
|
|
1123
|
+
endOffset: tagLineSourceEnd,
|
|
1124
|
+
replacement: lowered
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
return result;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
8
1131
|
function _array_like_to_array$f(arr, len) {
|
|
9
1132
|
if (len == null || len > arr.length) len = arr.length;
|
|
10
1133
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -1341,7 +2464,6 @@ var DEFAULT_KNOWN_COMPANIONS = [
|
|
|
1341
2464
|
if (familyTags.length === 0 || requireBareMarker && !markerTag) return;
|
|
1342
2465
|
var triggerTag = markerTag !== null && markerTag !== void 0 ? markerTag : familyTags[0];
|
|
1343
2466
|
checkDbxTagFamily({
|
|
1344
|
-
parsed: parsed,
|
|
1345
2467
|
spec: spec,
|
|
1346
2468
|
markerTag: triggerTag,
|
|
1347
2469
|
familyTags: familyTags,
|
|
@@ -1980,7 +3102,7 @@ function _unsupported_iterable_to_array$c(o, minLen) {
|
|
|
1980
3102
|
*/ var MODEL_FIREBASE_CRUD_FUNCTION_CONFIG_MAP_TYPE_NAME = 'ModelFirebaseCrudFunctionConfigMap';
|
|
1981
3103
|
/**
|
|
1982
3104
|
* CRUD verb names supported by `ModelFirebaseCrudFunctionConfigMap`. Mirrors the
|
|
1983
|
-
* `create | read | update | delete | query` verbs in the type definition at
|
|
3105
|
+
* `create | read | update | delete | query | invoke` verbs in the type definition at
|
|
1984
3106
|
* `packages/firebase/src/lib/client/function/model.function.factory.ts`.
|
|
1985
3107
|
*/ var DEFAULT_CRUD_VERB_NAMES = [
|
|
1986
3108
|
'create',
|
|
@@ -16105,6 +17227,415 @@ function reportCompositeKeyTag(ctx, tag, allowedEncodings) {
|
|
|
16105
17227
|
}
|
|
16106
17228
|
};
|
|
16107
17229
|
|
|
17230
|
+
var SPEC_SUFFIX = '.spec.ts';
|
|
17231
|
+
/**
|
|
17232
|
+
* Classifies a spec filename against the conventions for the given parent
|
|
17233
|
+
* folder. Pure function — never touches the filesystem.
|
|
17234
|
+
*
|
|
17235
|
+
* @param config - Inputs.
|
|
17236
|
+
* @param config.filename - Bare filename including the `.spec.ts` suffix
|
|
17237
|
+
* (e.g. `job.scenario.requirement.spec.ts`).
|
|
17238
|
+
* @param config.parentFolderName - Name of the directory containing the file
|
|
17239
|
+
* (e.g. `job`). Used to detect cross-group misplacement.
|
|
17240
|
+
* @returns The classification.
|
|
17241
|
+
*/ function classifySpecFile(config) {
|
|
17242
|
+
var filename = config.filename, parentFolderName = config.parentFolderName;
|
|
17243
|
+
var result;
|
|
17244
|
+
if (!filename.endsWith(SPEC_SUFFIX)) {
|
|
17245
|
+
result = {
|
|
17246
|
+
filename: filename,
|
|
17247
|
+
group: '',
|
|
17248
|
+
kind: 'non-spec',
|
|
17249
|
+
subgroups: [],
|
|
17250
|
+
isCanonical: false
|
|
17251
|
+
};
|
|
17252
|
+
} else {
|
|
17253
|
+
var _parts_;
|
|
17254
|
+
var stem = filename.slice(0, -SPEC_SUFFIX.length);
|
|
17255
|
+
var parts = stem.split('.');
|
|
17256
|
+
var group = (_parts_ = parts[0]) !== null && _parts_ !== void 0 ? _parts_ : '';
|
|
17257
|
+
if (group !== parentFolderName) {
|
|
17258
|
+
result = {
|
|
17259
|
+
filename: filename,
|
|
17260
|
+
group: group,
|
|
17261
|
+
kind: 'non-group',
|
|
17262
|
+
subgroups: [],
|
|
17263
|
+
isCanonical: false
|
|
17264
|
+
};
|
|
17265
|
+
} else {
|
|
17266
|
+
var rest = parts.slice(1);
|
|
17267
|
+
result = classifyRemainingSegments({
|
|
17268
|
+
filename: filename,
|
|
17269
|
+
group: group,
|
|
17270
|
+
rest: rest
|
|
17271
|
+
});
|
|
17272
|
+
}
|
|
17273
|
+
}
|
|
17274
|
+
return result;
|
|
17275
|
+
}
|
|
17276
|
+
function classifyRemainingSegments(config) {
|
|
17277
|
+
var filename = config.filename, group = config.group, rest = config.rest;
|
|
17278
|
+
var result;
|
|
17279
|
+
var crudIdx = rest.indexOf('crud');
|
|
17280
|
+
var scenarioIdx = rest.indexOf('scenario');
|
|
17281
|
+
if (crudIdx === 0) {
|
|
17282
|
+
if (rest.length === 1) {
|
|
17283
|
+
result = {
|
|
17284
|
+
filename: filename,
|
|
17285
|
+
group: group,
|
|
17286
|
+
kind: 'crud',
|
|
17287
|
+
subgroups: [],
|
|
17288
|
+
isCanonical: true
|
|
17289
|
+
};
|
|
17290
|
+
} else {
|
|
17291
|
+
result = {
|
|
17292
|
+
filename: filename,
|
|
17293
|
+
group: group,
|
|
17294
|
+
kind: 'crud-subgroup',
|
|
17295
|
+
subgroups: rest.slice(1),
|
|
17296
|
+
isCanonical: true
|
|
17297
|
+
};
|
|
17298
|
+
}
|
|
17299
|
+
} else if (scenarioIdx === 0) {
|
|
17300
|
+
if (rest.length === 1) {
|
|
17301
|
+
result = {
|
|
17302
|
+
filename: filename,
|
|
17303
|
+
group: group,
|
|
17304
|
+
kind: 'scenario',
|
|
17305
|
+
subgroups: [],
|
|
17306
|
+
isCanonical: true
|
|
17307
|
+
};
|
|
17308
|
+
} else {
|
|
17309
|
+
result = {
|
|
17310
|
+
filename: filename,
|
|
17311
|
+
group: group,
|
|
17312
|
+
kind: 'scenario-subgroup',
|
|
17313
|
+
subgroups: rest.slice(1),
|
|
17314
|
+
isCanonical: true
|
|
17315
|
+
};
|
|
17316
|
+
}
|
|
17317
|
+
} else if (crudIdx > 0) {
|
|
17318
|
+
var subgroups = rest.filter(function(_, i) {
|
|
17319
|
+
return i !== crudIdx;
|
|
17320
|
+
});
|
|
17321
|
+
var recommendedRename = buildCanonicalFilename({
|
|
17322
|
+
group: group,
|
|
17323
|
+
bucket: 'crud',
|
|
17324
|
+
subgroups: subgroups
|
|
17325
|
+
});
|
|
17326
|
+
result = {
|
|
17327
|
+
filename: filename,
|
|
17328
|
+
group: group,
|
|
17329
|
+
kind: 'crud-misplaced',
|
|
17330
|
+
subgroups: subgroups,
|
|
17331
|
+
isCanonical: false,
|
|
17332
|
+
recommendedRename: recommendedRename,
|
|
17333
|
+
driftReason: '`crud` segment is not directly after the group name.'
|
|
17334
|
+
};
|
|
17335
|
+
} else if (scenarioIdx > 0) {
|
|
17336
|
+
var subgroups1 = rest.filter(function(_, i) {
|
|
17337
|
+
return i !== scenarioIdx;
|
|
17338
|
+
});
|
|
17339
|
+
var recommendedRename1 = buildCanonicalFilename({
|
|
17340
|
+
group: group,
|
|
17341
|
+
bucket: 'scenario',
|
|
17342
|
+
subgroups: subgroups1
|
|
17343
|
+
});
|
|
17344
|
+
result = {
|
|
17345
|
+
filename: filename,
|
|
17346
|
+
group: group,
|
|
17347
|
+
kind: 'scenario-misplaced',
|
|
17348
|
+
subgroups: subgroups1,
|
|
17349
|
+
isCanonical: false,
|
|
17350
|
+
recommendedRename: recommendedRename1,
|
|
17351
|
+
driftReason: '`scenario` segment is not directly after the group name.'
|
|
17352
|
+
};
|
|
17353
|
+
} else if (rest.length === 0) {
|
|
17354
|
+
var recommendedRename2 = buildCanonicalFilename({
|
|
17355
|
+
group: group,
|
|
17356
|
+
bucket: 'scenario',
|
|
17357
|
+
subgroups: []
|
|
17358
|
+
});
|
|
17359
|
+
result = {
|
|
17360
|
+
filename: filename,
|
|
17361
|
+
group: group,
|
|
17362
|
+
kind: 'no-bucket',
|
|
17363
|
+
subgroups: [],
|
|
17364
|
+
isCanonical: false,
|
|
17365
|
+
recommendedRename: recommendedRename2,
|
|
17366
|
+
driftReason: 'Missing `crud` or `scenario` segment.'
|
|
17367
|
+
};
|
|
17368
|
+
} else {
|
|
17369
|
+
var recommendedRename3 = buildCanonicalFilename({
|
|
17370
|
+
group: group,
|
|
17371
|
+
bucket: 'scenario',
|
|
17372
|
+
subgroups: rest
|
|
17373
|
+
});
|
|
17374
|
+
result = {
|
|
17375
|
+
filename: filename,
|
|
17376
|
+
group: group,
|
|
17377
|
+
kind: 'no-bucket',
|
|
17378
|
+
subgroups: rest,
|
|
17379
|
+
isCanonical: false,
|
|
17380
|
+
recommendedRename: recommendedRename3,
|
|
17381
|
+
driftReason: 'Missing `crud` or `scenario` segment — defaulting suggestion to `scenario`.'
|
|
17382
|
+
};
|
|
17383
|
+
}
|
|
17384
|
+
return result;
|
|
17385
|
+
}
|
|
17386
|
+
/**
|
|
17387
|
+
* Renders a canonical spec filename for the given group + bucket + subgroup
|
|
17388
|
+
* chain. Pure data — used both by drift remediation and by the
|
|
17389
|
+
* `recommendSpecPath()` helper below.
|
|
17390
|
+
*
|
|
17391
|
+
* @param config - Inputs.
|
|
17392
|
+
* @param config.group - The model-group name (e.g. `job`).
|
|
17393
|
+
* @param config.bucket - `crud` or `scenario`.
|
|
17394
|
+
* @param config.subgroups - Optional ordered subgroup segments
|
|
17395
|
+
* (e.g. `['requirement','worker']`).
|
|
17396
|
+
* @returns The canonical filename (e.g. `job.scenario.requirement.worker.spec.ts`).
|
|
17397
|
+
*/ function buildCanonicalFilename(config) {
|
|
17398
|
+
var group = config.group, bucket = config.bucket, subgroups = config.subgroups;
|
|
17399
|
+
var tail = subgroups.length === 0 ? '' : ".".concat(subgroups.join('.'));
|
|
17400
|
+
return "".concat(group, ".").concat(bucket).concat(tail, ".spec.ts");
|
|
17401
|
+
}
|
|
17402
|
+
|
|
17403
|
+
/**
|
|
17404
|
+
* Default subpath segment (relative to an app source root) below which the
|
|
17405
|
+
* rule expects model-group function folders. Matches the convention used by
|
|
17406
|
+
* `<apiDir>/src/app/function/<group>/`.
|
|
17407
|
+
*/ var DEFAULT_FUNCTION_DIR_SEGMENT = 'src/app/function';
|
|
17408
|
+
function matchFunctionSpecPath(filename, functionDirSegment) {
|
|
17409
|
+
var result;
|
|
17410
|
+
if (filename.endsWith('.spec.ts')) {
|
|
17411
|
+
var normalized = filename.split(sep).join('/');
|
|
17412
|
+
var marker = "/".concat(functionDirSegment, "/");
|
|
17413
|
+
var markerIdx = normalized.indexOf(marker);
|
|
17414
|
+
if (markerIdx >= 0) {
|
|
17415
|
+
var afterMarker = normalized.slice(markerIdx + marker.length);
|
|
17416
|
+
var parts = afterMarker.split('/');
|
|
17417
|
+
if (parts.length === 2) {
|
|
17418
|
+
var _parts_, _parts_1;
|
|
17419
|
+
result = {
|
|
17420
|
+
filename: (_parts_ = parts[1]) !== null && _parts_ !== void 0 ? _parts_ : '',
|
|
17421
|
+
parentFolderName: (_parts_1 = parts[0]) !== null && _parts_1 !== void 0 ? _parts_1 : ''
|
|
17422
|
+
};
|
|
17423
|
+
} else if (parts.length > 2) {
|
|
17424
|
+
result = {
|
|
17425
|
+
filename: basename(filename),
|
|
17426
|
+
parentFolderName: basename(dirname(filename))
|
|
17427
|
+
};
|
|
17428
|
+
}
|
|
17429
|
+
}
|
|
17430
|
+
}
|
|
17431
|
+
return result;
|
|
17432
|
+
}
|
|
17433
|
+
/**
|
|
17434
|
+
* ESLint rule that enforces the canonical naming convention for Firebase
|
|
17435
|
+
* Functions API spec files: every `.spec.ts` under
|
|
17436
|
+
* `<apiDir>/src/app/function/<group>/` must be `<group>.crud[.<sub>...].spec.ts`
|
|
17437
|
+
* or `<group>.scenario[.<sub>...].spec.ts`. Drift forms surface a rename
|
|
17438
|
+
* suggestion derived from the shared `classifySpecFile` classifier in
|
|
17439
|
+
* `@dereekb/util`, so this rule and the `dbx_model_test_validate_app` MCP
|
|
17440
|
+
* tool never diverge.
|
|
17441
|
+
*
|
|
17442
|
+
* Not auto-fixable: renaming files (and updating any imports/snapshots they
|
|
17443
|
+
* carry) is outside the safe scope of an ESLint autofix.
|
|
17444
|
+
*/ var FIREBASE_REQUIRE_CANONICAL_API_SPEC_FILENAME_RULE = {
|
|
17445
|
+
meta: {
|
|
17446
|
+
type: 'suggestion',
|
|
17447
|
+
fixable: undefined,
|
|
17448
|
+
docs: {
|
|
17449
|
+
description: 'Require API spec filenames under `src/app/function/<group>/` to follow the `<group>.crud[.<sub>...].spec.ts` / `<group>.scenario[.<sub>...].spec.ts` convention.',
|
|
17450
|
+
recommended: true
|
|
17451
|
+
},
|
|
17452
|
+
messages: {
|
|
17453
|
+
testFileDriftRename: '`{{filename}}`: {{reason}} Rename to `{{recommendedRename}}`.',
|
|
17454
|
+
testFileMissingBucket: '`{{filename}}`: missing `crud` / `scenario` segment. Rename to `{{recommendedRename}}` (default) or to a `crud` variant if the tests are CRUD-flavored.',
|
|
17455
|
+
testFileNonGroupPlacement: '`{{filename}}`: first segment `{{group}}` does not match the parent folder `{{parentFolderName}}`. Move into `{{group}}/` or rename the prefix to match the current folder.'
|
|
17456
|
+
},
|
|
17457
|
+
schema: [
|
|
17458
|
+
{
|
|
17459
|
+
type: 'object',
|
|
17460
|
+
additionalProperties: false,
|
|
17461
|
+
properties: {
|
|
17462
|
+
functionDirSegment: {
|
|
17463
|
+
type: 'string'
|
|
17464
|
+
}
|
|
17465
|
+
}
|
|
17466
|
+
}
|
|
17467
|
+
]
|
|
17468
|
+
},
|
|
17469
|
+
create: function create(context) {
|
|
17470
|
+
var _context_options_, _options_functionDirSegment;
|
|
17471
|
+
var options = (_context_options_ = context.options[0]) !== null && _context_options_ !== void 0 ? _context_options_ : {};
|
|
17472
|
+
var functionDirSegment = (_options_functionDirSegment = options.functionDirSegment) !== null && _options_functionDirSegment !== void 0 ? _options_functionDirSegment : DEFAULT_FUNCTION_DIR_SEGMENT;
|
|
17473
|
+
var matched = matchFunctionSpecPath(context.filename, functionDirSegment);
|
|
17474
|
+
function check(programNode) {
|
|
17475
|
+
if (!matched) return;
|
|
17476
|
+
var classification = classifySpecFile({
|
|
17477
|
+
filename: matched.filename,
|
|
17478
|
+
parentFolderName: matched.parentFolderName
|
|
17479
|
+
});
|
|
17480
|
+
if (classification.isCanonical) return;
|
|
17481
|
+
if (classification.kind === 'non-spec') return;
|
|
17482
|
+
if (classification.kind === 'crud-misplaced' || classification.kind === 'scenario-misplaced') {
|
|
17483
|
+
var _classification_driftReason, _classification_recommendedRename;
|
|
17484
|
+
context.report({
|
|
17485
|
+
node: programNode,
|
|
17486
|
+
messageId: 'testFileDriftRename',
|
|
17487
|
+
data: {
|
|
17488
|
+
filename: classification.filename,
|
|
17489
|
+
reason: (_classification_driftReason = classification.driftReason) !== null && _classification_driftReason !== void 0 ? _classification_driftReason : 'segment order does not match the convention.',
|
|
17490
|
+
recommendedRename: (_classification_recommendedRename = classification.recommendedRename) !== null && _classification_recommendedRename !== void 0 ? _classification_recommendedRename : ''
|
|
17491
|
+
}
|
|
17492
|
+
});
|
|
17493
|
+
} else if (classification.kind === 'no-bucket') {
|
|
17494
|
+
var _classification_recommendedRename1;
|
|
17495
|
+
context.report({
|
|
17496
|
+
node: programNode,
|
|
17497
|
+
messageId: 'testFileMissingBucket',
|
|
17498
|
+
data: {
|
|
17499
|
+
filename: classification.filename,
|
|
17500
|
+
recommendedRename: (_classification_recommendedRename1 = classification.recommendedRename) !== null && _classification_recommendedRename1 !== void 0 ? _classification_recommendedRename1 : ''
|
|
17501
|
+
}
|
|
17502
|
+
});
|
|
17503
|
+
} else if (classification.kind === 'non-group') {
|
|
17504
|
+
context.report({
|
|
17505
|
+
node: programNode,
|
|
17506
|
+
messageId: 'testFileNonGroupPlacement',
|
|
17507
|
+
data: {
|
|
17508
|
+
filename: classification.filename,
|
|
17509
|
+
group: classification.group,
|
|
17510
|
+
parentFolderName: matched.parentFolderName
|
|
17511
|
+
}
|
|
17512
|
+
});
|
|
17513
|
+
}
|
|
17514
|
+
}
|
|
17515
|
+
return {
|
|
17516
|
+
Program: function Program(node) {
|
|
17517
|
+
return check(node);
|
|
17518
|
+
}
|
|
17519
|
+
};
|
|
17520
|
+
}
|
|
17521
|
+
};
|
|
17522
|
+
|
|
17523
|
+
function isGroupIndex(filename, functionDirSegment) {
|
|
17524
|
+
var normalized = filename.split(sep).join('/');
|
|
17525
|
+
var marker = "/".concat(functionDirSegment, "/");
|
|
17526
|
+
var markerIdx = normalized.indexOf(marker);
|
|
17527
|
+
var result = false;
|
|
17528
|
+
if (markerIdx >= 0) {
|
|
17529
|
+
var afterMarker = normalized.slice(markerIdx + marker.length);
|
|
17530
|
+
var parts = afterMarker.split('/');
|
|
17531
|
+
result = parts.length === 2 && parts[1] === 'index.ts';
|
|
17532
|
+
}
|
|
17533
|
+
return result;
|
|
17534
|
+
}
|
|
17535
|
+
function hasCrudSpec(groupDir, group) {
|
|
17536
|
+
var found = false;
|
|
17537
|
+
try {
|
|
17538
|
+
var entries = readdirSync(groupDir);
|
|
17539
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
17540
|
+
try {
|
|
17541
|
+
for(var _iterator = entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
17542
|
+
var entry = _step.value;
|
|
17543
|
+
var classification = classifySpecFile({
|
|
17544
|
+
filename: entry,
|
|
17545
|
+
parentFolderName: group
|
|
17546
|
+
});
|
|
17547
|
+
if (classification.kind === 'crud' || classification.kind === 'crud-subgroup') {
|
|
17548
|
+
found = true;
|
|
17549
|
+
break;
|
|
17550
|
+
}
|
|
17551
|
+
}
|
|
17552
|
+
} catch (err) {
|
|
17553
|
+
_didIteratorError = true;
|
|
17554
|
+
_iteratorError = err;
|
|
17555
|
+
} finally{
|
|
17556
|
+
try {
|
|
17557
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
17558
|
+
_iterator.return();
|
|
17559
|
+
}
|
|
17560
|
+
} finally{
|
|
17561
|
+
if (_didIteratorError) {
|
|
17562
|
+
throw _iteratorError;
|
|
17563
|
+
}
|
|
17564
|
+
}
|
|
17565
|
+
}
|
|
17566
|
+
} catch (unused) {
|
|
17567
|
+
// Directory unreadable — treat as no crud spec; rule will emit the warning
|
|
17568
|
+
// and the user can investigate. We do NOT swallow the error silently
|
|
17569
|
+
// in any other way.
|
|
17570
|
+
}
|
|
17571
|
+
return found;
|
|
17572
|
+
}
|
|
17573
|
+
/**
|
|
17574
|
+
* ESLint rule that fires on every `<apiDir>/src/app/function/<group>/index.ts`
|
|
17575
|
+
* (the canonical anchor file for a Firebase Functions group) and verifies
|
|
17576
|
+
* that the same folder contains a `<group>.crud.spec.ts` (or any
|
|
17577
|
+
* `<group>.crud.<sub>.spec.ts` variant) sibling. Mirrors the coverage check
|
|
17578
|
+
* in `dbx_model_test_validate_app` so editor + CI lint flag missing CRUD
|
|
17579
|
+
* coverage without needing the MCP audit.
|
|
17580
|
+
*
|
|
17581
|
+
* Not auto-fixable: creating a spec file shell with sensible test cases is
|
|
17582
|
+
* outside the safe scope of an ESLint autofix.
|
|
17583
|
+
*/ var FIREBASE_REQUIRE_API_CRUD_SPEC_FOR_GROUP_RULE = {
|
|
17584
|
+
meta: {
|
|
17585
|
+
type: 'suggestion',
|
|
17586
|
+
fixable: undefined,
|
|
17587
|
+
docs: {
|
|
17588
|
+
description: 'Require every API model-group function folder to have a `<group>.crud.spec.ts` covering its CRUD function map.',
|
|
17589
|
+
recommended: true
|
|
17590
|
+
},
|
|
17591
|
+
messages: {
|
|
17592
|
+
modelGroupMissingCrudSpec: 'Model group `{{group}}` has no `{{expectedFilename}}`. Add it covering the CRUD function map (create/read/update/delete + permission/error paths).'
|
|
17593
|
+
},
|
|
17594
|
+
schema: [
|
|
17595
|
+
{
|
|
17596
|
+
type: 'object',
|
|
17597
|
+
additionalProperties: false,
|
|
17598
|
+
properties: {
|
|
17599
|
+
functionDirSegment: {
|
|
17600
|
+
type: 'string'
|
|
17601
|
+
}
|
|
17602
|
+
}
|
|
17603
|
+
}
|
|
17604
|
+
]
|
|
17605
|
+
},
|
|
17606
|
+
create: function create(context) {
|
|
17607
|
+
var _context_options_, _options_functionDirSegment;
|
|
17608
|
+
var options = (_context_options_ = context.options[0]) !== null && _context_options_ !== void 0 ? _context_options_ : {};
|
|
17609
|
+
var functionDirSegment = (_options_functionDirSegment = options.functionDirSegment) !== null && _options_functionDirSegment !== void 0 ? _options_functionDirSegment : DEFAULT_FUNCTION_DIR_SEGMENT;
|
|
17610
|
+
var filename = context.filename;
|
|
17611
|
+
var isAnchor = isGroupIndex(filename, functionDirSegment);
|
|
17612
|
+
function check(programNode) {
|
|
17613
|
+
if (!isAnchor) return;
|
|
17614
|
+
var groupDir = dirname(filename);
|
|
17615
|
+
var group = basename(groupDir);
|
|
17616
|
+
if (hasCrudSpec(groupDir, group)) return;
|
|
17617
|
+
var expectedFilename = buildCanonicalFilename({
|
|
17618
|
+
group: group,
|
|
17619
|
+
bucket: 'crud',
|
|
17620
|
+
subgroups: []
|
|
17621
|
+
});
|
|
17622
|
+
context.report({
|
|
17623
|
+
node: programNode,
|
|
17624
|
+
messageId: 'modelGroupMissingCrudSpec',
|
|
17625
|
+
data: {
|
|
17626
|
+
group: group,
|
|
17627
|
+
expectedFilename: expectedFilename
|
|
17628
|
+
}
|
|
17629
|
+
});
|
|
17630
|
+
}
|
|
17631
|
+
return {
|
|
17632
|
+
Program: function Program(node) {
|
|
17633
|
+
return check(node);
|
|
17634
|
+
}
|
|
17635
|
+
};
|
|
17636
|
+
}
|
|
17637
|
+
};
|
|
17638
|
+
|
|
16108
17639
|
/**
|
|
16109
17640
|
* ESLint plugin for `@dereekb/firebase` rules.
|
|
16110
17641
|
*
|
|
@@ -16124,7 +17655,9 @@ function reportCompositeKeyTag(ctx, tag, allowedEncodings) {
|
|
|
16124
17655
|
'require-firestore-rule-for-service-model': FIREBASE_REQUIRE_FIRESTORE_RULE_FOR_SERVICE_MODEL_RULE,
|
|
16125
17656
|
'require-dbx-model-service-factory-tag': FIREBASE_REQUIRE_DBX_MODEL_SERVICE_FACTORY_TAG_RULE,
|
|
16126
17657
|
'require-service-factory-for-dbx-model': FIREBASE_REQUIRE_SERVICE_FACTORY_FOR_DBX_MODEL_RULE,
|
|
16127
|
-
'require-dbx-model-companion-tags': FIREBASE_REQUIRE_DBX_MODEL_COMPANION_TAGS_RULE
|
|
17658
|
+
'require-dbx-model-companion-tags': FIREBASE_REQUIRE_DBX_MODEL_COMPANION_TAGS_RULE,
|
|
17659
|
+
'require-canonical-api-spec-filename': FIREBASE_REQUIRE_CANONICAL_API_SPEC_FILENAME_RULE,
|
|
17660
|
+
'require-api-crud-spec-for-group': FIREBASE_REQUIRE_API_CRUD_SPEC_FOR_GROUP_RULE
|
|
16128
17661
|
}
|
|
16129
17662
|
};
|
|
16130
17663
|
/**
|
|
@@ -16133,4 +17666,4 @@ function reportCompositeKeyTag(ctx, tag, allowedEncodings) {
|
|
|
16133
17666
|
* @dbxAllowConstantName
|
|
16134
17667
|
*/ var firebaseESLintPlugin = FIREBASE_ESLINT_PLUGIN;
|
|
16135
17668
|
|
|
16136
|
-
export { API_DETAILS_IMPORT_MODULE, DBX_MODEL_FIREBASE_INDEX_MARKER, DBX_MODEL_SERVICE_FACTORY_TAG, DEFAULT_API_DETAILS_FACTORY_NAME, DEFAULT_CONSTRAINT_FACTORY_NAMES, DEFAULT_CRUD_FUNCTION_TYPE_VERBS, DEFAULT_CRUD_VERB_NAMES, DEFAULT_DISCOVERY_EXCLUDED_DIRS, DEFAULT_FACTORY_SEARCH_ROOTS, DEFAULT_FACTORY_TAG, DEFAULT_FIRESTORE_RULES_FILENAME, DEFAULT_IDENTITY_FACTORY_NAME, DEFAULT_INDEX_AFFECTING_CONSTRAINT_NAMES, DEFAULT_MODEL_MARKER_TAG, DEFAULT_MODEL_SEARCH_ROOTS, DEFAULT_PAGINATION_CONSTRAINT_NAMES, DEFAULT_REGISTRY_FACTORY_CALL_NAME, DEFAULT_STORAGE_FILE_UPLOAD_POLICY_TYPE_NAME, DEFAULT_STORAGE_RULES_FILENAME, FIREBASE_ESLINT_PLUGIN, FIREBASE_MODEL_SERVICE_FACTORY_MODULE, FIREBASE_MODEL_SERVICE_FACTORY_NAME, FIREBASE_MODULE, FIREBASE_REQUIRE_API_DETAILS_FOR_CRUD_FUNCTION_RULE, FIREBASE_REQUIRE_COMPLETE_CRUD_FUNCTION_CONFIG_MAP_RULE, FIREBASE_REQUIRE_DBX_MODEL_COMPANION_TAGS_RULE, FIREBASE_REQUIRE_DBX_MODEL_FIREBASE_INDEX_COMPANION_TAGS_RULE, FIREBASE_REQUIRE_DBX_MODEL_FIREBASE_INDEX_QUERY_SUFFIX_RULE, FIREBASE_REQUIRE_DBX_MODEL_FIREBASE_INDEX_VALID_DISPATCHER_RULE, FIREBASE_REQUIRE_DBX_MODEL_SERVICE_FACTORY_TAG_RULE, FIREBASE_REQUIRE_FIRESTORE_CONSTRAINT_TYPE_PARAMETER_RULE, FIREBASE_REQUIRE_FIRESTORE_RULE_FOR_SERVICE_MODEL_RULE, FIREBASE_REQUIRE_INPUT_TYPE_FOR_API_DETAILS_RULE, FIREBASE_REQUIRE_SERVICE_FACTORY_FOR_DBX_MODEL_RULE, FIREBASE_REQUIRE_STORAGEFILE_POLICY_MATCHES_RULES_RULE, FIREBASE_REQUIRE_TAGGED_FIRESTORE_CONSTRAINTS_RULE, INPUT_TYPE_PROPERTY_NAME, MIRRORS_POLICY_KEY_MARKER_REGEX, MODEL_FIREBASE_CRUD_FUNCTION_CONFIG_MAP_TYPE_NAME, QUERY_SUFFIX, discoveryGlobExcludeFilter, firebaseESLintPlugin, parseFirestoreRules, parseStorageRules };
|
|
17669
|
+
export { API_DETAILS_IMPORT_MODULE, DBX_MODEL_FIREBASE_INDEX_MARKER, DBX_MODEL_SERVICE_FACTORY_TAG, DEFAULT_API_DETAILS_FACTORY_NAME, DEFAULT_CONSTRAINT_FACTORY_NAMES, DEFAULT_CRUD_FUNCTION_TYPE_VERBS, DEFAULT_CRUD_VERB_NAMES, DEFAULT_DISCOVERY_EXCLUDED_DIRS, DEFAULT_FACTORY_SEARCH_ROOTS, DEFAULT_FACTORY_TAG, DEFAULT_FIRESTORE_RULES_FILENAME, DEFAULT_FUNCTION_DIR_SEGMENT, DEFAULT_IDENTITY_FACTORY_NAME, DEFAULT_INDEX_AFFECTING_CONSTRAINT_NAMES, DEFAULT_MODEL_MARKER_TAG, DEFAULT_MODEL_SEARCH_ROOTS, DEFAULT_PAGINATION_CONSTRAINT_NAMES, DEFAULT_REGISTRY_FACTORY_CALL_NAME, DEFAULT_STORAGE_FILE_UPLOAD_POLICY_TYPE_NAME, DEFAULT_STORAGE_RULES_FILENAME, FIREBASE_ESLINT_PLUGIN, FIREBASE_MODEL_SERVICE_FACTORY_MODULE, FIREBASE_MODEL_SERVICE_FACTORY_NAME, FIREBASE_MODULE, FIREBASE_REQUIRE_API_CRUD_SPEC_FOR_GROUP_RULE, FIREBASE_REQUIRE_API_DETAILS_FOR_CRUD_FUNCTION_RULE, FIREBASE_REQUIRE_CANONICAL_API_SPEC_FILENAME_RULE, FIREBASE_REQUIRE_COMPLETE_CRUD_FUNCTION_CONFIG_MAP_RULE, FIREBASE_REQUIRE_DBX_MODEL_COMPANION_TAGS_RULE, FIREBASE_REQUIRE_DBX_MODEL_FIREBASE_INDEX_COMPANION_TAGS_RULE, FIREBASE_REQUIRE_DBX_MODEL_FIREBASE_INDEX_QUERY_SUFFIX_RULE, FIREBASE_REQUIRE_DBX_MODEL_FIREBASE_INDEX_VALID_DISPATCHER_RULE, FIREBASE_REQUIRE_DBX_MODEL_SERVICE_FACTORY_TAG_RULE, FIREBASE_REQUIRE_FIRESTORE_CONSTRAINT_TYPE_PARAMETER_RULE, FIREBASE_REQUIRE_FIRESTORE_RULE_FOR_SERVICE_MODEL_RULE, FIREBASE_REQUIRE_INPUT_TYPE_FOR_API_DETAILS_RULE, FIREBASE_REQUIRE_SERVICE_FACTORY_FOR_DBX_MODEL_RULE, FIREBASE_REQUIRE_STORAGEFILE_POLICY_MATCHES_RULES_RULE, FIREBASE_REQUIRE_TAGGED_FIRESTORE_CONSTRAINTS_RULE, INPUT_TYPE_PROPERTY_NAME, MIRRORS_POLICY_KEY_MARKER_REGEX, MODEL_FIREBASE_CRUD_FUNCTION_CONFIG_MAP_TYPE_NAME, QUERY_SUFFIX, discoveryGlobExcludeFilter, firebaseESLintPlugin, parseFirestoreRules, parseStorageRules };
|