@elytracms/core 0.0.6
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/dist/clipboard/build.d.ts +77 -0
- package/dist/clipboard/build.js +128 -0
- package/dist/clipboard/build.js.map +1 -0
- package/dist/clipboard/clipboard.d.ts +33 -0
- package/dist/clipboard/clipboard.js +45 -0
- package/dist/clipboard/clipboard.js.map +1 -0
- package/dist/clipboard/fragment.d.ts +112 -0
- package/dist/clipboard/fragment.js +79 -0
- package/dist/clipboard/fragment.js.map +1 -0
- package/dist/clipboard/html.d.ts +26 -0
- package/dist/clipboard/html.js +82 -0
- package/dist/clipboard/html.js.map +1 -0
- package/dist/clipboard/index.d.ts +15 -0
- package/dist/clipboard/index.js +16 -0
- package/dist/clipboard/index.js.map +1 -0
- package/dist/clipboard/references.d.ts +50 -0
- package/dist/clipboard/references.js +0 -0
- package/dist/clipboard/references.js.map +1 -0
- package/dist/clipboard/serialize.d.ts +69 -0
- package/dist/clipboard/serialize.js +130 -0
- package/dist/clipboard/serialize.js.map +1 -0
- package/dist/cms-core/collections.d.ts +82 -0
- package/dist/cms-core/collections.js +187 -0
- package/dist/cms-core/collections.js.map +1 -0
- package/dist/cms-core/documents.d.ts +71 -0
- package/dist/cms-core/documents.js +67 -0
- package/dist/cms-core/documents.js.map +1 -0
- package/dist/cms-core/envelopes.d.ts +80 -0
- package/dist/cms-core/envelopes.js +124 -0
- package/dist/cms-core/envelopes.js.map +1 -0
- package/dist/cms-core/fields.d.ts +220 -0
- package/dist/cms-core/fields.js +250 -0
- package/dist/cms-core/fields.js.map +1 -0
- package/dist/cms-core/fixtures.d.ts +92 -0
- package/dist/cms-core/fixtures.js +357 -0
- package/dist/cms-core/fixtures.js.map +1 -0
- package/dist/cms-core/hierarchy.d.ts +113 -0
- package/dist/cms-core/hierarchy.js +223 -0
- package/dist/cms-core/hierarchy.js.map +1 -0
- package/dist/cms-core/index.d.ts +25 -0
- package/dist/cms-core/index.js +26 -0
- package/dist/cms-core/index.js.map +1 -0
- package/dist/cms-core/infer.d.ts +103 -0
- package/dist/cms-core/infer.js +57 -0
- package/dist/cms-core/infer.js.map +1 -0
- package/dist/cms-core/issues.d.ts +92 -0
- package/dist/cms-core/issues.js +74 -0
- package/dist/cms-core/issues.js.map +1 -0
- package/dist/cms-core/json-schema.d.ts +25 -0
- package/dist/cms-core/json-schema.js +110 -0
- package/dist/cms-core/json-schema.js.map +1 -0
- package/dist/cms-core/localization.d.ts +51 -0
- package/dist/cms-core/localization.js +89 -0
- package/dist/cms-core/localization.js.map +1 -0
- package/dist/cms-core/routes.d.ts +76 -0
- package/dist/cms-core/routes.js +220 -0
- package/dist/cms-core/routes.js.map +1 -0
- package/dist/cms-core/self-type.d.ts +41 -0
- package/dist/cms-core/self-type.js +191 -0
- package/dist/cms-core/self-type.js.map +1 -0
- package/dist/cms-core/url-for-document.d.ts +39 -0
- package/dist/cms-core/url-for-document.js +138 -0
- package/dist/cms-core/url-for-document.js.map +1 -0
- package/dist/cms-core/validate-document.d.ts +121 -0
- package/dist/cms-core/validate-document.js +871 -0
- package/dist/cms-core/validate-document.js.map +1 -0
- package/dist/cms-core/versions.d.ts +75 -0
- package/dist/cms-core/versions.js +97 -0
- package/dist/cms-core/versions.js.map +1 -0
- package/dist/collaboration/approval.d.ts +68 -0
- package/dist/collaboration/approval.js +104 -0
- package/dist/collaboration/approval.js.map +1 -0
- package/dist/collaboration/collaboration.d.ts +49 -0
- package/dist/collaboration/collaboration.js +56 -0
- package/dist/collaboration/collaboration.js.map +1 -0
- package/dist/collaboration/comments.d.ts +72 -0
- package/dist/collaboration/comments.js +118 -0
- package/dist/collaboration/comments.js.map +1 -0
- package/dist/collaboration/core.d.ts +25 -0
- package/dist/collaboration/core.js +26 -0
- package/dist/collaboration/core.js.map +1 -0
- package/dist/collaboration/index.d.ts +14 -0
- package/dist/collaboration/index.js +15 -0
- package/dist/collaboration/index.js.map +1 -0
- package/dist/collaboration/presence.d.ts +62 -0
- package/dist/collaboration/presence.js +85 -0
- package/dist/collaboration/presence.js.map +1 -0
- package/dist/collaboration/publishing.d.ts +60 -0
- package/dist/collaboration/publishing.js +93 -0
- package/dist/collaboration/publishing.js.map +1 -0
- package/dist/collaboration/versions.d.ts +52 -0
- package/dist/collaboration/versions.js +81 -0
- package/dist/collaboration/versions.js.map +1 -0
- package/dist/component-registry/index.d.ts +3 -0
- package/dist/component-registry/index.js +4 -0
- package/dist/component-registry/index.js.map +1 -0
- package/dist/component-registry/issues.d.ts +6 -0
- package/dist/component-registry/issues.js +2 -0
- package/dist/component-registry/issues.js.map +1 -0
- package/dist/component-registry/manifest.d.ts +164 -0
- package/dist/component-registry/manifest.js +129 -0
- package/dist/component-registry/manifest.js.map +1 -0
- package/dist/component-registry/registry.d.ts +33 -0
- package/dist/component-registry/registry.js +90 -0
- package/dist/component-registry/registry.js.map +1 -0
- package/dist/content/__fixtures__/filterable-collections.d.ts +14 -0
- package/dist/content/__fixtures__/filterable-collections.js +15 -0
- package/dist/content/__fixtures__/filterable-collections.js.map +1 -0
- package/dist/content/__fixtures__/sample-accessor-types.d.ts +56 -0
- package/dist/content/__fixtures__/sample-accessor-types.js +5 -0
- package/dist/content/__fixtures__/sample-accessor-types.js.map +1 -0
- package/dist/content/__fixtures__/sample-delivery-types.d.ts +122 -0
- package/dist/content/__fixtures__/sample-delivery-types.js +5 -0
- package/dist/content/__fixtures__/sample-delivery-types.js.map +1 -0
- package/dist/content/assets.d.ts +53 -0
- package/dist/content/assets.js +38 -0
- package/dist/content/assets.js.map +1 -0
- package/dist/content/binding-sources.d.ts +53 -0
- package/dist/content/binding-sources.js +73 -0
- package/dist/content/binding-sources.js.map +1 -0
- package/dist/content/client.d.ts +90 -0
- package/dist/content/client.js +383 -0
- package/dist/content/client.js.map +1 -0
- package/dist/content/codegen.d.ts +54 -0
- package/dist/content/codegen.js +305 -0
- package/dist/content/codegen.js.map +1 -0
- package/dist/content/context.d.ts +38 -0
- package/dist/content/context.js +21 -0
- package/dist/content/context.js.map +1 -0
- package/dist/content/cursor.d.ts +33 -0
- package/dist/content/cursor.js +104 -0
- package/dist/content/cursor.js.map +1 -0
- package/dist/content/index.d.ts +28 -0
- package/dist/content/index.js +29 -0
- package/dist/content/index.js.map +1 -0
- package/dist/content/locale.d.ts +30 -0
- package/dist/content/locale.js +26 -0
- package/dist/content/locale.js.map +1 -0
- package/dist/content/perspective.d.ts +29 -0
- package/dist/content/perspective.js +31 -0
- package/dist/content/perspective.js.map +1 -0
- package/dist/content/populate.d.ts +25 -0
- package/dist/content/populate.js +22 -0
- package/dist/content/populate.js.map +1 -0
- package/dist/content/query.d.ts +122 -0
- package/dist/content/query.js +257 -0
- package/dist/content/query.js.map +1 -0
- package/dist/content/raw.d.ts +13 -0
- package/dist/content/raw.js +14 -0
- package/dist/content/raw.js.map +1 -0
- package/dist/content/resolve.d.ts +97 -0
- package/dist/content/resolve.js +261 -0
- package/dist/content/resolve.js.map +1 -0
- package/dist/content/serialize.d.ts +30 -0
- package/dist/content/serialize.js +57 -0
- package/dist/content/serialize.js.map +1 -0
- package/dist/content/tags.d.ts +54 -0
- package/dist/content/tags.js +40 -0
- package/dist/content/tags.js.map +1 -0
- package/dist/data-binding/fixtures.d.ts +20 -0
- package/dist/data-binding/fixtures.js +47 -0
- package/dist/data-binding/fixtures.js.map +1 -0
- package/dist/data-binding/index.d.ts +14 -0
- package/dist/data-binding/index.js +15 -0
- package/dist/data-binding/index.js.map +1 -0
- package/dist/data-binding/issues.d.ts +45 -0
- package/dist/data-binding/issues.js +46 -0
- package/dist/data-binding/issues.js.map +1 -0
- package/dist/data-binding/resolve.d.ts +87 -0
- package/dist/data-binding/resolve.js +204 -0
- package/dist/data-binding/resolve.js.map +1 -0
- package/dist/data-binding/sample.d.ts +21 -0
- package/dist/data-binding/sample.js +23 -0
- package/dist/data-binding/sample.js.map +1 -0
- package/dist/data-binding/sources.d.ts +225 -0
- package/dist/data-binding/sources.js +154 -0
- package/dist/data-binding/sources.js.map +1 -0
- package/dist/data-binding/tokens.d.ts +62 -0
- package/dist/data-binding/tokens.js +150 -0
- package/dist/data-binding/tokens.js.map +1 -0
- package/dist/design-tokens/css.d.ts +34 -0
- package/dist/design-tokens/css.js +51 -0
- package/dist/design-tokens/css.js.map +1 -0
- package/dist/design-tokens/index.d.ts +10 -0
- package/dist/design-tokens/index.js +11 -0
- package/dist/design-tokens/index.js.map +1 -0
- package/dist/design-tokens/style-guide.d.ts +30 -0
- package/dist/design-tokens/style-guide.js +31 -0
- package/dist/design-tokens/style-guide.js.map +1 -0
- package/dist/design-tokens/tokens.d.ts +89 -0
- package/dist/design-tokens/tokens.js +112 -0
- package/dist/design-tokens/tokens.js.map +1 -0
- package/dist/export-sync/builder-source.d.ts +85 -0
- package/dist/export-sync/builder-source.js +124 -0
- package/dist/export-sync/builder-source.js.map +1 -0
- package/dist/export-sync/check.d.ts +61 -0
- package/dist/export-sync/check.js +126 -0
- package/dist/export-sync/check.js.map +1 -0
- package/dist/export-sync/cli.d.ts +89 -0
- package/dist/export-sync/cli.js +323 -0
- package/dist/export-sync/cli.js.map +1 -0
- package/dist/export-sync/core.d.ts +58 -0
- package/dist/export-sync/core.js +41 -0
- package/dist/export-sync/core.js.map +1 -0
- package/dist/export-sync/eject.d.ts +28 -0
- package/dist/export-sync/eject.js +21 -0
- package/dist/export-sync/eject.js.map +1 -0
- package/dist/export-sync/fixtures.d.ts +25 -0
- package/dist/export-sync/fixtures.js +87 -0
- package/dist/export-sync/fixtures.js.map +1 -0
- package/dist/export-sync/generate.d.ts +7 -0
- package/dist/export-sync/generate.js +505 -0
- package/dist/export-sync/generate.js.map +1 -0
- package/dist/export-sync/index.d.ts +37 -0
- package/dist/export-sync/index.js +39 -0
- package/dist/export-sync/index.js.map +1 -0
- package/dist/export-sync/init.d.ts +123 -0
- package/dist/export-sync/init.js +234 -0
- package/dist/export-sync/init.js.map +1 -0
- package/dist/export-sync/manifest-host.d.ts +48 -0
- package/dist/export-sync/manifest-host.js +73 -0
- package/dist/export-sync/manifest-host.js.map +1 -0
- package/dist/export-sync/node.d.ts +20 -0
- package/dist/export-sync/node.js +101 -0
- package/dist/export-sync/node.js.map +1 -0
- package/dist/export-sync/push.d.ts +76 -0
- package/dist/export-sync/push.js +197 -0
- package/dist/export-sync/push.js.map +1 -0
- package/dist/export-sync/registry-sync-client.d.ts +59 -0
- package/dist/export-sync/registry-sync-client.js +97 -0
- package/dist/export-sync/registry-sync-client.js.map +1 -0
- package/dist/export-sync/sync.d.ts +47 -0
- package/dist/export-sync/sync.js +47 -0
- package/dist/export-sync/sync.js.map +1 -0
- package/dist/export-sync/typegen.d.ts +40 -0
- package/dist/export-sync/typegen.js +45 -0
- package/dist/export-sync/typegen.js.map +1 -0
- package/dist/export-sync/validate.d.ts +19 -0
- package/dist/export-sync/validate.js +102 -0
- package/dist/export-sync/validate.js.map +1 -0
- package/dist/export-sync/watch.d.ts +66 -0
- package/dist/export-sync/watch.js +70 -0
- package/dist/export-sync/watch.js.map +1 -0
- package/dist/operations/assets.d.ts +198 -0
- package/dist/operations/assets.js +75 -0
- package/dist/operations/assets.js.map +1 -0
- package/dist/operations/authorization.d.ts +49 -0
- package/dist/operations/authorization.js +128 -0
- package/dist/operations/authorization.js.map +1 -0
- package/dist/operations/changesets.d.ts +160 -0
- package/dist/operations/changesets.js +442 -0
- package/dist/operations/changesets.js.map +1 -0
- package/dist/operations/client.d.ts +49 -0
- package/dist/operations/client.js +57 -0
- package/dist/operations/client.js.map +1 -0
- package/dist/operations/core.d.ts +238 -0
- package/dist/operations/core.js +269 -0
- package/dist/operations/core.js.map +1 -0
- package/dist/operations/documents.d.ts +432 -0
- package/dist/operations/documents.js +344 -0
- package/dist/operations/documents.js.map +1 -0
- package/dist/operations/graph.d.ts +138 -0
- package/dist/operations/graph.js +78 -0
- package/dist/operations/graph.js.map +1 -0
- package/dist/operations/index.d.ts +19 -0
- package/dist/operations/index.js +20 -0
- package/dist/operations/index.js.map +1 -0
- package/dist/operations/members.d.ts +87 -0
- package/dist/operations/members.js +56 -0
- package/dist/operations/members.js.map +1 -0
- package/dist/operations/publishing.d.ts +89 -0
- package/dist/operations/publishing.js +57 -0
- package/dist/operations/publishing.js.map +1 -0
- package/dist/operations/references.d.ts +222 -0
- package/dist/operations/references.js +177 -0
- package/dist/operations/references.js.map +1 -0
- package/dist/operations/schema.d.ts +413 -0
- package/dist/operations/schema.js +138 -0
- package/dist/operations/schema.js.map +1 -0
- package/dist/operations/tokens.d.ts +79 -0
- package/dist/operations/tokens.js +102 -0
- package/dist/operations/tokens.js.map +1 -0
- package/dist/persistence/adapter.d.ts +79 -0
- package/dist/persistence/adapter.js +55 -0
- package/dist/persistence/adapter.js.map +1 -0
- package/dist/persistence/assets.d.ts +120 -0
- package/dist/persistence/assets.js +141 -0
- package/dist/persistence/assets.js.map +1 -0
- package/dist/persistence/backend-validation.d.ts +43 -0
- package/dist/persistence/backend-validation.js +57 -0
- package/dist/persistence/backend-validation.js.map +1 -0
- package/dist/persistence/cli-tokens.d.ts +50 -0
- package/dist/persistence/cli-tokens.js +66 -0
- package/dist/persistence/cli-tokens.js.map +1 -0
- package/dist/persistence/cms.d.ts +148 -0
- package/dist/persistence/cms.js +232 -0
- package/dist/persistence/cms.js.map +1 -0
- package/dist/persistence/contract-scenarios.d.ts +73 -0
- package/dist/persistence/contract-scenarios.js +496 -0
- package/dist/persistence/contract-scenarios.js.map +1 -0
- package/dist/persistence/core.d.ts +96 -0
- package/dist/persistence/core.js +110 -0
- package/dist/persistence/core.js.map +1 -0
- package/dist/persistence/graph.d.ts +61 -0
- package/dist/persistence/graph.js +98 -0
- package/dist/persistence/graph.js.map +1 -0
- package/dist/persistence/index.d.ts +22 -0
- package/dist/persistence/index.js +23 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/members.d.ts +70 -0
- package/dist/persistence/members.js +0 -0
- package/dist/persistence/members.js.map +1 -0
- package/dist/persistence/publishing.d.ts +59 -0
- package/dist/persistence/publishing.js +95 -0
- package/dist/persistence/publishing.js.map +1 -0
- package/dist/persistence/reference-extraction.d.ts +44 -0
- package/dist/persistence/reference-extraction.js +204 -0
- package/dist/persistence/reference-extraction.js.map +1 -0
- package/dist/persistence/reference-indexing.d.ts +68 -0
- package/dist/persistence/reference-indexing.js +112 -0
- package/dist/persistence/reference-indexing.js.map +1 -0
- package/dist/persistence/references.d.ts +257 -0
- package/dist/persistence/references.js +0 -0
- package/dist/persistence/references.js.map +1 -0
- package/dist/persistence/seed.d.ts +55 -0
- package/dist/persistence/seed.js +102 -0
- package/dist/persistence/seed.js.map +1 -0
- package/dist/persistence/self-maintaining-adapter.d.ts +41 -0
- package/dist/persistence/self-maintaining-adapter.js +79 -0
- package/dist/persistence/self-maintaining-adapter.js.map +1 -0
- package/dist/plugins/asset-storage.d.ts +76 -0
- package/dist/plugins/asset-storage.js +104 -0
- package/dist/plugins/asset-storage.js.map +1 -0
- package/dist/plugins/component-package.d.ts +54 -0
- package/dist/plugins/component-package.js +92 -0
- package/dist/plugins/component-package.js.map +1 -0
- package/dist/plugins/data-sources.d.ts +78 -0
- package/dist/plugins/data-sources.js +99 -0
- package/dist/plugins/data-sources.js.map +1 -0
- package/dist/plugins/examples.d.ts +47 -0
- package/dist/plugins/examples.js +205 -0
- package/dist/plugins/examples.js.map +1 -0
- package/dist/plugins/export-targets.d.ts +47 -0
- package/dist/plugins/export-targets.js +78 -0
- package/dist/plugins/export-targets.js.map +1 -0
- package/dist/plugins/field-types.d.ts +86 -0
- package/dist/plugins/field-types.js +93 -0
- package/dist/plugins/field-types.js.map +1 -0
- package/dist/plugins/hooks.d.ts +60 -0
- package/dist/plugins/hooks.js +94 -0
- package/dist/plugins/hooks.js.map +1 -0
- package/dist/plugins/index.d.ts +27 -0
- package/dist/plugins/index.js +28 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/marketplace.d.ts +90 -0
- package/dist/plugins/marketplace.js +110 -0
- package/dist/plugins/marketplace.js.map +1 -0
- package/dist/plugins/plugin.d.ts +107 -0
- package/dist/plugins/plugin.js +122 -0
- package/dist/plugins/plugin.js.map +1 -0
- package/dist/plugins/templates.d.ts +66 -0
- package/dist/plugins/templates.js +74 -0
- package/dist/plugins/templates.js.map +1 -0
- package/dist/project-graph/binding.d.ts +68 -0
- package/dist/project-graph/binding.js +39 -0
- package/dist/project-graph/binding.js.map +1 -0
- package/dist/project-graph/container.d.ts +126 -0
- package/dist/project-graph/container.js +221 -0
- package/dist/project-graph/container.js.map +1 -0
- package/dist/project-graph/edit.d.ts +66 -0
- package/dist/project-graph/edit.js +201 -0
- package/dist/project-graph/edit.js.map +1 -0
- package/dist/project-graph/fixtures.d.ts +51 -0
- package/dist/project-graph/fixtures.js +224 -0
- package/dist/project-graph/fixtures.js.map +1 -0
- package/dist/project-graph/ids.d.ts +17 -0
- package/dist/project-graph/ids.js +19 -0
- package/dist/project-graph/ids.js.map +1 -0
- package/dist/project-graph/index.d.ts +12 -0
- package/dist/project-graph/index.js +13 -0
- package/dist/project-graph/index.js.map +1 -0
- package/dist/project-graph/issues.d.ts +61 -0
- package/dist/project-graph/issues.js +44 -0
- package/dist/project-graph/issues.js.map +1 -0
- package/dist/project-graph/json.d.ts +6 -0
- package/dist/project-graph/json.js +10 -0
- package/dist/project-graph/json.js.map +1 -0
- package/dist/project-graph/node.d.ts +48 -0
- package/dist/project-graph/node.js +42 -0
- package/dist/project-graph/node.js.map +1 -0
- package/dist/project-graph/normalize.d.ts +17 -0
- package/dist/project-graph/normalize.js +110 -0
- package/dist/project-graph/normalize.js.map +1 -0
- package/dist/project-graph/serialize.d.ts +36 -0
- package/dist/project-graph/serialize.js +51 -0
- package/dist/project-graph/serialize.js.map +1 -0
- package/dist/project-graph/structure.d.ts +40 -0
- package/dist/project-graph/structure.js +36 -0
- package/dist/project-graph/structure.js.map +1 -0
- package/dist/project-graph/validate.d.ts +84 -0
- package/dist/project-graph/validate.js +158 -0
- package/dist/project-graph/validate.js.map +1 -0
- package/dist/rich-text/adapter.d.ts +43 -0
- package/dist/rich-text/adapter.js +24 -0
- package/dist/rich-text/adapter.js.map +1 -0
- package/dist/rich-text/dom-editor.d.ts +101 -0
- package/dist/rich-text/dom-editor.js +482 -0
- package/dist/rich-text/dom-editor.js.map +1 -0
- package/dist/rich-text/embed.d.ts +70 -0
- package/dist/rich-text/embed.js +70 -0
- package/dist/rich-text/embed.js.map +1 -0
- package/dist/rich-text/fixtures.d.ts +25 -0
- package/dist/rich-text/fixtures.js +115 -0
- package/dist/rich-text/fixtures.js.map +1 -0
- package/dist/rich-text/html.d.ts +5 -0
- package/dist/rich-text/html.js +309 -0
- package/dist/rich-text/html.js.map +1 -0
- package/dist/rich-text/index.d.ts +19 -0
- package/dist/rich-text/index.js +20 -0
- package/dist/rich-text/index.js.map +1 -0
- package/dist/rich-text/markdown.d.ts +7 -0
- package/dist/rich-text/markdown.js +235 -0
- package/dist/rich-text/markdown.js.map +1 -0
- package/dist/rich-text/portable-text.d.ts +50 -0
- package/dist/rich-text/portable-text.js +223 -0
- package/dist/rich-text/portable-text.js.map +1 -0
- package/dist/rich-text/registry.d.ts +48 -0
- package/dist/rich-text/registry.js +16 -0
- package/dist/rich-text/registry.js.map +1 -0
- package/dist/rich-text/render.d.ts +69 -0
- package/dist/rich-text/render.js +205 -0
- package/dist/rich-text/render.js.map +1 -0
- package/dist/rich-text/schema.d.ts +86 -0
- package/dist/rich-text/schema.js +80 -0
- package/dist/rich-text/schema.js.map +1 -0
- package/dist/rich-text/test-support.d.ts +7 -0
- package/dist/rich-text/test-support.js +8 -0
- package/dist/rich-text/test-support.js.map +1 -0
- package/dist/runtime-renderer/client.d.ts +14 -0
- package/dist/runtime-renderer/client.js +15 -0
- package/dist/runtime-renderer/client.js.map +1 -0
- package/dist/runtime-renderer/condition.d.ts +8 -0
- package/dist/runtime-renderer/condition.js +48 -0
- package/dist/runtime-renderer/condition.js.map +1 -0
- package/dist/runtime-renderer/content-client.d.ts +62 -0
- package/dist/runtime-renderer/content-client.js +37 -0
- package/dist/runtime-renderer/content-client.js.map +1 -0
- package/dist/runtime-renderer/context.d.ts +185 -0
- package/dist/runtime-renderer/context.js +7 -0
- package/dist/runtime-renderer/context.js.map +1 -0
- package/dist/runtime-renderer/fallback.d.ts +39 -0
- package/dist/runtime-renderer/fallback.js +45 -0
- package/dist/runtime-renderer/fallback.js.map +1 -0
- package/dist/runtime-renderer/index.d.ts +13 -0
- package/dist/runtime-renderer/index.js +13 -0
- package/dist/runtime-renderer/index.js.map +1 -0
- package/dist/runtime-renderer/primitives.d.ts +85 -0
- package/dist/runtime-renderer/primitives.js +442 -0
- package/dist/runtime-renderer/primitives.js.map +1 -0
- package/dist/runtime-renderer/render.d.ts +138 -0
- package/dist/runtime-renderer/render.js +825 -0
- package/dist/runtime-renderer/render.js.map +1 -0
- package/dist/runtime-renderer/rich-text.d.ts +26 -0
- package/dist/runtime-renderer/rich-text.js +113 -0
- package/dist/runtime-renderer/rich-text.js.map +1 -0
- package/dist/starter-kits/index.d.ts +13 -0
- package/dist/starter-kits/index.js +14 -0
- package/dist/starter-kits/index.js.map +1 -0
- package/dist/starter-kits/instantiate.d.ts +29 -0
- package/dist/starter-kits/instantiate.js +24 -0
- package/dist/starter-kits/instantiate.js.map +1 -0
- package/dist/starter-kits/kit.d.ts +61 -0
- package/dist/starter-kits/kit.js +37 -0
- package/dist/starter-kits/kit.js.map +1 -0
- package/dist/starter-kits/kits.d.ts +7 -0
- package/dist/starter-kits/kits.js +201 -0
- package/dist/starter-kits/kits.js.map +1 -0
- package/dist/starter-kits/manifests.d.ts +7 -0
- package/dist/starter-kits/manifests.js +111 -0
- package/dist/starter-kits/manifests.js.map +1 -0
- package/dist/starter-kits/upgrade.d.ts +39 -0
- package/dist/starter-kits/upgrade.js +54 -0
- package/dist/starter-kits/upgrade.js.map +1 -0
- package/dist/starter-kits/validate.d.ts +16 -0
- package/dist/starter-kits/validate.js +77 -0
- package/dist/starter-kits/validate.js.map +1 -0
- package/dist/studio-core/context.d.ts +27 -0
- package/dist/studio-core/context.js +44 -0
- package/dist/studio-core/context.js.map +1 -0
- package/dist/studio-core/errors.d.ts +58 -0
- package/dist/studio-core/errors.js +74 -0
- package/dist/studio-core/errors.js.map +1 -0
- package/dist/studio-core/fixtures.d.ts +18 -0
- package/dist/studio-core/fixtures.js +83 -0
- package/dist/studio-core/fixtures.js.map +1 -0
- package/dist/studio-core/ids.d.ts +22 -0
- package/dist/studio-core/ids.js +33 -0
- package/dist/studio-core/ids.js.map +1 -0
- package/dist/studio-core/index.d.ts +11 -0
- package/dist/studio-core/index.js +12 -0
- package/dist/studio-core/index.js.map +1 -0
- package/dist/studio-core/issues.d.ts +50 -0
- package/dist/studio-core/issues.js +33 -0
- package/dist/studio-core/issues.js.map +1 -0
- package/dist/studio-core/metadata.d.ts +109 -0
- package/dist/studio-core/metadata.js +74 -0
- package/dist/studio-core/metadata.js.map +1 -0
- package/dist/studio-core/repository.d.ts +73 -0
- package/dist/studio-core/repository.js +202 -0
- package/dist/studio-core/repository.js.map +1 -0
- package/dist/studio-core/sections.d.ts +73 -0
- package/dist/studio-core/sections.js +68 -0
- package/dist/studio-core/sections.js.map +1 -0
- package/dist/studio-core/validate.d.ts +15 -0
- package/dist/studio-core/validate.js +119 -0
- package/dist/studio-core/validate.js.map +1 -0
- package/dist/studio-core/workspace-config.d.ts +587 -0
- package/dist/studio-core/workspace-config.js +434 -0
- package/dist/studio-core/workspace-config.js.map +1 -0
- package/package.json +104 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { existsSync, readdirSync, watch as fsWatch } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
4
|
+
import { WORKSPACE_CONFIG_FILES } from '@elytracms/core/studio-core';
|
|
5
|
+
import { extractManifestCandidates, isManifestFile, MANIFEST_IGNORED_DIRECTORIES, } from './manifest-host';
|
|
6
|
+
/**
|
|
7
|
+
* Node-only implementations for the manifest push (EC-147) and workspace init
|
|
8
|
+
* (EC-154): the real filesystem {@link ManifestHost}, the `node:fs` watch
|
|
9
|
+
* driver, and the dynamic-import {@link WorkspaceConfigHost}. Lives behind the
|
|
10
|
+
* `@elytracms/core/export-sync/node` subpath — NOT re-exported from the package root —
|
|
11
|
+
* because the studio bundles the root barrel via `@elytracms/core/plugins` and must stay
|
|
12
|
+
* browser-safe.
|
|
13
|
+
*/
|
|
14
|
+
function walk(rootAbs, relative, out) {
|
|
15
|
+
const entries = readdirSync(join(rootAbs, relative), { withFileTypes: true });
|
|
16
|
+
for (const entry of entries) {
|
|
17
|
+
if (entry.name.startsWith('.'))
|
|
18
|
+
continue;
|
|
19
|
+
const relPath = relative === '' ? entry.name : `${relative}/${entry.name}`;
|
|
20
|
+
if (entry.isDirectory()) {
|
|
21
|
+
if (MANIFEST_IGNORED_DIRECTORIES.has(entry.name))
|
|
22
|
+
continue;
|
|
23
|
+
walk(rootAbs, relPath, out);
|
|
24
|
+
}
|
|
25
|
+
else if (isManifestFile(entry.name)) {
|
|
26
|
+
out.push(relPath);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The real {@link ManifestHost}: recursive fs walk + dynamic `import()`. Loading a
|
|
32
|
+
* `.manifest.ts` module requires a TypeScript-capable runtime (the CLI is expected to
|
|
33
|
+
* run under `tsx` or Node type stripping in the host repo); compiled `.manifest.js` /
|
|
34
|
+
* `.manifest.mjs` modules load under plain Node.
|
|
35
|
+
*/
|
|
36
|
+
export function createNodeManifestHost() {
|
|
37
|
+
return {
|
|
38
|
+
listManifestFiles(root) {
|
|
39
|
+
const out = [];
|
|
40
|
+
walk(root, '', out);
|
|
41
|
+
return out.sort();
|
|
42
|
+
},
|
|
43
|
+
async loadManifestCandidates(root, file) {
|
|
44
|
+
// Cache-bust so watch mode re-imports edited modules instead of the stale copy.
|
|
45
|
+
const url = `${pathToFileURL(join(root, file)).href}?t=${Date.now()}`;
|
|
46
|
+
const moduleExports = await import(url);
|
|
47
|
+
return extractManifestCandidates(moduleExports);
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The real {@link WorkspaceConfigHost} (EC-154): probes the conventional
|
|
53
|
+
* `elytra.config.*` names under the host-repo root and loads modules with
|
|
54
|
+
* dynamic `import()`, exactly like manifest discovery. Loading the `.ts`
|
|
55
|
+
* variants requires a TypeScript-capable runtime (`tsx` / Node type stripping);
|
|
56
|
+
* compiled `.js`/`.mjs` configs load under plain Node.
|
|
57
|
+
*/
|
|
58
|
+
export function createNodeWorkspaceConfigHost() {
|
|
59
|
+
async function loadModule(absolutePath) {
|
|
60
|
+
// Cache-bust so repeated CLI runs in one process re-import edited modules.
|
|
61
|
+
const url = `${pathToFileURL(absolutePath).href}?t=${Date.now()}`;
|
|
62
|
+
return import(url);
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
async loadConfig(root) {
|
|
66
|
+
for (const file of WORKSPACE_CONFIG_FILES) {
|
|
67
|
+
const absolute = join(root, file);
|
|
68
|
+
if (!existsSync(absolute))
|
|
69
|
+
continue;
|
|
70
|
+
return { file, moduleExports: await loadModule(absolute) };
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
},
|
|
74
|
+
loadSchemaModule(root, modulePath) {
|
|
75
|
+
return loadModule(join(root, modulePath));
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/** The real watch driver: `node:fs` recursive watch (no external watcher dependency). */
|
|
80
|
+
export function createFsWatchDriver() {
|
|
81
|
+
return {
|
|
82
|
+
watch(root, onEvent) {
|
|
83
|
+
let resolveDone;
|
|
84
|
+
const done = new Promise((resolve) => {
|
|
85
|
+
resolveDone = resolve;
|
|
86
|
+
});
|
|
87
|
+
const watcher = fsWatch(root, { recursive: true }, (_eventType, filename) => {
|
|
88
|
+
if (filename !== null)
|
|
89
|
+
onEvent({ path: filename.toString().split('\\').join('/') });
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
close() {
|
|
93
|
+
watcher.close();
|
|
94
|
+
resolveDone();
|
|
95
|
+
},
|
|
96
|
+
done,
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/export-sync/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,SAAS,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,4BAA4B,GAC7B,MAAM,iBAAiB,CAAA;AAIxB;;;;;;;GAOG;AAEH,SAAS,IAAI,CAAC,OAAe,EAAE,QAAgB,EAAE,GAAa;IAC5D,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7E,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAQ;QACxC,MAAM,OAAO,GAAG,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAA;QAC1E,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,4BAA4B,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,SAAQ;YAC1D,IAAI,CA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AQ,CAAC;oBAAE,SAAQ;gBACnC,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAA;YAC5D,CAAC;YACD,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,gBAAgB,CAAC,IAAY,EAAE,UAAkB;YAC/C,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAA;QAC3C,CAAC;KACF,CAAA;AACH,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,KAAK,CAAC,IAAY,EAAE,OAAoC;YACtD,IAAI,WAAwB,CAAA;YAC5B,MAAM,IAAI,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;gBACzC,WAAW,GAAG,OAAO,CAAA;YACvB,CAAC,CAAC,CAAA;YACF,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE;gBAC1E,IAAI,QAAQ,KAAK,IAAI;oBAAE,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;YACrF,CAAC,CAAC,CAAA;YACF,OAAO;gBACL,KAAK;oBACH,OAAO,CAAC,KAAK,EAAE,CAAA;oBACf,WAAW,EAAE,CAAA;gBACf,CAAC;gBACD,IAAI;aACL,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ComponentManifest } from '@elytracms/core/component-registry';
|
|
2
|
+
import type { ManifestHost } from './manifest-host';
|
|
3
|
+
/**
|
|
4
|
+
* The host-repo manifest discovery + validation pass (EC-147, vision AD-2).
|
|
5
|
+
* Component manifests are code-owned (defined in TS next to the components), so
|
|
6
|
+
* there is no longer a DB copy to push to: `builder push` is now a validate-only
|
|
7
|
+
* command that discovers manifest modules in the host repo, validates them with
|
|
8
|
+
* the component-registry validation (EC-011: invalid/duplicate ids) plus structural
|
|
9
|
+
* checks, and reports any problems.
|
|
10
|
+
*
|
|
11
|
+
* Failure semantics mirror `runPull`: every problem is a structured {@link PushIssue},
|
|
12
|
+
* never a throw. CI mode (`--ci`) fails the run (exit non-zero) on any issue. The
|
|
13
|
+
* discovery here is shared with `builder check` (EC-148) so both see the exact same
|
|
14
|
+
* local manifest set, validated the exact same way.
|
|
15
|
+
*/
|
|
16
|
+
export type PushIssueCode = 'load-error' | 'invalid-manifest' | 'duplicate-id' | 'invalid-id';
|
|
17
|
+
/** A file-level, structured validation failure (CI output is built from these). */
|
|
18
|
+
export interface PushIssue {
|
|
19
|
+
code: PushIssueCode;
|
|
20
|
+
severity: 'error';
|
|
21
|
+
message: string;
|
|
22
|
+
/** Root-relative manifest module path, when the issue is attributable to a file. */
|
|
23
|
+
file?: string;
|
|
24
|
+
componentId?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface PushOptions {
|
|
27
|
+
/** Host-repo scan root. */
|
|
28
|
+
root: string;
|
|
29
|
+
/** Non-interactive mode: any issue fails the run (exit non-zero). */
|
|
30
|
+
ci?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface DiscoveredManifestFile {
|
|
33
|
+
file: string;
|
|
34
|
+
ids: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface PushResult {
|
|
37
|
+
files: DiscoveredManifestFile[];
|
|
38
|
+
/** Component ids discovered and validated this run. */
|
|
39
|
+
discovered: string[];
|
|
40
|
+
issues: PushIssue[];
|
|
41
|
+
ok: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Structural validation of a single exported candidate (the manifest module contract:
|
|
45
|
+
* every export must be a manifest). Returns human-readable problems; empty = valid.
|
|
46
|
+
* Id well-formedness and cross-file duplicates are checked by `ComponentRegistry`
|
|
47
|
+
* (EC-011) afterwards.
|
|
48
|
+
*/
|
|
49
|
+
export declare function validateManifestCandidate(value: unknown): string[];
|
|
50
|
+
/** The machine-parseable issue line format shared by `push` and `check` CI output. */
|
|
51
|
+
export declare function formatPushIssue(issue: PushIssue): string;
|
|
52
|
+
/**
|
|
53
|
+
* Everything `runPush` and `runCheck` (EC-148) know about the host repo's
|
|
54
|
+
* component manifests: the conflict-free, structurally valid manifest set plus
|
|
55
|
+
* any discovery/validation issues. Shared so push and the CI check see the exact
|
|
56
|
+
* same local manifest set, validated the exact same way.
|
|
57
|
+
*/
|
|
58
|
+
export interface ManifestDiscovery {
|
|
59
|
+
files: DiscoveredManifestFile[];
|
|
60
|
+
/** id → the validated live manifest for every conflict-free, structurally valid module. */
|
|
61
|
+
manifests: Map<string, ComponentManifest>;
|
|
62
|
+
/** id → stable JSON payload (deterministic change detection). */
|
|
63
|
+
payloads: Map<string, string>;
|
|
64
|
+
/** Load + validation issues; non-empty means the local view is INCOMPLETE. */
|
|
65
|
+
issues: PushIssue[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Discover, load, and validate the host repo's manifest modules (steps 1–3):
|
|
69
|
+
* fs/module problems become `load-error`, structural problems `invalid-manifest`,
|
|
70
|
+
* and EC-011 registry validation contributes `duplicate-id`/`invalid-id`. Never throws.
|
|
71
|
+
*/
|
|
72
|
+
export declare function discoverManifests(host: ManifestHost, root: string): Promise<ManifestDiscovery>;
|
|
73
|
+
/** Run a push (discover + validate). Returns a structured result and never throws. */
|
|
74
|
+
export declare function runPush(host: ManifestHost, io: {
|
|
75
|
+
log(line: string): void;
|
|
76
|
+
}, options: PushOptions): Promise<PushResult>;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { ComponentRegistry, isPrimitive, namespaceOf } from '@elytracms/core/component-registry';
|
|
2
|
+
import { assertPropFieldDef, fieldDefSchema, fieldValueValidator } from '@elytracms/core/cms-core';
|
|
3
|
+
import { stableJson } from './core';
|
|
4
|
+
function isRecord(value) {
|
|
5
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Structural validation of a single exported candidate (the manifest module contract:
|
|
9
|
+
* every export must be a manifest). Returns human-readable problems; empty = valid.
|
|
10
|
+
* Id well-formedness and cross-file duplicates are checked by `ComponentRegistry`
|
|
11
|
+
* (EC-011) afterwards.
|
|
12
|
+
*/
|
|
13
|
+
export function validateManifestCandidate(value) {
|
|
14
|
+
if (!isRecord(value)) {
|
|
15
|
+
return [
|
|
16
|
+
'Export is not a component manifest object (every export of a *.manifest.* module must be a manifest or an array of manifests).',
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
const problems = [];
|
|
20
|
+
const id = value.id;
|
|
21
|
+
if (typeof id !== 'string' || id.length === 0) {
|
|
22
|
+
problems.push('Manifest is missing a string "id".');
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
if (typeof value.namespace !== 'string' || value.namespace !== namespaceOf(id)) {
|
|
26
|
+
problems.push(`Manifest "namespace" ("${String(value.namespace)}") does not match the id's namespace ("${namespaceOf(id)}").`);
|
|
27
|
+
}
|
|
28
|
+
if (isPrimitive(id)) {
|
|
29
|
+
problems.push(`"${id}" is under base.primitives.* — platform primitives are platform-owned and cannot be declared in a host repo.`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (!isRecord(value.props)) {
|
|
33
|
+
problems.push('Manifest "props" must be a record of prop field-defs.');
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
for (const [name, spec] of Object.entries(value.props)) {
|
|
37
|
+
// EC-190: a prop is a `FieldDef` minus `name` (the record key IS the name).
|
|
38
|
+
// It must parse as a field-def, its `default` must satisfy the field's own
|
|
39
|
+
// value validator, and document-only attrs (`filterable`/`unique`) are flagged.
|
|
40
|
+
if (!isRecord(spec)) {
|
|
41
|
+
problems.push(`Prop "${name}" must be a field-def object.`);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const parsed = fieldDefSchema.safeParse({ ...spec, name });
|
|
45
|
+
if (!parsed.success) {
|
|
46
|
+
problems.push(`Prop "${name}" is not a valid field-def (expected a cms-core FieldDef shape).`);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const field = parsed.data;
|
|
50
|
+
for (const issue of assertPropFieldDef(field))
|
|
51
|
+
problems.push(issue.message);
|
|
52
|
+
if (spec.default !== undefined && !fieldValueValidator(field)(spec.default)) {
|
|
53
|
+
problems.push(`Default value for prop "${name}" does not satisfy its own field-def.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (!Array.isArray(value.slots)) {
|
|
58
|
+
problems.push('Manifest "slots" must be an array of slot specs.');
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
for (const slot of value.slots) {
|
|
62
|
+
if (!isRecord(slot) || typeof slot.name !== 'string' || slot.name.length === 0) {
|
|
63
|
+
problems.push('Every slot spec needs a non-empty string "name".');
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (value.iterate !== undefined) {
|
|
69
|
+
const iterate = value.iterate;
|
|
70
|
+
const slotNames = Array.isArray(value.slots)
|
|
71
|
+
? value.slots.filter(isRecord).map((s) => s.name)
|
|
72
|
+
: [];
|
|
73
|
+
// EC-190 DD7: the iterated items value (an array) has NO static field-def type,
|
|
74
|
+
// so `itemsProp` is no longer a *declared* prop — it rides node.props undeclared.
|
|
75
|
+
// Only the item slot must resolve to an existing slot.
|
|
76
|
+
if (!isRecord(iterate) ||
|
|
77
|
+
typeof iterate.itemsProp !== 'string' ||
|
|
78
|
+
iterate.itemsProp.length === 0 ||
|
|
79
|
+
typeof iterate.itemSlot !== 'string' ||
|
|
80
|
+
!slotNames.includes(iterate.itemSlot)) {
|
|
81
|
+
problems.push('"iterate" must name an items prop and reference an existing item slot.');
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return problems;
|
|
85
|
+
}
|
|
86
|
+
/** The machine-parseable issue line format shared by `push` and `check` CI output. */
|
|
87
|
+
export function formatPushIssue(issue) {
|
|
88
|
+
const where = [issue.file, issue.componentId].filter(Boolean).join(' ');
|
|
89
|
+
return ` error [${issue.code}]${where ? ` ${where}` : ''} — ${issue.message}`;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Discover, load, and validate the host repo's manifest modules (steps 1–3):
|
|
93
|
+
* fs/module problems become `load-error`, structural problems `invalid-manifest`,
|
|
94
|
+
* and EC-011 registry validation contributes `duplicate-id`/`invalid-id`. Never throws.
|
|
95
|
+
*/
|
|
96
|
+
export async function discoverManifests(host, root) {
|
|
97
|
+
const issues = [];
|
|
98
|
+
const files = [];
|
|
99
|
+
/** id → file of first registration (for duplicate/file attribution). */
|
|
100
|
+
const fileOf = new Map();
|
|
101
|
+
const valid = [];
|
|
102
|
+
// 1. Discover + load manifest modules; a failing module is a file-level issue.
|
|
103
|
+
let fileList = [];
|
|
104
|
+
try {
|
|
105
|
+
fileList = [...(await host.listManifestFiles(root))].sort();
|
|
106
|
+
}
|
|
107
|
+
catch (cause) {
|
|
108
|
+
issues.push({
|
|
109
|
+
code: 'load-error',
|
|
110
|
+
severity: 'error',
|
|
111
|
+
message: `Manifest discovery failed: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
for (const file of fileList) {
|
|
115
|
+
let candidates;
|
|
116
|
+
try {
|
|
117
|
+
candidates = [...(await host.loadManifestCandidates(root, file))];
|
|
118
|
+
}
|
|
119
|
+
catch (cause) {
|
|
120
|
+
issues.push({
|
|
121
|
+
code: 'load-error',
|
|
122
|
+
severity: 'error',
|
|
123
|
+
file,
|
|
124
|
+
message: `Manifest module failed to load: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
125
|
+
});
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
const ids = [];
|
|
129
|
+
for (const candidate of candidates) {
|
|
130
|
+
const problems = validateManifestCandidate(candidate);
|
|
131
|
+
if (problems.length > 0) {
|
|
132
|
+
const componentId = isRecord(candidate) && typeof candidate.id === 'string' ? candidate.id : undefined;
|
|
133
|
+
for (const message of problems) {
|
|
134
|
+
issues.push({
|
|
135
|
+
code: 'invalid-manifest',
|
|
136
|
+
severity: 'error',
|
|
137
|
+
file,
|
|
138
|
+
...(componentId ? { componentId } : {}),
|
|
139
|
+
message,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
// Structurally verified above; the manifest interface is satisfied.
|
|
145
|
+
const manifest = candidate;
|
|
146
|
+
ids.push(manifest.id);
|
|
147
|
+
if (!fileOf.has(manifest.id))
|
|
148
|
+
fileOf.set(manifest.id, file);
|
|
149
|
+
valid.push(manifest);
|
|
150
|
+
}
|
|
151
|
+
files.push({ file, ids });
|
|
152
|
+
}
|
|
153
|
+
// 2. EC-011 registry validation over the structurally valid set: invalid ids and
|
|
154
|
+
// duplicate ids come from the same ComponentRegistry that guards authoring.
|
|
155
|
+
const registry = new ComponentRegistry(valid);
|
|
156
|
+
const excluded = new Set();
|
|
157
|
+
for (const issue of registry.issues) {
|
|
158
|
+
excluded.add(issue.componentId);
|
|
159
|
+
const firstFile = fileOf.get(issue.componentId);
|
|
160
|
+
issues.push({
|
|
161
|
+
code: issue.code === 'duplicate-id' ? 'duplicate-id' : 'invalid-id',
|
|
162
|
+
severity: 'error',
|
|
163
|
+
...(firstFile ? { file: firstFile } : {}),
|
|
164
|
+
componentId: issue.componentId,
|
|
165
|
+
message: issue.code === 'duplicate-id'
|
|
166
|
+
? `Duplicate component id "${issue.componentId}" across manifest modules (first declared in ${firstFile ?? 'unknown'}).`
|
|
167
|
+
: issue.message,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
// 3. Collect the conflict-free manifests + deterministic payloads (change detection).
|
|
171
|
+
const payloads = new Map();
|
|
172
|
+
const manifests = new Map();
|
|
173
|
+
for (const manifest of valid) {
|
|
174
|
+
if (excluded.has(manifest.id) || manifests.has(manifest.id))
|
|
175
|
+
continue;
|
|
176
|
+
manifests.set(manifest.id, manifest);
|
|
177
|
+
payloads.set(manifest.id, stableJson({ id: manifest.id, namespace: manifest.namespace }));
|
|
178
|
+
}
|
|
179
|
+
return { files, manifests, payloads, issues };
|
|
180
|
+
}
|
|
181
|
+
/** Run a push (discover + validate). Returns a structured result and never throws. */
|
|
182
|
+
export async function runPush(host, io, options) {
|
|
183
|
+
const { files, manifests, issues } = await discoverManifests(host, options.root);
|
|
184
|
+
io.log(`Push (${options.root}): ${manifests.size} manifest(s) in ${files.length} file(s)${issues.length ? ` — ${issues.length} issue(s)` : ''}.`);
|
|
185
|
+
for (const issue of issues)
|
|
186
|
+
io.log(formatPushIssue(issue));
|
|
187
|
+
const discovered = [...manifests.keys()].sort();
|
|
188
|
+
if (issues.length > 0) {
|
|
189
|
+
io.log(options.ci
|
|
190
|
+
? 'CI mode: validation failed.'
|
|
191
|
+
: `Validated ${discovered.length} manifest(s) with ${issues.length} issue(s).`);
|
|
192
|
+
return { files, discovered, issues, ok: false };
|
|
193
|
+
}
|
|
194
|
+
io.log(`Validated ${discovered.length} manifest(s).`);
|
|
195
|
+
return { files, discovered, issues, ok: true };
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=push.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/export-sync/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAA;AAEhG,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAElG,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAiDnC,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QA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AAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhF,EAAE,CAAC,GAAG,CACJ,SAAS,OAAO,CAAC,IAAI,MAAM,SAAS,CAAC,IAAI,mBAAmB,KAAK,CAAC,MAAM,WAAW,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,MAAM,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,CAC1I,CAAA;IACD,KAAK,MAAM,KAAK,IAAI,MAAM;QAAE,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAA;IAE1D,MAAM,UAAU,GAAG,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC/C,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,EAAE,CAAC,GAAG,CACJ,OAAO,CAAC,EAAE;YACR,CAAC,CAAC,6BAA6B;YAC/B,CAAC,CAAC,aAAa,UAAU,CAAC,MAAM,qBAAqB,MAAM,CAAC,MAAM,YAAY,CACjF,CAAA;QACD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,CAAA;IACjD,CAAC;IAED,EAAE,CAAC,GAAG,CAAC,aAAa,UAAU,CAAC,MAAM,eAAe,CAAC,CAAA;IACrD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;AAChD,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared CLI ↔ builder HTTP transport (EC-157). The `builder check` / `builder
|
|
3
|
+
* typegen` snapshot endpoint is served by the builder's Convex deployment
|
|
4
|
+
* (`convex/http.ts` + `convex/sync.ts`), authenticated with the EC-150 Bearer CLI
|
|
5
|
+
* tokens. This module fixes the endpoint layout, the token header, the request
|
|
6
|
+
* helper, and the structured error contract that the snapshot exchange uses.
|
|
7
|
+
*
|
|
8
|
+
* Component manifests are code-owned (defined in TS next to the components) and are
|
|
9
|
+
* no longer mirrored in builder persistence — there is no manifest push/list/sync
|
|
10
|
+
* client. What remains here is the shared snapshot transport.
|
|
11
|
+
*/
|
|
12
|
+
/** Env var the CLI reads the sync token from when `--token` is not passed. */
|
|
13
|
+
export declare const SYNC_TOKEN_ENV = "ELYTRA_SYNC_TOKEN";
|
|
14
|
+
/** Header carrying the sync token: `Authorization: Bearer <token>`. */
|
|
15
|
+
export declare const REGISTRY_SYNC_TOKEN_HEADER = "authorization";
|
|
16
|
+
/** Resolve the sync token: explicit flag wins, then `ELYTRA_SYNC_TOKEN`. */
|
|
17
|
+
export declare function resolveSyncToken(flagValue: string | undefined, env: Record<string, string | undefined>): string | undefined;
|
|
18
|
+
/** Endpoint layout the builder implements (EC-157 — Convex HTTP action in `convex/sync.ts`). */
|
|
19
|
+
export declare function registrySyncEndpoints(baseUrl: string, projectId: string): {
|
|
20
|
+
snapshot: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* One structured problem inside a builder error response — mirrors the CLI's
|
|
24
|
+
* issue granularity (per-item validation failures keep their component id).
|
|
25
|
+
*/
|
|
26
|
+
export interface RegistrySyncErrorIssue {
|
|
27
|
+
code: string;
|
|
28
|
+
message: string;
|
|
29
|
+
componentId?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The structured error body every builder sync endpoint returns on failure (EC-157):
|
|
33
|
+
* auth failures and validation problems are data, never opaque 500s.
|
|
34
|
+
*/
|
|
35
|
+
export interface RegistrySyncErrorBody {
|
|
36
|
+
error: {
|
|
37
|
+
code: string;
|
|
38
|
+
message: string;
|
|
39
|
+
issues?: RegistrySyncErrorIssue[];
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** A failed CLI ↔ builder exchange — reported as a structured `transport` issue. */
|
|
43
|
+
export declare class RegistrySyncTransportError extends Error {
|
|
44
|
+
/** HTTP status of the builder response, when one was received. */
|
|
45
|
+
readonly status?: number;
|
|
46
|
+
/** Structured issues from the builder error body, when it sent any. */
|
|
47
|
+
readonly issues?: RegistrySyncErrorIssue[];
|
|
48
|
+
constructor(message: string, options?: {
|
|
49
|
+
status?: number;
|
|
50
|
+
issues?: RegistrySyncErrorIssue[];
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* One authenticated JSON exchange with a builder sync endpoint. Used by the HTTP
|
|
55
|
+
* builder source (`builder-source.ts`) to fetch the typegen/check snapshot. Non-OK
|
|
56
|
+
* responses become {@link RegistrySyncTransportError}s carrying the builder's
|
|
57
|
+
* structured error body (code, message, per-item issues) when one was returned.
|
|
58
|
+
*/
|
|
59
|
+
export declare function registrySyncRequest<T>(fetchImpl: typeof fetch, url: string, method: 'GET' | 'POST', token: string | undefined, body?: unknown): Promise<T>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared CLI ↔ builder HTTP transport (EC-157). The `builder check` / `builder
|
|
3
|
+
* typegen` snapshot endpoint is served by the builder's Convex deployment
|
|
4
|
+
* (`convex/http.ts` + `convex/sync.ts`), authenticated with the EC-150 Bearer CLI
|
|
5
|
+
* tokens. This module fixes the endpoint layout, the token header, the request
|
|
6
|
+
* helper, and the structured error contract that the snapshot exchange uses.
|
|
7
|
+
*
|
|
8
|
+
* Component manifests are code-owned (defined in TS next to the components) and are
|
|
9
|
+
* no longer mirrored in builder persistence — there is no manifest push/list/sync
|
|
10
|
+
* client. What remains here is the shared snapshot transport.
|
|
11
|
+
*/
|
|
12
|
+
/** Env var the CLI reads the sync token from when `--token` is not passed. */
|
|
13
|
+
export const SYNC_TOKEN_ENV = 'ELYTRA_SYNC_TOKEN';
|
|
14
|
+
/** Header carrying the sync token: `Authorization: Bearer <token>`. */
|
|
15
|
+
export const REGISTRY_SYNC_TOKEN_HEADER = 'authorization';
|
|
16
|
+
/** Resolve the sync token: explicit flag wins, then `ELYTRA_SYNC_TOKEN`. */
|
|
17
|
+
export function resolveSyncToken(flagValue, env) {
|
|
18
|
+
return flagValue ?? env[SYNC_TOKEN_ENV];
|
|
19
|
+
}
|
|
20
|
+
/** Endpoint layout the builder implements (EC-157 — Convex HTTP action in `convex/sync.ts`). */
|
|
21
|
+
export function registrySyncEndpoints(baseUrl, projectId) {
|
|
22
|
+
const base = `${baseUrl.replace(/\/$/, '')}/api/projects/${projectId}/registry-sync`;
|
|
23
|
+
return {
|
|
24
|
+
snapshot: `${base}/snapshot`,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function parseErrorBody(value) {
|
|
28
|
+
if (typeof value !== 'object' || value === null)
|
|
29
|
+
return undefined;
|
|
30
|
+
const error = value.error;
|
|
31
|
+
if (typeof error !== 'object' || error === null)
|
|
32
|
+
return undefined;
|
|
33
|
+
const { code, message, issues } = error;
|
|
34
|
+
if (typeof code !== 'string' || typeof message !== 'string')
|
|
35
|
+
return undefined;
|
|
36
|
+
return {
|
|
37
|
+
code,
|
|
38
|
+
message,
|
|
39
|
+
...(Array.isArray(issues)
|
|
40
|
+
? {
|
|
41
|
+
issues: issues.filter((issue) => typeof issue === 'object' &&
|
|
42
|
+
issue !== null &&
|
|
43
|
+
typeof issue.code === 'string' &&
|
|
44
|
+
typeof issue.message === 'string'),
|
|
45
|
+
}
|
|
46
|
+
: {}),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** A failed CLI ↔ builder exchange — reported as a structured `transport` issue. */
|
|
50
|
+
export class RegistrySyncTransportError extends Error {
|
|
51
|
+
/** HTTP status of the builder response, when one was received. */
|
|
52
|
+
status;
|
|
53
|
+
/** Structured issues from the builder error body, when it sent any. */
|
|
54
|
+
issues;
|
|
55
|
+
constructor(message, options = {}) {
|
|
56
|
+
super(message);
|
|
57
|
+
this.name = 'RegistrySyncTransportError';
|
|
58
|
+
if (options.status !== undefined)
|
|
59
|
+
this.status = options.status;
|
|
60
|
+
if (options.issues !== undefined)
|
|
61
|
+
this.issues = options.issues;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* One authenticated JSON exchange with a builder sync endpoint. Used by the HTTP
|
|
66
|
+
* builder source (`builder-source.ts`) to fetch the typegen/check snapshot. Non-OK
|
|
67
|
+
* responses become {@link RegistrySyncTransportError}s carrying the builder's
|
|
68
|
+
* structured error body (code, message, per-item issues) when one was returned.
|
|
69
|
+
*/
|
|
70
|
+
export async function registrySyncRequest(fetchImpl, url, method, token, body) {
|
|
71
|
+
const headers = { 'content-type': 'application/json' };
|
|
72
|
+
if (token)
|
|
73
|
+
headers[REGISTRY_SYNC_TOKEN_HEADER] = `Bearer ${token}`;
|
|
74
|
+
let response;
|
|
75
|
+
try {
|
|
76
|
+
response = await fetchImpl(url, {
|
|
77
|
+
method,
|
|
78
|
+
headers,
|
|
79
|
+
...(body === undefined ? {} : { body: JSON.stringify(body) }),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
catch (cause) {
|
|
83
|
+
throw new RegistrySyncTransportError(`Builder unreachable at ${url}: ${cause instanceof Error ? cause.message : String(cause)}`);
|
|
84
|
+
}
|
|
85
|
+
if (!response.ok) {
|
|
86
|
+
const errorBody = parseErrorBody(await response.json().catch(() => undefined));
|
|
87
|
+
const issueLines = (errorBody?.issues ?? [])
|
|
88
|
+
.map((issue) => `[${issue.code}]${issue.componentId ? ` ${issue.componentId}` : ''} ${issue.message}`)
|
|
89
|
+
.join('; ');
|
|
90
|
+
throw new RegistrySyncTransportError(`Builder responded ${response.status} for ${method} ${url}${errorBody ? ` — ${errorBody.code}: ${errorBody.message}` : '.'}${issueLines ? ` (${issueLines})` : ''}`, {
|
|
91
|
+
status: response.status,
|
|
92
|
+
...(errorBody?.issues ? { issues: errorBody.issues } : {}),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return (await response.json());
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=registry-sync-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-sync-client.js","sourceRoot":"","sources":["../../src/export-sync/registry-sync-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAA;AAEjD,uEAAuE;AACvE,MAAM,CAAC,MAAM,0BAA0B,GAAG,eAAe,CAAA;AAEzD,4EAA4E;AAC5E,MAAM,UAAU,gBAAgB,CAC9B,SAA6B,EAC7B,GAAuC;IAEvC,OAAO,SAAS,IAAI,GAAG,CAAC,cAAc,CAAC,CAAA;AACzC,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,qBAAqB,CACnC,OAAe,EACf,SAAiB;IAIjB,MAAM,IAAI,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,SAAS,gBAAgB,CAAA;IACpF,OAAO;QACL,QAAQ,EAAE,GAAG,IAAI,WAAW;KAC7B,CAAA;AACH,CAAC;AAwBD,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAA;IACjE,MAAM,KAAK,GAAI,KAA6B,CAAC,KAAK,CAAA;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAA;IACjE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAgC,CAAA;IAClE,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAA;IAC7E,OAAO;QACL,IAAI;QACJ,OAAO;QACP,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YACvB,CAAC,CAAC;gBACE,MAAM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IAAI,EAAE,CAAM,CAAA;AACrC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ExportInput, ExportMode, GeneratedFile } from './core';
|
|
2
|
+
import type { ExportIssue } from './validate';
|
|
3
|
+
/**
|
|
4
|
+
* Pull / sync / drift (EC-110–112). The CLI's job is provider-neutral: a {@link ExportSource}
|
|
5
|
+
* yields the canonical model (from Convex in production, from a fixture offline); the pull
|
|
6
|
+
* validates, generates, and writes — or, in validate/drift modes, only reports. CI runs this
|
|
7
|
+
* before `next build` and fails on validation errors or drift.
|
|
8
|
+
*/
|
|
9
|
+
/** Provider-neutral source of the canonical model (Convex adapter in production; fixture offline). */
|
|
10
|
+
export interface ExportSource {
|
|
11
|
+
loadInput(mode: ExportMode): Promise<ExportInput> | ExportInput;
|
|
12
|
+
}
|
|
13
|
+
/** Injected file IO so the pull is fully testable (in-memory in tests, fs in the real bin). */
|
|
14
|
+
export interface FileIO {
|
|
15
|
+
read(path: string): string | undefined;
|
|
16
|
+
write(path: string, contents: string): void;
|
|
17
|
+
log(message: string): void;
|
|
18
|
+
}
|
|
19
|
+
export type DriftStatus = 'added' | 'changed' | 'unchanged';
|
|
20
|
+
export interface DriftEntry {
|
|
21
|
+
path: string;
|
|
22
|
+
status: DriftStatus;
|
|
23
|
+
}
|
|
24
|
+
export interface PullOptions {
|
|
25
|
+
mode: ExportMode;
|
|
26
|
+
/** Validate + report only; never write files. */
|
|
27
|
+
validateOnly?: boolean;
|
|
28
|
+
/** Compute drift against the existing repo files; never write. */
|
|
29
|
+
checkDrift?: boolean;
|
|
30
|
+
/** Treat any error-severity validation issue (or, in drift mode, any drift) as failure. */
|
|
31
|
+
failOnError?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface PullResult {
|
|
34
|
+
mode: ExportMode;
|
|
35
|
+
issues: ExportIssue[];
|
|
36
|
+
files: GeneratedFile[];
|
|
37
|
+
drift: DriftEntry[];
|
|
38
|
+
/** Paths actually written (empty in validate/drift modes). */
|
|
39
|
+
wrote: string[];
|
|
40
|
+
/** Overall success (respects failOnError). */
|
|
41
|
+
ok: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Run a pull. Returns a structured result and never throws; validation issues are data. Writes
|
|
45
|
+
* files only when not in validate/drift mode and (if failOnError) there are no error issues.
|
|
46
|
+
*/
|
|
47
|
+
export declare function runPull(source: ExportSource, io: FileIO, options: PullOptions): Promise<PullResult>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { generateExport } from './generate';
|
|
2
|
+
import { isExportable, validateExport } from './validate';
|
|
3
|
+
function computeDrift(files, io) {
|
|
4
|
+
return files.map((file) => {
|
|
5
|
+
const existing = io.read(file.path);
|
|
6
|
+
const status = existing === undefined ? 'added' : existing === file.contents ? 'unchanged' : 'changed';
|
|
7
|
+
return { path: file.path, status };
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Run a pull. Returns a structured result and never throws; validation issues are data. Writes
|
|
12
|
+
* files only when not in validate/drift mode and (if failOnError) there are no error issues.
|
|
13
|
+
*/
|
|
14
|
+
export async function runPull(source, io, options) {
|
|
15
|
+
const input = await source.loadInput(options.mode);
|
|
16
|
+
const issues = validateExport(input);
|
|
17
|
+
const exportable = isExportable(issues);
|
|
18
|
+
const errorCount = issues.filter((i) => i.severity === 'error').length;
|
|
19
|
+
io.log(`Pull (${options.mode}): ${issues.length} validation issue(s)${errorCount ? ` — ${errorCount} error(s)` : ''}.`);
|
|
20
|
+
// Validation gate: with --fail-on-error a broken graph never produces output (EC-111/112).
|
|
21
|
+
if (options.failOnError && !exportable) {
|
|
22
|
+
for (const issue of issues.filter((i) => i.severity === 'error'))
|
|
23
|
+
io.log(` error [${issue.code}] ${issue.message}`);
|
|
24
|
+
return { mode: options.mode, issues, files: [], drift: [], wrote: [], ok: false };
|
|
25
|
+
}
|
|
26
|
+
const files = generateExport(input);
|
|
27
|
+
if (options.validateOnly) {
|
|
28
|
+
return { mode: options.mode, issues, files, drift: [], wrote: [], ok: exportable };
|
|
29
|
+
}
|
|
30
|
+
const drift = computeDrift(files, io);
|
|
31
|
+
if (options.checkDrift) {
|
|
32
|
+
const changed = drift.filter((d) => d.status !== 'unchanged');
|
|
33
|
+
for (const d of changed)
|
|
34
|
+
io.log(` drift ${d.status}: ${d.path}`);
|
|
35
|
+
io.log(`Drift: ${changed.length} of ${files.length} file(s) out of sync.`);
|
|
36
|
+
const ok = (!options.failOnError || changed.length === 0) && exportable;
|
|
37
|
+
return { mode: options.mode, issues, files, drift, wrote: [], ok };
|
|
38
|
+
}
|
|
39
|
+
const wrote = [];
|
|
40
|
+
for (const file of files) {
|
|
41
|
+
io.write(file.path, file.contents);
|
|
42
|
+
wrote.push(file.path);
|
|
43
|
+
}
|
|
44
|
+
io.log(`Wrote ${wrote.length} file(s).`);
|
|
45
|
+
return { mode: options.mode, issues, files, drift, wrote, ok: exportable };
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=sync.js.map
|