@dialecte/core 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/hub.worker-B1HcVDhn.js +2 -0
- package/dist/diagnostics/diagnostics.d.ts +4 -0
- package/dist/diagnostics/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics/types.d.ts +6 -1
- package/dist/diagnostics/types.d.ts.map +1 -1
- package/dist/dialecte/create-dialecte-project.d.ts +11 -0
- package/dist/dialecte/create-dialecte-project.d.ts.map +1 -0
- package/dist/dialecte/create-project-factory.d.ts +14 -0
- package/dist/dialecte/create-project-factory.d.ts.map +1 -0
- package/dist/dialecte/define-dialecte.d.ts +12 -0
- package/dist/dialecte/define-dialecte.d.ts.map +1 -0
- package/dist/dialecte/dialecte.constants.d.ts +4 -0
- package/dist/dialecte/dialecte.constants.d.ts.map +1 -0
- package/dist/dialecte/dialecte.types.d.ts +75 -0
- package/dist/dialecte/dialecte.types.d.ts.map +1 -0
- package/dist/dialecte/index.d.ts +4 -0
- package/dist/dialecte/index.d.ts.map +1 -0
- package/dist/{project-DIKdMMHx.js → dialecte-gIPrRzni.js} +8031 -8457
- package/dist/document/bind-extensions.d.ts +4 -1
- package/dist/document/bind-extensions.d.ts.map +1 -1
- package/dist/document/document.d.ts +58 -5
- package/dist/document/document.d.ts.map +1 -1
- package/dist/document/progress/progress.types.d.ts +21 -4
- package/dist/document/progress/progress.types.d.ts.map +1 -1
- package/dist/document/query/find/ancestor/find-ancestor.d.ts +2 -0
- package/dist/document/query/find/ancestor/find-ancestor.d.ts.map +1 -1
- package/dist/document/query/find/by-attribute/find-by-attributes.d.ts +4 -0
- package/dist/document/query/find/by-attribute/find-by-attributes.d.ts.map +1 -1
- package/dist/document/query/find/descendant/find-descendant.d.ts +2 -0
- package/dist/document/query/find/descendant/find-descendant.d.ts.map +1 -1
- package/dist/document/query/get/attribute/get-attribute.d.ts +4 -0
- package/dist/document/query/get/attribute/get-attribute.d.ts.map +1 -1
- package/dist/document/query/get/attribute/get-attributes.d.ts +4 -0
- package/dist/document/query/get/attribute/get-attributes.d.ts.map +1 -1
- package/dist/document/query/get/definition/get-definition.d.ts +2 -0
- package/dist/document/query/get/definition/get-definition.d.ts.map +1 -1
- package/dist/document/query/get/record/get-child.d.ts +2 -0
- package/dist/document/query/get/record/get-child.d.ts.map +1 -1
- package/dist/document/query/get/record/get-children.d.ts +2 -0
- package/dist/document/query/get/record/get-children.d.ts.map +1 -1
- package/dist/document/query/get/record/get-record.d.ts +2 -0
- package/dist/document/query/get/record/get-record.d.ts.map +1 -1
- package/dist/document/query/get/record/get-records-by-tagname.d.ts +2 -0
- package/dist/document/query/get/record/get-records-by-tagname.d.ts.map +1 -1
- package/dist/document/query/get/record/get-records.d.ts +2 -0
- package/dist/document/query/get/record/get-records.d.ts.map +1 -1
- package/dist/document/query/get/record/load-live-records.d.ts +2 -0
- package/dist/document/query/get/record/load-live-records.d.ts.map +1 -1
- package/dist/document/query/get/record/resolve-record.d.ts +2 -0
- package/dist/document/query/get/record/resolve-record.d.ts.map +1 -1
- package/dist/document/query/get/record/staged-lookup.d.ts +4 -0
- package/dist/document/query/get/record/staged-lookup.d.ts.map +1 -1
- package/dist/document/query/get/tree/get-tree.d.ts +6 -0
- package/dist/document/query/get/tree/get-tree.d.ts.map +1 -1
- package/dist/document/query/main.d.ts +50 -15
- package/dist/document/query/main.d.ts.map +1 -1
- package/dist/document/query/snapshot/collect-snapshot.d.ts +2 -0
- package/dist/document/query/snapshot/collect-snapshot.d.ts.map +1 -1
- package/dist/document/query/snapshot/get-snapshot.d.ts +2 -0
- package/dist/document/query/snapshot/get-snapshot.d.ts.map +1 -1
- package/dist/document/query/snapshot/records-to-tree.d.ts +2 -0
- package/dist/document/query/snapshot/records-to-tree.d.ts.map +1 -1
- package/dist/document/query/tree-filter/omit.d.ts +8 -0
- package/dist/document/query/tree-filter/omit.d.ts.map +1 -1
- package/dist/document/query/tree-filter/order.d.ts +5 -2
- package/dist/document/query/tree-filter/order.d.ts.map +1 -1
- package/dist/document/query/tree-filter/unwrap.d.ts +2 -0
- package/dist/document/query/tree-filter/unwrap.d.ts.map +1 -1
- package/dist/document/staged-operations.d.ts +5 -1
- package/dist/document/staged-operations.d.ts.map +1 -1
- package/dist/document/transaction/clone/clone.d.ts +2 -0
- package/dist/document/transaction/clone/clone.d.ts.map +1 -1
- package/dist/document/transaction/commit/commit.d.ts.map +1 -1
- package/dist/document/transaction/commit/merge-operations.d.ts +1 -1
- package/dist/document/transaction/commit/merge-operations.d.ts.map +1 -1
- package/dist/document/transaction/commit/summarize-operations.d.ts +16 -0
- package/dist/document/transaction/commit/summarize-operations.d.ts.map +1 -0
- package/dist/document/transaction/commit/summarize-operations.types.d.ts +17 -0
- package/dist/document/transaction/commit/summarize-operations.types.d.ts.map +1 -0
- package/dist/document/transaction/create/create.d.ts +2 -0
- package/dist/document/transaction/create/create.d.ts.map +1 -1
- package/dist/document/transaction/guard.d.ts +5 -0
- package/dist/document/transaction/guard.d.ts.map +1 -1
- package/dist/document/transaction/index.d.ts +2 -0
- package/dist/document/transaction/index.d.ts.map +1 -1
- package/dist/document/transaction/main.d.ts +46 -16
- package/dist/document/transaction/main.d.ts.map +1 -1
- package/dist/document/transaction/stage-operations.d.ts.map +1 -1
- package/dist/document/transaction/update/update.d.ts +2 -0
- package/dist/document/transaction/update/update.d.ts.map +1 -1
- package/dist/document/types.d.ts +3 -5
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.extensions.d.ts.map +1 -1
- package/dist/engine-store-CIEqgPUb.js +348 -0
- package/dist/engine.constants-DBMjMmV9.js +98 -0
- package/dist/engine.d.ts +9 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +15805 -0
- package/dist/errors/codes.d.ts +451 -0
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/errors/errors.constants.d.ts +3 -0
- package/dist/errors/errors.constants.d.ts.map +1 -0
- package/dist/errors/errors.d.ts +10 -0
- package/dist/errors/errors.d.ts.map +1 -1
- package/dist/errors/types.d.ts +14 -0
- package/dist/errors/types.d.ts.map +1 -1
- package/dist/helpers/assert-fixed.d.ts +3 -1
- package/dist/helpers/assert-fixed.d.ts.map +1 -1
- package/dist/helpers/assert-xml-characters.d.ts +35 -0
- package/dist/helpers/assert-xml-characters.d.ts.map +1 -0
- package/dist/helpers/assert-xml-characters.types.d.ts +26 -0
- package/dist/helpers/assert-xml-characters.types.d.ts.map +1 -0
- package/dist/helpers/assert-xsi-type.d.ts +4 -0
- package/dist/helpers/assert-xsi-type.d.ts.map +1 -1
- package/dist/helpers/converter.d.ts +21 -6
- package/dist/helpers/converter.d.ts.map +1 -1
- package/dist/helpers/evaluate-expectations.d.ts +21 -0
- package/dist/helpers/evaluate-expectations.d.ts.map +1 -0
- package/dist/helpers/evaluate-expectations.types.d.ts +31 -0
- package/dist/helpers/evaluate-expectations.types.d.ts.map +1 -0
- package/dist/helpers/guard.d.ts +24 -4
- package/dist/helpers/guard.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/merge-extensions.d.ts +2 -0
- package/dist/helpers/merge-extensions.d.ts.map +1 -1
- package/dist/helpers/read-attributes.d.ts +4 -0
- package/dist/helpers/read-attributes.d.ts.map +1 -1
- package/dist/helpers/standardizing.d.ts +10 -0
- package/dist/helpers/standardizing.d.ts.map +1 -1
- package/dist/helpers/strip-attributes.d.ts +2 -0
- package/dist/helpers/strip-attributes.d.ts.map +1 -1
- package/dist/helpers-DVShv41E.js +489 -0
- package/dist/helpers.js +3 -439
- package/dist/in-process-link-DBeAOZRp.js +2791 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -12
- package/dist/perf/create-perf.d.ts +8 -1
- package/dist/perf/create-perf.d.ts.map +1 -1
- package/dist/perf/index.d.ts +1 -1
- package/dist/perf/index.d.ts.map +1 -1
- package/dist/perf/noop-perf.d.ts.map +1 -1
- package/dist/perf/perf.types.d.ts +65 -6
- package/dist/perf/perf.types.d.ts.map +1 -1
- package/dist/project/index.d.ts +7 -5
- package/dist/project/index.d.ts.map +1 -1
- package/dist/project/io/export-blob.d.ts +5 -2
- package/dist/project/io/export-blob.d.ts.map +1 -1
- package/dist/project/io/export-document.d.ts +5 -4
- package/dist/project/io/export-document.d.ts.map +1 -1
- package/dist/project/io/index.d.ts +1 -1
- package/dist/project/io/index.d.ts.map +1 -1
- package/dist/project/io/init-empty-document.d.ts +2 -0
- package/dist/project/io/init-empty-document.d.ts.map +1 -1
- package/dist/project/io/run-export.d.ts +19 -0
- package/dist/project/io/run-export.d.ts.map +1 -0
- package/dist/project/io/run-export.types.d.ts +45 -0
- package/dist/project/io/run-export.types.d.ts.map +1 -0
- package/dist/project/io/run-import.d.ts +15 -0
- package/dist/project/io/run-import.d.ts.map +1 -0
- package/dist/project/io/run-import.types.d.ts +19 -0
- package/dist/project/io/run-import.types.d.ts.map +1 -0
- package/dist/project/io/store-runtime.constants.d.ts +6 -0
- package/dist/project/io/store-runtime.constants.d.ts.map +1 -0
- package/dist/project/io/store-runtime.d.ts +12 -0
- package/dist/project/io/store-runtime.d.ts.map +1 -0
- package/dist/project/io/store-runtime.types.d.ts +18 -0
- package/dist/project/io/store-runtime.types.d.ts.map +1 -0
- package/dist/project/project-channel.d.ts +11 -0
- package/dist/project/project-channel.d.ts.map +1 -0
- package/dist/project/project.constants.d.ts +12 -0
- package/dist/project/project.constants.d.ts.map +1 -0
- package/dist/project/project.d.ts +315 -31
- package/dist/project/project.d.ts.map +1 -1
- package/dist/project/state/document-lifecycle.d.ts +0 -12
- package/dist/project/state/document-lifecycle.d.ts.map +1 -1
- package/dist/project/state/document-state.d.ts +4 -0
- package/dist/project/state/document-state.d.ts.map +1 -1
- package/dist/project/types.d.ts +126 -60
- package/dist/project/types.d.ts.map +1 -1
- package/dist/project-key-Ch34EtFa.js +1435 -0
- package/dist/rolldown-runtime-CYdcPHCu.js +12 -0
- package/dist/running-operations-vnijBvn7.js +76 -0
- package/dist/same-json-value-C6kUaoyt.js +1603 -0
- package/dist/sqlite.d.ts +5 -0
- package/dist/sqlite.d.ts.map +1 -0
- package/dist/sqlite.js +2671 -0
- package/dist/sqlite3.wasm +0 -0
- package/dist/store/apply-record-patch.d.ts +13 -0
- package/dist/store/apply-record-patch.d.ts.map +1 -0
- package/dist/store/closing-connections.d.ts +7 -0
- package/dist/store/closing-connections.d.ts.map +1 -0
- package/dist/store/closing-connections.types.d.ts +13 -0
- package/dist/store/closing-connections.types.d.ts.map +1 -0
- package/dist/store/commit-progress.d.ts +10 -0
- package/dist/store/commit-progress.d.ts.map +1 -0
- package/dist/store/compare-by-id.d.ts +10 -0
- package/dist/store/compare-by-id.d.ts.map +1 -0
- package/dist/store/document-path.constants.d.ts +20 -0
- package/dist/store/document-path.constants.d.ts.map +1 -0
- package/dist/store/document-path.d.ts +75 -0
- package/dist/store/document-path.d.ts.map +1 -0
- package/dist/store/document-path.types.d.ts +11 -0
- package/dist/store/document-path.types.d.ts.map +1 -0
- package/dist/store/engine/client/check-engine-wire.d.ts +8 -0
- package/dist/store/engine/client/check-engine-wire.d.ts.map +1 -0
- package/dist/store/engine/client/client.constants.d.ts +30 -0
- package/dist/store/engine/client/client.constants.d.ts.map +1 -0
- package/dist/store/engine/client/client.types.d.ts +200 -0
- package/dist/store/engine/client/client.types.d.ts.map +1 -0
- package/dist/store/engine/client/engine-client.d.ts +15 -0
- package/dist/store/engine/client/engine-client.d.ts.map +1 -0
- package/dist/store/engine/client/engine-control.d.ts +16 -0
- package/dist/store/engine/client/engine-control.d.ts.map +1 -0
- package/dist/store/engine/client/heartbeat-watch.d.ts +17 -0
- package/dist/store/engine/client/heartbeat-watch.d.ts.map +1 -0
- package/dist/store/engine/client/hub-connector.d.ts +11 -0
- package/dist/store/engine/client/hub-connector.d.ts.map +1 -0
- package/dist/store/engine/client/hub-connector.types.d.ts +25 -0
- package/dist/store/engine/client/hub-connector.types.d.ts.map +1 -0
- package/dist/store/engine/client/worker-connector.d.ts +32 -0
- package/dist/store/engine/client/worker-connector.d.ts.map +1 -0
- package/dist/store/engine/creation-refusal.d.ts +10 -0
- package/dist/store/engine/creation-refusal.d.ts.map +1 -0
- package/dist/store/engine/dialecte-refusal.d.ts +18 -0
- package/dist/store/engine/dialecte-refusal.d.ts.map +1 -0
- package/dist/store/engine/engine-store.d.ts +163 -0
- package/dist/store/engine/engine-store.d.ts.map +1 -0
- package/dist/store/engine/engine-store.types.d.ts +53 -0
- package/dist/store/engine/engine-store.types.d.ts.map +1 -0
- package/dist/store/engine/engine.constants.d.ts +14 -0
- package/dist/store/engine/engine.constants.d.ts.map +1 -0
- package/dist/store/engine/engine.types.d.ts +165 -0
- package/dist/store/engine/engine.types.d.ts.map +1 -0
- package/dist/store/engine/host/engine-wire.d.ts +19 -0
- package/dist/store/engine/host/engine-wire.d.ts.map +1 -0
- package/dist/store/engine/host/heartbeat.d.ts +33 -0
- package/dist/store/engine/host/heartbeat.d.ts.map +1 -0
- package/dist/store/engine/host/host.constants.d.ts +13 -0
- package/dist/store/engine/host/host.constants.d.ts.map +1 -0
- package/dist/store/engine/host/host.types.d.ts +65 -0
- package/dist/store/engine/host/host.types.d.ts.map +1 -0
- package/dist/store/engine/host/store-events.d.ts +14 -0
- package/dist/store/engine/host/store-events.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-client.constants.d.ts +27 -0
- package/dist/store/engine/hub/hub-client.constants.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-client.d.ts +46 -0
- package/dist/store/engine/hub/hub-client.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-client.types.d.ts +208 -0
- package/dist/store/engine/hub/hub-client.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-protocol.types.d.ts +193 -0
- package/dist/store/engine/hub/hub-protocol.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-router.d.ts +9 -0
- package/dist/store/engine/hub/hub-router.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-shell.d.ts +13 -0
- package/dist/store/engine/hub/hub-shell.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-shell.types.d.ts +64 -0
- package/dist/store/engine/hub/hub-shell.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub.constants.d.ts +33 -0
- package/dist/store/engine/hub/hub.constants.d.ts.map +1 -0
- package/dist/store/engine/hub/hub.types.d.ts +305 -0
- package/dist/store/engine/hub/hub.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub.worker.d.ts +2 -0
- package/dist/store/engine/hub/hub.worker.d.ts.map +1 -0
- package/dist/store/engine/hub/realm-host.d.ts +10 -0
- package/dist/store/engine/hub/realm-host.d.ts.map +1 -0
- package/dist/store/engine/hub/realm-host.types.d.ts +78 -0
- package/dist/store/engine/hub/realm-host.types.d.ts.map +1 -0
- package/dist/store/engine/project-key.d.ts +15 -0
- package/dist/store/engine/project-key.d.ts.map +1 -0
- package/dist/store/engine/wire/error-envelope.d.ts +25 -0
- package/dist/store/engine/wire/error-envelope.d.ts.map +1 -0
- package/dist/store/engine/wire/wire-values.d.ts +33 -0
- package/dist/store/engine/wire/wire-values.d.ts.map +1 -0
- package/dist/store/engine/wire/wire.constants.d.ts +116 -0
- package/dist/store/engine/wire/wire.constants.d.ts.map +1 -0
- package/dist/store/engine/wire/wire.types.d.ts +119 -0
- package/dist/store/engine/wire/wire.types.d.ts.map +1 -0
- package/dist/store/hub-public.d.ts +33 -0
- package/dist/store/hub-public.d.ts.map +1 -0
- package/dist/store/ignore-destroy-outcome.d.ts +6 -0
- package/dist/store/ignore-destroy-outcome.d.ts.map +1 -0
- package/dist/store/in-memory/in-memory-state.d.ts +46 -0
- package/dist/store/in-memory/in-memory-state.d.ts.map +1 -0
- package/dist/store/in-memory/in-memory-store.constants.d.ts +7 -0
- package/dist/store/in-memory/in-memory-store.constants.d.ts.map +1 -0
- package/dist/store/in-memory/in-memory-store.d.ts +105 -17
- package/dist/store/in-memory/in-memory-store.d.ts.map +1 -1
- package/dist/store/in-memory/types.d.ts +55 -1
- package/dist/store/in-memory/types.d.ts.map +1 -1
- package/dist/store/index.d.ts +8 -2
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/json-values.constants.d.ts +18 -0
- package/dist/store/json-values.constants.d.ts.map +1 -0
- package/dist/store/json-values.d.ts +40 -0
- package/dist/store/json-values.d.ts.map +1 -0
- package/dist/store/json-values.types.d.ts +18 -0
- package/dist/store/json-values.types.d.ts.map +1 -0
- package/dist/store/local/dexie-store.constants.d.ts +20 -0
- package/dist/store/local/dexie-store.constants.d.ts.map +1 -0
- package/dist/store/local/dexie-store.d.ts +134 -5
- package/dist/store/local/dexie-store.d.ts.map +1 -1
- package/dist/store/local/types.d.ts +6 -0
- package/dist/store/local/types.d.ts.map +1 -1
- package/dist/store/lost-write.d.ts +32 -0
- package/dist/store/lost-write.d.ts.map +1 -0
- package/dist/store/lost-write.types.d.ts +4 -0
- package/dist/store/lost-write.types.d.ts.map +1 -0
- package/dist/store/open-connections.d.ts +4 -0
- package/dist/store/open-connections.d.ts.map +1 -0
- package/dist/store/open-connections.types.d.ts +17 -0
- package/dist/store/open-connections.types.d.ts.map +1 -0
- package/dist/store/own-import.d.ts +10 -0
- package/dist/store/own-import.d.ts.map +1 -0
- package/dist/store/project-name.d.ts +10 -0
- package/dist/store/project-name.d.ts.map +1 -0
- package/dist/store/resolve-store.d.ts +28 -4
- package/dist/store/resolve-store.d.ts.map +1 -1
- package/dist/store/running-operations.d.ts +7 -0
- package/dist/store/running-operations.d.ts.map +1 -0
- package/dist/store/running-operations.types.d.ts +10 -0
- package/dist/store/running-operations.types.d.ts.map +1 -0
- package/dist/store/same-json-value.d.ts +9 -0
- package/dist/store/same-json-value.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/in-process-link.d.ts +20 -0
- package/dist/store/sqlite/adapter/in-process-link.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/in-process-link.types.d.ts +21 -0
- package/dist/store/sqlite/adapter/in-process-link.types.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/realm-storage.d.ts +10 -0
- package/dist/store/sqlite/adapter/realm-storage.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-connector.d.ts +14 -0
- package/dist/store/sqlite/adapter/sqlite-connector.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-engine-settings.d.ts +4 -0
- package/dist/store/sqlite/adapter/sqlite-engine-settings.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.d.ts +8 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.types.d.ts +5 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.types.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.d.ts +8 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.types.d.ts +5 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.types.d.ts.map +1 -0
- package/dist/store/sqlite/engine/blobs.d.ts +55 -0
- package/dist/store/sqlite/engine/blobs.d.ts.map +1 -0
- package/dist/store/sqlite/engine/bulk-insert.d.ts +31 -0
- package/dist/store/sqlite/engine/bulk-insert.d.ts.map +1 -0
- package/dist/store/sqlite/engine/commit.d.ts +20 -0
- package/dist/store/sqlite/engine/commit.d.ts.map +1 -0
- package/dist/store/sqlite/engine/device-cache.d.ts +13 -0
- package/dist/store/sqlite/engine/device-cache.d.ts.map +1 -0
- package/dist/store/sqlite/engine/engine-errors.d.ts +26 -0
- package/dist/store/sqlite/engine/engine-errors.d.ts.map +1 -0
- package/dist/store/sqlite/engine/engine.constants.d.ts +144 -0
- package/dist/store/sqlite/engine/engine.constants.d.ts.map +1 -0
- package/dist/store/sqlite/engine/engine.types.d.ts +361 -0
- package/dist/store/sqlite/engine/engine.types.d.ts.map +1 -0
- package/dist/store/sqlite/engine/history.d.ts +114 -0
- package/dist/store/sqlite/engine/history.d.ts.map +1 -0
- package/dist/store/sqlite/engine/import-queue.d.ts +7 -0
- package/dist/store/sqlite/engine/import-queue.d.ts.map +1 -0
- package/dist/store/sqlite/engine/import-target.d.ts +23 -0
- package/dist/store/sqlite/engine/import-target.d.ts.map +1 -0
- package/dist/store/sqlite/engine/import-window.d.ts +23 -0
- package/dist/store/sqlite/engine/import-window.d.ts.map +1 -0
- package/dist/store/sqlite/engine/reclaim.d.ts +13 -0
- package/dist/store/sqlite/engine/reclaim.d.ts.map +1 -0
- package/dist/store/sqlite/engine/records.d.ts +117 -0
- package/dist/store/sqlite/engine/records.d.ts.map +1 -0
- package/dist/store/sqlite/engine/registry.d.ts +76 -0
- package/dist/store/sqlite/engine/registry.d.ts.map +1 -0
- package/dist/store/sqlite/engine/schema.d.ts +57 -0
- package/dist/store/sqlite/engine/schema.d.ts.map +1 -0
- package/dist/store/sqlite/engine/sqlite-engine.d.ts +14 -0
- package/dist/store/sqlite/engine/sqlite-engine.d.ts.map +1 -0
- package/dist/store/sqlite/engine/transaction.d.ts +12 -0
- package/dist/store/sqlite/engine/transaction.d.ts.map +1 -0
- package/dist/store/sqlite/list-projects.constants.d.ts +12 -0
- package/dist/store/sqlite/list-projects.constants.d.ts.map +1 -0
- package/dist/store/sqlite/list-projects.d.ts +22 -0
- package/dist/store/sqlite/list-projects.d.ts.map +1 -0
- package/dist/store/sqlite/list-projects.types.d.ts +28 -0
- package/dist/store/sqlite/list-projects.types.d.ts.map +1 -0
- package/dist/store/sqlite/load-sqlite.d.ts +11 -0
- package/dist/store/sqlite/load-sqlite.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/close-engine.d.ts +18 -0
- package/dist/store/sqlite/runtime/close-engine.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/install-pool.d.ts +94 -0
- package/dist/store/sqlite/runtime/install-pool.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/pool-header.d.ts +13 -0
- package/dist/store/sqlite/runtime/pool-header.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/progress-beat.d.ts +13 -0
- package/dist/store/sqlite/runtime/progress-beat.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/runtime.constants.d.ts +57 -0
- package/dist/store/sqlite/runtime/runtime.constants.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/runtime.types.d.ts +56 -0
- package/dist/store/sqlite/runtime/runtime.types.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/serve-dialecte-engine.d.ts +16 -0
- package/dist/store/sqlite/runtime/serve-dialecte-engine.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite-store-of.d.ts +7 -0
- package/dist/store/sqlite/sqlite-store-of.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite-text.d.ts +20 -0
- package/dist/store/sqlite/sqlite-text.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite-wasm-url.d.ts +9 -0
- package/dist/store/sqlite/sqlite-wasm-url.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite.constants.d.ts +15 -0
- package/dist/store/sqlite/sqlite.constants.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite.types.d.ts +36 -0
- package/dist/store/sqlite/sqlite.types.d.ts.map +1 -0
- package/dist/store/sqlite-storage.constants.d.ts +14 -0
- package/dist/store/sqlite-storage.constants.d.ts.map +1 -0
- package/dist/store/sqlite-storage.d.ts +22 -0
- package/dist/store/sqlite-storage.d.ts.map +1 -0
- package/dist/store/sqlite-storage.types.d.ts +24 -0
- package/dist/store/sqlite-storage.types.d.ts.map +1 -0
- package/dist/store/store-errors.d.ts +51 -0
- package/dist/store/store-errors.d.ts.map +1 -0
- package/dist/store/store.constants.d.ts +15 -3
- package/dist/store/store.constants.d.ts.map +1 -1
- package/dist/store/store.types.d.ts +280 -16
- package/dist/store/store.types.d.ts.map +1 -1
- package/dist/store/stored-record.d.ts +16 -0
- package/dist/store/stored-record.d.ts.map +1 -0
- package/dist/store/unfinished-imports.d.ts +15 -0
- package/dist/store/unfinished-imports.d.ts.map +1 -0
- package/dist/store/write-outcome.d.ts +34 -0
- package/dist/store/write-outcome.d.ts.map +1 -0
- package/dist/test/assert-valid-xml/assert-valid-xml.constants.d.ts +7 -0
- package/dist/test/assert-valid-xml/assert-valid-xml.constants.d.ts.map +1 -0
- package/dist/test/assert-valid-xml/assert-valid-xml.d.ts +19 -18
- package/dist/test/assert-valid-xml/assert-valid-xml.d.ts.map +1 -1
- package/dist/test/assert-valid-xml/assert-valid-xml.types.d.ts +8 -4
- package/dist/test/assert-valid-xml/assert-valid-xml.types.d.ts.map +1 -1
- package/dist/test/assert-xml/assert-xml.constants.d.ts +25 -0
- package/dist/test/assert-xml/assert-xml.constants.d.ts.map +1 -0
- package/dist/test/assert-xml/assert-xml.d.ts +23 -34
- package/dist/test/assert-xml/assert-xml.d.ts.map +1 -1
- package/dist/test/assert-xml/assert-xml.types.d.ts +48 -0
- package/dist/test/assert-xml/assert-xml.types.d.ts.map +1 -0
- package/dist/test/assert-xml/describe-nearby.d.ts +16 -0
- package/dist/test/assert-xml/describe-nearby.d.ts.map +1 -0
- package/dist/test/assert-xml/describe-node-place.d.ts +15 -0
- package/dist/test/assert-xml/describe-node-place.d.ts.map +1 -0
- package/dist/test/assert-xml/index.d.ts +1 -1
- package/dist/test/assert-xml/index.d.ts.map +1 -1
- package/dist/test/assert-xml/query-failure-message.d.ts +24 -0
- package/dist/test/assert-xml/query-failure-message.d.ts.map +1 -0
- package/dist/test/assert-xml/read-xpath-step.d.ts +8 -0
- package/dist/test/assert-xml/read-xpath-step.d.ts.map +1 -0
- package/dist/test/assert-xml/xpath-parser.d.ts +2 -1
- package/dist/test/assert-xml/xpath-parser.d.ts.map +1 -1
- package/dist/test/config.d.ts +5 -0
- package/dist/test/config.d.ts.map +1 -1
- package/dist/test/constant.d.ts +2 -0
- package/dist/test/constant.d.ts.map +1 -1
- package/dist/test/create-test-dialecte.d.ts +32 -37
- package/dist/test/create-test-dialecte.d.ts.map +1 -1
- package/dist/test/create-test-dialecte.types.d.ts +99 -0
- package/dist/test/create-test-dialecte.types.d.ts.map +1 -0
- package/dist/test/create-test-helpers-internal.types.d.ts +19 -0
- package/dist/test/create-test-helpers-internal.types.d.ts.map +1 -0
- package/dist/test/create-test-helpers.d.ts +13 -0
- package/dist/test/create-test-helpers.d.ts.map +1 -0
- package/dist/test/create-test-helpers.types.d.ts +50 -0
- package/dist/test/create-test-helpers.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-constraint.d.ts +3 -0
- package/dist/test/fixtures/test-entry-scan-constraint.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-edges.types.d.ts +10 -0
- package/dist/test/fixtures/test-entry-scan-edges.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-recursive.d.ts +4 -0
- package/dist/test/fixtures/test-entry-scan-recursive.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-recursive.types.d.ts +15 -0
- package/dist/test/fixtures/test-entry-scan-recursive.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-shapes.d.ts +14 -0
- package/dist/test/fixtures/test-entry-scan-shapes.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-shapes.types.d.ts +14 -0
- package/dist/test/fixtures/test-entry-scan-shapes.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-tree.d.ts +3 -0
- package/dist/test/fixtures/test-entry-scan-tree.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan.d.ts +5 -0
- package/dist/test/fixtures/test-entry-scan.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan.types.d.ts +5 -0
- package/dist/test/fixtures/test-entry-scan.types.d.ts.map +1 -0
- package/dist/test/generated/definition.generated.d.ts +5 -0
- package/dist/test/generated/definition.generated.d.ts.map +1 -1
- package/dist/test/in-memory-storage.setup.d.ts +2 -0
- package/dist/test/in-memory-storage.setup.d.ts.map +1 -0
- package/dist/test/index.d.ts +6 -0
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/normalize-uuids.constants.d.ts +3 -0
- package/dist/test/normalize-uuids.constants.d.ts.map +1 -0
- package/dist/test/normalize-uuids.d.ts +12 -0
- package/dist/test/normalize-uuids.d.ts.map +1 -1
- package/dist/test/run-test-cases.d.ts +30 -11
- package/dist/test/run-test-cases.d.ts.map +1 -1
- package/dist/test/run-test-cases.type.d.ts +16 -0
- package/dist/test/run-test-cases.type.d.ts.map +1 -1
- package/dist/test/sqlite-storage.setup.d.ts +1 -0
- package/dist/test/sqlite-storage.setup.d.ts.map +1 -0
- package/dist/test/test-dialecte-setup.d.ts +31 -0
- package/dist/test/test-dialecte-setup.d.ts.map +1 -0
- package/dist/test/test-dialecte-setup.types.d.ts +29 -0
- package/dist/test/test-dialecte-setup.types.d.ts.map +1 -0
- package/dist/test/test-dialecte.d.ts +2722 -0
- package/dist/test/test-dialecte.d.ts.map +1 -0
- package/dist/test/test-dialecte.types.d.ts +3 -0
- package/dist/test/test-dialecte.types.d.ts.map +1 -0
- package/dist/test/test-dialecte.worker.d.ts +2 -0
- package/dist/test/test-dialecte.worker.d.ts.map +1 -0
- package/dist/test/test-entry-environment.constants.d.ts +27 -0
- package/dist/test/test-entry-environment.constants.d.ts.map +1 -0
- package/dist/test/test-record.d.ts +49 -1
- package/dist/test/test-record.d.ts.map +1 -1
- package/dist/test/test-storage/index.d.ts +5 -0
- package/dist/test/test-storage/index.d.ts.map +1 -0
- package/dist/test/test-storage/read-test-storage.d.ts +4 -0
- package/dist/test/test-storage/read-test-storage.d.ts.map +1 -0
- package/dist/test/test-storage/resolve-test-storage.d.ts +9 -0
- package/dist/test/test-storage/resolve-test-storage.d.ts.map +1 -0
- package/dist/test/test-storage/test-storage.constants.d.ts +9 -0
- package/dist/test/test-storage/test-storage.constants.d.ts.map +1 -0
- package/dist/test/test-storage/test-storage.types.d.ts +15 -0
- package/dist/test/test-storage/test-storage.types.d.ts.map +1 -0
- package/dist/test/test-storage/test-store-for.d.ts +19 -0
- package/dist/test/test-storage/test-store-for.d.ts.map +1 -0
- package/dist/test/test-storage/use-test-storage.d.ts +14 -0
- package/dist/test/test-storage/use-test-storage.d.ts.map +1 -0
- package/dist/test/test-timing.constants.d.ts +15 -0
- package/dist/test/test-timing.constants.d.ts.map +1 -0
- package/dist/test/xml/engine-console.d.ts +6 -0
- package/dist/test/xml/engine-console.d.ts.map +1 -0
- package/dist/test/xml/engine.d.ts +3 -0
- package/dist/test/xml/engine.d.ts.map +1 -0
- package/dist/test/xml/index.d.ts +8 -0
- package/dist/test/xml/index.d.ts.map +1 -0
- package/dist/test/xml/malformed-xml-error.d.ts +5 -0
- package/dist/test/xml/malformed-xml-error.d.ts.map +1 -0
- package/dist/test/xml/print-node.d.ts +7 -0
- package/dist/test/xml/print-node.d.ts.map +1 -0
- package/dist/test/xml/select-nodes.d.ts +14 -0
- package/dist/test/xml/select-nodes.d.ts.map +1 -0
- package/dist/test/xml/with-xml-document.constants.d.ts +7 -0
- package/dist/test/xml/with-xml-document.constants.d.ts.map +1 -0
- package/dist/test/xml/with-xml-document.d.ts +14 -0
- package/dist/test/xml/with-xml-document.d.ts.map +1 -0
- package/dist/test/xml/xml-query-refused-error.d.ts +13 -0
- package/dist/test/xml/xml-query-refused-error.d.ts.map +1 -0
- package/dist/test/xml/xml.constants.d.ts +16 -0
- package/dist/test/xml/xml.constants.d.ts.map +1 -0
- package/dist/test/xml/xml.types.d.ts +31 -0
- package/dist/test/xml/xml.types.d.ts.map +1 -0
- package/dist/test/xsd/test-ext.xsd +226 -0
- package/dist/test/xsd/test.xsd +528 -0
- package/dist/test.js +3427 -406
- package/dist/types/dialecte-config.d.ts +6 -0
- package/dist/types/dialecte-config.d.ts.map +1 -1
- package/dist/types/io.d.ts +5 -0
- package/dist/types/io.d.ts.map +1 -1
- package/dist/utils/attribute-rules.d.ts +16 -1
- package/dist/utils/attribute-rules.d.ts.map +1 -1
- package/dist/utils/child-occurrences.constants.d.ts +4 -0
- package/dist/utils/child-occurrences.constants.d.ts.map +1 -0
- package/dist/utils/child-occurrences.d.ts +17 -0
- package/dist/utils/child-occurrences.d.ts.map +1 -0
- package/dist/utils/child-occurrences.types.d.ts +6 -0
- package/dist/utils/child-occurrences.types.d.ts.map +1 -0
- package/dist/utils/datatype.d.ts +4 -0
- package/dist/utils/datatype.d.ts.map +1 -1
- package/dist/utils/format-xml.d.ts +4 -0
- package/dist/utils/format-xml.d.ts.map +1 -1
- package/dist/utils/index.d.ts +5 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/invariant.d.ts +2 -0
- package/dist/utils/invariant.d.ts.map +1 -1
- package/dist/utils/namespaces.d.ts +15 -1
- package/dist/utils/namespaces.d.ts.map +1 -1
- package/dist/utils/order-children.d.ts +14 -3
- package/dist/utils/order-children.d.ts.map +1 -1
- package/dist/utils/order-children.types.d.ts +10 -0
- package/dist/utils/order-children.types.d.ts.map +1 -0
- package/dist/utils/particle-occurrences.d.ts +4 -0
- package/dist/utils/particle-occurrences.d.ts.map +1 -0
- package/dist/utils/required-choices.d.ts +17 -0
- package/dist/utils/required-choices.d.ts.map +1 -0
- package/dist/utils/required-choices.types.d.ts +15 -0
- package/dist/utils/required-choices.types.d.ts.map +1 -0
- package/dist/utils/resolve-definition.d.ts +4 -0
- package/dist/utils/resolve-definition.d.ts.map +1 -1
- package/dist/utils/save-to-disk.constants.d.ts +3 -0
- package/dist/utils/save-to-disk.constants.d.ts.map +1 -0
- package/dist/utils/save-to-disk.d.ts +17 -5
- package/dist/utils/save-to-disk.d.ts.map +1 -1
- package/dist/utils/save-to-disk.types.d.ts +17 -0
- package/dist/utils/save-to-disk.types.d.ts.map +1 -0
- package/dist/utils/seeded-uuid.constants.d.ts +5 -0
- package/dist/utils/seeded-uuid.constants.d.ts.map +1 -0
- package/dist/utils/seeded-uuid.d.ts +15 -0
- package/dist/utils/seeded-uuid.d.ts.map +1 -0
- package/dist/utils/seeded-uuid.types.d.ts +8 -0
- package/dist/utils/seeded-uuid.types.d.ts.map +1 -0
- package/dist/utils/tell-listener.constants.d.ts +9 -0
- package/dist/utils/tell-listener.constants.d.ts.map +1 -0
- package/dist/utils/tell-listener.d.ts +24 -0
- package/dist/utils/tell-listener.d.ts.map +1 -0
- package/dist/utils/xml-characters.constants.d.ts +9 -0
- package/dist/utils/xml-characters.constants.d.ts.map +1 -0
- package/dist/utils/xml-characters.d.ts +8 -0
- package/dist/utils/xml-characters.d.ts.map +1 -0
- package/dist/utils/xml-whitespace.constants.d.ts +8 -0
- package/dist/utils/xml-whitespace.constants.d.ts.map +1 -0
- package/dist/utils/xml-whitespace.d.ts +19 -0
- package/dist/utils/xml-whitespace.d.ts.map +1 -0
- package/dist/utils/xsi-type.d.ts +4 -0
- package/dist/utils/xsi-type.d.ts.map +1 -1
- package/dist/utils/yield-to-queue.d.ts +6 -0
- package/dist/utils/yield-to-queue.d.ts.map +1 -0
- package/dist/utils-USNkj4sT.js +1275 -0
- package/dist/utils.js +1 -2
- package/dist/xml/build/document-root.d.ts +7 -0
- package/dist/xml/build/document-root.d.ts.map +1 -0
- package/dist/xml/build/index.d.ts +0 -5
- package/dist/xml/build/index.d.ts.map +1 -1
- package/dist/xml/build/record-element.d.ts +15 -0
- package/dist/xml/build/record-element.d.ts.map +1 -0
- package/dist/xml/build/record-element.types.d.ts +12 -0
- package/dist/xml/build/record-element.types.d.ts.map +1 -0
- package/dist/xml/build/write-xml-records.d.ts +7 -0
- package/dist/xml/build/write-xml-records.d.ts.map +1 -0
- package/dist/xml/build/write-xml-records.types.d.ts +11 -0
- package/dist/xml/build/write-xml-records.types.d.ts.map +1 -0
- package/dist/xml/build/xml-element.d.ts +79 -0
- package/dist/xml/build/xml-element.d.ts.map +1 -0
- package/dist/xml/build/xml-element.types.d.ts +34 -0
- package/dist/xml/build/xml-element.types.d.ts.map +1 -0
- package/dist/xml/build/xml-writer.constants.d.ts +24 -0
- package/dist/xml/build/xml-writer.constants.d.ts.map +1 -0
- package/dist/xml/build/xml-writer.d.ts +40 -0
- package/dist/xml/build/xml-writer.d.ts.map +1 -0
- package/dist/xml/build/xml-writer.types.d.ts +34 -0
- package/dist/xml/build/xml-writer.types.d.ts.map +1 -0
- package/dist/xml/dom/index.d.ts +3 -0
- package/dist/xml/dom/index.d.ts.map +1 -0
- package/dist/xml/dom/xml-document-from-file.d.ts +10 -0
- package/dist/xml/dom/xml-document-from-file.d.ts.map +1 -0
- package/dist/xml/dom/xml-document-from-file.types.d.ts +5 -0
- package/dist/xml/dom/xml-document-from-file.types.d.ts.map +1 -0
- package/dist/xml/index.d.ts +1 -0
- package/dist/xml/index.d.ts.map +1 -1
- package/dist/xml/inspect-xml.d.ts +2 -0
- package/dist/xml/inspect-xml.d.ts.map +1 -1
- package/dist/xml/parse/index.d.ts +1 -1
- package/dist/xml/parse/index.d.ts.map +1 -1
- package/dist/xml/parse/parse-xml-document.constants.d.ts +5 -0
- package/dist/xml/parse/parse-xml-document.constants.d.ts.map +1 -0
- package/dist/xml/parse/parse-xml-document.d.ts +13 -2
- package/dist/xml/parse/parse-xml-document.d.ts.map +1 -1
- package/dist/xml/parse/parse-xml-document.types.d.ts +7 -2
- package/dist/xml/parse/parse-xml-document.types.d.ts.map +1 -1
- package/dist/xml/parse/parser.constants.d.ts +7 -0
- package/dist/xml/parse/parser.constants.d.ts.map +1 -0
- package/dist/xml/parse/parser.d.ts.map +1 -1
- package/package.json +88 -10
- package/skills/dialecte/SKILL.md +345 -0
- package/skills/dialecte/references/api.json +1830 -0
- package/skills/dialecte/references/api.md +557 -0
- package/skills/dialecte/references/core-api.md +205 -0
- package/skills/dialecte/references/testing.md +116 -0
- package/skills/dialecte-contributing/SKILL.md +374 -0
- package/skills/dialecte-contributing/references/code-rules.md +115 -0
- package/skills/dialecte-contributing/references/landing-changes.md +87 -0
- package/skills/dialecte-contributing/references/lot-in-a-package.md +45 -0
- package/skills/dialecte-contributing/references/perf.md +40 -0
- package/skills/dialecte-contributing/references/traps.md +109 -0
- package/skills/dialecte-lot/SKILL.md +526 -0
- package/skills/dialecte-lot/references/briefs.md +161 -0
- package/skills/dialecte-lot/references/model-tiers.md +52 -0
- package/skills/dialecte-lot/references/retro.md +51 -0
- package/skills/dialecte-lot/references/standard-check.md +45 -0
- package/skills/dialecte-lot/references/stations.md +110 -0
- package/dist/project/io/import-document.d.ts +0 -7
- package/dist/project/io/import-document.d.ts.map +0 -1
- package/dist/test/assert-xml/types.d.ts +0 -2
- package/dist/test/assert-xml/types.d.ts.map +0 -1
- package/dist/utils-DJN0Md0v.js +0 -624
- package/dist/xml/build/build-xml-document.d.ts +0 -10
- package/dist/xml/build/build-xml-document.d.ts.map +0 -1
- package/dist/xml/build/build-xml-document.types.d.ts +0 -22
- package/dist/xml/build/build-xml-document.types.d.ts.map +0 -1
- package/dist/xml/build/download-file.d.ts +0 -7
- package/dist/xml/build/download-file.d.ts.map +0 -1
- package/dist/xml/build/formatter.d.ts +0 -2
- package/dist/xml/build/formatter.d.ts.map +0 -1
- package/dist/xml/build/serialize.d.ts +0 -11
- package/dist/xml/build/serialize.d.ts.map +0 -1
- package/dist/xml/build/serialize.types.d.ts +0 -12
- package/dist/xml/build/serialize.types.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dialecte/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Dialecte - Core functionality for Dialecte SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
"source": "src/index.ts",
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|
|
16
|
+
"skills",
|
|
17
|
+
"!skills/*/evals",
|
|
16
18
|
"bin"
|
|
17
19
|
],
|
|
18
20
|
"type": "module",
|
|
@@ -25,6 +27,7 @@
|
|
|
25
27
|
"types": "./dist/test.d.ts",
|
|
26
28
|
"default": "./dist/test.js"
|
|
27
29
|
},
|
|
30
|
+
"./test/xsd/*": "./dist/test/xsd/*",
|
|
28
31
|
"./utils": {
|
|
29
32
|
"types": "./dist/utils.d.ts",
|
|
30
33
|
"default": "./dist/utils.js"
|
|
@@ -32,30 +35,46 @@
|
|
|
32
35
|
"./helpers": {
|
|
33
36
|
"types": "./dist/helpers.d.ts",
|
|
34
37
|
"default": "./dist/helpers.js"
|
|
38
|
+
},
|
|
39
|
+
"./engine": {
|
|
40
|
+
"types": "./dist/engine.d.ts",
|
|
41
|
+
"default": "./dist/engine.js"
|
|
42
|
+
},
|
|
43
|
+
"./sqlite": {
|
|
44
|
+
"types": "./dist/sqlite.d.ts",
|
|
45
|
+
"default": "./dist/sqlite.js"
|
|
35
46
|
}
|
|
36
47
|
},
|
|
37
48
|
"scripts": {
|
|
38
49
|
"//====== BUILD ======//": "",
|
|
39
50
|
"build": "run-p type-check \"build-only {@}\" --",
|
|
40
|
-
"build-only": "tsc -p tsconfig.json && vite build",
|
|
51
|
+
"build-only": "tsc -p tsconfig.json && vite build && vite build -c vite.engine.config.ts",
|
|
41
52
|
"build:watch": "vite build --watch",
|
|
42
53
|
"//====== VITEPRESS ======//": "",
|
|
43
54
|
"doc:dev": "vitepress dev",
|
|
44
55
|
"doc:build": "vitepress build",
|
|
45
56
|
"doc:preview": "vitepress preview",
|
|
46
57
|
"//====== TEST ======//": "",
|
|
47
|
-
"test": "
|
|
58
|
+
"test": "npm run test:node && npm run test:browser",
|
|
59
|
+
"test:node": "vitest run --project node --project node-indexeddb --project node-sqlite",
|
|
60
|
+
"test:browser": "vitest run --project browser",
|
|
61
|
+
"test:browser:all": "vitest run --project browser-all",
|
|
48
62
|
"test:perf": "VITE_BENCH=1 vitest run --project perf --mode bench --reporter=verbose",
|
|
63
|
+
"test:perf:node": "VITE_BENCH=1 vitest run --project perf-node --mode bench --reporter=verbose",
|
|
64
|
+
"test:hook": "dialecte gate --hook",
|
|
49
65
|
"//====== CHECK ======//": "",
|
|
50
|
-
"check": "run-p type-check type-check:test lint:check format:check",
|
|
66
|
+
"check": "run-p type-check type-check:test type-check:node lint:check format:check",
|
|
67
|
+
"skills:generate": "dialecte skills generate",
|
|
68
|
+
"skills:check": "dialecte skills check",
|
|
51
69
|
"type-check": "tsc -p tsconfig.build.json --noEmit --skipLibCheck",
|
|
52
70
|
"type-check:test": "tsc -p tsconfig.vitest.json --noEmit",
|
|
71
|
+
"type-check:node": "tsc -p tsconfig.node.json --noEmit",
|
|
53
72
|
"//====== TYPE PERF ======//": "",
|
|
54
73
|
"coverage:gen": "dialecte coverage",
|
|
55
74
|
"type-bench": "npm run coverage:gen && dialecte bench",
|
|
56
75
|
"type-bench:check": "npm run coverage:gen && dialecte bench --check",
|
|
57
76
|
"type-narrowing": "npm run coverage:gen && dialecte narrowing",
|
|
58
|
-
"lint:check": "oxlint",
|
|
77
|
+
"lint:check": "oxlint --deny-warnings",
|
|
59
78
|
"lint:fix": "oxlint . --fix -D correctness --ignore-path .gitignore",
|
|
60
79
|
"format:check": "oxfmt --check",
|
|
61
80
|
"format:fix": "oxfmt",
|
|
@@ -63,22 +82,25 @@
|
|
|
63
82
|
"prepare": "husky"
|
|
64
83
|
},
|
|
65
84
|
"dependencies": {
|
|
85
|
+
"@sqlite.org/sqlite-wasm": "3.54.1-build1",
|
|
66
86
|
"@types/sax": "1.2.7",
|
|
87
|
+
"comlink": "4.4.2",
|
|
67
88
|
"dexie": "4.4.6",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
89
|
+
"libxml2-wasm": "0.7.2",
|
|
90
|
+
"sax": "^1.4.3"
|
|
70
91
|
},
|
|
71
92
|
"devDependencies": {
|
|
72
|
-
"@dialecte/cli": "0.
|
|
93
|
+
"@dialecte/cli": "0.3.1",
|
|
73
94
|
"@tsconfig/node24": "^24.0.4",
|
|
74
95
|
"@types/node": "^24.12.4",
|
|
75
96
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
76
97
|
"@vitest/browser-playwright": "^4.1.10",
|
|
77
|
-
"
|
|
98
|
+
"fake-indexeddb": "^6.2.6",
|
|
78
99
|
"husky": "^9.1.7",
|
|
79
100
|
"jiti": "^2.4.2",
|
|
101
|
+
"mermaid": "11.17.2",
|
|
80
102
|
"npm-run-all2": "^8.0.4",
|
|
81
|
-
"oxfmt": "^0.
|
|
103
|
+
"oxfmt": "^0.75.0",
|
|
82
104
|
"oxlint": "^1.68.0",
|
|
83
105
|
"oxlint-tsgolint": "^0.23.0",
|
|
84
106
|
"playwright": "^1.60.0",
|
|
@@ -88,6 +110,62 @@
|
|
|
88
110
|
"vite-plugin-dts": "^5.0.2",
|
|
89
111
|
"vitepress": "^2.0.0-alpha.17",
|
|
90
112
|
"vitepress-plugin-llms": "^1.13.2",
|
|
113
|
+
"vitepress-plugin-mermaid": "2.0.17",
|
|
91
114
|
"vitest": "^4.1.10"
|
|
115
|
+
},
|
|
116
|
+
"overrides": {
|
|
117
|
+
"vitepress-plugin-mermaid": {
|
|
118
|
+
"vitepress": "$vitepress"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"dialecte": {
|
|
122
|
+
"profile": "contributor",
|
|
123
|
+
"tdd": {
|
|
124
|
+
"production": [
|
|
125
|
+
"src/test"
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"gate": {
|
|
129
|
+
"fast": [
|
|
130
|
+
{
|
|
131
|
+
"name": "check",
|
|
132
|
+
"run": "npm run check"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "skills",
|
|
136
|
+
"run": "npm run skills:check"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "tests",
|
|
140
|
+
"run": "npx vitest run --changed --project node --project node-indexeddb",
|
|
141
|
+
"counts": "tests",
|
|
142
|
+
"changedOnly": true
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"full": [
|
|
146
|
+
{
|
|
147
|
+
"name": "check",
|
|
148
|
+
"run": "npm run check"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "skills",
|
|
152
|
+
"run": "npm run skills:check"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "build",
|
|
156
|
+
"run": "npm run build"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "tests",
|
|
160
|
+
"run": "npm run test:node",
|
|
161
|
+
"counts": "tests"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "browser tests",
|
|
165
|
+
"run": "npx vitest run --project browser",
|
|
166
|
+
"counts": "tests"
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
}
|
|
92
170
|
}
|
|
93
171
|
}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dialecte
|
|
3
|
+
description: Work with Dialecte, the XSD-to-typed-DSL engine (@dialecte/core plus a dialecte package, published or generated from your own XSD) in application code - open a Project, read with doc.query, write with doc.transaction, import/export XML, write a local (custom) extension in your app (shape, node-tier tests, product choices passed per call as a policy, promotion), keep document logic out of UI components, write table-driven tests. It gives the mental model, the reuse ladder to run before writing any helper, and the traps that make code slow or wrong. Use it whenever code imports @dialecte/*, touches records, refs, getAttributes, getTree, findDescendants, addChild, deepClone, hooks or run*TestCases, or the user mentions dialecte, even for a small read. To change dialecte itself use dialecte-contributing; for a dialecte's own business verbs use that dialecte's skill (dialecte-<id>, shipped with its package); to generate a dialecte from an XSD use dialecte-create.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: dialecte
|
|
7
|
+
version: '0.1.0'
|
|
8
|
+
audience: consumer
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<!-- dialecte-skills ignore: doc.query.inventory.lowStock tx.inventory.restock project.state doc.state doc.query.myFeature.findOrphanParts -->
|
|
12
|
+
|
|
13
|
+
# Dialecte (using it)
|
|
14
|
+
|
|
15
|
+
Dialecte turns an XSD into a typed DSL over XML documents stored in a database. Almost every "I need
|
|
16
|
+
a function that does X with these records" already exists somewhere in its layers, and the most
|
|
17
|
+
common failure is writing it again: a local `toRef`, an attribute finder, an ancestor walk, a
|
|
18
|
+
uuid/name fix-up that a hook already performs on every write. This skill exists to stop that.
|
|
19
|
+
|
|
20
|
+
## The mental model: four layers, each owns something
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
your app custom extensions, services, UI (yours)
|
|
24
|
+
dialecte package @dialecte/<id>, @acme/widget (domain)
|
|
25
|
+
├ definition/*.generated.ts generated from the XSD - never edited by hand
|
|
26
|
+
├ config/ wires the definition into core, `namespace <Name>` types
|
|
27
|
+
├ hooks/ automatic coherence on every write and on import
|
|
28
|
+
├ extensions/<ns>/ business verbs: doc.query.<ns>.<verb>(), tx.<ns>.<verb>()
|
|
29
|
+
└ test/ run<Name>TestCases, XML validators for fixtures
|
|
30
|
+
@dialecte/core schema-agnostic engine: Project, Document, Query, Transaction,
|
|
31
|
+
records + refs, hook dispatch, XML import/export, stores, errors, test runner
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- **Core knows no domain.** It never contains the rules of any schema. A domain rule lives in the
|
|
35
|
+
dialecte package; an app-only rule lives in the app (a local extension for document code, a policy
|
|
36
|
+
for your product's choices: see below).
|
|
37
|
+
- **Using is not changing.** This skill is for code that uses a dialecte. Changing a dialecte package
|
|
38
|
+
itself (its gates, lots, hand-overs, its pull request) is `dialecte-contributing`; nothing in it is
|
|
39
|
+
needed to use one.
|
|
40
|
+
- **The definition is the source of truth** for which elements, attributes, children, parents,
|
|
41
|
+
defaults and types exist. From app code read it through the package's config
|
|
42
|
+
(`<NAME>_DIALECTE_CONFIG.children / parents / attributes / descendants / ancestors`) or
|
|
43
|
+
`query.getDefinition(ref)`, instead of writing a list by hand.
|
|
44
|
+
TypeScript types are generated from it, so the compiler already rejects an invalid child or
|
|
45
|
+
attribute.
|
|
46
|
+
- **Hooks keep a document coherent automatically.** If the dialecte has an `afterCreated` hook that
|
|
47
|
+
fills reference paths, your code must not fill them too. Know the hooks before writing any write.
|
|
48
|
+
- **Extensions are the dialecte's business API.** They are bound onto every query and transaction:
|
|
49
|
+
`doc.query.inventory.lowStock(...)`, `tx.inventory.restock(...)`.
|
|
50
|
+
|
|
51
|
+
## Step 0: is this skill your version's?
|
|
52
|
+
|
|
53
|
+
This skill ships inside `@dialecte/core` and describes the core it ships with (0.8). If your project
|
|
54
|
+
pins another core, read the skill of that version (`npx @dialecte/cli skills sync` installs the one
|
|
55
|
+
matching your `node_modules`) and confirm signatures in its `.d.ts`.
|
|
56
|
+
|
|
57
|
+
## Look it up with the cli first: one command each
|
|
58
|
+
|
|
59
|
+
`@dialecte/cli` (0.2 or later, run as `npx @dialecte/cli <command>`) answers from what is installed -
|
|
60
|
+
the same with or without the repositories - in a few lines (`--json` for more). Run these before
|
|
61
|
+
reading `node_modules`, the sources or the docs:
|
|
62
|
+
|
|
63
|
+
| You need | Run |
|
|
64
|
+
| --------------------------------------------------------------- | ---------------------------------------------- |
|
|
65
|
+
| your versions, and whether this skill is theirs (Step 0) | `npx @dialecte/cli doctor` |
|
|
66
|
+
| a method for what you are trying to do (reuse ladder, rung 2-4) | `npx @dialecte/cli api find "<what you need>"` |
|
|
67
|
+
| its exact contract: signature, summary, routes, one call | `npx @dialecte/cli api show <route>` |
|
|
68
|
+
| what a group holds, your own extensions included | `npx @dialecte/cli members <expression>` |
|
|
69
|
+
| what an element may hold: parents, children, attributes | `npx @dialecte/cli schema <Tag>` |
|
|
70
|
+
|
|
71
|
+
- A `⚠️` line of `doctor` comes first: it names the command that fixes it.
|
|
72
|
+
- Search by the words of your need, not by a name you imagine:
|
|
73
|
+
`npx @dialecte/cli api find "copy a subtree from another document"`. The best match is first; read the
|
|
74
|
+
`api show` of every close one before ruling it out.
|
|
75
|
+
- `schema` reads the installed definition through core's own readers: never list children or required
|
|
76
|
+
attributes by hand, never parse `definition.generated.ts` or the XSD.
|
|
77
|
+
- Exit 1 means nothing found (or a warning): fall back to the sources below, in their order.
|
|
78
|
+
|
|
79
|
+
## Where the truth for your installed version lives
|
|
80
|
+
|
|
81
|
+
This skill describes shapes and rules, not exact signatures. Before calling or citing any method,
|
|
82
|
+
confirm it in this order:
|
|
83
|
+
|
|
84
|
+
1. The repo, if it is checked out locally (sibling folder, `$DIALECTE_ROOT`): `src/` of the package,
|
|
85
|
+
at the version you run.
|
|
86
|
+
2. The installed build: `node_modules/@dialecte/<pkg>/dist/**/*.d.ts` (exact for your version).
|
|
87
|
+
3. The published docs, index first then the one page you need:
|
|
88
|
+
`https://dialecte.github.io/core/llms.txt` and the one each dialecte package publishes
|
|
89
|
+
(`https://dialecte.github.io/<package>/llms.txt`; `llms-full.txt` only for a cross-API search). Docs describe the latest release.
|
|
90
|
+
|
|
91
|
+
Never invent a signature. If the three disagree, the code you actually run wins.
|
|
92
|
+
|
|
93
|
+
## The reuse ladder - run it before writing ANY helper, stop at the first hit
|
|
94
|
+
|
|
95
|
+
1. **Your app's own dialecte layer** (its local extensions, services). Someone may have written it.
|
|
96
|
+
2. **The dialecte's business extensions.** Each dialecte package ships a skill (`dialecte-<id>`)
|
|
97
|
+
with `references/api.md`: an index of its verbs by intent ("label of an element", "copy a
|
|
98
|
+
subtree from another document"), generated from the JSDoc. Search it by what you are trying to
|
|
99
|
+
do, not by a method name you imagine.
|
|
100
|
+
3. **The dialecte's hooks.** "Whenever X is created/renamed/deleted/imported, also do Y" is a hook,
|
|
101
|
+
and the dialecte may already ship it. Read the package's hooks doc before writing coherence code.
|
|
102
|
+
4. **Core Query / Transaction.** Traversal, lookup by attributes, trees, snapshots, add/ensure/
|
|
103
|
+
update/delete/deepClone. Search [references/api.md](references/api.md) by what you are trying
|
|
104
|
+
to do (generated from the JSDoc, intent table first); the shapes are in
|
|
105
|
+
[references/core-api.md](references/core-api.md).
|
|
106
|
+
5. **Core and package helpers/utils** (`@dialecte/core/helpers`, `@dialecte/core/utils`, the
|
|
107
|
+
package's own helpers): `toRef`, record converters, guards, `readAttribute(s)`, definition and
|
|
108
|
+
attribute rules, namespaces, canonical ordering, `invariant`, XML formatting.
|
|
109
|
+
6. **Only then write it** - as a local extension in the package's extension shape (see _A local
|
|
110
|
+
extension in your app_), not as a loose util. If every consumer of that dialecte would need it,
|
|
111
|
+
it belongs in the dialecte package (see _Promoting it to the package_).
|
|
112
|
+
|
|
113
|
+
When you do write new code, say in your hand-off which rung you checked and why nothing fit.
|
|
114
|
+
A verb whose name or summary is close to your need is read in full (JSDoc and tests) before you
|
|
115
|
+
rule it out: names are short, behaviour is in the doc. Name what you ruled out and why.
|
|
116
|
+
|
|
117
|
+
## Core usage in five moves (every dialecte package ships `create<Name>Project`)
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
const project = await createWidgetProject({ storage: { type: 'local' } }).open('my-project')
|
|
121
|
+
|
|
122
|
+
const { documentId, diagnostics } = await project.importFile(file) // XML -> records, inside the store
|
|
123
|
+
// project.import(files) never rejects per file: it returns { status: 'imported' | 'failed' } entries
|
|
124
|
+
const doc = project.openDocument(documentId)
|
|
125
|
+
|
|
126
|
+
const query = doc.query // a new Query per access: take it once
|
|
127
|
+
const root = await query.getRoot()
|
|
128
|
+
const { name } = await query.getAttributes(someRef) // typed value object
|
|
129
|
+
|
|
130
|
+
await doc.transaction(async (tx) => {
|
|
131
|
+
const part = await tx.addChild(assemblyRef, { tagName: 'Part', attributes: { name: 'P1' } })
|
|
132
|
+
await tx.update(part, { attributes: { desc: 'spare' } }) // reads in tx see staged writes
|
|
133
|
+
}) // atomic commit, undoable
|
|
134
|
+
|
|
135
|
+
const { file, filename } = await project.export({ documentId }) // a formatted UTF-8 Blob, written by the store
|
|
136
|
+
// { xmlDocument: true } also answers the DOM, in the page only
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Use the package's factory, not `new Project` / `createProjectFactory` yourself.
|
|
140
|
+
|
|
141
|
+
## Rules that keep code correct
|
|
142
|
+
|
|
143
|
+
- **All writes inside `doc.transaction(fn)`.** One at a time on this Document: a nested or
|
|
144
|
+
overlapping one started on the same Document instance throws `CONCURRENT_TRANSACTION`. `doc.prepare(fn)` stages without committing (preview, then
|
|
145
|
+
`commit()` / `discard()`).
|
|
146
|
+
- **Records are values.** Never mutate a record you got back; pass a ref or record to a method.
|
|
147
|
+
Every public method accepts a ref (`{ tagName, id }`) or any record shape and normalises it with
|
|
148
|
+
`toRef` - do not convert by hand.
|
|
149
|
+
- **Read attributes through the API.** With a query or tx at hand: `getAttributes(ref)` /
|
|
150
|
+
`getAttribute(ref, { name })` (typed, sees staged writes). Without one (import pass, pure
|
|
151
|
+
function): `readAttribute(s)` - a dialecte package may export one bound to its config (prefer
|
|
152
|
+
it); core's takes `dialecteConfig`. Never `record.attributes.find(...)`. Absent vs empty:
|
|
153
|
+
`{ defaults: 'none', fullObject: true }` gives `undefined` when absent.
|
|
154
|
+
- **Never build or parse XML by hand.** `project.import` / `project.export`; normalise input in
|
|
155
|
+
the `beforeImport` IO hook.
|
|
156
|
+
- **Errors:** `throwDialecteError(key, {...})` / `invariant(cond, {...})`; a dialecte declares its
|
|
157
|
+
own catalogue with `defineErrors`. No ad-hoc `throw new Error`.
|
|
158
|
+
- **State for UI** comes from `project.state` / `doc.state` / `doc.subscribe`, not parallel flags.
|
|
159
|
+
|
|
160
|
+
## Rules that keep code fast
|
|
161
|
+
|
|
162
|
+
Dialecte runs on large documents (hundreds of MB). A query hidden inside a per-element loop
|
|
163
|
+
multiplies.
|
|
164
|
+
|
|
165
|
+
- To climb, follow `record.parent` step by step and stop as soon as you know the answer.
|
|
166
|
+
`findAncestors` only when you need the whole chain.
|
|
167
|
+
- No `findAncestors` / `getTree` / `getRecordsByTagName` / path building inside a per-element loop
|
|
168
|
+
without a per-run `Map` cache keyed by id. Prefer reading the hierarchy once.
|
|
169
|
+
- Filter in the read, not after it: `findDescendants(ref, { collect: [{ Part: { where: { kind: 'spare' } } }] })`
|
|
170
|
+
and `getTree(ref, { select: { where } })` take attribute filters - do not collect everything and
|
|
171
|
+
filter in JS.
|
|
172
|
+
- `findDescendants` groups by tag and is NOT in document order; use `getTree` when order matters.
|
|
173
|
+
- `getTree` loads the whole document unless it is a committed read with an `id` and a `depth`;
|
|
174
|
+
and it **unwraps transparent elements by default** (the config's `transparentElements`: their
|
|
175
|
+
children are lifted into the parent) - pass `unwrap` explicitly when you walk or copy them.
|
|
176
|
+
- Prefer one pass that gathers what several steps need over re-reading the same records.
|
|
177
|
+
|
|
178
|
+
## Hooks: what fires when (core)
|
|
179
|
+
|
|
180
|
+
| Action | Hooks, in order |
|
|
181
|
+
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
182
|
+
| `tx.addChild` | afterStandardizedRecord → afterCreated |
|
|
183
|
+
| `tx.deepClone` | per node: beforeClone → afterStandardizedRecord → afterCreated |
|
|
184
|
+
| `tx.update` | afterStandardizedRecord → afterUpdated (not fired for a no-op update) |
|
|
185
|
+
| `tx.delete` | beforeDelete (subtree still readable) → cascade → parent update staged → afterDelete |
|
|
186
|
+
| end of transaction | your callback → beforeCommit → commit |
|
|
187
|
+
| import | beforeImport(xml) → per record, at its closing tag (children before parent): afterStandardizedRecord → beforeImportRecord → store write → afterImport |
|
|
188
|
+
|
|
189
|
+
Consequences to remember:
|
|
190
|
+
|
|
191
|
+
- Operations a hook returns are staged raw: no standardisation, no fixed/xsi guards, no further
|
|
192
|
+
hooks. A hook that deletes must also return the parent's `updated` op.
|
|
193
|
+
- Import hooks never read the store or call a query: collect in `beforeImportRecord`, resolve in
|
|
194
|
+
`afterImport` from what was collected. Import writes are not undoable.
|
|
195
|
+
- `afterStandardizedRecord` runs on create, update, import and init: it must be idempotent.
|
|
196
|
+
|
|
197
|
+
## A local extension in your app
|
|
198
|
+
|
|
199
|
+
A **local extension** is your app's own dialecte extension: code that reads or writes the document,
|
|
200
|
+
written in exactly the shape of a package extension and passed at project creation. Write one when the
|
|
201
|
+
reuse ladder found nothing and the verb is yours (no package has it yet, or your product needs it before
|
|
202
|
+
a package ships it). Because the shape is the package's, the folder can later move into the package with
|
|
203
|
+
no call-site change.
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
src/dialecte-extension/ (your app's folder for local extensions)
|
|
207
|
+
index.ts export const LOCAL_EXTENSIONS = { myFeature }
|
|
208
|
+
my-feature/
|
|
209
|
+
index.ts export const myFeature = { query: { findOrphanParts }, transaction: {} }
|
|
210
|
+
query/
|
|
211
|
+
find-orphan-parts.ts one function per file
|
|
212
|
+
find-orphan-parts.types.ts its params and result types
|
|
213
|
+
find-orphan-parts.test.ts next to it
|
|
214
|
+
transaction/
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
```ts
|
|
218
|
+
// my-feature/query/find-orphan-parts.ts
|
|
219
|
+
import type * as Core from '@dialecte/core'
|
|
220
|
+
import type { Config } from '@acme/widget/v1' // the package's Config type (check its exports)
|
|
221
|
+
|
|
222
|
+
export async function findOrphanParts(query: Core.Query<Config>, params: FindOrphanPartsParams) { ... }
|
|
223
|
+
|
|
224
|
+
// app
|
|
225
|
+
const project = createWidgetProject({ extensions: LOCAL_EXTENSIONS })
|
|
226
|
+
doc.query.myFeature.findOrphanParts({ assembly }) // first param is bound away
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
- First parameter is the query (or transaction), typed `Core.Query<Config>` /
|
|
230
|
+
`Core.Transaction<Config>`, never the hydrated `<Name>.Query` (that type is built from the
|
|
231
|
+
extensions: a cycle). Remaining parameters go in ONE object.
|
|
232
|
+
- To call a sibling method, import it and pass your own `query` / `tx`.
|
|
233
|
+
- Pick a namespace key of your own. A custom module whose key equals a module key the dialecte
|
|
234
|
+
already uses (`inventory` in `@acme/widget`) merges into it, and only a same-named method there throws `EXTENSION_METHOD_COLLISION`. Nothing
|
|
235
|
+
stops a top-level name from shadowing a core member: never name a module like a core method.
|
|
236
|
+
- **It holds no product choice.** It reads and writes the document; it imports nothing from your app
|
|
237
|
+
(no service, store, composable, component, policy file) and carries none of your product's rules.
|
|
238
|
+
Where your product decides differently from the plain behaviour, see policies below.
|
|
239
|
+
- **Tests on the node tier**: table-driven with the package's runner (`<package>/<version>/test` →
|
|
240
|
+
`run<Name>TestCases`), inline XML fixtures, the function called directly with `source.query` / `tx`,
|
|
241
|
+
not through the bound method. No test names a store: the runner runs them in Node on the in-memory
|
|
242
|
+
store. See [Testing](#testing).
|
|
243
|
+
|
|
244
|
+
### Policies: your product's choices, passed per call
|
|
245
|
+
|
|
246
|
+
When products may want different answers from the same verb (which parts count as orphans, how a
|
|
247
|
+
created element is named), the verb stays product-neutral and the product passes its choice **on each
|
|
248
|
+
call**. A **policy** is that set of values (or, where a value is not enough, an injected function).
|
|
249
|
+
|
|
250
|
+
- The verb declares the choice in its params type, typed, **with the plain behaviour as default**:
|
|
251
|
+
an option (`includeSpares?: boolean`, default `false`) or a strategy (`nameOf?: (part) => string`,
|
|
252
|
+
default the plain naming). It branches on it inside, in one pass.
|
|
253
|
+
- The product keeps its values in a policy file next to the service that calls the verb
|
|
254
|
+
(`my-feature.policy.ts`), and the service passes them: `doc.query.myFeature.findOrphanParts({ assembly, ...MY_FEATURE_POLICY })`.
|
|
255
|
+
- Something the plain verb does not know at all (an extra element only your product writes) is
|
|
256
|
+
composition: the addition is a verb of its own in your local extension, and the service calls the
|
|
257
|
+
plain verb and then that one inside the same transaction.
|
|
258
|
+
- Never patch the output afterwards (create, then rename or delete what the verb wrote): it depends on
|
|
259
|
+
the verb's internals, breaks silently when the verb changes and hides the decision from its tests.
|
|
260
|
+
Never branch on your product inside the verb either.
|
|
261
|
+
- Test both: the default, and the option your product sets.
|
|
262
|
+
|
|
263
|
+
### Promoting it to the package
|
|
264
|
+
|
|
265
|
+
When other consumers want the verb, propose it to the package: draft an issue on the package's
|
|
266
|
+
repository with the extension folder and its tests (same shape, so call sites do not change), show it to
|
|
267
|
+
the user and post it only with their approval. The option and its plain default move with the verb; your
|
|
268
|
+
policy file and its values stay in your app. Once a package version ships it, bump the package, delete the
|
|
269
|
+
local folder and its entry in your local extensions index, keep passing your policy.
|
|
270
|
+
|
|
271
|
+
## Keep the logic out of the UI
|
|
272
|
+
|
|
273
|
+
Four layers, each owns one thing, so the document code can be unit-tested without a render and moved
|
|
274
|
+
to a package without a rewrite (framework names below are examples, e.g. Vue):
|
|
275
|
+
|
|
276
|
+
| Layer | Owns | Never |
|
|
277
|
+
| ------------------------------- | ----------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
278
|
+
| local extension | reads and writes of the document; returns records or plain data | UI, app types, reactive state, imports from the app |
|
|
279
|
+
| service (`<domain>.service.ts`) | calls the verbs, passes the policy, turns document data into the app's shapes | reactive state |
|
|
280
|
+
| composable / store | reactive state, derived values, domain logic; calls services | runtime `@dialecte/*` imports, `doc.query` |
|
|
281
|
+
| component | template and local UI state (toggles, dialogs, emits) | document calls, service imports, domain transforms |
|
|
282
|
+
|
|
283
|
+
Types of the dialecte package (`<Name>.Record`, tag names) may pass through a service unchanged (a
|
|
284
|
+
composable then imports them with `import type`): do not wrap a type only to re-export it. Read the subtree once in the extension (`getTree` or a filtered
|
|
285
|
+
`findDescendants`) instead of one read per element from a component loop.
|
|
286
|
+
|
|
287
|
+
## Testing
|
|
288
|
+
|
|
289
|
+
Each dialecte package exports table-driven runners from its `/test` entry
|
|
290
|
+
(`<package>/<version>/test` → `run<Name>TestCases`; core's own: `@dialecte/core/test`). Details
|
|
291
|
+
and the case format: [references/testing.md](references/testing.md). Short version: one table per
|
|
292
|
+
behaviour, inline XML fixtures with `dev:db-id` ids that say intent, `.withExport` asserts the
|
|
293
|
+
resulting XML with XPath, `.withoutExport` asserts inside `act`, `.generic` for pure functions.
|
|
294
|
+
Red first, one case at a time. No test names its store: the runner chooses it (in Node on the
|
|
295
|
+
in-memory store under a node vitest project whose setup file calls `useTestStorage`, core 0.8+).
|
|
296
|
+
Assertions take XML text; on a big file, check record expectations (tag, attributes, parent,
|
|
297
|
+
count) with the query API instead of XPath on the whole export.
|
|
298
|
+
|
|
299
|
+
## Check a behaviour by running it
|
|
300
|
+
|
|
301
|
+
When the question is what a call does to a document - which elements a verb writes, whether a write
|
|
302
|
+
is refused and with which error, what a hook adds - run it in Node instead of reasoning from the
|
|
303
|
+
source. `npx @dialecte/cli run` (a cli that lists `run` in its `--help`, on core 0.8) runs a script
|
|
304
|
+
against an in-memory project of the installed dialecte; ids are seeded, so the same script, input and
|
|
305
|
+
`--seed` give the same outcome.
|
|
306
|
+
|
|
307
|
+
1. **Expectations first**, in a JSON file: `[{ "tag": "Part", "under": { "tag": "Assembly" }, "count": 2 }]` -
|
|
308
|
+
`where` for attribute values, `count: 0` for none, no `count` for at least one. They say what the
|
|
309
|
+
user wants, which a valid document does not prove.
|
|
310
|
+
2. **The script** is a module whose default export receives `{ project, doc, documentId, dialecte, helpers, utils }`.
|
|
311
|
+
Use the dialecte's verbs, not hand-built `addChild` chains; ask the user for values that are open.
|
|
312
|
+
3. **Run it**: `npx @dialecte/cli run script.ts --in fixture.xml --expect expected.json`. `--prepare` stages
|
|
313
|
+
the first transaction and commits nothing (its operations and what its callback returned are
|
|
314
|
+
printed); `--json` answers the outcome as data; `--out result.xml` writes the document;
|
|
315
|
+
`--package <name>` names the dialecte when the project has none or several.
|
|
316
|
+
4. **Read the outcome**, not a guess: `failed: <code> <key> at <path>` for a thrown error, then
|
|
317
|
+
`npx @dialecte/cli explain <code>` for when it is raised and the usual fix; each unmet expectation
|
|
318
|
+
with the count found; the operations per tag. Exit 1 means failed or unmet.
|
|
319
|
+
5. Expectations red → script → green; show the user the prepared operations before anything is
|
|
320
|
+
committed for real.
|
|
321
|
+
|
|
322
|
+
## Before you hand over
|
|
323
|
+
|
|
324
|
+
- Did you walk the reuse ladder and name what you reused?
|
|
325
|
+
- Does a hook already do any write you added by hand?
|
|
326
|
+
- Any query inside a loop over elements? Any `findAncestors` that could be a parent step?
|
|
327
|
+
- Any hand-written list that the definition or a registry already holds?
|
|
328
|
+
- Does a local extension import anything from the app, or hold a product choice instead of an option?
|
|
329
|
+
- Does a component or composable call `doc.query` / import `@dialecte/*` instead of going through a service?
|
|
330
|
+
- Every Dialecte method you call confirmed in the installed version?
|
|
331
|
+
|
|
332
|
+
## Retro gate - before you hand over
|
|
333
|
+
|
|
334
|
+
List in your hand-over every place where this skill was wrong, missing or misleading for the task,
|
|
335
|
+
and every correction the user made that a skill should have prevented. Then:
|
|
336
|
+
|
|
337
|
+
- **Inside a dialecte repository**: draft each skill edit as before/after and show it to the user; an
|
|
338
|
+
approved edit goes in the same change (skills ship with the package that owns the code), through
|
|
339
|
+
the skill-creator skill (`anthropic-skills:skill-creator`) loaded - the eval case first, failing on the text
|
|
340
|
+
before the change, as `dialecte-lot` describes - then `npm run skills:generate` and
|
|
341
|
+
`npm run skills:check` (see `dialecte-contributing`).
|
|
342
|
+
- **In an app**: draft an issue for the package that ships the skill - the statement that was wrong
|
|
343
|
+
or missing, the evidence (file, behaviour), the wording you propose - and show it to the user.
|
|
344
|
+
Post it only with their approval.
|
|
345
|
+
- Nothing to report: write "skill retro: nothing".
|