@r_masseater/vite-plus-adopt 0.7.0 → 0.8.1

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 CHANGED
@@ -49,6 +49,7 @@ export default defineConfig({
49
49
  ```
50
50
 
51
51
  `import type {} from "@r_masseater/vite-plus-adopt"` で、`defineConfig` に上の 8 つのキーの型が付く。
52
+ textlint は Git が追跡する Markdown を検査する。ほかのファイルも検査するときは、`textlint.sources` に対象の glob(`files`)とそのファイルに当てる設定を並べる。`presets` はそこでも使える。
52
53
  Steiger は `steiger.paths` に合うディレクトリのうち、直下に FSD のレイヤー(`app`・`pages`・`widgets`・`features`・`entities`・`shared` など)のフォルダを持つものだけを検査する。
53
54
 
54
55
  Git のフックは次のように書く。
package/dist/attw.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { t as parseJson } from "./json-D-rhjlSM.mjs";
1
+ import { t as parseJson } from "./json-QtVKpodH.mjs";
2
2
  import { Array as Array$1, Function, MutableRef, Option, Order, Predicate, Record, String as String$1, pipe } from "effect";
3
- import semver, { major, maxSatisfying, minor, valid, validRange } from "semver";
4
3
  import { untar } from "@andrewbranch/untar.js";
5
4
  import { FlateErrorCode, Gunzip } from "fflate";
5
+ import semver, { major, maxSatisfying, minor, valid, validRange } from "semver";
6
6
  import { serverFS } from "typescript/fs";
7
7
  import { API, ModuleKind, ModuleResolutionKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, isObjectType } from "typescript/sync";
8
8
  import { init, parse } from "cjs-module-lexer";
@@ -11,7 +11,7 @@ import { isArrayBindingPattern, isArrayLiteralExpression, isArrowFunction, isBin
11
11
  import validatePackgeName from "validate-npm-package-name";
12
12
  import * as cjs from "@loaderkit/resolve/cjs";
13
13
  import * as esm from "@loaderkit/resolve/esm";
14
- // src/attw/flags.ts
14
+ // src/shared/lib/typescript/flags.ts
15
15
  const DATA_FIRST_ARITY$36 = 2;
16
16
  const SET_BIT = 1;
17
17
  const BINARY = 2;
@@ -23,7 +23,7 @@ const hasFlag = Function.dual(DATA_FIRST_ARITY$36, (flags, mask) => sharedFlags(
23
23
  const withFlags = Function.dual(DATA_FIRST_ARITY$36, (flags, mask) => flags + mask - sharedFlags(flags, mask));
24
24
  const withoutFlags = Function.dual(DATA_FIRST_ARITY$36, (flags, mask) => flags - sharedFlags(flags, mask));
25
25
  const combineFlags = (...masks) => Array$1.reduce(masks, 0, withFlags);
26
- // src/attw/binder-symbols.ts
26
+ // src/shared/lib/typescript/binder-symbols.ts
27
27
  const DATA_FIRST_ARITY$35 = 2;
28
28
  const DATA_FIRST_ARITY_3$22 = 3;
29
29
  const UNDERSCORE = "_";
@@ -107,7 +107,7 @@ const declareSymbol = (declaration) => {
107
107
  if (Predicate.isUndefined(symbol.parent) && Option.isSome(declaration.parent)) symbol.parent = declaration.parent.value;
108
108
  return symbol;
109
109
  };
110
- // src/attw/binder-syntax.ts
110
+ // src/shared/lib/typescript/binder-syntax.ts
111
111
  const DATA_FIRST_ARITY$34 = 2;
112
112
  const REQUIRE_ARGUMENTS = 1;
113
113
  const DEFINE_PROPERTY_ARGUMENTS = 3;
@@ -171,7 +171,7 @@ const isBindableObjectDefinePropertyCall = (node) => {
171
171
  return node.arguments.length === DEFINE_PROPERTY_ARGUMENTS && isObjectDefinePropertyCallee(node.expression) && Option.exists(Option.fromNullishOr(property), isStringOrNumericLiteralLike) && Option.exists(Option.fromNullishOr(target), (value) => isBindableStatic(value, STATIC_NAME));
172
172
  };
173
173
  const isAliasableExpression = (node) => isEntityNameExpression(node) || node.kind === SyntaxKind.ClassExpression;
174
- // src/attw/binder-assignment.ts
174
+ // src/shared/lib/typescript/binder-assignment.ts
175
175
  const DATA_FIRST_ARITY$33 = 2;
176
176
  const AssignmentKind = {
177
177
  None: "None",
@@ -245,7 +245,7 @@ const getAssignmentDeclarationKind = Function.dual(DATA_FIRST_ARITY$33, (node, i
245
245
  if (kind === AssignmentKind.Property || inJsFile) return kind;
246
246
  return AssignmentKind.None;
247
247
  });
248
- // src/attw/binder-names.ts
248
+ // src/shared/lib/typescript/binder-names.ts
249
249
  const DATA_FIRST_ARITY$32 = 2;
250
250
  const isNodeValue = (value) => Predicate.hasProperty(value, "kind") && Predicate.isNumber(value.kind);
251
251
  const declaredName = (node) => {
@@ -322,7 +322,7 @@ const declarationName = Function.dual(DATA_FIRST_ARITY$32, (node, inJsFile) => {
322
322
  onSome: (name) => nameOfNamedDeclaration(node, name)
323
323
  });
324
324
  });
325
- // src/attw/messages.ts
325
+ // src/shared/lib/typescript/messages.ts
326
326
  const DATA_FIRST_ARITY$31 = 2;
327
327
  const Messages = {
328
328
  directoryDoesNotExist: "Directory '{0}' does not exist, skipping all lookups in it.",
@@ -393,12 +393,12 @@ const emitTrace = Function.dual(DATA_FIRST_ARITY$31, (trace, message) => {
393
393
  const traceMessage = (state, message, ...args) => {
394
394
  emitTrace(state.trace, formatMessage(message, ...args));
395
395
  };
396
- // src/attw/text-search.ts
396
+ // src/shared/lib/typescript/text-search.ts
397
397
  const DATA_FIRST_ARITY_3$21 = 3;
398
398
  const START$6 = 0;
399
399
  const indexFrom = Function.dual(DATA_FIRST_ARITY_3$21, (text, search, from) => Option.map(String$1.indexOf(search)(String$1.slice(from)(text)), (found) => found + from));
400
400
  const lastIndexUpTo = Function.dual(DATA_FIRST_ARITY_3$21, (text, search, position) => String$1.lastIndexOf(search)(String$1.slice(START$6, Math.max(position, START$6) + search.length)(text)));
401
- // src/attw/path-roots.ts
401
+ // src/shared/lib/typescript/path-roots.ts
402
402
  const FIRST$2 = 0;
403
403
  const NEXT$2 = 1;
404
404
  const AFTER_NEXT = 2;
@@ -468,7 +468,7 @@ const isRootedDiskPath = (path) => {
468
468
  const root = getPathRoot(path);
469
469
  return root.length > FIRST$2 && !root.isUrl;
470
470
  };
471
- // src/attw/paths.ts
471
+ // src/shared/lib/typescript/paths.ts
472
472
  const DATA_FIRST_ARITY$30 = 2;
473
473
  const SEPARATOR$1 = "/";
474
474
  const ROOT_LENGTH$1 = 1;
@@ -613,7 +613,7 @@ const containsPath = Function.dual(DATA_FIRST_ARITY$30, (parent, child) => {
613
613
  const childComponents = reducePathComponents(getPathComponents(child));
614
614
  return parent === child || childComponents.length >= parentComponents.length && sharedPrefixLength(parentComponents, childComponents) === parentComponents.length;
615
615
  });
616
- // src/attw/package-json-fields.ts
616
+ // src/shared/lib/typescript/package-json-fields.ts
617
617
  const DATA_FIRST_ARITY_3$20 = 3;
618
618
  const EMPTY$6 = 0;
619
619
  const typeName = (value) => {
@@ -657,7 +657,7 @@ const readPackageJsonMainField = Function.dual(DATA_FIRST_ARITY_3$20, (content,
657
657
  baseDirectory
658
658
  }, state));
659
659
  const asRecord = (value) => Option.liftPredicate(value, Predicate.isObject).pipe(Option.getOrElse(() => ({})));
660
- // src/attw/types-versions.ts
660
+ // src/shared/lib/typescript/types-versions.ts
661
661
  const DATA_FIRST_ARITY$29 = 2;
662
662
  const RESOLUTION_VERSION = "5.6.1-rc";
663
663
  const RESOLUTION_VERSION_MAJOR_MINOR = "5.6";
@@ -693,7 +693,7 @@ const resolveTypesVersionPathsWithTrace = (content, state) => resolvePackageJson
693
693
  expected: "object"
694
694
  }, state).pipe(Option.flatMap((typesVersions) => selectVersionPathsWithTrace(asRecord(typesVersions), state)));
695
695
  const getVersionPaths = Function.dual(DATA_FIRST_ARITY$29, (info, state) => info.contents.versionPaths(() => resolveTypesVersionPathsWithTrace(info.contents.packageJsonContent, state)));
696
- // src/attw/binder-declarations.ts
696
+ // src/shared/lib/typescript/binder-declarations.ts
697
697
  const DATA_FIRST_ARITY$28 = 2;
698
698
  const DATA_FIRST_ARITY_3$19 = 3;
699
699
  const DEFAULT_NAME = "default";
@@ -759,7 +759,7 @@ const declareBlockScoped = Function.dual(DATA_FIRST_ARITY_3$19, (binding, node,
759
759
  if (binding.isExternalModule || Predicate.isNotUndefined(binding.commonJsModuleIndicator)) return declareModuleMember(binding, node, flags);
760
760
  return declareLocal(binding, node, flags);
761
761
  });
762
- // src/attw/binder-cjs.ts
762
+ // src/shared/lib/typescript/binder-cjs.ts
763
763
  const DATA_FIRST_ARITY$27 = 2;
764
764
  const DATA_FIRST_ARITY_3$18 = 3;
765
765
  const MAX_ALIAS_STEPS = 100;
@@ -861,7 +861,7 @@ const bindObjectDefinePropertyExport = Function.dual(DATA_FIRST_ARITY_3$18, (bin
861
861
  flags: EXPORT_PROPERTY$1
862
862
  });
863
863
  });
864
- // src/attw/binder-scopes.ts
864
+ // src/shared/lib/typescript/binder-scopes.ts
865
865
  const CONTAINER_KINDS = /* @__PURE__ */ new Set([
866
866
  SyntaxKind.ClassExpression,
867
867
  SyntaxKind.ClassDeclaration,
@@ -929,7 +929,7 @@ const hasAncestor = (node, predicate) => {
929
929
  };
930
930
  const containerIsFile = (node) => !hasAncestor(node, isContainer);
931
931
  const blockScopeIsFile = (node) => !hasAncestor(node, isBlockScopeContainer);
932
- // src/attw/binder-jsdoc.ts
932
+ // src/shared/lib/typescript/binder-jsdoc.ts
933
933
  const DATA_FIRST_ARITY$26 = 2;
934
934
  const TYPE_ALIAS = {
935
935
  includes: SymbolFlags.TypeAlias,
@@ -946,7 +946,7 @@ const declaresFileTypeAlias = (site) => Predicate.isNotUndefined(site.tag.name)
946
946
  const bindJSDocTypeAliases = Function.dual(DATA_FIRST_ARITY$26, (binding, hosts) => {
947
947
  for (const site of typeAliasTagSites(hosts)) if (declaresFileTypeAlias(site)) declareBlockScoped(binding, site.tag, TYPE_ALIAS);
948
948
  });
949
- // src/attw/binder-expando-symbol.ts
949
+ // src/shared/lib/typescript/binder-expando-symbol.ts
950
950
  const EXPANDO_FLAGS = combineFlags(SymbolFlags.Function, SymbolFlags.Class, SymbolFlags.NamespaceModule);
951
951
  const isFunctionOrArrow = (node) => isFunctionExpression(node) || isArrowFunction(node);
952
952
  const expandoInitializer = (initializer, isPrototypeAssignment) => {
@@ -979,7 +979,7 @@ const declarationIsExpando = (node) => {
979
979
  const isExpandoSymbol = (symbol) => hasFlag(symbol.flags, EXPANDO_FLAGS) || Option.exists(Option.fromNullishOr(symbol.valueDeclaration), declarationIsExpando);
980
980
  const isFunctionSymbol = (symbol) => symbol.pipe(Option.flatMap((found) => Option.fromNullishOr(found.valueDeclaration)), Option.exists((declaration) => isFunctionDeclaration(declaration) || isVariableDeclaration(declaration) && isFunctionLike(declaration.initializer)));
981
981
  const hasFunctionLikeExpandoInitializer = (declaration) => Option.exists(assignedExpandoInitializer(declaration), isFunctionOrArrow);
982
- // src/attw/binder-expando.ts
982
+ // src/shared/lib/typescript/binder-expando.ts
983
983
  const DATA_FIRST_ARITY_3$17 = 3;
984
984
  const DESCRIPTOR_ARGUMENT = 2;
985
985
  const NAMESPACE_FLAGS = {
@@ -1103,7 +1103,7 @@ const bindObjectDefinePropertyAssignment = Function.dual(DATA_FIRST_ARITY_3$17,
1103
1103
  const isTopLevel = isSourceFile(call.parent.parent);
1104
1104
  bindExpandoMember(binding, call, namespaceFor(binding, target, isTopLevel));
1105
1105
  });
1106
- // src/attw/binder-module-exports.ts
1106
+ // src/shared/lib/typescript/binder-module-exports.ts
1107
1107
  const DATA_FIRST_ARITY_3$16 = 3;
1108
1108
  const isEmptyObjectLiteral = (node) => isObjectLiteralExpression(node) && !Array$1.isReadonlyArrayNonEmpty(node.properties);
1109
1109
  const MODULE_EXPORTS_ALIAS = {
@@ -1143,7 +1143,7 @@ const bindModuleExportsAccess = Function.dual(DATA_FIRST_ARITY_3$16, (binding, n
1143
1143
  flags: MODULE_LOCAL
1144
1144
  });
1145
1145
  });
1146
- // src/attw/binder-this.ts
1146
+ // src/shared/lib/typescript/binder-this.ts
1147
1147
  const DATA_FIRST_ARITY$25 = 2;
1148
1148
  const THIS_CONTAINER_KINDS = /* @__PURE__ */ new Set([
1149
1149
  SyntaxKind.FunctionDeclaration,
@@ -1185,7 +1185,7 @@ const bindThisPropertyAssignment = Function.dual(DATA_FIRST_ARITY$25, (binding,
1185
1185
  declareSourceFileMember(binding, node, THIS_PROPERTY_LOCAL);
1186
1186
  });
1187
1187
  const isThisInitialized = Function.dual(DATA_FIRST_ARITY$25, (binding, node) => isAccessExpression(node.left) && variableInitializer(binding, node.left.expression).pipe(Option.exists(isThisKeyword)));
1188
- // src/attw/binder-expressions.ts
1188
+ // src/shared/lib/typescript/binder-expressions.ts
1189
1189
  const EXPRESSION_ARITY = 3;
1190
1190
  const isThisAliasAssignment = (binding, node, scope) => binding.isJs && scope.blockIsFile && isThisInitialized(binding, node);
1191
1191
  const bindPropertyAssignment = (binding, node, scope) => {
@@ -1282,7 +1282,7 @@ const containerState = (node, stateOf) => {
1282
1282
  return INSTANTIATED;
1283
1283
  };
1284
1284
  const getModuleInstanceState = (node) => Option.getOrElse(declarationState(node), () => containerState(node, getModuleInstanceState));
1285
- // src/attw/binder-nodes.ts
1285
+ // src/shared/lib/typescript/binder-nodes.ts
1286
1286
  const flagPair = (includes, excludes) => ({
1287
1287
  includes,
1288
1288
  excludes
@@ -1361,7 +1361,7 @@ const DECLARATION_BINDERS = /* @__PURE__ */ new Map([
1361
1361
  [SyntaxKind.ExportDeclaration, bindExportDeclaration],
1362
1362
  [SyntaxKind.ExportAssignment, bindExportAssignment]
1363
1363
  ]);
1364
- // src/attw/binder-variables.ts
1364
+ // src/shared/lib/typescript/binder-variables.ts
1365
1365
  const DATA_FIRST_ARITY_3$15 = 3;
1366
1366
  const ALIAS = {
1367
1367
  includes: SymbolFlags.Alias,
@@ -1416,7 +1416,7 @@ const variableBinderFor = (binding, node) => {
1416
1416
  const bindVariable = Function.dual(DATA_FIRST_ARITY_3$15, (binding, node, scope) => {
1417
1417
  if (!isBindingPattern(node.name)) variableBinderFor(binding, node)(binding, node, scope);
1418
1418
  });
1419
- // src/attw/binder-walk.ts
1419
+ // src/shared/lib/typescript/binder-walk.ts
1420
1420
  const FILE_SCOPE = {
1421
1421
  containerIsFile: true,
1422
1422
  blockIsFile: true
@@ -1471,7 +1471,7 @@ const bindFileNodes = (binding) => {
1471
1471
  }
1472
1472
  return pipe(bound, Array$1.filter((node) => !isReparsed(node)));
1473
1473
  };
1474
- // src/attw/binder.ts
1474
+ // src/shared/lib/typescript/binder.ts
1475
1475
  const USE_STRICT = "use strict";
1476
1476
  const JSON_EXPORT = {
1477
1477
  includes: SymbolFlags.Property,
@@ -1526,7 +1526,7 @@ const bindSourceFile = (file) => {
1526
1526
  if (binding.isJs) bindJSDocTypeAliases(binding, nodes);
1527
1527
  exposeOnSourceFile(binding);
1528
1528
  };
1529
- // src/attw/extensions.ts
1529
+ // src/shared/lib/typescript/extensions.ts
1530
1530
  const DATA_FIRST_ARITY$24 = 2;
1531
1531
  const Extension = {
1532
1532
  Ts: ".ts",
@@ -1654,7 +1654,7 @@ const EXTENSIONS_FOR_KIND = {
1654
1654
  Json: [Extension.Json]
1655
1655
  };
1656
1656
  const extensionIsOk = Function.dual(DATA_FIRST_ARITY$24, (extensions, extension) => pipe(EXTENSION_KIND_ORDER, Array$1.some((kind) => extensions.includes(kind) && EXTENSIONS_FOR_KIND[kind].includes(extension))));
1657
- // src/attw/source-file.ts
1657
+ // src/shared/lib/typescript/source-file.ts
1658
1658
  const DATA_FIRST_ARITY$23 = 2;
1659
1659
  const infos = /* @__PURE__ */ new WeakMap();
1660
1660
  const UNSET = Object.freeze({
@@ -1705,7 +1705,7 @@ const moduleAugmentationsOf = (sourceFile) => Option.match(infoOf(sourceFile), {
1705
1705
  });
1706
1706
  const isSourceFileJS = (sourceFile) => sourceFile.scriptKind === ScriptKind.JS || sourceFile.scriptKind === ScriptKind.JSX;
1707
1707
  const isJSDocNode = (node) => hasFlag(node.flags, NodeFlags.JSDoc);
1708
- // src/attw/module-mode.ts
1708
+ // src/shared/lib/typescript/module-mode.ts
1709
1709
  const DATA_FIRST_ARITY$22 = 2;
1710
1710
  const DATA_FIRST_ARITY_3$14 = 3;
1711
1711
  const SINGLE = 1;
@@ -1760,7 +1760,7 @@ const emitSyntaxForUsage = (sourceFile, usage, options) => {
1760
1760
  };
1761
1761
  const getModeForUsageLocation$1 = Function.dual(DATA_FIRST_ARITY_3$14, (sourceFile, usage, options) => typeOnlyOverride(usage).pipe(Option.orElse(() => importTypeOverride(usage)), Option.orElse(() => Option.liftPredicate(options, importSyntaxAffectsModuleResolution).pipe(Option.flatMap(() => emitSyntaxForUsage(sourceFile, usage, options))))));
1762
1762
  const getDefaultResolutionModeForFile = Function.dual(DATA_FIRST_ARITY$22, (sourceFile, options) => Option.liftPredicate(options, importSyntaxAffectsModuleResolution).pipe(Option.flatMap(() => impliedNodeFormatForEmit(sourceFile, options))));
1763
- // src/attw/resolution-mode-numbers.ts
1763
+ // src/shared/lib/typescript/resolution-mode-numbers.ts
1764
1764
  const MODE_NUMBERS = {
1765
1765
  CommonJS: ModuleKind.CommonJS,
1766
1766
  ESNext: ModuleKind.ESNext
@@ -1768,7 +1768,7 @@ const MODE_NUMBERS = {
1768
1768
  const MODES_BY_NUMBER = /* @__PURE__ */ new Map([[ModuleKind.CommonJS, "CommonJS"], [ModuleKind.ESNext, "ESNext"]]);
1769
1769
  const modeFromNumber = (mode) => Option.fromNullishOr(mode).pipe(Option.flatMap((value) => Option.fromNullishOr(MODES_BY_NUMBER.get(value))));
1770
1770
  const modeToNumber = (mode) => MODE_NUMBERS[mode];
1771
- // src/attw/ts-api.ts
1771
+ // src/shared/lib/typescript/ts-api.ts
1772
1772
  const DATA_FIRST_ARITY_3$13 = 3;
1773
1773
  const MOUNT_ROOT = "/attw";
1774
1774
  const SEPARATOR = "/";
@@ -1860,7 +1860,7 @@ const parseSourceFile = Function.dual(DATA_FIRST_ARITY_3$13, (fileName, text, sc
1860
1860
  retained.dispose();
1861
1861
  return sourceFile;
1862
1862
  });
1863
- // src/attw/typescript-files.ts
1863
+ // src/shared/lib/typescript/typescript-files.ts
1864
1864
  const ROOT = "/";
1865
1865
  const SCRIPT_KIND_AFTER_TEXT = 2;
1866
1866
  const RESOLUTION_NAMES = /* @__PURE__ */ new Map([
@@ -1890,7 +1890,7 @@ const fileFunctions = {
1890
1890
  createSourceFile,
1891
1891
  getModeForUsageLocation
1892
1892
  };
1893
- // src/attw/typescript-guards.ts
1893
+ // src/shared/lib/typescript/typescript-guards.ts
1894
1894
  const QUIT = "quit";
1895
1895
  const toleratingAbsence = (guard) => (node) => Predicate.isNotUndefined(node) && guard(node);
1896
1896
  const isFunctionBlock = (node) => Predicate.isNotUndefined(node) && isBlock(node) && isFunctionLike(node.parent);
@@ -1934,7 +1934,7 @@ const nodeFunctions = {
1934
1934
  isVariableDeclaration: toleratingAbsence(isVariableDeclaration),
1935
1935
  skipParentheses
1936
1936
  };
1937
- // src/attw/package-names.ts
1937
+ // src/shared/lib/typescript/package-names.ts
1938
1938
  const DATA_FIRST_ARITY$21 = 2;
1939
1939
  const NEXT$1 = 1;
1940
1940
  const START$4 = 0;
@@ -1971,7 +1971,7 @@ const mangleScopedPackageNameWithTrace = Function.dual(DATA_FIRST_ARITY$21, (pac
1971
1971
  if (mangled !== packageName) traceMessage(state, Messages.scopedPackageDetected, mangled);
1972
1972
  return mangled;
1973
1973
  });
1974
- // src/attw/path-compare.ts
1974
+ // src/shared/lib/typescript/path-compare.ts
1975
1975
  const DATA_FIRST_ARITY$20 = 2;
1976
1976
  const FIRST = 0;
1977
1977
  const SECOND = 1;
@@ -1987,7 +1987,7 @@ const comparePathsCaseInsensitive = Function.dual(DATA_FIRST_ARITY$20, (left, ri
1987
1987
  const rightRoot = String$1.slice(FIRST, getRootLength(right))(right);
1988
1988
  return Option.liftPredicate(compareCaseInsensitive(leftRoot, rightRoot), (result) => result !== FIRST).pipe(Option.getOrElse(() => compareRests(String$1.slice(leftRoot.length)(left), String$1.slice(rightRoot.length)(right))));
1989
1989
  });
1990
- // src/attw/typescript-paths.ts
1990
+ // src/shared/lib/typescript/typescript-paths.ts
1991
1991
  const forEachAncestorDirectory = (directory, visit) => Option.getOrUndefined(forEachAncestorDirectory$1(directory, (ancestor) => Option.fromUndefinedOr(visit(ancestor))));
1992
1992
  const pathFunctions = {
1993
1993
  Extension,
@@ -2002,7 +2002,7 @@ const pathFunctions = {
2002
2002
  pathIsRelative,
2003
2003
  unmangleScopedPackageName
2004
2004
  };
2005
- // src/attw/typescript.ts
2005
+ // src/shared/lib/typescript/index.ts
2006
2006
  const ts = {
2007
2007
  ...fileFunctions,
2008
2008
  ...nodeFunctions,
@@ -2956,7 +2956,7 @@ interface Array<T> {
2956
2956
  [n: number]: T;
2957
2957
  }
2958
2958
  `;
2959
- // src/attw/checker-session.ts
2959
+ // src/shared/lib/typescript/checker-session.ts
2960
2960
  const openCheckerSession = (program) => {
2961
2961
  const api = sharedApi();
2962
2962
  const moduleResolver = api.createModuleResolver(program.compilerOptions, { resolveModuleName: (moduleName, containingDirectory, mode) => Option.getOrUndefined(program.resolve(moduleName, containingDirectory, mode)) });
@@ -2977,7 +2977,7 @@ const openCheckerSession = (program) => {
2977
2977
  }
2978
2978
  };
2979
2979
  };
2980
- // src/attw/checker-symbols.ts
2980
+ // src/shared/lib/typescript/checker-symbols.ts
2981
2981
  const DATA_FIRST_ARITY$19 = 2;
2982
2982
  const EXPORT_EQUALS = "export=";
2983
2983
  const isCheckerSymbol = (symbol) => "getExports" in symbol;
@@ -3031,7 +3031,7 @@ const assignedIdentifier = (declaration) => {
3031
3031
  };
3032
3032
  const localNamed = (identifier) => bindingOf(sourceFileOf(identifier)).pipe(Option.flatMap((binding) => Option.liftPredicate(identifier, (node) => isIdentifier(node)).pipe(Option.flatMap((node) => Option.fromNullishOr(binding.locals.get(escapeLeadingUnderscores$1(node.text)))))));
3033
3033
  const boundExpandoExports = (moduleSymbol) => Option.fromNullishOr(moduleSymbol.exports).pipe(Option.flatMap((exports) => Option.fromNullishOr(exports.get(EXPORT_EQUALS))), Option.flatMap((exportEquals) => firstDeclaration(exportEquals)), Option.flatMap((declaration) => assignedIdentifier(declaration)), Option.flatMap((identifier) => localNamed(identifier)), Option.flatMap((local) => Option.fromNullishOr(local.exports)), Option.map((members) => pipe([...members.values()], Array$1.filter((member) => hasFlag(member.flags, SymbolFlags.Assignment)))), Option.getOrElse(() => []));
3034
- // src/attw/type-only.ts
3034
+ // src/shared/lib/typescript/type-only.ts
3035
3035
  const isTypeOnlyImportClause = (node) => isImportClause(node) && node.phaseModifier === SyntaxKind.TypeKeyword;
3036
3036
  const rule = (guard, test) => (node) => Option.liftPredicate(node, guard).pipe(Option.map(test));
3037
3037
  const isTypeOnlyExportStatement = (node) => isExportDeclaration(node) && node.isTypeOnly;
@@ -3050,7 +3050,7 @@ const TYPE_ONLY_RULES = [
3050
3050
  rule(isNamespaceExport, (namespace) => isTypeOnlyExportStatement(namespace.parent))
3051
3051
  ];
3052
3052
  const isTypeOnlyImportOrExportDeclaration = (node) => Array$1.findFirst(TYPE_ONLY_RULES, (check) => check(node)).pipe(Option.getOrElse(() => false));
3053
- // src/attw/checker.ts
3053
+ // src/shared/lib/typescript/checker.ts
3054
3054
  const UNKNOWN = "unknown";
3055
3055
  const NONE$1 = 0;
3056
3056
  const isAlias = (symbol) => hasFlag(symbol.flags, SymbolFlags.Alias);
@@ -3124,7 +3124,7 @@ const createTypeChecker = (program) => {
3124
3124
  dispose: session.dispose
3125
3125
  };
3126
3126
  };
