@antelopejs/tooling-configs 0.7.2 → 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.
Files changed (32) hide show
  1. package/README.md +68 -26
  2. package/dist/bin/api-diff.mjs +16 -16
  3. package/dist/bin/body-check.mjs +1 -1
  4. package/dist/bin/check-size.mjs +1 -1
  5. package/dist/bin/checks.mjs +1 -1
  6. package/dist/bin/comment-proof.mjs +2 -2
  7. package/dist/bin/ratchet.mjs +3 -3
  8. package/dist/bin/readme-strip.mjs +1 -1
  9. package/dist/bin/suppressions.mjs +3 -3
  10. package/dist/bin/sync.mjs +41 -28
  11. package/dist/bin/tsc.d.mts +1 -0
  12. package/dist/bin/tsc.mjs +24 -0
  13. package/dist/bin/verify.mjs +89 -89
  14. package/dist/{checks-DvND3Ngb.mjs → checks-BTFf0Evy.mjs} +246 -65
  15. package/dist/{docs-compat-BAZiPLZt.mjs → docs-compat-BmczGA1d.mjs} +1 -1
  16. package/dist/eslint.mjs +1 -1
  17. package/dist/{guardrails-PoMIcyGb.mjs → guardrails-CNmSFSxO.mjs} +128 -120
  18. package/dist/{installed-typescript-6MtIWlE4.mjs → installed-typescript-CF_FR9DV.mjs} +17 -17
  19. package/dist/oxc/guardrails/index.mjs +1 -1
  20. package/dist/oxc/lint.mjs +1 -1
  21. package/dist/{package-DDG3YH7W.mjs → package-1pH5I0TF.mjs} +3 -7
  22. package/dist/{proof-stamp-BFV7JTZT.mjs → proof-stamp-Bg4ULLvr.mjs} +2 -2
  23. package/dist/{ratchet-DLCfeaPY.mjs → ratchet-CPpvIU6Y.mjs} +2 -2
  24. package/dist/{suppression-base-CYaLZAq7.mjs → suppression-base-CDiFJse2.mjs} +2 -2
  25. package/dist/{suppression-budget-CPDSFg4X.mjs → suppression-budget-BeJIgSTO.mjs} +1 -1
  26. package/dist/{suppressions-CxPnh4sC.mjs → suppressions-BvWGA463.mjs} +5 -1
  27. package/dist/{templates-HG0fel2S.mjs → templates-Df6SlGLA.mjs} +1 -1
  28. package/dist/{typescript-QfxkJYzd.mjs → typescript-B0df00nl.mjs} +13 -13
  29. package/dist/typescript-version-CptQKjGz.mjs +18 -0
  30. package/dist/typescript6-BWqCcXGY.mjs +2 -0
  31. package/dist/typescript6-HdyOMBv3.mjs +8 -0
  32. package/package.json +27 -5
@@ -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 (ts.isPropertyAccessExpression(parent) || ts.isPropertyAssignment(parent) || ts.isMethodDeclaration(parent) || ts.isPropertyDeclaration(parent) || ts.isGetAccessor(parent) || ts.isSetAccessor(parent) || ts.isEnumMember(parent)) && parent.name === node;
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 && ts.isNamespaceImport(named)) bindings.push([named.name.text, bindingOrigin(covered, module, "*")]);
122
- if (named && ts.isNamedImports(named)) for (const element of named.elements) bindings.push([element.name.text, bindingOrigin(covered, module, (element.propertyName ?? element.name).text)]);
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 (ts.isNamespaceExport(exported)) return [`export * as ${exported.name.text} from ${module}`];
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 || !ts.isNamedExports(exported)) return [];
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 (!(ts.isImportDeclaration(statement) || ts.isExportDeclaration(statement))) continue;
166
+ if (!(typescript6_default.isImportDeclaration(statement) || typescript6_default.isExportDeclaration(statement))) continue;
167
167
  const specifier = statement.moduleSpecifier;
