@soda-gql/common 0.12.3 → 0.12.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/dist/{canonical-id-U2VNaQ86.mjs → canonical-id-BNdkINTi.mjs} +2 -2
- package/dist/{canonical-id-U2VNaQ86.mjs.map → canonical-id-BNdkINTi.mjs.map} +1 -1
- package/dist/canonical-id.d.cts +1 -1
- package/dist/canonical-id.d.mts +1 -1
- package/dist/canonical-id.mjs +2 -2
- package/dist/{index-BMa2_rDb.d.mts → index-B7A6qmX_.d.mts} +1 -1
- package/dist/{index-BMa2_rDb.d.mts.map → index-B7A6qmX_.d.mts.map} +1 -1
- package/dist/{index-CbQyueYV.d.cts → index-B9cqW0Kp.d.cts} +1 -1
- package/dist/{index-CbQyueYV.d.cts.map → index-B9cqW0Kp.d.cts.map} +1 -1
- package/dist/{index-B1w5x8e3.d.mts → index-BIgjHIdk.d.mts} +2 -25
- package/dist/index-BIgjHIdk.d.mts.map +1 -0
- package/dist/{index-Dit86qkX.d.mts → index-DO6j6Cif.d.cts} +1 -1
- package/dist/{index-Dit86qkX.d.mts.map → index-DO6j6Cif.d.cts.map} +1 -1
- package/dist/{index-LHYortIn.d.cts → index-DeJfMmkU.d.mts} +1 -1
- package/dist/{index-LHYortIn.d.cts.map → index-DeJfMmkU.d.mts.map} +1 -1
- package/dist/{index-BDPAGTeS.d.cts → index-DpSxWrZ_.d.cts} +2 -25
- package/dist/index-DpSxWrZ_.d.cts.map +1 -0
- package/dist/{index-DZSebwar.d.cts → index-KB_f9ZJF.d.mts} +1 -1
- package/dist/{index-DZSebwar.d.cts.map → index-KB_f9ZJF.d.mts.map} +1 -1
- package/dist/{index-AqkJhrm3.d.mts → index-UauBErGY.d.cts} +1 -1
- package/dist/{index-AqkJhrm3.d.mts.map → index-UauBErGY.d.cts.map} +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{portable-BFrcBOaX.mjs → portable-BDL1bEL6.mjs} +1 -1
- package/dist/{portable-BFrcBOaX.mjs.map → portable-BDL1bEL6.mjs.map} +1 -1
- package/dist/portable.d.cts +1 -1
- package/dist/portable.d.mts +1 -1
- package/dist/portable.mjs +1 -1
- package/dist/swc-span-Bi4N-vaI.d.cts +25 -0
- package/dist/swc-span-Bi4N-vaI.d.cts.map +1 -0
- package/dist/swc-span-C4QReqWr.d.mts +25 -0
- package/dist/swc-span-C4QReqWr.d.mts.map +1 -0
- package/dist/template-extraction.cjs +356 -0
- package/dist/template-extraction.cjs.map +1 -0
- package/dist/template-extraction.d.cts +131 -0
- package/dist/template-extraction.d.cts.map +1 -0
- package/dist/template-extraction.d.mts +131 -0
- package/dist/template-extraction.d.mts.map +1 -0
- package/dist/template-extraction.mjs +344 -0
- package/dist/template-extraction.mjs.map +1 -0
- package/dist/{utils-DlhM4qvh.mjs → utils-DOz9GTVx.mjs} +1 -1
- package/dist/{utils-DlhM4qvh.mjs.map → utils-DOz9GTVx.mjs.map} +1 -1
- package/dist/utils.d.cts +2 -1
- package/dist/utils.d.mts +2 -1
- package/dist/utils.mjs +1 -1
- package/dist/{zod-DeSimXdI.mjs → zod-nQLTnNYB.mjs} +1 -1
- package/dist/{zod-DeSimXdI.mjs.map → zod-nQLTnNYB.mjs.map} +1 -1
- package/dist/zod.d.cts +1 -1
- package/dist/zod.d.mts +1 -1
- package/dist/zod.mjs +1 -1
- package/package.json +13 -2
- package/template-extraction.d.ts +2 -0
- package/template-extraction.js +1 -0
- package/dist/index-B1w5x8e3.d.mts.map +0 -1
- package/dist/index-BDPAGTeS.d.cts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as normalizePath } from "./utils-
|
|
1
|
+
import { c as normalizePath } from "./utils-DOz9GTVx.mjs";
|
|
2
2
|
import { isAbsolute, relative, resolve } from "node:path";
|
|
3
3
|
import z$1 from "zod";
|
|
4
4
|
|
|
@@ -229,4 +229,4 @@ const buildAstPath = (stack) => {
|
|
|
229
229
|
|
|
230
230
|
//#endregion
|
|
231
231
|
export { CanonicalIdSchema as a, parseCanonicalId as c, createPathTracker as i, validateCanonicalId as l, createCanonicalTracker as n, createCanonicalId as o, createOccurrenceTracker as r, isRelativeCanonicalId as s, buildAstPath as t };
|
|
232
|
-
//# sourceMappingURL=canonical-id-
|
|
232
|
+
//# sourceMappingURL=canonical-id-BNdkINTi.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-id-U2VNaQ86.mjs","names":["CanonicalIdSchema: z.ZodType<CanonicalId>","z","resolved","normalized","idParts","scopeStack: ScopeFrame[]","frame: ScopeFrame","exportBinding: string | undefined"],"sources":["../src/canonical-id/canonical-id.ts","../src/canonical-id/path-tracker.ts"],"sourcesContent":["import { isAbsolute, relative, resolve } from \"node:path\";\nimport z from \"zod\";\nimport { normalizePath } from \"../utils\";\n\nexport type CanonicalId = string & { readonly __brand: \"CanonicalId\" };\n\nconst canonicalIdSeparator = \"::\" as const;\n\nexport const CanonicalIdSchema: z.ZodType<CanonicalId> = z.string() as unknown as z.ZodType<CanonicalId>;\n\n/**\n * Options for creating a canonical ID.\n */\nexport type CreateCanonicalIdOptions = {\n /**\n * Base directory for relative path computation.\n * When provided, the canonical ID will use a relative path from baseDir.\n * When undefined, an absolute path is required and used as-is.\n */\n readonly baseDir?: string;\n};\n\n/**\n * Create a canonical ID from a file path and AST path.\n *\n * @param filePath - The file path (absolute, or relative if baseDir is provided)\n * @param astPath - The AST path identifying the definition within the file\n * @param options - Optional configuration including baseDir for relative path support\n * @returns A canonical ID in the format \"{path}::{astPath}\"\n */\nexport const createCanonicalId = (filePath: string, astPath: string, options?: CreateCanonicalIdOptions): CanonicalId => {\n const { baseDir } = options ?? {};\n\n if (baseDir) {\n // With baseDir, compute relative path\n const absolutePath = isAbsolute(filePath) ? filePath : resolve(baseDir, filePath);\n const resolved = resolve(absolutePath);\n const relativePath = relative(baseDir, resolved);\n const normalized = normalizePath(relativePath);\n\n const idParts = [normalized, astPath];\n return idParts.join(canonicalIdSeparator) as CanonicalId;\n }\n\n // Without baseDir, require absolute path (legacy behavior)\n if (!isAbsolute(filePath)) {\n throw new Error(\"[INTERNAL] CANONICAL_ID_REQUIRES_ABSOLUTE_PATH\");\n }\n\n const resolved = resolve(filePath);\n const normalized = normalizePath(resolved);\n\n // Create a 2-part ID: {absPath}::{astPath}\n // astPath uniquely identifies the definition's location in the AST (e.g., \"MyComponent.useQuery.def\")\n const idParts = [normalized, astPath];\n\n return idParts.join(canonicalIdSeparator) as CanonicalId;\n};\n\n/**\n * Check if a canonical ID uses a relative path.\n * Relative canonical IDs do not start with '/'.\n *\n * @param canonicalId - The canonical ID to check\n * @returns true if the canonical ID uses a relative path\n */\nexport const isRelativeCanonicalId = (canonicalId: CanonicalId | string): boolean => {\n return !canonicalId.startsWith(\"/\");\n};\n\n/**\n * Parse a canonical ID into its components.\n * @param canonicalId - The canonical ID to parse (e.g., \"/app/src/user.ts::userFragment\")\n * @returns An object with filePath and astPath\n */\nexport const parseCanonicalId = (\n canonicalId: CanonicalId | string,\n): {\n filePath: string;\n astPath: string;\n} => {\n const idx = canonicalId.indexOf(canonicalIdSeparator);\n if (idx === -1) {\n return { filePath: canonicalId, astPath: \"\" };\n }\n return {\n filePath: canonicalId.slice(0, idx),\n astPath: canonicalId.slice(idx + canonicalIdSeparator.length),\n };\n};\n\n/**\n * Validation result for canonical ID format.\n */\nexport type CanonicalIdValidationResult = { readonly isValid: true } | { readonly isValid: false; readonly reason: string };\n\n/**\n * Validate a canonical ID format.\n * A valid canonical ID has format: \"{filePath}::{astPath}\"\n * where both filePath and astPath are non-empty.\n *\n * @param canonicalId - The canonical ID to validate\n * @returns Validation result with isValid boolean and optional error reason\n */\nexport const validateCanonicalId = (canonicalId: string): CanonicalIdValidationResult => {\n const idx = canonicalId.indexOf(canonicalIdSeparator);\n\n if (idx === -1) {\n return { isValid: false, reason: \"missing '::' separator\" };\n }\n\n const filePath = canonicalId.slice(0, idx);\n const astPath = canonicalId.slice(idx + canonicalIdSeparator.length);\n\n if (filePath === \"\") {\n return { isValid: false, reason: \"empty file path\" };\n }\n\n if (astPath === \"\") {\n return { isValid: false, reason: \"empty AST path\" };\n }\n\n return { isValid: true };\n};\n","/**\n * Canonical path tracker for AST traversal.\n *\n * This module provides a stateful helper that tracks scope information during\n * AST traversal to generate canonical IDs. It's designed to integrate with\n * existing plugin visitor patterns (Babel, SWC, TypeScript) without requiring\n * a separate AST traversal.\n *\n * Usage pattern:\n * 1. Plugin creates tracker at file/program entry\n * 2. Plugin calls enterScope/exitScope during its traversal\n * 3. Plugin calls registerDefinition when discovering GQL definitions\n * 4. Tracker provides canonical ID information\n */\n\nimport type { CanonicalId } from \"./canonical-id\";\nimport { createCanonicalId } from \"./canonical-id\";\n\n/**\n * Scope frame for tracking AST path segments\n */\nexport type ScopeFrame = {\n /** Name segment (e.g., \"MyComponent\", \"useQuery\", \"arrow#1\") */\n readonly nameSegment: string;\n /** Kind of scope */\n readonly kind: \"function\" | \"class\" | \"variable\" | \"property\" | \"method\" | \"expression\";\n /** Occurrence index for disambiguation */\n readonly occurrence: number;\n};\n\n/**\n * Opaque handle for scope tracking\n */\nexport type ScopeHandle = {\n readonly __brand: \"ScopeHandle\";\n readonly depth: number;\n};\n\n/**\n * Canonical path tracker interface\n */\nexport interface CanonicalPathTracker {\n /**\n * Enter a new scope during traversal\n * @param options Scope information\n * @returns Handle to use when exiting the scope\n */\n enterScope(options: { segment: string; kind: ScopeFrame[\"kind\"]; stableKey?: string }): ScopeHandle;\n\n /**\n * Exit a scope during traversal\n * @param handle Handle returned from enterScope\n */\n exitScope(handle: ScopeHandle): void;\n\n /**\n * Register a definition discovered during traversal\n * @returns Definition metadata including astPath and canonical ID information\n */\n registerDefinition(): {\n astPath: string;\n isTopLevel: boolean;\n exportBinding?: string;\n };\n\n /**\n * Resolve a canonical ID from an astPath\n * @param astPath AST path string\n * @returns Canonical ID\n */\n resolveCanonicalId(astPath: string): CanonicalId;\n\n /**\n * Register an export binding\n * @param local Local variable name\n * @param exported Exported name\n */\n registerExportBinding(local: string, exported: string): void;\n\n /**\n * Get current scope depth\n * @returns Current depth (0 = top level)\n */\n currentDepth(): number;\n}\n\n/**\n * Build AST path from scope stack (internal helper)\n */\nconst _buildAstPath = (stack: readonly ScopeFrame[]): string => {\n return stack.map((frame) => frame.nameSegment).join(\".\");\n};\n\n/**\n * Create a canonical path tracker\n *\n * @param options Configuration options\n * @returns Tracker instance\n *\n * @example\n * ```typescript\n * // In a Babel plugin\n * const tracker = createCanonicalTracker({ filePath: state.filename });\n *\n * const visitor = {\n * FunctionDeclaration: {\n * enter(path) {\n * const handle = tracker.enterScope({\n * segment: path.node.id.name,\n * kind: 'function'\n * });\n * },\n * exit(path) {\n * tracker.exitScope(handle);\n * }\n * }\n * };\n * ```\n */\nexport const createCanonicalTracker = (options: {\n filePath: string;\n /**\n * Base directory for relative path computation in canonical IDs.\n * When provided, canonical IDs will use relative paths from baseDir.\n */\n baseDir?: string;\n getExportName?: (localName: string) => string | undefined;\n}): CanonicalPathTracker => {\n const { filePath, baseDir, getExportName } = options;\n\n // Scope stack\n const scopeStack: ScopeFrame[] = [];\n\n // Occurrence counters for disambiguating duplicate names\n const occurrenceCounters = new Map<string, number>();\n\n // Used paths for ensuring uniqueness\n const usedPaths = new Set<string>();\n\n // Export bindings map\n const exportBindings = new Map<string, string>();\n\n const getNextOccurrence = (key: string): number => {\n const current = occurrenceCounters.get(key) ?? 0;\n occurrenceCounters.set(key, current + 1);\n return current;\n };\n\n const ensureUniquePath = (basePath: string): string => {\n let path = basePath;\n let suffix = 0;\n while (usedPaths.has(path)) {\n suffix++;\n path = `${basePath}$${suffix}`;\n }\n usedPaths.add(path);\n return path;\n };\n\n return {\n enterScope({ segment, kind, stableKey }): ScopeHandle {\n const key = stableKey ?? `${kind}:${segment}`;\n const occurrence = getNextOccurrence(key);\n\n const frame: ScopeFrame = {\n nameSegment: segment,\n kind,\n occurrence,\n };\n\n scopeStack.push(frame);\n\n return {\n __brand: \"ScopeHandle\",\n depth: scopeStack.length - 1,\n } as ScopeHandle;\n },\n\n exitScope(handle: ScopeHandle): void {\n // Validate handle depth matches current stack\n if (handle.depth !== scopeStack.length - 1) {\n throw new Error(`[INTERNAL] Invalid scope exit: expected depth ${scopeStack.length - 1}, got ${handle.depth}`);\n }\n scopeStack.pop();\n },\n\n registerDefinition(): {\n astPath: string;\n isTopLevel: boolean;\n exportBinding?: string;\n } {\n const basePath = _buildAstPath(scopeStack);\n const astPath = ensureUniquePath(basePath);\n const isTopLevel = scopeStack.length === 0;\n\n // Check export binding if provided\n let exportBinding: string | undefined;\n if (getExportName && isTopLevel) {\n // For top-level definitions, try to get export name\n // This is a simplified version - real logic depends on how the definition is bound\n exportBinding = undefined;\n }\n\n return {\n astPath,\n isTopLevel,\n exportBinding,\n };\n },\n\n resolveCanonicalId(astPath: string): CanonicalId {\n return createCanonicalId(filePath, astPath, { baseDir });\n },\n\n registerExportBinding(local: string, exported: string): void {\n exportBindings.set(local, exported);\n },\n\n currentDepth(): number {\n return scopeStack.length;\n },\n };\n};\n\n/**\n * Helper to create occurrence tracker (for backward compatibility)\n */\nexport const createOccurrenceTracker = (): {\n getNextOccurrence: (key: string) => number;\n} => {\n const occurrenceCounters = new Map<string, number>();\n\n return {\n getNextOccurrence(key: string): number {\n const current = occurrenceCounters.get(key) ?? 0;\n occurrenceCounters.set(key, current + 1);\n return current;\n },\n };\n};\n\n/**\n * Helper to create path tracker (for backward compatibility)\n */\nexport const createPathTracker = (): {\n ensureUniquePath: (basePath: string) => string;\n} => {\n const usedPaths = new Set<string>();\n\n return {\n ensureUniquePath(basePath: string): string {\n let path = basePath;\n let suffix = 0;\n while (usedPaths.has(path)) {\n suffix++;\n path = `${basePath}$${suffix}`;\n }\n usedPaths.add(path);\n return path;\n },\n };\n};\n\n/**\n * Build AST path from scope stack (for backward compatibility)\n */\nexport const buildAstPath = (stack: readonly ScopeFrame[]): string => {\n return stack.map((frame) => frame.nameSegment).join(\".\");\n};\n"],"mappings":";;;;;AAMA,MAAM,uBAAuB;AAE7B,MAAaA,oBAA4CC,IAAE,QAAQ;;;;;;;;;AAsBnE,MAAa,qBAAqB,UAAkB,SAAiB,YAAoD;CACvH,MAAM,EAAE,YAAY,WAAW,EAAE;AAEjC,KAAI,SAAS;EAEX,MAAM,eAAe,WAAW,SAAS,GAAG,WAAW,QAAQ,SAAS,SAAS;EACjF,MAAMC,aAAW,QAAQ,aAAa;EACtC,MAAM,eAAe,SAAS,SAASA,WAAS;EAChD,MAAMC,eAAa,cAAc,aAAa;EAE9C,MAAMC,YAAU,CAACD,cAAY,QAAQ;AACrC,SAAOC,UAAQ,KAAK,qBAAqB;;AAI3C,KAAI,CAAC,WAAW,SAAS,EAAE;AACzB,QAAM,IAAI,MAAM,iDAAiD;;CAGnE,MAAM,WAAW,QAAQ,SAAS;CAClC,MAAM,aAAa,cAAc,SAAS;CAI1C,MAAM,UAAU,CAAC,YAAY,QAAQ;AAErC,QAAO,QAAQ,KAAK,qBAAqB;;;;;;;;;AAU3C,MAAa,yBAAyB,gBAA+C;AACnF,QAAO,CAAC,YAAY,WAAW,IAAI;;;;;;;AAQrC,MAAa,oBACX,gBAIG;CACH,MAAM,MAAM,YAAY,QAAQ,qBAAqB;AACrD,KAAI,QAAQ,CAAC,GAAG;AACd,SAAO;GAAE,UAAU;GAAa,SAAS;GAAI;;AAE/C,QAAO;EACL,UAAU,YAAY,MAAM,GAAG,IAAI;EACnC,SAAS,YAAY,MAAM,MAAM,qBAAqB,OAAO;EAC9D;;;;;;;;;;AAgBH,MAAa,uBAAuB,gBAAqD;CACvF,MAAM,MAAM,YAAY,QAAQ,qBAAqB;AAErD,KAAI,QAAQ,CAAC,GAAG;AACd,SAAO;GAAE,SAAS;GAAO,QAAQ;GAA0B;;CAG7D,MAAM,WAAW,YAAY,MAAM,GAAG,I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O,QAAQ;;AAEhH,cAAW,KAAK;;EAGlB,qBAIE;GACA,MAAM,WAAW,cAAc,WAAW;GAC1C,MAAM,UAAU,iBAAiB,SAAS;GAC1C,MAAM,aAAa,WAAW,WAAW;GAGzC,IAAIC;AACJ,OAAI,iBAAiB,YAAY;AAG/B,oBAAgB;;AAGlB,UAAO;IACL;IACA;IACA;IACD;;EAGH,mBAAmB,SAA8B;AAC/C,UAAO,kBAAkB,UAAU,SAAS,EAAE,SAAS,CAAC;;EAG1D,sBAAsB,OAAe,UAAwB;AAC3D,kBAAe,IAAI,OAAO,SAAS;;EAGrC,eAAuB;AACrB,UAAO,WAAW;;EAErB;;;;;AAMH,MAAa,gCAER;CACH,MAAM,qBAAqB,IAAI,KAAqB;AAEpD,QAAO,EACL,kBAAkB,KAAqB;EACrC,MAAM,UAAU,mBAAmB,IAAI,IAAI,IAAI;AAC/C,qBAAmB,IAAI,KAAK,UAAU,EAAE;AACxC,SAAO;IAEV;;;;;AAMH,MAAa,0BAER;CACH,MAAM,YAAY,IAAI,KAAa;AAEnC,QAAO,EACL,iBAAiB,UAA0B;EACzC,IAAI,OAAO;EACX,IAAI,SAAS;AACb,SAAO,UAAU,IAAI,KAAK,EAAE;AAC1B;AACA,UAAO,GAAG,SAAS,GAAG;;AAExB,YAAU,IAAI,KAAK;AACnB,SAAO;IAEV;;;;;AAMH,MAAa,gBAAgB,UAAyC;AACpE,QAAO,MAAM,KAAK,UAAU,MAAM,YAAY,CAAC,KAAK,IAAI"}
|
|
1
|
+
{"version":3,"file":"canonical-id-BNdkINTi.mjs","names":["CanonicalIdSchema: z.ZodType<CanonicalId>","z","resolved","normalized","idParts","scopeStack: ScopeFrame[]","frame: ScopeFrame","exportBinding: string | undefined"],"sources":["../src/canonical-id/canonical-id.ts","../src/canonical-id/path-tracker.ts"],"sourcesContent":["import { isAbsolute, relative, resolve } from \"node:path\";\nimport z from \"zod\";\nimport { normalizePath } from \"../utils\";\n\nexport type CanonicalId = string & { readonly __brand: \"CanonicalId\" };\n\nconst canonicalIdSeparator = \"::\" as const;\n\nexport const CanonicalIdSchema: z.ZodType<CanonicalId> = z.string() as unknown as z.ZodType<CanonicalId>;\n\n/**\n * Options for creating a canonical ID.\n */\nexport type CreateCanonicalIdOptions = {\n /**\n * Base directory for relative path computation.\n * When provided, the canonical ID will use a relative path from baseDir.\n * When undefined, an absolute path is required and used as-is.\n */\n readonly baseDir?: string;\n};\n\n/**\n * Create a canonical ID from a file path and AST path.\n *\n * @param filePath - The file path (absolute, or relative if baseDir is provided)\n * @param astPath - The AST path identifying the definition within the file\n * @param options - Optional configuration including baseDir for relative path support\n * @returns A canonical ID in the format \"{path}::{astPath}\"\n */\nexport const createCanonicalId = (filePath: string, astPath: string, options?: CreateCanonicalIdOptions): CanonicalId => {\n const { baseDir } = options ?? {};\n\n if (baseDir) {\n // With baseDir, compute relative path\n const absolutePath = isAbsolute(filePath) ? filePath : resolve(baseDir, filePath);\n const resolved = resolve(absolutePath);\n const relativePath = relative(baseDir, resolved);\n const normalized = normalizePath(relativePath);\n\n const idParts = [normalized, astPath];\n return idParts.join(canonicalIdSeparator) as CanonicalId;\n }\n\n // Without baseDir, require absolute path (legacy behavior)\n if (!isAbsolute(filePath)) {\n throw new Error(\"[INTERNAL] CANONICAL_ID_REQUIRES_ABSOLUTE_PATH\");\n }\n\n const resolved = resolve(filePath);\n const normalized = normalizePath(resolved);\n\n // Create a 2-part ID: {absPath}::{astPath}\n // astPath uniquely identifies the definition's location in the AST (e.g., \"MyComponent.useQuery.def\")\n const idParts = [normalized, astPath];\n\n return idParts.join(canonicalIdSeparator) as CanonicalId;\n};\n\n/**\n * Check if a canonical ID uses a relative path.\n * Relative canonical IDs do not start with '/'.\n *\n * @param canonicalId - The canonical ID to check\n * @returns true if the canonical ID uses a relative path\n */\nexport const isRelativeCanonicalId = (canonicalId: CanonicalId | string): boolean => {\n return !canonicalId.startsWith(\"/\");\n};\n\n/**\n * Parse a canonical ID into its components.\n * @param canonicalId - The canonical ID to parse (e.g., \"/app/src/user.ts::userFragment\")\n * @returns An object with filePath and astPath\n */\nexport const parseCanonicalId = (\n canonicalId: CanonicalId | string,\n): {\n filePath: string;\n astPath: string;\n} => {\n const idx = canonicalId.indexOf(canonicalIdSeparator);\n if (idx === -1) {\n return { filePath: canonicalId, astPath: \"\" };\n }\n return {\n filePath: canonicalId.slice(0, idx),\n astPath: canonicalId.slice(idx + canonicalIdSeparator.length),\n };\n};\n\n/**\n * Validation result for canonical ID format.\n */\nexport type CanonicalIdValidationResult = { readonly isValid: true } | { readonly isValid: false; readonly reason: string };\n\n/**\n * Validate a canonical ID format.\n * A valid canonical ID has format: \"{filePath}::{astPath}\"\n * where both filePath and astPath are non-empty.\n *\n * @param canonicalId - The canonical ID to validate\n * @returns Validation result with isValid boolean and optional error reason\n */\nexport const validateCanonicalId = (canonicalId: string): CanonicalIdValidationResult => {\n const idx = canonicalId.indexOf(canonicalIdSeparator);\n\n if (idx === -1) {\n return { isValid: false, reason: \"missing '::' separator\" };\n }\n\n const filePath = canonicalId.slice(0, idx);\n const astPath = canonicalId.slice(idx + canonicalIdSeparator.length);\n\n if (filePath === \"\") {\n return { isValid: false, reason: \"empty file path\" };\n }\n\n if (astPath === \"\") {\n return { isValid: false, reason: \"empty AST path\" };\n }\n\n return { isValid: true };\n};\n","/**\n * Canonical path tracker for AST traversal.\n *\n * This module provides a stateful helper that tracks scope information during\n * AST traversal to generate canonical IDs. It's designed to integrate with\n * existing plugin visitor patterns (Babel, SWC, TypeScript) without requiring\n * a separate AST traversal.\n *\n * Usage pattern:\n * 1. Plugin creates tracker at file/program entry\n * 2. Plugin calls enterScope/exitScope during its traversal\n * 3. Plugin calls registerDefinition when discovering GQL definitions\n * 4. Tracker provides canonical ID information\n */\n\nimport type { CanonicalId } from \"./canonical-id\";\nimport { createCanonicalId } from \"./canonical-id\";\n\n/**\n * Scope frame for tracking AST path segments\n */\nexport type ScopeFrame = {\n /** Name segment (e.g., \"MyComponent\", \"useQuery\", \"arrow#1\") */\n readonly nameSegment: string;\n /** Kind of scope */\n readonly kind: \"function\" | \"class\" | \"variable\" | \"property\" | \"method\" | \"expression\";\n /** Occurrence index for disambiguation */\n readonly occurrence: number;\n};\n\n/**\n * Opaque handle for scope tracking\n */\nexport type ScopeHandle = {\n readonly __brand: \"ScopeHandle\";\n readonly depth: number;\n};\n\n/**\n * Canonical path tracker interface\n */\nexport interface CanonicalPathTracker {\n /**\n * Enter a new scope during traversal\n * @param options Scope information\n * @returns Handle to use when exiting the scope\n */\n enterScope(options: { segment: string; kind: ScopeFrame[\"kind\"]; stableKey?: string }): ScopeHandle;\n\n /**\n * Exit a scope during traversal\n * @param handle Handle returned from enterScope\n */\n exitScope(handle: ScopeHandle): void;\n\n /**\n * Register a definition discovered during traversal\n * @returns Definition metadata including astPath and canonical ID information\n */\n registerDefinition(): {\n astPath: string;\n isTopLevel: boolean;\n exportBinding?: string;\n };\n\n /**\n * Resolve a canonical ID from an astPath\n * @param astPath AST path string\n * @returns Canonical ID\n */\n resolveCanonicalId(astPath: string): CanonicalId;\n\n /**\n * Register an export binding\n * @param local Local variable name\n * @param exported Exported name\n */\n registerExportBinding(local: string, exported: string): void;\n\n /**\n * Get current scope depth\n * @returns Current depth (0 = top level)\n */\n currentDepth(): number;\n}\n\n/**\n * Build AST path from scope stack (internal helper)\n */\nconst _buildAstPath = (stack: readonly ScopeFrame[]): string => {\n return stack.map((frame) => frame.nameSegment).join(\".\");\n};\n\n/**\n * Create a canonical path tracker\n *\n * @param options Configuration options\n * @returns Tracker instance\n *\n * @example\n * ```typescript\n * // In a Babel plugin\n * const tracker = createCanonicalTracker({ filePath: state.filename });\n *\n * const visitor = {\n * FunctionDeclaration: {\n * enter(path) {\n * const handle = tracker.enterScope({\n * segment: path.node.id.name,\n * kind: 'function'\n * });\n * },\n * exit(path) {\n * tracker.exitScope(handle);\n * }\n * }\n * };\n * ```\n */\nexport const createCanonicalTracker = (options: {\n filePath: string;\n /**\n * Base directory for relative path computation in canonical IDs.\n * When provided, canonical IDs will use relative paths from baseDir.\n */\n baseDir?: string;\n getExportName?: (localName: string) => string | undefined;\n}): CanonicalPathTracker => {\n const { filePath, baseDir, getExportName } = options;\n\n // Scope stack\n const scopeStack: ScopeFrame[] = [];\n\n // Occurrence counters for disambiguating duplicate names\n const occurrenceCounters = new Map<string, number>();\n\n // Used paths for ensuring uniqueness\n const usedPaths = new Set<string>();\n\n // Export bindings map\n const exportBindings = new Map<string, string>();\n\n const getNextOccurrence = (key: string): number => {\n const current = occurrenceCounters.get(key) ?? 0;\n occurrenceCounters.set(key, current + 1);\n return current;\n };\n\n const ensureUniquePath = (basePath: string): string => {\n let path = basePath;\n let suffix = 0;\n while (usedPaths.has(path)) {\n suffix++;\n path = `${basePath}$${suffix}`;\n }\n usedPaths.add(path);\n return path;\n };\n\n return {\n enterScope({ segment, kind, stableKey }): ScopeHandle {\n const key = stableKey ?? `${kind}:${segment}`;\n const occurrence = getNextOccurrence(key);\n\n const frame: ScopeFrame = {\n nameSegment: segment,\n kind,\n occurrence,\n };\n\n scopeStack.push(frame);\n\n return {\n __brand: \"ScopeHandle\",\n depth: scopeStack.length - 1,\n } as ScopeHandle;\n },\n\n exitScope(handle: ScopeHandle): void {\n // Validate handle depth matches current stack\n if (handle.depth !== scopeStack.length - 1) {\n throw new Error(`[INTERNAL] Invalid scope exit: expected depth ${scopeStack.length - 1}, got ${handle.depth}`);\n }\n scopeStack.pop();\n },\n\n registerDefinition(): {\n astPath: string;\n isTopLevel: boolean;\n exportBinding?: string;\n } {\n const basePath = _buildAstPath(scopeStack);\n const astPath = ensureUniquePath(basePath);\n const isTopLevel = scopeStack.length === 0;\n\n // Check export binding if provided\n let exportBinding: string | undefined;\n if (getExportName && isTopLevel) {\n // For top-level definitions, try to get export name\n // This is a simplified version - real logic depends on how the definition is bound\n exportBinding = undefined;\n }\n\n return {\n astPath,\n isTopLevel,\n exportBinding,\n };\n },\n\n resolveCanonicalId(astPath: string): CanonicalId {\n return createCanonicalId(filePath, astPath, { baseDir });\n },\n\n registerExportBinding(local: string, exported: string): void {\n exportBindings.set(local, exported);\n },\n\n currentDepth(): number {\n return scopeStack.length;\n },\n };\n};\n\n/**\n * Helper to create occurrence tracker (for backward compatibility)\n */\nexport const createOccurrenceTracker = (): {\n getNextOccurrence: (key: string) => number;\n} => {\n const occurrenceCounters = new Map<string, number>();\n\n return {\n getNextOccurrence(key: string): number {\n const current = occurrenceCounters.get(key) ?? 0;\n occurrenceCounters.set(key, current + 1);\n return current;\n },\n };\n};\n\n/**\n * Helper to create path tracker (for backward compatibility)\n */\nexport const createPathTracker = (): {\n ensureUniquePath: (basePath: string) => string;\n} => {\n const usedPaths = new Set<string>();\n\n return {\n ensureUniquePath(basePath: string): string {\n let path = basePath;\n let suffix = 0;\n while (usedPaths.has(path)) {\n suffix++;\n path = `${basePath}$${suffix}`;\n }\n usedPaths.add(path);\n return path;\n },\n };\n};\n\n/**\n * Build AST path from scope stack (for backward compatibility)\n */\nexport const buildAstPath = (stack: readonly ScopeFrame[]): string => {\n return stack.map((frame) => frame.nameSegment).join(\".\");\n};\n"],"mappings":";;;;;AAMA,MAAM,uBAAuB;AAE7B,MAAaA,oBAA4CC,IAAE,QAAQ;;;;;;;;;AAsBnE,MAAa,qBAAqB,UAAkB,SAAiB,YAAoD;CACvH,MAAM,EAAE,YAAY,WAAW,EAAE;AAEjC,KAAI,SAAS;EAEX,MAAM,eAAe,WAAW,SAAS,GAAG,WAAW,QAAQ,SAAS,SAAS;EACjF,MAAMC,aAAW,QAAQ,aAAa;EACtC,MAAM,eAAe,SAAS,SAASA,WAAS;EAChD,MAAMC,eAAa,cAAc,aAAa;EAE9C,MAAMC,YAAU,CAACD,cAAY,QAAQ;AACrC,SAAOC,UAAQ,KAAK,qBAAqB;;AAI3C,KAAI,CAAC,WAAW,SAAS,EAAE;AACzB,QAAM,IAAI,MAAM,iDAAiD;;CAGnE,MAAM,WAAW,QAAQ,SAAS;CAClC,MAAM,aAAa,cAAc,SAAS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I,KAAa;AAEnC,QAAO,EACL,iBAAiB,UAA0B;EACzC,IAAI,OAAO;EACX,IAAI,SAAS;AACb,SAAO,UAAU,IAAI,KAAK,EAAE;AAC1B;AACA,UAAO,GAAG,SAAS,GAAG;;AAExB,YAAU,IAAI,KAAK;AACnB,SAAO;IAEV;;;;;AAMH,MAAa,gBAAgB,UAAyC;AACpE,QAAO,MAAM,KAAK,UAAU,MAAM,YAAY,CAAC,KAAK,IAAI"}
|
package/dist/canonical-id.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createCanonicalTracker, c as CanonicalId, d as CreateCanonicalIdOptions, f as createCanonicalId, h as validateCanonicalId, i as buildAstPath, l as CanonicalIdSchema, m as parseCanonicalId, n as ScopeFrame, o as createOccurrenceTracker, p as isRelativeCanonicalId, r as ScopeHandle, s as createPathTracker, t as CanonicalPathTracker, u as CanonicalIdValidationResult } from "./index-
|
|
1
|
+
import { a as createCanonicalTracker, c as CanonicalId, d as CreateCanonicalIdOptions, f as createCanonicalId, h as validateCanonicalId, i as buildAstPath, l as CanonicalIdSchema, m as parseCanonicalId, n as ScopeFrame, o as createOccurrenceTracker, p as isRelativeCanonicalId, r as ScopeHandle, s as createPathTracker, t as CanonicalPathTracker, u as CanonicalIdValidationResult } from "./index-UauBErGY.cjs";
|
|
2
2
|
export { CanonicalId, CanonicalIdSchema, CanonicalIdValidationResult, CanonicalPathTracker, CreateCanonicalIdOptions, ScopeFrame, ScopeHandle, buildAstPath, createCanonicalId, createCanonicalTracker, createOccurrenceTracker, createPathTracker, isRelativeCanonicalId, parseCanonicalId, validateCanonicalId };
|
package/dist/canonical-id.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createCanonicalTracker, c as CanonicalId, d as CreateCanonicalIdOptions, f as createCanonicalId, h as validateCanonicalId, i as buildAstPath, l as CanonicalIdSchema, m as parseCanonicalId, n as ScopeFrame, o as createOccurrenceTracker, p as isRelativeCanonicalId, r as ScopeHandle, s as createPathTracker, t as CanonicalPathTracker, u as CanonicalIdValidationResult } from "./index-
|
|
1
|
+
import { a as createCanonicalTracker, c as CanonicalId, d as CreateCanonicalIdOptions, f as createCanonicalId, h as validateCanonicalId, i as buildAstPath, l as CanonicalIdSchema, m as parseCanonicalId, n as ScopeFrame, o as createOccurrenceTracker, p as isRelativeCanonicalId, r as ScopeHandle, s as createPathTracker, t as CanonicalPathTracker, u as CanonicalIdValidationResult } from "./index-KB_f9ZJF.mjs";
|
|
2
2
|
export { CanonicalId, CanonicalIdSchema, CanonicalIdValidationResult, CanonicalPathTracker, CreateCanonicalIdOptions, ScopeFrame, ScopeHandle, buildAstPath, createCanonicalId, createCanonicalTracker, createOccurrenceTracker, createPathTracker, isRelativeCanonicalId, parseCanonicalId, validateCanonicalId };
|
package/dist/canonical-id.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./utils-
|
|
2
|
-
import { a as CanonicalIdSchema, c as parseCanonicalId, i as createPathTracker, l as validateCanonicalId, n as createCanonicalTracker, o as createCanonicalId, r as createOccurrenceTracker, s as isRelativeCanonicalId, t as buildAstPath } from "./canonical-id-
|
|
1
|
+
import "./utils-DOz9GTVx.mjs";
|
|
2
|
+
import { a as CanonicalIdSchema, c as parseCanonicalId, i as createPathTracker, l as validateCanonicalId, n as createCanonicalTracker, o as createCanonicalId, r as createOccurrenceTracker, s as isRelativeCanonicalId, t as buildAstPath } from "./canonical-id-BNdkINTi.mjs";
|
|
3
3
|
|
|
4
4
|
export { CanonicalIdSchema, buildAstPath, createCanonicalId, createCanonicalTracker, createOccurrenceTracker, createPathTracker, isRelativeCanonicalId, parseCanonicalId, validateCanonicalId };
|
|
@@ -78,4 +78,4 @@ declare const runtime: {
|
|
|
78
78
|
declare function resetPortableForTests(): void;
|
|
79
79
|
//#endregion
|
|
80
80
|
export { __resetPortableHasherForTests as a, PortableFS as c, getPortableFS as d, PortableHasher as i, __resetPortableFSForTests as l, runtime as n, createPortableHasher as o, HashAlgorithm as r, getPortableHasher as s, resetPortableForTests as t, createPortableFS as u };
|
|
81
|
-
//# sourceMappingURL=index-
|
|
81
|
+
//# sourceMappingURL=index-B7A6qmX_.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-B7A6qmX_.d.mts","names":[],"sources":["../src/portable/fs.ts","../src/portable/hash.ts","../src/portable/runtime.ts"],"sourcesContent":[],"mappings":";;AAIA;;AAE4C,UAF3B,UAAA,CAE2B;EAKM,QAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EANxB,OAMwB,CAAA,MAAA,CAAA;EAC1B,SAAA,CAAA,IAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EANoB,OAMpB,CAAA,IAAA,CAAA;EACe;;;;EAWf,eAAA,CAAA,IAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAb0B,OAa1B,CAAA,IAAA,CAAA;EAAO,MAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAZP,OAYO,CAAA,OAAA,CAAA;EAuEf,IAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAlFM,OAkFU,CAAA;IAwHhB,KAAA,EA1MuB,IA0MvB;IAWA,IAAA,EAAA,MAAA;;4CApN4B;6BCN3B;IAFL,SAAA,CAAA,EAAa,OAAA;EAER,CAAA,CAAA,EDOyC,OCPzC,CAAA,IAAA,CAAc;EAIf;AAgBhB;AAWA;;;;AClCA;AAUA;wBFSwB;;;;;;;;;;iBAuER,gBAAA,CAAA,GAAoB;iBAwHpB,aAAA,CAAA,GAAiB;;;;;iBAWjB,yBAAA,CAAA;;;;AA9NhB;;AAE4C,KCAhC,aAAA,GDAgC,QAAA,GAAA,QAAA;AAKM,UCHjC,cAAA,CDGiC;EAC1B,IAAA,CAAA,OAAA,EAAA,MAAA,EAAA,SAAA,CAAA,ECHY,aDGZ,CAAA,EAAA,MAAA;;AACF,iBCDN,oBAAA,CAAA,CDCM,ECDkB,cDClB;AACsB,iBCc5B,iBAAA,CAAA,CDd4B,ECcP,cDdO;;;;AAiF5C;AAwHgB,iBChLA,6BAAA,CAAA,CDgL2B,EAAA,IAAA;;;;AAnN3C;;;AAOkD,cENrC,OFMqC,EAAA;EAC1B,SAAA,KAAA,EAAA,KAAA;EACe,SAAA,MAAA,EAAA,OAAA;EAAjB,SAAA,iBAAA,EAAA,OAAA;CACsB;;;;AAiF5C;AAwHgB,iBExMA,qBAAA,CAAA,CFwM2B,EAAA,IAAA"}
|
|
@@ -78,4 +78,4 @@ declare const runtime: {
|
|
|
78
78
|
declare function resetPortableForTests(): void;
|
|
79
79
|
//#endregion
|
|
80
80
|
export { __resetPortableHasherForTests as a, PortableFS as c, getPortableFS as d, PortableHasher as i, __resetPortableFSForTests as l, runtime as n, createPortableHasher as o, HashAlgorithm as r, getPortableHasher as s, resetPortableForTests as t, createPortableFS as u };
|
|
81
|
-
//# sourceMappingURL=index-
|
|
81
|
+
//# sourceMappingURL=index-B9cqW0Kp.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-B9cqW0Kp.d.cts","names":[],"sources":["../src/portable/fs.ts","../src/portable/hash.ts","../src/portable/runtime.ts"],"sourcesContent":[],"mappings":";;AAIA;;AAE4C,UAF3B,UAAA,CAE2B;EAKM,QAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EANxB,OAMwB,CAAA,MAAA,CAAA;EAC1B,SAAA,CAAA,IAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EANoB,OAMpB,CAAA,IAAA,CAAA;EACe;;;;EAWf,eAAA,CAAA,IAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAb0B,OAa1B,CAAA,IAAA,CAAA;EAAO,MAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAZP,OAYO,CAAA,OAAA,CAAA;EAuEf,IAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAlFM,OAkFU,CAAA;IAwHhB,KAAA,EA1MuB,IA0MvB;IAWA,IAAA,EAAA,MAAA;;4CApN4B;6BCN3B;IAFL,SAAA,CAAA,EAAa,OAAA;EAER,CAAA,CAAA,EDOyC,OCPzC,CAAA,IAAA,CAAc;EAIf;AAgBhB;AAWA;;;;AClCA;AAUA;wBFSwB;;;;;;;;;;iBAuER,gBAAA,CAAA,GAAoB;iBAwHpB,aAAA,CAAA,GAAiB;;;;;iBAWjB,yBAAA,CAAA;;;;AA9NhB;;AAE4C,KCAhC,aAAA,GDAgC,QAAA,GAAA,QAAA;AAKM,UCHjC,cAAA,CDGiC;EAC1B,IAAA,CAAA,OAAA,EAAA,MAAA,EAAA,SAAA,CAAA,ECHY,aDGZ,CAAA,EAAA,MAAA;;AACF,iBCDN,oBAAA,CAAA,CDCM,ECDkB,cDClB;AACsB,iBCc5B,iBAAA,CAAA,CDd4B,ECcP,cDdO;;;;AAiF5C;AAwHgB,iBChLA,6BAAA,CAAA,CDgL2B,EAAA,IAAA;;;;AAnN3C;;;AAOkD,cENrC,OFMqC,EAAA;EAC1B,SAAA,KAAA,EAAA,KAAA;EACe,SAAA,MAAA,EAAA,OAAA;EAAjB,SAAA,iBAAA,EAAA,OAAA;CACsB;;;;AAiF5C;AAwHgB,iBExMA,qBAAA,CAAA,CFwM2B,EAAA,IAAA"}
|
|
@@ -135,28 +135,5 @@ declare const isRelativeSpecifier: (specifier: string) => boolean;
|
|
|
135
135
|
*/
|
|
136
136
|
declare const isExternalSpecifier: (specifier: string) => boolean;
|
|
137
137
|
//#endregion
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
* SWC span position converter: UTF-8 byte offsets → UTF-16 code unit indices.
|
|
141
|
-
*
|
|
142
|
-
* SWC (Rust-based) returns span positions as UTF-8 byte offsets.
|
|
143
|
-
* JavaScript strings use UTF-16 code units for indexing.
|
|
144
|
-
* For ASCII-only content these are identical, but for multi-byte
|
|
145
|
-
* characters the positions diverge.
|
|
146
|
-
*/
|
|
147
|
-
type SwcSpanConverter = {
|
|
148
|
-
/** UTF-8 byte length of the source string */
|
|
149
|
-
readonly byteLength: number;
|
|
150
|
-
/** Convert a UTF-8 byte offset (within the source) to a UTF-16 code unit index */
|
|
151
|
-
readonly byteOffsetToCharIndex: (byteOffset: number) => number;
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* Create a converter that maps UTF-8 byte offsets to UTF-16 char indices
|
|
155
|
-
* for the given source string.
|
|
156
|
-
*
|
|
157
|
-
* Includes a fast path for ASCII-only sources (zero allocation).
|
|
158
|
-
*/
|
|
159
|
-
declare const createSwcSpanConverter: (source: string) => SwcSpanConverter;
|
|
160
|
-
//#endregion
|
|
161
|
-
export { isExternalSpecifier as a, parseJsExtension as c, cachedFn as d, AliasResolver as f, readTsconfigPaths as g, TsconfigReadError as h, MODULE_EXTENSION_CANDIDATES as i, resolveRelativeImportWithExistenceCheck as l, TsconfigPathsConfig as m, createSwcSpanConverter as n, isRelativeSpecifier as o, createAliasResolver as p, JsExtensionInfo as r, normalizePath as s, SwcSpanConverter as t, resolveRelativeImportWithReferences as u };
|
|
162
|
-
//# sourceMappingURL=index-B1w5x8e3.d.mts.map
|
|
138
|
+
export { normalizePath as a, resolveRelativeImportWithReferences as c, createAliasResolver as d, TsconfigPathsConfig as f, isRelativeSpecifier as i, cachedFn as l, readTsconfigPaths as m, MODULE_EXTENSION_CANDIDATES as n, parseJsExtension as o, TsconfigReadError as p, isExternalSpecifier as r, resolveRelativeImportWithExistenceCheck as s, JsExtensionInfo as t, AliasResolver as u };
|
|
139
|
+
//# sourceMappingURL=index-BIgjHIdk.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BIgjHIdk.d.mts","names":[],"sources":["../src/utils/tsconfig.ts","../src/utils/alias-resolver.ts","../src/utils/cached-fn.ts","../src/utils/path.ts"],"sourcesContent":[],"mappings":";;;;;;AAQA;AAUA;AA4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shape: TShape & { [K in Exclude<keyof TShape, keyof TOutput>]: never }) => z.ZodObject<TShape & { [K in Exclude<keyof TShape, keyof TOutput>]: never } extends infer T ? { -readonly [P in keyof T]: T[P] } : never, z.core.$strict>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ShapeFor as n, defineSchemaFor as r, SchemaFor as t };
|
|
9
|
-
//# sourceMappingURL=index-
|
|
9
|
+
//# sourceMappingURL=index-DO6j6Cif.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-DO6j6Cif.d.cts","names":[],"sources":["../src/zod/schema-helper.ts"],"sourcesContent":[],"mappings":";;;KAGY,qBAAqB,CAAA,CAAE,QAAQ;KAE/B,2CAFA,MAEiD,OAFxC,KAEoD,SAF9B,CAEwC,OAFlD,CAE0D,CAFxD,CAAA,CAAA,EAEnC;AAA6D,iBAE7C,eAF6C,CAAA,gBAAA,MAAA,CAAA,CAAA,CAAA,EAAA,CAAA,eAGpC,QAHoC,CAG3B,OAH2B,CAGnB,OAHmB,CAAA,CAAA,CAAA,CAAA,KAAA,EAGD,MAHC,GAAA,QAGgB,OAHhB,CAAA,MAG8B,MAH9B,EAAA,MAG4C,OAH5C,CAAA,GAAA,KAAA,EAAA,EAAA,GAG8D,CAAA,CAAA,SAH9D,CAG8D,MAH9D,GAAA,QAGY,OAHZ,CAAA,MAGY,MAHZ,EAAA,MAGY,OAHZ,CAAA,GAAA,KAAA,EAAA,SAAA,KAAA,EAAA,GAAA,kBAAA,MAGY,CAHZ,GAGY,CAHZ,CAGY,CAHZ,CAAA,EAAA,GAAA,KAAA,EAGY,CAAA,CAAA,IAAA,CAAA,OAHZ,CAAA"}
|
|
@@ -6,4 +6,4 @@ type ShapeFor<TOutput extends object> = { [K in keyof TOutput]-?: SchemaFor<TOut
|
|
|
6
6
|
declare function defineSchemaFor<TOutput extends object>(): <TShape extends ShapeFor<NoInfer<TOutput>>>(shape: TShape & { [K in Exclude<keyof TShape, keyof TOutput>]: never }) => z.ZodObject<TShape & { [K in Exclude<keyof TShape, keyof TOutput>]: never } extends infer T ? { -readonly [P in keyof T]: T[P] } : never, z.core.$strict>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ShapeFor as n, defineSchemaFor as r, SchemaFor as t };
|
|
9
|
-
//# sourceMappingURL=index-
|
|
9
|
+
//# sourceMappingURL=index-DeJfMmkU.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-DeJfMmkU.d.mts","names":[],"sources":["../src/zod/schema-helper.ts"],"sourcesContent":[],"mappings":";;;KAGY,qBAAqB,CAAA,CAAE,QAAQ;KAE/B,2CAFA,MAEiD,OAFxC,KAEoD,SAF9B,CAEwC,OAFlD,CAE0D,CAFxD,CAAA,CAAA,EAEnC;AAA6D,iBAE7C,eAF6C,CAAA,gBAAA,MAAA,CAAA,CAAA,CAAA,EAAA,CAAA,eAGpC,QAHoC,CAG3B,OAH2B,CAGnB,OAHmB,CAAA,CAAA,CAAA,CAAA,KAAA,EAGD,MAHC,GAAA,QAGgB,OAHhB,CAAA,MAG8B,MAH9B,EAAA,MAG4C,OAH5C,CAAA,GAAA,KAAA,EAAA,EAAA,GAG8D,CAAA,CAAA,SAH9D,CAG8D,MAH9D,GAAA,QAGY,OAHZ,CAAA,MAGY,MAHZ,EAAA,MAGY,OAHZ,CAAA,GAAA,KAAA,EAAA,SAAA,KAAA,EAAA,GAAA,kBAAA,MAGY,CAHZ,GAGY,CAHZ,CAGY,CAHZ,CAAA,EAAA,GAAA,KAAA,EAGY,CAAA,CAAA,IAAA,CAAA,OAHZ,CAAA"}
|
|
@@ -135,28 +135,5 @@ declare const isRelativeSpecifier: (specifier: string) => boolean;
|
|
|
135
135
|
*/
|
|
136
136
|
declare const isExternalSpecifier: (specifier: string) => boolean;
|
|
137
137
|
//#endregion
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
* SWC span position converter: UTF-8 byte offsets → UTF-16 code unit indices.
|
|
141
|
-
*
|
|
142
|
-
* SWC (Rust-based) returns span positions as UTF-8 byte offsets.
|
|
143
|
-
* JavaScript strings use UTF-16 code units for indexing.
|
|
144
|
-
* For ASCII-only content these are identical, but for multi-byte
|
|
145
|
-
* characters the positions diverge.
|
|
146
|
-
*/
|
|
147
|
-
type SwcSpanConverter = {
|
|
148
|
-
/** UTF-8 byte length of the source string */
|
|
149
|
-
readonly byteLength: number;
|
|
150
|
-
/** Convert a UTF-8 byte offset (within the source) to a UTF-16 code unit index */
|
|
151
|
-
readonly byteOffsetToCharIndex: (byteOffset: number) => number;
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* Create a converter that maps UTF-8 byte offsets to UTF-16 char indices
|
|
155
|
-
* for the given source string.
|
|
156
|
-
*
|
|
157
|
-
* Includes a fast path for ASCII-only sources (zero allocation).
|
|
158
|
-
*/
|
|
159
|
-
declare const createSwcSpanConverter: (source: string) => SwcSpanConverter;
|
|
160
|
-
//#endregion
|
|
161
|
-
export { isExternalSpecifier as a, parseJsExtension as c, cachedFn as d, AliasResolver as f, readTsconfigPaths as g, TsconfigReadError as h, MODULE_EXTENSION_CANDIDATES as i, resolveRelativeImportWithExistenceCheck as l, TsconfigPathsConfig as m, createSwcSpanConverter as n, isRelativeSpecifier as o, createAliasResolver as p, JsExtensionInfo as r, normalizePath as s, SwcSpanConverter as t, resolveRelativeImportWithReferences as u };
|
|
162
|
-
//# sourceMappingURL=index-BDPAGTeS.d.cts.map
|
|
138
|
+
export { normalizePath as a, resolveRelativeImportWithReferences as c, createAliasResolver as d, TsconfigPathsConfig as f, isRelativeSpecifier as i, cachedFn as l, readTsconfigPaths as m, MODULE_EXTENSION_CANDIDATES as n, parseJsExtension as o, TsconfigReadError as p, isExternalSpecifier as r, resolveRelativeImportWithExistenceCheck as s, JsExtensionInfo as t, AliasResolver as u };
|
|
139
|
+
//# sourceMappingURL=index-DpSxWrZ_.d.cts.map
|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OC,YAAY,KAAK;;;;;cAqDlB;;;;cAKA"}
|
|
@@ -180,4 +180,4 @@ declare const createPathTracker: () => {
|
|
|
180
180
|
declare const buildAstPath: (stack: readonly ScopeFrame[]) => string;
|
|
181
181
|
//#endregion
|
|
182
182
|
export { createCanonicalTracker as a, CanonicalId as c, CreateCanonicalIdOptions as d, createCanonicalId as f, validateCanonicalId as h, buildAstPath as i, CanonicalIdSchema as l, parseCanonicalId as m, ScopeFrame as n, createOccurrenceTracker as o, isRelativeCanonicalId as p, ScopeHandle as r, createPathTracker as s, CanonicalPathTracker as t, CanonicalIdValidationResult as u };
|
|
183
|
-
//# sourceMappingURL=index-
|
|
183
|
+
//# sourceMappingURL=index-KB_f9ZJF.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-KB_f9ZJF.d.mts","names":[],"sources":["../src/canonical-id/canonical-id.ts","../src/canonical-id/path-tracker.ts"],"sourcesContent":[],"mappings":";;;KAIY,WAAA;;AAAZ,CAAA;AAIa,cAAA,iBAA6B,EAAV,GAAA,CAAE,OAAF,CAAU,WAAD,CAAA;AAKzC;AAiBA;AAoCA;AASa,KA9DD,wBAAA,GA+DG;EAkBH;AAUZ;;;;ECnFY,SAAA,OAAU,CAAA,EAAA,MAAA;AAYtB,CAAA;AAQA;;;;;;AA8EA;AA4GA;AAiBa,cDtNA,iBCuOZ,EAAA,CAAA,QAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EDvO8E,wBCuO9E,EAAA,GDvOyG,WCuOzG;AAKD;;;;;;;cDxMa,qCAAsC;;;;;;cAStC,gCACE;;;;;;;KAkBH,2BAAA;;;;;;;;;;;;;;cAUC,8CAA6C;;;;ACvE1D;AAQA;;AAM0F,KA1B9E,UAAA,GA0B8E;EAMtE;EAiBmB,SAAA,WAAA,EAAA,MAAA;EAAW;EAiDrC,SAAA,IAAA,EAAA,UAuGZ,GAAA,OAAA,GA/FG,UAAA,GAAA,UA+FH,GAAA,QAAA,GAAA,YAAA;EAKY;EAiBA,SAAA,UAAA,EAiBZ,MAAA;AAKD,CAAA;;;;KAzOY,WAAA;;;;;;;UAQK,oBAAA;;;;;;;;UAM8B;;MAA2C;;;;;oBAMtE;;;;;;;;;;;;;;;uCAiBmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiD1B;;;;;;;;MAQT;;;;cAoGS;;;;;;cAiBA;;;;;;cAsBA,+BAAgC"}
|
|
@@ -180,4 +180,4 @@ declare const createPathTracker: () => {
|
|
|
180
180
|
declare const buildAstPath: (stack: readonly ScopeFrame[]) => string;
|
|
181
181
|
//#endregion
|
|
182
182
|
export { createCanonicalTracker as a, CanonicalId as c, CreateCanonicalIdOptions as d, createCanonicalId as f, validateCanonicalId as h, buildAstPath as i, CanonicalIdSchema as l, parseCanonicalId as m, ScopeFrame as n, createOccurrenceTracker as o, isRelativeCanonicalId as p, ScopeHandle as r, createPathTracker as s, CanonicalPathTracker as t, CanonicalIdValidationResult as u };
|
|
183
|
-
//# sourceMappingURL=index-
|
|
183
|
+
//# sourceMappingURL=index-UauBErGY.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-UauBErGY.d.cts","names":[],"sources":["../src/canonical-id/canonical-id.ts","../src/canonical-id/path-tracker.ts"],"sourcesContent":[],"mappings":";;;KAIY,WAAA;;AAAZ,CAAA;AAIa,cAAA,iBAA6B,EAAV,GAAA,CAAE,OAAF,CAAU,WAAD,CAAA;AAKzC;AAiBA;AAoCA;AASa,KA9DD,wBAAA,GA+DG;EAkBH;AAUZ;;;;ECnFY,SAAA,OAAU,CAAA,EAAA,MAAA;AAYtB,CAAA;AAQA;;;;;;AA8EA;AA4GA;AAiBa,cDtNA,iBCuOZ,EAAA,CAAA,QAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EDvO8E,wBCuO9E,EAAA,GDvOyG,WCuOzG;AAKD;;;;;;;cDxMa,qCAAsC;;;;;;cAStC,gCACE;;;;;;;KAkBH,2BAAA;;;;;;;;;;;;;;cAUC,8CAA6C;;;;ACvE1D;AAQA;;AAM0F,KA1B9E,UAAA,GA0B8E;EAMtE;EAiBmB,SAAA,WAAA,EAAA,MAAA;EAAW;EAiDrC,SAAA,IAAA,EAAA,UAuGZ,GAAA,OAAA,GA/FG,UAAA,GAAA,UA+FH,GAAA,QAAA,GAAA,YAAA;EAKY;EAiBA,SAAA,UAAA,EAiBZ,MAAA;AAKD,CAAA;;;;KAzOY,WAAA;;;;;;;UAQK,oBAAA;;;;;;;;UAM8B;;MAA2C;;;;;oBAMtE;;;;;;;;;;;;;;;uCAiBmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiD1B;;;;;;;;MAQT;;;;cAoGS;;;;;;cAiBA;;;;;;cAsBA,+BAAgC"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { a as createCanonicalTracker, c as CanonicalId, d as CreateCanonicalIdOptions, f as createCanonicalId, h as validateCanonicalId, i as buildAstPath, l as CanonicalIdSchema, m as parseCanonicalId, n as ScopeFrame, o as createOccurrenceTracker, p as isRelativeCanonicalId, r as ScopeHandle, s as createPathTracker, t as CanonicalPathTracker, u as CanonicalIdValidationResult } from "./index-
|
|
2
|
-
import { a as __resetPortableHasherForTests, c as PortableFS, d as getPortableFS, i as PortableHasher, l as __resetPortableFSForTests, n as runtime, o as createPortableHasher, r as HashAlgorithm, s as getPortableHasher, t as resetPortableForTests, u as createPortableFS } from "./index-
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as
|
|
1
|
+
import { a as createCanonicalTracker, c as CanonicalId, d as CreateCanonicalIdOptions, f as createCanonicalId, h as validateCanonicalId, i as buildAstPath, l as CanonicalIdSchema, m as parseCanonicalId, n as ScopeFrame, o as createOccurrenceTracker, p as isRelativeCanonicalId, r as ScopeHandle, s as createPathTracker, t as CanonicalPathTracker, u as CanonicalIdValidationResult } from "./index-UauBErGY.cjs";
|
|
2
|
+
import { a as __resetPortableHasherForTests, c as PortableFS, d as getPortableFS, i as PortableHasher, l as __resetPortableFSForTests, n as runtime, o as createPortableHasher, r as HashAlgorithm, s as getPortableHasher, t as resetPortableForTests, u as createPortableFS } from "./index-B9cqW0Kp.cjs";
|
|
3
|
+
import { a as normalizePath, c as resolveRelativeImportWithReferences, d as createAliasResolver, f as TsconfigPathsConfig, i as isRelativeSpecifier, l as cachedFn, m as readTsconfigPaths, n as MODULE_EXTENSION_CANDIDATES, o as parseJsExtension, p as TsconfigReadError, r as isExternalSpecifier, s as resolveRelativeImportWithExistenceCheck, t as JsExtensionInfo, u as AliasResolver } from "./index-DpSxWrZ_.cjs";
|
|
4
|
+
import { n as createSwcSpanConverter, t as SwcSpanConverter } from "./swc-span-Bi4N-vaI.cjs";
|
|
5
|
+
import { n as ShapeFor, r as defineSchemaFor, t as SchemaFor } from "./index-DO6j6Cif.cjs";
|
|
5
6
|
import { Result } from "neverthrow";
|
|
6
7
|
|
|
7
8
|
//#region packages/common/src/scheduler/types.d.ts
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/scheduler/types.ts","../src/scheduler/async-scheduler.ts","../src/scheduler/effect.ts","../src/scheduler/sync-scheduler.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/scheduler/types.ts","../src/scheduler/async-scheduler.ts","../src/scheduler/effect.ts","../src/scheduler/sync-scheduler.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;AAgBA;;;;;;;AAwB8C,uBAxBxB,MAwBwB,CAAA,UAAA,OAAA,CAAA,CAAA;EAApC;;;EAc4B,WAAA,CAAA,CAAA,EAlCrB,OAkCqB;EAAO;AAC5C;AAGD;EACoB,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E7BE,MF6BF,CAAA,OAAA,CAAA,EAAA;EAAS,WAAA,CAAA,OAAA,EAAA,SE7BP,MF6BO,CAAA,OAAA,CAAA,EAAA;EAKpC,UAAA,YAAiB,CAAA,CAAA,EAAA,SAAA,OAAkC,EAAA;EAKnD,UAAA,aAAc,CAAA,CAAA,EE/BS,OF+BT,CAAA,SAAA,OAAA,EAAA,CAAA;AAS1B;AAUA;;;;;;;AAQA;;;;;;AACyD,cEzC5C,WAAA,SAAoB,MFyCwB,CAAA,IAAA,CAAA,CAAA;EAAO,UAAA,YAAA,CAAA,CAAA,EAAA,IAAA;6BEpC7B;;;ADhEnC;;;cC+Ea;EA1FA;;;EACqB,SAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA,KAAA,EA6Ff,CA7Fe,EAAA,GA6FX,UA7FW,CA6FA,CA7FA,CAAA;EAIN;;;EALO,SAAA,KAAA,EAAA,CAAA,CAAA,CAAA,CAAA,OAAA,EAmGb,OAnGa,CAmGL,CAnGK,CAAA,EAAA,GAmGA,WAnGA,CAmGY,CAnGZ,CAAA;EAAM;AAqBzC;;EACwC,SAAA,QAAA,EAAA,CAAA,OAAA,EAAA,SAkFT,MAlFS,CAAA,OAAA,CAAA,EAAA,EAAA,GAkFW,cAlFX;EAAR;;;EAIJ,SAAA,KAAA,EAAA,GAAA,GAmFf,WAnFe;CAIS;;;;;;;;;;AFvBrC;;;;;;;;;;AAsC8C,cGjCjC,mBHiCiC,EAAA,GAAA,GGjCP,aHiCO"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { a as createCanonicalTracker, c as CanonicalId, d as CreateCanonicalIdOptions, f as createCanonicalId, h as validateCanonicalId, i as buildAstPath, l as CanonicalIdSchema, m as parseCanonicalId, n as ScopeFrame, o as createOccurrenceTracker, p as isRelativeCanonicalId, r as ScopeHandle, s as createPathTracker, t as CanonicalPathTracker, u as CanonicalIdValidationResult } from "./index-
|
|
2
|
-
import { a as __resetPortableHasherForTests, c as PortableFS, d as getPortableFS, i as PortableHasher, l as __resetPortableFSForTests, n as runtime, o as createPortableHasher, r as HashAlgorithm, s as getPortableHasher, t as resetPortableForTests, u as createPortableFS } from "./index-
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as
|
|
1
|
+
import { a as createCanonicalTracker, c as CanonicalId, d as CreateCanonicalIdOptions, f as createCanonicalId, h as validateCanonicalId, i as buildAstPath, l as CanonicalIdSchema, m as parseCanonicalId, n as ScopeFrame, o as createOccurrenceTracker, p as isRelativeCanonicalId, r as ScopeHandle, s as createPathTracker, t as CanonicalPathTracker, u as CanonicalIdValidationResult } from "./index-KB_f9ZJF.mjs";
|
|
2
|
+
import { a as __resetPortableHasherForTests, c as PortableFS, d as getPortableFS, i as PortableHasher, l as __resetPortableFSForTests, n as runtime, o as createPortableHasher, r as HashAlgorithm, s as getPortableHasher, t as resetPortableForTests, u as createPortableFS } from "./index-B7A6qmX_.mjs";
|
|
3
|
+
import { a as normalizePath, c as resolveRelativeImportWithReferences, d as createAliasResolver, f as TsconfigPathsConfig, i as isRelativeSpecifier, l as cachedFn, m as readTsconfigPaths, n as MODULE_EXTENSION_CANDIDATES, o as parseJsExtension, p as TsconfigReadError, r as isExternalSpecifier, s as resolveRelativeImportWithExistenceCheck, t as JsExtensionInfo, u as AliasResolver } from "./index-BIgjHIdk.mjs";
|
|
4
|
+
import { n as createSwcSpanConverter, t as SwcSpanConverter } from "./swc-span-C4QReqWr.mjs";
|
|
5
|
+
import { n as ShapeFor, r as defineSchemaFor, t as SchemaFor } from "./index-DeJfMmkU.mjs";
|
|
5
6
|
import { Result } from "neverthrow";
|
|
6
7
|
|
|
7
8
|
//#region packages/common/src/scheduler/types.d.ts
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/scheduler/types.ts","../src/scheduler/async-scheduler.ts","../src/scheduler/effect.ts","../src/scheduler/sync-scheduler.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/scheduler/types.ts","../src/scheduler/async-scheduler.ts","../src/scheduler/effect.ts","../src/scheduler/sync-scheduler.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;AAgBA;;;;;;;AAwB8C,uBAxBxB,MAwBwB,CAAA,UAAA,OAAA,CAAA,CAAA;EAApC;;;EAc4B,WAAA,CAAA,CAAA,EAlCrB,OAkCqB;EAAO;AAC5C;AAGD;EACoB,YAAA,CAAA,CAAA,EAhCI,OAgCJ,CAhCY,OAgCZ,CAAA;EAMU;;;;;;;AAY9B;AAKA;EAAiD,GAAA,CAAA,CAAA,EA1CvC,SA0CuC,CA1C7B,MA0C6B,CA1CtB,OA0CsB,CAAA,EA1CZ,OA0CY,EA1CH,YA0CG,CAAA;EAAQ;;;;EAK7C,mBAAA,YAAiB,CAAA,CAAA,EAvCQ,OAuC0B;EAKnD;AASZ;AAUA;;EAC4B,mBAAA,aAAA,CAAA,CAAA,EA1DU,OA0DV,CA1DkB,OA0DlB,CAAA;;cAvDtB,aAuDmE,EAAA,OAAA,MAAA;AAAhB,cAtD5C,YAsD4C,CAAA,UAAA,OAAA,CAAA,CAAA;EAAM,kBArD3C,aAAA;EA4DH,QAAA,WAAc,CAAA;EACe,OAAA,IAAA,CAAA,OAAA,CAAA,CAAA,KAAA,EAvDhB,OAuDgB,CAAA,EAvDN,YAuDM,CAvDO,OAuDP,CAAA;EAAlB,OAAA,MAAA,CAAA,OAAA,CAAA,CAAA,KAAA,EAnDI,YAmDJ,CAnDiB,OAmDjB,CAAA,CAAA,EAnD4B,OAmD5B;;;;;AAAoC,KA3CpD,YA2CoD,CAAA,CAAA,CAAA,GA3ClC,CA2CkC,SA3CxB,MA2CwB,CAAA,KAAA,EAAA,CAAA,GAAA,CAAA,GAAA,KAAA;;;;ACpGnD,KD8DD,eCxCX,CAAA,OAAA,CAAA,GDwCsC,SC9DC,CD8DS,MCxChD,E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AA,GGjCP,aHiCO"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as getPortableHasher, c as getPortableFS, i as createPortableHasher, n as runtime, o as __resetPortableFSForTests, r as __resetPortableHasherForTests, s as createPortableFS, t as resetPortableForTests } from "./portable-
|
|
2
|
-
import { a as MODULE_EXTENSION_CANDIDATES, c as normalizePath, d as resolveRelativeImportWithReferences, i as createAliasResolver, l as parseJsExtension, n as createSwcSpanConverter, o as isExternalSpecifier, r as cachedFn, s as isRelativeSpecifier, t as readTsconfigPaths, u as resolveRelativeImportWithExistenceCheck } from "./utils-
|
|
3
|
-
import { a as CanonicalIdSchema, c as parseCanonicalId, i as createPathTracker, l as validateCanonicalId, n as createCanonicalTracker, o as createCanonicalId, r as createOccurrenceTracker, s as isRelativeCanonicalId, t as buildAstPath } from "./canonical-id-
|
|
4
|
-
import { t as defineSchemaFor } from "./zod-
|
|
1
|
+
import { a as getPortableHasher, c as getPortableFS, i as createPortableHasher, n as runtime, o as __resetPortableFSForTests, r as __resetPortableHasherForTests, s as createPortableFS, t as resetPortableForTests } from "./portable-BDL1bEL6.mjs";
|
|
2
|
+
import { a as MODULE_EXTENSION_CANDIDATES, c as normalizePath, d as resolveRelativeImportWithReferences, i as createAliasResolver, l as parseJsExtension, n as createSwcSpanConverter, o as isExternalSpecifier, r as cachedFn, s as isRelativeSpecifier, t as readTsconfigPaths, u as resolveRelativeImportWithExistenceCheck } from "./utils-DOz9GTVx.mjs";
|
|
3
|
+
import { a as CanonicalIdSchema, c as parseCanonicalId, i as createPathTracker, l as validateCanonicalId, n as createCanonicalTracker, o as createCanonicalId, r as createOccurrenceTracker, s as isRelativeCanonicalId, t as buildAstPath } from "./canonical-id-BNdkINTi.mjs";
|
|
4
|
+
import { t as defineSchemaFor } from "./zod-nQLTnNYB.mjs";
|
|
5
5
|
import { err, ok } from "neverthrow";
|
|
6
6
|
|
|
7
7
|
//#region packages/common/src/scheduler/types.ts
|
|
@@ -193,4 +193,4 @@ function resetPortableForTests() {}
|
|
|
193
193
|
|
|
194
194
|
//#endregion
|
|
195
195
|
export { getPortableHasher as a, getPortableFS as c, createPortableHasher as i, runtime as n, __resetPortableFSForTests as o, __resetPortableHasherForTests as r, createPortableFS as s, resetPortableForTests as t };
|
|
196
|
-
//# sourceMappingURL=portable-
|
|
196
|
+
//# sourceMappingURL=portable-BDL1bEL6.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portable-BFrcBOaX.mjs","names":["nodeFsPromises: FSPromises | null","nodeFsSync: FSSync | null","pathModule: { dirname: (path: string) => string } | null","pathModule","fsInstance: PortableFS | null","hasherInstance: PortableHasher | null"],"sources":["../src/portable/fs.ts","../src/portable/hash.ts","../src/portable/runtime.ts"],"sourcesContent":["/**\n * Portable filesystem API using Node.js fs\n */\n\nexport interface PortableFS {\n readFile(path: string): Promise<string>;\n writeFile(path: string, content: string): Promise<void>;\n /**\n * Write a file atomically using temp file + rename pattern.\n * This prevents partial/corrupt writes on crash.\n */\n writeFileAtomic(path: string, content: string): Promise<void>;\n exists(path: string): Promise<boolean>;\n stat(path: string): Promise<{ mtime: Date; size: number }>;\n rename(oldPath: string, newPath: string): Promise<void>;\n mkdir(path: string, options?: { recursive?: boolean }): Promise<void>;\n /**\n * Write a file synchronously and atomically using temp file + rename pattern.\n * Safe for use in beforeExit handlers.\n */\n writeFileSyncAtomic(path: string, content: string): void;\n /**\n * Remove a file. Does not throw if file doesn't exist.\n */\n unlink(path: string): Promise<void>;\n /**\n * Remove a file synchronously. Does not throw if file doesn't exist.\n */\n unlinkSync(path: string): void;\n /**\n * Read a file synchronously.\n */\n readFileSync(path: string): string;\n}\n\ninterface FSPromises {\n readFile: (path: string, encoding: string) => Promise<string>;\n writeFile: (path: string, content: string, encoding: string) => Promise<void>;\n access: (path: string) => Promise<void>;\n stat: (path: string) => Promise<{\n mtime: Date;\n size: number;\n isDirectory: () => boolean;\n }>;\n rename: (oldPath: string, newPath: string) => Promise<void>;\n mkdir: (path: string, options?: { recursive?: boolean }) => Promise<void>;\n unlink: (path: string) => Promise<void>;\n}\n\ninterface FSSync {\n writeFileSync: (path: string, content: string, encoding: string) => void;\n renameSync: (oldPath: string, newPath: string) => void;\n unlinkSync: (path: string) => void;\n readFileSync: (path: string, encoding: string) => string;\n mkdirSync: (path: string, options?: { recursive?: boolean }) => void;\n}\n\n// Cache the fs/promises import\nlet nodeFsPromises: FSPromises | null = null;\nconst getNodeFS = async (): Promise<FSPromises> => {\n if (!nodeFsPromises) {\n const fs = await import(\"node:fs/promises\");\n nodeFsPromises = fs as FSPromises;\n }\n return nodeFsPromises;\n};\n\n// Cache the sync fs import\nlet nodeFsSync: FSSync | null = null;\nconst getNodeFSSync = (): FSSync => {\n if (!nodeFsSync) {\n // Use require for sync loading\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n nodeFsSync = require(\"node:fs\") as FSSync;\n }\n return nodeFsSync;\n};\n\n// Cache path module\nlet pathModule: { dirname: (path: string) => string } | null = null;\nconst getPathModule = (): { dirname: (path: string) => string } => {\n if (!pathModule) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n pathModule = require(\"node:path\") as { dirname: (path: string) => string };\n }\n return pathModule;\n};\n\n/**\n * Generate a unique temp file path for atomic write.\n */\nconst getTempPath = (targetPath: string): string => {\n return `${targetPath}.${process.pid}.${Date.now()}.tmp`;\n};\n\nexport function createPortableFS(): PortableFS {\n return {\n async readFile(path) {\n const nodeFS = await getNodeFS();\n return await nodeFS.readFile(path, \"utf-8\");\n },\n\n async writeFile(path, content) {\n const nodeFS = await getNodeFS();\n // Auto-create parent directories like Bun.write does\n const pathModule = await import(\"node:path\");\n const dir = pathModule.dirname(path);\n await nodeFS.mkdir(dir, { recursive: true });\n await nodeFS.writeFile(path, content, \"utf-8\");\n },\n\n async writeFileAtomic(path, content) {\n const nodeFS = await getNodeFS();\n const pathMod = await import(\"node:path\");\n const dir = pathMod.dirname(path);\n const tempPath = getTempPath(path);\n\n try {\n await nodeFS.mkdir(dir, { recursive: true });\n await nodeFS.writeFile(tempPath, content, \"utf-8\");\n await nodeFS.rename(tempPath, path);\n } catch (error) {\n // Clean up temp file on failure\n try {\n await nodeFS.unlink(tempPath);\n } catch {\n // Ignore cleanup errors\n }\n throw error;\n }\n },\n\n async exists(path) {\n const nodeFS = await getNodeFS();\n try {\n await nodeFS.access(path);\n return true;\n } catch {\n return false;\n }\n },\n\n async stat(path) {\n const nodeFS = await getNodeFS();\n const stats = await nodeFS.stat(path);\n return { mtime: stats.mtime, size: stats.size };\n },\n\n async rename(oldPath, newPath) {\n const nodeFS = await getNodeFS();\n await nodeFS.rename(oldPath, newPath);\n },\n\n async mkdir(path, options) {\n const nodeFS = await getNodeFS();\n await nodeFS.mkdir(path, options);\n },\n\n writeFileSyncAtomic(path, content) {\n const fsSync = getNodeFSSync();\n const pathMod = getPathModule();\n const tempPath = getTempPath(path);\n\n // Ensure parent directory exists\n const dir = pathMod.dirname(path);\n fsSync.mkdirSync(dir, { recursive: true });\n\n try {\n fsSync.writeFileSync(tempPath, content, \"utf-8\");\n fsSync.renameSync(tempPath, path);\n } catch (error) {\n // Clean up temp file on failure\n try {\n fsSync.unlinkSync(tempPath);\n } catch {\n // Ignore cleanup errors\n }\n throw error;\n }\n },\n\n async unlink(path) {\n const nodeFS = await getNodeFS();\n try {\n await nodeFS.unlink(path);\n } catch (error) {\n // Ignore ENOENT (file not found)\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") {\n throw error;\n }\n }\n },\n\n unlinkSync(path) {\n const fsSync = getNodeFSSync();\n try {\n fsSync.unlinkSync(path);\n } catch (error) {\n // Ignore ENOENT (file not found)\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") {\n throw error;\n }\n }\n },\n\n readFileSync(path) {\n const fsSync = getNodeFSSync();\n return fsSync.readFileSync(path, \"utf-8\");\n },\n };\n}\n\n// Singleton to avoid recreating instances\nlet fsInstance: PortableFS | null = null;\n\nexport function getPortableFS(): PortableFS {\n if (!fsInstance) {\n fsInstance = createPortableFS();\n }\n return fsInstance;\n}\n\n/**\n * Reset the filesystem singleton for testing\n * @internal\n */\nexport function __resetPortableFSForTests(): void {\n fsInstance = null;\n}\n","/**\n * Portable hashing API using Node.js crypto\n */\n\nimport { createHash } from \"node:crypto\";\n\nexport type HashAlgorithm = \"sha256\" | \"xxhash\";\n\nexport interface PortableHasher {\n hash(content: string, algorithm?: HashAlgorithm): string;\n}\n\nexport function createPortableHasher(): PortableHasher {\n return {\n hash(content, algorithm = \"xxhash\") {\n if (algorithm === \"sha256\") {\n return createHash(\"sha256\").update(content).digest(\"hex\");\n }\n // xxhash fallback: use sha256 truncated to 16 chars\n const sha256Hash = createHash(\"sha256\").update(content).digest(\"hex\");\n return sha256Hash.substring(0, 16);\n },\n };\n}\n\n// Singleton to avoid recreating instances\nlet hasherInstance: PortableHasher | null = null;\n\nexport function getPortableHasher(): PortableHasher {\n if (!hasherInstance) {\n hasherInstance = createPortableHasher();\n }\n return hasherInstance;\n}\n\n/**\n * Reset the hasher singleton for testing\n * @internal\n */\nexport function __resetPortableHasherForTests(): void {\n hasherInstance = null;\n}\n","/**\n * Runtime detection utilities for portable API implementation\n * Note: Bun-specific code has been removed. Node.js APIs are always used.\n */\n\nexport const runtime = {\n isBun: false,\n isNode: typeof process !== \"undefined\",\n supportsWebCrypto: typeof crypto !== \"undefined\" && typeof crypto.subtle !== \"undefined\",\n} as const;\n\n/**\n * Reset runtime state for testing purposes only\n * @internal\n */\nexport function resetPortableForTests(): void {\n // This is a marker function that portable modules can use\n // to reset their singleton state in tests\n}\n"],"mappings":";;;;;;;;AA0DA,IAAIA,iBAAoC;AACxC,MAAM,YAAY,YAAiC;AACjD,KAAI,CAAC,gBAAgB;EACnB,MAAM,KAAK,MAAM,OAAO;AACxB,mBAAiB;;AAEnB,QAAO;;AAIT,IAAIC,aAA4B;AAChC,MAAM,sBAA8B;AAClC,KAAI,CAAC,YAAY;AAGf,yBAAqB,UA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AAO,MAAM;;EAG3D,MAAM,aAAa,WAAW,SAAS,CAAC,OAAO,QAAQ,CAAC,OAAO,MAAM;AACrE,SAAO,WAAW,UAAU,GAAG,GAAG;IAErC;;AAIH,IAAIC,iBAAwC;AAE5C,SAAgB,oBAAoC;AAClD,KAAI,CAAC,gBAAgB;AACnB,mBAAiB,sBAAsB;;AAEzC,QAAO;;;;;;AAOT,SAAgB,gCAAsC;AACpD,kBAAiB;;;;;;;;;ACnCnB,MAAa,UAAU;CACrB,OAAO;CACP,QAAQ,OAAO,YAAY;CAC3B,mBAAmB,OAAO,WAAW,eAAe,OAAO,OAAO,WAAW;CAC9E;;;;;AAMD,SAAgB,wBAA8B"}
|
|
1
|
+
{"version":3,"file":"portable-BDL1bEL6.mjs","names":["nodeFsPromises: FSPromises | null","nodeFsSync: FSSync | null","pathModule: { dirname: (path: string) => string } | null","pathModule","fsInstance: PortableFS | null","hasherInstance: PortableHasher | null"],"sources":["../src/portable/fs.ts","../src/portable/hash.ts","../src/portable/runtime.ts"],"sourcesContent":["/**\n * Portable filesystem API using Node.js fs\n */\n\nexport interface PortableFS {\n readFile(path: string): Promise<string>;\n writeFile(path: string, content: string): Promise<void>;\n /**\n * Write a file atomically using temp file + rename pattern.\n * This prevents partial/corrupt writes on crash.\n */\n writeFileAtomic(path: string, content: string): Promise<void>;\n exists(path: string): Promise<boolean>;\n stat(path: string): Promise<{ mtime: Date; size: number }>;\n rename(oldPath: string, newPath: string): Promise<void>;\n mkdir(path: string, options?: { recursive?: boolean }): Promise<void>;\n /**\n * Write a file synchronously and atomically using temp file + rename pattern.\n * Safe for use in beforeExit handlers.\n */\n writeFileSyncAtomic(path: string, content: string): void;\n /**\n * Remove a file. Does not throw if file doesn't exist.\n */\n unlink(path: string): Promise<void>;\n /**\n * Remove a file synchronously. Does not throw if file doesn't exist.\n */\n unlinkSync(path: string): void;\n /**\n * Read a file synchronously.\n */\n readFileSync(path: string): string;\n}\n\ninterface FSPromises {\n readFile: (path: string, encoding: string) => Promise<string>;\n writeFile: (path: string, content: string, encoding: string) => Promise<void>;\n access: (path: string) => Promise<void>;\n stat: (path: string) => Promise<{\n mtime: Date;\n size: number;\n isDirectory: () => boolean;\n }>;\n rename: (oldPath: string, newPath: string) => Promise<void>;\n mkdir: (path: string, options?: { recursive?: boolean }) => Promise<void>;\n unlink: (path: string) => Promise<void>;\n}\n\ninterface FSSync {\n writeFileSync: (path: string, content: string, encoding: string) => void;\n renameSync: (oldPath: string, newPath: string) => void;\n unlinkSync: (path: string) => void;\n readFileSync: (path: string, encoding: string) => string;\n mkdirSync: (path: string, options?: { recursive?: boolean }) => void;\n}\n\n// Cache the fs/promises import\nlet nodeFsPromises: FSPromises | null = null;\nconst getNodeFS = async (): Promise<FSPromises> => {\n if (!nodeFsPromises) {\n const fs = await import(\"node:fs/promises\");\n nodeFsPromises = fs as FSPromises;\n }\n return nodeFsPromises;\n};\n\n// Cache the sync fs import\nlet nodeFsSync: FSSync | null = null;\nconst getNodeFSSync = (): FSSync => {\n if (!nodeFsSync) {\n // Use require for sync loading\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n nodeFsSync = require(\"node:fs\") as FSSync;\n }\n return nodeFsSync;\n};\n\n// Cache path module\nlet pathModule: { dirname: (path: string) => string } | null = null;\nconst getPathModule = (): { dirname: (path: string) => string } => {\n if (!pathModule) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n pathModule = require(\"node:path\") as { dirname: (path: string) => string };\n }\n return pathModule;\n};\n\n/**\n * Generate a unique temp file path for atomic write.\n */\nconst getTempPath = (targetPath: string): string => {\n return `${targetPath}.${process.pid}.${Date.now()}.tmp`;\n};\n\nexport function createPortableFS(): PortableFS {\n return {\n async readFile(path) {\n const nodeFS = await getNodeFS();\n return await nodeFS.readFile(path, \"utf-8\");\n },\n\n async writeFile(path, content) {\n const nodeFS = await getNodeFS();\n // Auto-create parent directories like Bun.write does\n const pathModule = await import(\"node:path\");\n const dir = pathModule.dirname(path);\n await nodeFS.mkdir(dir, { recursive: true });\n await nodeFS.writeFile(path, content, \"utf-8\");\n },\n\n async writeFileAtomic(path, content) {\n const nodeFS = await getNodeFS();\n const pathMod = await import(\"node:path\");\n const dir = pathMod.dirname(path);\n const tempPath = getTempPath(path);\n\n try {\n await nodeFS.mkdir(dir, { recursive: true });\n await nodeFS.writeFile(tempPath, content, \"utf-8\");\n await nodeFS.rename(tempPath, path);\n } catch (error) {\n // Clean up temp file on failure\n try {\n await nodeFS.unlink(tempPath);\n } catch {\n // Ignore cleanup errors\n }\n throw error;\n }\n },\n\n async exists(path) {\n const nodeFS = await getNodeFS();\n try {\n await nodeFS.access(path);\n return true;\n } catch {\n return false;\n }\n },\n\n async stat(path) {\n const nodeFS = await getNodeFS();\n const stats = await nodeFS.stat(path);\n return { mtime: stats.mtime, size: stats.size };\n },\n\n async rename(oldPath, newPath) {\n const nodeFS = await getNodeFS();\n await nodeFS.rename(oldPath, newPath);\n },\n\n async mkdir(path, options) {\n const nodeFS = await getNodeFS();\n await nodeFS.mkdir(path, options);\n },\n\n writeFileSyncAtomic(path, content) {\n const fsSync = getNodeFSSync();\n const pathMod = getPathModule();\n const tempPath = getTempPath(path);\n\n // Ensure parent directory exists\n const dir = pathMod.dirname(path);\n fsSync.mkdirSync(dir, { recursive: true });\n\n try {\n fsSync.writeFileSync(tempPath, content, \"utf-8\");\n fsSync.renameSync(tempPath, path);\n } catch (error) {\n // Clean up temp file on failure\n try {\n fsSync.unlinkSync(tempPath);\n } catch {\n // Ignore cleanup errors\n }\n throw error;\n }\n },\n\n async unlink(path) {\n const nodeFS = await getNodeFS();\n try {\n await nodeFS.unlink(path);\n } catch (error) {\n // Ignore ENOENT (file not found)\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") {\n throw error;\n }\n }\n },\n\n unlinkSync(path) {\n const fsSync = getNodeFSSync();\n try {\n fsSync.unlinkSync(path);\n } catch (error) {\n // Ignore ENOENT (file not found)\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") {\n throw error;\n }\n }\n },\n\n readFileSync(path) {\n const fsSync = getNodeFSSync();\n return fsSync.readFileSync(path, \"utf-8\");\n },\n };\n}\n\n// Singleton to avoid recreating instances\nlet fsInstance: PortableFS | null = null;\n\nexport function getPortableFS(): PortableFS {\n if (!fsInstance) {\n fsInstance = createPortableFS();\n }\n return fsInstance;\n}\n\n/**\n * Reset the filesystem singleton for testing\n * @internal\n */\nexport function __resetPortableFSForTests(): void {\n fsInstance = null;\n}\n","/**\n * Portable hashing API using Node.js crypto\n */\n\nimport { createHash } from \"node:crypto\";\n\nexport type HashAlgorithm = \"sha256\" | \"xxhash\";\n\nexport interface PortableHasher {\n hash(content: string, algorithm?: HashAlgorithm): string;\n}\n\nexport function createPortableHasher(): PortableHasher {\n return {\n hash(content, algorithm = \"xxhash\") {\n if (algorithm === \"sha256\") {\n return createHash(\"sha256\").update(content).digest(\"hex\");\n }\n // xxhash fallback: use sha256 truncated to 16 chars\n const sha256Hash = createHash(\"sha256\").update(content).digest(\"hex\");\n return sha256Hash.substring(0, 16);\n },\n };\n}\n\n// Singleton to avoid recreating instances\nlet hasherInstance: PortableHasher | null = null;\n\nexport function getPortableHasher(): PortableHasher {\n if (!hasherInstance) {\n hasherInstance = createPortableHasher();\n }\n return hasherInstance;\n}\n\n/**\n * Reset the hasher singleton for testing\n * @internal\n */\nexport function __resetPortableHasherForTests(): void {\n hasherInstance = null;\n}\n","/**\n * Runtime detection utilities for portable API implementation\n * Note: Bun-specific code has been removed. Node.js APIs are always used.\n */\n\nexport const runtime = {\n isBun: false,\n isNode: typeof process !== \"undefined\",\n supportsWebCrypto: typeof crypto !== \"undefined\" && typeof crypto.subtle !== \"undefined\",\n} as const;\n\n/**\n * Reset runtime state for testing purposes only\n * @internal\n */\nexport function resetPortableForTests(): void {\n // This is a marker function that portable modules can use\n // to reset their singleton state in tests\n}\n"],"mappings":";;;;;;;;AA0DA,IAAIA,iBAAoC;AACxC,MAAM,YAAY,YAAiC;AACjD,KAAI,CAAC,gB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;;;;;;;ACvNf,SAAgB,uBAAuC;AACrD,QAAO,EACL,KAAK,SAAS,YAAY,UAAU;AAClC,MAAI,cAAc,UAAU;AAC1B,UAAO,WAAW,SAAS,CAAC,OAAO,QAAQ,CAAC,OAAO,MAAM;;EAG3D,MAAM,aAAa,WAAW,SAAS,CAAC,OAAO,QAAQ,CAAC,OAAO,MAAM;AACrE,SAAO,WAAW,UAAU,GAAG,GAAG;IAErC;;AAIH,IAAIC,iBAAwC;AAE5C,SAAgB,oBAAoC;AAClD,KAAI,CAAC,gBAAgB;AACnB,mBAAiB,sBAAsB;;AAEzC,QAAO;;;;;;AAOT,SAAgB,gCAAsC;AACpD,kBAAiB;;;;;;;;;ACnCnB,MAAa,UAAU;CACrB,OAAO;CACP,QAAQ,OAAO,YAAY;CAC3B,mBAAmB,OAAO,WAAW,eAAe,OAAO,OAAO,WAAW;CAC9E;;;;;AAMD,SAAgB,wBAA8B"}
|
package/dist/portable.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as __resetPortableHasherForTests, c as PortableFS, d as getPortableFS, i as PortableHasher, l as __resetPortableFSForTests, n as runtime, o as createPortableHasher, r as HashAlgorithm, s as getPortableHasher, t as resetPortableForTests, u as createPortableFS } from "./index-
|
|
1
|
+
import { a as __resetPortableHasherForTests, c as PortableFS, d as getPortableFS, i as PortableHasher, l as __resetPortableFSForTests, n as runtime, o as createPortableHasher, r as HashAlgorithm, s as getPortableHasher, t as resetPortableForTests, u as createPortableFS } from "./index-B9cqW0Kp.cjs";
|
|
2
2
|
export { HashAlgorithm, PortableFS, PortableHasher, __resetPortableFSForTests, __resetPortableHasherForTests, createPortableFS, createPortableHasher, getPortableFS, getPortableHasher, resetPortableForTests, runtime };
|
package/dist/portable.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as __resetPortableHasherForTests, c as PortableFS, d as getPortableFS, i as PortableHasher, l as __resetPortableFSForTests, n as runtime, o as createPortableHasher, r as HashAlgorithm, s as getPortableHasher, t as resetPortableForTests, u as createPortableFS } from "./index-
|
|
1
|
+
import { a as __resetPortableHasherForTests, c as PortableFS, d as getPortableFS, i as PortableHasher, l as __resetPortableFSForTests, n as runtime, o as createPortableHasher, r as HashAlgorithm, s as getPortableHasher, t as resetPortableForTests, u as createPortableFS } from "./index-B7A6qmX_.mjs";
|
|
2
2
|
export { HashAlgorithm, PortableFS, PortableHasher, __resetPortableFSForTests, __resetPortableHasherForTests, createPortableFS, createPortableHasher, getPortableFS, getPortableHasher, resetPortableForTests, runtime };
|
package/dist/portable.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as getPortableHasher, c as getPortableFS, i as createPortableHasher, n as runtime, o as __resetPortableFSForTests, r as __resetPortableHasherForTests, s as createPortableFS, t as resetPortableForTests } from "./portable-
|
|
1
|
+
import { a as getPortableHasher, c as getPortableFS, i as createPortableHasher, n as runtime, o as __resetPortableFSForTests, r as __resetPortableHasherForTests, s as createPortableFS, t as resetPortableForTests } from "./portable-BDL1bEL6.mjs";
|
|
2
2
|
|
|
3
3
|
export { __resetPortableFSForTests, __resetPortableHasherForTests, createPortableFS, createPortableHasher, getPortableFS, getPortableHasher, resetPortableForTests, runtime };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region packages/common/src/utils/swc-span.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* SWC span position converter: UTF-8 byte offsets → UTF-16 code unit indices.
|
|
4
|
+
*
|
|
5
|
+
* SWC (Rust-based) returns span positions as UTF-8 byte offsets.
|
|
6
|
+
* JavaScript strings use UTF-16 code units for indexing.
|
|
7
|
+
* For ASCII-only content these are identical, but for multi-byte
|
|
8
|
+
* characters the positions diverge.
|
|
9
|
+
*/
|
|
10
|
+
type SwcSpanConverter = {
|
|
11
|
+
/** UTF-8 byte length of the source string */
|
|
12
|
+
readonly byteLength: number;
|
|
13
|
+
/** Convert a UTF-8 byte offset (within the source) to a UTF-16 code unit index */
|
|
14
|
+
readonly byteOffsetToCharIndex: (byteOffset: number) => number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Create a converter that maps UTF-8 byte offsets to UTF-16 char indices
|
|
18
|
+
* for the given source string.
|
|
19
|
+
*
|
|
20
|
+
* Includes a fast path for ASCII-only sources (zero allocation).
|
|
21
|
+
*/
|
|
22
|
+
declare const createSwcSpanConverter: (source: string) => SwcSpanConverter;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { createSwcSpanConverter as n, SwcSpanConverter as t };
|
|
25
|
+
//# sourceMappingURL=swc-span-Bi4N-vaI.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swc-span-Bi4N-vaI.d.cts","names":[],"sources":["../src/utils/swc-span.ts"],"sourcesContent":[],"mappings":";;AASA;AAaA;;;;;;KAbY,gBAAA;;;;;;;;;;;;cAaC,4CAA2C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region packages/common/src/utils/swc-span.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* SWC span position converter: UTF-8 byte offsets → UTF-16 code unit indices.
|
|
4
|
+
*
|
|
5
|
+
* SWC (Rust-based) returns span positions as UTF-8 byte offsets.
|
|
6
|
+
* JavaScript strings use UTF-16 code units for indexing.
|
|
7
|
+
* For ASCII-only content these are identical, but for multi-byte
|
|
8
|
+
* characters the positions diverge.
|
|
9
|
+
*/
|
|
10
|
+
type SwcSpanConverter = {
|
|
11
|
+
/** UTF-8 byte length of the source string */
|
|
12
|
+
readonly byteLength: number;
|
|
13
|
+
/** Convert a UTF-8 byte offset (within the source) to a UTF-16 code unit index */
|
|
14
|
+
readonly byteOffsetToCharIndex: (byteOffset: number) => number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Create a converter that maps UTF-8 byte offsets to UTF-16 char indices
|
|
18
|
+
* for the given source string.
|
|
19
|
+
*
|
|
20
|
+
* Includes a fast path for ASCII-only sources (zero allocation).
|
|
21
|
+
*/
|
|
22
|
+
declare const createSwcSpanConverter: (source: string) => SwcSpanConverter;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { createSwcSpanConverter as n, SwcSpanConverter as t };
|
|
25
|
+
//# sourceMappingURL=swc-span-C4QReqWr.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swc-span-C4QReqWr.d.mts","names":[],"sources":["../src/utils/swc-span.ts"],"sourcesContent":[],"mappings":";;AASA;AAaA;;;;;;KAbY,gBAAA;;;;;;;;;;;;cAaC,4CAA2C"}
|