mycontext-cli 4.2.1 → 4.2.2
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/README.md +22 -0
- package/dist/README.md +22 -0
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/doctor.d.ts +18 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +53 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +63 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/doctor/DoctorEngine.d.ts +5 -0
- package/dist/doctor/DoctorEngine.d.ts.map +1 -0
- package/dist/doctor/DoctorEngine.js +491 -0
- package/dist/doctor/DoctorEngine.js.map +1 -0
- package/dist/doctor/api.d.ts +4 -0
- package/dist/doctor/api.d.ts.map +1 -0
- package/dist/doctor/api.js +19 -0
- package/dist/doctor/api.js.map +1 -0
- package/dist/doctor/rules/dead-code-rules.d.ts +3 -0
- package/dist/doctor/rules/dead-code-rules.d.ts.map +1 -0
- package/dist/doctor/rules/dead-code-rules.js +269 -0
- package/dist/doctor/rules/dead-code-rules.js.map +1 -0
- package/dist/doctor/rules/index.d.ts +11 -0
- package/dist/doctor/rules/index.d.ts.map +1 -0
- package/dist/doctor/rules/index.js +21 -0
- package/dist/doctor/rules/index.js.map +1 -0
- package/dist/doctor/rules/nextjs-rules.d.ts +3 -0
- package/dist/doctor/rules/nextjs-rules.d.ts.map +1 -0
- package/dist/doctor/rules/nextjs-rules.js +357 -0
- package/dist/doctor/rules/nextjs-rules.js.map +1 -0
- package/dist/doctor/rules/node-rules.d.ts +3 -0
- package/dist/doctor/rules/node-rules.d.ts.map +1 -0
- package/dist/doctor/rules/node-rules.js +290 -0
- package/dist/doctor/rules/node-rules.js.map +1 -0
- package/dist/doctor/rules/turbo-rules.d.ts +3 -0
- package/dist/doctor/rules/turbo-rules.d.ts.map +1 -0
- package/dist/doctor/rules/turbo-rules.js +215 -0
- package/dist/doctor/rules/turbo-rules.js.map +1 -0
- package/dist/doctor/types.d.ts +87 -0
- package/dist/doctor/types.d.ts.map +1 -0
- package/dist/doctor/types.js +6 -0
- package/dist/doctor/types.js.map +1 -0
- package/dist/package.json +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.deadCodeRules = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* Dead Code Rules — Find unused exports, orphan files, unused components
|
|
39
|
+
*/
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
function diag(rule, filePath, message, opts = {}) {
|
|
42
|
+
return {
|
|
43
|
+
ruleId: rule.id,
|
|
44
|
+
filePath,
|
|
45
|
+
line: opts.line,
|
|
46
|
+
severity: rule.severity,
|
|
47
|
+
message,
|
|
48
|
+
help: opts.help || rule.help,
|
|
49
|
+
autoFixable: opts.autoFixable ?? false,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// ─── Rules ────────────────────────────────────────────────────────
|
|
53
|
+
const orphanFiles = {
|
|
54
|
+
id: "dead/orphan-files",
|
|
55
|
+
name: "Orphan Files",
|
|
56
|
+
category: "dead",
|
|
57
|
+
severity: "warning",
|
|
58
|
+
description: "Files not imported by any other file in the project",
|
|
59
|
+
help: "Delete orphan files or import them where needed",
|
|
60
|
+
appliesTo: ["node", "nextjs"],
|
|
61
|
+
async check(ctx) {
|
|
62
|
+
const results = [];
|
|
63
|
+
// Find all .ts/.tsx/.js/.jsx files
|
|
64
|
+
const allFiles = await ctx.findFiles(/\.(ts|tsx|js|jsx)$/);
|
|
65
|
+
if (allFiles.length === 0)
|
|
66
|
+
return results;
|
|
67
|
+
// Build import graph
|
|
68
|
+
const importedFiles = new Set();
|
|
69
|
+
// Files that are entry points (not expected to be imported)
|
|
70
|
+
const entryPatterns = [
|
|
71
|
+
/page\.(tsx|jsx|ts|js)$/,
|
|
72
|
+
/layout\.(tsx|jsx|ts|js)$/,
|
|
73
|
+
/route\.(tsx|jsx|ts|js)$/,
|
|
74
|
+
/loading\.(tsx|jsx|ts|js)$/,
|
|
75
|
+
/error\.(tsx|jsx|ts|js)$/,
|
|
76
|
+
/not-found\.(tsx|jsx|ts|js)$/,
|
|
77
|
+
/middleware\.(ts|js)$/,
|
|
78
|
+
/\bindex\.(ts|tsx|js|jsx)$/,
|
|
79
|
+
/\.config\.(ts|js|mjs|cjs)$/,
|
|
80
|
+
/\.test\.(ts|tsx|js|jsx)$/,
|
|
81
|
+
/\.spec\.(ts|tsx|js|jsx)$/,
|
|
82
|
+
/cli\.(ts|js)$/,
|
|
83
|
+
];
|
|
84
|
+
for (const f of allFiles) {
|
|
85
|
+
const content = await ctx.readFile(f);
|
|
86
|
+
if (!content)
|
|
87
|
+
continue;
|
|
88
|
+
// Find import/require statements
|
|
89
|
+
const importRegex = /(?:import|require)\s*\(?['"]([^'"]+)['"]\)?/g;
|
|
90
|
+
const exportFromRegex = /export\s+.*\s+from\s+['"]([^'"]+)['"]/g;
|
|
91
|
+
let match;
|
|
92
|
+
const processImport = (importPath) => {
|
|
93
|
+
if (importPath.startsWith(".")) {
|
|
94
|
+
// Resolve relative import to actual file
|
|
95
|
+
const dir = path.dirname(f);
|
|
96
|
+
const resolved = path.join(dir, importPath);
|
|
97
|
+
// Try common extensions
|
|
98
|
+
const extensions = ["", ".ts", ".tsx", ".js", ".jsx", "/index.ts", "/index.tsx", "/index.js"];
|
|
99
|
+
for (const ext of extensions) {
|
|
100
|
+
const candidate = resolved + ext;
|
|
101
|
+
// Normalize path
|
|
102
|
+
const normalized = path.normalize(candidate);
|
|
103
|
+
importedFiles.add(normalized);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
while ((match = importRegex.exec(content)) !== null) {
|
|
108
|
+
const m = match[1];
|
|
109
|
+
if (m)
|
|
110
|
+
processImport(m);
|
|
111
|
+
}
|
|
112
|
+
while ((match = exportFromRegex.exec(content)) !== null) {
|
|
113
|
+
const m = match[1];
|
|
114
|
+
if (m)
|
|
115
|
+
processImport(m);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Find orphans
|
|
119
|
+
const orphans = [];
|
|
120
|
+
for (const f of allFiles) {
|
|
121
|
+
// Skip entry points
|
|
122
|
+
if (entryPatterns.some(p => p.test(f)))
|
|
123
|
+
continue;
|
|
124
|
+
// Skip if the file (without extension) is in the imported set
|
|
125
|
+
const withoutExt = f.replace(/\.(ts|tsx|js|jsx)$/, "");
|
|
126
|
+
const normalized = path.normalize(f);
|
|
127
|
+
const normalizedWithout = path.normalize(withoutExt);
|
|
128
|
+
const isImported = importedFiles.has(normalized) ||
|
|
129
|
+
importedFiles.has(normalizedWithout) ||
|
|
130
|
+
importedFiles.has(normalizedWithout + "/index");
|
|
131
|
+
if (!isImported) {
|
|
132
|
+
orphans.push(f);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// Only report if we found a reasonable number of orphans (< 30% of files)
|
|
136
|
+
// Otherwise, the detection is probably incomplete
|
|
137
|
+
if (orphans.length > 0 && orphans.length < allFiles.length * 0.3) {
|
|
138
|
+
for (const orphan of orphans.slice(0, 20)) { // cap at 20 to avoid noise
|
|
139
|
+
results.push(diag(this, orphan, `File appears unused — not imported anywhere`));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return results;
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
const unusedExports = {
|
|
146
|
+
id: "dead/unused-exports",
|
|
147
|
+
name: "Unused Exports",
|
|
148
|
+
category: "dead",
|
|
149
|
+
severity: "warning",
|
|
150
|
+
description: "Exported functions/types that aren't imported anywhere",
|
|
151
|
+
help: "Remove unused exports or make them private",
|
|
152
|
+
appliesTo: ["node", "nextjs"],
|
|
153
|
+
async check(ctx) {
|
|
154
|
+
const results = [];
|
|
155
|
+
// Skip if it's a library package (has main/module/exports/types in package.json)
|
|
156
|
+
const pkg = await ctx.readJson("package.json");
|
|
157
|
+
if (pkg && (pkg.main || pkg.module || pkg.exports || pkg.types || pkg.typings)) {
|
|
158
|
+
return results;
|
|
159
|
+
}
|
|
160
|
+
// Find all named exports across the project
|
|
161
|
+
const allFiles = await ctx.findFiles(/\.(ts|tsx|js|jsx)$/);
|
|
162
|
+
if (allFiles.length > 300)
|
|
163
|
+
return results; // too big, skip
|
|
164
|
+
// Build a map of all exported names
|
|
165
|
+
const exports = [];
|
|
166
|
+
let allContent = "";
|
|
167
|
+
for (const f of allFiles) {
|
|
168
|
+
const content = await ctx.readFile(f);
|
|
169
|
+
if (!content)
|
|
170
|
+
continue;
|
|
171
|
+
allContent += content + "\n";
|
|
172
|
+
const lines = content.split("\n");
|
|
173
|
+
for (let i = 0; i < lines.length; i++) {
|
|
174
|
+
const line = lines[i];
|
|
175
|
+
if (!line)
|
|
176
|
+
continue;
|
|
177
|
+
// export function name
|
|
178
|
+
const funcMatch = /export\s+(?:async\s+)?function\s+(\w+)/g.exec(line);
|
|
179
|
+
if (funcMatch && funcMatch[1]) {
|
|
180
|
+
exports.push({ name: funcMatch[1], file: f, line: i + 1 });
|
|
181
|
+
}
|
|
182
|
+
// export const name
|
|
183
|
+
const constMatch = /export\s+const\s+(\w+)/g.exec(line);
|
|
184
|
+
if (constMatch && constMatch[1]) {
|
|
185
|
+
exports.push({ name: constMatch[1], file: f, line: i + 1 });
|
|
186
|
+
}
|
|
187
|
+
// export class name
|
|
188
|
+
const classMatch = /export\s+class\s+(\w+)/g.exec(line);
|
|
189
|
+
if (classMatch && classMatch[1]) {
|
|
190
|
+
exports.push({ name: classMatch[1], file: f, line: i + 1 });
|
|
191
|
+
}
|
|
192
|
+
// export interface/type name
|
|
193
|
+
const typeMatch = /export\s+(?:interface|type)\s+(\w+)/g.exec(line);
|
|
194
|
+
if (typeMatch && typeMatch[1]) {
|
|
195
|
+
exports.push({ name: typeMatch[1], file: f, line: i + 1 });
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// For each export, check if it's referenced elsewhere
|
|
200
|
+
const unused = [];
|
|
201
|
+
for (const exp of exports) {
|
|
202
|
+
// Skip very common names that might be false positives
|
|
203
|
+
if (["default", "metadata", "GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(exp.name))
|
|
204
|
+
continue;
|
|
205
|
+
// Skip index files (barrel exports)
|
|
206
|
+
if (/index\.(ts|tsx|js|jsx)$/.test(exp.file))
|
|
207
|
+
continue;
|
|
208
|
+
// Count references (subtract 1 for the export itself)
|
|
209
|
+
const regex = new RegExp(`\\b${exp.name}\\b`, "g");
|
|
210
|
+
const matches = allContent.match(regex);
|
|
211
|
+
const count = matches ? matches.length : 0;
|
|
212
|
+
// If only referenced once (the export declaration itself), it's unused
|
|
213
|
+
if (count <= 1) {
|
|
214
|
+
unused.push(exp);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// Cap results
|
|
218
|
+
for (const u of unused.slice(0, 15)) {
|
|
219
|
+
results.push(diag(this, u.file, `Export "${u.name}" appears unused`, { line: u.line }));
|
|
220
|
+
}
|
|
221
|
+
return results;
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
const unusedComponents = {
|
|
225
|
+
id: "dead/unused-components",
|
|
226
|
+
name: "Unused Components",
|
|
227
|
+
category: "dead",
|
|
228
|
+
severity: "warning",
|
|
229
|
+
description: "React components defined but never imported/used",
|
|
230
|
+
help: "Remove unused components or use them in your pages",
|
|
231
|
+
appliesTo: ["nextjs"],
|
|
232
|
+
async check(ctx) {
|
|
233
|
+
const results = [];
|
|
234
|
+
// Find component files (PascalCase .tsx files, not in pages/layouts/routes)
|
|
235
|
+
const componentFiles = await ctx.findFiles(/\/[A-Z][a-zA-Z]+\.(tsx|jsx)$/);
|
|
236
|
+
const allFiles = await ctx.findFiles(/\.(ts|tsx|js|jsx)$/);
|
|
237
|
+
if (allFiles.length > 300)
|
|
238
|
+
return results; // too big
|
|
239
|
+
// Read all content for reference checking
|
|
240
|
+
let allContent = "";
|
|
241
|
+
for (const f of allFiles) {
|
|
242
|
+
const content = await ctx.readFile(f);
|
|
243
|
+
if (content)
|
|
244
|
+
allContent += content + "\n";
|
|
245
|
+
}
|
|
246
|
+
for (const cf of componentFiles) {
|
|
247
|
+
// Extract component name from file path
|
|
248
|
+
const basename = path.basename(cf, path.extname(cf));
|
|
249
|
+
// Skip if it's a page/layout/route
|
|
250
|
+
if (["page", "layout", "route", "loading", "error", "not-found"].includes(basename.toLowerCase()))
|
|
251
|
+
continue;
|
|
252
|
+
// Check if component name is referenced in any other file
|
|
253
|
+
const regex = new RegExp(`<${basename}[\\s/>]|import.*${basename}`, "g");
|
|
254
|
+
const matches = allContent.match(regex);
|
|
255
|
+
const references = matches ? matches.length : 0;
|
|
256
|
+
// The component definition itself counts as 1 reference (import in its own file)
|
|
257
|
+
if (references <= 1) {
|
|
258
|
+
results.push(diag(this, cf, `Component "${basename}" appears unused`));
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return results;
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
exports.deadCodeRules = [
|
|
265
|
+
orphanFiles,
|
|
266
|
+
unusedExports,
|
|
267
|
+
unusedComponents,
|
|
268
|
+
];
|
|
269
|
+
//# sourceMappingURL=dead-code-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dead-code-rules.js","sourceRoot":"","sources":["../../../src/doctor/rules/dead-code-rules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,2CAA6B;AAG7B,SAAS,IAAI,CACX,IAAgB,EAChB,QAAgB,EAChB,OAAe,EACf,OAAgE,EAAE;IAElE,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,EAAE;QACf,QAAQ;QACR,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,OAAO;QACP,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI;QAC5B,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,KAAK;KACvC,CAAC;AACJ,CAAC;AAED,qEAAqE;AAErE,MAAM,W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C,CAAC;YACzE,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAC;AAEW,QAAA,aAAa,GAAiB;IACzC,WAAW;IACX,aAAa;IACb,gBAAgB;CACjB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rule Registry — Exports all doctor rules
|
|
3
|
+
*/
|
|
4
|
+
import { nextjsRules } from "./nextjs-rules";
|
|
5
|
+
import { turboRules } from "./turbo-rules";
|
|
6
|
+
import { nodeRules } from "./node-rules";
|
|
7
|
+
import { deadCodeRules } from "./dead-code-rules";
|
|
8
|
+
import type { DoctorRule } from "../types";
|
|
9
|
+
export declare const allRules: DoctorRule[];
|
|
10
|
+
export { nextjsRules, turboRules, nodeRules, deadCodeRules };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/doctor/rules/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,QAAQ,EAAE,UAAU,EAKhC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deadCodeRules = exports.nodeRules = exports.turboRules = exports.nextjsRules = exports.allRules = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Rule Registry — Exports all doctor rules
|
|
6
|
+
*/
|
|
7
|
+
const nextjs_rules_1 = require("./nextjs-rules");
|
|
8
|
+
Object.defineProperty(exports, "nextjsRules", { enumerable: true, get: function () { return nextjs_rules_1.nextjsRules; } });
|
|
9
|
+
const turbo_rules_1 = require("./turbo-rules");
|
|
10
|
+
Object.defineProperty(exports, "turboRules", { enumerable: true, get: function () { return turbo_rules_1.turboRules; } });
|
|
11
|
+
const node_rules_1 = require("./node-rules");
|
|
12
|
+
Object.defineProperty(exports, "nodeRules", { enumerable: true, get: function () { return node_rules_1.nodeRules; } });
|
|
13
|
+
const dead_code_rules_1 = require("./dead-code-rules");
|
|
14
|
+
Object.defineProperty(exports, "deadCodeRules", { enumerable: true, get: function () { return dead_code_rules_1.deadCodeRules; } });
|
|
15
|
+
exports.allRules = [
|
|
16
|
+
...nextjs_rules_1.nextjsRules,
|
|
17
|
+
...turbo_rules_1.turboRules,
|
|
18
|
+
...node_rules_1.nodeRules,
|
|
19
|
+
...dead_code_rules_1.deadCodeRules,
|
|
20
|
+
];
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/doctor/rules/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,iDAA6C;AAapC,4FAbA,0BAAW,OAaA;AAZpB,+CAA2C;AAYrB,2FAZb,wBAAU,OAYa;AAXhC,6CAAyC;AAWP,0FAXzB,sBAAS,OAWyB;AAV3C,uDAAkD;AAUL,8FAVpC,+BAAa,OAUoC;AAP7C,QAAA,QAAQ,GAAiB;IACpC,GAAG,0BAAW;IACd,GAAG,wBAAU;IACb,GAAG,sBAAS;IACZ,GAAG,+BAAa;CACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs-rules.d.ts","sourceRoot":"","sources":["../../../src/doctor/rules/nextjs-rules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,UAAU,CAAC;AAkUpE,eAAO,MAAM,WAAW,EAAE,UAAU,EAWnC,CAAC"}
|