hammerkit 1.5.1 → 1.6.0-alpha.2
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/.agents/FEEDBACK.md +74 -0
- package/.agents/skills/before-commit/SKILL.md +101 -0
- package/.agents/skills/do-the-work/SKILL.md +64 -0
- package/.agents/skills/fix-ci/SKILL.md +98 -0
- package/.agents/skills/speckit-git-commit/SKILL.md +53 -0
- package/.agents/skills/speckit-git-feature/SKILL.md +72 -0
- package/.agents/skills/speckit-git-initialize/SKILL.md +54 -0
- package/.agents/skills/speckit-git-remote/SKILL.md +50 -0
- package/.agents/skills/speckit-git-validate/SKILL.md +54 -0
- package/.gitbook.yaml +5 -0
- package/.specify/extensions/.registry +37 -0
- package/.specify/extensions/git/README.md +100 -0
- package/.specify/extensions/git/commands/speckit.git.commit.md +48 -0
- package/.specify/extensions/git/commands/speckit.git.feature.md +67 -0
- package/.specify/extensions/git/commands/speckit.git.initialize.md +49 -0
- package/.specify/extensions/git/commands/speckit.git.remote.md +45 -0
- package/.specify/extensions/git/commands/speckit.git.validate.md +49 -0
- package/.specify/extensions/git/config-template.yml +62 -0
- package/.specify/extensions/git/extension.yml +140 -0
- package/.specify/extensions/git/git-config.yml +62 -0
- package/.specify/extensions.yml +149 -0
- package/.specify/feature.json +3 -0
- package/.specify/init-options.json +10 -0
- package/.specify/integration.json +15 -0
- package/.specify/integrations/claude.manifest.json +16 -0
- package/.specify/integrations/speckit.manifest.json +17 -0
- package/.specify/memory/constitution.md +162 -0
- package/.specify/templates/checklist-template.md +40 -0
- package/.specify/templates/constitution-template.md +50 -0
- package/.specify/templates/plan-template.md +113 -0
- package/.specify/templates/spec-template.md +131 -0
- package/.specify/templates/tasks-template.md +252 -0
- package/.specify/workflows/speckit/workflow.yml +77 -0
- package/.specify/workflows/workflow-registry.json +13 -0
- package/AGENTS.md +94 -0
- package/Dockerfile +3 -3
- package/FOLLOWUPS.md +34 -0
- package/README.md +9 -7
- package/SUMMARY.md +30 -5
- package/VALUES.md +53 -0
- package/build.schema.json +542 -408
- package/dist/cache/auto-pull.spec.js +123 -0
- package/dist/cache/backends/local-cache-backend.js +56 -0
- package/dist/cache/backends/local-cache-backend.spec.js +72 -0
- package/dist/cache/backends/s3-cache-backend.js +124 -0
- package/dist/cache/backends/s3-cache-backend.spec.js +118 -0
- package/dist/cache/cache-backend-registry.js +21 -0
- package/dist/cache/cache-backend-registry.spec.js +22 -0
- package/dist/cache/cache-backend.js +3 -0
- package/dist/cache/resolve-cache.js +60 -0
- package/dist/cache/resolve-cache.spec.js +52 -0
- package/dist/cli.js +112 -82
- package/dist/cli.spec.js +20 -2
- package/dist/console/get-logger.spec.js +23 -0
- package/dist/docker/get-default-platform.spec.js +29 -0
- package/dist/docker/longest-common-prefix.spec.js +26 -0
- package/dist/docker/package.js +283 -0
- package/dist/docker/package.spec.js +145 -0
- package/dist/docker/pull.js +4 -4
- package/dist/docker/remove-container.spec.js +32 -0
- package/dist/docker/stream.js +3 -3
- package/dist/docker/using-container.js +29 -11
- package/dist/docker/using-container.spec.js +90 -0
- package/dist/environment/merge-environment-variables.js +21 -0
- package/dist/environment/merge-environment-variables.spec.js +24 -0
- package/dist/environment/replace-env-variables.js +43 -10
- package/dist/environment/replace-env-variables.spec.js +47 -0
- package/dist/executer/abort.spec.js +18 -0
- package/dist/executer/await-completed-dependencies.js +56 -0
- package/dist/executer/cache-metadata.js +11 -0
- package/dist/executer/check-readiness.js +1 -1
- package/dist/{planner/work-node-port.js → executer/container-bind.js} +1 -1
- package/dist/executer/docker-service.js +110 -86
- package/dist/executer/docker-task.js +132 -0
- package/dist/executer/environment-mock.js +3 -4
- package/dist/executer/environment-mock.spec.js +22 -0
- package/dist/executer/event-cache.js +60 -127
- package/dist/executer/execute-command.js +4 -3
- package/dist/executer/execute-docker.js +32 -14
- package/dist/executer/execute-work-service.js +61 -0
- package/dist/executer/execute-work-task.js +107 -0
- package/dist/executer/execute-work-tree.js +27 -0
- package/dist/executer/execute.spec.js +14 -10
- package/dist/executer/execution-steps.js +47 -31
- package/dist/executer/get-container-binds.js +19 -0
- package/dist/executer/get-docker-executor.js +12 -12
- package/dist/executer/get-scheduler-down-result.js +12 -0
- package/dist/executer/get-scheduler-execute-result.js +28 -0
- package/dist/executer/get-scheduler-up-result.js +12 -0
- package/dist/executer/get-service-containers.js +14 -0
- package/dist/executer/get-service-containers.spec.js +59 -0
- package/dist/executer/get-service-env-hints.js +35 -0
- package/dist/executer/get-service-env-hints.spec.js +65 -0
- package/dist/executer/kubernetes-service.js +116 -48
- package/dist/executer/label-values.js +29 -46
- package/dist/executer/label-values.spec.js +61 -0
- package/dist/executer/lazy-resolver.js +16 -0
- package/dist/executer/lazy-resolver.spec.js +20 -0
- package/dist/executer/local-task.js +44 -0
- package/dist/executer/process-manager.js +16 -70
- package/dist/executer/process-manager.spec.js +39 -76
- package/dist/executer/reset-work-tree.js +30 -0
- package/dist/executer/scheduler/check-for-loop.js +17 -7
- package/dist/executer/scheduler/{scheduler-state.js → dependency-state.js} +1 -1
- package/dist/executer/scheduler/enqueue-next.js +83 -19
- package/dist/executer/scheduler/enqueue-next.spec.js +136 -0
- package/dist/executer/scheduler/{node-state.js → need-state.js} +1 -1
- package/dist/{parser/build-file.js → executer/scheduler/task-state.js} +1 -1
- package/dist/executer/set-user-permission.js +1 -1
- package/dist/executer/state-resolver.js +61 -0
- package/dist/executer/state-resolver.spec.js +37 -0
- package/dist/executer/state.js +37 -31
- package/dist/executer/state.spec.js +66 -0
- package/dist/executer/states.spec.js +14 -0
- package/dist/executer/watch-loop.js +68 -0
- package/dist/executer/watch-state-key.js +44 -0
- package/dist/executer/work-scope.js +1 -5
- package/dist/file/get-file-context.js +24 -3
- package/dist/file/get-file-context.spec.js +178 -0
- package/dist/file/move-files.js +2 -2
- package/dist/file/move-files.spec.js +48 -0
- package/dist/index.js +7 -8
- package/dist/json-schema.js +12 -0
- package/dist/kubernetes/apply.js +34 -0
- package/dist/kubernetes/await-running-state.js +71 -0
- package/dist/kubernetes/ensure-http-route.js +53 -0
- package/dist/kubernetes/ensure-http-route.spec.js +70 -0
- package/dist/kubernetes/ensure-ingress.js +54 -0
- package/dist/kubernetes/ensure-kubernetes-deployment-exists.js +105 -0
- package/dist/kubernetes/ensure-kubernetes-persistent-volume-claim-exists.js +40 -0
- package/dist/kubernetes/ensure-kubernetes-service-exists.js +36 -0
- package/dist/kubernetes/ensure-namespace.js +43 -0
- package/dist/kubernetes/ensure-namespace.spec.js +39 -0
- package/dist/kubernetes/ensure-persistent-data.js +158 -0
- package/dist/kubernetes/get-service-ip.js +11 -0
- package/dist/kubernetes/kubernetes-instance.js +48 -0
- package/dist/kubernetes/remove-persistent-data.js +19 -0
- package/dist/kubernetes/resolve-pod-name.js +42 -0
- package/dist/kubernetes/resolve-pod-name.spec.js +81 -0
- package/dist/kubernetes/resources.js +12 -0
- package/dist/kubernetes/restore-kubernetes-data.js +42 -0
- package/dist/kubernetes/store-kubernetes-data.js +39 -0
- package/dist/kubernetes/volumes.js +64 -0
- package/dist/log.js +69 -69
- package/dist/log.spec.js +131 -0
- package/dist/logging/grouped-logger.js +17 -15
- package/dist/logging/grouped-logger.spec.js +84 -0
- package/dist/logging/interactive-logger.js +1 -1
- package/dist/logging/interactive-logger.spec.js +57 -0
- package/dist/logging/live-logger.js +2 -2
- package/dist/logging/live-logger.spec.js +37 -0
- package/dist/logging/loggers.spec.js +154 -0
- package/dist/optimizer/calculate-checksum.spec.js +34 -0
- package/dist/optimizer/get-cache-directory.js +6 -6
- package/dist/optimizer/get-cache-directory.spec.js +59 -0
- package/dist/optimizer/get-work-cache-stats.js +53 -0
- package/dist/optimizer/get-work-cache-stats.spec.js +79 -0
- package/dist/{parser/build-file-task.js → optimizer/work-cache-stats.js} +1 -1
- package/dist/optimizer/work-task-cache-description.js +25 -0
- package/dist/optimizer/work-task-cache-description.spec.js +45 -0
- package/dist/parser/default-build-file.js +14 -7
- package/dist/parser/default-build-file.spec.js +48 -0
- package/dist/parser/parse-label-arguments.spec.js +27 -0
- package/dist/parser/read-build-file.js +2 -13
- package/dist/parser/read-build-file.spec.js +89 -0
- package/dist/parser/read-env-file.js +4 -5
- package/dist/parser/read-env-file.spec.js +42 -0
- package/dist/planner/utils/append-work-dependencies.js +55 -0
- package/dist/planner/utils/append-work-environment.js +22 -0
- package/dist/planner/utils/append-work-needs.js +18 -0
- package/dist/planner/utils/append-work-service.js +107 -0
- package/dist/planner/utils/append-work-service.spec.js +71 -0
- package/dist/planner/utils/append-work-task.js +81 -0
- package/dist/planner/utils/get-container-user.js +14 -0
- package/dist/planner/utils/get-container-user.spec.js +30 -0
- package/dist/planner/utils/get-default-kube-config.js +10 -0
- package/dist/planner/utils/get-default-kube-config.spec.js +11 -0
- package/dist/planner/utils/get-work-runtime.js +44 -0
- package/dist/planner/utils/normalize-path.js +1 -1
- package/dist/planner/utils/normalize-path.spec.js +24 -0
- package/dist/planner/utils/parse-work-command.js +80 -0
- package/dist/planner/utils/parse-work-command.spec.js +21 -0
- package/dist/planner/utils/parse-work-generate.js +38 -0
- package/dist/planner/utils/parse-work-generate.spec.js +45 -0
- package/dist/planner/utils/{parse-work-node-mount.js → parse-work-mount.js} +10 -7
- package/dist/planner/utils/{parse-work-node-mount.spec.js → parse-work-mount.spec.js} +14 -11
- package/dist/planner/utils/parse-work-mounts.js +13 -0
- package/dist/planner/utils/parse-work-mounts.spec.js +19 -0
- package/dist/planner/utils/{parse-work-node-port.js → parse-work-port.js} +11 -8
- package/dist/planner/utils/parse-work-port.spec.js +24 -0
- package/dist/planner/utils/parse-work-ports.js +10 -0
- package/dist/planner/utils/parse-work-ports.spec.js +24 -0
- package/dist/planner/utils/parse-work-source.js +72 -0
- package/dist/planner/utils/parse-work-source.spec.js +58 -0
- package/dist/planner/utils/parse-work-volume.js +45 -0
- package/dist/planner/utils/parse-work-volume.spec.js +18 -0
- package/dist/planner/utils/plan-work-tasks.js +41 -0
- package/dist/planner/utils/plan-work-tasks.spec.js +30 -0
- package/dist/planner/utils/plan-work-volume.js +1 -0
- package/dist/planner/utils/plan-work-volume.spec.js +33 -0
- package/dist/planner/utils/split-name.js +2 -2
- package/dist/planner/utils/split-name.spec.js +16 -0
- package/dist/planner/utils/template-value.js +1 -2
- package/dist/planner/utils/template-value.spec.js +14 -0
- package/dist/planner/validate.js +71 -38
- package/dist/planner/validate.spec.js +251 -0
- package/dist/planner/work-cache-id.js +12 -0
- package/dist/planner/work-cache-id.spec.js +173 -0
- package/dist/planner/work-command.js +3 -0
- package/dist/planner/work-environment.js +3 -0
- package/dist/planner/work-healthcheck.js +3 -0
- package/dist/planner/{work-node-status.js → work-item-status.js} +16 -62
- package/dist/{parser/build-file-service.js → planner/work-item-validation.js} +1 -1
- package/dist/planner/work-item.js +16 -0
- package/dist/{optimizer/work-node-cache-stats.js → planner/work-kubernetes-selector.js} +1 -1
- package/dist/planner/{work-nodes.js → work-port.js} +1 -1
- package/dist/planner/work-runtime-docker.js +224 -0
- package/dist/planner/work-runtime-kubernetes.js +264 -0
- package/dist/planner/work-runtime-local.js +109 -0
- package/dist/planner/work-runtime-local.spec.js +193 -0
- package/dist/planner/work-service-id.js +15 -5
- package/dist/planner/work-source.js +3 -0
- package/dist/planner/work-task.js +8 -0
- package/dist/program-commands.spec.js +84 -0
- package/dist/program.js +219 -73
- package/dist/program.spec.js +34 -11
- package/dist/run-program.js +28 -0
- package/dist/{executer/process.js → runtime/runtime.js} +1 -1
- package/dist/schema/build-file-base-task-schema.js +27 -0
- package/dist/schema/build-file-container-service-schema.js +28 -0
- package/dist/schema/build-file-container-task-schema.js +13 -0
- package/dist/schema/build-file-environment-schema-ingress.js +14 -0
- package/dist/schema/build-file-environment-schema.js +23 -0
- package/dist/schema/build-file-kubernetes-service-schema.js +17 -0
- package/dist/schema/build-file-kubernetes-service-selector-schema.js +9 -0
- package/dist/schema/build-file-local-platform-schema.js +9 -0
- package/dist/schema/build-file-local-task-schema.js +12 -0
- package/dist/schema/build-file-need-schema.js +12 -0
- package/dist/schema/build-file-schema.js +23 -0
- package/dist/schema/build-file-schema.spec.js +61 -0
- package/dist/schema/build-file-service-container-healthcheck.js +8 -0
- package/dist/schema/build-file-service-schema.js +15 -0
- package/dist/schema/build-file-task-command-schema.js +12 -0
- package/dist/schema/build-file-task-schema.js +12 -0
- package/dist/schema/build-file-volume-schema.js +14 -0
- package/dist/schema/cache-schema.js +31 -0
- package/dist/schema/doc-build-files.spec.js +223 -0
- package/dist/schema/envs-schema.js +6 -0
- package/dist/schema/labels-schema.js +6 -0
- package/dist/schema/parse-context.js +3 -0
- package/dist/schema/parse-error.js +12 -0
- package/dist/schema/parse-error.spec.js +18 -0
- package/dist/schema/reference-parser.js +209 -0
- package/dist/schema/reference-parser.spec.js +83 -0
- package/dist/schema/schema-parser.js +66 -0
- package/dist/schema/schema-parser.spec.js +80 -0
- package/dist/schema/type-guards.spec.js +23 -0
- package/dist/schema/work-scope-parser.js +77 -0
- package/dist/schema/work-scope-parser.spec.js +66 -0
- package/dist/service/update-service-status.js +11 -0
- package/dist/service/update-service-status.spec.js +27 -0
- package/dist/testing/ensure-local-registry.js +134 -0
- package/dist/testing/example-test-suite.js +16 -18
- package/dist/testing/expect.js +46 -22
- package/dist/testing/http-get.js +21 -0
- package/dist/testing/integration/cache.spec.js +13 -14
- package/dist/testing/integration/cancellation.spec.js +14 -9
- package/dist/testing/integration/clean.spec.js +14 -11
- package/dist/testing/integration/cmd.spec.js +1 -1
- package/dist/testing/integration/concurrency.spec.js +3 -3
- package/dist/testing/integration/docker-package-registry.spec.js +44 -0
- package/dist/testing/integration/docker-service-crash.spec.js +36 -0
- package/dist/testing/integration/docker.spec.js +4 -3
- package/dist/testing/integration/env.spec.js +9 -8
- package/dist/testing/integration/environment.spec.js +97 -0
- package/dist/testing/integration/error.spec.js +5 -4
- package/dist/testing/integration/export.spec.js +22 -0
- package/dist/testing/integration/extend.spec.js +9 -12
- package/dist/testing/integration/glob.spec.js +12 -20
- package/dist/testing/integration/include.spec.js +3 -3
- package/dist/testing/integration/invalid.spec.js +2 -3
- package/dist/testing/integration/invalid_loop.spec.js +49 -6
- package/dist/testing/integration/k8s-state-cache.spec.js +41 -0
- package/dist/testing/integration/kubernetes-service.spec.js +148 -0
- package/dist/testing/integration/kubernetes.spec.js +93 -9
- package/dist/testing/integration/labels.spec.js +6 -11
- package/dist/testing/integration/local.spec.js +1 -1
- package/dist/testing/integration/monorepo.spec.js +4 -4
- package/dist/testing/integration/multi-line.spec.js +3 -3
- package/dist/testing/integration/reference.spec.js +4 -5
- package/dist/testing/integration/services.spec.js +22 -4
- package/dist/testing/integration/store.spec.js +15 -16
- package/dist/testing/integration/unknown.spec.js +20 -18
- package/dist/testing/integration/validate.spec.js +143 -26
- package/dist/testing/integration/watch-dependency.spec.js +11 -8
- package/dist/testing/integration/watch.spec.js +15 -16
- package/dist/testing/requires-kubernetes.js +18 -0
- package/dist/testing/requires-linux-containers.js +18 -0
- package/dist/testing/requires-windows-containers.js +18 -0
- package/dist/testing/test-case.js +75 -0
- package/dist/testing/test-streams.js +28 -0
- package/dist/testing/testing-timeout.js +32 -0
- package/dist/utils/abort-event.js +10 -4
- package/dist/utils/abort-event.spec.js +46 -0
- package/dist/utils/buffer-context.js +44 -0
- package/dist/utils/buffer-context.spec.js +38 -0
- package/dist/utils/ci.spec.js +53 -0
- package/dist/utils/emitter.spec.js +34 -0
- package/dist/utils/empty-writable.spec.js +18 -0
- package/dist/utils/environment-config.js +4 -1
- package/dist/utils/environment-config.spec.js +26 -0
- package/dist/utils/fail-never.spec.js +9 -0
- package/dist/version.js +9 -0
- package/dist/version.spec.js +12 -0
- package/package.json +41 -23
- package/specs/build-file/caches/spec.md +114 -0
- package/specs/build-file/environment-variables/spec.md +82 -0
- package/specs/build-file/includes/spec.md +60 -0
- package/specs/build-file/references/spec.md +56 -0
- package/specs/build-file/spec.md +62 -0
- package/specs/cli/clean/spec.md +85 -0
- package/specs/cli/down/spec.md +85 -0
- package/specs/cli/execute/spec.md +101 -0
- package/specs/cli/init/spec.md +64 -0
- package/specs/cli/ls/spec.md +66 -0
- package/specs/cli/package/spec.md +110 -0
- package/specs/cli/spec.md +73 -0
- package/specs/cli/store-restore/spec.md +74 -0
- package/specs/cli/up/spec.md +80 -0
- package/specs/cli/validate/spec.md +70 -0
- package/specs/labels/spec.md +91 -0
- package/specs/service/container/spec.md +120 -0
- package/specs/service/kubernetes/spec.md +97 -0
- package/specs/service/spec.md +105 -0
- package/specs/task/caching/spec.md +107 -0
- package/specs/task/container/spec.md +118 -0
- package/specs/task/dependencies/spec.md +70 -0
- package/specs/task/extending/spec.md +74 -0
- package/specs/task/kubernetes/spec.md +125 -0
- package/specs/task/needs/spec.md +59 -0
- package/specs/task/spec.md +87 -0
- package/specs/task/watching/spec.md +69 -0
- package/dist/console/console-context-mock.js +0 -14
- package/dist/environment/get-process-env.js +0 -15
- package/dist/executer/create-scheduler-state.js +0 -32
- package/dist/executer/docker-node.js +0 -123
- package/dist/executer/hierarchy-scheduler.js +0 -94
- package/dist/executer/local-node.js +0 -57
- package/dist/executer/schedule.js +0 -137
- package/dist/executer/start-node.js +0 -67
- package/dist/executer/watch-node.js +0 -56
- package/dist/executer/watch-service.js +0 -54
- package/dist/file/get-file-context-mock.js +0 -187
- package/dist/file/get-file-context-mock.spec.js +0 -56
- package/dist/get-work-context.js +0 -29
- package/dist/optimizer/get-work-node-cache-stats.js +0 -104
- package/dist/optimizer/read-work-node-cache.js +0 -19
- package/dist/optimizer/work-node-cache-description.js +0 -32
- package/dist/optimizer/write-work-node-cache.js +0 -21
- package/dist/parser/build-file-task-command.js +0 -3
- package/dist/parser/build-file-task-platform.js +0 -3
- package/dist/parser/build-file-task-source.js +0 -3
- package/dist/parser/get-build-file.js +0 -9
- package/dist/parser/parse-boolean.js +0 -29
- package/dist/parser/parse-boolean.spec.js +0 -48
- package/dist/parser/parse-build-file-references.js +0 -35
- package/dist/parser/parse-build-file-services.js +0 -58
- package/dist/parser/parse-build-file-task-command.js +0 -36
- package/dist/parser/parse-build-file-task-source.js +0 -63
- package/dist/parser/parse-build-file.js +0 -125
- package/dist/parser/parse-context.js +0 -13
- package/dist/parser/parse-envs.js +0 -29
- package/dist/parser/parse-healthcheck.js +0 -28
- package/dist/parser/parse-service-selector.js +0 -39
- package/dist/parser/parse-string-array.js +0 -20
- package/dist/parser/parse-string-map.js +0 -30
- package/dist/parser/parse-string.js +0 -20
- package/dist/planner/utils/get-container-mounts.js +0 -24
- package/dist/planner/utils/parse-work-service-volume.js +0 -23
- package/dist/planner/utils/plan-work-command.js +0 -21
- package/dist/planner/utils/plan-work-dependency.js +0 -36
- package/dist/planner/utils/plan-work-node.js +0 -293
- package/dist/planner/utils/plan-work-nodes.js +0 -78
- package/dist/planner/utils/plan-work-tree.js +0 -15
- package/dist/planner/work-context.js +0 -23
- package/dist/planner/work-node-command.js +0 -3
- package/dist/planner/work-node-id.js +0 -12
- package/dist/planner/work-node-id.spec.js +0 -106
- package/dist/planner/work-node-path.js +0 -2
- package/dist/planner/work-node-source.js +0 -3
- package/dist/planner/work-node-validation.js +0 -3
- package/dist/planner/work-node.js +0 -8
- package/dist/planner/work-service-volume.js +0 -3
- package/dist/planner/work-services.js +0 -3
- package/dist/start-watch-processes.js +0 -28
- package/dist/testing/cli.js +0 -73
- package/dist/testing/create-build-file.js +0 -9
- package/dist/testing/get-logger.js +0 -23
- package/dist/testing/get-node.js +0 -12
- package/dist/testing/get-test-context.js +0 -19
- package/dist/testing/integration/program.spec.js +0 -25
- package/dist/testing/lazy.js +0 -17
- package/dist/testing/start-watch-processes.js +0 -29
- package/dist/testing/test-suite-options.js +0 -3
- package/dist/utils/abortable-function.js +0 -71
- package/logs/cache-console.log +0 -0
- package/logs/cache-status.log +0 -6
- package/logs/cache-stout.log +0 -0
- package/logs/cancellation-console.log +0 -0
- package/logs/cancellation-status.log +0 -3
- package/logs/cancellation-stout.log +0 -3
- package/logs/clean-console.log +0 -0
- package/logs/clean-status.log +0 -37
- package/logs/clean-stout.log +0 -95
- package/logs/cmd-console.log +0 -0
- package/logs/cmd-status.log +0 -8
- package/logs/cmd-stout.log +0 -9
- package/logs/concurrency-console.log +0 -0
- package/logs/concurrency-status.log +0 -14
- package/logs/concurrency-stout.log +0 -88
- package/logs/docker-console.log +0 -0
- package/logs/docker-status.log +0 -14
- package/logs/docker-stout.log +0 -39
- package/logs/env-console.log +0 -1
- package/logs/env-status.log +0 -1
- package/logs/env-stout.log +0 -0
- package/logs/error-console.log +0 -0
- package/logs/error-status.log +0 -10
- package/logs/error-stout.log +0 -36
- package/logs/extend-console.log +0 -0
- package/logs/extend-status.log +0 -1
- package/logs/extend-stout.log +0 -0
- package/logs/glob-console.log +0 -28
- package/logs/glob-status.log +0 -23
- package/logs/glob-stout.log +0 -52
- package/logs/hello-world-node-console.log +0 -0
- package/logs/hello-world-node-status.log +0 -37
- package/logs/hello-world-node-stout.log +0 -41
- package/logs/include-console.log +0 -0
- package/logs/include-status.log +0 -3
- package/logs/include-stout.log +0 -0
- package/logs/invalid-console.log +0 -0
- package/logs/invalid-status.log +0 -1
- package/logs/invalid-stout.log +0 -0
- package/logs/invalid_loop-console.log +0 -0
- package/logs/invalid_loop-status.log +0 -1
- package/logs/invalid_loop-stout.log +0 -11
- package/logs/labels-console.log +0 -0
- package/logs/labels-status.log +0 -1
- package/logs/labels-stout.log +0 -0
- package/logs/local-console.log +0 -0
- package/logs/local-status.log +0 -7
- package/logs/local-stout.log +0 -8
- package/logs/monorepo-console.log +0 -0
- package/logs/monorepo-status.log +0 -152
- package/logs/monorepo-stout.log +0 -2354
- package/logs/multi-line-console.log +0 -0
- package/logs/multi-line-status.log +0 -1
- package/logs/multi-line-stout.log +0 -0
- package/logs/reference-console.log +0 -0
- package/logs/reference-status.log +0 -5
- package/logs/reference-stout.log +0 -0
- package/logs/services-console.log +0 -0
- package/logs/services-status.log +0 -129
- package/logs/services-stout.log +0 -639
- package/logs/store-restore-console.log +0 -0
- package/logs/store-restore-status.log +0 -40
- package/logs/store-restore-stout.log +0 -97
- package/logs/unknown-console.log +0 -3
- package/logs/unknown-status.log +0 -1
- package/logs/unknown-stout.log +0 -0
- package/logs/validate-console.log +0 -0
- package/logs/validate-status.log +0 -2
- package/logs/validate-stout.log +0 -0
- package/logs/watch-console.log +0 -0
- package/logs/watch-dependency-console.log +0 -0
- package/logs/watch-dependency-status.log +0 -176
- package/logs/watch-dependency-stout.log +0 -779
- package/logs/watch-status.log +0 -100
- package/logs/watch-stout.log +0 -349
|
@@ -1,59 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const parse_work_mount_1 = require("./parse-work-mount");
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const os_1 = require("os");
|
|
6
6
|
function normalizePath(val) {
|
|
7
7
|
return val.split(path_1.posix.sep).join(path_1.sep);
|
|
8
8
|
}
|
|
9
|
-
describe('parse-work-
|
|
9
|
+
describe('parse-work-mount', () => {
|
|
10
10
|
it('should parse "subdir"', () => {
|
|
11
|
-
expect((0,
|
|
11
|
+
expect((0, parse_work_mount_1.parseWorkMount)('/home/test', 'subdir')).toMatchObject({
|
|
12
12
|
localPath: normalizePath('/home/test/subdir'),
|
|
13
13
|
containerPath: normalizePath('/home/test/subdir'),
|
|
14
14
|
});
|
|
15
15
|
});
|
|
16
16
|
it('should parse "./subdir"', () => {
|
|
17
|
-
expect((0,
|
|
17
|
+
expect((0, parse_work_mount_1.parseWorkMount)('/home/test', './subdir')).toMatchObject({
|
|
18
18
|
localPath: normalizePath('/home/test/subdir'),
|
|
19
19
|
containerPath: normalizePath('/home/test/subdir'),
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
22
|
it('should parse "./subdir:./otherdir"', () => {
|
|
23
|
-
expect((0,
|
|
23
|
+
expect((0, parse_work_mount_1.parseWorkMount)('/home/test', './subdir:./otherdir')).toMatchObject({
|
|
24
24
|
localPath: normalizePath('/home/test/subdir'),
|
|
25
25
|
containerPath: normalizePath('/home/test/otherdir'),
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
28
|
it('should parse "$PWD/subdir:/subdir"', () => {
|
|
29
|
-
expect((0,
|
|
29
|
+
expect((0, parse_work_mount_1.parseWorkMount)('/home/test', '$PWD/subdir:/subdir')).toMatchObject({
|
|
30
30
|
localPath: (0, path_1.join)((0, os_1.homedir)(), 'subdir'),
|
|
31
31
|
containerPath: '/subdir',
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
34
|
it('should parse "$PWD/subdir:$PWD/subdir"', () => {
|
|
35
|
-
expect((0,
|
|
35
|
+
expect((0, parse_work_mount_1.parseWorkMount)('/home/test', '$PWD/subdir:$PWD/subdir')).toMatchObject({
|
|
36
36
|
localPath: (0, path_1.join)((0, os_1.homedir)(), 'subdir'),
|
|
37
37
|
containerPath: normalizePath('/home/test/subdir'),
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
it('should parse "/subdir:/otherdir"', () => {
|
|
41
|
-
expect((0,
|
|
41
|
+
expect((0, parse_work_mount_1.parseWorkMount)('/home/test', '/subdir:/otherdir')).toMatchObject({
|
|
42
42
|
localPath: '/subdir',
|
|
43
43
|
containerPath: '/otherdir',
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
46
|
it('should parse "/subdir:otherdir"', () => {
|
|
47
|
-
expect((0,
|
|
47
|
+
expect((0, parse_work_mount_1.parseWorkMount)('/home/test', '/subdir:otherdir')).toMatchObject({
|
|
48
48
|
localPath: '/subdir',
|
|
49
49
|
containerPath: normalizePath('/home/test/otherdir'),
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
it('should parse "subdir:/otherdir"', () => {
|
|
53
|
-
expect((0,
|
|
53
|
+
expect((0, parse_work_mount_1.parseWorkMount)('/home/test', 'subdir:/otherdir')).toMatchObject({
|
|
54
54
|
localPath: normalizePath('/home/test/subdir'),
|
|
55
55
|
containerPath: '/otherdir',
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
|
+
it('throws for a mount string with more than two parts', () => {
|
|
59
|
+
expect(() => (0, parse_work_mount_1.parseWorkMount)('/home/test', 'a:b:c')).toThrow('invalid mount a:b:c');
|
|
60
|
+
});
|
|
58
61
|
});
|
|
59
|
-
//# sourceMappingURL=parse-work-
|
|
62
|
+
//# sourceMappingURL=parse-work-mount.spec.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseWorkMounts = void 0;
|
|
4
|
+
const template_value_1 = require("./template-value");
|
|
5
|
+
const parse_work_mount_1 = require("./parse-work-mount");
|
|
6
|
+
function parseWorkMounts(cwd, schema, envs) {
|
|
7
|
+
if (!schema.mounts) {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
return schema.mounts.map((m) => (0, template_value_1.templateValue)(m, envs)).map((m) => (0, parse_work_mount_1.parseWorkMount)(cwd, m));
|
|
11
|
+
}
|
|
12
|
+
exports.parseWorkMounts = parseWorkMounts;
|
|
13
|
+
//# sourceMappingURL=parse-work-mounts.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const parse_work_mounts_1 = require("./parse-work-mounts");
|
|
4
|
+
const noEnvs = { variables: {}, replacements: [] };
|
|
5
|
+
describe('parseWorkMounts', () => {
|
|
6
|
+
it('returns [] when no mounts are declared', () => {
|
|
7
|
+
expect((0, parse_work_mounts_1.parseWorkMounts)('/work', {}, noEnvs)).toEqual([]);
|
|
8
|
+
});
|
|
9
|
+
it('templates env vars and parses each mount against the cwd', () => {
|
|
10
|
+
const result = (0, parse_work_mounts_1.parseWorkMounts)('/work', { mounts: ['$PWD/.npm:/.npm', 'config:/etc/config'] }, {
|
|
11
|
+
variables: { PWD: '/home/x' },
|
|
12
|
+
replacements: [],
|
|
13
|
+
});
|
|
14
|
+
expect(result).toHaveLength(2);
|
|
15
|
+
expect(result[0]).toMatchObject({ containerPath: '/.npm' });
|
|
16
|
+
expect(result[1]).toMatchObject({ containerPath: '/etc/config' });
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=parse-work-mounts.spec.js.map
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
3
|
+
exports.parseWorkPort = void 0;
|
|
4
|
+
function parseWorkPort(port) {
|
|
5
5
|
const parts = port.split(':');
|
|
6
6
|
if (parts.length === 1) {
|
|
7
|
-
const port = parsePort(parts[0]);
|
|
7
|
+
const port = parsePort(parts[0], false);
|
|
8
8
|
return { containerPort: port, hostPort: port };
|
|
9
9
|
}
|
|
10
10
|
else if (parts.length === 2) {
|
|
11
|
-
return { containerPort: parsePort(parts[1]), hostPort: parsePort(parts[0]) };
|
|
11
|
+
return { containerPort: parsePort(parts[1], false), hostPort: parsePort(parts[0], true) };
|
|
12
12
|
}
|
|
13
13
|
else {
|
|
14
14
|
throw new Error(`invalid port ${port}`);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
exports.
|
|
18
|
-
function parsePort(port) {
|
|
17
|
+
exports.parseWorkPort = parseWorkPort;
|
|
18
|
+
function parsePort(port, optional) {
|
|
19
19
|
const result = parseInt(port);
|
|
20
20
|
if (isNaN(result) || result === null || result === undefined) {
|
|
21
|
-
|
|
21
|
+
if (!optional) {
|
|
22
|
+
throw new Error(`invalid port ${port}`);
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
22
25
|
}
|
|
23
26
|
return result;
|
|
24
27
|
}
|
|
25
|
-
//# sourceMappingURL=parse-work-
|
|
28
|
+
//# sourceMappingURL=parse-work-port.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const parse_work_port_1 = require("./parse-work-port");
|
|
4
|
+
describe('parse-work-port', () => {
|
|
5
|
+
it('should parse 5432', () => {
|
|
6
|
+
expect((0, parse_work_port_1.parseWorkPort)('5432')).toEqual({
|
|
7
|
+
hostPort: 5432,
|
|
8
|
+
containerPort: 5432,
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
it('should parse 5432:5433', () => {
|
|
12
|
+
expect((0, parse_work_port_1.parseWorkPort)('5432:5433')).toEqual({
|
|
13
|
+
hostPort: 5432,
|
|
14
|
+
containerPort: 5433,
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
it('throws for a port with more than two parts', () => {
|
|
18
|
+
expect(() => (0, parse_work_port_1.parseWorkPort)('1:2:3')).toThrow('invalid port 1:2:3');
|
|
19
|
+
});
|
|
20
|
+
it('throws for a non-numeric port', () => {
|
|
21
|
+
expect(() => (0, parse_work_port_1.parseWorkPort)('http')).toThrow('invalid port http');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=parse-work-port.spec.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseWorkPorts = void 0;
|
|
4
|
+
const template_value_1 = require("./template-value");
|
|
5
|
+
const parse_work_port_1 = require("./parse-work-port");
|
|
6
|
+
function parseWorkPorts(schema, envs) {
|
|
7
|
+
return (schema.ports ?? []).map((m) => (0, template_value_1.templateValue)(`${m}`, envs)).map((m) => (0, parse_work_port_1.parseWorkPort)(m));
|
|
8
|
+
}
|
|
9
|
+
exports.parseWorkPorts = parseWorkPorts;
|
|
10
|
+
//# sourceMappingURL=parse-work-ports.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const parse_work_ports_1 = require("./parse-work-ports");
|
|
4
|
+
const noEnvs = { variables: {}, replacements: [] };
|
|
5
|
+
describe('parse-work-ports', () => {
|
|
6
|
+
it('returns an empty list when the service declares no ports', () => {
|
|
7
|
+
const schema = { image: 'postgres:12-alpine' };
|
|
8
|
+
expect((0, parse_work_ports_1.parseWorkPorts)(schema, noEnvs)).toEqual([]);
|
|
9
|
+
});
|
|
10
|
+
it('parses numeric and string ports', () => {
|
|
11
|
+
const schema = { image: 'node', ports: [5432, '8080:80'] };
|
|
12
|
+
expect((0, parse_work_ports_1.parseWorkPorts)(schema, noEnvs)).toEqual([
|
|
13
|
+
{ hostPort: 5432, containerPort: 5432 },
|
|
14
|
+
{ hostPort: 8080, containerPort: 80 },
|
|
15
|
+
]);
|
|
16
|
+
});
|
|
17
|
+
it('templates env vars in port values', () => {
|
|
18
|
+
const schema = { image: 'node', ports: ['$PORT:80'] };
|
|
19
|
+
expect((0, parse_work_ports_1.parseWorkPorts)(schema, { variables: { PORT: '9090' }, replacements: [] })).toEqual([
|
|
20
|
+
{ hostPort: 9090, containerPort: 80 },
|
|
21
|
+
]);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=parse-work-ports.spec.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSource = exports.parseWorkSource = void 0;
|
|
4
|
+
const minimatch_1 = require("minimatch");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const template_value_1 = require("./template-value");
|
|
7
|
+
// minimatch globs are always '/'-separated; on Windows path.join/relative yield
|
|
8
|
+
// '\\', which minimatch treats as escape chars (so a native pattern never
|
|
9
|
+
// matches). Normalize both the pattern and the candidate to posix before
|
|
10
|
+
// matching. No-op on posix, where sep === posix.sep.
|
|
11
|
+
const toPosix = (value) => (path_1.sep === path_1.posix.sep ? value : value.split(path_1.sep).join(path_1.posix.sep));
|
|
12
|
+
function parseWorkSource(cwd, sources, envs) {
|
|
13
|
+
const result = [];
|
|
14
|
+
if (!sources) {
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
for (const source of sources) {
|
|
18
|
+
const wildcardIndex = source.indexOf('*');
|
|
19
|
+
if (wildcardIndex >= 0) {
|
|
20
|
+
if (wildcardIndex === 0) {
|
|
21
|
+
const absolutePath = cwd;
|
|
22
|
+
result.push({
|
|
23
|
+
matcher: (file, cwd) => {
|
|
24
|
+
const matcher = new minimatch_1.Minimatch(source, { dot: true });
|
|
25
|
+
return matcher.match(toPosix((0, path_1.relative)(cwd, file)));
|
|
26
|
+
},
|
|
27
|
+
inherited: null,
|
|
28
|
+
source,
|
|
29
|
+
absolutePath,
|
|
30
|
+
isFile: false,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const prefixSource = source.substring(0, wildcardIndex);
|
|
35
|
+
const absolutePath = (0, path_1.join)(cwd, (0, template_value_1.templateValue)(prefixSource, envs));
|
|
36
|
+
result.push({
|
|
37
|
+
matcher: (file, cwd) => {
|
|
38
|
+
const matcher = new minimatch_1.Minimatch(toPosix((0, path_1.join)(cwd, source)), { dot: true });
|
|
39
|
+
return matcher.match(toPosix(file));
|
|
40
|
+
},
|
|
41
|
+
inherited: null,
|
|
42
|
+
source,
|
|
43
|
+
absolutePath,
|
|
44
|
+
isFile: false,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const absolutePath = (0, path_1.join)(cwd, (0, template_value_1.templateValue)(source, envs));
|
|
50
|
+
result.push({
|
|
51
|
+
matcher: (file) => file.startsWith(absolutePath),
|
|
52
|
+
absolutePath,
|
|
53
|
+
source,
|
|
54
|
+
inherited: null,
|
|
55
|
+
isFile: (0, path_1.extname)(absolutePath).length > 1,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
exports.parseWorkSource = parseWorkSource;
|
|
62
|
+
function createSource(absolutePath) {
|
|
63
|
+
return {
|
|
64
|
+
matcher: (file) => file.startsWith(absolutePath),
|
|
65
|
+
absolutePath,
|
|
66
|
+
source: absolutePath,
|
|
67
|
+
inherited: null,
|
|
68
|
+
isFile: (0, path_1.extname)(absolutePath).length > 1,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
exports.createSource = createSource;
|
|
72
|
+
//# sourceMappingURL=parse-work-source.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const path_1 = require("path");
|
|
4
|
+
const parse_work_source_1 = require("./parse-work-source");
|
|
5
|
+
const noEnvs = { variables: {}, replacements: [] };
|
|
6
|
+
// parseWorkSource builds absolutePath via path.join and the no-wildcard matcher
|
|
7
|
+
// compares with String.startsWith, so both are native-separated. Author the
|
|
8
|
+
// expectations in posix and convert to the host separator. No-op on posix.
|
|
9
|
+
const toNative = (value) => value.split(path_1.posix.sep).join(path_1.sep);
|
|
10
|
+
describe('parse-work-source', () => {
|
|
11
|
+
it('returns an empty list for null/undefined sources', () => {
|
|
12
|
+
expect((0, parse_work_source_1.parseWorkSource)('/proj', null, noEnvs)).toEqual([]);
|
|
13
|
+
expect((0, parse_work_source_1.parseWorkSource)('/proj', undefined, noEnvs)).toEqual([]);
|
|
14
|
+
});
|
|
15
|
+
describe('without a wildcard', () => {
|
|
16
|
+
it('treats a path with an extension as a file', () => {
|
|
17
|
+
const [src] = (0, parse_work_source_1.parseWorkSource)('/proj', ['dist/app.js'], noEnvs);
|
|
18
|
+
expect(src.absolutePath).toBe(toNative('/proj/dist/app.js'));
|
|
19
|
+
expect(src.isFile).toBe(true);
|
|
20
|
+
expect(src.matcher(toNative('/proj/dist/app.js'), '/proj')).toBe(true);
|
|
21
|
+
expect(src.matcher(toNative('/proj/dist/other.js'), '/proj')).toBe(false);
|
|
22
|
+
});
|
|
23
|
+
it('treats a path without an extension as a directory', () => {
|
|
24
|
+
const [src] = (0, parse_work_source_1.parseWorkSource)('/proj', ['src'], noEnvs);
|
|
25
|
+
expect(src.absolutePath).toBe(toNative('/proj/src'));
|
|
26
|
+
expect(src.isFile).toBe(false);
|
|
27
|
+
expect(src.matcher(toNative('/proj/src/index.ts'), '/proj')).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
describe('with a leading wildcard', () => {
|
|
31
|
+
it('anchors the absolute path to cwd and matches relative paths', () => {
|
|
32
|
+
const [src] = (0, parse_work_source_1.parseWorkSource)('/proj', ['*.spec.ts'], noEnvs);
|
|
33
|
+
expect(src.absolutePath).toBe('/proj');
|
|
34
|
+
expect(src.isFile).toBe(false);
|
|
35
|
+
expect(src.matcher('/proj/a.spec.ts', '/proj')).toBe(true);
|
|
36
|
+
expect(src.matcher('/proj/a.ts', '/proj')).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe('with a mid-string wildcard', () => {
|
|
40
|
+
it('uses the prefix for the absolute path and globs against the full path', () => {
|
|
41
|
+
const [src] = (0, parse_work_source_1.parseWorkSource)('/proj', ['src/*.ts'], noEnvs);
|
|
42
|
+
expect(src.absolutePath).toBe(toNative('/proj/src/'));
|
|
43
|
+
expect(src.isFile).toBe(false);
|
|
44
|
+
expect(src.matcher('/proj/src/a.ts', '/proj')).toBe(true);
|
|
45
|
+
expect(src.matcher('/proj/src/sub/a.ts', '/proj')).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe('createSource', () => {
|
|
49
|
+
it('builds a prefix matcher from an absolute path', () => {
|
|
50
|
+
const src = (0, parse_work_source_1.createSource)('/proj/dist');
|
|
51
|
+
expect(src.absolutePath).toBe('/proj/dist');
|
|
52
|
+
expect(src.source).toBe('/proj/dist');
|
|
53
|
+
expect(src.matcher('/proj/dist/app.js', '/proj')).toBe(true);
|
|
54
|
+
expect(src.matcher('/proj/other', '/proj')).toBe(false);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=parse-work-source.spec.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseWorkVolumes = exports.parseWorkVolume = void 0;
|
|
4
|
+
const normalize_path_1 = require("./normalize-path");
|
|
5
|
+
const plan_work_volume_1 = require("./plan-work-volume");
|
|
6
|
+
const template_value_1 = require("./template-value");
|
|
7
|
+
function parseWorkVolume(cwd, volume, envs) {
|
|
8
|
+
if (typeof volume === 'string') {
|
|
9
|
+
const parts = volume.split(':');
|
|
10
|
+
if (parts.length === 2) {
|
|
11
|
+
return parseVolume(cwd, parts[0], parts[1]);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
throw new Error(`invalid volume ${volume}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
const path = (0, template_value_1.templateValue)(volume.path, envs);
|
|
19
|
+
return {
|
|
20
|
+
containerPath: path,
|
|
21
|
+
export: volume.export ?? false,
|
|
22
|
+
name: volume.name ? (0, template_value_1.templateValue)(volume.name, envs) : (0, plan_work_volume_1.getVolumeName)(path),
|
|
23
|
+
inherited: null,
|
|
24
|
+
resetOnChange: volume.resetOnChange ?? false,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.parseWorkVolume = parseWorkVolume;
|
|
29
|
+
function parseWorkVolumes(cwd, volumes, envs) {
|
|
30
|
+
if (!volumes) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
return volumes.map((v) => parseWorkVolume(cwd, v, envs));
|
|
34
|
+
}
|
|
35
|
+
exports.parseWorkVolumes = parseWorkVolumes;
|
|
36
|
+
function parseVolume(cwd, name, containerPath) {
|
|
37
|
+
return {
|
|
38
|
+
name,
|
|
39
|
+
resetOnChange: false,
|
|
40
|
+
containerPath: (0, normalize_path_1.normalizePath)(cwd, cwd, containerPath),
|
|
41
|
+
inherited: null,
|
|
42
|
+
export: false,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=parse-work-volume.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const parse_work_volume_1 = require("./parse-work-volume");
|
|
4
|
+
describe('parse-work-volume', () => {
|
|
5
|
+
it('should parse projdata:/usr/data', () => {
|
|
6
|
+
expect((0, parse_work_volume_1.parseWorkVolume)('/home/user/proj', 'projdata:/usr/data', { replacements: [], variables: {} })).toEqual({
|
|
7
|
+
name: 'projdata',
|
|
8
|
+
containerPath: '/usr/data',
|
|
9
|
+
resetOnChange: false,
|
|
10
|
+
export: false,
|
|
11
|
+
inherited: null,
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
it('throws for a volume string that is not name:path', () => {
|
|
15
|
+
expect(() => (0, parse_work_volume_1.parseWorkVolume)('/home/user/proj', 'a:b:c', { replacements: [], variables: {} })).toThrow('invalid volume a:b:c');
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=parse-work-volume.spec.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasError = exports.hasErrorService = exports.hasErrorTask = exports.iterateWorkTasks = exports.iterateWorkServices = void 0;
|
|
4
|
+
function* iterateWorkServices(workTree) {
|
|
5
|
+
for (const service of Object.values(workTree.services)) {
|
|
6
|
+
yield service;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.iterateWorkServices = iterateWorkServices;
|
|
10
|
+
function* iterateWorkTasks(workTree) {
|
|
11
|
+
for (const task of Object.values(workTree.tasks)) {
|
|
12
|
+
yield task;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.iterateWorkTasks = iterateWorkTasks;
|
|
16
|
+
function hasErrorTask(workTree) {
|
|
17
|
+
for (const task of iterateWorkTasks(workTree)) {
|
|
18
|
+
if (task.state.current.type === 'error') {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
exports.hasErrorTask = hasErrorTask;
|
|
25
|
+
function hasErrorService(workTree) {
|
|
26
|
+
for (const task of iterateWorkServices(workTree)) {
|
|
27
|
+
if (task.state.current.type === 'error') {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
exports.hasErrorService = hasErrorService;
|
|
34
|
+
function hasError(workTree) {
|
|
35
|
+
if (hasErrorService(workTree)) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return hasErrorTask(workTree);
|
|
39
|
+
}
|
|
40
|
+
exports.hasError = hasError;
|
|
41
|
+
//# sourceMappingURL=plan-work-tasks.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const plan_work_tasks_1 = require("./plan-work-tasks");
|
|
4
|
+
const ok = { state: { current: { type: 'completed' } } };
|
|
5
|
+
const err = { state: { current: { type: 'error' } } };
|
|
6
|
+
const tree = (services, tasks) => ({ services, tasks });
|
|
7
|
+
describe('plan-work-tasks iterators and error helpers', () => {
|
|
8
|
+
it('iterateWorkServices yields every service value', () => {
|
|
9
|
+
const t = tree({ a: { id: 'A' }, b: { id: 'B' } }, {});
|
|
10
|
+
expect([...(0, plan_work_tasks_1.iterateWorkServices)(t)].map((s) => s.id)).toEqual(['A', 'B']);
|
|
11
|
+
});
|
|
12
|
+
it('iterateWorkTasks yields every task value', () => {
|
|
13
|
+
const t = tree({}, { a: { id: 'A' } });
|
|
14
|
+
expect([...(0, plan_work_tasks_1.iterateWorkTasks)(t)].map((s) => s.id)).toEqual(['A']);
|
|
15
|
+
});
|
|
16
|
+
it('hasErrorTask is true iff a task is in error', () => {
|
|
17
|
+
expect((0, plan_work_tasks_1.hasErrorTask)(tree({}, { a: ok }))).toBe(false);
|
|
18
|
+
expect((0, plan_work_tasks_1.hasErrorTask)(tree({}, { a: ok, b: err }))).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
it('hasErrorService is true iff a service is in error', () => {
|
|
21
|
+
expect((0, plan_work_tasks_1.hasErrorService)(tree({ a: ok }, {}))).toBe(false);
|
|
22
|
+
expect((0, plan_work_tasks_1.hasErrorService)(tree({ a: err }, {}))).toBe(true);
|
|
23
|
+
});
|
|
24
|
+
it('hasError covers both services and tasks', () => {
|
|
25
|
+
expect((0, plan_work_tasks_1.hasError)(tree({}, {}))).toBe(false);
|
|
26
|
+
expect((0, plan_work_tasks_1.hasError)(tree({ a: err }, {}))).toBe(true);
|
|
27
|
+
expect((0, plan_work_tasks_1.hasError)(tree({}, { a: err }))).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=plan-work-tasks.spec.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const plan_work_volume_1 = require("./plan-work-volume");
|
|
4
|
+
describe('plan-work-volume', () => {
|
|
5
|
+
describe('generateId / getVolumeName', () => {
|
|
6
|
+
it('hashes the input deterministically (sha1)', () => {
|
|
7
|
+
expect((0, plan_work_volume_1.generateId)('a')).toBe((0, plan_work_volume_1.generateId)('a'));
|
|
8
|
+
expect((0, plan_work_volume_1.generateId)('a')).not.toBe((0, plan_work_volume_1.generateId)('b'));
|
|
9
|
+
expect((0, plan_work_volume_1.getVolumeName)('x')).toMatch(/^hammerkit-[a-f0-9]{40}$/);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
describe('getContainerVolumes', () => {
|
|
13
|
+
const task = {
|
|
14
|
+
generates: [
|
|
15
|
+
{ path: '/out/a', volumeName: 'na', inherited: null, resetOnChange: true, export: false, isFile: false },
|
|
16
|
+
{ path: '/out/b', volumeName: 'nb', inherited: null, resetOnChange: false, export: true, isFile: false },
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
it('emits a named volume for every generate that has no matching mount', () => {
|
|
20
|
+
const volumes = (0, plan_work_volume_1.getContainerVolumes)(task, []);
|
|
21
|
+
expect(volumes.map((v) => v.containerPath)).toEqual(['/out/a', '/out/b']);
|
|
22
|
+
expect(volumes[0].resetOnChange).toBe(true);
|
|
23
|
+
expect(volumes[1].export).toBe(true);
|
|
24
|
+
expect(volumes[0].name).toMatch(/^hammerkit-/);
|
|
25
|
+
});
|
|
26
|
+
it('skips a generate whose path is already mounted (mount wins)', () => {
|
|
27
|
+
const mounts = [{ containerPath: '/out/a' }];
|
|
28
|
+
const volumes = (0, plan_work_volume_1.getContainerVolumes)(task, mounts);
|
|
29
|
+
expect(volumes.map((v) => v.containerPath)).toEqual(['/out/b']);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=plan-work-volume.spec.js.map
|
|
@@ -4,10 +4,10 @@ exports.splitName = void 0;
|
|
|
4
4
|
function splitName(name) {
|
|
5
5
|
const index = name.indexOf(':');
|
|
6
6
|
if (index > 0) {
|
|
7
|
-
return { prefix: name.
|
|
7
|
+
return { prefix: name.substring(0, index), name: name.substring(index + 1) };
|
|
8
8
|
}
|
|
9
9
|
else {
|
|
10
|
-
return {
|
|
10
|
+
return { name };
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.splitName = splitName;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const split_name_1 = require("./split-name");
|
|
4
|
+
describe('split-name', () => {
|
|
5
|
+
it('should split test:bar', () => {
|
|
6
|
+
const result = (0, split_name_1.splitName)('test:bar');
|
|
7
|
+
expect(result.name).toEqual('bar');
|
|
8
|
+
expect(result.prefix).toEqual('test');
|
|
9
|
+
});
|
|
10
|
+
it('should not split test', () => {
|
|
11
|
+
const result = (0, split_name_1.splitName)('test');
|
|
12
|
+
expect(result.name).toEqual('test');
|
|
13
|
+
expect(result.prefix).toEqual(undefined);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=split-name.spec.js.map
|
|
@@ -6,8 +6,7 @@ function templateValue(value, envs) {
|
|
|
6
6
|
return value;
|
|
7
7
|
}
|
|
8
8
|
let result = value;
|
|
9
|
-
for (const key of Object.
|
|
10
|
-
const envValue = envs[key];
|
|
9
|
+
for (const [key, envValue] of Object.entries(envs.variables)) {
|
|
11
10
|
result = result.replace(new RegExp(`\\$${key}`, 'gi'), envValue);
|
|
12
11
|
}
|
|
13
12
|
return result;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const template_value_1 = require("./template-value");
|
|
4
|
+
describe('template-value', () => {
|
|
5
|
+
it('should template string value', () => {
|
|
6
|
+
const value = (0, template_value_1.templateValue)('echo $VAR', { variables: { VAR: 'hello' }, replacements: [] });
|
|
7
|
+
expect(value).toEqual('echo hello');
|
|
8
|
+
});
|
|
9
|
+
it('should leave missing envs', () => {
|
|
10
|
+
const value = (0, template_value_1.templateValue)('echo $VAR', { variables: {}, replacements: [] });
|
|
11
|
+
expect(value).toEqual('echo $VAR');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=template-value.spec.js.map
|