3127
- // src/attw/package-json.ts
3127
+ // src/shared/lib/typescript/package-json.ts
3128
3128
  const DATA_FIRST_ARITY$18 = 2;
3129
3129
  const DATA_FIRST_ARITY_3$12 = 3;
3130
3130
  const PACKAGE_JSON = "package.json";
@@ -3258,7 +3258,7 @@ const qualifiedName = (packageId) => {
3258
3258
  return packageId.name;
3259
3259
  };
3260
3260
  const packageIdToString = (packageId) => `${qualifiedName(packageId)}@${packageId.version}${packageId.peerDependencies}`;
3261
- // src/attw/resolver-patterns.ts
3261
+ // src/shared/lib/typescript/resolver-patterns.ts
3262
3262
  const DATA_FIRST_ARITY$17 = 2;
3263
3263
  const DATA_FIRST_ARITY_3$11 = 3;
3264
3264
  const NOT_FOUND = -1;
@@ -3299,7 +3299,7 @@ const prefixExpansion = (key, name) => Option.liftPredicate({
3299
3299
  pattern: false
3300
3300
  }, () => String$1.startsWith(key)(name));
3301
3301
  const expandedSubpath = Function.dual(DATA_FIRST_ARITY_3$11, (key, name, state) => trailerExpansion(key, name, state).pipe(Option.orElse(() => starSuffixExpansion(key, name)), Option.orElse(() => prefixExpansion(key, name))));
