@shapeshift-labs/frontier-lang-css 0.1.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/LICENSE +21 -0
- package/README.md +233 -0
- package/bench/smoke.mjs +25 -0
- package/benchmarks/package-bench.mjs +1 -0
- package/dist/css-modules.js +205 -0
- package/dist/index.d.ts +226 -0
- package/dist/index.js +258 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) ShapeShift Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# @shapeshift-labs/frontier-lang-css
|
|
2
|
+
|
|
3
|
+
CSS semantic merge evidence and projection adapter for Frontier Lang semantic source documents.
|
|
4
|
+
|
|
5
|
+
This package is runtime-neutral. It emits deterministic CSS from Frontier Lang documents and builds source-bound CSS rule evidence for merge admission. It also records CSS Modules and ICSS evidence for local class exports, generated class-name maps, `composes`, `:local`, `:global`, and `:import` / `:export` token edges. Browser cascade, layout, rendering, font loading, animation timing, generated-name transforms, and JS/TS use-site equivalence remain explicit proof gaps unless a host supplies stronger evidence.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Related Packages
|
|
9
|
+
|
|
10
|
+
The published Frontier package family is generated from one shared package catalog so READMEs stay in sync across packages:
|
|
11
|
+
|
|
12
|
+
- [`@shapeshift-labs/frontier`](https://www.npmjs.com/package/@shapeshift-labs/frontier): Core JSON diff/apply, compact patch tuples, JSON Pointer, equality, clone, validation, Unicode helpers, and tiny dependency-free runtime budget/scheduler primitives.
|
|
13
|
+
- [`@shapeshift-labs/frontier-query`](https://www.npmjs.com/package/@shapeshift-labs/frontier-query): Shared query-key, selector path, condition, entity identity, and table-shape primitives.
|
|
14
|
+
- [`@shapeshift-labs/frontier-codec`](https://www.npmjs.com/package/@shapeshift-labs/frontier-codec): Patch serialization, binary frames, canonical JSON, and patch-history codecs.
|
|
15
|
+
- [`@shapeshift-labs/frontier-engine`](https://www.npmjs.com/package/@shapeshift-labs/frontier-engine): Stateful planned diff engine, adaptive profiles, schema plans, and engine-level history helpers.
|
|
16
|
+
- [`@shapeshift-labs/frontier-state`](https://www.npmjs.com/package/@shapeshift-labs/frontier-state): Patch-routed app-state subscriptions, owned commits, maintained views, and path mapping.
|
|
17
|
+
- [`@shapeshift-labs/frontier-dataflow`](https://www.npmjs.com/package/@shapeshift-labs/frontier-dataflow): Serializable incremental dataflow and materialized-view graphs for Frontier apps, including selectors, dependency DAGs, filters, joins, aggregations, stale paths, recompute budgets, output patches, provenance records, and proof of why derived views changed.
|
|
18
|
+
- [`@shapeshift-labs/frontier-state-cache`](https://www.npmjs.com/package/@shapeshift-labs/frontier-state-cache): Normalized query-result cache with entity/query watchers, persistence, change logs, optimistic layers, scheduled persistence, and mutation bridge.
|
|
19
|
+
- [`@shapeshift-labs/frontier-state-cache-idb`](https://www.npmjs.com/package/@shapeshift-labs/frontier-state-cache-idb): IndexedDB persistence adapter for Frontier state-cache snapshots and durable change logs.
|
|
20
|
+
- [`@shapeshift-labs/frontier-state-cache-file`](https://www.npmjs.com/package/@shapeshift-labs/frontier-state-cache-file): Structured file persistence adapter for Frontier state-cache snapshots and change logs.
|
|
21
|
+
- [`@shapeshift-labs/frontier-state-cache-sql`](https://www.npmjs.com/package/@shapeshift-labs/frontier-state-cache-sql): SQL persistence adapter for Frontier state-cache snapshots and change logs.
|
|
22
|
+
- [`@shapeshift-labs/frontier-schema`](https://www.npmjs.com/package/@shapeshift-labs/frontier-schema): JSON Schema validation, Frontier profile generation, CloudEvent envelopes, and query/table schema helpers.
|
|
23
|
+
- [`@shapeshift-labs/frontier-migrations`](https://www.npmjs.com/package/@shapeshift-labs/frontier-migrations): Boundary-first data migrations, import normalization, plugin/API version mapping, versioned envelopes, graph diagnostics, patch path rewrites, dry-run reports, and current-shape rehydration.
|
|
24
|
+
- [`@shapeshift-labs/frontier-event-log`](https://www.npmjs.com/package/@shapeshift-labs/frontier-event-log): Bounded event logs, replay cursors, consumer acknowledgements, keyed compaction, checkpoints, and Frontier patch event records.
|
|
25
|
+
- [`@shapeshift-labs/frontier-run`](https://www.npmjs.com/package/@shapeshift-labs/frontier-run): Append-only distributed run graphs, causal event DAGs, evidence nodes, lanes, leases, refs, segments, dashboard projections, and admission decision records for Frontier agent work.
|
|
26
|
+
- [`@shapeshift-labs/frontier-lease`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lease): Runtime-neutral semantic, file, package, and repository lease claims with fencing tokens, expiry, conflict checks, apply validation, and replayable evidence for Frontier collaboration.
|
|
27
|
+
- [`@shapeshift-labs/frontier-inspect`](https://www.npmjs.com/package/@shapeshift-labs/frontier-inspect): Cross-package inspection/evidence bundles, registry graph snapshots, feature/resource impact reports, timeline/event normalization, redaction, JSONL import/export, and AI-readable app feature maps.
|
|
28
|
+
- [`@shapeshift-labs/frontier-scheduler`](https://www.npmjs.com/package/@shapeshift-labs/frontier-scheduler): Deterministic work scheduling, lanes, cancellation, backpressure, frame policies, replay snapshots, and work graphs.
|
|
29
|
+
- [`@shapeshift-labs/frontier-logging`](https://www.npmjs.com/package/@shapeshift-labs/frontier-logging): Opt-in structured logging, browser telemetry, scheduled sinks, file sinks, exporters, benchmark traces, and Frontier patch/update summaries.
|
|
30
|
+
- [`@shapeshift-labs/frontier-mutation`](https://www.npmjs.com/package/@shapeshift-labs/frontier-mutation): Explicit mutation and selector plans compiled to Frontier patches or CRDT operations.
|
|
31
|
+
- [`@shapeshift-labs/frontier-effects`](https://www.npmjs.com/package/@shapeshift-labs/frontier-effects): Serializable effect descriptors and resource graphs for Frontier apps, including fetch, storage, timers, navigation, workers, clipboard, broadcast, WebSocket, stream, policy metadata, runtime records, redaction, JSONL, proof helpers, and registry graph output.
|
|
32
|
+
- [`@shapeshift-labs/frontier-auth`](https://www.npmjs.com/package/@shapeshift-labs/frontier-auth): Frontier-native auth contracts for providers, sessions, profile completeness, route and resource gates, account-linking policy, token issue/verify plans, runtime grants, audit events, registry graphs, lint resources, and auth evidence without owning app secrets, crypto, storage, or provider SDKs.
|
|
33
|
+
- [`@shapeshift-labs/frontier-policy`](https://www.npmjs.com/package/@shapeshift-labs/frontier-policy): Serializable policy and capability decisions for Frontier apps, effects, views, sync, routes, traces, and AI tools.
|
|
34
|
+
- [`@shapeshift-labs/frontier-flags`](https://www.npmjs.com/package/@shapeshift-labs/frontier-flags): Patchable policy-aware feature flag state for Frontier apps, including targeting, deterministic rollouts, experiment variants, kill switches, exposure records, audit logs, and replay evidence.
|
|
35
|
+
- [`@shapeshift-labs/frontier-tools`](https://www.npmjs.com/package/@shapeshift-labs/frontier-tools): Serializable app action/tool manifests for AI-operable Frontier apps, including availability, validation, dry-run plans, patch previews, effect/tool constraints, execution records, rollback links, and registry graph output.
|
|
36
|
+
- [`@shapeshift-labs/frontier-sandbox`](https://www.npmjs.com/package/@shapeshift-labs/frontier-sandbox): Runtime-agnostic sandbox contracts for Frontier patch-producing actions, including manifests, declared reads/writes/capabilities, host-validated patch/effect/event/log results, dynamic source modules, source event replay, and structural runtime adapters.
|
|
37
|
+
- [`@shapeshift-labs/frontier-sandbox-quickjs`](https://www.npmjs.com/package/@shapeshift-labs/frontier-sandbox-quickjs): QuickJS/WebAssembly runtime adapter for Frontier sandbox actions, including invocation/runtime isolation modes, deadline and memory limits, dynamic source execution, and patch/effect result normalization.
|
|
38
|
+
- [`@shapeshift-labs/frontier-workflow`](https://www.npmjs.com/package/@shapeshift-labs/frontier-workflow): Serializable durable workflow/process manifests for Frontier apps, including steps, waits, approvals, timers, retries, expected patches, compensation, records, timelines, and registry graph output.
|
|
39
|
+
- [`@shapeshift-labs/frontier-worker`](https://www.npmjs.com/package/@shapeshift-labs/frontier-worker): Serializable worker and edge task descriptors for Frontier apps, including queues, idempotency keys, retry and timeout policy, declared reads/writes/effects, snapshots, patch outputs, produced assets, execution records, logs, trace links, proof hashes, dedupe indexes, and registry graph output.
|
|
40
|
+
- [`@shapeshift-labs/frontier-queue`](https://www.npmjs.com/package/@shapeshift-labs/frontier-queue): Serializable durable queue state, leases, retries, dedupe keys, patch-carrying jobs, dead-letter records, replay evidence, and queue inspection for Frontier apps.
|
|
41
|
+
- [`@shapeshift-labs/frontier-swarm`](https://www.npmjs.com/package/@shapeshift-labs/frontier-swarm): Hierarchical swarm plans, lanes, compute profiles, ownership policy, semantic ownership regions, task queues, event streams, run records, merge bundles, merge indexes, queue overlays, merge admission, coordinator dashboards, changed-path checks, and proof artifacts for Frontier agent work.
|
|
42
|
+
- [`@shapeshift-labs/frontier-swarm-git`](https://www.npmjs.com/package/@shapeshift-labs/frontier-swarm-git): Node Git, workspace, patch, changed-path, write-fence, package-link repair, patch check, HEAD read, blob hash, and apply-ledger adapter for Frontier swarm runners.
|
|
43
|
+
- [`@shapeshift-labs/frontier-swarm-codex`](https://www.npmjs.com/package/@shapeshift-labs/frontier-swarm-codex): Node Codex CLI adapter for Frontier swarm plans, including prompt rendering, worktree and snapshot workspaces, Codex argument compatibility, browser resource allocation, JSONL capture, verification commands, pid-backed stop, collect/apply workflows, merge indexes, queue overlays, merge bundles, normalized job evidence, coordinator query artifacts, result artifacts, and run-log sync adapters.
|
|
44
|
+
- [`@shapeshift-labs/frontier-loom-ui`](https://www.npmjs.com/package/@shapeshift-labs/frontier-loom-ui): Read-only Loom and Frontier operator dashboard for workspace-lifetime progress, active agents, queue state, evidence/admission status, run events, run-log sync projections, semantic leases, gate executions, git apply/workspace evidence, and coordinator steering intent files.
|
|
45
|
+
- [`@shapeshift-labs/frontier-lang-kernel`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-kernel): Runtime-neutral semantic source graph, type/lattice/extern declarations, patch bundles, replay, hashing, evidence records, and merge-admission kernel for Frontier Lang.
|
|
46
|
+
- [`@shapeshift-labs/frontier-lang-parser`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-parser): Dependency-light Frontier Lang parser for modules, entities, state, actions, effects, types, externs, targets, and lattice declarations.
|
|
47
|
+
- [`@shapeshift-labs/frontier-lang-checker`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-checker): Checker and diagnostics for Frontier Lang semantic documents, including type symbols, effects, regions, lattice laws, CRDT metadata, and patch evidence.
|
|
48
|
+
- [`@shapeshift-labs/frontier-lang-typescript`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-typescript): TypeScript projection adapter for Frontier Lang semantic documents, including type/entity/state/action/extern declarations and CRDT lattice descriptors.
|
|
49
|
+
- [`@shapeshift-labs/frontier-lang-javascript`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-javascript): JavaScript projection adapter for Frontier Lang semantic documents, including ESM action stubs and schema/lattice descriptors.
|
|
50
|
+
- [`@shapeshift-labs/frontier-lang-html`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-html): HTML semantic merge evidence and projection adapter for Frontier Lang semantic documents, including element tree identity, attributes, text/comment spans, source maps, and fail-closed browser/runtime proof gaps.
|
|
51
|
+
- [`@shapeshift-labs/frontier-lang-rust`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-rust): Rust projection adapter for Frontier Lang semantic documents, including structs, aliases, and action stubs.
|
|
52
|
+
- [`@shapeshift-labs/frontier-lang-python`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-python): Python projection adapter for Frontier Lang semantic documents, including dataclasses, typed patch records, and action stubs.
|
|
53
|
+
- [`@shapeshift-labs/frontier-lang-c`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-c): C header projection adapter for Frontier Lang semantic documents, including structs and action prototypes.
|
|
54
|
+
- [`@shapeshift-labs/frontier-lang-compiler`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-compiler): Compiler facade for Frontier Lang source documents, including parse, check, hash, diagnostics, universal AST envelopes, proof/paradigm semantic summaries, projection to TypeScript, JavaScript, HTML, CSS, Rust, Python, and C, and native source-import adapters for semantic merge evidence.
|
|
55
|
+
- [`@shapeshift-labs/frontier-lang-swift`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-swift): Swift source-language importer package for Frontier Lang semantic documents, including package-level metadata, SwiftSyntax adapter helpers, native import results, and semantic sidecar generation for SwiftSyntax/SwiftParser-shaped syntax trees.
|
|
56
|
+
- [`@shapeshift-labs/frontier-lang-kotlin`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-kotlin): Kotlin PSI source-language importer package for Frontier Lang semantic documents, including package-level metadata, Kotlin PSI adapter helpers, native import results, and semantic sidecar generation for Kotlin PSI/KtFile-shaped syntax trees.
|
|
57
|
+
- [`@shapeshift-labs/frontier-lang-java`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-java): Java source-language importer package for Frontier Lang semantic documents, including package-level metadata, Java AST adapter helpers, native import results, and semantic sidecar generation for javac/JDT/JavaParser-shaped ASTs.
|
|
58
|
+
- [`@shapeshift-labs/frontier-lang-go`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-go): Go source-language importer package for Frontier Lang semantic documents, including package-level metadata, Go AST adapter helpers, native import results, and semantic sidecar generation for go/ast File or Package trees.
|
|
59
|
+
- [`@shapeshift-labs/frontier-lang-csharp`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-csharp): C# Roslyn source-language importer package for Frontier Lang semantic documents, including package-level metadata, Roslyn adapter helpers, native import results, and semantic sidecar generation for SyntaxTree/SyntaxNode-shaped ASTs.
|
|
60
|
+
- [`@shapeshift-labs/frontier-lang-clang`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-clang): Clang AST source-language importer package for Frontier Lang semantic documents, including package-level metadata, Clang AST JSON adapter helpers, native import results, and semantic sidecar generation for C/C++ translation units.
|
|
61
|
+
- [`@shapeshift-labs/frontier-lang-cli`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang-cli): Command line interface for parsing, checking, hashing, emitting, native source import/projection, semantic slicing, and corpus roundtrip evidence for Frontier Lang projects.
|
|
62
|
+
- [`@shapeshift-labs/frontier-lang`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lang): Umbrella package for Frontier Lang kernel, parser, checker, compiler facade, universal AST helpers, projection adapters, HTML/CSS semantic merge evidence adapters, and source-language importer adapters.
|
|
63
|
+
- [`@shapeshift-labs/frontier-kv`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv): Serializable in-memory key/value state for Frontier apps, including TTL, versioned compare-and-set, batched patch mutations, scans, watchers, snapshots, JSONL event evidence, and replay verification.
|
|
64
|
+
- [`@shapeshift-labs/frontier-kv-locks`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-locks): Lease-style lock records on top of Frontier KV, including acquire, renew, release, fencing tokens, expiration, owner evidence, and replayable lock events.
|
|
65
|
+
- [`@shapeshift-labs/frontier-kv-rate-limit`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-rate-limit): Patch-native rate limit buckets for Frontier KV, including fixed windows, sliding windows, token buckets, deterministic refill, consume evidence, and reset records.
|
|
66
|
+
- [`@shapeshift-labs/frontier-kv-file`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-file): Node file persistence adapter for Frontier KV snapshots and append-only JSONL event logs, including atomic writes, compaction, replay loading, and adapter evidence.
|
|
67
|
+
- [`@shapeshift-labs/frontier-kv-idb`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-idb): IndexedDB persistence adapter for Frontier KV snapshots and event logs, with structural IDB interfaces, upgrade planning, compact event storage, and replay loading.
|
|
68
|
+
- [`@shapeshift-labs/frontier-kv-redis`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-redis): Redis-compatible command planning and structural client adapter for Frontier KV operations, including key mapping, TTL commands, optimistic CAS scripts, and replay evidence without bundling Redis drivers.
|
|
69
|
+
- [`@shapeshift-labs/frontier-kv-server`](https://www.npmjs.com/package/@shapeshift-labs/frontier-kv-server): Small Node HTTP server adapter for Frontier KV, including request planning, JSON endpoints for get/set/delete/scan/batch, optional rate-limit hooks, and replayable response evidence.
|
|
70
|
+
- [`@shapeshift-labs/frontier-assets`](https://www.npmjs.com/package/@shapeshift-labs/frontier-assets): Serializable asset and content provenance graphs for Frontier apps, including source files, generated variants, thumbnails, LOD chunks, shader/material dependencies, transforms, hashes, owners, runtime consumers, review plans, registry graph output, and impact queries.
|
|
71
|
+
- [`@shapeshift-labs/frontier-blueprint`](https://www.npmjs.com/package/@shapeshift-labs/frontier-blueprint): Serializable Blueprint/Prefab flyweight templates for Frontier apps, including parameterized instantiation, deterministic ID/path remapping, compact overrides, variants, effective-state materialization, scene/state patch emission, dependency metadata, and registry graph output.
|
|
72
|
+
- [`@shapeshift-labs/frontier-triggers`](https://www.npmjs.com/package/@shapeshift-labs/frontier-triggers): Capability-gated event trigger registry, scoped event envelopes, listener/reaction rules, structured rejection, deterministic event-to-action scheduling, replay/provenance records, and registry graph output.
|
|
73
|
+
- [`@shapeshift-labs/frontier-virtual`](https://www.npmjs.com/package/@shapeshift-labs/frontier-virtual): DOM-neutral virtualization, layout providers, range materialization, grids, spatial/frustum indexes, patch invalidation, camera anchors, and serializable layout state.
|
|
74
|
+
- [`@shapeshift-labs/frontier-table`](https://www.npmjs.com/package/@shapeshift-labs/frontier-table): Renderer-neutral data grid and table primitives for Frontier apps, including stable row identity, sorting, filtering, selection, virtual ranges, patch-driven edits, cache/dataflow descriptors, and CRDT-compatible row and cell operation frames.
|
|
75
|
+
- [`@shapeshift-labs/frontier-scene`](https://www.npmjs.com/package/@shapeshift-labs/frontier-scene): Patch-native 2D/3D scene graph, transform propagation, bounds queries, virtual/culling adapters, spatial invalidation, and camera/frustum materialization.
|
|
76
|
+
- [`@shapeshift-labs/frontier-pathfinding`](https://www.npmjs.com/package/@shapeshift-labs/frontier-pathfinding): Patch-native grid pathfinding, typed-array A*/Dijkstra search, flow fields, connected components, line-of-sight smoothing, dirty-cell invalidation, and scheduler-friendly path jobs.
|
|
77
|
+
- [`@shapeshift-labs/frontier-lod`](https://www.npmjs.com/package/@shapeshift-labs/frontier-lod): Patch-native level-of-detail and significance selection for rendering and computation workloads, compact typed hot paths, multi-observer selection, budget degradation, materialization frames, and scheduler work plans.
|
|
78
|
+
- [`@shapeshift-labs/frontier-route`](https://www.npmjs.com/package/@shapeshift-labs/frontier-route): DOM-neutral app/game route resources, route and scene manifests, match/resolve/transition planning, dependency metadata, sessions, registry graph output, and impact queries.
|
|
79
|
+
- [`@shapeshift-labs/frontier-trace`](https://www.npmjs.com/package/@shapeshift-labs/frontier-trace): Serializable traces, spans, events, causal links, W3C trace context helpers, timeline/resource/path queries, critical-path analysis, registry graph output, JSONL/proof helpers, Chrome trace export, and redaction for app-wide feature observability.
|
|
80
|
+
- [`@shapeshift-labs/frontier-manifest`](https://www.npmjs.com/package/@shapeshift-labs/frontier-manifest): Build/static feature manifests for owners, routes, actions, states, migrations, tests, source files, assets, resources, tasks, dependency metadata, registry graph output, feature maps, JSONL export, and impact queries.
|
|
81
|
+
- [`@shapeshift-labs/frontier-view`](https://www.npmjs.com/package/@shapeshift-labs/frontier-view): Renderer-neutral view manifests, type defaults, validation frames, action bindings, visual channels, virtual/LOD hints, and data-to-representation mapping for Frontier apps.
|
|
82
|
+
- [`@shapeshift-labs/frontier-icons`](https://www.npmjs.com/package/@shapeshift-labs/frontier-icons): Renderer-neutral icon records, icon sets, lookup aliases, SVG frames, string rendering, and registry evidence for Frontier apps.
|
|
83
|
+
- [`@shapeshift-labs/frontier-design`](https://www.npmjs.com/package/@shapeshift-labs/frontier-design): Renderer-neutral design-system tokens, semantic roles, recipes, target style frames, CSS variable output, and registry graph evidence for Frontier apps.
|
|
84
|
+
- [`@shapeshift-labs/frontier-canvas`](https://www.npmjs.com/package/@shapeshift-labs/frontier-canvas): Renderer-neutral infinite canvas surfaces for Frontier apps, including camera and viewport math, pan/zoom plans, grid materialization, snapping, hit testing, selection handles, extensible tool dispatch, frame records, registry graph output, and impact/proof helpers.
|
|
85
|
+
- [`@shapeshift-labs/frontier-canvas-tools`](https://www.npmjs.com/package/@shapeshift-labs/frontier-canvas-tools): Renderer-neutral editor tools, state machines, transform handles, permissions, async records, and AI action bridges for Frontier canvas surfaces.
|
|
86
|
+
- [`@shapeshift-labs/frontier-dnd`](https://www.npmjs.com/package/@shapeshift-labs/frontier-dnd): Renderer-neutral drag-and-drop sessions, sensor descriptors, collision ranking, drop planning, reorder patches, state partitioning, and registry evidence for Frontier apps.
|
|
87
|
+
- [`@shapeshift-labs/frontier-dom`](https://www.npmjs.com/package/@shapeshift-labs/frontier-dom): Patch-native DOM and host renderer bindings, manifest hydration, JSX runtime/compiler helpers, SSR, devtools, and logging bridges.
|
|
88
|
+
- [`@shapeshift-labs/frontier-playwright`](https://www.npmjs.com/package/@shapeshift-labs/frontier-playwright): Playwright/headless automation probes for Frontier state, DOM, devtools, marks, and timeline queries.
|
|
89
|
+
- [`@shapeshift-labs/frontier-test`](https://www.npmjs.com/package/@shapeshift-labs/frontier-test): Serializable test/spec evidence manifests for Frontier apps, including fixtures, commands, expected patches/effects/routes/policies, coverage declarations, run plans, run records, report adapters, replay proofs, fuzzers, benchmarks, registry graph output, and impact queries.
|
|
90
|
+
- [`@shapeshift-labs/frontier-fixtures`](https://www.npmjs.com/package/@shapeshift-labs/frontier-fixtures): Deterministic fixture and scenario generation for Frontier apps, including schema-valid sample state, related entity collections, actor personas, route states, replay-verified patch streams, event records, JSONL bundles, and evidence summaries.
|
|
91
|
+
- [`@shapeshift-labs/frontier-component-preview`](https://www.npmjs.com/package/@shapeshift-labs/frontier-component-preview): Frontier-native component preview books, generated preview manifests, stateful variants, Vite virtual modules, standalone browser preview shells, inspector bridges, and preview harness evidence for Frontier apps.
|
|
92
|
+
- [`@shapeshift-labs/frontier-documentation`](https://www.npmjs.com/package/@shapeshift-labs/frontier-documentation): Frontier-native documentation manifests, generated documentation books, package/API/source discovery, Vite virtual modules, standalone browser docs shells, inspector bridges, search indexes, and documentation harness evidence for Frontier apps and packages.
|
|
93
|
+
- [`@shapeshift-labs/frontier-ast-walk`](https://www.npmjs.com/package/@shapeshift-labs/frontier-ast-walk): Dependency-light source graph, import/export/declaration/call analysis, Frontier package-use discovery, and business-logic placement findings for Frontier tools, apps, docs, fuzzers, benchmarks, and agent evidence.
|
|
94
|
+
- [`@shapeshift-labs/frontier-history`](https://www.npmjs.com/package/@shapeshift-labs/frontier-history): Serializable temporal explanation and causality records for Frontier apps, including field-change explanations, action/workflow/policy/effect/trace/test provenance, audit windows, undo planning, registry/provenance graph output, JSONL replay bundles, and proof hashes.
|
|
95
|
+
- [`@shapeshift-labs/frontier-application`](https://www.npmjs.com/package/@shapeshift-labs/frontier-application): Serializable whole-application graph and impact queries for Frontier apps, including features, owners, packages, routes, views, actions, mutations, state paths, effects, workers, assets, tests, traces, policies, workflows, migrations, benchmarks, registry graph output, feature maps, JSONL bundles, and proof hashes.
|
|
96
|
+
- [`@shapeshift-labs/frontier-linter`](https://www.npmjs.com/package/@shapeshift-labs/frontier-linter): Serializable Frontier lint rules, diagnostics, fixes, reports, and fast rule execution for package catalogs, registry graphs, application maps, manifests, traces, policies, workflows, workers, assets, tests, benchmarks, and source snippets.
|
|
97
|
+
- [`@shapeshift-labs/frontier-framework`](https://www.npmjs.com/package/@shapeshift-labs/frontier-framework): High-level app framework package for Frontier applications, including configuration, CLI scaffolding, Vite builds, monorepo layout, TSX route builds, split frontend/backend deploy artifacts, backend-neutral Fetch handler and sync transport contracts, runtime data-source migrations, devtools, harness gates, agent MCP/tool manifests, CI evidence gates, workflow manifests, SARIF/linter output, replay scripts, and evidence manifest output.
|
|
98
|
+
- [`@shapeshift-labs/frontier-crdt`](https://www.npmjs.com/package/@shapeshift-labs/frontier-crdt): Native CRDT documents, update tooling, awareness, branches, conflict introspection, version frames, and undo.
|
|
99
|
+
- [`@shapeshift-labs/frontier-crdt-sync`](https://www.npmjs.com/package/@shapeshift-labs/frontier-crdt-sync): CRDT sync endpoints, repo/storage/provider contracts, scheduled sync work, document URLs, local networks, model checking, forensics, and text binding contracts.
|
|
100
|
+
- [`@shapeshift-labs/frontier-crdt-websocket`](https://www.npmjs.com/package/@shapeshift-labs/frontier-crdt-websocket): WebSocket client/server transports for Frontier CRDT sync providers.
|
|
101
|
+
- [`@shapeshift-labs/frontier-react`](https://www.npmjs.com/package/@shapeshift-labs/frontier-react): React external-store hooks and adapters for Frontier state, cache, and CRDT surfaces.
|
|
102
|
+
- [`@shapeshift-labs/frontier-richtext`](https://www.npmjs.com/package/@shapeshift-labs/frontier-richtext): Rich text Delta normalization/application, marks, embeds, ranges, and cursor/selection transforms for local editor integrations.
|
|
103
|
+
- [`@shapeshift-labs/frontier-realtime`](https://www.npmjs.com/package/@shapeshift-labs/frontier-realtime): Shared realtime command, tick, snapshot, prediction, reconciliation, interpolation, rollback, message, and delta primitives.
|
|
104
|
+
- [`@shapeshift-labs/frontier-realtime-server`](https://www.npmjs.com/package/@shapeshift-labs/frontier-realtime-server): Authoritative realtime room, tick, command validation, rate-limit, session, and snapshot-history runtime.
|
|
105
|
+
- [`@shapeshift-labs/frontier-realtime-websocket`](https://www.npmjs.com/package/@shapeshift-labs/frontier-realtime-websocket): WebSocket client, wire, and Node room-server transport for Frontier realtime.
|
|
106
|
+
- [`@shapeshift-labs/frontier-game`](https://www.npmjs.com/package/@shapeshift-labs/frontier-game): Game-facing entity, component, player, room, ownership, spatial interest, rollback, physics, and replication helpers above realtime.
|
|
107
|
+
- [`@shapeshift-labs/loom`](https://www.npmjs.com/package/@shapeshift-labs/loom): Repo-level semantic collaboration CLI for .loom workspaces, including init, scan, status, graph snapshots, projection plans, Frontier Lang delegation, Frontier Swarm delegation, run-log sync command delegation, and Frontier Framework delegation.
|
|
108
|
+
|
|
109
|
+
Package source repositories:
|
|
110
|
+
|
|
111
|
+
- [`siliconjungle/-shapeshift-labs-frontier`](https://github.com/siliconjungle/-shapeshift-labs-frontier)
|
|
112
|
+
- [`siliconjungle/-shapeshift-labs-frontier-query`](https://github.com/siliconjungle/-shapeshift-labs-frontier-query)
|
|
113
|
+
- [`siliconjungle/-shapeshift-labs-frontier-codec`](https://github.com/siliconjungle/-shapeshift-labs-frontier-codec)
|
|
114
|
+
- [`siliconjungle/-shapeshift-labs-frontier-engine`](https://github.com/siliconjungle/-shapeshift-labs-frontier-engine)
|
|
115
|
+
- [`siliconjungle/-shapeshift-labs-frontier-state`](https://github.com/siliconjungle/-shapeshift-labs-frontier-state)
|
|
116
|
+
- [`siliconjungle/-shapeshift-labs-frontier-dataflow`](https://github.com/siliconjungle/-shapeshift-labs-frontier-dataflow)
|
|
117
|
+
- [`siliconjungle/-shapeshift-labs-frontier-state-cache`](https://github.com/siliconjungle/-shapeshift-labs-frontier-state-cache)
|
|
118
|
+
- [`siliconjungle/-shapeshift-labs-frontier-state-cache-idb`](https://github.com/siliconjungle/-shapeshift-labs-frontier-state-cache-idb)
|
|
119
|
+
- [`siliconjungle/-shapeshift-labs-frontier-state-cache-file`](https://github.com/siliconjungle/-shapeshift-labs-frontier-state-cache-file)
|
|
120
|
+
- [`siliconjungle/-shapeshift-labs-frontier-state-cache-sql`](https://github.com/siliconjungle/-shapeshift-labs-frontier-state-cache-sql)
|
|
121
|
+
- [`siliconjungle/-shapeshift-labs-frontier-schema`](https://github.com/siliconjungle/-shapeshift-labs-frontier-schema)
|
|
122
|
+
- [`siliconjungle/-shapeshift-labs-frontier-migrations`](https://github.com/siliconjungle/-shapeshift-labs-frontier-migrations)
|
|
123
|
+
- [`siliconjungle/-shapeshift-labs-frontier-event-log`](https://github.com/siliconjungle/-shapeshift-labs-frontier-event-log)
|
|
124
|
+
- [`siliconjungle/-shapeshift-labs-frontier-run`](https://github.com/siliconjungle/-shapeshift-labs-frontier-run)
|
|
125
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lease`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lease)
|
|
126
|
+
- [`siliconjungle/-shapeshift-labs-frontier-inspect`](https://github.com/siliconjungle/-shapeshift-labs-frontier-inspect)
|
|
127
|
+
- [`siliconjungle/-shapeshift-labs-frontier-scheduler`](https://github.com/siliconjungle/-shapeshift-labs-frontier-scheduler)
|
|
128
|
+
- [`siliconjungle/-shapeshift-labs-frontier-logging`](https://github.com/siliconjungle/-shapeshift-labs-frontier-logging)
|
|
129
|
+
- [`siliconjungle/-shapeshift-labs-frontier-mutation`](https://github.com/siliconjungle/-shapeshift-labs-frontier-mutation)
|
|
130
|
+
- [`siliconjungle/-shapeshift-labs-frontier-effects`](https://github.com/siliconjungle/-shapeshift-labs-frontier-effects)
|
|
131
|
+
- [`siliconjungle/-shapeshift-labs-frontier-auth`](https://github.com/siliconjungle/-shapeshift-labs-frontier-auth)
|
|
132
|
+
- [`siliconjungle/-shapeshift-labs-frontier-policy`](https://github.com/siliconjungle/-shapeshift-labs-frontier-policy)
|
|
133
|
+
- [`siliconjungle/-shapeshift-labs-frontier-flags`](https://github.com/siliconjungle/-shapeshift-labs-frontier-flags)
|
|
134
|
+
- [`siliconjungle/-shapeshift-labs-frontier-tools`](https://github.com/siliconjungle/-shapeshift-labs-frontier-tools)
|
|
135
|
+
- [`siliconjungle/-shapeshift-labs-frontier-sandbox`](https://github.com/siliconjungle/-shapeshift-labs-frontier-sandbox)
|
|
136
|
+
- [`siliconjungle/-shapeshift-labs-frontier-sandbox-quickjs`](https://github.com/siliconjungle/-shapeshift-labs-frontier-sandbox-quickjs)
|
|
137
|
+
- [`siliconjungle/-shapeshift-labs-frontier-workflow`](https://github.com/siliconjungle/-shapeshift-labs-frontier-workflow)
|
|
138
|
+
- [`siliconjungle/-shapeshift-labs-frontier-worker`](https://github.com/siliconjungle/-shapeshift-labs-frontier-worker)
|
|
139
|
+
- [`siliconjungle/-shapeshift-labs-frontier-queue`](https://github.com/siliconjungle/-shapeshift-labs-frontier-queue)
|
|
140
|
+
- [`siliconjungle/-shapeshift-labs-frontier-swarm`](https://github.com/siliconjungle/-shapeshift-labs-frontier-swarm)
|
|
141
|
+
- [`siliconjungle/-shapeshift-labs-frontier-swarm-git`](https://github.com/siliconjungle/-shapeshift-labs-frontier-swarm-git)
|
|
142
|
+
- [`siliconjungle/-shapeshift-labs-frontier-swarm-codex`](https://github.com/siliconjungle/-shapeshift-labs-frontier-swarm-codex)
|
|
143
|
+
- [`siliconjungle/frontier-loom-ui`](https://github.com/siliconjungle/frontier-loom-ui)
|
|
144
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-kernel`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-kernel)
|
|
145
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-parser`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-parser)
|
|
146
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-checker`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-checker)
|
|
147
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-typescript`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-typescript)
|
|
148
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-javascript`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-javascript)
|
|
149
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-html`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-html)
|
|
150
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-css`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-css)
|
|
151
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-rust`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-rust)
|
|
152
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-python`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-python)
|
|
153
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-c`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-c)
|
|
154
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-compiler`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-compiler)
|
|
155
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-swift`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-swift)
|
|
156
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-kotlin`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-kotlin)
|
|
157
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-java`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-java)
|
|
158
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-go`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-go)
|
|
159
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-csharp`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-csharp)
|
|
160
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-clang`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-clang)
|
|
161
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang-cli`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-cli)
|
|
162
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lang`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lang)
|
|
163
|
+
- [`siliconjungle/-shapeshift-labs-frontier-kv`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv)
|
|
164
|
+
- [`siliconjungle/-shapeshift-labs-frontier-kv-locks`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-locks)
|
|
165
|
+
- [`siliconjungle/-shapeshift-labs-frontier-kv-rate-limit`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-rate-limit)
|
|
166
|
+
- [`siliconjungle/-shapeshift-labs-frontier-kv-file`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-file)
|
|
167
|
+
- [`siliconjungle/-shapeshift-labs-frontier-kv-idb`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-idb)
|
|
168
|
+
- [`siliconjungle/-shapeshift-labs-frontier-kv-redis`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-redis)
|
|
169
|
+
- [`siliconjungle/-shapeshift-labs-frontier-kv-server`](https://github.com/siliconjungle/-shapeshift-labs-frontier-kv-server)
|
|
170
|
+
- [`siliconjungle/-shapeshift-labs-frontier-assets`](https://github.com/siliconjungle/-shapeshift-labs-frontier-assets)
|
|
171
|
+
- [`siliconjungle/-shapeshift-labs-frontier-blueprint`](https://github.com/siliconjungle/-shapeshift-labs-frontier-blueprint)
|
|
172
|
+
- [`siliconjungle/-shapeshift-labs-frontier-triggers`](https://github.com/siliconjungle/-shapeshift-labs-frontier-triggers)
|
|
173
|
+
- [`siliconjungle/-shapeshift-labs-frontier-virtual`](https://github.com/siliconjungle/-shapeshift-labs-frontier-virtual)
|
|
174
|
+
- [`siliconjungle/-shapeshift-labs-frontier-table`](https://github.com/siliconjungle/-shapeshift-labs-frontier-table)
|
|
175
|
+
- [`siliconjungle/-shapeshift-labs-frontier-scene`](https://github.com/siliconjungle/-shapeshift-labs-frontier-scene)
|
|
176
|
+
- [`siliconjungle/-shapeshift-labs-frontier-pathfinding`](https://github.com/siliconjungle/-shapeshift-labs-frontier-pathfinding)
|
|
177
|
+
- [`siliconjungle/-shapeshift-labs-frontier-lod`](https://github.com/siliconjungle/-shapeshift-labs-frontier-lod)
|
|
178
|
+
- [`siliconjungle/-shapeshift-labs-frontier-route`](https://github.com/siliconjungle/-shapeshift-labs-frontier-route)
|
|
179
|
+
- [`siliconjungle/-shapeshift-labs-frontier-trace`](https://github.com/siliconjungle/-shapeshift-labs-frontier-trace)
|
|
180
|
+
- [`siliconjungle/-shapeshift-labs-frontier-manifest`](https://github.com/siliconjungle/-shapeshift-labs-frontier-manifest)
|
|
181
|
+
- [`siliconjungle/-shapeshift-labs-frontier-view`](https://github.com/siliconjungle/-shapeshift-labs-frontier-view)
|
|
182
|
+
- [`siliconjungle/-shapeshift-labs-frontier-icons`](https://github.com/siliconjungle/-shapeshift-labs-frontier-icons)
|
|
183
|
+
- [`siliconjungle/-shapeshift-labs-frontier-design`](https://github.com/siliconjungle/-shapeshift-labs-frontier-design)
|
|
184
|
+
- [`siliconjungle/-shapeshift-labs-frontier-canvas`](https://github.com/siliconjungle/-shapeshift-labs-frontier-canvas)
|
|
185
|
+
- [`siliconjungle/-shapeshift-labs-frontier-canvas-tools`](https://github.com/siliconjungle/-shapeshift-labs-frontier-canvas-tools)
|
|
186
|
+
- [`siliconjungle/-shapeshift-labs-frontier-dnd`](https://github.com/siliconjungle/-shapeshift-labs-frontier-dnd)
|
|
187
|
+
- [`siliconjungle/-shapeshift-labs-frontier-dom`](https://github.com/siliconjungle/-shapeshift-labs-frontier-dom)
|
|
188
|
+
- [`siliconjungle/-shapeshift-labs-frontier-playwright`](https://github.com/siliconjungle/-shapeshift-labs-frontier-playwright)
|
|
189
|
+
- [`siliconjungle/-shapeshift-labs-frontier-test`](https://github.com/siliconjungle/-shapeshift-labs-frontier-test)
|
|
190
|
+
- [`siliconjungle/-shapeshift-labs-frontier-fixtures`](https://github.com/siliconjungle/-shapeshift-labs-frontier-fixtures)
|
|
191
|
+
- [`siliconjungle/-shapeshift-labs-frontier-component-preview`](https://github.com/siliconjungle/-shapeshift-labs-frontier-component-preview)
|
|
192
|
+
- [`siliconjungle/-shapeshift-labs-frontier-documentation`](https://github.com/siliconjungle/-shapeshift-labs-frontier-documentation)
|
|
193
|
+
- [`siliconjungle/-shapeshift-labs-frontier-ast-walk`](https://github.com/siliconjungle/-shapeshift-labs-frontier-ast-walk)
|
|
194
|
+
- [`siliconjungle/-shapeshift-labs-frontier-history`](https://github.com/siliconjungle/-shapeshift-labs-frontier-history)
|
|
195
|
+
- [`siliconjungle/-shapeshift-labs-frontier-application`](https://github.com/siliconjungle/-shapeshift-labs-frontier-application)
|
|
196
|
+
- [`siliconjungle/-shapeshift-labs-frontier-linter`](https://github.com/siliconjungle/-shapeshift-labs-frontier-linter)
|
|
197
|
+
- [`siliconjungle/-shapeshift-labs-frontier-framework`](https://github.com/siliconjungle/-shapeshift-labs-frontier-framework)
|
|
198
|
+
- [`siliconjungle/-shapeshift-labs-frontier-crdt`](https://github.com/siliconjungle/-shapeshift-labs-frontier-crdt)
|
|
199
|
+
- [`siliconjungle/-shapeshift-labs-frontier-crdt-sync`](https://github.com/siliconjungle/-shapeshift-labs-frontier-crdt-sync)
|
|
200
|
+
- [`siliconjungle/-shapeshift-labs-frontier-crdt-websocket`](https://github.com/siliconjungle/-shapeshift-labs-frontier-crdt-websocket)
|
|
201
|
+
- [`siliconjungle/-shapeshift-labs-frontier-react`](https://github.com/siliconjungle/-shapeshift-labs-frontier-react)
|
|
202
|
+
- [`siliconjungle/-shapeshift-labs-frontier-richtext`](https://github.com/siliconjungle/-shapeshift-labs-frontier-richtext)
|
|
203
|
+
- [`siliconjungle/-shapeshift-labs-frontier-realtime`](https://github.com/siliconjungle/-shapeshift-labs-frontier-realtime)
|
|
204
|
+
- [`siliconjungle/-shapeshift-labs-frontier-realtime-server`](https://github.com/siliconjungle/-shapeshift-labs-frontier-realtime-server)
|
|
205
|
+
- [`siliconjungle/-shapeshift-labs-frontier-realtime-websocket`](https://github.com/siliconjungle/-shapeshift-labs-frontier-realtime-websocket)
|
|
206
|
+
- [`siliconjungle/-shapeshift-labs-frontier-game`](https://github.com/siliconjungle/-shapeshift-labs-frontier-game)
|
|
207
|
+
- [`siliconjungle/-shapeshift-labs-loom`](https://github.com/siliconjungle/-shapeshift-labs-loom)
|
|
208
|
+
|
|
209
|
+
## Usage
|
|
210
|
+
|
|
211
|
+
```js
|
|
212
|
+
import {
|
|
213
|
+
createCssSemanticMergeEvidence,
|
|
214
|
+
emitCssWithSourceMap
|
|
215
|
+
} from '@shapeshift-labs/frontier-lang-css';
|
|
216
|
+
|
|
217
|
+
const { code, sourceMap } = emitCssWithSourceMap(document, {
|
|
218
|
+
sourcePath: 'todo.frontier',
|
|
219
|
+
targetPath: 'todo.css'
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
const evidence = createCssSemanticMergeEvidence(code, {
|
|
223
|
+
sourcePath: 'todo.css'
|
|
224
|
+
});
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
`sourceMap.mappings` links emitted rule blocks back to Frontier Lang semantic node ids. `createCssSemanticMergeEvidence` records selectors, specificity, declarations, custom properties, cascade keys, source spans, stable hashes, and fail-closed proof gaps for cascade/render-sensitive CSS surfaces.
|
|
228
|
+
|
|
229
|
+
## Support Boundary
|
|
230
|
+
|
|
231
|
+
- Ready evidence: style rules, selectors, specificity, declarations, custom properties, source spans, stable hashes.
|
|
232
|
+
- Review-only gaps: shorthands without longhand expansion, scoped cascade under `@media` / `@supports` / `@container` / `@layer`, `@keyframes`, `@font-face`, `@page`, browser layout and render equivalence.
|
|
233
|
+
- Claims: `autoMergeClaim`, `semanticEquivalenceClaim`, `browserCascadeEquivalenceClaim`, and `browserRenderEquivalenceClaim` remain false.
|
package/bench/smoke.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { performance } from 'node:perf_hooks';
|
|
2
|
+
import { createDocument, entityNode } from '@shapeshift-labs/frontier-lang-kernel';
|
|
3
|
+
import { createCssSemanticMergeEvidence, emitCss, emitCssWithSourceMap } from '../dist/index.js';
|
|
4
|
+
|
|
5
|
+
const document = createDocument({ id: 'doc', name: 'Doc', nodes: [
|
|
6
|
+
entityNode({ id: 'ent_todo', name: 'Todo', fields: [
|
|
7
|
+
{ id: 'field_title', name: 'title', type: 'Text' },
|
|
8
|
+
{ id: 'field_done', name: 'done', type: 'Bool' }
|
|
9
|
+
] })
|
|
10
|
+
] });
|
|
11
|
+
const source = ':root { --brand: green; }\n.todo[data-state="done"] { color: var(--brand); }';
|
|
12
|
+
const start = performance.now();
|
|
13
|
+
let bytes = 0;
|
|
14
|
+
let mappedBytes = 0;
|
|
15
|
+
let mappings = 0;
|
|
16
|
+
let evidenceRecords = 0;
|
|
17
|
+
for (let index = 0; index < 500; index += 1) {
|
|
18
|
+
bytes += emitCss(document).length;
|
|
19
|
+
const mapped = emitCssWithSourceMap(document, { targetPath: 'doc.css' });
|
|
20
|
+
const evidence = createCssSemanticMergeEvidence(source);
|
|
21
|
+
mappedBytes += mapped.code.length + JSON.stringify(mapped.sourceMap).length;
|
|
22
|
+
mappings += mapped.sourceMap.mappings.length;
|
|
23
|
+
evidenceRecords += evidence.records.length;
|
|
24
|
+
}
|
|
25
|
+
console.log(JSON.stringify({ emits: 500, bytes, mappedBytes, mappings, evidenceRecords, durationMs: Number((performance.now() - start).toFixed(2)) }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../bench/smoke.mjs';
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { hashSemanticValue } from '@shapeshift-labs/frontier-lang-kernel';
|
|
2
|
+
|
|
3
|
+
const CssModulePathPattern = /\.module\.css$/i;
|
|
4
|
+
|
|
5
|
+
export function createCssModuleEvidence(records, options, sourceHash) {
|
|
6
|
+
const enabled = options.cssModule === true || options.cssModules === true || CssModulePathPattern.test(String(options.sourcePath ?? ''));
|
|
7
|
+
if (!enabled) return undefined;
|
|
8
|
+
const rules = records.filter((record) => record.kind === 'rule');
|
|
9
|
+
const exports = cssModuleExports(rules, options);
|
|
10
|
+
const compositions = cssModuleCompositions(rules);
|
|
11
|
+
const icssImports = cssModuleIcssImports(rules);
|
|
12
|
+
const icssExports = cssModuleIcssExports(rules);
|
|
13
|
+
const proofGaps = cssModuleProofGaps(exports, compositions, icssImports, icssExports, options);
|
|
14
|
+
const moduleHash = hashSemanticValue({
|
|
15
|
+
kind: 'frontier.lang.css.modules.v1',
|
|
16
|
+
exports: exports.map((entry) => ({ name: entry.name, selectors: entry.selectors })),
|
|
17
|
+
compositions: compositions.map((entry) => ({ localName: entry.localName, names: entry.names, source: entry.source })),
|
|
18
|
+
icssImports,
|
|
19
|
+
icssExports
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
kind: 'frontier.lang.cssModuleEvidence',
|
|
23
|
+
version: 1,
|
|
24
|
+
sourceHash,
|
|
25
|
+
moduleHash,
|
|
26
|
+
mode: 'css-modules',
|
|
27
|
+
exports,
|
|
28
|
+
compositions,
|
|
29
|
+
icssImports,
|
|
30
|
+
icssExports,
|
|
31
|
+
generatedClassNameMapHash: options.generatedClassNameMapHash ?? generatedClassNameMapHash(options.generatedClassNameMap),
|
|
32
|
+
jsTsUseSiteGraphHash: options.jsTsUseSiteGraphHash,
|
|
33
|
+
cssModuleCompositionGraphHash: options.cssModuleCompositionGraphHash,
|
|
34
|
+
icssGraphHash: options.icssGraphHash,
|
|
35
|
+
proofGaps
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function cssModuleProofGaps(exports, compositions, icssImports, icssExports, options) {
|
|
40
|
+
const proofGaps = [];
|
|
41
|
+
if (exports.length && !options.generatedClassNameMapHash && !options.generatedClassNameMap) {
|
|
42
|
+
proofGaps.push(proofGap('css-module-generated-class-map-unproved', 'CSS Modules exported local classes need generated class-name map evidence from the bundler/runtime.'));
|
|
43
|
+
}
|
|
44
|
+
if (exports.length && !options.jsTsUseSiteGraphHash) {
|
|
45
|
+
proofGaps.push(proofGap('css-module-js-ts-use-site-graph-unproved', 'CSS Modules exported classes need JS/TS/JSX import and member-use graph evidence.'));
|
|
46
|
+
}
|
|
47
|
+
if (compositions.length && !options.cssModuleCompositionGraphHash) {
|
|
48
|
+
proofGaps.push(proofGap('css-module-composition-resolution-unproved', 'CSS Modules composes declarations need resolved local/global/file composition graph evidence.'));
|
|
49
|
+
}
|
|
50
|
+
if ((icssImports.length || icssExports.length) && !options.icssGraphHash) {
|
|
51
|
+
proofGaps.push(proofGap('css-module-icss-graph-unproved', 'ICSS import/export records need a resolved token graph before equivalence can be claimed.'));
|
|
52
|
+
}
|
|
53
|
+
return proofGaps;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function cssModuleExports(rules, options) {
|
|
57
|
+
const generatedClassNameMap = options.generatedClassNameMap ?? {};
|
|
58
|
+
const byName = new Map();
|
|
59
|
+
for (const rule of rules) {
|
|
60
|
+
if (isIcssSelector(rule)) continue;
|
|
61
|
+
for (const selector of rule.selectors ?? []) {
|
|
62
|
+
for (const localName of localClassNamesForSelector(selector)) {
|
|
63
|
+
const existing = byName.get(localName) ?? {
|
|
64
|
+
kind: 'css-module-export',
|
|
65
|
+
name: localName,
|
|
66
|
+
localName,
|
|
67
|
+
selectors: [],
|
|
68
|
+
ruleHashes: [],
|
|
69
|
+
sourceSpans: [],
|
|
70
|
+
generatedName: generatedClassNameMap[localName],
|
|
71
|
+
exportHash: undefined
|
|
72
|
+
};
|
|
73
|
+
existing.selectors.push(selector);
|
|
74
|
+
existing.ruleHashes.push(rule.ruleHash);
|
|
75
|
+
existing.sourceSpans.push(rule.sourceSpan);
|
|
76
|
+
byName.set(localName, existing);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return [...byName.values()].map(cssModuleExportWithHash);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function cssModuleExportWithHash(entry) {
|
|
84
|
+
const selectors = uniqueStrings(entry.selectors);
|
|
85
|
+
const ruleHashes = uniqueStrings(entry.ruleHashes);
|
|
86
|
+
return {
|
|
87
|
+
...entry,
|
|
88
|
+
selectors,
|
|
89
|
+
ruleHashes,
|
|
90
|
+
exportHash: hashSemanticValue({ kind: 'frontier.lang.css.module.export.v1', name: entry.name, selectors, ruleHashes, generatedName: entry.generatedName })
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function cssModuleCompositions(rules) {
|
|
95
|
+
const result = [];
|
|
96
|
+
for (const rule of rules) {
|
|
97
|
+
if (isIcssSelector(rule)) continue;
|
|
98
|
+
const localNames = uniqueStrings((rule.selectors ?? []).flatMap(localClassNamesForSelector));
|
|
99
|
+
for (const declaration of rule.declarations ?? []) {
|
|
100
|
+
if (declaration.property !== 'composes') continue;
|
|
101
|
+
const parsed = parseCssModuleComposesValue(declaration.value);
|
|
102
|
+
for (const localName of localNames) {
|
|
103
|
+
result.push({
|
|
104
|
+
kind: 'css-module-composition',
|
|
105
|
+
localName,
|
|
106
|
+
names: parsed.names,
|
|
107
|
+
source: parsed.source,
|
|
108
|
+
sourceKind: parsed.sourceKind,
|
|
109
|
+
selectorHash: rule.selectorHash,
|
|
110
|
+
declarationHash: declaration.declarationHash,
|
|
111
|
+
compositionHash: hashSemanticValue({ kind: 'frontier.lang.css.module.composition.v1', localName, names: parsed.names, source: parsed.source, sourceKind: parsed.sourceKind })
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function cssModuleIcssImports(rules) {
|
|
120
|
+
const result = [];
|
|
121
|
+
for (const rule of rules) {
|
|
122
|
+
const source = icssImportSource(rule);
|
|
123
|
+
if (!source) continue;
|
|
124
|
+
for (const declaration of rule.declarations ?? []) {
|
|
125
|
+
const importedName = declaration.rawProperty ?? declaration.property;
|
|
126
|
+
result.push({
|
|
127
|
+
kind: 'icss-import',
|
|
128
|
+
source,
|
|
129
|
+
importedName,
|
|
130
|
+
localName: declaration.value,
|
|
131
|
+
declarationHash: declaration.declarationHash,
|
|
132
|
+
importHash: hashSemanticValue({ kind: 'frontier.lang.css.module.icssImport.v1', source, importedName, localName: declaration.value })
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function cssModuleIcssExports(rules) {
|
|
140
|
+
const result = [];
|
|
141
|
+
for (const rule of rules) {
|
|
142
|
+
if (!(rule.selectors ?? []).some((selector) => selector.trim() === ':export')) continue;
|
|
143
|
+
for (const declaration of rule.declarations ?? []) {
|
|
144
|
+
const name = declaration.rawProperty ?? declaration.property;
|
|
145
|
+
result.push({
|
|
146
|
+
kind: 'icss-export',
|
|
147
|
+
name,
|
|
148
|
+
value: declaration.value,
|
|
149
|
+
declarationHash: declaration.declarationHash,
|
|
150
|
+
exportHash: hashSemanticValue({ kind: 'frontier.lang.css.module.icssExport.v1', name, value: declaration.value })
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function parseCssModuleComposesValue(value) {
|
|
158
|
+
const match = /^(.*?)\s+from\s+(.+)$/i.exec(value.trim());
|
|
159
|
+
const namesPart = match ? match[1] : value;
|
|
160
|
+
const source = match ? stripCssQuotes(match[2].trim()) : undefined;
|
|
161
|
+
return {
|
|
162
|
+
names: uniqueStrings(namesPart.split(/\s+/).map((item) => item.trim()).filter(Boolean)),
|
|
163
|
+
source,
|
|
164
|
+
sourceKind: !source ? 'local' : source === 'global' ? 'global' : 'file'
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function localClassNamesForSelector(selector) {
|
|
169
|
+
const forcedLocal = [];
|
|
170
|
+
const globalNames = new Set();
|
|
171
|
+
let stripped = String(selector ?? '').replace(/:global\(([^)]*)\)/g, (_, body) => {
|
|
172
|
+
for (const name of classNames(body)) globalNames.add(name);
|
|
173
|
+
return ' ';
|
|
174
|
+
});
|
|
175
|
+
stripped = stripped.replace(/:local\(([^)]*)\)/g, (_, body) => {
|
|
176
|
+
forcedLocal.push(...classNames(body));
|
|
177
|
+
return ' ';
|
|
178
|
+
});
|
|
179
|
+
if (/:global\b/.test(stripped)) return uniqueStrings(forcedLocal);
|
|
180
|
+
return uniqueStrings([...forcedLocal, ...classNames(stripped).filter((name) => !globalNames.has(name))]);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function classNames(selector) {
|
|
184
|
+
return (String(selector ?? '').match(/\.[_A-Za-z-][\w-]*/g) ?? []).map((name) => name.slice(1));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function isIcssSelector(rule) {
|
|
188
|
+
return (rule.selectors ?? []).some((selector) => selector.trim() === ':export' || /^:import\(/.test(selector.trim()));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function icssImportSource(rule) {
|
|
192
|
+
for (const selector of rule.selectors ?? []) {
|
|
193
|
+
const match = /^:import\((['"]?)(.*?)\1\)$/.exec(selector.trim());
|
|
194
|
+
if (match) return match[2];
|
|
195
|
+
}
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function generatedClassNameMapHash(generatedClassNameMap) {
|
|
200
|
+
return generatedClassNameMap ? hashSemanticValue({ kind: 'frontier.lang.css.modules.generatedClassNameMap.v1', generatedClassNameMap }) : undefined;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function proofGap(code, summary) { return { code, status: 'not-claimed', summary, failClosed: true, semanticEquivalenceClaim: false }; }
|
|
204
|
+
function stripCssQuotes(value) { return String(value ?? '').replace(/^['"]|['"]$/g, ''); }
|
|
205
|
+
function uniqueStrings(values) { return [...new Set((values ?? []).map((value) => String(value)).filter(Boolean))]; }
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import type { FrontierLangDocument } from '@shapeshift-labs/frontier-lang-kernel';
|
|
2
|
+
|
|
3
|
+
export interface CssProjectionOptions {
|
|
4
|
+
readonly banner?: string;
|
|
5
|
+
readonly sourceMapId?: string;
|
|
6
|
+
readonly sourcePath?: string;
|
|
7
|
+
readonly sourceHash?: string;
|
|
8
|
+
readonly cssModule?: boolean;
|
|
9
|
+
readonly cssModules?: boolean;
|
|
10
|
+
readonly generatedClassNameMap?: Readonly<Record<string, string>>;
|
|
11
|
+
readonly generatedClassNameMapHash?: string;
|
|
12
|
+
readonly jsTsUseSiteGraphHash?: string;
|
|
13
|
+
readonly cssModuleCompositionGraphHash?: string;
|
|
14
|
+
readonly icssGraphHash?: string;
|
|
15
|
+
readonly targetPath?: string;
|
|
16
|
+
readonly semanticIndexId?: string;
|
|
17
|
+
readonly sourceSpansBySemanticNodeId?: Readonly<Record<string, CssSourceSpan>>;
|
|
18
|
+
readonly evidence?: readonly CssProjectionEvidenceRecord[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CssProjectionEvidenceRecord {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly kind?: string;
|
|
24
|
+
readonly summary?: string;
|
|
25
|
+
readonly [key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface CssSourceSpan {
|
|
29
|
+
readonly path?: string;
|
|
30
|
+
readonly startOffset?: number;
|
|
31
|
+
readonly endOffset?: number;
|
|
32
|
+
readonly startLine: number;
|
|
33
|
+
readonly startColumn: number;
|
|
34
|
+
readonly endLine: number;
|
|
35
|
+
readonly endColumn: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface CssSourceRef {
|
|
39
|
+
readonly semanticNodeId: string;
|
|
40
|
+
readonly semanticNodeKind?: string;
|
|
41
|
+
readonly semanticNodeName?: string;
|
|
42
|
+
readonly regionIds?: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface CssAstDeclaration {
|
|
46
|
+
readonly property: string;
|
|
47
|
+
readonly value: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface CssAstRule {
|
|
51
|
+
readonly kind: 'rule';
|
|
52
|
+
readonly selector: string;
|
|
53
|
+
readonly declarations: readonly CssAstDeclaration[];
|
|
54
|
+
readonly sourceRef?: CssSourceRef;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface CssAstStylesheet {
|
|
58
|
+
readonly kind: 'css.stylesheet';
|
|
59
|
+
readonly banner: string;
|
|
60
|
+
readonly rules: readonly CssAstRule[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface CssSourceMapMapping {
|
|
64
|
+
readonly id: string;
|
|
65
|
+
readonly semanticNodeId: string;
|
|
66
|
+
readonly sourceSpan?: CssSourceSpan;
|
|
67
|
+
readonly generatedSpan: CssSourceSpan & { readonly targetPath?: string; readonly generatedName?: string };
|
|
68
|
+
readonly target?: { readonly language: 'css'; readonly [key: string]: unknown };
|
|
69
|
+
readonly generatedName?: string;
|
|
70
|
+
readonly precision: 'rule-block';
|
|
71
|
+
readonly metadata: Readonly<Record<string, unknown>>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface CssSourceMap {
|
|
75
|
+
readonly kind: 'frontier.lang.sourceMap';
|
|
76
|
+
readonly version: 1;
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly sourcePath?: string;
|
|
79
|
+
readonly sourceHash?: string;
|
|
80
|
+
readonly target?: { readonly language: 'css'; readonly [key: string]: unknown };
|
|
81
|
+
readonly targetPath?: string;
|
|
82
|
+
readonly semanticIndexId?: string;
|
|
83
|
+
readonly mappings: readonly CssSourceMapMapping[];
|
|
84
|
+
readonly evidence: readonly CssProjectionEvidenceRecord[];
|
|
85
|
+
readonly metadata: Readonly<Record<string, unknown>>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface CssProjectionResult {
|
|
89
|
+
readonly code: string;
|
|
90
|
+
readonly sourceMap: CssSourceMap;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface CssProjectionWithAstResult extends CssProjectionResult {
|
|
94
|
+
readonly ast: CssAstStylesheet;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface CssSemanticProofGap {
|
|
98
|
+
readonly code: string;
|
|
99
|
+
readonly status: 'not-claimed' | string;
|
|
100
|
+
readonly summary: string;
|
|
101
|
+
readonly failClosed: true;
|
|
102
|
+
readonly semanticEquivalenceClaim: false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface CssSemanticDeclaration {
|
|
106
|
+
readonly property: string;
|
|
107
|
+
readonly rawProperty?: string;
|
|
108
|
+
readonly value: string;
|
|
109
|
+
readonly important: boolean;
|
|
110
|
+
readonly valueHash: string;
|
|
111
|
+
readonly ordinal: number;
|
|
112
|
+
readonly cascadeKey: string;
|
|
113
|
+
readonly declarationHash: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface CssSemanticRecord {
|
|
117
|
+
readonly kind: 'rule' | 'at-rule' | string;
|
|
118
|
+
readonly selectors?: readonly string[];
|
|
119
|
+
readonly selectorHash?: string;
|
|
120
|
+
readonly specificity?: readonly (readonly number[])[];
|
|
121
|
+
readonly scopes?: readonly string[];
|
|
122
|
+
readonly declarations?: readonly CssSemanticDeclaration[];
|
|
123
|
+
readonly customProperties?: readonly string[];
|
|
124
|
+
readonly atRuleName?: string;
|
|
125
|
+
readonly conditionText?: string;
|
|
126
|
+
readonly scopeKey?: string;
|
|
127
|
+
readonly sourceSpan: CssSourceSpan;
|
|
128
|
+
readonly sourceHash: string;
|
|
129
|
+
readonly ruleHash?: string;
|
|
130
|
+
readonly atRuleHash?: string;
|
|
131
|
+
readonly proofGaps?: readonly CssSemanticProofGap[];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface CssModuleExportRecord {
|
|
135
|
+
readonly kind: 'css-module-export';
|
|
136
|
+
readonly name: string;
|
|
137
|
+
readonly localName: string;
|
|
138
|
+
readonly selectors: readonly string[];
|
|
139
|
+
readonly ruleHashes: readonly string[];
|
|
140
|
+
readonly sourceSpans: readonly CssSourceSpan[];
|
|
141
|
+
readonly generatedName?: string;
|
|
142
|
+
readonly exportHash: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface CssModuleCompositionRecord {
|
|
146
|
+
readonly kind: 'css-module-composition';
|
|
147
|
+
readonly localName: string;
|
|
148
|
+
readonly names: readonly string[];
|
|
149
|
+
readonly source?: string;
|
|
150
|
+
readonly sourceKind: 'local' | 'global' | 'file' | string;
|
|
151
|
+
readonly selectorHash?: string;
|
|
152
|
+
readonly declarationHash?: string;
|
|
153
|
+
readonly compositionHash: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface CssModuleIcssImportRecord {
|
|
157
|
+
readonly kind: 'icss-import';
|
|
158
|
+
readonly source: string;
|
|
159
|
+
readonly importedName: string;
|
|
160
|
+
readonly localName: string;
|
|
161
|
+
readonly declarationHash?: string;
|
|
162
|
+
readonly importHash: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface CssModuleIcssExportRecord {
|
|
166
|
+
readonly kind: 'icss-export';
|
|
167
|
+
readonly name: string;
|
|
168
|
+
readonly value: string;
|
|
169
|
+
readonly declarationHash?: string;
|
|
170
|
+
readonly exportHash: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface CssModuleEvidence {
|
|
174
|
+
readonly kind: 'frontier.lang.cssModuleEvidence';
|
|
175
|
+
readonly version: 1;
|
|
176
|
+
readonly sourceHash: string;
|
|
177
|
+
readonly moduleHash: string;
|
|
178
|
+
readonly mode: 'css-modules';
|
|
179
|
+
readonly exports: readonly CssModuleExportRecord[];
|
|
180
|
+
readonly compositions: readonly CssModuleCompositionRecord[];
|
|
181
|
+
readonly icssImports: readonly CssModuleIcssImportRecord[];
|
|
182
|
+
readonly icssExports: readonly CssModuleIcssExportRecord[];
|
|
183
|
+
readonly generatedClassNameMapHash?: string;
|
|
184
|
+
readonly jsTsUseSiteGraphHash?: string;
|
|
185
|
+
readonly cssModuleCompositionGraphHash?: string;
|
|
186
|
+
readonly icssGraphHash?: string;
|
|
187
|
+
readonly proofGaps: readonly CssSemanticProofGap[];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface CssSemanticSheet {
|
|
191
|
+
readonly kind: 'frontier.lang.cssSemanticSheet';
|
|
192
|
+
readonly version: 1;
|
|
193
|
+
readonly sourcePath?: string;
|
|
194
|
+
readonly sourceHash: string;
|
|
195
|
+
readonly records: readonly CssSemanticRecord[];
|
|
196
|
+
readonly cssModules?: CssModuleEvidence;
|
|
197
|
+
readonly sheetHash: string;
|
|
198
|
+
readonly summary: Readonly<Record<string, number>>;
|
|
199
|
+
readonly proofGaps: readonly CssSemanticProofGap[];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface CssSemanticMergeEvidence {
|
|
203
|
+
readonly kind: 'frontier.lang.cssSemanticMergeEvidence';
|
|
204
|
+
readonly version: 1;
|
|
205
|
+
readonly status: 'ready' | 'needs-review' | string;
|
|
206
|
+
readonly sourcePath?: string;
|
|
207
|
+
readonly sourceHash: string;
|
|
208
|
+
readonly sheetHash: string;
|
|
209
|
+
readonly records: readonly CssSemanticRecord[];
|
|
210
|
+
readonly cssModules?: CssModuleEvidence;
|
|
211
|
+
readonly proofGaps: readonly CssSemanticProofGap[];
|
|
212
|
+
readonly autoMergeClaim: false;
|
|
213
|
+
readonly semanticEquivalenceClaim: false;
|
|
214
|
+
readonly cssModuleGeneratedNameEquivalenceClaim: false;
|
|
215
|
+
readonly cssModuleUseSiteEquivalenceClaim: false;
|
|
216
|
+
readonly browserCascadeEquivalenceClaim: false;
|
|
217
|
+
readonly browserRenderEquivalenceClaim: false;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export declare function toCssAst(document: FrontierLangDocument, options?: CssProjectionOptions): CssAstStylesheet;
|
|
221
|
+
export declare function renderCssAst(ast: CssAstStylesheet): string;
|
|
222
|
+
export declare function renderCssAstWithSourceMap(ast: CssAstStylesheet, options?: CssProjectionOptions): CssProjectionResult;
|
|
223
|
+
export declare function emitCss(document: FrontierLangDocument, options?: CssProjectionOptions): string;
|
|
224
|
+
export declare function emitCssWithSourceMap(document: FrontierLangDocument, options?: CssProjectionOptions): CssProjectionWithAstResult;
|
|
225
|
+
export declare function parseCssSemanticSheet(sourceText: string, options?: CssProjectionOptions): CssSemanticSheet;
|
|
226
|
+
export declare function createCssSemanticMergeEvidence(sourceText: string, options?: CssProjectionOptions): CssSemanticMergeEvidence;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { hashSemanticValue } from '@shapeshift-labs/frontier-lang-kernel';
|
|
2
|
+
import { createCssModuleEvidence } from './css-modules.js';
|
|
3
|
+
|
|
4
|
+
const ShorthandProperties = new Set(['all', 'animation', 'background', 'border', 'border-block', 'border-color', 'border-image', 'border-inline', 'border-radius', 'border-style', 'border-width', 'columns', 'flex', 'font', 'gap', 'grid', 'grid-area', 'grid-column', 'grid-row', 'inset', 'list-style', 'margin', 'offset', 'outline', 'overflow', 'padding', 'place-content', 'place-items', 'place-self', 'text-decoration', 'transition']);
|
|
5
|
+
const RuntimeAtRules = new Set(['keyframes', 'font-face', 'page', 'property']);
|
|
6
|
+
const ScopeAtRules = new Set(['media', 'supports', 'container', 'layer', 'scope']);
|
|
7
|
+
|
|
8
|
+
export function toCssAst(document, options = {}) {
|
|
9
|
+
const banner = options.banner ?? 'Generated by @shapeshift-labs/frontier-lang-css.';
|
|
10
|
+
const rules = [];
|
|
11
|
+
for (const node of Object.values(document.nodes)) {
|
|
12
|
+
if (node.kind === 'entity' || node.kind === 'type') {
|
|
13
|
+
rules.push({
|
|
14
|
+
kind: 'rule',
|
|
15
|
+
selector: `.frontier-${cssIdentifier(node.name)}`,
|
|
16
|
+
declarations: (node.fields ?? []).map((field) => ({ property: `--frontier-field-${cssIdentifier(field.name)}`, value: JSON.stringify(typeName(field.type)) })),
|
|
17
|
+
sourceRef: sourceRef(node, { regionIds: (node.fields ?? []).map((field) => field.id) })
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (node.kind === 'capability') rules.push({
|
|
21
|
+
kind: 'rule',
|
|
22
|
+
selector: `[data-frontier-capability="${cssString(node.capability)}"]`,
|
|
23
|
+
declarations: [{ property: '--frontier-capability', value: JSON.stringify(node.capability) }],
|
|
24
|
+
sourceRef: sourceRef(node)
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return { kind: 'css.stylesheet', banner, rules };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function renderCssAst(ast) {
|
|
31
|
+
return renderCssAstWithSourceMap(ast).code;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function renderCssAstWithSourceMap(ast, options = {}) {
|
|
35
|
+
const lines = [`/* ${ast.banner} */`];
|
|
36
|
+
const mappings = [];
|
|
37
|
+
ast.rules.forEach((rule, index) => {
|
|
38
|
+
const startLine = lines.length + 1;
|
|
39
|
+
lines.push(`${rule.selector} {`);
|
|
40
|
+
for (const declaration of rule.declarations) lines.push(` ${declaration.property}: ${declaration.value};`);
|
|
41
|
+
lines.push('}', '');
|
|
42
|
+
if (rule.sourceRef?.semanticNodeId) mappings.push(sourceMapMapping(rule, index, startLine, lines.length - 1, options));
|
|
43
|
+
});
|
|
44
|
+
const code = `${lines.join('\n').trimEnd()}\n`;
|
|
45
|
+
return { code, sourceMap: sourceMapEnvelope(ast, mappings, options) };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function emitCss(document, options = {}) {
|
|
49
|
+
return renderCssAst(toCssAst(document, options));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function emitCssWithSourceMap(document, options = {}) {
|
|
53
|
+
const ast = toCssAst(document, options);
|
|
54
|
+
const result = renderCssAstWithSourceMap(ast, { sourceMapId: options.sourceMapId ?? `sourcemap_${idFragment(document.id)}_css`, ...options });
|
|
55
|
+
return { ...result, ast };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function parseCssSemanticSheet(sourceText, options = {}) {
|
|
59
|
+
const lineStarts = computeLineStarts(sourceText);
|
|
60
|
+
const sourceHash = options.sourceHash ?? hashSemanticValue({ kind: 'frontier.lang.css.source.v1', sourceText });
|
|
61
|
+
const records = parseCssBlocks(sourceText, 0, sourceText.length, [], lineStarts, sourceHash);
|
|
62
|
+
const cssModules = createCssModuleEvidence(records, options, sourceHash);
|
|
63
|
+
const proofGaps = [
|
|
64
|
+
...records.flatMap((record) => record.proofGaps ?? []),
|
|
65
|
+
...(cssModules?.proofGaps ?? [])
|
|
66
|
+
];
|
|
67
|
+
return {
|
|
68
|
+
kind: 'frontier.lang.cssSemanticSheet',
|
|
69
|
+
version: 1,
|
|
70
|
+
sourcePath: options.sourcePath,
|
|
71
|
+
sourceHash,
|
|
72
|
+
records,
|
|
73
|
+
cssModules,
|
|
74
|
+
sheetHash: hashSemanticValue({ kind: 'frontier.lang.cssSemanticSheet.records.v1', records: records.map(hashableCssRecord), cssModuleHash: cssModules?.moduleHash }),
|
|
75
|
+
summary: {
|
|
76
|
+
rules: records.filter((record) => record.kind === 'rule').length,
|
|
77
|
+
declarations: records.reduce((sum, record) => sum + (record.declarations?.length ?? 0), 0),
|
|
78
|
+
scopedRules: records.filter((record) => record.scopes?.length).length,
|
|
79
|
+
cssModuleExports: cssModules?.exports.length ?? 0,
|
|
80
|
+
cssModuleCompositions: cssModules?.compositions.length ?? 0,
|
|
81
|
+
icssImports: cssModules?.icssImports.length ?? 0,
|
|
82
|
+
icssExports: cssModules?.icssExports.length ?? 0,
|
|
83
|
+
proofGaps: proofGaps.length
|
|
84
|
+
},
|
|
85
|
+
proofGaps
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function createCssSemanticMergeEvidence(sourceText, options = {}) {
|
|
90
|
+
const sheet = parseCssSemanticSheet(sourceText, options);
|
|
91
|
+
return {
|
|
92
|
+
kind: 'frontier.lang.cssSemanticMergeEvidence',
|
|
93
|
+
version: 1,
|
|
94
|
+
status: sheet.proofGaps.length ? 'needs-review' : 'ready',
|
|
95
|
+
sourcePath: options.sourcePath,
|
|
96
|
+
sourceHash: sheet.sourceHash,
|
|
97
|
+
sheetHash: sheet.sheetHash,
|
|
98
|
+
records: sheet.records,
|
|
99
|
+
cssModules: sheet.cssModules,
|
|
100
|
+
proofGaps: sheet.proofGaps,
|
|
101
|
+
autoMergeClaim: false,
|
|
102
|
+
semanticEquivalenceClaim: false,
|
|
103
|
+
cssModuleGeneratedNameEquivalenceClaim: false,
|
|
104
|
+
cssModuleUseSiteEquivalenceClaim: false,
|
|
105
|
+
browserCascadeEquivalenceClaim: false,
|
|
106
|
+
browserRenderEquivalenceClaim: false
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function parseCssBlocks(sourceText, start, end, scopes, lineStarts, sourceHash) {
|
|
111
|
+
const records = [];
|
|
112
|
+
let index = start;
|
|
113
|
+
while (index < end) {
|
|
114
|
+
const open = sourceText.indexOf('{', index);
|
|
115
|
+
if (open < 0 || open >= end) break;
|
|
116
|
+
const close = matchingBrace(sourceText, open, end);
|
|
117
|
+
if (close < 0) break;
|
|
118
|
+
const preludeStart = previousBoundary(sourceText, index, open);
|
|
119
|
+
const prelude = sourceText.slice(preludeStart, open).replace(/\/\*[\s\S]*?\*\//g, '').trim();
|
|
120
|
+
const body = sourceText.slice(open + 1, close);
|
|
121
|
+
if (prelude.startsWith('@')) {
|
|
122
|
+
const at = parseAtRule(prelude, preludeStart, close + 1, lineStarts, sourceHash, scopes);
|
|
123
|
+
records.push(at);
|
|
124
|
+
if (ScopeAtRules.has(at.atRuleName)) records.push(...parseCssBlocks(sourceText, open + 1, close, [...scopes, at.scopeKey], lineStarts, sourceHash));
|
|
125
|
+
} else if (prelude) {
|
|
126
|
+
records.push(cssRuleRecord(prelude, body, preludeStart, close + 1, lineStarts, sourceHash, scopes));
|
|
127
|
+
}
|
|
128
|
+
index = close + 1;
|
|
129
|
+
}
|
|
130
|
+
return records;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function cssRuleRecord(prelude, body, start, end, lineStarts, sourceHash, scopes) {
|
|
134
|
+
const selectors = prelude.split(',').map((selector) => selector.trim()).filter(Boolean);
|
|
135
|
+
const declarations = parseDeclarations(body);
|
|
136
|
+
const proofGaps = [
|
|
137
|
+
...declarations.filter((declaration) => ShorthandProperties.has(declaration.property)).map((declaration) => proofGap('css-shorthand-expansion-unproved', `CSS shorthand ${declaration.property} needs longhand expansion evidence.`)),
|
|
138
|
+
...scopes.length ? [proofGap('css-scoped-cascade-equivalence-unproved', 'Scoped cascade equivalence requires browser/style evidence.')] : []
|
|
139
|
+
];
|
|
140
|
+
return compactRecord({
|
|
141
|
+
kind: 'rule',
|
|
142
|
+
selectors,
|
|
143
|
+
selectorHash: hashSemanticValue({ kind: 'frontier.lang.css.selectors.v1', selectors }),
|
|
144
|
+
specificity: selectors.map(selectorSpecificity),
|
|
145
|
+
scopes,
|
|
146
|
+
declarations: declarations.map((declaration, ordinal) => ({
|
|
147
|
+
...declaration,
|
|
148
|
+
ordinal,
|
|
149
|
+
cascadeKey: [...scopes, selectors.join(','), declaration.property].join('::'),
|
|
150
|
+
declarationHash: hashSemanticValue({ kind: 'frontier.lang.css.declaration.v1', scopes, selectors, declaration })
|
|
151
|
+
})),
|
|
152
|
+
customProperties: declarations.filter((declaration) => declaration.property.startsWith('--')).map((declaration) => declaration.property),
|
|
153
|
+
sourceSpan: sourceSpan(start, end, lineStarts),
|
|
154
|
+
sourceHash,
|
|
155
|
+
ruleHash: hashSemanticValue({ kind: 'frontier.lang.css.rule.v1', selectors, scopes, declarations }),
|
|
156
|
+
proofGaps: proofGaps.length ? proofGaps : undefined
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function parseAtRule(prelude, start, end, lineStarts, sourceHash, scopes) {
|
|
161
|
+
const match = /^@([A-Za-z-]+)\s*([\s\S]*)$/.exec(prelude);
|
|
162
|
+
const atRuleName = match?.[1]?.toLowerCase() ?? 'unknown';
|
|
163
|
+
const conditionText = match?.[2]?.trim() ?? '';
|
|
164
|
+
const proofGaps = [];
|
|
165
|
+
if (RuntimeAtRules.has(atRuleName)) proofGaps.push(proofGap(`css-${atRuleName}-runtime-equivalence-unproved`, `CSS @${atRuleName} semantics require browser evidence.`));
|
|
166
|
+
if (ScopeAtRules.has(atRuleName)) proofGaps.push(proofGap(`css-${atRuleName}-cascade-scope-unproved`, `CSS @${atRuleName} scoped cascade requires condition evaluation evidence.`));
|
|
167
|
+
return compactRecord({
|
|
168
|
+
kind: 'at-rule',
|
|
169
|
+
atRuleName,
|
|
170
|
+
conditionText,
|
|
171
|
+
scopeKey: `@${atRuleName} ${conditionText}`.trim(),
|
|
172
|
+
scopes,
|
|
173
|
+
sourceSpan: sourceSpan(start, end, lineStarts),
|
|
174
|
+
sourceHash,
|
|
175
|
+
atRuleHash: hashSemanticValue({ kind: 'frontier.lang.css.atRule.v1', atRuleName, conditionText, scopes }),
|
|
176
|
+
proofGaps: proofGaps.length ? proofGaps : undefined
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function parseDeclarations(body) {
|
|
181
|
+
return body
|
|
182
|
+
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
183
|
+
.split(';')
|
|
184
|
+
.map((part) => part.trim())
|
|
185
|
+
.filter(Boolean)
|
|
186
|
+
.flatMap((part) => {
|
|
187
|
+
const separator = part.indexOf(':');
|
|
188
|
+
if (separator <= 0) return [];
|
|
189
|
+
const rawProperty = part.slice(0, separator).trim();
|
|
190
|
+
const property = rawProperty.toLowerCase();
|
|
191
|
+
const value = part.slice(separator + 1).trim();
|
|
192
|
+
return [{ property, rawProperty, value, important: /!important\s*$/i.test(value), valueHash: hashSemanticValue({ kind: 'frontier.lang.css.value.v1', value }) }];
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function selectorSpecificity(selector) {
|
|
197
|
+
const withoutStrings = selector.replace(/"[^"]*"|'[^']*'/g, '');
|
|
198
|
+
const ids = (withoutStrings.match(/#[\w-]+/g) ?? []).length;
|
|
199
|
+
const classes = (withoutStrings.match(/\.[\w-]+|\[[^\]]+\]|:(?!:)[\w-]+(?:\([^)]*\))?/g) ?? []).length;
|
|
200
|
+
const elements = (withoutStrings.replace(/#[\w-]+|\.[\w-]+|\[[^\]]+\]|:{1,2}[\w-]+(?:\([^)]*\))?/g, ' ').match(/\b[A-Za-z][\w-]*\b/g) ?? []).length;
|
|
201
|
+
return [ids, classes, elements];
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function matchingBrace(text, open, end) {
|
|
205
|
+
let depth = 0;
|
|
206
|
+
for (let index = open; index < end; index += 1) {
|
|
207
|
+
if (text[index] === '{') depth += 1;
|
|
208
|
+
if (text[index] === '}') {
|
|
209
|
+
depth -= 1;
|
|
210
|
+
if (depth === 0) return index;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return -1;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function previousBoundary(text, start, open) {
|
|
217
|
+
const candidates = [text.lastIndexOf('}', open - 1), text.lastIndexOf(';', open - 1)].filter((value) => value >= start);
|
|
218
|
+
return (candidates.length ? Math.max(...candidates) + 1 : start);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function sourceMapMapping(rule, index, startLine, endLine, options) {
|
|
222
|
+
return compactRecord({
|
|
223
|
+
id: `map_${idFragment(rule.sourceRef.semanticNodeId)}_${index}`,
|
|
224
|
+
semanticNodeId: rule.sourceRef.semanticNodeId,
|
|
225
|
+
sourceSpan: options.sourceSpansBySemanticNodeId?.[rule.sourceRef.semanticNodeId],
|
|
226
|
+
generatedSpan: { path: options.targetPath, targetPath: options.targetPath, target: { language: 'css' }, generatedName: rule.selector, startLine, startColumn: 1, endLine, endColumn: 1 },
|
|
227
|
+
target: { language: 'css' },
|
|
228
|
+
generatedName: rule.selector,
|
|
229
|
+
precision: 'rule-block',
|
|
230
|
+
metadata: { semanticNodeKind: rule.sourceRef.semanticNodeKind, semanticNodeName: rule.sourceRef.semanticNodeName, regionIds: rule.sourceRef.regionIds }
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function sourceMapEnvelope(ast, mappings, options) {
|
|
235
|
+
return compactRecord({ kind: 'frontier.lang.sourceMap', version: 1, id: options.sourceMapId ?? `sourcemap_${idFragment(ast.kind)}_css`, sourcePath: options.sourcePath, sourceHash: options.sourceHash, target: { language: 'css' }, targetPath: options.targetPath, semanticIndexId: options.semanticIndexId, mappings, evidence: options.evidence ?? [], metadata: { precision: 'rule-block', generatedSpanStrategy: 'css-renderer-rule-block' } });
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function sourceSpan(start, end, lineStarts) {
|
|
239
|
+
const from = positionAt(start, lineStarts);
|
|
240
|
+
const to = positionAt(end, lineStarts);
|
|
241
|
+
return { startOffset: start, endOffset: end, startLine: from.line, startColumn: from.column, endLine: to.line, endColumn: to.column };
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function positionAt(offset, lineStarts) {
|
|
245
|
+
let line = 0;
|
|
246
|
+
while (line + 1 < lineStarts.length && lineStarts[line + 1] <= offset) line += 1;
|
|
247
|
+
return { line: line + 1, column: offset - lineStarts[line] + 1 };
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function sourceRef(node, extra = {}) { return { semanticNodeId: node.id, semanticNodeKind: node.kind, semanticNodeName: node.name, ...extra }; }
|
|
251
|
+
function proofGap(code, summary) { return { code, status: 'not-claimed', summary, failClosed: true, semanticEquivalenceClaim: false }; }
|
|
252
|
+
function hashableCssRecord(record) { return { kind: record.kind, selectors: record.selectors, specificity: record.specificity, scopes: record.scopes, atRuleName: record.atRuleName, conditionText: record.conditionText, declarations: record.declarations?.map((item) => ({ property: item.property, value: item.value, important: item.important })), proofGaps: record.proofGaps?.map((gap) => gap.code) }; }
|
|
253
|
+
function computeLineStarts(text) { const starts = [0]; for (let index = 0; index < text.length; index += 1) if (text[index] === '\n') starts.push(index + 1); return starts; }
|
|
254
|
+
function cssIdentifier(value) { return String(value ?? 'unknown').replace(/[^A-Za-z0-9_-]/g, '-').replace(/^-+/, '') || 'unknown'; }
|
|
255
|
+
function cssString(value) { return String(value ?? '').replace(/\\/g, '\\\\').replace(/"/g, '\\"'); }
|
|
256
|
+
function typeName(type) { return typeof type === 'string' ? type : type?.name ?? type?.kind ?? 'unknown'; }
|
|
257
|
+
function compactRecord(record) { return Object.fromEntries(Object.entries(record).filter(([, value]) => value !== undefined)); }
|
|
258
|
+
function idFragment(value) { return String(value ?? 'unknown').replace(/[^A-Za-z0-9_$]/g, '_').replace(/^_+/, '') || 'unknown'; }
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shapeshift-labs/frontier-lang-css",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CSS semantic merge evidence and projection adapter for Frontier Lang semantic source documents.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"examples",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"bench",
|
|
21
|
+
"benchmarks/package-bench.mjs"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "node scripts/build.mjs",
|
|
25
|
+
"test": "npm run build && node test/smoke.mjs",
|
|
26
|
+
"typecheck": "node ./node_modules/typescript/bin/tsc --noEmit -p test/tsconfig.json",
|
|
27
|
+
"fuzz": "npm run build && node fuzz/smoke.mjs",
|
|
28
|
+
"bench": "npm run build && node bench/smoke.mjs",
|
|
29
|
+
"prepare": "npm run build",
|
|
30
|
+
"prepack": "npm run lint && npm test",
|
|
31
|
+
"pack:dry": "npm pack --dry-run",
|
|
32
|
+
"readme:packages": "node benchmarks/package-readme-sections.mjs",
|
|
33
|
+
"readme:packages:check": "node benchmarks/package-readme-sections.mjs --check",
|
|
34
|
+
"lint": "node scripts/strict-source-policy.mjs"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"frontier",
|
|
38
|
+
"semantic-merge",
|
|
39
|
+
"compiler",
|
|
40
|
+
"css"
|
|
41
|
+
],
|
|
42
|
+
"author": "ShapeShift Labs",
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+ssh://git@github.com/siliconjungle/-shapeshift-labs-frontier-lang-css.git"
|
|
47
|
+
},
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-css/issues"
|
|
50
|
+
},
|
|
51
|
+
"homepage": "https://github.com/siliconjungle/-shapeshift-labs-frontier-lang-css#readme",
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@shapeshift-labs/frontier-lang-kernel": "0.3.12"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"typescript": "^5.9.3"
|
|
60
|
+
}
|
|
61
|
+
}
|