@colbymchenry/codegraph-darwin-x64 0.9.0
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/bin/codegraph +3 -0
- package/lib/dist/bin/codegraph.d.ts +21 -0
- package/lib/dist/bin/codegraph.d.ts.map +1 -0
- package/lib/dist/bin/codegraph.js +1273 -0
- package/lib/dist/bin/codegraph.js.map +1 -0
- package/lib/dist/bin/node-version-check.d.ts +37 -0
- package/lib/dist/bin/node-version-check.d.ts.map +1 -0
- package/lib/dist/bin/node-version-check.js +79 -0
- package/lib/dist/bin/node-version-check.js.map +1 -0
- package/lib/dist/bin/uninstall.d.ts +14 -0
- package/lib/dist/bin/uninstall.d.ts.map +1 -0
- package/lib/dist/bin/uninstall.js +36 -0
- package/lib/dist/bin/uninstall.js.map +1 -0
- package/lib/dist/config.d.ts +51 -0
- package/lib/dist/config.d.ts.map +1 -0
- package/lib/dist/config.js +321 -0
- package/lib/dist/config.js.map +1 -0
- package/lib/dist/context/formatter.d.ts +30 -0
- package/lib/dist/context/formatter.d.ts.map +1 -0
- package/lib/dist/context/formatter.js +244 -0
- package/lib/dist/context/formatter.js.map +1 -0
- package/lib/dist/context/index.d.ts +97 -0
- package/lib/dist/context/index.d.ts.map +1 -0
- package/lib/dist/context/index.js +1050 -0
- package/lib/dist/context/index.js.map +1 -0
- package/lib/dist/db/index.d.ts +83 -0
- package/lib/dist/db/index.d.ts.map +1 -0
- package/lib/dist/db/index.js +219 -0
- package/lib/dist/db/index.js.map +1 -0
- package/lib/dist/db/migrations.d.ts +44 -0
- package/lib/dist/db/migrations.d.ts.map +1 -0
- package/lib/dist/db/migrations.js +131 -0
- package/lib/dist/db/migrations.js.map +1 -0
- package/lib/dist/db/queries.d.ts +253 -0
- package/lib/dist/db/queries.d.ts.map +1 -0
- package/lib/dist/db/queries.js +1207 -0
- package/lib/dist/db/queries.js.map +1 -0
- package/lib/dist/db/schema.sql +151 -0
- package/lib/dist/db/sqlite-adapter.d.ts +46 -0
- package/lib/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/lib/dist/db/sqlite-adapter.js +114 -0
- package/lib/dist/db/sqlite-adapter.js.map +1 -0
- package/lib/dist/directory.d.ts +57 -0
- package/lib/dist/directory.d.ts.map +1 -0
- package/lib/dist/directory.js +264 -0
- package/lib/dist/directory.js.map +1 -0
- package/lib/dist/errors.d.ts +136 -0
- package/lib/dist/errors.d.ts.map +1 -0
- package/lib/dist/errors.js +219 -0
- package/lib/dist/errors.js.map +1 -0
- package/lib/dist/extraction/dfm-extractor.d.ts +31 -0
- package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/dfm-extractor.js +151 -0
- package/lib/dist/extraction/dfm-extractor.js.map +1 -0
- package/lib/dist/extraction/grammars.d.ts +78 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -0
- package/lib/dist/extraction/grammars.js +332 -0
- package/lib/dist/extraction/grammars.js.map +1 -0
- package/lib/dist/extraction/index.d.ts +130 -0
- package/lib/dist/extraction/index.d.ts.map +1 -0
- package/lib/dist/extraction/index.js +1305 -0
- package/lib/dist/extraction/index.js.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts +4 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.js +126 -0
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -0
- package/lib/dist/extraction/languages/csharp.d.ts +3 -0
- package/lib/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/lib/dist/extraction/languages/csharp.js +72 -0
- package/lib/dist/extraction/languages/csharp.js.map +1 -0
- package/lib/dist/extraction/languages/dart.d.ts +3 -0
- package/lib/dist/extraction/languages/dart.d.ts.map +1 -0
- package/lib/dist/extraction/languages/dart.js +192 -0
- package/lib/dist/extraction/languages/dart.js.map +1 -0
- package/lib/dist/extraction/languages/go.d.ts +3 -0
- package/lib/dist/extraction/languages/go.d.ts.map +1 -0
- package/lib/dist/extraction/languages/go.js +58 -0
- package/lib/dist/extraction/languages/go.js.map +1 -0
- package/lib/dist/extraction/languages/index.d.ts +10 -0
- package/lib/dist/extraction/languages/index.d.ts.map +1 -0
- package/lib/dist/extraction/languages/index.js +49 -0
- package/lib/dist/extraction/languages/index.js.map +1 -0
- package/lib/dist/extraction/languages/java.d.ts +3 -0
- package/lib/dist/extraction/languages/java.d.ts.map +1 -0
- package/lib/dist/extraction/languages/java.js +64 -0
- package/lib/dist/extraction/languages/java.js.map +1 -0
- package/lib/dist/extraction/languages/javascript.d.ts +3 -0
- package/lib/dist/extraction/languages/javascript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/javascript.js +90 -0
- package/lib/dist/extraction/languages/javascript.js.map +1 -0
- package/lib/dist/extraction/languages/kotlin.d.ts +3 -0
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -0
- package/lib/dist/extraction/languages/kotlin.js +253 -0
- package/lib/dist/extraction/languages/kotlin.js.map +1 -0
- package/lib/dist/extraction/languages/lua.d.ts +3 -0
- package/lib/dist/extraction/languages/lua.d.ts.map +1 -0
- package/lib/dist/extraction/languages/lua.js +150 -0
- package/lib/dist/extraction/languages/lua.js.map +1 -0
- package/lib/dist/extraction/languages/luau.d.ts +3 -0
- package/lib/dist/extraction/languages/luau.d.ts.map +1 -0
- package/lib/dist/extraction/languages/luau.js +37 -0
- package/lib/dist/extraction/languages/luau.js.map +1 -0
- package/lib/dist/extraction/languages/pascal.d.ts +3 -0
- package/lib/dist/extraction/languages/pascal.d.ts.map +1 -0
- package/lib/dist/extraction/languages/pascal.js +66 -0
- package/lib/dist/extraction/languages/pascal.js.map +1 -0
- package/lib/dist/extraction/languages/php.d.ts +3 -0
- package/lib/dist/extraction/languages/php.d.ts.map +1 -0
- package/lib/dist/extraction/languages/php.js +107 -0
- package/lib/dist/extraction/languages/php.js.map +1 -0
- package/lib/dist/extraction/languages/python.d.ts +3 -0
- package/lib/dist/extraction/languages/python.d.ts.map +1 -0
- package/lib/dist/extraction/languages/python.js +56 -0
- package/lib/dist/extraction/languages/python.js.map +1 -0
- package/lib/dist/extraction/languages/ruby.d.ts +3 -0
- package/lib/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/lib/dist/extraction/languages/ruby.js +114 -0
- package/lib/dist/extraction/languages/ruby.js.map +1 -0
- package/lib/dist/extraction/languages/rust.d.ts +3 -0
- package/lib/dist/extraction/languages/rust.d.ts.map +1 -0
- package/lib/dist/extraction/languages/rust.js +109 -0
- package/lib/dist/extraction/languages/rust.js.map +1 -0
- package/lib/dist/extraction/languages/scala.d.ts +3 -0
- package/lib/dist/extraction/languages/scala.d.ts.map +1 -0
- package/lib/dist/extraction/languages/scala.js +139 -0
- package/lib/dist/extraction/languages/scala.js.map +1 -0
- package/lib/dist/extraction/languages/swift.d.ts +3 -0
- package/lib/dist/extraction/languages/swift.d.ts.map +1 -0
- package/lib/dist/extraction/languages/swift.js +91 -0
- package/lib/dist/extraction/languages/swift.js.map +1 -0
- package/lib/dist/extraction/languages/typescript.d.ts +3 -0
- package/lib/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/typescript.js +129 -0
- package/lib/dist/extraction/languages/typescript.js.map +1 -0
- package/lib/dist/extraction/liquid-extractor.d.ts +52 -0
- package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/liquid-extractor.js +313 -0
- package/lib/dist/extraction/liquid-extractor.js.map +1 -0
- package/lib/dist/extraction/parse-worker.d.ts +8 -0
- package/lib/dist/extraction/parse-worker.d.ts.map +1 -0
- package/lib/dist/extraction/parse-worker.js +94 -0
- package/lib/dist/extraction/parse-worker.js.map +1 -0
- package/lib/dist/extraction/svelte-extractor.d.ts +56 -0
- package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/svelte-extractor.js +272 -0
- package/lib/dist/extraction/svelte-extractor.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.js +103 -0
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts +179 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter-types.js +10 -0
- package/lib/dist/extraction/tree-sitter-types.js.map +1 -0
- package/lib/dist/extraction/tree-sitter.d.ts +233 -0
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter.js +2425 -0
- package/lib/dist/extraction/tree-sitter.js.map +1 -0
- package/lib/dist/extraction/vue-extractor.d.ts +36 -0
- package/lib/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/vue-extractor.js +163 -0
- package/lib/dist/extraction/vue-extractor.js.map +1 -0
- package/lib/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/lib/dist/graph/index.d.ts +8 -0
- package/lib/dist/graph/index.d.ts.map +1 -0
- package/lib/dist/graph/index.js +13 -0
- package/lib/dist/graph/index.js.map +1 -0
- package/lib/dist/graph/queries.d.ts +106 -0
- package/lib/dist/graph/queries.d.ts.map +1 -0
- package/lib/dist/graph/queries.js +366 -0
- package/lib/dist/graph/queries.js.map +1 -0
- package/lib/dist/graph/traversal.d.ts +127 -0
- package/lib/dist/graph/traversal.d.ts.map +1 -0
- package/lib/dist/graph/traversal.js +493 -0
- package/lib/dist/graph/traversal.js.map +1 -0
- package/lib/dist/index.d.ts +453 -0
- package/lib/dist/index.d.ts.map +1 -0
- package/lib/dist/index.js +833 -0
- package/lib/dist/index.js.map +1 -0
- package/lib/dist/installer/claude-md-template.d.ts +14 -0
- package/lib/dist/installer/claude-md-template.d.ts.map +1 -0
- package/lib/dist/installer/claude-md-template.js +21 -0
- package/lib/dist/installer/claude-md-template.js.map +1 -0
- package/lib/dist/installer/config-writer.d.ts +29 -0
- package/lib/dist/installer/config-writer.d.ts.map +1 -0
- package/lib/dist/installer/config-writer.js +111 -0
- package/lib/dist/installer/config-writer.js.map +1 -0
- package/lib/dist/installer/index.d.ts +65 -0
- package/lib/dist/installer/index.d.ts.map +1 -0
- package/lib/dist/installer/index.js +406 -0
- package/lib/dist/installer/index.js.map +1 -0
- package/lib/dist/installer/instructions-template.d.ts +28 -0
- package/lib/dist/installer/instructions-template.d.ts.map +1 -0
- package/lib/dist/installer/instructions-template.js +64 -0
- package/lib/dist/installer/instructions-template.js.map +1 -0
- package/lib/dist/installer/targets/claude.d.ts +47 -0
- package/lib/dist/installer/targets/claude.d.ts.map +1 -0
- package/lib/dist/installer/targets/claude.js +401 -0
- package/lib/dist/installer/targets/claude.js.map +1 -0
- package/lib/dist/installer/targets/codex.d.ts +18 -0
- package/lib/dist/installer/targets/codex.d.ts.map +1 -0
- package/lib/dist/installer/targets/codex.js +185 -0
- package/lib/dist/installer/targets/codex.js.map +1 -0
- package/lib/dist/installer/targets/cursor.d.ts +35 -0
- package/lib/dist/installer/targets/cursor.d.ts.map +1 -0
- package/lib/dist/installer/targets/cursor.js +229 -0
- package/lib/dist/installer/targets/cursor.js.map +1 -0
- package/lib/dist/installer/targets/opencode.d.ts +30 -0
- package/lib/dist/installer/targets/opencode.d.ts.map +1 -0
- package/lib/dist/installer/targets/opencode.js +235 -0
- package/lib/dist/installer/targets/opencode.js.map +1 -0
- package/lib/dist/installer/targets/registry.d.ts +35 -0
- package/lib/dist/installer/targets/registry.d.ts.map +1 -0
- package/lib/dist/installer/targets/registry.js +83 -0
- package/lib/dist/installer/targets/registry.js.map +1 -0
- package/lib/dist/installer/targets/shared.d.ts +77 -0
- package/lib/dist/installer/targets/shared.d.ts.map +1 -0
- package/lib/dist/installer/targets/shared.js +246 -0
- package/lib/dist/installer/targets/shared.js.map +1 -0
- package/lib/dist/installer/targets/toml.d.ts +52 -0
- package/lib/dist/installer/targets/toml.d.ts.map +1 -0
- package/lib/dist/installer/targets/toml.js +147 -0
- package/lib/dist/installer/targets/toml.js.map +1 -0
- package/lib/dist/installer/targets/types.d.ts +116 -0
- package/lib/dist/installer/targets/types.d.ts.map +1 -0
- package/lib/dist/installer/targets/types.js +16 -0
- package/lib/dist/installer/targets/types.js.map +1 -0
- package/lib/dist/mcp/index.d.ts +94 -0
- package/lib/dist/mcp/index.d.ts.map +1 -0
- package/lib/dist/mcp/index.js +453 -0
- package/lib/dist/mcp/index.js.map +1 -0
- package/lib/dist/mcp/server-instructions.d.ts +19 -0
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -0
- package/lib/dist/mcp/server-instructions.js +71 -0
- package/lib/dist/mcp/server-instructions.js.map +1 -0
- package/lib/dist/mcp/tools.d.ts +257 -0
- package/lib/dist/mcp/tools.d.ts.map +1 -0
- package/lib/dist/mcp/tools.js +1646 -0
- package/lib/dist/mcp/tools.js.map +1 -0
- package/lib/dist/mcp/transport.d.ts +106 -0
- package/lib/dist/mcp/transport.d.ts.map +1 -0
- package/lib/dist/mcp/transport.js +233 -0
- package/lib/dist/mcp/transport.js.map +1 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.js +225 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.js +213 -0
- package/lib/dist/resolution/frameworks/csharp.js.map +1 -0
- package/lib/dist/resolution/frameworks/express.d.ts +8 -0
- package/lib/dist/resolution/frameworks/express.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/express.js +225 -0
- package/lib/dist/resolution/frameworks/express.js.map +1 -0
- package/lib/dist/resolution/frameworks/go.d.ts +8 -0
- package/lib/dist/resolution/frameworks/go.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/go.js +158 -0
- package/lib/dist/resolution/frameworks/go.js.map +1 -0
- package/lib/dist/resolution/frameworks/index.d.ts +42 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/index.js +133 -0
- package/lib/dist/resolution/frameworks/index.js.map +1 -0
- package/lib/dist/resolution/frameworks/java.d.ts +8 -0
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/java.js +177 -0
- package/lib/dist/resolution/frameworks/java.js.map +1 -0
- package/lib/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/laravel.js +248 -0
- package/lib/dist/resolution/frameworks/laravel.js.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.js +374 -0
- package/lib/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/lib/dist/resolution/frameworks/python.d.ts +10 -0
- package/lib/dist/resolution/frameworks/python.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/python.js +278 -0
- package/lib/dist/resolution/frameworks/python.js.map +1 -0
- package/lib/dist/resolution/frameworks/react.d.ts +8 -0
- package/lib/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/react.js +272 -0
- package/lib/dist/resolution/frameworks/react.js.map +1 -0
- package/lib/dist/resolution/frameworks/ruby.d.ts +8 -0
- package/lib/dist/resolution/frameworks/ruby.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/ruby.js +198 -0
- package/lib/dist/resolution/frameworks/ruby.js.map +1 -0
- package/lib/dist/resolution/frameworks/rust.d.ts +8 -0
- package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/rust.js +207 -0
- package/lib/dist/resolution/frameworks/rust.js.map +1 -0
- package/lib/dist/resolution/frameworks/svelte.d.ts +9 -0
- package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/svelte.js +249 -0
- package/lib/dist/resolution/frameworks/svelte.js.map +1 -0
- package/lib/dist/resolution/frameworks/swift.d.ts +10 -0
- package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/swift.js +376 -0
- package/lib/dist/resolution/frameworks/swift.js.map +1 -0
- package/lib/dist/resolution/frameworks/vue.d.ts +9 -0
- package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/vue.js +306 -0
- package/lib/dist/resolution/frameworks/vue.js.map +1 -0
- package/lib/dist/resolution/import-resolver.d.ts +40 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -0
- package/lib/dist/resolution/import-resolver.js +663 -0
- package/lib/dist/resolution/import-resolver.js.map +1 -0
- package/lib/dist/resolution/index.d.ts +106 -0
- package/lib/dist/resolution/index.d.ts.map +1 -0
- package/lib/dist/resolution/index.js +709 -0
- package/lib/dist/resolution/index.js.map +1 -0
- package/lib/dist/resolution/name-matcher.d.ts +32 -0
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -0
- package/lib/dist/resolution/name-matcher.js +384 -0
- package/lib/dist/resolution/name-matcher.js.map +1 -0
- package/lib/dist/resolution/path-aliases.d.ts +68 -0
- package/lib/dist/resolution/path-aliases.d.ts.map +1 -0
- package/lib/dist/resolution/path-aliases.js +238 -0
- package/lib/dist/resolution/path-aliases.js.map +1 -0
- package/lib/dist/resolution/strip-comments.d.ts +27 -0
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -0
- package/lib/dist/resolution/strip-comments.js +441 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -0
- package/lib/dist/resolution/types.d.ts +172 -0
- package/lib/dist/resolution/types.d.ts.map +1 -0
- package/lib/dist/resolution/types.js +8 -0
- package/lib/dist/resolution/types.js.map +1 -0
- package/lib/dist/search/query-parser.d.ts +57 -0
- package/lib/dist/search/query-parser.d.ts.map +1 -0
- package/lib/dist/search/query-parser.js +177 -0
- package/lib/dist/search/query-parser.js.map +1 -0
- package/lib/dist/search/query-utils.d.ts +53 -0
- package/lib/dist/search/query-utils.d.ts.map +1 -0
- package/lib/dist/search/query-utils.js +350 -0
- package/lib/dist/search/query-utils.js.map +1 -0
- package/lib/dist/sync/git-hooks.d.ts +45 -0
- package/lib/dist/sync/git-hooks.d.ts.map +1 -0
- package/lib/dist/sync/git-hooks.js +223 -0
- package/lib/dist/sync/git-hooks.js.map +1 -0
- package/lib/dist/sync/index.d.ts +17 -0
- package/lib/dist/sync/index.d.ts.map +1 -0
- package/lib/dist/sync/index.js +28 -0
- package/lib/dist/sync/index.js.map +1 -0
- package/lib/dist/sync/watch-policy.d.ts +48 -0
- package/lib/dist/sync/watch-policy.d.ts.map +1 -0
- package/lib/dist/sync/watch-policy.js +124 -0
- package/lib/dist/sync/watch-policy.js.map +1 -0
- package/lib/dist/sync/watcher.d.ts +81 -0
- package/lib/dist/sync/watcher.d.ts.map +1 -0
- package/lib/dist/sync/watcher.js +194 -0
- package/lib/dist/sync/watcher.js.map +1 -0
- package/lib/dist/types.d.ts +423 -0
- package/lib/dist/types.d.ts.map +1 -0
- package/lib/dist/types.js +262 -0
- package/lib/dist/types.js.map +1 -0
- package/lib/dist/ui/glyphs.d.ts +42 -0
- package/lib/dist/ui/glyphs.d.ts.map +1 -0
- package/lib/dist/ui/glyphs.js +78 -0
- package/lib/dist/ui/glyphs.js.map +1 -0
- package/lib/dist/ui/shimmer-progress.d.ts +11 -0
- package/lib/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/lib/dist/ui/shimmer-progress.js +90 -0
- package/lib/dist/ui/shimmer-progress.js.map +1 -0
- package/lib/dist/ui/shimmer-worker.d.ts +2 -0
- package/lib/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/lib/dist/ui/shimmer-worker.js +118 -0
- package/lib/dist/ui/shimmer-worker.js.map +1 -0
- package/lib/dist/ui/types.d.ts +17 -0
- package/lib/dist/ui/types.d.ts.map +1 -0
- package/lib/dist/ui/types.js +3 -0
- package/lib/dist/ui/types.js.map +1 -0
- package/lib/dist/utils.d.ts +205 -0
- package/lib/dist/utils.d.ts.map +1 -0
- package/lib/dist/utils.js +549 -0
- package/lib/dist/utils.js.map +1 -0
- package/lib/node_modules/.package-lock.json +116 -0
- package/lib/node_modules/@clack/core/CHANGELOG.md +348 -0
- package/lib/node_modules/@clack/core/LICENSE +9 -0
- package/lib/node_modules/@clack/core/README.md +22 -0
- package/lib/node_modules/@clack/core/dist/index.d.mts +363 -0
- package/lib/node_modules/@clack/core/dist/index.mjs +17 -0
- package/lib/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/lib/node_modules/@clack/core/package.json +63 -0
- package/lib/node_modules/@clack/prompts/CHANGELOG.md +591 -0
- package/lib/node_modules/@clack/prompts/LICENSE +9 -0
- package/lib/node_modules/@clack/prompts/README.md +375 -0
- package/lib/node_modules/@clack/prompts/dist/index.d.mts +396 -0
- package/lib/node_modules/@clack/prompts/dist/index.mjs +144 -0
- package/lib/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/lib/node_modules/@clack/prompts/package.json +68 -0
- package/lib/node_modules/commander/LICENSE +22 -0
- package/lib/node_modules/commander/Readme.md +1176 -0
- package/lib/node_modules/commander/esm.mjs +16 -0
- package/lib/node_modules/commander/index.js +24 -0
- package/lib/node_modules/commander/lib/argument.js +150 -0
- package/lib/node_modules/commander/lib/command.js +2777 -0
- package/lib/node_modules/commander/lib/error.js +39 -0
- package/lib/node_modules/commander/lib/help.js +747 -0
- package/lib/node_modules/commander/lib/option.js +380 -0
- package/lib/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/lib/node_modules/commander/package-support.json +19 -0
- package/lib/node_modules/commander/package.json +82 -0
- package/lib/node_modules/commander/typings/esm.d.mts +3 -0
- package/lib/node_modules/commander/typings/index.d.ts +1113 -0
- package/lib/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/lib/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/lib/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/lib/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/lib/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/lib/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/lib/node_modules/fast-string-truncated-width/license +21 -0
- package/lib/node_modules/fast-string-truncated-width/package.json +35 -0
- package/lib/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/lib/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/lib/node_modules/fast-string-width/dist/index.js +14 -0
- package/lib/node_modules/fast-string-width/license +21 -0
- package/lib/node_modules/fast-string-width/package.json +34 -0
- package/lib/node_modules/fast-string-width/readme.md +42 -0
- package/lib/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/lib/node_modules/fast-wrap-ansi/README.md +26 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.js +219 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.js.map +1 -0
- package/lib/node_modules/fast-wrap-ansi/package.json +51 -0
- package/lib/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/lib/node_modules/jsonc-parser/LICENSE.md +21 -0
- package/lib/node_modules/jsonc-parser/README.md +364 -0
- package/lib/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
- package/lib/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
- package/lib/node_modules/jsonc-parser/lib/esm/main.js +178 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
- package/lib/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
- package/lib/node_modules/jsonc-parser/lib/umd/main.js +194 -0
- package/lib/node_modules/jsonc-parser/package.json +37 -0
- package/lib/node_modules/picomatch/LICENSE +21 -0
- package/lib/node_modules/picomatch/README.md +738 -0
- package/lib/node_modules/picomatch/index.js +17 -0
- package/lib/node_modules/picomatch/lib/constants.js +180 -0
- package/lib/node_modules/picomatch/lib/parse.js +1085 -0
- package/lib/node_modules/picomatch/lib/picomatch.js +341 -0
- package/lib/node_modules/picomatch/lib/scan.js +391 -0
- package/lib/node_modules/picomatch/lib/utils.js +72 -0
- package/lib/node_modules/picomatch/package.json +83 -0
- package/lib/node_modules/picomatch/posix.js +3 -0
- package/lib/node_modules/sisteransi/license +21 -0
- package/lib/node_modules/sisteransi/package.json +34 -0
- package/lib/node_modules/sisteransi/readme.md +113 -0
- package/lib/node_modules/sisteransi/src/index.js +58 -0
- package/lib/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/lib/node_modules/tree-sitter-wasms/LICENSE +24 -0
- package/lib/node_modules/tree-sitter-wasms/README.md +23 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-bash.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-cpp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-css.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-dart.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elisp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elixir.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elm.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-embedded_template.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-go.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-html.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-java.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-javascript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-json.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-kotlin.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-lua.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-objc.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ocaml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-php.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-python.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ql.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rescript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ruby.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rust.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-scala.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-solidity.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-swift.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-systemrdl.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tlaplus.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-toml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tsx.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-typescript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-vue.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-yaml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-zig.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/package.json +64 -0
- package/lib/node_modules/web-tree-sitter/LICENSE +21 -0
- package/lib/node_modules/web-tree-sitter/README.md +269 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs +4558 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs.map +7 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js +4516 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js.map +7 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm.map +31 -0
- package/lib/node_modules/web-tree-sitter/lib/alloc.c +48 -0
- package/lib/node_modules/web-tree-sitter/lib/alloc.h +41 -0
- package/lib/node_modules/web-tree-sitter/lib/array.h +291 -0
- package/lib/node_modules/web-tree-sitter/lib/atomic.h +68 -0
- package/lib/node_modules/web-tree-sitter/lib/clock.h +146 -0
- package/lib/node_modules/web-tree-sitter/lib/error_costs.h +11 -0
- package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.c +523 -0
- package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.h +36 -0
- package/lib/node_modules/web-tree-sitter/lib/host.h +21 -0
- package/lib/node_modules/web-tree-sitter/lib/language.c +293 -0
- package/lib/node_modules/web-tree-sitter/lib/language.h +293 -0
- package/lib/node_modules/web-tree-sitter/lib/length.h +52 -0
- package/lib/node_modules/web-tree-sitter/lib/lexer.c +483 -0
- package/lib/node_modules/web-tree-sitter/lib/lexer.h +54 -0
- package/lib/node_modules/web-tree-sitter/lib/lib.c +12 -0
- package/lib/node_modules/web-tree-sitter/lib/node.c +875 -0
- package/lib/node_modules/web-tree-sitter/lib/parser.c +2297 -0
- package/lib/node_modules/web-tree-sitter/lib/parser.h +286 -0
- package/lib/node_modules/web-tree-sitter/lib/point.h +48 -0
- package/lib/node_modules/web-tree-sitter/lib/query.c +4347 -0
- package/lib/node_modules/web-tree-sitter/lib/reduce_action.h +34 -0
- package/lib/node_modules/web-tree-sitter/lib/reusable_node.h +95 -0
- package/lib/node_modules/web-tree-sitter/lib/stack.c +912 -0
- package/lib/node_modules/web-tree-sitter/lib/stack.h +133 -0
- package/lib/node_modules/web-tree-sitter/lib/subtree.c +1034 -0
- package/lib/node_modules/web-tree-sitter/lib/subtree.h +399 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.c +987 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.cjs +2988 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm.map +1 -0
- package/lib/node_modules/web-tree-sitter/lib/tree.c +170 -0
- package/lib/node_modules/web-tree-sitter/lib/tree.h +31 -0
- package/lib/node_modules/web-tree-sitter/lib/tree_cursor.c +716 -0
- package/lib/node_modules/web-tree-sitter/lib/tree_cursor.h +48 -0
- package/lib/node_modules/web-tree-sitter/lib/ts_assert.h +11 -0
- package/lib/node_modules/web-tree-sitter/lib/unicode.h +75 -0
- package/lib/node_modules/web-tree-sitter/lib/wasm_store.c +1937 -0
- package/lib/node_modules/web-tree-sitter/lib/wasm_store.h +31 -0
- package/lib/node_modules/web-tree-sitter/package.json +98 -0
- package/lib/node_modules/web-tree-sitter/src/bindings.ts +26 -0
- package/lib/node_modules/web-tree-sitter/src/constants.ts +133 -0
- package/lib/node_modules/web-tree-sitter/src/index.ts +31 -0
- package/lib/node_modules/web-tree-sitter/src/language.ts +291 -0
- package/lib/node_modules/web-tree-sitter/src/lookahead_iterator.ts +75 -0
- package/lib/node_modules/web-tree-sitter/src/marshal.ts +176 -0
- package/lib/node_modules/web-tree-sitter/src/node.ts +646 -0
- package/lib/node_modules/web-tree-sitter/src/parser.ts +325 -0
- package/lib/node_modules/web-tree-sitter/src/query.ts +973 -0
- package/lib/node_modules/web-tree-sitter/src/tree.ts +145 -0
- package/lib/node_modules/web-tree-sitter/src/tree_cursor.ts +318 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.cjs +4031 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.cjs.map +7 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.js +3980 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.js.map +7 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.wasm.map +30 -0
- package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts +1030 -0
- package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +56 -0
- package/lib/package.json +55 -0
- package/node +0 -0
- package/package.json +17 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LiquidExtractor = void 0;
|
|
4
|
+
const tree_sitter_helpers_1 = require("./tree-sitter-helpers");
|
|
5
|
+
/**
|
|
6
|
+
* LiquidExtractor - Extracts relationships from Liquid template files
|
|
7
|
+
*
|
|
8
|
+
* Liquid is a templating language (used by Shopify, Jekyll, etc.) that doesn't
|
|
9
|
+
* have traditional functions or classes. Instead, we extract:
|
|
10
|
+
* - Section references ({% section 'name' %})
|
|
11
|
+
* - Snippet references ({% render 'name' %} and {% include 'name' %})
|
|
12
|
+
* - Schema blocks ({% schema %}...{% endschema %})
|
|
13
|
+
*/
|
|
14
|
+
class LiquidExtractor {
|
|
15
|
+
filePath;
|
|
16
|
+
source;
|
|
17
|
+
nodes = [];
|
|
18
|
+
edges = [];
|
|
19
|
+
unresolvedReferences = [];
|
|
20
|
+
errors = [];
|
|
21
|
+
constructor(filePath, source) {
|
|
22
|
+
this.filePath = filePath;
|
|
23
|
+
this.source = source;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Extract from Liquid source
|
|
27
|
+
*/
|
|
28
|
+
extract() {
|
|
29
|
+
const startTime = Date.now();
|
|
30
|
+
try {
|
|
31
|
+
// Create file node
|
|
32
|
+
const fileNode = this.createFileNode();
|
|
33
|
+
// Extract render/include statements (snippet references)
|
|
34
|
+
this.extractSnippetReferences(fileNode.id);
|
|
35
|
+
// Extract section references
|
|
36
|
+
this.extractSectionReferences(fileNode.id);
|
|
37
|
+
// Extract schema block
|
|
38
|
+
this.extractSchema(fileNode.id);
|
|
39
|
+
// Extract assign statements as variables
|
|
40
|
+
this.extractAssignments(fileNode.id);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
this.errors.push({
|
|
44
|
+
message: `Liquid extraction error: ${error instanceof Error ? error.message : String(error)}`,
|
|
45
|
+
severity: 'error',
|
|
46
|
+
code: 'parse_error',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
nodes: this.nodes,
|
|
51
|
+
edges: this.edges,
|
|
52
|
+
unresolvedReferences: this.unresolvedReferences,
|
|
53
|
+
errors: this.errors,
|
|
54
|
+
durationMs: Date.now() - startTime,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Create a file node for the Liquid template
|
|
59
|
+
*/
|
|
60
|
+
createFileNode() {
|
|
61
|
+
const lines = this.source.split('\n');
|
|
62
|
+
const id = (0, tree_sitter_helpers_1.generateNodeId)(this.filePath, 'file', this.filePath, 1);
|
|
63
|
+
const fileNode = {
|
|
64
|
+
id,
|
|
65
|
+
kind: 'file',
|
|
66
|
+
name: this.filePath.split('/').pop() || this.filePath,
|
|
67
|
+
qualifiedName: this.filePath,
|
|
68
|
+
filePath: this.filePath,
|
|
69
|
+
language: 'liquid',
|
|
70
|
+
startLine: 1,
|
|
71
|
+
endLine: lines.length,
|
|
72
|
+
startColumn: 0,
|
|
73
|
+
endColumn: lines[lines.length - 1]?.length || 0,
|
|
74
|
+
updatedAt: Date.now(),
|
|
75
|
+
};
|
|
76
|
+
this.nodes.push(fileNode);
|
|
77
|
+
return fileNode;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Extract {% render 'snippet' %} and {% include 'snippet' %} references
|
|
81
|
+
*/
|
|
82
|
+
extractSnippetReferences(fileNodeId) {
|
|
83
|
+
// Match {% render 'name' %} or {% include 'name' %} with optional parameters
|
|
84
|
+
const renderRegex = /\{%[-]?\s*(render|include)\s+['"]([^'"]+)['"]/g;
|
|
85
|
+
let match;
|
|
86
|
+
while ((match = renderRegex.exec(this.source)) !== null) {
|
|
87
|
+
const [fullMatch, tagType, snippetName] = match;
|
|
88
|
+
const line = this.getLineNumber(match.index);
|
|
89
|
+
// Create an import node for searchability
|
|
90
|
+
const importNodeId = (0, tree_sitter_helpers_1.generateNodeId)(this.filePath, 'import', snippetName, line);
|
|
91
|
+
const importNode = {
|
|
92
|
+
id: importNodeId,
|
|
93
|
+
kind: 'import',
|
|
94
|
+
name: snippetName,
|
|
95
|
+
qualifiedName: `${this.filePath}::import:${snippetName}`,
|
|
96
|
+
filePath: this.filePath,
|
|
97
|
+
language: 'liquid',
|
|
98
|
+
signature: fullMatch,
|
|
99
|
+
startLine: line,
|
|
100
|
+
endLine: line,
|
|
101
|
+
startColumn: match.index - this.getLineStart(line),
|
|
102
|
+
endColumn: match.index - this.getLineStart(line) + fullMatch.length,
|
|
103
|
+
updatedAt: Date.now(),
|
|
104
|
+
};
|
|
105
|
+
this.nodes.push(importNode);
|
|
106
|
+
// Add containment edge from file to import
|
|
107
|
+
this.edges.push({
|
|
108
|
+
source: fileNodeId,
|
|
109
|
+
target: importNodeId,
|
|
110
|
+
kind: 'contains',
|
|
111
|
+
});
|
|
112
|
+
// Create a component node for the snippet reference
|
|
113
|
+
const nodeId = (0, tree_sitter_helpers_1.generateNodeId)(this.filePath, 'component', `${tagType}:${snippetName}`, line);
|
|
114
|
+
const node = {
|
|
115
|
+
id: nodeId,
|
|
116
|
+
kind: 'component',
|
|
117
|
+
name: snippetName,
|
|
118
|
+
qualifiedName: `${this.filePath}::${tagType}:${snippetName}`,
|
|
119
|
+
filePath: this.filePath,
|
|
120
|
+
language: 'liquid',
|
|
121
|
+
startLine: line,
|
|
122
|
+
endLine: line,
|
|
123
|
+
startColumn: match.index - this.getLineStart(line),
|
|
124
|
+
endColumn: match.index - this.getLineStart(line) + fullMatch.length,
|
|
125
|
+
updatedAt: Date.now(),
|
|
126
|
+
};
|
|
127
|
+
this.nodes.push(node);
|
|
128
|
+
// Add containment edge from file
|
|
129
|
+
this.edges.push({
|
|
130
|
+
source: fileNodeId,
|
|
131
|
+
target: nodeId,
|
|
132
|
+
kind: 'contains',
|
|
133
|
+
});
|
|
134
|
+
// Add unresolved reference to the snippet file
|
|
135
|
+
this.unresolvedReferences.push({
|
|
136
|
+
fromNodeId: fileNodeId,
|
|
137
|
+
referenceName: `snippets/${snippetName}.liquid`,
|
|
138
|
+
referenceKind: 'references',
|
|
139
|
+
line,
|
|
140
|
+
column: match.index - this.getLineStart(line),
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Extract {% section 'name' %} references
|
|
146
|
+
*/
|
|
147
|
+
extractSectionReferences(fileNodeId) {
|
|
148
|
+
// Match {% section 'name' %}
|
|
149
|
+
const sectionRegex = /\{%[-]?\s*section\s+['"]([^'"]+)['"]/g;
|
|
150
|
+
let match;
|
|
151
|
+
while ((match = sectionRegex.exec(this.source)) !== null) {
|
|
152
|
+
const [fullMatch, sectionName] = match;
|
|
153
|
+
const line = this.getLineNumber(match.index);
|
|
154
|
+
// Create an import node for searchability
|
|
155
|
+
const importNodeId = (0, tree_sitter_helpers_1.generateNodeId)(this.filePath, 'import', sectionName, line);
|
|
156
|
+
const importNode = {
|
|
157
|
+
id: importNodeId,
|
|
158
|
+
kind: 'import',
|
|
159
|
+
name: sectionName,
|
|
160
|
+
qualifiedName: `${this.filePath}::import:${sectionName}`,
|
|
161
|
+
filePath: this.filePath,
|
|
162
|
+
language: 'liquid',
|
|
163
|
+
signature: fullMatch,
|
|
164
|
+
startLine: line,
|
|
165
|
+
endLine: line,
|
|
166
|
+
startColumn: match.index - this.getLineStart(line),
|
|
167
|
+
endColumn: match.index - this.getLineStart(line) + fullMatch.length,
|
|
168
|
+
updatedAt: Date.now(),
|
|
169
|
+
};
|
|
170
|
+
this.nodes.push(importNode);
|
|
171
|
+
// Add containment edge from file to import
|
|
172
|
+
this.edges.push({
|
|
173
|
+
source: fileNodeId,
|
|
174
|
+
target: importNodeId,
|
|
175
|
+
kind: 'contains',
|
|
176
|
+
});
|
|
177
|
+
// Create a component node for the section reference
|
|
178
|
+
const nodeId = (0, tree_sitter_helpers_1.generateNodeId)(this.filePath, 'component', `section:${sectionName}`, line);
|
|
179
|
+
const node = {
|
|
180
|
+
id: nodeId,
|
|
181
|
+
kind: 'component',
|
|
182
|
+
name: sectionName,
|
|
183
|
+
qualifiedName: `${this.filePath}::section:${sectionName}`,
|
|
184
|
+
filePath: this.filePath,
|
|
185
|
+
language: 'liquid',
|
|
186
|
+
startLine: line,
|
|
187
|
+
endLine: line,
|
|
188
|
+
startColumn: match.index - this.getLineStart(line),
|
|
189
|
+
endColumn: match.index - this.getLineStart(line) + fullMatch.length,
|
|
190
|
+
updatedAt: Date.now(),
|
|
191
|
+
};
|
|
192
|
+
this.nodes.push(node);
|
|
193
|
+
// Add containment edge from file
|
|
194
|
+
this.edges.push({
|
|
195
|
+
source: fileNodeId,
|
|
196
|
+
target: nodeId,
|
|
197
|
+
kind: 'contains',
|
|
198
|
+
});
|
|
199
|
+
// Add unresolved reference to the section file
|
|
200
|
+
this.unresolvedReferences.push({
|
|
201
|
+
fromNodeId: fileNodeId,
|
|
202
|
+
referenceName: `sections/${sectionName}.liquid`,
|
|
203
|
+
referenceKind: 'references',
|
|
204
|
+
line,
|
|
205
|
+
column: match.index - this.getLineStart(line),
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Extract {% schema %}...{% endschema %} blocks
|
|
211
|
+
*/
|
|
212
|
+
extractSchema(fileNodeId) {
|
|
213
|
+
// Match {% schema %}...{% endschema %}
|
|
214
|
+
const schemaRegex = /\{%[-]?\s*schema\s*[-]?%\}([\s\S]*?)\{%[-]?\s*endschema\s*[-]?%\}/g;
|
|
215
|
+
let match;
|
|
216
|
+
while ((match = schemaRegex.exec(this.source)) !== null) {
|
|
217
|
+
const [fullMatch, schemaContent] = match;
|
|
218
|
+
const startLine = this.getLineNumber(match.index);
|
|
219
|
+
const endLine = this.getLineNumber(match.index + fullMatch.length);
|
|
220
|
+
// Try to parse the schema JSON to get the name
|
|
221
|
+
let schemaName = 'schema';
|
|
222
|
+
try {
|
|
223
|
+
const schemaJson = JSON.parse(schemaContent);
|
|
224
|
+
if (schemaJson.name) {
|
|
225
|
+
// Shopify schema names can be translation objects like {"en": "...", "fr": "..."}
|
|
226
|
+
schemaName = typeof schemaJson.name === 'string'
|
|
227
|
+
? schemaJson.name
|
|
228
|
+
: schemaJson.name.en || Object.values(schemaJson.name)[0] || 'schema';
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
catch {
|
|
232
|
+
// Schema isn't valid JSON, use default name
|
|
233
|
+
}
|
|
234
|
+
// Create a node for the schema
|
|
235
|
+
const nodeId = (0, tree_sitter_helpers_1.generateNodeId)(this.filePath, 'constant', `schema:${schemaName}`, startLine);
|
|
236
|
+
const node = {
|
|
237
|
+
id: nodeId,
|
|
238
|
+
kind: 'constant',
|
|
239
|
+
name: schemaName,
|
|
240
|
+
qualifiedName: `${this.filePath}::schema:${schemaName}`,
|
|
241
|
+
filePath: this.filePath,
|
|
242
|
+
language: 'liquid',
|
|
243
|
+
startLine,
|
|
244
|
+
endLine,
|
|
245
|
+
startColumn: match.index - this.getLineStart(startLine),
|
|
246
|
+
endColumn: 0,
|
|
247
|
+
docstring: schemaContent?.trim().substring(0, 200), // Store first 200 chars as docstring
|
|
248
|
+
updatedAt: Date.now(),
|
|
249
|
+
};
|
|
250
|
+
this.nodes.push(node);
|
|
251
|
+
// Add containment edge from file
|
|
252
|
+
this.edges.push({
|
|
253
|
+
source: fileNodeId,
|
|
254
|
+
target: nodeId,
|
|
255
|
+
kind: 'contains',
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Extract {% assign var = value %} statements
|
|
261
|
+
*/
|
|
262
|
+
extractAssignments(fileNodeId) {
|
|
263
|
+
// Match {% assign variable_name = ... %}
|
|
264
|
+
const assignRegex = /\{%[-]?\s*assign\s+(\w+)\s*=/g;
|
|
265
|
+
let match;
|
|
266
|
+
while ((match = assignRegex.exec(this.source)) !== null) {
|
|
267
|
+
const [, variableName] = match;
|
|
268
|
+
const line = this.getLineNumber(match.index);
|
|
269
|
+
// Create a variable node
|
|
270
|
+
const nodeId = (0, tree_sitter_helpers_1.generateNodeId)(this.filePath, 'variable', variableName, line);
|
|
271
|
+
const node = {
|
|
272
|
+
id: nodeId,
|
|
273
|
+
kind: 'variable',
|
|
274
|
+
name: variableName,
|
|
275
|
+
qualifiedName: `${this.filePath}::${variableName}`,
|
|
276
|
+
filePath: this.filePath,
|
|
277
|
+
language: 'liquid',
|
|
278
|
+
startLine: line,
|
|
279
|
+
endLine: line,
|
|
280
|
+
startColumn: match.index - this.getLineStart(line),
|
|
281
|
+
endColumn: match.index - this.getLineStart(line) + match[0].length,
|
|
282
|
+
updatedAt: Date.now(),
|
|
283
|
+
};
|
|
284
|
+
this.nodes.push(node);
|
|
285
|
+
// Add containment edge from file
|
|
286
|
+
this.edges.push({
|
|
287
|
+
source: fileNodeId,
|
|
288
|
+
target: nodeId,
|
|
289
|
+
kind: 'contains',
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Get the line number for a character index
|
|
295
|
+
*/
|
|
296
|
+
getLineNumber(index) {
|
|
297
|
+
const substring = this.source.substring(0, index);
|
|
298
|
+
return (substring.match(/\n/g) || []).length + 1;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Get the character index of the start of a line
|
|
302
|
+
*/
|
|
303
|
+
getLineStart(lineNumber) {
|
|
304
|
+
const lines = this.source.split('\n');
|
|
305
|
+
let index = 0;
|
|
306
|
+
for (let i = 0; i < lineNumber - 1 && i < lines.length; i++) {
|
|
307
|
+
index += lines[i].length + 1; // +1 for newline
|
|
308
|
+
}
|
|
309
|
+
return index;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
exports.LiquidExtractor = LiquidExtractor;
|
|
313
|
+
//# sourceMappingURL=liquid-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquid-extractor.js","sourceRoot":"","sources":["../../src/extraction/liquid-extractor.ts"],"names":[],"mappings":";;;AACA,+DAAuD;AAEvD;;;;;;;;GAQG;AACH,MAAa,eAAe;IAClB,QAAQ,CAAS;IACjB,MAAM,CAAS;IACf,KAAK,GAAW,EAAE,CAAC;IACnB,KAAK,GAAW,EAAE,CAAC;IACnB,oBAAoB,GAA0B,EAAE,CAAC;IACjD,MAAM,GAAsB,EAAE,CAAC;IAEvC,YAAY,QAAgB,EAAE,MAAc;QAC1C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM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M,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAClD,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACK,YAAY,CAAC,UAAkB;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5D,KAAK,IAAI,KAAK,CAAC,CAAC,CAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,iBAAiB;QAClD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAnVD,0CAmVC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-worker.d.ts","sourceRoot":"","sources":["../../src/extraction/parse-worker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Parse Worker
|
|
4
|
+
*
|
|
5
|
+
* Runs tree-sitter parsing in a separate thread so the main thread
|
|
6
|
+
* stays unblocked and the UI animation renders smoothly.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const worker_threads_1 = require("worker_threads");
|
|
10
|
+
const tree_sitter_1 = require("./tree-sitter");
|
|
11
|
+
const grammars_1 = require("./grammars");
|
|
12
|
+
// Emscripten prints `Aborted()` (and a follow-up RuntimeError diag
|
|
13
|
+
// line) directly to stderr when WASM aborts — before the JS catch
|
|
14
|
+
// runs. Worker stderr is inherited by the parent, so each crash leaks
|
|
15
|
+
// a noise line to the user's terminal even though the JS layer
|
|
16
|
+
// already handles the failure cleanly. Filter these specific lines
|
|
17
|
+
// out at the source. Real diagnostic output (anything we log
|
|
18
|
+
// ourselves) goes through console.* / parentPort and is unaffected.
|
|
19
|
+
//
|
|
20
|
+
// Caveats deliberately accepted:
|
|
21
|
+
// - Per-call match: each `write()` call is matched in isolation.
|
|
22
|
+
// If Emscripten ever splits `Aborted(` across two write()s (it
|
|
23
|
+
// doesn't today — synchronous abort prints the whole line at
|
|
24
|
+
// once via libc puts) the first fragment would leak. Buffering
|
|
25
|
+
// across calls would add complexity for a hypothetical case.
|
|
26
|
+
// - Substring exactness: the prefix `Aborted(` is the literal
|
|
27
|
+
// Emscripten signature. Any user code that legitimately writes
|
|
28
|
+
// a stderr line starting with that prefix would also be filtered;
|
|
29
|
+
// in practice no real diagnostic does.
|
|
30
|
+
{
|
|
31
|
+
const realWrite = process.stderr.write.bind(process.stderr);
|
|
32
|
+
process.stderr.write = ((chunk, encoding, cb) => {
|
|
33
|
+
const s = typeof chunk === 'string' ? chunk : Buffer.from(chunk).toString('utf-8');
|
|
34
|
+
if (s.startsWith('Aborted(') ||
|
|
35
|
+
s.includes('Build with -sASSERTIONS for more info')) {
|
|
36
|
+
// Honour the Writable stream contract: callbacks must always
|
|
37
|
+
// fire even when the write is suppressed, or upstream code
|
|
38
|
+
// waiting on the drain signal would hang. Both overload forms
|
|
39
|
+
// are handled (`(chunk, cb)` and `(chunk, encoding, cb)`).
|
|
40
|
+
if (typeof encoding === 'function')
|
|
41
|
+
encoding();
|
|
42
|
+
else if (cb)
|
|
43
|
+
cb();
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
return realWrite(chunk, encoding, cb);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
const PARSER_RESET_INTERVAL = 5000;
|
|
50
|
+
const parseCounts = new Map();
|
|
51
|
+
worker_threads_1.parentPort.on('message', async (msg) => {
|
|
52
|
+
if (msg.type === 'load-grammars') {
|
|
53
|
+
await (0, grammars_1.loadGrammarsForLanguages)(msg.languages);
|
|
54
|
+
worker_threads_1.parentPort.postMessage({ type: 'grammars-loaded' });
|
|
55
|
+
}
|
|
56
|
+
else if (msg.type === 'parse') {
|
|
57
|
+
const { id, filePath, content, frameworkNames } = msg;
|
|
58
|
+
try {
|
|
59
|
+
const language = (0, grammars_1.detectLanguage)(filePath, content);
|
|
60
|
+
const result = (0, tree_sitter_1.extractFromSource)(filePath, content, language, frameworkNames);
|
|
61
|
+
// Periodic parser reset to reclaim WASM heap memory
|
|
62
|
+
const count = (parseCounts.get(language) ?? 0) + 1;
|
|
63
|
+
parseCounts.set(language, count);
|
|
64
|
+
if (count % PARSER_RESET_INTERVAL === 0) {
|
|
65
|
+
(0, grammars_1.resetParser)(language);
|
|
66
|
+
}
|
|
67
|
+
worker_threads_1.parentPort.postMessage({ type: 'parse-result', id, result });
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
71
|
+
// WASM memory errors leave the module in a corrupted state — all
|
|
72
|
+
// subsequent parses would also fail (cascading failures). Crash the
|
|
73
|
+
// worker so the main thread spawns a fresh one with a clean heap.
|
|
74
|
+
if (message.includes('memory access out of bounds') || message.includes('out of memory')) {
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
worker_threads_1.parentPort.postMessage({
|
|
78
|
+
type: 'parse-result',
|
|
79
|
+
id,
|
|
80
|
+
result: {
|
|
81
|
+
nodes: [],
|
|
82
|
+
edges: [],
|
|
83
|
+
unresolvedReferences: [],
|
|
84
|
+
errors: [{ message: `Parse worker error: ${message}`, filePath: filePath, severity: 'error', code: 'parse_error' }],
|
|
85
|
+
durationMs: 0,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else if (msg.type === 'shutdown') {
|
|
91
|
+
worker_threads_1.parentPort.postMessage({ type: 'shutdown-ack' });
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=parse-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-worker.js","sourceRoot":"","sources":["../../src/extraction/parse-worker.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,mDAA4C;AAC5C,+CAAkD;AAClD,yCAAmF;AAGnF,mEAAmE;AACnE,kEAAkE;AAClE,sEAAsE;AACtE,+DAA+D;AAC/D,mEAAmE;AACnE,6DAA6D;AAC7D,oEAAoE;AACpE,EAAE;AACF,iCAAiC;AACjC,mEAAmE;AACnE,mEAAmE;AACnE,iEAAiE;AACjE,mEAAmE;AACnE,iEAAiE;AACjE,gEAAgE;AAChE,mEAAmE;AACnE,sEAAsE;AACtE,2CAA2C;AAC3C,CAAC;IACC,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5D,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CACtB,KAA0B,EAC1B,QAA0D,EAC1D,EAAiC,EACxB,EAAE;QACX,MAAM,CAAC,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACnF,IACE,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;YACxB,CAAC,CAAC,QAAQ,CAAC,uCAAuC,CAAC,EACnD,CAAC;YACD,6DAA6D;YAC7D,2DAA2D;YAC3D,8DAA8D;YAC9D,2DAA2D;YAC3D,IAAI,OAAO,QAAQ,KAAK,UAAU;gBAAE,QAAQ,EAAE,CAAC;iBAC1C,IAAI,EAAE;gBAAE,EAAE,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,SAAS,CAAC,KAAc,EAAE,QAAiB,EAAE,EAAW,CAAC,CA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C,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAEjE,iEAAiE;YACjE,oEAAoE;YACpE,kEAAkE;YAClE,IAAI,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;gBACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YAED,2BAAW,CAAC,WAAW,CAAC;gBACtB,IAAI,EAAE,cAAc;gBACpB,EAAE;gBACF,MAAM,EAAE;oBACN,KAAK,EAAE,EAAE;oBACT,KAAK,EAAE,EAAE;oBACT,oBAAoB,EAAE,EAAE;oBACxB,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,uBAAuB,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;oBACpH,UAAU,EAAE,CAAC;iBACa;aAC7B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;SAAM,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACnC,2BAAW,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACpD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ExtractionResult } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* SvelteExtractor - Extracts code relationships from Svelte component files
|
|
4
|
+
*
|
|
5
|
+
* Svelte files are multi-language (script + template + style). Rather than
|
|
6
|
+
* parsing the full Svelte grammar, we extract the <script> block content
|
|
7
|
+
* and delegate it to the TypeScript/JavaScript TreeSitterExtractor.
|
|
8
|
+
*
|
|
9
|
+
* Also extracts function calls from template expressions (`{fn(...)}`) so
|
|
10
|
+
* cross-file call edges are captured even when calls live in markup.
|
|
11
|
+
*
|
|
12
|
+
* Every .svelte file produces a component node (Svelte components are always importable).
|
|
13
|
+
*/
|
|
14
|
+
export declare class SvelteExtractor {
|
|
15
|
+
private filePath;
|
|
16
|
+
private source;
|
|
17
|
+
private nodes;
|
|
18
|
+
private edges;
|
|
19
|
+
private unresolvedReferences;
|
|
20
|
+
private errors;
|
|
21
|
+
constructor(filePath: string, source: string);
|
|
22
|
+
/**
|
|
23
|
+
* Extract from Svelte source
|
|
24
|
+
*/
|
|
25
|
+
extract(): ExtractionResult;
|
|
26
|
+
/**
|
|
27
|
+
* Create a component node for the .svelte file
|
|
28
|
+
*/
|
|
29
|
+
private createComponentNode;
|
|
30
|
+
/**
|
|
31
|
+
* Extract <script> blocks from the Svelte source
|
|
32
|
+
*/
|
|
33
|
+
private extractScriptBlocks;
|
|
34
|
+
/**
|
|
35
|
+
* Process a script block by delegating to TreeSitterExtractor
|
|
36
|
+
*/
|
|
37
|
+
private processScriptBlock;
|
|
38
|
+
/**
|
|
39
|
+
* Extract function calls from Svelte template expressions.
|
|
40
|
+
*
|
|
41
|
+
* In Svelte, many function calls happen in markup (e.g., `class={cn(...)}`),
|
|
42
|
+
* not inside `<script>` blocks. We scan the template portion for `{expression}`
|
|
43
|
+
* blocks and extract call patterns from them.
|
|
44
|
+
*/
|
|
45
|
+
private extractTemplateCalls;
|
|
46
|
+
/**
|
|
47
|
+
* Extract component usages from the Svelte template.
|
|
48
|
+
*
|
|
49
|
+
* PascalCase tags like <Modal>, <Button />, <DevServerPreview> represent
|
|
50
|
+
* component instantiations — analogous to function calls in imperative code.
|
|
51
|
+
* Capturing these creates graph edges from parent to child components and
|
|
52
|
+
* gives codegraph_explore anchor points in the template markup.
|
|
53
|
+
*/
|
|
54
|
+
private extractTemplateComponents;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=svelte-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svelte-extractor.d.ts","sourceRoot":"","sources":["../../src/extraction/svelte-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,gBAAgB,EAAkD,MAAM,UAAU,CAAC;AAWxG;;;;;;;;;;;GAWG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,MAAM,CAAyB;gBAE3B,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAK5C;;OAEG;IACH,OAAO,IAAI,gBAAgB;IAyC3B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAyB3B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA6C3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA4D1B;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB;IAqD5B;;;;;;;OAOG;IACH,OAAO,CAAC,yBAAyB;CAmClC"}
|