3302
- // src/attw/resolver-files.ts
3302
+ // src/shared/lib/typescript/resolver-files.ts
3303
3303
  const DATA_FIRST_ARITY$16 = 2;
3304
3304
  const DATA_FIRST_ARITY_3$10 = 3;
3305
3305
  const attempt = (kind, extension, usingTsExtension = false) => ({
@@ -3420,7 +3420,7 @@ const loadFileNameFromPackageJsonField = Function.dual(DATA_FIRST_ARITY$16, (req
3420
3420
  resolvedUsingTsExtension: false
3421
3421
  })));
3422
3422
  });
3423
- // src/attw/resolver-target.ts
3423
+ // src/shared/lib/typescript/resolver-target.ts
3424
3424
  const DATA_FIRST_ARITY_3$9 = 3;
3425
3425
  const FORBIDDEN_SEGMENTS = /* @__PURE__ */ new Set([
3426
3426
  "..",
@@ -3538,7 +3538,7 @@ const loadTarget = Function.dual(DATA_FIRST_ARITY_3$9, (target, site, state) =>
3538
3538
  if (Predicate.isString(target)) return loadStringTarget(target, site, state);
3539
3539
  return loadStructuredTarget(loadTarget)(target, site, state);
3540
3540
  });
3541
- // src/attw/resolver-exports.ts
3541
+ // src/shared/lib/typescript/resolver-exports.ts
3542
3542
  const DATA_FIRST_ARITY_3$8 = 3;
3543
3543
  const DATA_FIRST_ARITY$15 = 2;
3544
3544
  const SAME_ORDER = 0;
@@ -3665,7 +3665,7 @@ const loadModuleFromSelfNameReference = Function.dual(DATA_FIRST_ARITY$15, (look
3665
3665
  extensions: lookup.extensions,
3666
3666
  subpath
3667
3667
  }, state))))));
