@catladder/pipeline 1.154.2 → 1.155.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/build/base/writeDotEnv.js +8 -0
- package/dist/build/node/buildJob.js +1 -1
- package/dist/build/node/cache.d.ts +3 -2
- package/dist/build/node/cache.js +11 -2
- package/dist/bundles/catladder-gitlab/index.js +2 -2
- package/dist/constants.js +1 -1
- package/dist/context/getBuildInfoVariables.d.ts +2 -3
- package/dist/context/getBuildInfoVariables.js +43 -17
- package/dist/context/getEnvironmentVariables.d.ts +0 -3
- package/dist/pipeline/yarn/yarnUtils.js +12 -11
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/jsonParse.d.ts +1 -0
- package/dist/utils/jsonParse.js +14 -0
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +28 -24
- package/examples/__snapshots__/native-app.ts.snap +0 -12
- package/package.json +1 -1
- package/src/build/base/writeDotEnv.ts +4 -0
- package/src/build/node/buildJob.ts +9 -1
- package/src/build/node/cache.ts +14 -1
- package/src/context/getBuildInfoVariables.ts +25 -30
- package/src/pipeline/yarn/yarnUtils.ts +8 -5
- package/src/utils/jsonParse.ts +7 -0
|
@@ -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],
|
|
@@ -68,7 +68,7 @@ var createNodeBuildJobDefinition = function (context) {
|
|
|
68
68
|
return {
|
|
69
69
|
image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
|
|
70
70
|
runnerVariables: constants_1.NODE_RUNNER_BUILD_VARIABLES,
|
|
71
|
-
cache: __spreadArray(__spreadArray(__spreadArray([], __read((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : []), false), __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
|
|
71
|
+
cache: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : []), false), __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false), __read(context.type === "workspace" ? (0, cache_1.getWorkspaceDefaultCaches)(context) : []), false),
|
|
72
72
|
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : []), false),
|
|
73
73
|
jobTags: buildConfig.jobTags
|
|
74
74
|
};
|
|
@@ -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[];
|
package/dist/build/node/cache.js
CHANGED
|
@@ -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"));
|
|
@@ -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;
|