@antelopejs/tooling-configs 0.7.3 → 0.7.4
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 +31 -3
- package/dist/bin/api-diff.mjs +16 -16
- package/dist/bin/body-check.mjs +1 -1
- package/dist/bin/check-size.mjs +1 -1
- package/dist/bin/checks.mjs +1 -1
- package/dist/bin/comment-proof.mjs +2 -2
- package/dist/bin/ratchet.mjs +3 -3
- package/dist/bin/readme-strip.mjs +1 -1
- package/dist/bin/suppressions.mjs +3 -3
- package/dist/bin/sync.mjs +41 -28
- package/dist/bin/tsc.d.mts +1 -0
- package/dist/bin/tsc.mjs +24 -0
- package/dist/bin/verify.mjs +89 -89
- package/dist/{checks-CSlWvky1.mjs → checks-BTFf0Evy.mjs} +31 -33
- package/dist/{docs-compat-BAZiPLZt.mjs → docs-compat-BmczGA1d.mjs} +1 -1
- package/dist/eslint.mjs +1 -1
- package/dist/{guardrails-nj7NTglr.mjs → guardrails-CNmSFSxO.mjs} +120 -120
- package/dist/{installed-typescript-6MtIWlE4.mjs → installed-typescript-CF_FR9DV.mjs} +17 -17
- package/dist/oxc/guardrails/index.mjs +1 -1
- package/dist/oxc/lint.mjs +1 -1
- package/dist/{package-DDG3YH7W.mjs → package-1pH5I0TF.mjs} +3 -7
- package/dist/{proof-stamp-BFV7JTZT.mjs → proof-stamp-Bg4ULLvr.mjs} +2 -2
- package/dist/{ratchet-DLCfeaPY.mjs → ratchet-CPpvIU6Y.mjs} +2 -2
- package/dist/{suppression-base-CYaLZAq7.mjs → suppression-base-CDiFJse2.mjs} +2 -2
- package/dist/{suppression-budget-CPDSFg4X.mjs → suppression-budget-BeJIgSTO.mjs} +1 -1
- package/dist/{suppressions-CxPnh4sC.mjs → suppressions-BvWGA463.mjs} +5 -1
- package/dist/{templates-HG0fel2S.mjs → templates-Df6SlGLA.mjs} +1 -1
- package/dist/{typescript-QfxkJYzd.mjs → typescript-B0df00nl.mjs} +13 -13
- package/dist/typescript-version-CptQKjGz.mjs +18 -0
- package/dist/typescript6-BWqCcXGY.mjs +2 -0
- package/dist/typescript6-HdyOMBv3.mjs +8 -0
- package/package.json +27 -5
package/dist/bin/verify.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { a as VERIFY_KINDS, c as isVerifyKind, l as skillFolder } from "../shared-BCFFyp3l.mjs";
|
|
3
|
+
import { t as typescript6_default } from "../typescript6-HdyOMBv3.mjs";
|
|
3
4
|
import { a as isString, c as object, f as parseJson, i as isObject, n as children, p as str, s as num, t as child, u as optStr } from "../json-CG2L7YFl.mjs";
|
|
4
5
|
import { a as exitIs, c as interrupted, i as exists, r as equal, u as refused } from "../checks-CxkSu2E6.mjs";
|
|
5
6
|
import { n as runCliAsync } from "../cli-4Tv71vYk.mjs";
|
|
@@ -12,7 +13,6 @@ import { accessSync, appendFileSync, chmodSync, closeSync, constants, copyFileSy
|
|
|
12
13
|
import { basename, dirname, extname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
13
14
|
import { execFileSync, spawn, spawnSync } from "node:child_process";
|
|
14
15
|
import { pathToFileURL } from "node:url";
|
|
15
|
-
import ts from "@typescript/typescript6";
|
|
16
16
|
import { createHash, randomBytes } from "node:crypto";
|
|
17
17
|
import { availableParallelism, constants as constants$1 } from "node:os";
|
|
18
18
|
import { parseArgs, stripVTControlCharacters } from "node:util";
|
|
@@ -103,7 +103,7 @@ function moduleKey(path, specifier) {
|
|
|
103
103
|
}
|
|
104
104
|
function isPropertyName(node) {
|
|
105
105
|
const parent = node.parent;
|
|
106
|
-
return (
|
|
106
|
+
return (typescript6_default.isPropertyAccessExpression(parent) || typescript6_default.isPropertyAssignment(parent) || typescript6_default.isMethodDeclaration(parent) || typescript6_default.isPropertyDeclaration(parent) || typescript6_default.isGetAccessor(parent) || typescript6_default.isSetAccessor(parent) || typescript6_default.isEnumMember(parent)) && parent.name === node;
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* A binding is its name alone when that module declares it as a function
|
|
@@ -118,14 +118,14 @@ function importedBindings(clause, module, covered) {
|
|
|
118
118
|
const named = clause.namedBindings;
|
|
119
119
|
const bindings = [];
|
|
120
120
|
if (clause.name) bindings.push([clause.name.text, bindingOrigin(covered, module, "default")]);
|
|
121
|
-
if (named &&
|
|
122
|
-
if (named &&
|
|
121
|
+
if (named && typescript6_default.isNamespaceImport(named)) bindings.push([named.name.text, bindingOrigin(covered, module, "*")]);
|
|
122
|
+
if (named && typescript6_default.isNamedImports(named)) for (const element of named.elements) bindings.push([element.name.text, bindingOrigin(covered, module, (element.propertyName ?? element.name).text)]);
|
|
123
123
|
return bindings;
|
|
124
124
|
}
|
|
125
125
|
function reexportTexts(statement, module, covered) {
|
|
126
126
|
const exported = statement.exportClause;
|
|
127
127
|
if (exported === void 0) return [`export * from ${module}`];
|
|
128
|
-
if (
|
|
128
|
+
if (typescript6_default.isNamespaceExport(exported)) return [`export * as ${exported.name.text} from ${module}`];
|
|
129
129
|
return exported.elements.flatMap((element) => {
|
|
130
130
|
const origin = bindingOrigin(covered, module, (element.propertyName ?? element.name).text);
|
|
131
131
|
return origin === element.name.text ? [] : [`export ${origin} as ${element.name.text}`];
|
|
@@ -139,7 +139,7 @@ function reexportTexts(statement, module, covered) {
|
|
|
139
139
|
*/
|
|
140
140
|
function localExportTexts(statement, bindings, locals) {
|
|
141
141
|
const exported = statement.exportClause;
|
|
142
|
-
if (exported === void 0 || !
|
|
142
|
+
if (exported === void 0 || !typescript6_default.isNamedExports(exported)) return [];
|
|
143
143
|
return exported.elements.flatMap((element) => {
|
|
144
144
|
const name = (element.propertyName ?? element.name).text;
|
|
145
145
|
const imported = bindings.get(name);
|
|
@@ -163,12 +163,12 @@ function originsOf(path, covered, file, locals) {
|
|
|
163
163
|
const earlier = [];
|
|
164
164
|
const exports = [];
|
|
165
165
|
for (const statement of file.statements) {
|
|
166
|
-
if (!(
|
|
166
|
+
if (!(typescript6_default.isImportDeclaration(statement) || typescript6_default.isExportDeclaration(statement))) continue;
|
|
167
167
|
const specifier = statement.moduleSpecifier;
|
|
168
|
-
if (specifier === void 0 &&
|
|
169
|
-
if (specifier === void 0 || !
|
|
168
|
+
if (specifier === void 0 && typescript6_default.isExportDeclaration(statement)) exports.push(statement);
|
|
169
|
+
if (specifier === void 0 || !typescript6_default.isStringLiteral(specifier)) continue;
|
|
170
170
|
const module = moduleKey(path, specifier.text);
|
|
171
|
-
if (
|
|
171
|
+
if (typescript6_default.isImportDeclaration(statement)) {
|
|
172
172
|
if (statement.importClause === void 0) {
|
|
173
173
|
ordered.push(`import ${module} after ${earlier.join(",")}`);
|
|
174
174
|
continue;
|
|
@@ -190,18 +190,18 @@ function originsOf(path, covered, file, locals) {
|
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
function leafOf(node, bindings) {
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
195
|
-
if (
|
|
196
|
-
if (
|
|
197
|
-
if (
|
|
198
|
-
if (
|
|
199
|
-
if (
|
|
200
|
-
if (
|
|
193
|
+
if (typescript6_default.isIdentifier(node)) return isPropertyName(node) ? node.text : bindings.get(node.text) ?? node.text;
|
|
194
|
+
if (typescript6_default.isPrivateIdentifier(node)) return node.text;
|
|
195
|
+
if (typescript6_default.isNumericLiteral(node)) return String(Number(node.text));
|
|
196
|
+
if (typescript6_default.isStringLiteralLike(node) || typescript6_default.isTemplateLiteralToken(node)) return JSON.stringify(node.text);
|
|
197
|
+
if (typescript6_default.isBigIntLiteral(node) || typescript6_default.isRegularExpressionLiteral(node)) return node.text;
|
|
198
|
+
if (typescript6_default.isPrefixUnaryExpression(node) || typescript6_default.isPostfixUnaryExpression(node)) return typescript6_default.SyntaxKind[node.operator];
|
|
199
|
+
if (typescript6_default.isVariableDeclarationList(node)) return String(node.flags & (typescript6_default.NodeFlags.Let | typescript6_default.NodeFlags.Const));
|
|
200
|
+
if (typescript6_default.isMetaProperty(node)) return typescript6_default.SyntaxKind[node.keywordToken];
|
|
201
201
|
return "";
|
|
202
202
|
}
|
|
203
203
|
function dropped(node) {
|
|
204
|
-
return node.kind ===
|
|
204
|
+
return node.kind === typescript6_default.SyntaxKind.ExportKeyword || node.kind === typescript6_default.SyntaxKind.DefaultKeyword;
|
|
205
205
|
}
|
|
206
206
|
/**
|
|
207
207
|
* The structure of a node: its kind, its identifier name or literal value,
|
|
@@ -210,44 +210,44 @@ function dropped(node) {
|
|
|
210
210
|
* imported binding stands for its origin.
|
|
211
211
|
*/
|
|
212
212
|
function structureOf(node, bindings) {
|
|
213
|
-
if (
|
|
213
|
+
if (typescript6_default.isParenthesizedExpression(node)) return structureOf(node.expression, bindings);
|
|
214
214
|
const children = [];
|
|
215
|
-
|
|
215
|
+
typescript6_default.forEachChild(node, (child) => {
|
|
216
216
|
if (!dropped(child)) children.push(structureOf(child, bindings));
|
|
217
217
|
});
|
|
218
|
-
return `${
|
|
218
|
+
return `${typescript6_default.SyntaxKind[node.kind]}(${leafOf(node, bindings)}|${children.join(",")})`;
|
|
219
219
|
}
|
|
220
220
|
function readable(text) {
|
|
221
221
|
const flat = text.replace(/\s+/g, " ").trim();
|
|
222
222
|
return flat.length > TEXT_LENGTH ? `${flat.slice(0, TEXT_LENGTH)}…` : flat;
|
|
223
223
|
}
|
|
224
224
|
function parseScript(path, source) {
|
|
225
|
-
const { outputText } =
|
|
225
|
+
const { outputText } = typescript6_default.transpileModule(source, {
|
|
226
226
|
fileName: path,
|
|
227
227
|
compilerOptions: {
|
|
228
|
-
target:
|
|
229
|
-
module:
|
|
228
|
+
target: typescript6_default.ScriptTarget.ES2022,
|
|
229
|
+
module: typescript6_default.ModuleKind.ESNext,
|
|
230
230
|
removeComments: true,
|
|
231
231
|
experimentalDecorators: true
|
|
232
232
|
}
|
|
233
233
|
});
|
|
234
234
|
return {
|
|
235
235
|
path,
|
|
236
|
-
file:
|
|
236
|
+
file: typescript6_default.createSourceFile("emit.js", outputText, typescript6_default.ScriptTarget.ES2022, true, typescript6_default.ScriptKind.JS)
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
239
|
function declaredNames$1(name) {
|
|
240
|
-
return
|
|
240
|
+
return typescript6_default.isIdentifier(name) ? [name.text] : name.elements.flatMap((element) => typescript6_default.isOmittedExpression(element) ? [] : declaredNames$1(element.name));
|
|
241
241
|
}
|
|
242
242
|
function isFunctionDeclaration(statement) {
|
|
243
|
-
return
|
|
243
|
+
return typescript6_default.isFunctionDeclaration(statement) && Boolean(statement.body) && statement.name !== void 0;
|
|
244
244
|
}
|
|
245
245
|
/** The top-level variables, classes and enums of a script, and its functions that another covered file also declares, each keyed by its file and name: what a function moved into another file must not pick up by name. */
|
|
246
246
|
function localsOf(script, covered) {
|
|
247
247
|
const file = script.path.replace(MODULE_EXTENSION, "");
|
|
248
248
|
const names = script.file.statements.flatMap((statement) => {
|
|
249
|
-
if (
|
|
250
|
-
return (
|
|
249
|
+
if (typescript6_default.isVariableStatement(statement)) return statement.declarationList.declarations.flatMap((declaration) => declaredNames$1(declaration.name));
|
|
250
|
+
return (typescript6_default.isClassDeclaration(statement) || typescript6_default.isEnumDeclaration(statement)) && statement.name ? [statement.name.text] : [];
|
|
251
251
|
});
|
|
252
252
|
const clashing = [...covered.functions.get(file) ?? []].filter((name) => covered.duplicated.has(name));
|
|
253
253
|
return new Map([...names, ...clashing].map((name) => [name, `${file}#${name}`]));
|
|
@@ -256,8 +256,8 @@ function scriptItems(script, covered) {
|
|
|
256
256
|
const locals = localsOf(script, covered);
|
|
257
257
|
const origins = originsOf(script.path, covered, script.file, locals);
|
|
258
258
|
const inFunctions = new Map([...locals, ...origins.bindings]);
|
|
259
|
-
const statements = script.file.statements.filter((statement) => !
|
|
260
|
-
const hoisted =
|
|
259
|
+
const statements = script.file.statements.filter((statement) => !typescript6_default.isImportDeclaration(statement) && !typescript6_default.isExportDeclaration(statement)).map((statement) => {
|
|
260
|
+
const hoisted = typescript6_default.isFunctionDeclaration(statement) && Boolean(statement.body);
|
|
261
261
|
return {
|
|
262
262
|
structure: structureOf(statement, hoisted ? inFunctions : origins.bindings),
|
|
263
263
|
text: readable(statement.getText(script.file)),
|
|
@@ -1772,40 +1772,40 @@ function ajsEntry(root) {
|
|
|
1772
1772
|
}
|
|
1773
1773
|
//#endregion
|
|
1774
1774
|
//#region src/verify/surface-types.ts
|
|
1775
|
-
const NAMED =
|
|
1776
|
-
const MODULE =
|
|
1777
|
-
const INHERITING =
|
|
1775
|
+
const NAMED = typescript6_default.SymbolFlags.Interface | typescript6_default.SymbolFlags.Class | typescript6_default.SymbolFlags.Enum | typescript6_default.SymbolFlags.TypeAlias;
|
|
1776
|
+
const MODULE = typescript6_default.SymbolFlags.ValueModule | typescript6_default.SymbolFlags.NamespaceModule;
|
|
1777
|
+
const INHERITING = typescript6_default.SymbolFlags.Class | typescript6_default.SymbolFlags.Interface;
|
|
1778
1778
|
function isObjectType$1(type) {
|
|
1779
|
-
return (type.flags &
|
|
1779
|
+
return (type.flags & typescript6_default.TypeFlags.Object) !== 0;
|
|
1780
1780
|
}
|
|
1781
1781
|
function isReference(type) {
|
|
1782
|
-
return (type.objectFlags &
|
|
1782
|
+
return (type.objectFlags & typescript6_default.ObjectFlags.Reference) !== 0;
|
|
1783
1783
|
}
|
|
1784
1784
|
function isPublicMember(member) {
|
|
1785
|
-
const hidden =
|
|
1786
|
-
return (
|
|
1785
|
+
const hidden = typescript6_default.ModifierFlags.Private | typescript6_default.ModifierFlags.Protected;
|
|
1786
|
+
return (typescript6_default.getCombinedModifierFlags(member) & hidden) === 0 && !(member.name !== void 0 && typescript6_default.isPrivateIdentifier(member.name));
|
|
1787
1787
|
}
|
|
1788
1788
|
/** A class declaration reduced to the members a consumer can reach; any other declaration as it is. */
|
|
1789
1789
|
function publicPart(declaration) {
|
|
1790
|
-
if (!
|
|
1791
|
-
return
|
|
1790
|
+
if (!typescript6_default.isClassDeclaration(declaration)) return declaration;
|
|
1791
|
+
return typescript6_default.factory.updateClassDeclaration(declaration, declaration.modifiers, declaration.name, declaration.typeParameters, declaration.heritageClauses, declaration.members.filter(isPublicMember));
|
|
1792
1792
|
}
|
|
1793
1793
|
/** Whether a heritage expression is a name such as `Base` or `ns.Base`, rather than a call. */
|
|
1794
1794
|
function isEntityName(expression) {
|
|
1795
|
-
return
|
|
1795
|
+
return typescript6_default.isIdentifier(expression) || typescript6_default.isPropertyAccessExpression(expression) && isEntityName(expression.expression);
|
|
1796
1796
|
}
|
|
1797
1797
|
/** The name a written type reference resolves through, when the node is one. */
|
|
1798
1798
|
function referencedName(node) {
|
|
1799
|
-
if (
|
|
1800
|
-
if (
|
|
1801
|
-
if (
|
|
1802
|
-
if (!
|
|
1799
|
+
if (typescript6_default.isTypeReferenceNode(node)) return node.typeName;
|
|
1800
|
+
if (typescript6_default.isExpressionWithTypeArguments(node) && isEntityName(node.expression)) return node.expression;
|
|
1801
|
+
if (typescript6_default.isTypeQueryNode(node)) return node.exprName;
|
|
1802
|
+
if (!typescript6_default.isImportTypeNode(node)) return void 0;
|
|
1803
1803
|
if (node.qualifier) return node.qualifier;
|
|
1804
|
-
return
|
|
1804
|
+
return typescript6_default.isLiteralTypeNode(node.argument) ? node.argument.literal : void 0;
|
|
1805
1805
|
}
|
|
1806
1806
|
/** Whether reading the declaration would read a whole module rather than one declaration. */
|
|
1807
1807
|
function isModuleBody(declaration) {
|
|
1808
|
-
return
|
|
1808
|
+
return typescript6_default.isSourceFile(declaration) || typescript6_default.isModuleDeclaration(declaration);
|
|
1809
1809
|
}
|
|
1810
1810
|
/**
|
|
1811
1811
|
* Collects the package's declarations a function reaches. The written text of
|
|
@@ -1823,7 +1823,7 @@ var DeclarationWalk = class {
|
|
|
1823
1823
|
seen = /* @__PURE__ */ new Set();
|
|
1824
1824
|
unread = [];
|
|
1825
1825
|
types = [];
|
|
1826
|
-
printer =
|
|
1826
|
+
printer = typescript6_default.createPrinter({ removeComments: true });
|
|
1827
1827
|
checker;
|
|
1828
1828
|
isLocalFile;
|
|
1829
1829
|
constructor(checker, isLocalFile) {
|
|
@@ -1858,11 +1858,11 @@ var DeclarationWalk = class {
|
|
|
1858
1858
|
return this.local(symbol).length > 0;
|
|
1859
1859
|
}
|
|
1860
1860
|
resolve(symbol) {
|
|
1861
|
-
return symbol.flags &
|
|
1861
|
+
return symbol.flags & typescript6_default.SymbolFlags.Alias ? this.checker.getAliasedSymbol(symbol) : symbol;
|
|
1862
1862
|
}
|
|
1863
1863
|
record(symbol) {
|
|
1864
1864
|
if ((symbol.flags & NAMED) === 0) return;
|
|
1865
|
-
const texts = this.local(symbol).map((declaration) => this.printer.printNode(
|
|
1865
|
+
const texts = this.local(symbol).map((declaration) => this.printer.printNode(typescript6_default.EmitHint.Unspecified, publicPart(declaration), declaration.getSourceFile()).replace(/\s+/g, " ").replace(/^(?:export )?(?:declare )?/, ""));
|
|
1866
1866
|
this.declarations.set(symbol, texts.join(" "));
|
|
1867
1867
|
}
|
|
1868
1868
|
open(found) {
|
|
@@ -1876,7 +1876,7 @@ var DeclarationWalk = class {
|
|
|
1876
1876
|
if (this.inherited.has(symbol) || !this.isLocal(symbol)) return;
|
|
1877
1877
|
this.inherited.add(symbol);
|
|
1878
1878
|
for (const declaration of this.local(symbol)) {
|
|
1879
|
-
if (!
|
|
1879
|
+
if (!typescript6_default.isClassLike(declaration) && !typescript6_default.isInterfaceDeclaration(declaration)) continue;
|
|
1880
1880
|
for (const clause of declaration.heritageClauses ?? []) for (const base of clause.types) {
|
|
1881
1881
|
this.typeArguments(base);
|
|
1882
1882
|
for (const owner of this.bases(base.expression)) this.owner(owner);
|
|
@@ -1885,11 +1885,11 @@ var DeclarationWalk = class {
|
|
|
1885
1885
|
}
|
|
1886
1886
|
/** Reads the type arguments a heritage expression writes, including those inside a call such as `mix<A>(Base<B>)`. */
|
|
1887
1887
|
typeArguments(node) {
|
|
1888
|
-
if (
|
|
1888
|
+
if (typescript6_default.isExpressionWithTypeArguments(node)) {
|
|
1889
1889
|
for (const argument of node.typeArguments ?? []) this.references(argument);
|
|
1890
1890
|
this.typeArguments(node.expression);
|
|
1891
|
-
} else if (
|
|
1892
|
-
else
|
|
1891
|
+
} else if (typescript6_default.isTypeNode(node)) this.references(node);
|
|
1892
|
+
else typescript6_default.forEachChild(node, (child) => this.typeArguments(child));
|
|
1893
1893
|
}
|
|
1894
1894
|
/** Records the symbol when it names an interface, class, enum or alias of the package, and queues its declarations to be read, once. */
|
|
1895
1895
|
reach(found) {
|
|
@@ -1897,25 +1897,25 @@ var DeclarationWalk = class {
|
|
|
1897
1897
|
if (this.reached.has(symbol) || !this.isLocal(symbol)) return;
|
|
1898
1898
|
this.reached.add(symbol);
|
|
1899
1899
|
for (const declaration of symbol.declarations ?? []) {
|
|
1900
|
-
const owner =
|
|
1900
|
+
const owner = typescript6_default.isEnumMember(declaration) ? this.checker.getSymbolAtLocation(declaration.parent.name) : void 0;
|
|
1901
1901
|
if (owner) this.reach(owner);
|
|
1902
1902
|
}
|
|
1903
|
-
const assigned = symbol.exports?.get(
|
|
1903
|
+
const assigned = symbol.exports?.get(typescript6_default.InternalSymbolName.ExportEquals);
|
|
1904
1904
|
if (assigned) this.reach(assigned);
|
|
1905
1905
|
if (symbol.flags & MODULE) for (const member of this.checker.getExportsOfModule(symbol)) {
|
|
1906
1906
|
const value = this.resolve(member);
|
|
1907
|
-
if (value.flags &
|
|
1907
|
+
if (value.flags & typescript6_default.SymbolFlags.Value) this.reach(value);
|
|
1908
1908
|
}
|
|
1909
1909
|
this.record(symbol);
|
|
1910
1910
|
this.open(symbol);
|
|
1911
1911
|
}
|
|
1912
1912
|
/** The symbols a heritage expression names: the entity it is, or each name in a call such as `Mixin(Base)`. */
|
|
1913
1913
|
bases(expression) {
|
|
1914
|
-
const symbol =
|
|
1914
|
+
const symbol = typescript6_default.isIdentifier(expression) || typescript6_default.isPropertyAccessExpression(expression) ? this.checker.getSymbolAtLocation(expression) : void 0;
|
|
1915
1915
|
if (symbol) return [symbol];
|
|
1916
1916
|
const found = [];
|
|
1917
|
-
|
|
1918
|
-
if (!
|
|
1917
|
+
typescript6_default.forEachChild(expression, (child) => {
|
|
1918
|
+
if (!typescript6_default.isTypeNode(child)) found.push(...this.bases(child));
|
|
1919
1919
|
});
|
|
1920
1920
|
return found;
|
|
1921
1921
|
}
|
|
@@ -1923,8 +1923,8 @@ var DeclarationWalk = class {
|
|
|
1923
1923
|
const name = referencedName(node);
|
|
1924
1924
|
const symbol = name && this.checker.getSymbolAtLocation(name);
|
|
1925
1925
|
if (symbol) this.reach(symbol);
|
|
1926
|
-
if (
|
|
1927
|
-
|
|
1926
|
+
if (typescript6_default.isExpressionWithTypeArguments(node) && !isEntityName(node.expression)) for (const base of this.bases(node.expression)) this.reach(base);
|
|
1927
|
+
typescript6_default.forEachChild(node, (child) => this.references(child));
|
|
1928
1928
|
}
|
|
1929
1929
|
type(type) {
|
|
1930
1930
|
if (this.seen.has(type)) return;
|
|
@@ -1938,7 +1938,7 @@ var DeclarationWalk = class {
|
|
|
1938
1938
|
this.types.push(...type.types);
|
|
1939
1939
|
return;
|
|
1940
1940
|
}
|
|
1941
|
-
if (type.flags &
|
|
1941
|
+
if (type.flags & typescript6_default.TypeFlags.TypeParameter) {
|
|
1942
1942
|
this.types.push(type.getConstraint() ?? type, type.getDefault() ?? type);
|
|
1943
1943
|
return;
|
|
1944
1944
|
}
|
|
@@ -1948,21 +1948,21 @@ var DeclarationWalk = class {
|
|
|
1948
1948
|
}
|
|
1949
1949
|
};
|
|
1950
1950
|
function declaredNames(statement) {
|
|
1951
|
-
if (
|
|
1952
|
-
if (
|
|
1951
|
+
if (typescript6_default.isVariableStatement(statement)) return statement.declarationList.declarations.map((declaration) => declaration.name);
|
|
1952
|
+
if (typescript6_default.isInterfaceDeclaration(statement) || typescript6_default.isClassDeclaration(statement) || typescript6_default.isFunctionDeclaration(statement) || typescript6_default.isTypeAliasDeclaration(statement) || typescript6_default.isEnumDeclaration(statement) || typescript6_default.isModuleDeclaration(statement)) return statement.name ? [statement.name] : [];
|
|
1953
1953
|
return [];
|
|
1954
1954
|
}
|
|
1955
1955
|
function moduleStatements(statement) {
|
|
1956
|
-
const body =
|
|
1957
|
-
if (body &&
|
|
1958
|
-
return body &&
|
|
1956
|
+
const body = typescript6_default.isModuleDeclaration(statement) ? statement.body : void 0;
|
|
1957
|
+
if (body && typescript6_default.isModuleBlock(body)) return body.statements;
|
|
1958
|
+
return body && typescript6_default.isModuleDeclaration(body) ? [body] : [];
|
|
1959
1959
|
}
|
|
1960
1960
|
/** Whether a module file's statement opens a scope outside text can see: `declare global`, or `declare module` of a module that is not a package file. */
|
|
1961
1961
|
function opensOutside(checker, statement, isLocalFile) {
|
|
1962
|
-
if (!
|
|
1963
|
-
if (statement.flags &
|
|
1964
|
-
if (!
|
|
1965
|
-
return !(checker.getSymbolAtLocation(statement.name)?.declarations ?? []).some((declaration) =>
|
|
1962
|
+
if (!typescript6_default.isModuleDeclaration(statement)) return false;
|
|
1963
|
+
if (statement.flags & typescript6_default.NodeFlags.GlobalAugmentation) return true;
|
|
1964
|
+
if (!typescript6_default.isStringLiteral(statement.name)) return false;
|
|
1965
|
+
return !(checker.getSymbolAtLocation(statement.name)?.declarations ?? []).some((declaration) => typescript6_default.isSourceFile(declaration) && isLocalFile(declaration));
|
|
1966
1966
|
}
|
|
1967
1967
|
/**
|
|
1968
1968
|
* The symbols the package declares where text outside the package can name
|
|
@@ -1973,7 +1973,7 @@ function opensOutside(checker, statement, isLocalFile) {
|
|
|
1973
1973
|
*/
|
|
1974
1974
|
function outsideVisible(checker, files, isLocalFile) {
|
|
1975
1975
|
const visible = /* @__PURE__ */ new Set();
|
|
1976
|
-
const pending = files.flatMap((file) =>
|
|
1976
|
+
const pending = files.flatMap((file) => typescript6_default.isExternalModule(file) ? file.statements.filter((statement) => opensOutside(checker, statement, isLocalFile)).flatMap(moduleStatements) : [...file.statements]);
|
|
1977
1977
|
for (let statement = pending.pop(); statement; statement = pending.pop()) {
|
|
1978
1978
|
pending.push(...moduleStatements(statement));
|
|
1979
1979
|
for (const name of declaredNames(statement)) {
|
|
@@ -2002,7 +2002,7 @@ function referencedDeclarations(checker, isLocalFile, signatures, path, visible)
|
|
|
2002
2002
|
//#endregion
|
|
2003
2003
|
//#region src/verify/surface.ts
|
|
2004
2004
|
const MAX_DEPTH = 4;
|
|
2005
|
-
const SIGNATURE_FLAGS =
|
|
2005
|
+
const SIGNATURE_FLAGS = typescript6_default.TypeFormatFlags.NoTruncation | typescript6_default.TypeFormatFlags.WriteArrowStyleSignature;
|
|
2006
2006
|
const DECLARATION_FILE = /\.d\.[cm]?ts$/;
|
|
2007
2007
|
function exportedDeclaration(value) {
|
|
2008
2008
|
if (Array.isArray(value)) return value.map(exportedDeclaration).find((found) => found !== void 0);
|
|
@@ -2036,7 +2036,7 @@ function declaredHere(walk, symbol) {
|
|
|
2036
2036
|
return (symbol.declarations ?? []).some((declaration) => inPackage(walk, declaration.getSourceFile().fileName));
|
|
2037
2037
|
}
|
|
2038
2038
|
function resolveAlias(walk, symbol) {
|
|
2039
|
-
return symbol.flags &
|
|
2039
|
+
return symbol.flags & typescript6_default.SymbolFlags.Alias ? walk.checker.getAliasedSymbol(symbol) : symbol;
|
|
2040
2040
|
}
|
|
2041
2041
|
function signatureTexts(walk, signatures, kind) {
|
|
2042
2042
|
return signatures.map((signature) => walk.checker.signatureToString(signature, void 0, SIGNATURE_FLAGS, kind).replace(/\s+/g, " "));
|
|
@@ -2045,7 +2045,7 @@ function callableText(walk, type, path) {
|
|
|
2045
2045
|
const callable = walk.checker.getNonNullableType(type);
|
|
2046
2046
|
const calls = callable.getCallSignatures();
|
|
2047
2047
|
const constructs = callable.getConstructSignatures();
|
|
2048
|
-
const texts = [...signatureTexts(walk, calls,
|
|
2048
|
+
const texts = [...signatureTexts(walk, calls, typescript6_default.SignatureKind.Call), ...signatureTexts(walk, constructs, typescript6_default.SignatureKind.Construct)];
|
|
2049
2049
|
if (texts.length === 0) return void 0;
|
|
2050
2050
|
const reached = referencedDeclarations(walk.checker, (file) => inPackage(walk, file.fileName), [...calls, ...constructs], path, walk.visible);
|
|
2051
2051
|
return reached.length === 0 ? texts.join(" | ") : `${texts.join(" | ")} where ${reached.join(" ")}`;
|
|
@@ -2054,8 +2054,8 @@ function typeOf(walk, symbol) {
|
|
|
2054
2054
|
return walk.checker.getTypeOfSymbol(symbol);
|
|
2055
2055
|
}
|
|
2056
2056
|
function isPublic(property) {
|
|
2057
|
-
const hidden =
|
|
2058
|
-
return (property.declarations ?? []).every((declaration) => (
|
|
2057
|
+
const hidden = typescript6_default.ModifierFlags.Private | typescript6_default.ModifierFlags.Protected;
|
|
2058
|
+
return (property.declarations ?? []).every((declaration) => (typescript6_default.getCombinedModifierFlags(declaration) & hidden) === 0);
|
|
2059
2059
|
}
|
|
2060
2060
|
function recordMembers(walk, type, prefix, skip, owners) {
|
|
2061
2061
|
for (const property of walk.checker.getPropertiesOfType(type)) {
|
|
@@ -2070,26 +2070,26 @@ function recordClass(walk, symbol, path, owners) {
|
|
|
2070
2070
|
recordMembers(walk, walk.checker.getDeclaredTypeOfSymbol(symbol), `${path}.prototype.`, "", owners);
|
|
2071
2071
|
}
|
|
2072
2072
|
function isObjectType(type) {
|
|
2073
|
-
return (type.flags &
|
|
2073
|
+
return (type.flags & typescript6_default.TypeFlags.Object) !== 0;
|
|
2074
2074
|
}
|
|
2075
2075
|
function isObjectLiteralType(walk, type) {
|
|
2076
2076
|
const owner = type.symbol;
|
|
2077
|
-
return isObjectType(type) && (type.objectFlags &
|
|
2077
|
+
return isObjectType(type) && (type.objectFlags & typescript6_default.ObjectFlags.Anonymous) !== 0 && owner !== void 0 && (owner.flags & typescript6_default.SymbolFlags.TypeLiteral) !== 0 && declaredHere(walk, owner);
|
|
2078
2078
|
}
|
|
2079
2079
|
function visit(walk, exported, path, trail) {
|
|
2080
2080
|
const symbol = resolveAlias(walk, exported);
|
|
2081
2081
|
if (trail.includes(symbol)) return;
|
|
2082
2082
|
const depth = path.split(":")[1]?.split(".").length ?? MAX_DEPTH;
|
|
2083
|
-
const type = symbol.flags &
|
|
2083
|
+
const type = symbol.flags & typescript6_default.SymbolFlags.Value ? typeOf(walk, symbol) : void 0;
|
|
2084
2084
|
const next = [...trail, symbol];
|
|
2085
2085
|
const text = type && callableText(walk, type, next);
|
|
2086
2086
|
if (text !== void 0) walk.surface.set(path, text);
|
|
2087
|
-
if (symbol.flags &
|
|
2087
|
+
if (symbol.flags & typescript6_default.SymbolFlags.Class && declaredHere(walk, symbol)) {
|
|
2088
2088
|
recordClass(walk, symbol, path, next);
|
|
2089
2089
|
return;
|
|
2090
2090
|
}
|
|
2091
2091
|
if (depth >= MAX_DEPTH || !declaredHere(walk, symbol)) return;
|
|
2092
|
-
if (symbol.flags &
|
|
2092
|
+
if (symbol.flags & typescript6_default.SymbolFlags.Module) for (const member of walk.checker.getExportsOfModule(symbol)) visit(walk, member, `${path}.${member.name}`, next);
|
|
2093
2093
|
else if (type && text === void 0 && isObjectLiteralType(walk, type)) for (const member of walk.checker.getPropertiesOfType(type)) visit(walk, member, `${path}.${member.name}`, next);
|
|
2094
2094
|
}
|
|
2095
2095
|
function unresolvedImports(walk, program) {
|
|
@@ -2097,7 +2097,7 @@ function unresolvedImports(walk, program) {
|
|
|
2097
2097
|
for (const file of program.getSourceFiles()) {
|
|
2098
2098
|
if (!inPackage(walk, file.fileName)) continue;
|
|
2099
2099
|
for (const statement of file.statements) {
|
|
2100
|
-
const specifier = (
|
|
2100
|
+
const specifier = (typescript6_default.isImportDeclaration(statement) || typescript6_default.isExportDeclaration(statement)) && statement.moduleSpecifier && typescript6_default.isStringLiteral(statement.moduleSpecifier) ? statement.moduleSpecifier : void 0;
|
|
2101
2101
|
if (specifier && !walk.checker.getSymbolAtLocation(specifier)) missing.push(`${relative(walk.folder, file.fileName)} -> ${specifier.text}`);
|
|
2102
2102
|
}
|
|
2103
2103
|
}
|
|
@@ -2132,13 +2132,13 @@ function declaredSurface(packageFolder) {
|
|
|
2132
2132
|
files.set(subpath, file);
|
|
2133
2133
|
}
|
|
2134
2134
|
const nodeTypes = nodeTypeRoot(folder);
|
|
2135
|
-
const program =
|
|
2135
|
+
const program = typescript6_default.createProgram([...files.values()], {
|
|
2136
2136
|
noEmit: true,
|
|
2137
2137
|
skipLibCheck: true,
|
|
2138
2138
|
strict: true,
|
|
2139
|
-
target:
|
|
2140
|
-
module:
|
|
2141
|
-
moduleResolution:
|
|
2139
|
+
target: typescript6_default.ScriptTarget.ESNext,
|
|
2140
|
+
module: typescript6_default.ModuleKind.ESNext,
|
|
2141
|
+
moduleResolution: typescript6_default.ModuleResolutionKind.Bundler,
|
|
2142
2142
|
...nodeTypes === void 0 ? { types: [] } : {
|
|
2143
2143
|
typeRoots: [nodeTypes],
|
|
2144
2144
|
types: ["node"]
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { t as CEILINGS_FILE } from "./ceilings-B7KayYIG.mjs";
|
|
2
|
-
import { l as serializeManifest, o as packageManager, s as parseManifest } from "./package-
|
|
2
|
+
import { l as serializeManifest, o as packageManager, s as parseManifest } from "./package-1pH5I0TF.mjs";
|
|
3
|
+
import { t as typescript6_default } from "./typescript6-HdyOMBv3.mjs";
|
|
3
4
|
import { a as isString, f as parseJson, i as isObject, u as optStr } from "./json-CG2L7YFl.mjs";
|
|
4
5
|
import { a as gitFiles, u as trackedManifests } from "./files-C-JJhExM.mjs";
|
|
5
|
-
import { i as DMS_PACKAGES, n as workspaceDirectories } from "./docs-compat-
|
|
6
|
+
import { i as DMS_PACKAGES, n as workspaceDirectories } from "./docs-compat-BmczGA1d.mjs";
|
|
6
7
|
import { n as shimInvocation, t as runCommand } from "./run-command-BlFRPORx.mjs";
|
|
7
8
|
import { n as tagVersion } from "./npm-CIIqL5SG.mjs";
|
|
8
9
|
import { n as packTarball } from "./pack-tarball-Cn4zGKn7.mjs";
|
|
@@ -11,7 +12,6 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpath
|
|
|
11
12
|
import { basename, dirname, join, posix, relative, resolve, sep } from "node:path";
|
|
12
13
|
import { spawnSync } from "node:child_process";
|
|
13
14
|
import { isMap, isScalar, isSeq, parseAllDocuments, parseDocument, stringify } from "yaml";
|
|
14
|
-
import ts from "@typescript/typescript6";
|
|
15
15
|
import { createHash } from "node:crypto";
|
|
16
16
|
import { tmpdir } from "node:os";
|
|
17
17
|
import { Range, gtr, minVersion, prerelease, satisfies, valid, validRange } from "semver";
|
|
@@ -521,17 +521,17 @@ const CONSUMER_OPTIONS = {
|
|
|
521
521
|
const CONSUMER_FILES = {
|
|
522
522
|
import: {
|
|
523
523
|
file: "consumer.mts",
|
|
524
|
-
mode:
|
|
524
|
+
mode: typescript6_default.ModuleKind.ESNext
|
|
525
525
|
},
|
|
526
526
|
require: {
|
|
527
527
|
file: "consumer.cts",
|
|
528
|
-
mode:
|
|
528
|
+
mode: typescript6_default.ModuleKind.CommonJS
|
|
529
529
|
}
|
|
530
530
|
};
|
|
531
531
|
const DECLARATION_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
532
|
+
typescript6_default.Extension.Dts,
|
|
533
|
+
typescript6_default.Extension.Dmts,
|
|
534
|
+
typescript6_default.Extension.Dcts
|
|
535
535
|
]);
|
|
536
536
|
const DECLARATION_FILE$1 = /\.d\.[cm]?ts$/;
|
|
537
537
|
/** An `exports` value that names declarations: a `types` condition or a `.d.ts`, `.d.mts` or `.d.cts` target. */
|
|
@@ -585,10 +585,10 @@ function entrySpecifiers(name, exports, files, consumer) {
|
|
|
585
585
|
import: [name],
|
|
586
586
|
require: []
|
|
587
587
|
};
|
|
588
|
-
const { options } =
|
|
588
|
+
const { options } = typescript6_default.convertCompilerOptionsFromJson(CONSUMER_OPTIONS, consumer);
|
|
589
589
|
const found = [...candidates(name, exports, files)];
|
|
590
590
|
const kept = (mode) => found.flatMap(([specifier, namesDeclarations]) => {
|
|
591
|
-
const { resolvedModule } =
|
|
591
|
+
const { resolvedModule } = typescript6_default.resolveModuleName(specifier, join(consumer, CONSUMER_FILES[mode].file), options, typescript6_default.sys, void 0, void 0, CONSUMER_FILES[mode].mode);
|
|
592
592
|
if (!resolvedModule) return [];
|
|
593
593
|
return DECLARATION_EXTENSIONS.has(resolvedModule.extension) || namesDeclarations ? [specifier] : [];
|
|
594
594
|
});
|
|
@@ -1219,8 +1219,6 @@ function isLayerCode(layer, file) {
|
|
|
1219
1219
|
const segments = relative(layer, file).split(sep);
|
|
1220
1220
|
return segments[0] !== LAYER_PLAYGROUND && !segments.some((segment) => NOT_LAYER_CODE.has(segment));
|
|
1221
1221
|
}
|
|
1222
|
-
/** The packages whose `tsc` a repository runs, in order: `typescript`, else `@typescript/native` when `typescript` is the TypeScript 6 API (`@typescript/typescript6`, whose only bin is `tsc6`) installed beside TypeScript 7 for tools that need that API. */
|
|
1223
|
-
const COMPILER_PACKAGES = ["typescript", "@typescript/native"];
|
|
1224
1222
|
/**
|
|
1225
1223
|
* The `package.json` of the package `name` in the nearest `node_modules` from `root` up, where a workspace may hoist it.
|
|
1226
1224
|
* Node's resolution is not used: it falls back to `NODE_PATH`, where a package manager's bin shim lists the pack's own
|
|
@@ -1233,9 +1231,9 @@ function manifestOf(root, name) {
|
|
|
1233
1231
|
if (dirname(folder) === folder) return void 0;
|
|
1234
1232
|
}
|
|
1235
1233
|
}
|
|
1236
|
-
/** The `bin.tsc` entry of the
|
|
1237
|
-
function
|
|
1238
|
-
const manifestPath = manifestOf(root,
|
|
1234
|
+
/** The repository's own `tsc`, the `bin.tsc` entry of the `typescript` it installs, run with Node so no shell parses its path. It is read from `package.json`, a file every TypeScript version ships, because TypeScript 7 declares an `exports` map that leaves `typescript/bin/tsc` out. */
|
|
1235
|
+
function compilerOf(root) {
|
|
1236
|
+
const manifestPath = manifestOf(root, "typescript");
|
|
1239
1237
|
if (manifestPath === void 0) return void 0;
|
|
1240
1238
|
try {
|
|
1241
1239
|
const tsc = parseManifest(readFileSync(manifestPath, "utf8")).bin?.tsc;
|
|
@@ -1244,17 +1242,10 @@ function binTsc(root, name) {
|
|
|
1244
1242
|
return;
|
|
1245
1243
|
}
|
|
1246
1244
|
}
|
|
1247
|
-
/** The repository's own `tsc` entry, run with Node so no shell parses its path. */
|
|
1248
|
-
function compilerOf(root) {
|
|
1249
|
-
for (const name of COMPILER_PACKAGES) {
|
|
1250
|
-
const tsc = binTsc(root, name);
|
|
1251
|
-
if (tsc !== void 0) return tsc;
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
1245
|
async function typecheckLayer(root, compiler, layer, signal) {
|
|
1255
1246
|
const configPath = join(root, layer, TSCONFIG);
|
|
1256
1247
|
if (!existsSync(configPath)) return `${layer}: has a verify.config.ts and no tsconfig.json. Add a tsconfig.json that includes its TypeScript files; antelopejs-sync writes one for the shared kinds.\n`;
|
|
1257
|
-
const ts = (await import("
|
|
1248
|
+
const ts = (await import("./typescript6-BWqCcXGY.mjs")).default;
|
|
1258
1249
|
const parsed = ts.getParsedCommandLineOfConfigFile(configPath, void 0, {
|
|
1259
1250
|
...ts.sys,
|
|
1260
1251
|
onUnRecoverableConfigFileDiagnostic: () => void 0
|
|
@@ -1636,7 +1627,8 @@ function checkSingletonPackages(root) {
|
|
|
1636
1627
|
//#region src/guardrails/script-steps.ts
|
|
1637
1628
|
const SEPARATORS = /&&|\|\||[;|\n]|(?<![>&])&(?!&)/u;
|
|
1638
1629
|
const ENV_ASSIGNMENT = /^[A-Za-z_]\w*=/u;
|
|
1639
|
-
|
|
1630
|
+
/** The compilers a script runs by name: TypeScript's `tsc` and the pack's `antelopejs-tsc`, which takes the same arguments. */
|
|
1631
|
+
const TSC_COMMANDS = ["tsc", "antelopejs-tsc"];
|
|
1640
1632
|
const MANAGERS = /* @__PURE__ */ new Set([
|
|
1641
1633
|
"pnpm",
|
|
1642
1634
|
"npm",
|
|
@@ -1746,15 +1738,19 @@ function skipOptions(args, from, valued) {
|
|
|
1746
1738
|
targets
|
|
1747
1739
|
};
|
|
1748
1740
|
}
|
|
1749
|
-
|
|
1750
|
-
|
|
1741
|
+
/** The compiler `word` runs: its name or a path to it, with or without `.js`. */
|
|
1742
|
+
function tscCommand(word) {
|
|
1743
|
+
const name = word.split(/[\\/]/u).at(-1)?.replace(/\.js$/u, "");
|
|
1744
|
+
return TSC_COMMANDS.find((command) => command === name);
|
|
1751
1745
|
}
|
|
1752
|
-
/** `tsc`, a path to
|
|
1746
|
+
/** `tsc` or the pack's `antelopejs-tsc`, a path to either, or `node` running one. */
|
|
1753
1747
|
function programSteps(line) {
|
|
1754
1748
|
const [head, ...rest] = line;
|
|
1755
1749
|
if (head === void 0) return [];
|
|
1756
|
-
|
|
1750
|
+
const command = tscCommand(head);
|
|
1751
|
+
if (command) return [{
|
|
1757
1752
|
kind: "tsc",
|
|
1753
|
+
command,
|
|
1758
1754
|
args: rest,
|
|
1759
1755
|
targets: []
|
|
1760
1756
|
}];
|
|
@@ -1765,8 +1761,10 @@ function programSteps(line) {
|
|
|
1765
1761
|
targets: []
|
|
1766
1762
|
}];
|
|
1767
1763
|
const at = rest.findIndex((word) => !word.startsWith("-"));
|
|
1768
|
-
|
|
1764
|
+
const run = at === -1 ? void 0 : tscCommand(rest[at]);
|
|
1765
|
+
return run ? [{
|
|
1769
1766
|
kind: "tsc",
|
|
1767
|
+
command: run,
|
|
1770
1768
|
args: rest.slice(at + 1),
|
|
1771
1769
|
targets: []
|
|
1772
1770
|
}] : [];
|
|
@@ -1799,7 +1797,7 @@ function managerSteps(manager, args) {
|
|
|
1799
1797
|
const verb = args[first.index];
|
|
1800
1798
|
if (verb === void 0) return [];
|
|
1801
1799
|
if (EXEC_VERBS.has(verb)) return pointedAt(execSteps(args.slice(first.index + 1)), first.targets);
|
|
1802
|
-
if (
|
|
1800
|
+
if (tscCommand(verb)) return pointedAt(programSteps(args.slice(first.index)), first.targets);
|
|
1803
1801
|
const run = verb === "run" || verb === "run-script";
|
|
1804
1802
|
const second = run ? skipOptions(args, first.index + 1, valued) : {
|
|
1805
1803
|
index: first.index,
|
|
@@ -1919,12 +1917,12 @@ function configFile(directory, project) {
|
|
|
1919
1917
|
/** Whether a `tsc` command line writes output: `-b`, or a run whose command line or tsconfig chain leaves `noEmit` unset. */
|
|
1920
1918
|
function tscWrites(directory, args) {
|
|
1921
1919
|
if (/^--?b(?:uild)?$/iu.test(args[0] ?? "")) return true;
|
|
1922
|
-
const { options } =
|
|
1920
|
+
const { options } = typescript6_default.parseCommandLine([...args]);
|
|
1923
1921
|
if (options.noEmit !== void 0) return !options.noEmit;
|
|
1924
1922
|
const file = configFile(directory, options.project ?? ".");
|
|
1925
1923
|
if (!existsSync(file)) return true;
|
|
1926
|
-
return
|
|
1927
|
-
...
|
|
1924
|
+
return typescript6_default.getParsedCommandLineOfConfigFile(file, {}, {
|
|
1925
|
+
...typescript6_default.sys,
|
|
1928
1926
|
onUnRecoverableConfigFileDiagnostic: () => void 0
|
|
1929
1927
|
})?.options.noEmit !== true;
|
|
1930
1928
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as parseManifest } from "./package-
|
|
1
|
+
import { s as parseManifest } from "./package-1pH5I0TF.mjs";
|
|
2
2
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { isMap, isScalar, isSeq, parseDocument } from "yaml";
|
package/dist/eslint.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as typeAwareRuleSetting, t as TYPE_AWARE_RULES } from "./type-aware-rules-BxhHbizU.mjs";
|
|
2
|
-
import { t as guardrailsPlugin } from "./guardrails-
|
|
2
|
+
import { t as guardrailsPlugin } from "./guardrails-CNmSFSxO.mjs";
|
|
3
3
|
import { createConfigForNuxt } from "@nuxt/eslint-config/flat";
|
|
4
4
|
//#region src/eslint.ts
|
|
5
5
|
/** Whether every rule of `plugin` has the `create` function ESLint calls, which `eslintCompatPlugin` gives each oxlint rule. */
|