3668
- // src/attw/paths-mapping.ts
3668
+ // src/shared/lib/typescript/paths-mapping.ts
3669
3669
  const DATA_FIRST_ARITY$14 = 2;
3670
3670
  const STAR_LENGTH = 1;
3671
3671
  const START$2 = 0;
@@ -3732,7 +3732,7 @@ const tryLoadModuleUsingPaths = Function.dual(DATA_FIRST_ARITY$14, (context, sta
3732
3732
  }, context, state)));
3733
3733
  }));
3734
3734
  });
3735
- // src/attw/resolver-directory.ts
3735
+ // src/shared/lib/typescript/resolver-directory.ts
3736
3736
  const DATA_FIRST_ARITY$13 = 2;
3737
3737
  const DECLARATION_ONLY_SIZE = 1;
3738
3738
  const INDEX = "index";
@@ -3819,7 +3819,7 @@ const loadNodeModuleFromDirectory = Function.dual(DATA_FIRST_ARITY$13, (request,
3819
3819
  }, state);
3820
3820
  return withPackageId(info, found, state);
3821
3821
  });
3822
- // src/attw/node-modules-paths.ts
3822
+ // src/shared/lib/typescript/node-modules-paths.ts
3823
3823
  const START$1 = 0;
3824
3824
  const SEPARATOR_STEP = 1;
