create-relkit 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-name.d.ts +8 -1
- package/dist/add-name.d.ts.map +1 -1
- package/dist/add-name.js +5 -1
- package/dist/add-name.js.map +1 -1
- package/dist/add-options-parser.d.ts +49 -0
- package/dist/add-options-parser.d.ts.map +1 -1
- package/dist/add-options-parser.js +52 -0
- package/dist/add-options-parser.js.map +1 -1
- package/dist/add-options-resource.d.ts +8 -0
- package/dist/add-options-resource.d.ts.map +1 -1
- package/dist/add-options-resource.js +8 -0
- package/dist/add-options-resource.js.map +1 -1
- package/dist/add-options.d.ts +6 -1
- package/dist/add-options.d.ts.map +1 -1
- package/dist/add-options.js +48 -1
- package/dist/add-options.js.map +1 -1
- package/dist/add-output.d.ts +10 -0
- package/dist/add-output.d.ts.map +1 -1
- package/dist/add-output.js +21 -0
- package/dist/add-output.js.map +1 -1
- package/dist/add-plan.d.ts +25 -0
- package/dist/add-plan.d.ts.map +1 -1
- package/dist/add-plan.js +91 -57
- package/dist/add-plan.js.map +1 -1
- package/dist/add-plan.types.d.ts +13 -0
- package/dist/add-plan.types.d.ts.map +1 -0
- package/dist/add-plan.types.js +2 -0
- package/dist/add-plan.types.js.map +1 -0
- package/dist/add-resolution-discovery.d.ts +56 -2
- package/dist/add-resolution-discovery.d.ts.map +1 -1
- package/dist/add-resolution-discovery.js +74 -10
- package/dist/add-resolution-discovery.js.map +1 -1
- package/dist/add-resolution-prompt.d.ts +46 -0
- package/dist/add-resolution-prompt.d.ts.map +1 -0
- package/dist/add-resolution-prompt.js +88 -0
- package/dist/add-resolution-prompt.js.map +1 -0
- package/dist/add-resolution-state-base.d.ts +112 -0
- package/dist/add-resolution-state-base.d.ts.map +1 -0
- package/dist/add-resolution-state-base.js +141 -0
- package/dist/add-resolution-state-base.js.map +1 -0
- package/dist/add-resolution-state.d.ts +66 -11
- package/dist/add-resolution-state.d.ts.map +1 -1
- package/dist/add-resolution-state.js +81 -69
- package/dist/add-resolution-state.js.map +1 -1
- package/dist/add-resolution-state.types.d.ts +6 -0
- package/dist/add-resolution-state.types.d.ts.map +1 -0
- package/dist/add-resolution-state.types.js +2 -0
- package/dist/add-resolution-state.types.js.map +1 -0
- package/dist/add-resolver-domain-execution.d.ts +35 -0
- package/dist/add-resolver-domain-execution.d.ts.map +1 -0
- package/dist/add-resolver-domain-execution.js +101 -0
- package/dist/add-resolver-domain-execution.js.map +1 -0
- package/dist/add-resolver-domain-input.d.ts +30 -0
- package/dist/add-resolver-domain-input.d.ts.map +1 -0
- package/dist/add-resolver-domain-input.js +83 -0
- package/dist/add-resolver-domain-input.js.map +1 -0
- package/dist/add-resolver-domain.d.ts +17 -0
- package/dist/add-resolver-domain.d.ts.map +1 -1
- package/dist/add-resolver-domain.js +36 -136
- package/dist/add-resolver-domain.js.map +1 -1
- package/dist/add-resolver-platform.d.ts +17 -0
- package/dist/add-resolver-platform.d.ts.map +1 -1
- package/dist/add-resolver-platform.js +83 -36
- package/dist/add-resolver-platform.js.map +1 -1
- package/dist/add-resolver-provider.d.ts +15 -0
- package/dist/add-resolver-provider.d.ts.map +1 -0
- package/dist/add-resolver-provider.js +67 -0
- package/dist/add-resolver-provider.js.map +1 -0
- package/dist/add-resolver-resources.d.ts +17 -0
- package/dist/add-resolver-resources.d.ts.map +1 -1
- package/dist/add-resolver-resources.js +79 -85
- package/dist/add-resolver-resources.js.map +1 -1
- package/dist/add-resolver.d.ts +33 -9
- package/dist/add-resolver.d.ts.map +1 -1
- package/dist/add-resolver.js +70 -31
- package/dist/add-resolver.js.map +1 -1
- package/dist/add-resolver.types.d.ts +27 -0
- package/dist/add-resolver.types.d.ts.map +1 -0
- package/dist/add-resolver.types.js +2 -0
- package/dist/add-resolver.types.js.map +1 -0
- package/dist/add-transaction-files-compat.d.ts +33 -0
- package/dist/add-transaction-files-compat.d.ts.map +1 -0
- package/dist/add-transaction-files-compat.js +42 -0
- package/dist/add-transaction-files-compat.js.map +1 -0
- package/dist/add-transaction-files.d.ts +49 -9
- package/dist/add-transaction-files.d.ts.map +1 -1
- package/dist/add-transaction-files.js +122 -74
- package/dist/add-transaction-files.js.map +1 -1
- package/dist/add-transaction-files.types.d.ts +7 -0
- package/dist/add-transaction-files.types.d.ts.map +1 -0
- package/dist/add-transaction-files.types.js +2 -0
- package/dist/add-transaction-files.types.js.map +1 -0
- package/dist/add-transaction-process.d.ts +37 -0
- package/dist/add-transaction-process.d.ts.map +1 -0
- package/dist/add-transaction-process.js +54 -0
- package/dist/add-transaction-process.js.map +1 -0
- package/dist/add-transaction-workflow.d.ts +23 -0
- package/dist/add-transaction-workflow.d.ts.map +1 -0
- package/dist/add-transaction-workflow.js +77 -0
- package/dist/add-transaction-workflow.js.map +1 -0
- package/dist/add-transaction.d.ts +26 -13
- package/dist/add-transaction.d.ts.map +1 -1
- package/dist/add-transaction.js +55 -105
- package/dist/add-transaction.js.map +1 -1
- package/dist/add-transaction.types.d.ts +32 -0
- package/dist/add-transaction.types.d.ts.map +1 -0
- package/dist/add-transaction.types.js +2 -0
- package/dist/add-transaction.types.js.map +1 -0
- package/dist/add-types.d.ts +56 -0
- package/dist/add-types.d.ts.map +1 -1
- package/dist/add-types.js +15 -0
- package/dist/add-types.js.map +1 -1
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +83 -0
- package/dist/bin.js.map +1 -0
- package/dist/bucket-profiles.d.ts +17 -3
- package/dist/bucket-profiles.d.ts.map +1 -1
- package/dist/bucket-profiles.js +27 -5
- package/dist/bucket-profiles.js.map +1 -1
- package/dist/bucket-profiles.types.d.ts +9 -0
- package/dist/bucket-profiles.types.d.ts.map +1 -0
- package/dist/bucket-profiles.types.js +2 -0
- package/dist/bucket-profiles.types.js.map +1 -0
- package/dist/build-catalog.d.ts +14 -0
- package/dist/build-catalog.d.ts.map +1 -0
- package/dist/build-catalog.js +70 -0
- package/dist/build-catalog.js.map +1 -0
- package/dist/catalog-resolution.d.ts +12 -0
- package/dist/catalog-resolution.d.ts.map +1 -0
- package/dist/catalog-resolution.js +43 -0
- package/dist/catalog-resolution.js.map +1 -0
- package/dist/catalog-resolution.types.d.ts +3 -0
- package/dist/catalog-resolution.types.d.ts.map +1 -0
- package/dist/catalog-resolution.types.js +2 -0
- package/dist/catalog-resolution.types.js.map +1 -0
- package/dist/create-preview.d.ts +30 -7
- package/dist/create-preview.d.ts.map +1 -1
- package/dist/create-preview.js +41 -11
- package/dist/create-preview.js.map +1 -1
- package/dist/create-preview.types.d.ts +9 -0
- package/dist/create-preview.types.d.ts.map +1 -0
- package/dist/create-preview.types.js +2 -0
- package/dist/create-preview.types.js.map +1 -0
- package/dist/create-resolver.d.ts +27 -10
- package/dist/create-resolver.d.ts.map +1 -1
- package/dist/create-resolver.js +105 -74
- package/dist/create-resolver.js.map +1 -1
- package/dist/create-resolver.types.d.ts +15 -0
- package/dist/create-resolver.types.d.ts.map +1 -0
- package/dist/create-resolver.types.js +2 -0
- package/dist/create-resolver.types.js.map +1 -0
- package/dist/dependency-patch-installation.d.ts +16 -0
- package/dist/dependency-patch-installation.d.ts.map +1 -0
- package/dist/dependency-patch-installation.js +59 -0
- package/dist/dependency-patch-installation.js.map +1 -0
- package/dist/dependency-patches.d.ts +57 -0
- package/dist/dependency-patches.d.ts.map +1 -0
- package/dist/dependency-patches.js +134 -0
- package/dist/dependency-patches.js.map +1 -0
- package/dist/dependency-patches.types.d.ts +21 -0
- package/dist/dependency-patches.types.d.ts.map +1 -0
- package/dist/dependency-patches.types.js +2 -0
- package/dist/dependency-patches.types.js.map +1 -0
- package/dist/domain-artifact.d.ts +76 -0
- package/dist/domain-artifact.d.ts.map +1 -0
- package/dist/domain-artifact.js +115 -0
- package/dist/domain-artifact.js.map +1 -0
- package/dist/domain-planning.d.ts +36 -20
- package/dist/domain-planning.d.ts.map +1 -1
- package/dist/domain-planning.js +45 -55
- package/dist/domain-planning.js.map +1 -1
- package/dist/domain-planning.types.d.ts +21 -0
- package/dist/domain-planning.types.d.ts.map +1 -0
- package/dist/domain-planning.types.js +2 -0
- package/dist/domain-planning.types.js.map +1 -0
- package/dist/generate-deployment.d.ts +18 -0
- package/dist/generate-deployment.d.ts.map +1 -0
- package/dist/generate-deployment.js +100 -0
- package/dist/generate-deployment.js.map +1 -0
- package/dist/generate-files-compat.d.ts +43 -0
- package/dist/generate-files-compat.d.ts.map +1 -0
- package/dist/generate-files-compat.js +56 -0
- package/dist/generate-files-compat.js.map +1 -0
- package/dist/generate-files-utilities.d.ts +63 -10
- package/dist/generate-files-utilities.d.ts.map +1 -1
- package/dist/generate-files-utilities.js +99 -48
- package/dist/generate-files-utilities.js.map +1 -1
- package/dist/generate-files-utilities.types.d.ts +6 -0
- package/dist/generate-files-utilities.types.d.ts.map +1 -0
- package/dist/generate-files-utilities.types.js +2 -0
- package/dist/generate-files-utilities.types.js.map +1 -0
- package/dist/generate-files.d.ts +30 -1
- package/dist/generate-files.d.ts.map +1 -1
- package/dist/generate-files.js +56 -85
- package/dist/generate-files.js.map +1 -1
- package/dist/generate-output.d.ts +14 -17
- package/dist/generate-output.d.ts.map +1 -1
- package/dist/generate-output.js +27 -0
- package/dist/generate-output.js.map +1 -1
- package/dist/generate-output.types.d.ts +21 -0
- package/dist/generate-output.types.d.ts.map +1 -0
- package/dist/generate-output.types.js +2 -0
- package/dist/generate-output.types.js.map +1 -0
- package/dist/generate-process.d.ts +60 -0
- package/dist/generate-process.d.ts.map +1 -1
- package/dist/generate-process.js +95 -31
- package/dist/generate-process.js.map +1 -1
- package/dist/generate-stage-cleanup.d.ts +17 -0
- package/dist/generate-stage-cleanup.d.ts.map +1 -0
- package/dist/generate-stage-cleanup.js +30 -0
- package/dist/generate-stage-cleanup.js.map +1 -0
- package/dist/generate-types.d.ts +36 -0
- package/dist/generate-types.d.ts.map +1 -1
- package/dist/generate-types.js +16 -0
- package/dist/generate-types.js.map +1 -1
- package/dist/generate-workflow.d.ts +31 -0
- package/dist/generate-workflow.d.ts.map +1 -0
- package/dist/generate-workflow.js +117 -0
- package/dist/generate-workflow.js.map +1 -0
- package/dist/generate.d.ts +29 -1
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +55 -97
- package/dist/generate.js.map +1 -1
- package/dist/generate.service.types.d.ts +15 -0
- package/dist/generate.service.types.d.ts.map +1 -0
- package/dist/generate.service.types.js +2 -0
- package/dist/generate.service.types.js.map +1 -0
- package/dist/generator-cleanup.d.ts +27 -0
- package/dist/generator-cleanup.d.ts.map +1 -0
- package/dist/generator-cleanup.js +64 -0
- package/dist/generator-cleanup.js.map +1 -0
- package/dist/generator-cleanup.types.d.ts +6 -0
- package/dist/generator-cleanup.types.d.ts.map +1 -0
- package/dist/generator-cleanup.types.js +2 -0
- package/dist/generator-cleanup.types.js.map +1 -0
- package/dist/generator-errors.d.ts +74 -0
- package/dist/generator-errors.d.ts.map +1 -0
- package/dist/generator-errors.js +89 -0
- package/dist/generator-errors.js.map +1 -0
- package/dist/generator-filesystem.d.ts +25 -0
- package/dist/generator-filesystem.d.ts.map +1 -0
- package/dist/generator-filesystem.js +68 -0
- package/dist/generator-filesystem.js.map +1 -0
- package/dist/generator-filesystem.types.d.ts +112 -0
- package/dist/generator-filesystem.types.d.ts.map +1 -0
- package/dist/generator-filesystem.types.js +2 -0
- package/dist/generator-filesystem.types.js.map +1 -0
- package/dist/generator-paths.d.ts +13 -0
- package/dist/generator-paths.d.ts.map +1 -0
- package/dist/generator-paths.js +45 -0
- package/dist/generator-paths.js.map +1 -0
- package/dist/generator-paths.types.d.ts +40 -0
- package/dist/generator-paths.types.d.ts.map +1 -0
- package/dist/generator-paths.types.js +2 -0
- package/dist/generator-paths.types.js.map +1 -0
- package/dist/generator-process.d.ts +25 -0
- package/dist/generator-process.d.ts.map +1 -0
- package/dist/generator-process.js +124 -0
- package/dist/generator-process.js.map +1 -0
- package/dist/generator-process.types.d.ts +27 -0
- package/dist/generator-process.types.d.ts.map +1 -0
- package/dist/generator-process.types.js +2 -0
- package/dist/generator-process.types.js.map +1 -0
- package/dist/generator-prompt.d.ts +22 -0
- package/dist/generator-prompt.d.ts.map +1 -0
- package/dist/generator-prompt.js +58 -0
- package/dist/generator-prompt.js.map +1 -0
- package/dist/generator-prompt.types.d.ts +38 -0
- package/dist/generator-prompt.types.d.ts.map +1 -0
- package/dist/generator-prompt.types.js +2 -0
- package/dist/generator-prompt.types.js.map +1 -0
- package/dist/generator-runtime.d.ts +22 -0
- package/dist/generator-runtime.d.ts.map +1 -0
- package/dist/generator-runtime.js +31 -0
- package/dist/generator-runtime.js.map +1 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -79
- package/dist/index.js.map +1 -1
- package/dist/options.d.ts +50 -1
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +48 -1
- package/dist/options.js.map +1 -1
- package/dist/patches/drizzle-orm.patch +692 -0
- package/dist/plan-builder-effects.d.ts +124 -0
- package/dist/plan-builder-effects.d.ts.map +1 -0
- package/dist/plan-builder-effects.js +172 -0
- package/dist/plan-builder-effects.js.map +1 -0
- package/dist/plan-builder-files.d.ts +12 -0
- package/dist/plan-builder-files.d.ts.map +1 -0
- package/dist/plan-builder-files.js +99 -0
- package/dist/plan-builder-files.js.map +1 -0
- package/dist/plan-builder-files.types.d.ts +49 -0
- package/dist/plan-builder-files.types.d.ts.map +1 -0
- package/dist/plan-builder-files.types.js +2 -0
- package/dist/plan-builder-files.types.js.map +1 -0
- package/dist/plan-builder-manifest.d.ts +11 -0
- package/dist/plan-builder-manifest.d.ts.map +1 -0
- package/dist/plan-builder-manifest.js +37 -0
- package/dist/plan-builder-manifest.js.map +1 -0
- package/dist/plan-builder.d.ts +78 -18
- package/dist/plan-builder.d.ts.map +1 -1
- package/dist/plan-builder.js +105 -126
- package/dist/plan-builder.js.map +1 -1
- package/dist/plan-builder.types.d.ts +22 -0
- package/dist/plan-builder.types.d.ts.map +1 -0
- package/dist/plan-builder.types.js +2 -0
- package/dist/plan-builder.types.js.map +1 -0
- package/dist/plan-manifest.d.ts +16 -4
- package/dist/plan-manifest.d.ts.map +1 -1
- package/dist/plan-manifest.js +60 -3
- package/dist/plan-manifest.js.map +1 -1
- package/dist/plan-manifest.types.d.ts +13 -0
- package/dist/plan-manifest.types.d.ts.map +1 -0
- package/dist/plan-manifest.types.js +2 -0
- package/dist/plan-manifest.types.js.map +1 -0
- package/dist/project-catalog.d.ts +17 -0
- package/dist/project-catalog.d.ts.map +1 -0
- package/dist/project-catalog.js +69 -0
- package/dist/project-catalog.js.map +1 -0
- package/dist/project-discovery-app.d.ts +7 -0
- package/dist/project-discovery-app.d.ts.map +1 -1
- package/dist/project-discovery-app.js +71 -0
- package/dist/project-discovery-app.js.map +1 -1
- package/dist/project-discovery-database.d.ts +10 -0
- package/dist/project-discovery-database.d.ts.map +1 -1
- package/dist/project-discovery-database.js +18 -0
- package/dist/project-discovery-database.js.map +1 -1
- package/dist/project-discovery-facts.d.ts +13 -0
- package/dist/project-discovery-facts.d.ts.map +1 -0
- package/dist/project-discovery-facts.js +170 -0
- package/dist/project-discovery-facts.js.map +1 -0
- package/dist/project-discovery-types.d.ts +15 -0
- package/dist/project-discovery-types.d.ts.map +1 -1
- package/dist/project-discovery.d.ts +31 -1
- package/dist/project-discovery.d.ts.map +1 -1
- package/dist/project-discovery.js +51 -147
- package/dist/project-discovery.js.map +1 -1
- package/dist/project-discovery.service.types.d.ts +13 -0
- package/dist/project-discovery.service.types.d.ts.map +1 -0
- package/dist/project-discovery.service.types.js +2 -0
- package/dist/project-discovery.service.types.js.map +1 -0
- package/dist/project-manifest.schemas.d.ts +22 -0
- package/dist/project-manifest.schemas.d.ts.map +1 -0
- package/dist/project-manifest.schemas.js +22 -0
- package/dist/project-manifest.schemas.js.map +1 -0
- package/dist/prompt-driver.d.ts +7 -30
- package/dist/prompt-driver.d.ts.map +1 -1
- package/dist/prompt-driver.js +25 -4
- package/dist/prompt-driver.js.map +1 -1
- package/dist/prompt-driver.types.d.ts +92 -0
- package/dist/prompt-driver.types.d.ts.map +1 -0
- package/dist/prompt-driver.types.js +2 -0
- package/dist/prompt-driver.types.js.map +1 -0
- package/dist/provider-planning-definitions.d.ts +43 -0
- package/dist/provider-planning-definitions.d.ts.map +1 -1
- package/dist/provider-planning-definitions.js +43 -0
- package/dist/provider-planning-definitions.js.map +1 -1
- package/dist/provider-planning.d.ts +37 -7
- package/dist/provider-planning.d.ts.map +1 -1
- package/dist/provider-planning.js +69 -76
- package/dist/provider-planning.js.map +1 -1
- package/dist/provider-planning.types.d.ts +14 -0
- package/dist/provider-planning.types.d.ts.map +1 -0
- package/dist/provider-planning.types.js +2 -0
- package/dist/provider-planning.types.js.map +1 -0
- package/dist/provider-profile-definition.d.ts +45 -0
- package/dist/provider-profile-definition.d.ts.map +1 -0
- package/dist/provider-profile-definition.js +93 -0
- package/dist/provider-profile-definition.js.map +1 -0
- package/dist/render-ai-sources.d.ts +20 -0
- package/dist/render-ai-sources.d.ts.map +1 -1
- package/dist/render-ai-sources.js +21 -0
- package/dist/render-ai-sources.js.map +1 -1
- package/dist/render-ai.d.ts +49 -0
- package/dist/render-ai.d.ts.map +1 -1
- package/dist/render-ai.js +62 -12
- package/dist/render-ai.js.map +1 -1
- package/dist/render-auth-schema.d.ts +5 -0
- package/dist/render-auth-schema.d.ts.map +1 -1
- package/dist/render-auth-schema.js +8 -0
- package/dist/render-auth-schema.js.map +1 -1
- package/dist/render-auth-sources.d.ts +8 -0
- package/dist/render-auth-sources.d.ts.map +1 -1
- package/dist/render-auth-sources.js +8 -0
- package/dist/render-auth-sources.js.map +1 -1
- package/dist/render-auth.d.ts +21 -0
- package/dist/render-auth.d.ts.map +1 -1
- package/dist/render-auth.js +86 -24
- package/dist/render-auth.js.map +1 -1
- package/dist/render-database-sources.d.ts +15 -0
- package/dist/render-database-sources.d.ts.map +1 -1
- package/dist/render-database-sources.js +15 -0
- package/dist/render-database-sources.js.map +1 -1
- package/dist/render-database.d.ts +24 -0
- package/dist/render-database.d.ts.map +1 -1
- package/dist/render-database.js +37 -17
- package/dist/render-database.js.map +1 -1
- package/dist/render-domain-callables.d.ts +67 -0
- package/dist/render-domain-callables.d.ts.map +1 -0
- package/dist/render-domain-callables.js +99 -0
- package/dist/render-domain-callables.js.map +1 -0
- package/dist/render-domain-events.d.ts +59 -0
- package/dist/render-domain-events.d.ts.map +1 -0
- package/dist/render-domain-events.js +92 -0
- package/dist/render-domain-events.js.map +1 -0
- package/dist/render-domain-jobs.d.ts +56 -0
- package/dist/render-domain-jobs.d.ts.map +1 -0
- package/dist/render-domain-jobs.js +84 -0
- package/dist/render-domain-jobs.js.map +1 -0
- package/dist/render-domain-register.d.ts +18 -0
- package/dist/render-domain-register.d.ts.map +1 -1
- package/dist/render-domain-register.js +27 -7
- package/dist/render-domain-register.js.map +1 -1
- package/dist/render-domain-sources.d.ts +63 -0
- package/dist/render-domain-sources.d.ts.map +1 -1
- package/dist/render-domain-sources.js +65 -0
- package/dist/render-domain-sources.js.map +1 -1
- package/dist/render-domain.d.ts +4 -25
- package/dist/render-domain.d.ts.map +1 -1
- package/dist/render-domain.js +3 -97
- package/dist/render-domain.js.map +1 -1
- package/dist/render-domain.types.d.ts +15 -0
- package/dist/render-domain.types.d.ts.map +1 -0
- package/dist/render-domain.types.js +2 -0
- package/dist/render-domain.types.js.map +1 -0
- package/dist/render-resource-sources.d.ts +12 -0
- package/dist/render-resource-sources.d.ts.map +1 -1
- package/dist/render-resource-sources.js +12 -0
- package/dist/render-resource-sources.js.map +1 -1
- package/dist/render-resources.d.ts +47 -0
- package/dist/render-resources.d.ts.map +1 -1
- package/dist/render-resources.js +62 -15
- package/dist/render-resources.js.map +1 -1
- package/dist/render-route-sources.d.ts +19 -0
- package/dist/render-route-sources.d.ts.map +1 -1
- package/dist/render-route-sources.js +19 -0
- package/dist/render-route-sources.js.map +1 -1
- package/dist/render-routes.d.ts +57 -0
- package/dist/render-routes.d.ts.map +1 -1
- package/dist/render-routes.js +72 -10
- package/dist/render-routes.js.map +1 -1
- package/dist/render-service.d.ts +23 -1
- package/dist/render-service.d.ts.map +1 -1
- package/dist/render-service.js +65 -20
- package/dist/render-service.js.map +1 -1
- package/dist/scaffold-catalog.d.ts +7 -6
- package/dist/scaffold-catalog.d.ts.map +1 -1
- package/dist/scaffold-catalog.js +11 -5
- package/dist/scaffold-catalog.js.map +1 -1
- package/dist/scaffold-catalog.types.d.ts +11 -0
- package/dist/scaffold-catalog.types.d.ts.map +1 -0
- package/dist/scaffold-catalog.types.js +2 -0
- package/dist/scaffold-catalog.types.js.map +1 -0
- package/dist/source-edit.d.ts +38 -2
- package/dist/source-edit.d.ts.map +1 -1
- package/dist/source-edit.js +39 -94
- package/dist/source-edit.js.map +1 -1
- package/dist/source-factory-edit.d.ts +78 -0
- package/dist/source-factory-edit.d.ts.map +1 -0
- package/dist/source-factory-edit.js +156 -0
- package/dist/source-factory-edit.js.map +1 -0
- package/dist/source-import-edit.d.ts +7 -1
- package/dist/source-import-edit.d.ts.map +1 -1
- package/dist/source-import-edit.js +20 -1
- package/dist/source-import-edit.js.map +1 -1
- package/dist/template-root.d.ts +15 -4
- package/dist/template-root.d.ts.map +1 -1
- package/dist/template-root.js +22 -5
- package/dist/template-root.js.map +1 -1
- package/dist/templates/default/README.md +1 -1
- package/dist/templates/default/v1/agent/package.json +4 -4
- package/dist/templates/default/v1/api/package.json +3 -3
- package/dist/templates/default/v1/fullstack/package.json +6 -6
- package/dist/templates/default/v1/minimal/package.json +3 -3
- package/dist/templates/default/v1/tasks/package.json +3 -3
- package/dist/validate-errors.d.ts +12 -0
- package/dist/validate-errors.d.ts.map +1 -0
- package/dist/validate-errors.js +16 -0
- package/dist/validate-errors.js.map +1 -0
- package/dist/validate-paths.d.ts +43 -0
- package/dist/validate-paths.d.ts.map +1 -0
- package/dist/validate-paths.js +105 -0
- package/dist/validate-paths.js.map +1 -0
- package/dist/validate.d.ts +56 -17
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +89 -130
- package/dist/validate.js.map +1 -1
- package/dist/validate.types.d.ts +19 -0
- package/dist/validate.types.d.ts.map +1 -0
- package/dist/validate.types.js +2 -0
- package/dist/validate.types.js.map +1 -0
- package/package.json +67 -5
- package/src/catalog-resolution.ts +55 -0
- package/src/catalog-resolution.types.ts +2 -0
- package/dist/create-additions.d.ts +0 -7
- package/dist/create-additions.d.ts.map +0 -1
- package/dist/create-additions.js +0 -27
- package/dist/create-additions.js.map +0 -1
|
@@ -15,18 +15,18 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@langchain/langgraph": "1.4.14",
|
|
18
|
-
"@relkit/app": "0.
|
|
19
|
-
"@relkit/client": "0.
|
|
20
|
-
"@relkit/local": "0.
|
|
18
|
+
"@relkit/app": "0.7.0",
|
|
19
|
+
"@relkit/client": "0.7.0",
|
|
20
|
+
"@relkit/local": "0.7.0",
|
|
21
21
|
"@tanstack/react-query": "5.102.3",
|
|
22
22
|
"langchain": "1.5.10",
|
|
23
|
-
"next": "16.3.
|
|
23
|
+
"next": "16.3.6",
|
|
24
24
|
"react": "19.2.8",
|
|
25
25
|
"react-dom": "19.2.8"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@relkit/cli": "0.
|
|
29
|
-
"@relkit/testing": "0.
|
|
28
|
+
"@relkit/cli": "0.7.0",
|
|
29
|
+
"@relkit/testing": "0.7.0",
|
|
30
30
|
"@types/bun": "1.3.10",
|
|
31
31
|
"@types/react": "19.2.18",
|
|
32
32
|
"@types/react-dom": "19.2.7",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"graph": "relkit graph print"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@relkit/app": "0.
|
|
18
|
+
"@relkit/app": "0.7.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/bun": "1.3.10",
|
|
22
|
-
"@relkit/cli": "0.
|
|
23
|
-
"@relkit/testing": "0.
|
|
22
|
+
"@relkit/cli": "0.7.0",
|
|
23
|
+
"@relkit/testing": "0.7.0",
|
|
24
24
|
"typescript": "5.9.3"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"jobs:trigger": "relkit jobs trigger --job exportOrders --input-file examples/export-orders.json --operation-id example-trigger"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@relkit/app": "0.
|
|
16
|
+
"@relkit/app": "0.7.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/bun": "1.3.10",
|
|
20
|
-
"@relkit/cli": "0.
|
|
21
|
-
"@relkit/testing": "0.
|
|
20
|
+
"@relkit/cli": "0.7.0",
|
|
21
|
+
"@relkit/testing": "0.7.0",
|
|
22
22
|
"typescript": "5.9.3"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Stable public creation-validation constructor, independent of native I/O adapters. */
|
|
2
|
+
export declare class CreateValidationError extends Error {
|
|
3
|
+
readonly code: string;
|
|
4
|
+
/**
|
|
5
|
+
* Constructs the unchanged creation validation rejection.
|
|
6
|
+
* @param code - Existing public validation code.
|
|
7
|
+
* @param message - User-facing validation explanation.
|
|
8
|
+
* @returns The original public constructor identity.
|
|
9
|
+
*/
|
|
10
|
+
constructor(code: string, message: string);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=validate-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-errors.d.ts","sourceRoot":"","sources":["../src/validate-errors.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,qBAAa,qBAAsB,SAAQ,KAAK;IAQ5C,QAAQ,CAAC,IAAI,EAAE,MAAM;IAPvB;;;;;OAKG;gBAEQ,IAAI,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM;CAKlB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Stable public creation-validation constructor, independent of native I/O adapters. */
|
|
2
|
+
export class CreateValidationError extends Error {
|
|
3
|
+
code;
|
|
4
|
+
/**
|
|
5
|
+
* Constructs the unchanged creation validation rejection.
|
|
6
|
+
* @param code - Existing public validation code.
|
|
7
|
+
* @param message - User-facing validation explanation.
|
|
8
|
+
* @returns The original public constructor identity.
|
|
9
|
+
*/
|
|
10
|
+
constructor(code, message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.code = code;
|
|
13
|
+
this.name = "CreateValidationError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=validate-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-errors.js","sourceRoot":"","sources":["../src/validate-errors.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAQnC;IAPX;;;;;OAKG;IACH,YACW,IAAY,EACrB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAHN,SAAI,GAAJ,IAAI,CAAQ;QAIrB,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { GeneratorPaths } from "./generator-paths.js";
|
|
3
|
+
import type { DestinationState } from "./validate.types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Inspects only an absent or real directory destination without following symlinks.
|
|
6
|
+
* @param path - Path inside the current project or owned resource.
|
|
7
|
+
* @returns Destination existence and emptiness flags; symlinks and non-directories fail.
|
|
8
|
+
*/
|
|
9
|
+
export declare const inspectDestinationEffect: (path: string) => Effect.Effect<DestinationState, import("./generator-errors.js").GeneratorDomainError, GeneratorPaths>;
|
|
10
|
+
/**
|
|
11
|
+
* Canonicalizes missing child segments only after proving the existing parent is a directory.
|
|
12
|
+
* @param path - Path inside the current project or owned resource.
|
|
13
|
+
* @returns The canonical path rebuilt from its existing ancestor and complete missing segments.
|
|
14
|
+
*/
|
|
15
|
+
export declare const canonicalizeMissingPathEffect: (path: string) => Effect.Effect<string, import("./generator-errors.js").GeneratorDomainError, GeneratorPaths>;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves an existing real directory without permitting symlink indirection.
|
|
18
|
+
* @param path - Path inside the current project or owned resource.
|
|
19
|
+
* @param label - Human-readable location included in validation diagnostics.
|
|
20
|
+
* @returns The canonical existing directory path; symlinks and non-directories fail.
|
|
21
|
+
*/
|
|
22
|
+
export declare const existingDirectoryEffect: (path: string, label: string) => Effect.Effect<string, import("./generator-errors.js").GeneratorDomainError, GeneratorPaths>;
|
|
23
|
+
/**
|
|
24
|
+
* Checks a canonical path relationship using no I/O.
|
|
25
|
+
* @param parent - Canonical proposed ancestor path.
|
|
26
|
+
* @param child - Canonical descendant path tested against the ancestor.
|
|
27
|
+
* @returns Whether the child is equal to or nested beneath the canonical parent.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isAncestorOrSame(parent: string, child: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Carries existing validation failures in the internal typed channel.
|
|
32
|
+
* @param message - User-facing diagnostic or prompt text.
|
|
33
|
+
* @returns A GeneratorDomainError retaining RELKIT_CREATE_DESTINATION_INVALID.
|
|
34
|
+
*/
|
|
35
|
+
export declare function invalid(message: string): import("./generator-errors.js").GeneratorDomainError;
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a typed failure retaining the exact public validation code and message.
|
|
38
|
+
* @param code - Stable public validation code.
|
|
39
|
+
* @param message - User-facing diagnostic or prompt text.
|
|
40
|
+
* @returns An Effect failing with the original CreateValidationError code and message.
|
|
41
|
+
*/
|
|
42
|
+
export declare function failure(code: string, message: string): Effect.Effect<never, import("./generator-errors.js").GeneratorDomainError, never>;
|
|
43
|
+
//# sourceMappingURL=validate-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-paths.d.ts","sourceRoot":"","sources":["../src/validate-paths.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yHA0BpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,+GAoCzC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,8HAgBnC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAGvE;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,wDAEtC;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qFAEpD"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { observeExecution } from "@relkit/contracts/operation";
|
|
4
|
+
import { GeneratorPaths } from "./generator-paths.js";
|
|
5
|
+
import { domainError } from "./generator-errors.js";
|
|
6
|
+
import { CreateValidationError } from "./validate-errors.js";
|
|
7
|
+
/**
|
|
8
|
+
* Inspects only an absent or real directory destination without following symlinks.
|
|
9
|
+
* @param path - Path inside the current project or owned resource.
|
|
10
|
+
* @returns Destination existence and emptiness flags; symlinks and non-directories fail.
|
|
11
|
+
*/
|
|
12
|
+
export const inspectDestinationEffect = Effect.fn("CreateValidation.inspect")(function* (path) {
|
|
13
|
+
const paths = yield* GeneratorPaths;
|
|
14
|
+
const info = yield* paths
|
|
15
|
+
.metadata(path)
|
|
16
|
+
.pipe(Effect.mapError(() => invalid("Destination could not be inspected.")));
|
|
17
|
+
if (info === undefined)
|
|
18
|
+
return { exists: false, empty: false };
|
|
19
|
+
if (info.kind === "symlink")
|
|
20
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_UNSAFE", "Destination must not be a symbolic link.");
|
|
21
|
+
if (info.kind !== "directory")
|
|
22
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_INVALID", "Destination is not a directory.");
|
|
23
|
+
const entries = yield* paths
|
|
24
|
+
.entries(path)
|
|
25
|
+
.pipe(Effect.mapError(() => invalid("Destination directory could not be read.")));
|
|
26
|
+
return { exists: true, empty: entries.length === 0 };
|
|
27
|
+
}, (effect) => observeExecution("generator", "validation.inspect", effect));
|
|
28
|
+
/**
|
|
29
|
+
* Canonicalizes missing child segments only after proving the existing parent is a directory.
|
|
30
|
+
* @param path - Path inside the current project or owned resource.
|
|
31
|
+
* @returns The canonical path rebuilt from its existing ancestor and complete missing segments.
|
|
32
|
+
*/
|
|
33
|
+
export const canonicalizeMissingPathEffect = Effect.fn("CreateValidation.canonicalize")(function* (path) {
|
|
34
|
+
const paths = yield* GeneratorPaths;
|
|
35
|
+
let current = path;
|
|
36
|
+
const missing = [];
|
|
37
|
+
for (;;) {
|
|
38
|
+
const info = yield* paths
|
|
39
|
+
.metadata(current)
|
|
40
|
+
.pipe(Effect.mapError(() => invalid("Destination path could not be resolved.")));
|
|
41
|
+
if (info !== undefined) {
|
|
42
|
+
if (missing.length > 0 && info.kind !== "directory")
|
|
43
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_INVALID", "A destination parent is not a directory.");
|
|
44
|
+
if (missing.length === 0 && info.kind === "symlink")
|
|
45
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_UNSAFE", "Destination must not be a symbolic link.");
|
|
46
|
+
const base = yield* paths
|
|
47
|
+
.realpath(current)
|
|
48
|
+
.pipe(Effect.mapError(() => invalid("Destination path could not be resolved.")));
|
|
49
|
+
return missing.reverse().reduce((parent, part) => join(parent, part), base);
|
|
50
|
+
}
|
|
51
|
+
const parent = dirname(current);
|
|
52
|
+
if (parent === current)
|
|
53
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_INVALID", "Destination path could not be resolved.");
|
|
54
|
+
missing.push(basename(current));
|
|
55
|
+
current = parent;
|
|
56
|
+
}
|
|
57
|
+
}, (effect) => observeExecution("generator", "validation.canonicalize", effect));
|
|
58
|
+
/**
|
|
59
|
+
* Resolves an existing real directory without permitting symlink indirection.
|
|
60
|
+
* @param path - Path inside the current project or owned resource.
|
|
61
|
+
* @param label - Human-readable location included in validation diagnostics.
|
|
62
|
+
* @returns The canonical existing directory path; symlinks and non-directories fail.
|
|
63
|
+
*/
|
|
64
|
+
export const existingDirectoryEffect = Effect.fn("CreateValidation.existingDirectory")(function* (path, label) {
|
|
65
|
+
const paths = yield* GeneratorPaths;
|
|
66
|
+
const resolved = resolve(path);
|
|
67
|
+
const info = yield* paths
|
|
68
|
+
.metadata(resolved)
|
|
69
|
+
.pipe(Effect.mapError(() => invalid(`${label} could not be resolved.`)));
|
|
70
|
+
if (info === undefined)
|
|
71
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_INVALID", `${label} could not be resolved.`);
|
|
72
|
+
if (info.kind !== "directory")
|
|
73
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_INVALID", `${label} is not a directory.`);
|
|
74
|
+
return yield* paths
|
|
75
|
+
.realpath(resolved)
|
|
76
|
+
.pipe(Effect.mapError(() => invalid(`${label} could not be resolved.`)));
|
|
77
|
+
}, (effect) => observeExecution("generator", "validation.existingDirectory", effect));
|
|
78
|
+
/**
|
|
79
|
+
* Checks a canonical path relationship using no I/O.
|
|
80
|
+
* @param parent - Canonical proposed ancestor path.
|
|
81
|
+
* @param child - Canonical descendant path tested against the ancestor.
|
|
82
|
+
* @returns Whether the child is equal to or nested beneath the canonical parent.
|
|
83
|
+
*/
|
|
84
|
+
export function isAncestorOrSame(parent, child) {
|
|
85
|
+
const relation = relative(parent, child);
|
|
86
|
+
return relation === "" || (!relation.startsWith("..") && !isAbsolute(relation));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Carries existing validation failures in the internal typed channel.
|
|
90
|
+
* @param message - User-facing diagnostic or prompt text.
|
|
91
|
+
* @returns A GeneratorDomainError retaining RELKIT_CREATE_DESTINATION_INVALID.
|
|
92
|
+
*/
|
|
93
|
+
export function invalid(message) {
|
|
94
|
+
return domainError(new CreateValidationError("RELKIT_CREATE_DESTINATION_INVALID", message));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Constructs a typed failure retaining the exact public validation code and message.
|
|
98
|
+
* @param code - Stable public validation code.
|
|
99
|
+
* @param message - User-facing diagnostic or prompt text.
|
|
100
|
+
* @returns An Effect failing with the original CreateValidationError code and message.
|
|
101
|
+
*/
|
|
102
|
+
export function failure(code, message) {
|
|
103
|
+
return Effect.fail(domainError(new CreateValidationError(code, message)));
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=validate-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-paths.js","sourceRoot":"","sources":["../src/validate-paths.ts"],"names":[],"mappings":"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"}
|
package/dist/validate.d.ts
CHANGED
|
@@ -1,23 +1,62 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { GeneratorPaths } from "./generator-paths.js";
|
|
1
3
|
import type { CreateOptions } from "./options.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
export interface ValidatedCreateOptions extends CreateOptions {
|
|
12
|
-
readonly destination: string;
|
|
13
|
-
readonly destinationExists: boolean;
|
|
14
|
-
readonly destinationEmpty: boolean;
|
|
15
|
-
}
|
|
16
|
-
/** Returns whether a value is a valid unscoped or scoped npm package name. */
|
|
4
|
+
import type { CreateValidationContext, ValidatedCreateOptions } from "./validate.types.js";
|
|
5
|
+
export type { CreateValidationContext, ValidatedCreateOptions } from "./validate.types.js";
|
|
6
|
+
export { CreateValidationError } from "./validate-errors.js";
|
|
7
|
+
/**
|
|
8
|
+
* Checks unscoped or scoped npm names without filesystem or Effect authority.
|
|
9
|
+
* @param value - Unknown candidate project package name.
|
|
10
|
+
* @returns Whether the value is a supported lowercase scoped or unscoped npm package name.
|
|
11
|
+
*/
|
|
17
12
|
export declare function isValidPackageName(value: unknown): value is string;
|
|
18
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Asserts the existing package-name contract using its unchanged public constructor.
|
|
15
|
+
* @param value - Unknown candidate project package name.
|
|
16
|
+
* @returns Completion for a valid string; invalid input throws RELKIT_CREATE_NAME_INVALID.
|
|
17
|
+
*/
|
|
19
18
|
export declare function validatePackageName(value: unknown): asserts value is string;
|
|
19
|
+
/**
|
|
20
|
+
* Resolves a safe creation destination through explicit read-only path authority.
|
|
21
|
+
* @param options - Explicit options retaining existing defaults.
|
|
22
|
+
* @param context - Caller-owned settings and cancellation.
|
|
23
|
+
* @returns The canonical safe destination path after name, ancestry and broad-path validation.
|
|
24
|
+
*/
|
|
25
|
+
export declare const resolveCreateDestinationEffect: (options: Pick<CreateOptions, "name" | "directory">, context?: CreateValidationContext | undefined) => Effect.Effect<string, import("./generator-errors.js").GeneratorDomainError, GeneratorPaths>;
|
|
26
|
+
/**
|
|
27
|
+
* Validates destination state using the same path service as the existing synchronous API.
|
|
28
|
+
* @param options - Explicit options retaining existing defaults.
|
|
29
|
+
* @param context - Caller-owned settings and cancellation.
|
|
30
|
+
* @returns Validated options, canonical destination and its initial existence/emptiness state.
|
|
31
|
+
*/
|
|
32
|
+
export declare const validateCreateOptionsEffect: (options: CreateOptions, context?: CreateValidationContext | undefined) => Effect.Effect<Readonly<{
|
|
33
|
+
destination: string;
|
|
34
|
+
destinationExists: boolean;
|
|
35
|
+
destinationEmpty: boolean;
|
|
36
|
+
name: string;
|
|
37
|
+
template: import("./options.js").CreateTemplate;
|
|
38
|
+
cloud: import("./options.js").CreateCloud;
|
|
39
|
+
deploy: import("./options.js").CreateDeployment;
|
|
40
|
+
jobs?: import("./options.js").CreateJobs;
|
|
41
|
+
install: boolean;
|
|
42
|
+
git: boolean;
|
|
43
|
+
examples: boolean;
|
|
44
|
+
directory?: string;
|
|
45
|
+
forceEmptyDirectory: boolean;
|
|
46
|
+
json: boolean;
|
|
47
|
+
}>, import("./generator-errors.js").GeneratorDomainError, GeneratorPaths>;
|
|
48
|
+
/**
|
|
49
|
+
* Preserves synchronous safe-destination resolution and its stable public errors.
|
|
50
|
+
* @param options - Explicit options retaining existing defaults.
|
|
51
|
+
* @param context - Caller-owned settings and cancellation.
|
|
52
|
+
* @returns A canonical safe destination path, retaining the existing validation errors.
|
|
53
|
+
*/
|
|
20
54
|
export declare function resolveCreateDestination(options: Pick<CreateOptions, "name" | "directory">, context?: CreateValidationContext): string;
|
|
21
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Preserves synchronous destination validation and its existing immutable result.
|
|
57
|
+
* @param options - Explicit request options or declared prompt choices.
|
|
58
|
+
* @param context - Caller-owned settings and cancellation.
|
|
59
|
+
* @returns Validated options with a safe canonical destination and initial destination state.
|
|
60
|
+
*/
|
|
22
61
|
export declare function validateCreateOptions(options: CreateOptions, context?: CreateValidationContext): ValidatedCreateOptions;
|
|
23
62
|
//# sourceMappingURL=validate.d.ts.map
|
package/dist/validate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAMtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE3F,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAI3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAiB7D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAOlE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAM3E;AAED;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,oMAsC1C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;yEA8BvC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,WAAW,CAAC,EAClD,OAAO,GAAE,uBAA4B,GACpC,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,GAAE,uBAA4B,GACpC,sBAAsB,CAExB"}
|
package/dist/validate.js
CHANGED
|
@@ -1,156 +1,115 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { parse, resolve } from "node:path";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { observeExecution } from "@relkit/contracts/operation";
|
|
4
|
+
import { GeneratorPaths } from "./generator-paths.js";
|
|
5
|
+
import { domainTry } from "./generator-errors.js";
|
|
6
|
+
import { runGeneratorSync } from "./generator-runtime.js";
|
|
7
|
+
import { CreateValidationError } from "./validate-errors.js";
|
|
8
|
+
export { CreateValidationError } from "./validate-errors.js";
|
|
9
|
+
/**
|
|
10
|
+
* Allowed lowercase npm package-name segment syntax.
|
|
11
|
+
*/
|
|
4
12
|
const PACKAGE_PART = /^(?![._])[a-z0-9._~-]+$/;
|
|
13
|
+
/**
|
|
14
|
+
* Windows drive-root or UNC paths that must not bypass relative destination rules.
|
|
15
|
+
*/
|
|
5
16
|
const WINDOWS_ABSOLUTE = /^(?:[A-Za-z]:[\\/]|\\\\)/;
|
|
17
|
+
/**
|
|
18
|
+
* Names reserved by npm/project layout and rejected for new projects.
|
|
19
|
+
*/
|
|
6
20
|
const RESERVED_NAMES = new Set(["favicon.ico", "node_modules"]);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
this.name = "CreateValidationError";
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
/** Returns whether a value is a valid unscoped or scoped npm package name. */
|
|
21
|
+
/**
|
|
22
|
+
* Checks unscoped or scoped npm names without filesystem or Effect authority.
|
|
23
|
+
* @param value - Unknown candidate project package name.
|
|
24
|
+
* @returns Whether the value is a supported lowercase scoped or unscoped npm package name.
|
|
25
|
+
*/
|
|
16
26
|
export function isValidPackageName(value) {
|
|
17
27
|
if (typeof value !== "string" || value.length === 0 || value.length > 214)
|
|
18
28
|
return false;
|
|
19
29
|
const parts = value.startsWith("@") ? value.slice(1).split("/") : [value];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return parts.every((part) => part.length > 0 && PACKAGE_PART.test(part) && !RESERVED_NAMES.has(part));
|
|
30
|
+
return (parts.length === (value.startsWith("@") ? 2 : 1) &&
|
|
31
|
+
parts.every((part) => part.length > 0 && PACKAGE_PART.test(part) && !RESERVED_NAMES.has(part)));
|
|
23
32
|
}
|
|
24
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Asserts the existing package-name contract using its unchanged public constructor.
|
|
35
|
+
* @param value - Unknown candidate project package name.
|
|
36
|
+
* @returns Completion for a valid string; invalid input throws RELKIT_CREATE_NAME_INVALID.
|
|
37
|
+
*/
|
|
25
38
|
export function validatePackageName(value) {
|
|
26
|
-
if (!isValidPackageName(value))
|
|
39
|
+
if (!isValidPackageName(value))
|
|
27
40
|
throw new CreateValidationError("RELKIT_CREATE_NAME_INVALID", "Project name must be a valid npm package name.");
|
|
28
|
-
}
|
|
29
41
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Resolves a safe creation destination through explicit read-only path authority.
|
|
44
|
+
* @param options - Explicit options retaining existing defaults.
|
|
45
|
+
* @param context - Caller-owned settings and cancellation.
|
|
46
|
+
* @returns The canonical safe destination path after name, ancestry and broad-path validation.
|
|
47
|
+
*/
|
|
48
|
+
export const resolveCreateDestinationEffect = Effect.fn("CreateValidation.destination")(function* (options, context = {}) {
|
|
49
|
+
yield* domainTry(() => validatePackageName(options.name));
|
|
50
|
+
const paths = yield* GeneratorPaths;
|
|
51
|
+
const workingDirectory = resolve(context.cwd ?? (yield* paths.cwd()));
|
|
52
|
+
const cwd = yield* existingDirectoryEffect(workingDirectory, "current directory");
|
|
34
53
|
const input = options.directory ?? options.name;
|
|
35
54
|
if (typeof input !== "string" ||
|
|
36
55
|
input.length === 0 ||
|
|
37
56
|
input.includes("\0") ||
|
|
38
|
-
WINDOWS_ABSOLUTE.test(input))
|
|
39
|
-
|
|
40
|
-
}
|
|
57
|
+
WINDOWS_ABSOLUTE.test(input))
|
|
58
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_INVALID", "Destination must be a valid local path.");
|
|
41
59
|
const candidate = resolve(workingDirectory, input);
|
|
42
|
-
|
|
60
|
+
const canonical = yield* canonicalizeMissingPathEffect(candidate);
|
|
61
|
+
const roots = [
|
|
62
|
+
cwd,
|
|
63
|
+
context.homeDirectory ?? (yield* paths.home()),
|
|
64
|
+
context.temporaryDirectory ?? (yield* paths.temporaryRoot()),
|
|
65
|
+
].map((root) => resolve(root));
|
|
66
|
+
if (canonical === parse(canonical).root ||
|
|
67
|
+
roots.some((root) => isAncestorOrSame(canonical, root)))
|
|
68
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_UNSAFE", "Destination is a current, root, or broad directory.");
|
|
43
69
|
return candidate;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (state.exists && !
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
}, (effect) => observeExecution("generator", "validation.destination", effect));
|
|
71
|
+
/**
|
|
72
|
+
* Validates destination state using the same path service as the existing synchronous API.
|
|
73
|
+
* @param options - Explicit options retaining existing defaults.
|
|
74
|
+
* @param context - Caller-owned settings and cancellation.
|
|
75
|
+
* @returns Validated options, canonical destination and its initial existence/emptiness state.
|
|
76
|
+
*/
|
|
77
|
+
export const validateCreateOptionsEffect = Effect.fn("CreateValidation.options")(function* (options, context = {}) {
|
|
78
|
+
if (options === null || typeof options !== "object")
|
|
79
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_INVALID", "Create options are invalid.");
|
|
80
|
+
yield* domainTry(() => validatePackageName(options.name));
|
|
81
|
+
if (typeof options.forceEmptyDirectory !== "boolean")
|
|
82
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_INVALID", "The empty-directory override must be boolean.");
|
|
83
|
+
const destination = yield* resolveCreateDestinationEffect(options, context);
|
|
84
|
+
const state = yield* inspectDestinationEffect(destination);
|
|
85
|
+
if (state.exists && !state.empty)
|
|
86
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_NOT_EMPTY", "Destination must be absent or an empty directory.");
|
|
87
|
+
if (state.exists && !options.forceEmptyDirectory)
|
|
88
|
+
return yield* failure("RELKIT_CREATE_DESTINATION_EXISTS", "Destination already exists; use --force-empty-directory only for an empty directory.");
|
|
62
89
|
return Object.freeze({
|
|
63
90
|
...options,
|
|
64
91
|
destination,
|
|
65
92
|
destinationExists: state.exists,
|
|
66
93
|
destinationEmpty: state.empty,
|
|
67
94
|
});
|
|
95
|
+
}, (effect) => observeExecution("generator", "validation.options", effect));
|
|
96
|
+
/**
|
|
97
|
+
* Preserves synchronous safe-destination resolution and its stable public errors.
|
|
98
|
+
* @param options - Explicit options retaining existing defaults.
|
|
99
|
+
* @param context - Caller-owned settings and cancellation.
|
|
100
|
+
* @returns A canonical safe destination path, retaining the existing validation errors.
|
|
101
|
+
*/
|
|
102
|
+
export function resolveCreateDestination(options, context = {}) {
|
|
103
|
+
return runGeneratorSync(resolveCreateDestinationEffect(options, context));
|
|
68
104
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
throw invalidDestination("Destination could not be inspected.");
|
|
78
|
-
}
|
|
79
|
-
if (info.isSymbolicLink())
|
|
80
|
-
throw unsafeDestination("Destination must not be a symbolic link.");
|
|
81
|
-
if (!info.isDirectory())
|
|
82
|
-
throw invalidDestination("Destination is not a directory.");
|
|
83
|
-
try {
|
|
84
|
-
return { exists: true, empty: readdirSync(path).length === 0 };
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
throw invalidDestination("Destination directory could not be read.");
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function canonicalizeMissingPath(path) {
|
|
91
|
-
let current = path;
|
|
92
|
-
const missing = [];
|
|
93
|
-
while (true) {
|
|
94
|
-
try {
|
|
95
|
-
const info = lstatSync(current);
|
|
96
|
-
if (missing.length > 0 && !info.isDirectory()) {
|
|
97
|
-
throw invalidDestination("A destination parent is not a directory.");
|
|
98
|
-
}
|
|
99
|
-
if (missing.length === 0 && info.isSymbolicLink()) {
|
|
100
|
-
throw unsafeDestination("Destination must not be a symbolic link.");
|
|
101
|
-
}
|
|
102
|
-
const base = realpathSync.native(current);
|
|
103
|
-
return missing.reverse().reduce((parent, part) => join(parent, part), base);
|
|
104
|
-
}
|
|
105
|
-
catch (error) {
|
|
106
|
-
if (!isNotFound(error)) {
|
|
107
|
-
if (error instanceof CreateValidationError)
|
|
108
|
-
throw error;
|
|
109
|
-
throw invalidDestination("Destination path could not be resolved.");
|
|
110
|
-
}
|
|
111
|
-
const parent = dirname(current);
|
|
112
|
-
if (parent === current)
|
|
113
|
-
throw invalidDestination("Destination path could not be resolved.");
|
|
114
|
-
missing.push(current.slice(parent.length + 1));
|
|
115
|
-
current = parent;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
function rejectBroadPath(path, cwd, context) {
|
|
120
|
-
const broadRoots = [
|
|
121
|
-
cwd,
|
|
122
|
-
context.homeDirectory ?? homedir(),
|
|
123
|
-
context.temporaryDirectory ?? tmpdir(),
|
|
124
|
-
].map((root) => resolve(root));
|
|
125
|
-
if (path === parse(path).root || broadRoots.some((root) => isAncestorOrSame(path, root))) {
|
|
126
|
-
throw unsafeDestination("Destination is a current, root, or broad directory.");
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
function existingDirectory(path, label) {
|
|
130
|
-
const resolved = resolve(path);
|
|
131
|
-
try {
|
|
132
|
-
const info = lstatSync(resolved);
|
|
133
|
-
if (!info.isDirectory())
|
|
134
|
-
throw invalidDestination(`${label} is not a directory.`);
|
|
135
|
-
return realpathSync.native(resolved);
|
|
136
|
-
}
|
|
137
|
-
catch (error) {
|
|
138
|
-
if (error instanceof CreateValidationError)
|
|
139
|
-
throw error;
|
|
140
|
-
throw invalidDestination(`${label} could not be resolved.`);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
function isAncestorOrSame(parent, child) {
|
|
144
|
-
const relation = relative(parent, child);
|
|
145
|
-
return relation === "" || (!relation.startsWith("..") && !isAbsolute(relation));
|
|
146
|
-
}
|
|
147
|
-
function invalidDestination(message) {
|
|
148
|
-
return new CreateValidationError("RELKIT_CREATE_DESTINATION_INVALID", message);
|
|
149
|
-
}
|
|
150
|
-
function unsafeDestination(message) {
|
|
151
|
-
return new CreateValidationError("RELKIT_CREATE_DESTINATION_UNSAFE", message);
|
|
152
|
-
}
|
|
153
|
-
function isNotFound(error) {
|
|
154
|
-
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
105
|
+
/**
|
|
106
|
+
* Preserves synchronous destination validation and its existing immutable result.
|
|
107
|
+
* @param options - Explicit request options or declared prompt choices.
|
|
108
|
+
* @param context - Caller-owned settings and cancellation.
|
|
109
|
+
* @returns Validated options with a safe canonical destination and initial destination state.
|
|
110
|
+
*/
|
|
111
|
+
export function validateCreateOptions(options, context = {}) {
|
|
112
|
+
return runGeneratorSync(validateCreateOptionsEffect(options, context));
|
|
155
113
|
}
|
|
114
|
+
import { inspectDestinationEffect, canonicalizeMissingPathEffect, existingDirectoryEffect, isAncestorOrSame, failure, } from "./validate-paths.js";
|
|
156
115
|
//# sourceMappingURL=validate.js.map
|