hammerkit 2.1.0-next.4 → 2.1.0-next.5

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.
@@ -2,13 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isDependencyOutput = void 0;
4
4
  const path_1 = require("path");
5
- // Whether a path is, or is inside, a folder a dependency of the task generates. The task sees
6
- // what the dependency made there: a src at such a path stays a src of the task (its id and its
7
- // cache key are as they were), but isn't bound or mounted over the output, as docker would bind
8
- // the host's folder (empty where the dependency ran in a container) and a pod would mount the
9
- // same path twice. A `build` whose context a dependency writes reads it so.
5
+ // Whether a path is a file a dependency of the task generates, or is, or is inside, a folder
6
+ // one generates. The task sees what the dependency made there: a src at such a path stays a
7
+ // src of the task (its id and its cache key are as they were), but isn't bound or mounted over
8
+ // the output, as docker would bind the host's folder (empty where the dependency ran in a
9
+ // container) and a pod would mount the same path twice. A `build` whose context a dependency
10
+ // writes reads it so, and a deploy that lists the digest file of its image in its src.
10
11
  function isDependencyOutput(task, path) {
11
- return task.generates.some((generate) => generate.inherited && !generate.isFile && (generate.path === path || isInside(generate.path, path)));
12
+ return task.generates.some((generate) => generate.inherited && (generate.path === path || (!generate.isFile && isInside(generate.path, path))));
12
13
  }
13
14
  exports.isDependencyOutput = isDependencyOutput;
14
15
  function isInside(folder, path) {
@@ -5,6 +5,7 @@ const read_build_file_1 = require("../parser/read-build-file");
5
5
  const plan_work_tasks_1 = require("./utils/plan-work-tasks");
6
6
  const unreferenced_build_file_envs_1 = require("./unreferenced-build-file-envs");
7
7
  const normalize_path_1 = require("./utils/normalize-path");
8
+ const dependency_outputs_1 = require("./utils/dependency-outputs");
8
9
  async function* validate(workTree, context) {
9
10
  const cycleItems = [];
10
11
  for (const item of (0, plan_work_tasks_1.iterateWorkServices)(workTree)) {
@@ -76,6 +77,10 @@ async function* validate(workTree, context) {
76
77
  }
77
78
  }
78
79
  for (const src of task.src) {
80
+ // a dependency writes it when it runs: the digest of an image a deploy lists in its src
81
+ if ((0, dependency_outputs_1.isDependencyOutput)(task, src.absolutePath)) {
82
+ continue;
83
+ }
79
84
  if (!(await context.file.exists(src.absolutePath))) {
80
85
  yield {
81
86
  type: 'warn',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hammerkit",
3
3
  "description": "Containerized build tool with incremental caching that runs the same build file locally, in Docker and on Kubernetes.",
4
- "version": "2.1.0-next.4",
4
+ "version": "2.1.0-next.5",
5
5
  "keywords": [
6
6
  "build",
7
7
  "build-tool",