3825
3825
  const NODE_MODULES_PART = "/node_modules/";
@@ -3835,7 +3835,7 @@ const parseNodeModuleFromPath = (resolved) => {
3835
3835
  return Option.map(String$1.lastIndexOf(NODE_MODULES_PART)(path), (index) => String$1.slice(START$1, packageDirectoryEnd(path, index))(path));
3836
3836
  };
3837
3837
  const pathContainsNodeModules = (path) => String$1.includes(NODE_MODULES_PART)(path);
3838
- // src/attw/resolver-state.ts
3838
+ // src/shared/lib/typescript/resolver-state.ts
3839
3839
  const DATA_FIRST_ARITY$12 = 2;
3840
3840
  const DATA_FIRST_ARITY_3$7 = 3;
3841
3841
  const LAST = -1;
@@ -3922,7 +3922,7 @@ const createState = Function.dual(DATA_FIRST_ARITY_3$7, (request, context, condi
3922
3922
  candidateIsFromPackageJsonField: false,
3923
3923
  outcome: createOutcome()
3924
3924
  }));
3925
- // src/attw/resolver-relative.ts
3925
+ // src/shared/lib/typescript/resolver-relative.ts
3926
3926
  const DATA_FIRST_ARITY$11 = 2;
3927
3927
  const directoryMissing = Function.dual(DATA_FIRST_ARITY$11, (directory, state) => {
3928
3928
  if (state.host.directoryExists(directory)) return false;
@@ -3969,7 +3969,7 @@ const loadRelativeModule = Function.dual(DATA_FIRST_ARITY$11, (lookup, state) =>
3969
3969
  insideNodeModules: parts.includes("node_modules")
3970
3970
  };
3971
3971
  });
