@catladder/pipeline 0.0.0-refactor-remove-envsubst-266e91b9 → 0.0.0-refactor-env-context-7ff87d8e
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/bin/catladder-gitlab.js +1 -1
- package/dist/build/base/createBuildJob.d.ts +2 -2
- package/dist/build/base/getBuildInfo.d.ts +1 -1
- package/dist/build/docker.d.ts +30 -3
- package/dist/build/docker.js +29 -13
- package/dist/build/index.d.ts +6 -5
- package/dist/build/node/buildJob.d.ts +2 -2
- package/dist/build/node/cache.d.ts +2 -2
- package/dist/build/node/index.d.ts +1 -1
- package/dist/build/node/meteor.d.ts +1 -1
- package/dist/build/node/meteor.js +6 -0
- package/dist/build/node/testJob.d.ts +2 -2
- package/dist/build/node/yarn.d.ts +1 -1
- package/dist/build/node/yarn.js +13 -1
- package/dist/build/types.d.ts +10 -0
- package/dist/bundles/catladder-gitlab/index.js +32457 -0
- package/dist/catladder-gitlab.js +1 -2
- package/dist/config/configruedEnvs.d.ts +1 -1
- package/dist/config/readConfig.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/context/getEnvConfig.d.ts +9 -0
- package/dist/context/getEnvConfig.js +26 -0
- package/dist/context/getEnvType.d.ts +4 -0
- package/dist/context/getEnvType.js +18 -0
- package/dist/context/getEnvironment.d.ts +3 -0
- package/dist/context/getEnvironment.js +187 -0
- package/dist/context/getEnvironmentContext.d.ts +4 -0
- package/dist/context/getEnvironmentContext.js +36 -0
- package/dist/context/getEnvironmentVariables.d.ts +10 -0
- package/dist/context/getEnvironmentVariables.js +322 -0
- package/dist/context/getLabels.d.ts +8 -0
- package/dist/context/getLabels.js +49 -0
- package/dist/context/index.d.ts +5 -6
- package/dist/context/index.js +176 -186
- package/dist/context/resolveReferences.d.ts +1 -3
- package/dist/context/resolveReferences.js +275 -26
- package/dist/context/resolveReferences.test.js +332 -81
- package/dist/defaults/index.d.ts +1 -1
- package/dist/deploy/base.d.ts +2 -2
- package/dist/deploy/base.js +6 -19
- package/dist/deploy/cloudRun/deployJob.d.ts +3 -0
- package/dist/deploy/cloudRun/deployJob.js +139 -0
- package/dist/deploy/cloudRun/index.d.ts +9 -0
- package/dist/deploy/cloudRun/index.js +56 -0
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -0
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +14 -0
- package/dist/deploy/cloudSql/index.d.ts +8 -0
- package/dist/deploy/cloudSql/index.js +30 -0
- package/dist/deploy/custom/deployJob.d.ts +2 -2
- package/dist/deploy/custom/deployJob.js +4 -1
- package/dist/deploy/custom/index.d.ts +2 -1
- package/dist/deploy/custom/index.js +15 -18
- package/dist/deploy/dockerTag/deployJob.d.ts +3 -0
- package/dist/deploy/dockerTag/deployJob.js +33 -0
- package/dist/deploy/dockerTag/index.d.ts +2 -0
- package/dist/deploy/dockerTag/index.js +19 -0
- package/dist/deploy/index.d.ts +12 -8
- package/dist/deploy/index.js +27 -14
- package/dist/deploy/kubernetes/additionalSecretKeys.d.ts +4 -0
- package/dist/deploy/kubernetes/additionalSecretKeys.js +33 -0
- package/dist/deploy/kubernetes/cloudsql.d.ts +1 -1
- package/dist/deploy/kubernetes/deployJob.d.ts +2 -2
- package/dist/deploy/kubernetes/deployJob.js +6 -62
- package/dist/deploy/kubernetes/index.d.ts +2 -1
- package/dist/deploy/kubernetes/index.js +45 -16
- package/dist/deploy/kubernetes/kubeEnv.d.ts +10 -0
- package/dist/deploy/kubernetes/kubeEnv.js +90 -0
- package/dist/deploy/kubernetes/kubeValues.d.ts +90 -0
- package/dist/deploy/kubernetes/kubeValues.js +96 -0
- package/dist/deploy/kubernetes/mongodb.d.ts +18 -5
- package/dist/deploy/kubernetes/mongodb.js +118 -8
- package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +18 -11
- package/dist/deploy/types/base.d.ts +15 -0
- package/dist/deploy/types/base.js +3 -0
- package/dist/deploy/types/custom.d.ts +27 -0
- package/dist/deploy/types/custom.js +3 -0
- package/dist/deploy/types/dockerTag.d.ts +10 -0
- package/dist/deploy/types/dockerTag.js +3 -0
- package/dist/deploy/types/googleCloudRun.d.ts +39 -0
- package/dist/deploy/types/googleCloudRun.js +3 -0
- package/dist/deploy/types/index.d.ts +24 -0
- package/dist/deploy/types/index.js +41 -0
- package/dist/deploy/{types.d.ts → types/kubernetes.d.ts} +96 -32
- package/dist/deploy/types/kubernetes.js +3 -0
- package/dist/deploy/utils.d.ts +2 -2
- package/dist/deploy/utils.js +4 -0
- package/dist/pipeline/createChildPipeline.d.ts +2 -2
- package/dist/pipeline/createJobs.d.ts +2 -2
- package/dist/pipeline/createJobs.js +45 -17
- package/dist/pipeline/gitlab/makeGitlabJob.d.ts +2 -2
- package/dist/pipeline/packageManager.d.ts +1 -1
- package/dist/rules/index.d.ts +1 -1
- package/dist/runner/index.d.ts +2 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +7 -6
- package/dist/types/config.js +1 -1
- package/dist/types/context.d.ts +10 -2
- package/dist/types/environmentContext.d.ts +22 -0
- package/dist/types/environmentContext.js +3 -0
- package/dist/types/jobs.d.ts +1 -1
- package/dist/types/pipeline.d.ts +1 -1
- package/package.json +14 -10
- package/scripts/bundle +2 -0
- package/src/build/base/createBuildJob.ts +3 -2
- package/src/build/base/getBuildInfo.ts +1 -1
- package/src/build/docker.ts +28 -17
- package/src/build/index.ts +8 -5
- package/src/build/node/buildJob.ts +2 -2
- package/src/build/node/cache.ts +2 -2
- package/src/build/node/index.ts +1 -1
- package/src/build/node/meteor.ts +8 -2
- package/src/build/node/testJob.ts +2 -2
- package/src/build/node/yarn.ts +21 -10
- package/src/build/tests/storybook.test.ts +1 -1
- package/src/build/types.ts +13 -1
- package/src/catladder-gitlab.ts +4 -2
- package/src/config/configruedEnvs.test.ts +2 -2
- package/src/config/configruedEnvs.ts +5 -4
- package/src/config/readConfig.ts +1 -1
- package/src/context/getEnvConfig.ts +21 -0
- package/src/context/getEnvType.ts +17 -0
- package/src/context/getEnvironment.ts +40 -0
- package/src/context/getEnvironmentContext.ts +57 -0
- package/src/context/getEnvironmentVariables.ts +152 -0
- package/src/context/getLabels.ts +20 -0
- package/src/context/index.ts +25 -198
- package/src/context/resolveReferences.test.ts +15 -15
- package/src/context/resolveReferences.ts +37 -30
- package/src/defaults/index.ts +1 -1
- package/src/deploy/base.ts +11 -23
- package/src/deploy/cloudRun/deployJob.ts +104 -0
- package/src/deploy/cloudRun/index.ts +48 -0
- package/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.ts +14 -0
- package/src/deploy/cloudSql/index.ts +16 -0
- package/src/deploy/custom/deployJob.ts +10 -3
- package/src/deploy/custom/index.ts +9 -1
- package/src/deploy/dockerTag/deployJob.ts +31 -0
- package/src/deploy/dockerTag/index.ts +9 -0
- package/src/deploy/index.ts +26 -17
- package/src/deploy/kubernetes/additionalSecretKeys.ts +23 -0
- package/src/deploy/kubernetes/cloudsql.ts +2 -1
- package/src/deploy/kubernetes/deployJob.ts +5 -72
- package/src/deploy/kubernetes/index.ts +42 -1
- package/src/deploy/kubernetes/kubeEnv.ts +48 -0
- package/src/deploy/kubernetes/kubeValues.ts +82 -0
- package/src/deploy/kubernetes/mongodb.ts +104 -7
- package/src/deploy/kubernetes/processSecretsAsFiles.ts +1 -1
- package/src/deploy/types/base.ts +17 -0
- package/src/deploy/types/custom.ts +24 -0
- package/src/deploy/types/dockerTag.ts +12 -0
- package/src/deploy/types/googleCloudRun.ts +79 -0
- package/src/deploy/types/index.ts +28 -0
- package/src/deploy/types/kubernetes.ts +281 -0
- package/src/deploy/utils.ts +6 -2
- package/src/pipeline/createChildPipeline.test.ts +1 -1
- package/src/pipeline/createChildPipeline.ts +2 -2
- package/src/pipeline/createJobs.ts +8 -8
- package/src/pipeline/gitlab/makeGitlabJob.ts +2 -2
- package/src/pipeline/packageManager.ts +1 -1
- package/src/rules/index.ts +1 -1
- package/src/runner/index.ts +2 -1
- package/src/types/config.ts +8 -6
- package/src/types/context.ts +14 -2
- package/src/types/environmentContext.ts +26 -0
- package/src/types/jobs.ts +1 -1
- package/src/types/pipeline.ts +1 -1
- package/tsconfig.json +2 -0
- package/dist/deploy/types.js +0 -16
- package/src/deploy/types.ts +0 -215
package/bin/catladder-gitlab.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Context } from "../../types";
|
|
1
|
+
import type { Context } from "../../types";
|
|
2
2
|
export declare const getBuildInfo: (context: Context) => string[];
|
package/dist/build/docker.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from "../types";
|
|
2
|
-
import { CatladderJob } from "../types/jobs";
|
|
1
|
+
import type { Context } from "../types";
|
|
2
|
+
import type { CatladderJob } from "../types/jobs";
|
|
3
3
|
export declare const getDockerImageVariables: (context: Context) => {
|
|
4
4
|
DOCKER_REGISTRY: string;
|
|
5
5
|
DOCKER_REGISTRY_IMAGE_PATH: string;
|
|
@@ -30,11 +30,38 @@ export declare const getDockerBuildVariables: (context: Context) => {
|
|
|
30
30
|
KUBERNETES_MEMORY_LIMIT: string;
|
|
31
31
|
};
|
|
32
32
|
export declare const DOCKER_BUILD_JOB_NAME = "\uD83D\uDD28 docker";
|
|
33
|
+
export declare const getDockerJobBaseProps: (context: Context) => {
|
|
34
|
+
image: string;
|
|
35
|
+
services: {
|
|
36
|
+
name: string;
|
|
37
|
+
command: string[];
|
|
38
|
+
}[];
|
|
39
|
+
variables: {
|
|
40
|
+
DOCKER_REGISTRY: string;
|
|
41
|
+
DOCKER_REGISTRY_IMAGE_PATH: string;
|
|
42
|
+
DOCKER_CACHE_IMAGE: string;
|
|
43
|
+
DOCKER_IMAGE_NAME: string;
|
|
44
|
+
DOCKER_IMAGE: string;
|
|
45
|
+
DOCKER_IMAGE_TAG: string;
|
|
46
|
+
DOCKER_BUILDKIT: string;
|
|
47
|
+
DOCKERFILE_ADDITIONS: string | undefined;
|
|
48
|
+
DOCKERFILE_ADDITIONS_END: string | undefined;
|
|
49
|
+
APP_DIR: string;
|
|
50
|
+
DOCKER_HOST: string;
|
|
51
|
+
DOCKER_TLS_CERTDIR: string;
|
|
52
|
+
DOCKER_DIR: string;
|
|
53
|
+
DOCKER_DRIVER: string;
|
|
54
|
+
KUBERNETES_CPU_REQUEST: string;
|
|
55
|
+
KUBERNETES_CPU_LIMIT: string;
|
|
56
|
+
KUBERNETES_MEMORY_REQUEST: string;
|
|
57
|
+
KUBERNETES_MEMORY_LIMIT: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
33
60
|
export declare const createDockerBuildJobBase: (context: Context, {
|
|
34
61
|
script,
|
|
35
|
-
variables,
|
|
36
62
|
...def
|
|
37
63
|
}: Partial<CatladderJob>) => CatladderJob;
|
|
64
|
+
export declare const gitlabDockerLogin = "docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY";
|
|
38
65
|
export declare const createDockerBuildJobDefault: (context: Context, {
|
|
39
66
|
script,
|
|
40
67
|
...def
|
package/dist/build/docker.js
CHANGED
|
@@ -61,7 +61,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
exports.__esModule = true;
|
|
64
|
-
exports.createDockerBuildJobDefault = exports.createDockerBuildJobBase = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = exports.getDockerImageVariables = void 0;
|
|
64
|
+
exports.createDockerBuildJobDefault = exports.gitlabDockerLogin = exports.createDockerBuildJobBase = exports.getDockerJobBaseProps = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = exports.getDockerImageVariables = void 0;
|
|
65
65
|
|
|
66
66
|
var lodash_1 = require("lodash");
|
|
67
67
|
|
|
@@ -96,10 +96,18 @@ var requiresDockerBuild = function (context) {
|
|
|
96
96
|
return true;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
if ((0, deploy_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
|
|
99
103
|
if ((0, deploy_1.isOfDeployType)(deployConfig, "custom") && deployConfig.requiresDocker) {
|
|
100
104
|
return true;
|
|
101
105
|
}
|
|
102
106
|
|
|
107
|
+
if ((0, deploy_1.isOfDeployType)(deployConfig, "dockerTag")) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
|
|
103
111
|
return false;
|
|
104
112
|
};
|
|
105
113
|
|
|
@@ -123,33 +131,41 @@ var getDockerBuildVariables = function (context) {
|
|
|
123
131
|
exports.getDockerBuildVariables = getDockerBuildVariables;
|
|
124
132
|
exports.DOCKER_BUILD_JOB_NAME = "🔨 docker";
|
|
125
133
|
|
|
126
|
-
var
|
|
127
|
-
|
|
128
|
-
variables = _a.variables,
|
|
129
|
-
def = __rest(_a, ["script", "variables"]);
|
|
130
|
-
|
|
131
|
-
return (0, lodash_1.merge)({
|
|
132
|
-
name: exports.DOCKER_BUILD_JOB_NAME,
|
|
133
|
-
envMode: "jobPerEnv",
|
|
134
|
-
stage: "build",
|
|
134
|
+
var getDockerJobBaseProps = function (context) {
|
|
135
|
+
return {
|
|
135
136
|
image: (0, runner_1.getRunnerImage)("docker-build"),
|
|
136
137
|
services: [{
|
|
137
138
|
name: "docker:20-dind",
|
|
138
139
|
command: ["--tls=false"]
|
|
139
140
|
}],
|
|
140
|
-
variables:
|
|
141
|
+
variables: (0, exports.getDockerBuildVariables)(context)
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
exports.getDockerJobBaseProps = getDockerJobBaseProps;
|
|
146
|
+
|
|
147
|
+
var createDockerBuildJobBase = function (context, _a) {
|
|
148
|
+
var script = _a.script,
|
|
149
|
+
def = __rest(_a, ["script"]);
|
|
150
|
+
|
|
151
|
+
return (0, lodash_1.merge)(__assign(__assign({
|
|
152
|
+
name: exports.DOCKER_BUILD_JOB_NAME,
|
|
153
|
+
envMode: "jobPerEnv",
|
|
154
|
+
stage: "build"
|
|
155
|
+
}, (0, exports.getDockerJobBaseProps)(context)), {
|
|
141
156
|
script: script || []
|
|
142
|
-
}, def);
|
|
157
|
+
}), def);
|
|
143
158
|
};
|
|
144
159
|
|
|
145
160
|
exports.createDockerBuildJobBase = createDockerBuildJobBase;
|
|
161
|
+
exports.gitlabDockerLogin = "docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY";
|
|
146
162
|
|
|
147
163
|
var createDockerBuildJobDefault = function (context, _a) {
|
|
148
164
|
var script = _a.script,
|
|
149
165
|
def = __rest(_a, ["script"]);
|
|
150
166
|
|
|
151
167
|
return (0, exports.createDockerBuildJobBase)(context, __assign({
|
|
152
|
-
script: __spreadArray(__spreadArray([], __read(script || []), false), ["docker
|
|
168
|
+
script: __spreadArray(__spreadArray([], __read(script || []), false), [exports.gitlabDockerLogin, "docker version", "docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1", "docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG", "docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE", "docker push $DOCKER_CACHE_IMAGE"], false)
|
|
153
169
|
}, def));
|
|
154
170
|
};
|
|
155
171
|
|
package/dist/build/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Context } from "../types/context";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Context } from "../types/context";
|
|
2
|
+
import type { EnvironmentContext } from "../types/environmentContext";
|
|
3
|
+
import type { CatladderJob } from "../types/jobs";
|
|
4
|
+
import type { BuildConfig, BuildConfigType } from "./types";
|
|
4
5
|
export * from "./types";
|
|
5
6
|
export * from "./node";
|
|
6
|
-
export declare type BuildTypes = { [type in
|
|
7
|
+
export declare type BuildTypes = { [type in BuildConfigType]: {
|
|
7
8
|
jobs: (context: Context) => CatladderJob[];
|
|
8
|
-
defaults: () => Partial<Extract<BuildConfig, {
|
|
9
|
+
defaults: (envVarContext: EnvironmentContext<BuildConfigType, any>) => Partial<Extract<BuildConfig, {
|
|
9
10
|
type: type;
|
|
10
11
|
}>>;
|
|
11
12
|
} };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Context } from "../../types/context";
|
|
2
|
-
import { CatladderJob } from "../../types/jobs";
|
|
1
|
+
import type { Context } from "../../types/context";
|
|
2
|
+
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
export declare const createNodeBuildJobs: (context: Context) => CatladderJob[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from "../../types/context";
|
|
2
|
-
import { GitlabJobCache } from "../../types/gitlab-types";
|
|
1
|
+
import type { Context } from "../../types/context";
|
|
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[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from "../../types/context";
|
|
2
|
-
import { CatladderJob } from "../../types/jobs";
|
|
2
|
+
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
export declare const createNodeJobs: (context: Context) => CatladderJob[];
|
|
4
4
|
export declare const createStorybookJobs: (context: Context) => CatladderJob[];
|
|
5
5
|
export declare const createMeteorJobs: (context: Context) => CatladderJob[];
|
|
@@ -73,6 +73,9 @@ var createMeteorBuildJobs = function (context) {
|
|
|
73
73
|
var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
|
|
74
74
|
cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read(getMeteorCache(context)), false),
|
|
75
75
|
image: (0, runner_1.getRunnerImage)("jobs-meteor"),
|
|
76
|
+
variables: {
|
|
77
|
+
METEOR_DISABLE_OPTIMISTIC_CACHING: "1"
|
|
78
|
+
},
|
|
76
79
|
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), ['echo "add healthcheck package"', "meteor add panter:healthroute --allow-superuser", "meteor add qualia:prod-shell --allow-superuser", 'TOOL_NODE_FLAGS="--max_old_space_size=3584 --min_semi_space_size=8 --max_semi_space_size=256 --optimize_for_size" meteor build ./dist --architecture os.linux.x86_64 --allow-superuser --server-only --directory', "cp ./__build_info.json ./dist/bundle/programs/server"], false),
|
|
77
80
|
artifacts: {
|
|
78
81
|
paths: [context.componentConfig.dir + "/__build_info.json", context.componentConfig.dir + "/dist"]
|
|
@@ -80,6 +83,9 @@ var createMeteorBuildJobs = function (context) {
|
|
|
80
83
|
}) : null;
|
|
81
84
|
return __spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), [(0, docker_1.createDockerBuildJobDefault)(context, {
|
|
82
85
|
script: ["ensureMeteorDockerfile"],
|
|
86
|
+
variables: {
|
|
87
|
+
METEOR_INSTALL_SCRIPTS: buildConfig.installScripts ? "true" : ""
|
|
88
|
+
},
|
|
83
89
|
needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
|
|
84
90
|
})], false);
|
|
85
91
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Context } from "../../types/context";
|
|
2
|
-
import { CatladderJob } from "../../types/jobs";
|
|
1
|
+
import type { Context } from "../../types/context";
|
|
2
|
+
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
export declare const createNodeTestJobs: (context: Context) => CatladderJob[];
|
package/dist/build/node/yarn.js
CHANGED
|
@@ -41,7 +41,19 @@ exports.getYarnInstall = exports.ensureNodeVersion = exports.getYarnInstallComma
|
|
|
41
41
|
var getYarnInstallCommand = function (context, options) {
|
|
42
42
|
var _a;
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
45
|
+
return "yarn install --frozen-lockfile ".concat((options === null || options === void 0 ? void 0 : options.prodOnly) ? "--production" : "", " ").concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "--ignore-scripts" : "");
|
|
46
|
+
} // is modern
|
|
47
|
+
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
48
|
+
// trying to import those fail on this version
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
52
|
+
var _a;
|
|
53
|
+
|
|
54
|
+
return (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.version.startsWith(v);
|
|
55
|
+
});
|
|
56
|
+
return (options === null || options === void 0 ? void 0 : options.prodOnly) ? "".concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "YARN_ENABLE_SCRIPTS=false " : "").concat(doesNotShipWithBuiltInPlugins ? "yarn plugin import workspace-tools && " : " ", "yarn workspaces focus --production") // needs yarn plugin import workspace-tools
|
|
45
57
|
: "".concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "YARN_ENABLE_SCRIPTS=false " : "", "yarn install --immutable");
|
|
46
58
|
};
|
|
47
59
|
|
package/dist/build/types.d.ts
CHANGED
|
@@ -59,12 +59,22 @@ export declare type BuildConfigNodeStatic = BuildConfigNodeBase & {
|
|
|
59
59
|
};
|
|
60
60
|
export declare type BuildConfigMeteor = BuildConfigNodeBase & {
|
|
61
61
|
type: "meteor";
|
|
62
|
+
/**
|
|
63
|
+
* whether to run yarn install inside the source folder in the docker image.
|
|
64
|
+
* This is only required if you have custom scripts in your image
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
installScripts?: boolean;
|
|
62
68
|
};
|
|
63
69
|
export declare type BuildConfigStorybook = BuildConfigNodeBase & {
|
|
64
70
|
type: "storybook";
|
|
65
71
|
startCommand?: never;
|
|
66
72
|
};
|
|
67
73
|
export declare type BuildConfig = BuildConfigNode | BuildConfigNodeStatic | BuildConfigStorybook | BuildConfigMeteor;
|
|
74
|
+
export declare type BuildConfigType = BuildConfig["type"];
|
|
75
|
+
export declare type BuildConfigGeneric<T extends BuildConfigType> = Extract<BuildConfig, {
|
|
76
|
+
type: T;
|
|
77
|
+
}>;
|
|
68
78
|
export declare const isOfBuildType: <T extends ("node" | "node-static" | "meteor" | "storybook")[]>(t: BuildConfig, ...types: T) => t is Extract<BuildConfigNode, {
|
|
69
79
|
type: T[number];
|
|
70
80
|
}> | Extract<BuildConfigNodeStatic, {
|