@athrio/loom 0.0.13 → 0.0.15

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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoomStore-axDgE8RF.js","names":[],"sources":["../../loom-ast/src/ast/LoomSymbol.ts","../../loom-lang-services/src/LoomStore.ts"],"sourcesContent":["import { Array, Match, Option, Schema } from 'effect'\nimport { type Position } from '#ast/LoomNode'\nimport {\n type LoomDocument,\n type LoomFrontmatter,\n type LoomHeading,\n type LoomSection,\n} from '#ast/LoomAst'\nimport { type SectionBodyWeft, type TocWeft } from '#ast/Weft'\nimport { type WarpAnchorToken, type WarpToken } from '#ast/LoomTokens'\n\nexport const SymbolKindSchema = Schema.Literals([\n 'headingTitle',\n 'sectionAnchor',\n 'warpAnchor',\n 'warpDef',\n 'specifier',\n 'sink',\n 'arrow',\n 'tilde',\n 'prose',\n 'frontmatterMembership',\n 'frontmatterValue',\n 'frontmatterTitle',\n 'frontmatterPart',\n 'frontmatterPartName',\n 'tocPart',\n 'tocEntry',\n])\nexport type SymbolKind = typeof SymbolKindSchema.Type\n\nexport interface SpanFeatures {\n readonly navigation?: boolean\n readonly semantic?: boolean\n readonly structure?: boolean\n readonly verification?: boolean\n readonly completion?: boolean\n}\n\nexport const SemanticTokenSchema = Schema.Literals([\n 'namespace',\n 'variable',\n 'keyword',\n 'string',\n 'operator',\n])\nexport type SemanticToken = typeof SemanticTokenSchema.Type\n\nexport interface SymbolProfile {\n readonly semantic: Option.Option<SemanticToken>\n readonly features: SpanFeatures\n}\n\nconst profile = (\n semantic: Option.Option<SemanticToken>,\n features: SpanFeatures,\n): SymbolProfile => ({ semantic, features })\n\nexport const profileOf = (kind: SymbolKind): SymbolProfile =>\n Match.value(kind).pipe(\n Match.when('headingTitle', () =>\n profile(Option.some('namespace'), { navigation: true, structure: true }),\n ),\n Match.when('sectionAnchor', () =>\n profile(Option.some('namespace'), {\n navigation: true,\n structure: true,\n verification: true,\n }),\n ),\n Match.when('warpAnchor', () =>\n profile(Option.some('variable'), { navigation: true, verification: true }),\n ),\n Match.when('warpDef', () => profile(Option.some('variable'), { navigation: true })),\n Match.when('specifier', () => profile(Option.some('keyword'), { verification: true })),\n Match.when('sink', () => profile(Option.some('string'), { verification: true })),\n Match.when('arrow', () => profile(Option.some('operator'), {})),\n Match.when('tilde', () => profile(Option.some('operator'), {})),\n Match.when('prose', () => profile(Option.none(), { structure: true })),\n Match.when('frontmatterMembership', () =>\n profile(Option.some('namespace'), { structure: true }),\n ),\n Match.when('frontmatterValue', () => profile(Option.some('string'), { structure: true })),\n Match.when('frontmatterTitle', () =>\n profile(Option.some('namespace'), { navigation: true, structure: true }),\n ),\n Match.when('frontmatterPart', () =>\n profile(Option.some('namespace'), { navigation: true, structure: true }),\n ),\n Match.when('frontmatterPartName', () =>\n profile(Option.some('namespace'), { navigation: true, structure: true }),\n ),\n Match.when('tocPart', () =>\n profile(Option.some('namespace'), { navigation: true, structure: true }),\n ),\n Match.when('tocEntry', () =>\n profile(Option.some('namespace'), {\n navigation: true,\n structure: true,\n verification: true,\n }),\n ),\n Match.exhaustive,\n )\n\nexport interface Symbol {\n readonly kind: SymbolKind\n readonly position: Position\n}\n\nconst anchorKind = (warpsInScope: ReadonlySet<string>, anchor: WarpAnchorToken): SymbolKind =>\n warpsInScope.has(anchor.name.value) ? 'warpAnchor' : 'sectionAnchor'\n\nconst namesOf = (warps: ReadonlyArray<WarpToken>): ReadonlyArray<string> =>\n Array.map(warps, (warp) => warp.name.value)\n\nconst at = (kind: SymbolKind, position: Position): Symbol => ({ kind, position })\n\nconst optSymbol = (\n kind: SymbolKind,\n token: { readonly position: Position } | undefined,\n): ReadonlyArray<Symbol> =>\n Option.toArray(Option.map(Option.fromNullishOr(token), (t) => at(kind, t.position)))\n\nconst frontmatterSymbols = (fm: LoomFrontmatter): ReadonlyArray<Symbol> => [\n ...optSymbol('frontmatterPart', fm.part),\n ...optSymbol('frontmatterPartName', fm.partName),\n ...optSymbol('frontmatterMembership', fm.chapter),\n ...optSymbol('frontmatterTitle', fm.title),\n ...optSymbol('frontmatterValue', fm.package),\n ...optSymbol('frontmatterValue', fm.language),\n]\n\nconst tocSymbols = (weft: TocWeft): ReadonlyArray<Symbol> => [\n ...optSymbol('tocPart', weft.part),\n ...optSymbol('tocEntry', weft.title),\n]\n\nconst headingSymbols = (heading: LoomHeading): ReadonlyArray<Symbol> => [\n ...Option.toArray(\n Option.map(Option.fromNullishOr(heading.title), (t) => at('headingTitle', t.position)),\n ),\n ...Option.toArray(\n Option.map(Option.fromNullishOr(heading.specifier), (s) => at('specifier', s.label.position)),\n ),\n ...Option.toArray(Option.map(Option.fromNullishOr(heading.sink), (s) => at('sink', s.position))),\n]\n\nconst delimiterOf = (weft: SectionBodyWeft): ReadonlyArray<Symbol> =>\n Match.value(weft).pipe(\n Match.when({ type: 'ArrowWeft' }, (w) => [at('arrow', w.arrow.position)]),\n Match.when({ type: 'TildeWeft' }, (w) => [at('tilde', w.tilde.position)]),\n Match.orElse(() => []),\n )\n\nconst sectionSymbols = (\n section: LoomSection,\n documentWarps: ReadonlyArray<string>,\n): ReadonlyArray<Symbol> => {\n const warps = Array.flatMap(section.preamble, (weft) => weft.warps)\n const scope = new Set([...documentWarps, ...namesOf(warps)])\n const anchors = [\n ...Array.flatMap(section.preamble, (weft) => weft.anchors),\n ...Array.flatMap(section.code, (weft) => weft.anchors),\n ]\n return [\n ...headingSymbols(section.heading),\n ...Array.map(warps, (warp) => at('warpDef', warp.name.position)),\n ...Array.map(anchors, (anchor) => at(anchorKind(scope, anchor), anchor.name.position)),\n ...Array.flatMap(section.code, delimiterOf),\n ...Array.flatMap(section.entries ?? [], tocSymbols),\n ]\n}\n\nexport const symbolsOf = (doc: LoomDocument): ReadonlyArray<Symbol> => {\n const warps = Array.flatMap(doc.preamble, (weft) => weft.warps)\n const scope = new Set(namesOf(warps))\n return [\n ...Array.flatMap(Option.toArray(Option.fromNullishOr(doc.frontmatter)), frontmatterSymbols),\n ...Array.map(warps, (warp) => at('warpDef', warp.name.position)),\n ...Array.map(\n Array.flatMap(doc.preamble, (weft) => weft.anchors),\n (anchor) => at(anchorKind(scope, anchor), anchor.name.position),\n ),\n ...Array.flatMap(doc.sections, (section) => sectionSymbols(section, namesOf(warps))),\n ]\n}\n\nexport const symbolAt = (doc: LoomDocument, offset: number): Option.Option<Symbol> =>\n Array.findFirst(\n symbolsOf(doc),\n (symbol) => symbol.position.start.offset <= offset && offset <= symbol.position.end.offset,\n )\n","import { Array, Data, Effect, Option, Schema, pipe } from 'effect'\nimport { execFile } from 'node:child_process'\nimport {\n existsSync,\n mkdirSync,\n readdirSync,\n readFileSync,\n renameSync,\n rmSync,\n writeFileSync,\n} from 'node:fs'\nimport { dirname, join } from 'node:path'\nimport { promisify } from 'node:util'\nimport { gunzipSync } from 'node:zlib'\n\nconst run = promisify(execFile)\n\nexport const servicePackage = (id: string): string => `@athrio/loom-service-${id}`\n\nexport const workspaceOf = (dir: string): Option.Option<string> => {\n if (existsSync(join(dir, '.loom'))) return Option.some(dir)\n const parent = dirname(dir)\n return parent === dir ? Option.none() : workspaceOf(parent)\n}\n\nexport const workspaceRoot = (dir: string): string => Option.getOrElse(workspaceOf(dir), () => dir)\n\nexport const storeDir = (dir: string): string =>\n process.env.LOOM_HOME === undefined\n ? join(workspaceRoot(dir), '.loom', 'services')\n : join(process.env.LOOM_HOME, 'services')\n\nconst servicePrefix = 'loom-service-'\n\nexport const installedServices = (dir: string): Effect.Effect<ReadonlyArray<string>> =>\n Effect.sync(() => {\n const scope = join(storeDir(dir), 'node_modules', '@athrio')\n if (!existsSync(scope)) return []\n return readdirSync(scope)\n .filter((name) => name.startsWith(servicePrefix))\n .map((name) => name.slice(servicePrefix.length))\n })\n\nexport const ServiceManifestSchema = Schema.Struct({\n version: Schema.optional(Schema.String),\n main: Schema.optional(Schema.String),\n exports: Schema.optional(Schema.Unknown),\n})\n\nexport type ServiceManifest = typeof ServiceManifestSchema.Type\n\nexport const serviceDir = (id: string, dir: string): string =>\n join(storeDir(dir), 'node_modules', servicePackage(id))\n\nexport const serviceManifest = (id: string, dir: string): Option.Option<ServiceManifest> =>\n pipe(\n Option.liftThrowable(() => readFileSync(join(serviceDir(id, dir), 'package.json'), 'utf8'))(),\n Option.flatMap(Option.liftThrowable((text: string): unknown => JSON.parse(text))),\n Option.flatMap(Schema.decodeUnknownOption(ServiceManifestSchema)),\n )\n\nexport const serviceVersion = '0.0.13'\n\nexport const installedVersion = (id: string, dir: string): Option.Option<string> =>\n Option.flatMap(serviceManifest(id, dir), (manifest) => Option.fromNullishOr(manifest.version))\n\nexport const standalone: boolean = /[\\\\/](\\$bunfs|~BUN)[\\\\/]/.test(import.meta.url)\n\ninterface EmbeddedFile extends Blob {\n readonly name?: string\n}\n\nexport const embeddedFile = (name: string): Option.Option<EmbeddedFile> =>\n pipe(\n Option.fromNullishOr(\n (globalThis as { readonly Bun?: { readonly embeddedFiles?: ReadonlyArray<EmbeddedFile> } })\n .Bun?.embeddedFiles,\n ),\n Option.flatMap(Array.findFirst((file) => file.name === name)),\n )\n\nexport class StoreError extends Data.TaggedError('StoreError')<{\n readonly packageName: string\n readonly cause: unknown\n}> {}\n\nconst prepareStore = (store: string): void => {\n mkdirSync(store, { recursive: true })\n const manifest = join(store, 'package.json')\n if (!existsSync(manifest))\n writeFileSync(\n manifest,\n `${JSON.stringify({ name: 'loom-services', private: true }, null, 2)}\\n`,\n )\n}\n\ninterface PackageManager {\n readonly command: string\n readonly args: ReadonlyArray<string>\n readonly env: NodeJS.ProcessEnv\n}\n\nconst packageManager = (store: string, spec: string): PackageManager =>\n standalone\n ? {\n command: process.execPath,\n args: ['add', spec, '--cwd', store, '--omit', 'peer'],\n env: { ...process.env, BUN_BE_BUN: '1' },\n }\n : {\n command: 'npm',\n args: ['install', spec, '--prefix', store, '--omit=peer', '--no-audit', '--no-fund'],\n env: process.env,\n }\n\nconst installPackage = (\n dir: string,\n packageName: string,\n range: string,\n): Effect.Effect<void, StoreError> =>\n Effect.gen(function* () {\n const store = storeDir(dir)\n yield* Effect.sync(() => prepareStore(store))\n const manager = packageManager(store, `${packageName}@${range}`)\n yield* Effect.tryPromise({\n try: () => run(manager.command, [...manager.args], { env: manager.env }),\n catch: (cause) => new StoreError({ packageName, cause }),\n })\n })\n\nexport type ServiceInstall = Data.TaggedEnum<{\n Current: {}\n Installed: {}\n Updated: { readonly from: string }\n}>\nexport const ServiceInstall = Data.taggedEnum<ServiceInstall>()\n\nexport const installService = (id: string, dir: string): Effect.Effect<ServiceInstall, StoreError> =>\n Effect.gen(function* () {\n const installed = installedVersion(id, dir)\n if (Option.contains(installed, serviceVersion)) return ServiceInstall.Current()\n yield* installPackage(dir, servicePackage(id), serviceVersion)\n return Option.match(installed, {\n onNone: () => ServiceInstall.Installed(),\n onSome: (from) => ServiceInstall.Updated({ from }),\n })\n })\n\nexport const typeScriptRange = '^6'\n\nexport const storeTypeScript = (dir: string): Option.Option<string> => {\n const file = join(storeDir(dir), 'node_modules', 'typescript', 'lib', 'typescript.js')\n return existsSync(file) ? Option.some(file) : Option.none()\n}\n\nconst typeScriptAsset = 'typescript.json.gz'\n\nconst PackedTypeScriptSchema = Schema.Struct({\n files: Schema.Record(Schema.String, Schema.String),\n})\n\nconst typeScriptError = (cause: unknown): StoreError =>\n new StoreError({ packageName: 'typescript', cause })\n\nconst unpackTypeScript = (dir: string, packed: Blob): Effect.Effect<void, StoreError> =>\n Effect.gen(function* () {\n const archive = yield* Effect.tryPromise({\n try: async () => new Uint8Array(await packed.arrayBuffer()),\n catch: typeScriptError,\n })\n const json = yield* Effect.try({\n try: (): unknown => JSON.parse(gunzipSync(archive).toString('utf8')),\n catch: typeScriptError,\n })\n const { files } = yield* Schema.decodeUnknownEffect(PackedTypeScriptSchema)(json).pipe(\n Effect.mapError(typeScriptError),\n )\n const store = storeDir(dir)\n const modules = join(store, 'node_modules')\n const partial = join(modules, `.typescript-${process.pid}`)\n yield* Effect.sync(() => prepareStore(store))\n yield* Effect.forEach(\n Object.entries(files),\n ([path, text]) =>\n Effect.try({\n try: () => {\n mkdirSync(dirname(join(partial, path)), { recursive: true })\n writeFileSync(join(partial, path), text)\n },\n catch: typeScriptError,\n }),\n { discard: true },\n )\n yield* Effect.try({\n try: () => {\n rmSync(join(modules, 'typescript'), { recursive: true, force: true })\n renameSync(partial, join(modules, 'typescript'))\n },\n catch: typeScriptError,\n })\n })\n\nexport const installTypeScript = (dir: string): Effect.Effect<string, StoreError> =>\n Option.match(embeddedFile(typeScriptAsset), {\n onSome: (packed) => unpackTypeScript(dir, packed),\n onNone: () => installPackage(dir, 'typescript', typeScriptRange),\n }).pipe(\n Effect.flatMap(() =>\n Option.match(storeTypeScript(dir), {\n onNone: () => Effect.fail(typeScriptError('the store holds no lib/typescript.js')),\n onSome: Effect.succeed,\n }),\n ),\n )\n\nexport const removeService = (id: string, dir: string): Effect.Effect<void> =>\n Effect.sync(() => rmSync(serviceDir(id, dir), { recursive: true, force: true }))\n"],"mappings":";;;;;;;AAWgC,SAAgB;CAC9C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAWD,IAAa,sBAAsB,SAAgB;CACjD;CACA;CACA;CACA;CACA;AACF,CAAC;AAQD,IAAM,WACJ,UACA,cACmB;CAAE;CAAU;AAAS;AAE1C,IAAa,aAAa,SACxB,MAAY,IAAI,CAAC,CAAC,KAChB,KAAW,sBACT,QAAQ,KAAY,WAAW,GAAG;CAAE,YAAY;CAAM,WAAW;AAAK,CAAC,CACzE,GACA,KAAW,uBACT,QAAQ,KAAY,WAAW,GAAG;CAChC,YAAY;CACZ,WAAW;CACX,cAAc;AAChB,CAAC,CACH,GACA,KAAW,oBACT,QAAQ,KAAY,UAAU,GAAG;CAAE,YAAY;CAAM,cAAc;AAAK,CAAC,CAC3E,GACA,KAAW,iBAAiB,QAAQ,KAAY,UAAU,GAAG,EAAE,YAAY,KAAK,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