3972
- // src/attw/resolver-package-loader.ts
3972
+ // src/shared/lib/typescript/resolver-package-loader.ts
3973
3973
  const DATA_FIRST_ARITY$10 = 2;
3974
3974
  const DATA_FIRST_ARITY_3$6 = 3;
3975
3975
  const EMPTY$3 = 0;
@@ -4009,7 +4009,7 @@ const resolveVersionPathsWithTrace = Function.dual(DATA_FIRST_ARITY_3$6, (reques
4009
4009
  fromFile: withoutPackageMetadata
4010
4010
  }, state);
4011
4011
  })));
4012
- // src/attw/resolver-package.ts
4012
+ // src/shared/lib/typescript/resolver-package.ts
4013
4013
  const DATA_FIRST_ARITY_3$5 = 3;
4014
4014
  const loadSubpathWithoutExports = (request, location, state) => {
4015
4015
  const candidateRequest = {
@@ -4062,7 +4062,7 @@ const loadSubpath = Function.dual(DATA_FIRST_ARITY_3$5, (request, location, stat
4062
4062
  packageInfo
4063
4063
  }, state);
4064
4064
  });
4065
- // src/attw/resolver-node-modules.ts
4065
+ // src/shared/lib/typescript/resolver-node-modules.ts
4066
4066
  const DATA_FIRST_ARITY$9 = 2;
