@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.
Files changed (169) hide show
  1. package/bin/catladder-gitlab.js +1 -1
  2. package/dist/build/base/createBuildJob.d.ts +2 -2
  3. package/dist/build/base/getBuildInfo.d.ts +1 -1
  4. package/dist/build/docker.d.ts +30 -3
  5. package/dist/build/docker.js +29 -13
  6. package/dist/build/index.d.ts +6 -5
  7. package/dist/build/node/buildJob.d.ts +2 -2
  8. package/dist/build/node/cache.d.ts +2 -2
  9. package/dist/build/node/index.d.ts +1 -1
  10. package/dist/build/node/meteor.d.ts +1 -1
  11. package/dist/build/node/meteor.js +6 -0
  12. package/dist/build/node/testJob.d.ts +2 -2
  13. package/dist/build/node/yarn.d.ts +1 -1
  14. package/dist/build/node/yarn.js +13 -1
  15. package/dist/build/types.d.ts +10 -0
  16. package/dist/bundles/catladder-gitlab/index.js +32457 -0
  17. package/dist/catladder-gitlab.js +1 -2
  18. package/dist/config/configruedEnvs.d.ts +1 -1
  19. package/dist/config/readConfig.d.ts +1 -1
  20. package/dist/constants.js +1 -1
  21. package/dist/context/getEnvConfig.d.ts +9 -0
  22. package/dist/context/getEnvConfig.js +26 -0
  23. package/dist/context/getEnvType.d.ts +4 -0
  24. package/dist/context/getEnvType.js +18 -0
  25. package/dist/context/getEnvironment.d.ts +3 -0
  26. package/dist/context/getEnvironment.js +187 -0
  27. package/dist/context/getEnvironmentContext.d.ts +4 -0
  28. package/dist/context/getEnvironmentContext.js +36 -0
  29. package/dist/context/getEnvironmentVariables.d.ts +10 -0
  30. package/dist/context/getEnvironmentVariables.js +322 -0
  31. package/dist/context/getLabels.d.ts +8 -0
  32. package/dist/context/getLabels.js +49 -0
  33. package/dist/context/index.d.ts +5 -6
  34. package/dist/context/index.js +176 -186
  35. package/dist/context/resolveReferences.d.ts +1 -3
  36. package/dist/context/resolveReferences.js +275 -26
  37. package/dist/context/resolveReferences.test.js +332 -81
  38. package/dist/defaults/index.d.ts +1 -1
  39. package/dist/deploy/base.d.ts +2 -2
  40. package/dist/deploy/base.js +6 -19
  41. package/dist/deploy/cloudRun/deployJob.d.ts +3 -0
  42. package/dist/deploy/cloudRun/deployJob.js +139 -0
  43. package/dist/deploy/cloudRun/index.d.ts +9 -0
  44. package/dist/deploy/cloudRun/index.js +56 -0
  45. package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -0
  46. package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +14 -0
  47. package/dist/deploy/cloudSql/index.d.ts +8 -0
  48. package/dist/deploy/cloudSql/index.js +30 -0
  49. package/dist/deploy/custom/deployJob.d.ts +2 -2
  50. package/dist/deploy/custom/deployJob.js +4 -1
  51. package/dist/deploy/custom/index.d.ts +2 -1
  52. package/dist/deploy/custom/index.js +15 -18
  53. package/dist/deploy/dockerTag/deployJob.d.ts +3 -0
  54. package/dist/deploy/dockerTag/deployJob.js +33 -0
  55. package/dist/deploy/dockerTag/index.d.ts +2 -0
  56. package/dist/deploy/dockerTag/index.js +19 -0
  57. package/dist/deploy/index.d.ts +12 -8
  58. package/dist/deploy/index.js +27 -14
  59. package/dist/deploy/kubernetes/additionalSecretKeys.d.ts +4 -0
  60. package/dist/deploy/kubernetes/additionalSecretKeys.js +33 -0
  61. package/dist/deploy/kubernetes/cloudsql.d.ts +1 -1
  62. package/dist/deploy/kubernetes/deployJob.d.ts +2 -2
  63. package/dist/deploy/kubernetes/deployJob.js +6 -62
  64. package/dist/deploy/kubernetes/index.d.ts +2 -1
  65. package/dist/deploy/kubernetes/index.js +45 -16
  66. package/dist/deploy/kubernetes/kubeEnv.d.ts +10 -0
  67. package/dist/deploy/kubernetes/kubeEnv.js +90 -0
  68. package/dist/deploy/kubernetes/kubeValues.d.ts +90 -0
  69. package/dist/deploy/kubernetes/kubeValues.js +96 -0
  70. package/dist/deploy/kubernetes/mongodb.d.ts +18 -5
  71. package/dist/deploy/kubernetes/mongodb.js +118 -8
  72. package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +18 -11
  73. package/dist/deploy/types/base.d.ts +15 -0
  74. package/dist/deploy/types/base.js +3 -0
  75. package/dist/deploy/types/custom.d.ts +27 -0
  76. package/dist/deploy/types/custom.js +3 -0
  77. package/dist/deploy/types/dockerTag.d.ts +10 -0
  78. package/dist/deploy/types/dockerTag.js +3 -0
  79. package/dist/deploy/types/googleCloudRun.d.ts +39 -0
  80. package/dist/deploy/types/googleCloudRun.js +3 -0
  81. package/dist/deploy/types/index.d.ts +24 -0
  82. package/dist/deploy/types/index.js +41 -0
  83. package/dist/deploy/{types.d.ts → types/kubernetes.d.ts} +96 -32
  84. package/dist/deploy/types/kubernetes.js +3 -0
  85. package/dist/deploy/utils.d.ts +2 -2
  86. package/dist/deploy/utils.js +4 -0
  87. package/dist/pipeline/createChildPipeline.d.ts +2 -2
  88. package/dist/pipeline/createJobs.d.ts +2 -2
  89. package/dist/pipeline/createJobs.js +45 -17
  90. package/dist/pipeline/gitlab/makeGitlabJob.d.ts +2 -2
  91. package/dist/pipeline/packageManager.d.ts +1 -1
  92. package/dist/rules/index.d.ts +1 -1
  93. package/dist/runner/index.d.ts +2 -3
  94. package/dist/tsconfig.tsbuildinfo +1 -1
  95. package/dist/types/config.d.ts +7 -6
  96. package/dist/types/config.js +1 -1
  97. package/dist/types/context.d.ts +10 -2
  98. package/dist/types/environmentContext.d.ts +22 -0
  99. package/dist/types/environmentContext.js +3 -0
  100. package/dist/types/jobs.d.ts +1 -1
  101. package/dist/types/pipeline.d.ts +1 -1
  102. package/package.json +14 -10
  103. package/scripts/bundle +2 -0
  104. package/src/build/base/createBuildJob.ts +3 -2
  105. package/src/build/base/getBuildInfo.ts +1 -1
  106. package/src/build/docker.ts +28 -17
  107. package/src/build/index.ts +8 -5
  108. package/src/build/node/buildJob.ts +2 -2
  109. package/src/build/node/cache.ts +2 -2
  110. package/src/build/node/index.ts +1 -1
  111. package/src/build/node/meteor.ts +8 -2
  112. package/src/build/node/testJob.ts +2 -2
  113. package/src/build/node/yarn.ts +21 -10
  114. package/src/build/tests/storybook.test.ts +1 -1
  115. package/src/build/types.ts +13 -1
  116. package/src/catladder-gitlab.ts +4 -2
  117. package/src/config/configruedEnvs.test.ts +2 -2
  118. package/src/config/configruedEnvs.ts +5 -4
  119. package/src/config/readConfig.ts +1 -1
  120. package/src/context/getEnvConfig.ts +21 -0
  121. package/src/context/getEnvType.ts +17 -0
  122. package/src/context/getEnvironment.ts +40 -0
  123. package/src/context/getEnvironmentContext.ts +57 -0
  124. package/src/context/getEnvironmentVariables.ts +152 -0
  125. package/src/context/getLabels.ts +20 -0
  126. package/src/context/index.ts +25 -198
  127. package/src/context/resolveReferences.test.ts +15 -15
  128. package/src/context/resolveReferences.ts +37 -30
  129. package/src/defaults/index.ts +1 -1
  130. package/src/deploy/base.ts +11 -23
  131. package/src/deploy/cloudRun/deployJob.ts +104 -0
  132. package/src/deploy/cloudRun/index.ts +48 -0
  133. package/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.ts +14 -0
  134. package/src/deploy/cloudSql/index.ts +16 -0
  135. package/src/deploy/custom/deployJob.ts +10 -3
  136. package/src/deploy/custom/index.ts +9 -1
  137. package/src/deploy/dockerTag/deployJob.ts +31 -0
  138. package/src/deploy/dockerTag/index.ts +9 -0
  139. package/src/deploy/index.ts +26 -17
  140. package/src/deploy/kubernetes/additionalSecretKeys.ts +23 -0
  141. package/src/deploy/kubernetes/cloudsql.ts +2 -1
  142. package/src/deploy/kubernetes/deployJob.ts +5 -72
  143. package/src/deploy/kubernetes/index.ts +42 -1
  144. package/src/deploy/kubernetes/kubeEnv.ts +48 -0
  145. package/src/deploy/kubernetes/kubeValues.ts +82 -0
  146. package/src/deploy/kubernetes/mongodb.ts +104 -7
  147. package/src/deploy/kubernetes/processSecretsAsFiles.ts +1 -1
  148. package/src/deploy/types/base.ts +17 -0
  149. package/src/deploy/types/custom.ts +24 -0
  150. package/src/deploy/types/dockerTag.ts +12 -0
  151. package/src/deploy/types/googleCloudRun.ts +79 -0
  152. package/src/deploy/types/index.ts +28 -0
  153. package/src/deploy/types/kubernetes.ts +281 -0
  154. package/src/deploy/utils.ts +6 -2
  155. package/src/pipeline/createChildPipeline.test.ts +1 -1
  156. package/src/pipeline/createChildPipeline.ts +2 -2
  157. package/src/pipeline/createJobs.ts +8 -8
  158. package/src/pipeline/gitlab/makeGitlabJob.ts +2 -2
  159. package/src/pipeline/packageManager.ts +1 -1
  160. package/src/rules/index.ts +1 -1
  161. package/src/runner/index.ts +2 -1
  162. package/src/types/config.ts +8 -6
  163. package/src/types/context.ts +14 -2
  164. package/src/types/environmentContext.ts +26 -0
  165. package/src/types/jobs.ts +1 -1
  166. package/src/types/pipeline.ts +1 -1
  167. package/tsconfig.json +2 -0
  168. package/dist/deploy/types.js +0 -16
  169. package/src/deploy/types.ts +0 -215