168
- if (specifier === void 0 && ts.isExportDeclaration(statement)) exports.push(statement);
169
- if (specifier === void 0 || !ts.isStringLiteral(specifier)) continue;
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 (ts.isImportDeclaration(statement)) {
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 (ts.isIdentifier(node)) return isPropertyName(node) ? node.text : bindings.get(node.text) ?? node.text;
194
- if (ts.isPrivateIdentifier(node)) return node.text;
195
- if (ts.isNumericLiteral(node)) return String(Number(node.text));
196
- if (ts.isStringLiteralLike(node) || ts.isTemplateLiteralToken(node)) return JSON.stringify(node.text);
197
- if (ts.isBigIntLiteral(node) || ts.isRegularExpressionLiteral(node)) return node.text;
198
- if (ts.isPrefixUnaryExpression(node) || ts.isPostfixUnaryExpression(node)) return ts.SyntaxKind[node.operator];
199
- if (ts.isVariableDeclarationList(node)) return String(node.flags & (ts.NodeFlags.Let | ts.NodeFlags.Const));
200
- if (ts.isMetaProperty(node)) return ts.SyntaxKind[node.keywordToken];
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 === ts.SyntaxKind.ExportKeyword || node.kind === ts.SyntaxKind.DefaultKeyword;
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 (ts.isParenthesizedExpression(node)) return structureOf(node.expression, bindings);
213
+ if (typescript6_default.isParenthesizedExpression(node)) return structureOf(node.expression, bindings);
214
214
  const children = [];
215
- ts.forEachChild(node, (child) => {
215
+ typescript6_default.forEachChild(node, (child) => {
216
216
  if (!dropped(child)) children.push(structureOf(child, bindings));
217
217
  });
218
- return `${ts.SyntaxKind[node.kind]}(${leafOf(node, bindings)}|${children.join(",")})`;
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 } = ts.transpileModule(source, {
225
+ const { outputText } = typescript6_default.transpileModule(source, {
226
226
  fileName: path,
227
227
  compilerOptions: {
228
- target: ts.ScriptTarget.ES2022,
229
- module: ts.ModuleKind.ESNext,
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: ts.createSourceFile("emit.js", outputText, ts.ScriptTarget.ES2022, true, ts.ScriptKind.JS)
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 ts.isIdentifier(name) ? [name.text] : name.elements.flatMap((element) => ts.isOmittedExpression(element) ? [] : declaredNames$1(element.name));
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 ts.isFunctionDeclaration(statement) && Boolean(statement.body) && statement.name !== void 0;
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 (ts.isVariableStatement(statement)) return statement.declarationList.declarations.flatMap((declaration) => declaredNames$1(declaration.name));
250
- return (ts.isClassDeclaration(statement) || ts.isEnumDeclaration(statement)) && statement.name ? [statement.name.text] : [];
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) => !ts.isImportDeclaration(statement) && !ts.isExportDeclaration(statement)).map((statement) => {
260
- const hoisted = ts.isFunctionDeclaration(statement) && Boolean(statement.body);
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 = ts.SymbolFlags.Interface | ts.SymbolFlags.Class | ts.SymbolFlags.Enum | ts.SymbolFlags.TypeAlias;
1776
- const MODULE = ts.SymbolFlags.ValueModule | ts.SymbolFlags.NamespaceModule;
1777
- const INHERITING = ts.SymbolFlags.Class | ts.SymbolFlags.Interface;
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 & ts.TypeFlags.Object) !== 0;
1779
+ return (type.flags & typescript6_default.TypeFlags.Object) !== 0;
1780
1780
  }
1781
1781
  function isReference(type) {
1782
- return (type.objectFlags & ts.ObjectFlags.Reference) !== 0;
1782
+ return (type.objectFlags & typescript6_default.ObjectFlags.Reference) !== 0;
1783
1783
  }
1784
1784
  function isPublicMember(member) {
1785
- const hidden = ts.ModifierFlags.Private | ts.ModifierFlags.Protected;
1786
- return (ts.getCombinedModifierFlags(member) & hidden) === 0 && !(member.name !== void 0 && ts.isPrivateIdentifier(member.name));
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 (!ts.isClassDeclaration(declaration)) return declaration;
1791
- return ts.factory.updateClassDeclaration(declaration, declaration.modifiers, declaration.name, declaration.typeParameters, declaration.heritageClauses, declaration.members.filter(isPublicMember));
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 ts.isIdentifier(expression) || ts.isPropertyAccessExpression(expression) && isEntityName(expression.expression);
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 (ts.isTypeReferenceNode(node)) return node.typeName;
1800
- if (ts.isExpressionWithTypeArguments(node) && isEntityName(node.expression)) return node.expression;
1801
- if (ts.isTypeQueryNode(node)) return node.exprName;
1802
- if (!ts.isImportTypeNode(node)) return void 0;
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 ts.isLiteralTypeNode(node.argument) ? node.argument.literal : void 0;
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 ts.isSourceFile(declaration) || ts.isModuleDeclaration(declaration);
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 = ts.createPrinter({ removeComments: true });
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 & ts.SymbolFlags.Alias ? this.checker.getAliasedSymbol(symbol) : symbol;
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(ts.EmitHint.Unspecified, publicPart(declaration), declaration.getSourceFile()).replace(/\s+/g, " ").replace(/^(?:export )?(?:declare )?/, ""));
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 (!ts.isClassLike(declaration) && !ts.isInterfaceDeclaration(declaration)) continue;
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 (ts.isExpressionWithTypeArguments(node)) {
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 (ts.isTypeNode(node)) this.references(node);
1892
- else ts.forEachChild(node, (child) => this.typeArguments(child));
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 = ts.isEnumMember(declaration) ? this.checker.getSymbolAtLocation(declaration.parent.name) : void 0;
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(ts.InternalSymbolName.ExportEquals);
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 & ts.SymbolFlags.Value) this.reach(value);
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 = ts.isIdentifier(expression) || ts.isPropertyAccessExpression(expression) ? this.checker.getSymbolAtLocation(expression) : void 0;
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
- ts.forEachChild(expression, (child) => {
1918
- if (!ts.isTypeNode(child)) found.push(...this.bases(child));
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 (ts.isExpressionWithTypeArguments(node) && !isEntityName(node.expression)) for (const base of this.bases(node.expression)) this.reach(base);
1927
- ts.forEachChild(node, (child) => this.references(child));
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 & ts.TypeFlags.TypeParameter) {
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 (ts.isVariableStatement(statement)) return statement.declarationList.declarations.map((declaration) => declaration.name);
1952
- if (ts.isInterfaceDeclaration(statement) || ts.isClassDeclaration(statement) || ts.isFunctionDeclaration(statement) || ts.isTypeAliasDeclaration(statement) || ts.isEnumDeclaration(statement) || ts.isModuleDeclaration(statement)) return statement.name ? [statement.name] : [];
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 = ts.isModuleDeclaration(statement) ? statement.body : void 0;
1957
- if (body && ts.isModuleBlock(body)) return body.statements;
1958
- return body && ts.isModuleDeclaration(body) ? [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 (!ts.isModuleDeclaration(statement)) return false;
1963
- if (statement.flags & ts.NodeFlags.GlobalAugmentation) return true;
1964
- if (!ts.isStringLiteral(statement.name)) return false;
1965
- return !(checker.getSymbolAtLocation(statement.name)?.declarations ?? []).some((declaration) => ts.isSourceFile(declaration) && isLocalFile(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) => ts.isExternalModule(file) ? file.statements.filter((statement) => opensOutside(checker, statement, isLocalFile)).flatMap(moduleStatements) : [...file.statements]);
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 = ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.WriteArrowStyleSignature;
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 & ts.SymbolFlags.Alias ? walk.checker.getAliasedSymbol(symbol) : symbol;
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, ts.SignatureKind.Call), ...signatureTexts(walk, constructs, ts.SignatureKind.Construct)];
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 = ts.ModifierFlags.Private | ts.ModifierFlags.Protected;
2058
- return (property.declarations ?? []).every((declaration) => (ts.getCombinedModifierFlags(declaration) & hidden) === 0);
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 & ts.TypeFlags.Object) !== 0;
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 & ts.ObjectFlags.Anonymous) !== 0 && owner !== void 0 && (owner.flags & ts.SymbolFlags.TypeLiteral) !== 0 && declaredHere(walk, owner);
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 & ts.SymbolFlags.Value ? typeOf(walk, symbol) : void 0;
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 & ts.SymbolFlags.Class && declaredHere(walk, symbol)) {
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 & ts.SymbolFlags.Module) for (const member of walk.checker.getExportsOfModule(symbol)) visit(walk, member, `${path}.${member.name}`, next);
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 = (ts.isImportDeclaration(statement) || ts.isExportDeclaration(statement)) && statement.moduleSpecifier && ts.isStringLiteral(statement.moduleSpecifier) ? statement.moduleSpecifier : void 0;
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 = ts.createProgram([...files.values()], {
2135
+ const program = typescript6_default.createProgram([...files.values()], {
2136
2136
  noEmit: true,
2137
2137
  skipLibCheck: true,
2138
2138
  strict: true,
2139
- target: ts.ScriptTarget.ESNext,
2140
- module: ts.ModuleKind.ESNext,
2141
- moduleResolution: ts.ModuleResolutionKind.Bundler,
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"]