4067
4067
  const EMPTY$2 = 0;
4068
4068
  const FEATURE_NAMES = [
@@ -4160,7 +4160,7 @@ const resolveFallbackWithTrace = (search, state) => {
4160
4160
  }, state);
4161
4161
  };
4162
4162
  const loadModuleFromNearestNodeModulesDirectory = Function.dual(DATA_FIRST_ARITY$9, (search, state) => resolvePreferredWithTrace(search, state).pipe(Option.orElse(() => resolveFallbackWithTrace(search, state))));
4163
- // src/attw/resolver-attempt.ts
4163
+ // src/shared/lib/typescript/resolver-attempt.ts
4164
4164
  const DATA_FIRST_ARITY$8 = 2;
4165
4165
  const DATA_FIRST_ARITY_3$4 = 3;
4166
4166
  const EMPTY$1 = 0;
@@ -4248,7 +4248,7 @@ const resolveAlternateResultWithTrace = Function.dual(DATA_FIRST_ARITY_3$4, (req
4248
4248
  if (shouldRetryWithBundler(request, result)) return retryWithBundler(request, state);
4249
4249
  return Option.none();
4250
4250
  });
4251
- // src/attw/resolver.ts
4251
+ // src/shared/lib/typescript/resolver.ts
4252
4252
  const DATA_FIRST_ARITY$7 = 2;
4253
4253
  const supportsExportsAndImports = (request) => request.options.moduleResolution !== "Node10";
4254
4254
  const modeLabel = (features) => {
@@ -4356,7 +4356,7 @@ const resolveModuleName = Function.dual(DATA_FIRST_ARITY$7, (request, context) =
4356
4356
  traceOutcome(request.moduleName, result, context.trace);
4357
4357
  return result;
4358
4358
  });
4359
- // src/attw/compiler-checker.ts
4359
+ // src/shared/lib/typescript/compiler-checker.ts
4360
4360
  const DATA_FIRST_ARITY_3$3 = 3;
4361
4361
  const checkerOptions = (core) => ({
4362
4362
  module: core.compilerOptions["module"],
@@ -4395,9 +4395,9 @@ const openChecker = Function.dual(DATA_FIRST_ARITY_3$3, (site, files, rootNames)
4395
4395
  resolve: checkerResolver(site, (path) => filePaths.has(path))
4396
4396
  });
4397
4397
  });
4398
- // src/attw/host-types.ts
4398
+ // src/shared/lib/typescript/host-types.ts
4399
4399
  const LIB_FILE_NAME = "/node_modules/typescript/lib/lib.d.ts";
4400
- // src/attw/program-build.ts
4400
+ // src/shared/lib/typescript/program-build.ts
4401
4401
  const DATA_FIRST_ARITY$6 = 2;
4402
4402
  const OUTSIDE_NODE_MODULES$1 = 0;
4403
4403
  const createDepthCounter = () => {
@@ -4464,7 +4464,7 @@ const createProgramBuild = Function.dual(DATA_FIRST_ARITY$6, (host, options) =>
4464
4464
  registry: createFileRegistry(),
4465
4465
  depth: createDepthCounter()
4466
4466
  }));
4467
- // src/attw/program-imports.ts
4467
+ // src/shared/lib/typescript/program-imports.ts
4468
4468
  const DATA_FIRST_ARITY_3$2 = 3;
4469
4469
  const MAX_NODE_MODULE_JS_DEPTH$1 = 0;
4470
4470
  const EMPTY = 0;
@@ -4541,7 +4541,7 @@ const processImportedModules = Function.dual(DATA_FIRST_ARITY_3$2, (build, impor
4541
4541
  };
4542
4542
  for (const { site, entry } of resolved) for (const module of Option.toArray(entry.resolution.resolvedModule)) followResolvedModule(walk, site, module);
4543
4543
  });
4544
- // src/attw/program.ts
4544
+ // src/shared/lib/typescript/program.ts
4545
4545
  const DATA_FIRST_ARITY_3$1 = 3;