@@ -1,3 +1,3 @@
1
1
  #! /usr/bin/env node
2
2
 
3
- require("../dist/catladder-gitlab.js");
3
+ require("../dist/bundles/catladder-gitlab/index.js");
@@ -1,5 +1,5 @@
1
- import { Context } from "../..";
2
- import { CatladderJob } from "../../types/jobs";
1
+ import type { Context } from "../..";
2
+ import type { CatladderJob } from "../../types/jobs";
3
3
  export declare const createBuildJob: (context: Context, {
4
4
  script,
5
5
  variables,
@@ -1,2 +1,2 @@
1
- import { Context } from "../../types";
1
+ import type { Context } from "../../types";
2
2
  export declare const getBuildInfo: (context: Context) => string[];
@@ -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
@@ -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 createDockerBuildJobBase = function (context, _a) {
127
- var script = _a.script,
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: __assign(__assign({}, (0, exports.getDockerBuildVariables)(context)), variables !== null && variables !== void 0 ? 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 login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY", "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)
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
 
@@ -1,11 +1,12 @@
1
- import { Context } from "../types/context";
2
- import { CatladderJob } from "../types/jobs";
3
- import { BuildConfig } from "./types";
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 BuildConfig["type"]]: {
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[];
@@ -1,3 +1,3 @@
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 createMeteorBuildJobs: (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[];
@@ -1,4 +1,4 @@
1
- import { Context } from "../../types";
1
+ import type { Context } from "../../types";
2
2
  export declare const getYarnInstallCommand: (context: Context, options?: {
3
3
  prodOnly?: boolean | undefined;
4
4
  noScripts?: boolean | undefined;
@@ -41,7 +41,19 @@ exports.getYarnInstall = exports.ensureNodeVersion = exports.getYarnInstallComma
41
41
  var getYarnInstallCommand = function (context, options) {
42
42
  var _a;
43
43
 
44
- return ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) ? "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" : "") : (options === null || options === void 0 ? void 0 : options.prodOnly) ? "".concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "YARN_ENABLE_SCRIPTS=false " : "", "yarn plugin import workspace-tools && yarn workspaces focus --production") // needs yarn plugin import workspace-tools
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
 
@@ -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, {