@catladder/pipeline 1.154.3 → 1.156.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.
@@ -28,6 +28,7 @@ Object.defineProperty(exports, "__esModule", {
28
28
  exports.componentContextNeedsBuildTimeDotEnv = exports.writeDotEnv = void 0;
29
29
  var lodash_1 = require("lodash");
30
30
  var gitlab_1 = require("../../utils/gitlab");
31
+ var getBuildInfoVariables_1 = require("../../context/getBuildInfoVariables");
31
32
  /**
32
33
  * writes a .env file in the components folder
33
34
  * @param context
@@ -42,6 +43,13 @@ var writeDotEnv = function (context) {
42
43
  var _b = __read(_a, 2),
43
44
  value = _b[1];
44
45
  return !(0, lodash_1.isNil)(value);
46
+ })
47
+ // filter out build variables, since they may interfer with caching like turbo
48
+ // build variables are rarely used anyway and we may treat them differently in the future
49
+ .filter(function (_a) {
50
+ var _b = __read(_a, 1),
51
+ key = _b[0];
52
+ return !getBuildInfoVariables_1.ALL_BUILD_VARIABLES.includes(key);
45
53
  }).map(function (_a) {
46
54
  var _b = __read(_a, 2),
47
55
  key = _b[0],
@@ -1,6 +1,7 @@
1
- import type { Context } from "../../types/context";
1
+ import type { Context, WorkspaceContext } from "../../types/context";
2
2
  import type { GitlabJobCache } from "../../types/gitlab-types";
3
3
  export declare const getYarnCache: (context: Context, policy?: string) => GitlabJobCache[];
4
4
  export declare const getNodeModulesCache: (context: Context, policy?: string) => GitlabJobCache[];
5
5
  export declare const getNodeCache: (context: Context, policy?: string) => GitlabJobCache[];
6
- export declare const getNextCache: (context: Context) => GitlabJobCache[];
6
+ export declare const getNextCache: (context: Context) => GitlabJobCache[];
7
+ export declare const getWorkspaceDefaultCaches: (context: WorkspaceContext) => GitlabJobCache[];
@@ -39,7 +39,7 @@ var __importDefault = this && this.__importDefault || function (mod) {
39
39
  Object.defineProperty(exports, "__esModule", {
40
40
  value: true
41
41
  });
42
- exports.getNextCache = exports.getNodeCache = exports.getNodeModulesCache = exports.getYarnCache = void 0;
42
+ exports.getWorkspaceDefaultCaches = exports.getNextCache = exports.getNodeCache = exports.getNodeModulesCache = exports.getYarnCache = void 0;
43
43
  var lodash_1 = require("lodash");
44
44
  var path_1 = require("path");
45
45
  var slugify_1 = __importDefault(require("slugify"));
@@ -82,7 +82,7 @@ var getNodeCache = function (context, policy) {
82
82
  if (policy === void 0) {
83
83
  policy = "pull-push";
84
84
  }
85
- return __spreadArray(__spreadArray([], __read((0, exports.getYarnCache)(context, policy)), false), __read((0, exports.getNodeModulesCache)(context, policy)), false);
85
+ return __spreadArray(__spreadArray(__spreadArray([], __read((0, exports.getYarnCache)(context, policy)), false), __read((0, exports.getNodeModulesCache)(context, policy)), false), __read(context.type === "workspace" ? (0, exports.getWorkspaceDefaultCaches)(context) : []), false);
86
86
  };
87
87
  exports.getNodeCache = getNodeCache;
88
88
  var getNextCache = function (context) {
@@ -96,4 +96,13 @@ var getNextCache = function (context) {
96
96
  paths: paths
97
97
  }];
98
98
  };
99
- exports.getNextCache = getNextCache;
99
+ exports.getNextCache = getNextCache;
100
+ var getWorkspaceDefaultCaches = function (context) {
101
+ return [{
102
+ // turbo repo
103
+ key: context.name + "-turbo",
104
+ policy: "pull-push",
105
+ paths: [(0, path_1.join)(context.build.dir, ".turbo")]
106
+ }];
107
+ };
108
+ exports.getWorkspaceDefaultCaches = getWorkspaceDefaultCaches;