4546
4546
  const TS_EXTENSIONS = [
4547
4547
  ".ts",
@@ -4713,7 +4713,7 @@ const createProgramFiles = Function.dual(DATA_FIRST_ARITY_3$1, (rootNames, optio
4713
4713
  }
4714
4714
  return build.registry.result();
4715
4715
  });
4716
- // src/attw/compiler-program.ts
4716
+ // src/shared/lib/typescript/compiler-program.ts
4717
4717
  const DATA_FIRST_ARITY$5 = 2;
4718
4718
  const buildProgramFiles = (site, rootNames) => createProgramFiles(rootNames, site.options, {
4719
4719
  modeOptions: site.core.modeOptions,
@@ -4747,7 +4747,7 @@ const createProgram = Function.dual(DATA_FIRST_ARITY$5, (site, rootNames) => {
4747
4747
  }
4748
4748
  };
4749
4749
  });
4750
- // src/attw/resolution-cache.ts
4750
+ // src/shared/lib/typescript/resolution-cache.ts
4751
4751
  const DATA_FIRST_ARITY$4 = 2;
4752
4752
  const NEXT = 1;
4753
4753
  const START = 0;
@@ -4810,7 +4810,7 @@ const createModuleResolutionCache = () => {
4810
4810
  }
4811
4811
  };
4812
4812
  };
4813
- // src/attw/host-resolutions.ts
4813
+ // src/shared/lib/typescript/host-resolutions.ts
4814
4814
  const DEFAULT_MODE = 1;
4815
4815
  const ALLOW_JS_FLAG = 0;
4816
4816
  const modeNumber = (mode) => mode.pipe(Option.map((value) => modeToNumber(value)), Option.getOrElse(() => DEFAULT_MODE));
@@ -4876,7 +4876,7 @@ const createResolutionStore = (source) => {
4876
4876
  getTrace: (request) => lookup(request).pipe(Option.map((entry) => entry.trace))
4877
4877
  };
4878
4878
  };
4879
- // src/attw/compiler-host-wrapper.ts
4879
+ // src/shared/lib/typescript/compiler-host-wrapper.ts
4880
4880
  const DATA_FIRST_ARITY$3 = 2;
4881
4881
  const PROGRAM_CACHE_SIZE = 2;
4882
4882
  const PRIMARY_OPTIONS = {
@@ -4963,7 +4963,7 @@ const wrapHost = Function.dual(DATA_FIRST_ARITY$3, (core, site) => {
4963
4963
  getResolvedModule: (sourceFile, moduleName, resolutionMode) => Option.getOrUndefined(resolvedModules.lookup(sourceFile.fileName, moduleName, modeFromNumber(resolutionMode)))
4964
4964
  };
4965
4965
  });
4966
- // src/attw/host-files.ts
4966
+ // src/shared/lib/typescript/host-files.ts
4967
4967
  const ESM_EXTENSIONS = [
4968
4968
  ".d.mts",
4969
4969
  ".mts",
@@ -5051,7 +5051,7 @@ const createFileFormats = (source) => ({
5051
5051
  moduleKind: (fileName) => moduleKindOf(source, fileName),
5052
5052
  packageJsonScopeFor: (fileName) => packageJsonScopeOf(source, fileName)
5053
5053
  });
5054
- // src/attw/host-sources.ts
5054
+ // src/shared/lib/typescript/host-sources.ts
5055
5055
  const createSourceFileStore = (origin) => {
5056
5056
  const sourceFiles = /* @__PURE__ */ new Map();
5057
5057
  const cached = (fileName) => Option.fromNullishOr(sourceFiles.get(toPath(fileName)));
@@ -5066,7 +5066,7 @@ const createSourceFileStore = (origin) => {
5066
5066
  cached
5067
5067
  };
5068
5068
  };
5069
- // src/attw/type-reference-state.ts
5069
+ // src/shared/lib/typescript/type-reference-state.ts
5070
5070
  const DATA_FIRST_ARITY$2 = 2;
5071
5071
  const conditionsFor = (request, exportsEnabled) => {
5072
5072
  if (!exportsEnabled) return [];
@@ -5095,7 +5095,7 @@ const stateFor = Function.dual(DATA_FIRST_ARITY$2, (request, host) => {
5095
5095
  resolveNested: resolveNestedModule
5096
5096
  };
5097
5097
  });
5098
- // src/attw/type-reference.ts
5098
+ // src/shared/lib/typescript/type-reference.ts
5099
5099
  const DATA_FIRST_ARITY$1 = 2;
5100
5100
  const TYPE_ROOT = "/node_modules/@types";
5101
5101
  const DECLARATION = extensionsOf("Declaration");
@@ -5132,7 +5132,7 @@ const resolveTypeReferenceDirective = Function.dual(DATA_FIRST_ARITY$1, (request
5132
5132
  isExternalLibraryImport: pathContainsNodeModules(resolved.path)
5133
5133
  })));
5134
5134
  });
5135
- // src/attw/host-wrapper.ts
5135
+ // src/shared/lib/typescript/host-wrapper.ts
5136
5136
  const TARGET_LATEST = 99;
5137
5137
  const MODULE_KINDS = {
5138
5138
  Node10: ModuleKind.CommonJS,
@@ -5208,7 +5208,7 @@ const createHostWrapper = (source) => {
5208
5208
  }, resolverHost)
5209
5209
  };
5210
5210
  };
5211
- // src/attw/compiler-hosts.ts
5211
+ // src/shared/lib/typescript/compiler-hosts.ts
5212
5212
  const DATA_FIRST_ARITY = 2;
5213
5213
  const DATA_FIRST_ARITY_3 = 3;
5214
5214
  const RESOLUTION_KINDS_BY_OPTION = /* @__PURE__ */ new Map([