@catladder/cli 0.0.0-main-4abb0711 → 0.0.0-main-ed835115
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/bundles/catenv/index.js +13 -2
- package/dist/bundles/cli/index.js +13 -2
- package/dist/pipeline/src/build/node/yarn.d.ts +2 -1
- package/dist/pipeline/src/build/node/yarn.js +13 -2
- package/dist/pipeline/src/build/node/yarn.js.map +1 -1
- package/dist/pipeline/src/build/types.d.ts +11 -0
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/pipeline/src/pipeline/yarn/yarnUtils.d.ts +0 -5
- package/dist/pipeline/src/pipeline/yarn/yarnUtils.js +0 -51
- package/dist/pipeline/src/pipeline/yarn/yarnUtils.js.map +0 -1
|
@@ -2383,8 +2383,9 @@ const BashExpression_1 = __nccwpck_require__(2376);
|
|
|
2383
2383
|
const utils_1 = __nccwpck_require__(2497);
|
|
2384
2384
|
const gitlab_1 = __nccwpck_require__(8490);
|
|
2385
2385
|
const YARN_INSTALL_CLASSIC = `yarn install --frozen-lockfile`;
|
|
2386
|
+
const YARN_BERRY_PROD_INSTALL = `yarn workspaces focus --production`;
|
|
2386
2387
|
// FIXME: check why and when rebuild is needed
|
|
2387
|
-
const YARN_BERRY_PROD_REBUILD = `yarn
|
|
2388
|
+
const YARN_BERRY_PROD_REBUILD = `yarn rebuild`;
|
|
2388
2389
|
const getYarnInstallCommand = (context) => {
|
|
2389
2390
|
if (context.packageManagerInfo.isClassic) {
|
|
2390
2391
|
return YARN_INSTALL_CLASSIC;
|
|
@@ -2414,6 +2415,7 @@ const getYarnInstall = (context, options) => {
|
|
|
2414
2415
|
exports.getYarnInstall = getYarnInstall;
|
|
2415
2416
|
const DOCKER_COPY_FILES = `COPY --chown=node:node $APP_DIR .`;
|
|
2416
2417
|
const getDockerAppCopyAndBuildScript = (context) => {
|
|
2418
|
+
var _a, _b, _c;
|
|
2417
2419
|
if (context.packageManagerInfo.isClassic) {
|
|
2418
2420
|
return new BashExpression_1.BashExpression(`
|
|
2419
2421
|
RUN ${YARN_INSTALL_CLASSIC} --production --ignore-scripts
|
|
@@ -2421,6 +2423,14 @@ ${DOCKER_COPY_FILES}
|
|
|
2421
2423
|
RUN ${YARN_INSTALL_CLASSIC} --production
|
|
2422
2424
|
`.trim());
|
|
2423
2425
|
}
|
|
2426
|
+
const yarnRebuildEnabledDefault = context.build.type === "fromWorkspace"
|
|
2427
|
+
? ((_b = (_a = context.build.workspaceBuildConfig.dockerDefaults) === null || _a === void 0 ? void 0 : _a.yarnRebuildEnabled) !== null && _b !== void 0 ? _b : true)
|
|
2428
|
+
: true;
|
|
2429
|
+
const yarnRebuildEnabled = "docker" in context.build.config &&
|
|
2430
|
+
context.build.config.docker &&
|
|
2431
|
+
"yarnRebuildEnabled" in context.build.config.docker
|
|
2432
|
+
? ((_c = context.build.config.docker.yarnRebuildEnabled) !== null && _c !== void 0 ? _c : yarnRebuildEnabledDefault)
|
|
2433
|
+
: yarnRebuildEnabledDefault;
|
|
2424
2434
|
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
2425
2435
|
// trying to import those fail on this version
|
|
2426
2436
|
const doesNotShipWithBuiltInPlugins = ["2", "3"].some((v) => context.packageManagerInfo.version.startsWith(v));
|
|
@@ -2433,7 +2443,8 @@ RUN ${YARN_INSTALL_CLASSIC} --production
|
|
|
2433
2443
|
ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
2434
2444
|
${DOCKER_COPY_FILES}
|
|
2435
2445
|
${maybeAddWorkspaceToolsCommand}
|
|
2436
|
-
RUN ${
|
|
2446
|
+
RUN ${YARN_BERRY_PROD_INSTALL}
|
|
2447
|
+
${yarnRebuildEnabled ? `RUN ${YARN_BERRY_PROD_REBUILD}` : ""}
|
|
2437
2448
|
|
|
2438
2449
|
`.trim());
|
|
2439
2450
|
};
|
|
@@ -5635,8 +5635,9 @@ const BashExpression_1 = __nccwpck_require__(42376);
|
|
|
5635
5635
|
const utils_1 = __nccwpck_require__(32497);
|
|
5636
5636
|
const gitlab_1 = __nccwpck_require__(38490);
|
|
5637
5637
|
const YARN_INSTALL_CLASSIC = `yarn install --frozen-lockfile`;
|
|
5638
|
+
const YARN_BERRY_PROD_INSTALL = `yarn workspaces focus --production`;
|
|
5638
5639
|
// FIXME: check why and when rebuild is needed
|
|
5639
|
-
const YARN_BERRY_PROD_REBUILD = `yarn
|
|
5640
|
+
const YARN_BERRY_PROD_REBUILD = `yarn rebuild`;
|
|
5640
5641
|
const getYarnInstallCommand = (context) => {
|
|
5641
5642
|
if (context.packageManagerInfo.isClassic) {
|
|
5642
5643
|
return YARN_INSTALL_CLASSIC;
|
|
@@ -5666,6 +5667,7 @@ const getYarnInstall = (context, options) => {
|
|
|
5666
5667
|
exports.getYarnInstall = getYarnInstall;
|
|
5667
5668
|
const DOCKER_COPY_FILES = `COPY --chown=node:node $APP_DIR .`;
|
|
5668
5669
|
const getDockerAppCopyAndBuildScript = (context) => {
|
|
5670
|
+
var _a, _b, _c;
|
|
5669
5671
|
if (context.packageManagerInfo.isClassic) {
|
|
5670
5672
|
return new BashExpression_1.BashExpression(`
|
|
5671
5673
|
RUN ${YARN_INSTALL_CLASSIC} --production --ignore-scripts
|
|
@@ -5673,6 +5675,14 @@ ${DOCKER_COPY_FILES}
|
|
|
5673
5675
|
RUN ${YARN_INSTALL_CLASSIC} --production
|
|
5674
5676
|
`.trim());
|
|
5675
5677
|
}
|
|
5678
|
+
const yarnRebuildEnabledDefault = context.build.type === "fromWorkspace"
|
|
5679
|
+
? ((_b = (_a = context.build.workspaceBuildConfig.dockerDefaults) === null || _a === void 0 ? void 0 : _a.yarnRebuildEnabled) !== null && _b !== void 0 ? _b : true)
|
|
5680
|
+
: true;
|
|
5681
|
+
const yarnRebuildEnabled = "docker" in context.build.config &&
|
|
5682
|
+
context.build.config.docker &&
|
|
5683
|
+
"yarnRebuildEnabled" in context.build.config.docker
|
|
5684
|
+
? ((_c = context.build.config.docker.yarnRebuildEnabled) !== null && _c !== void 0 ? _c : yarnRebuildEnabledDefault)
|
|
5685
|
+
: yarnRebuildEnabledDefault;
|
|
5676
5686
|
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
5677
5687
|
// trying to import those fail on this version
|
|
5678
5688
|
const doesNotShipWithBuiltInPlugins = ["2", "3"].some((v) => context.packageManagerInfo.version.startsWith(v));
|
|
@@ -5685,7 +5695,8 @@ RUN ${YARN_INSTALL_CLASSIC} --production
|
|
|
5685
5695
|
ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
5686
5696
|
${DOCKER_COPY_FILES}
|
|
5687
5697
|
${maybeAddWorkspaceToolsCommand}
|
|
5688
|
-
RUN ${
|
|
5698
|
+
RUN ${YARN_BERRY_PROD_INSTALL}
|
|
5699
|
+
${yarnRebuildEnabled ? `RUN ${YARN_BERRY_PROD_REBUILD}` : ""}
|
|
5689
5700
|
|
|
5690
5701
|
`.trim());
|
|
5691
5702
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BashExpression } from "../../bash/BashExpression";
|
|
2
|
+
import type { ComponentContextWithBuild } from "../../types";
|
|
2
3
|
import { type Context } from "../../types";
|
|
3
4
|
export declare const ensureNodeVersion: (context: Context) => string[];
|
|
4
5
|
export declare const getYarnInstall: (context: Context, options?: {
|
|
5
6
|
noCustomPostInstall: boolean;
|
|
6
7
|
}) => string[];
|
|
7
|
-
export declare const getDockerAppCopyAndBuildScript: (context:
|
|
8
|
+
export declare const getDockerAppCopyAndBuildScript: (context: ComponentContextWithBuild) => BashExpression;
|
|
@@ -5,8 +5,9 @@ const BashExpression_1 = require("../../bash/BashExpression");
|
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const gitlab_1 = require("../../utils/gitlab");
|
|
7
7
|
const YARN_INSTALL_CLASSIC = `yarn install --frozen-lockfile`;
|
|
8
|
+
const YARN_BERRY_PROD_INSTALL = `yarn workspaces focus --production`;
|
|
8
9
|
// FIXME: check why and when rebuild is needed
|
|
9
|
-
const YARN_BERRY_PROD_REBUILD = `yarn
|
|
10
|
+
const YARN_BERRY_PROD_REBUILD = `yarn rebuild`;
|
|
10
11
|
const getYarnInstallCommand = (context) => {
|
|
11
12
|
if (context.packageManagerInfo.isClassic) {
|
|
12
13
|
return YARN_INSTALL_CLASSIC;
|
|
@@ -36,6 +37,7 @@ const getYarnInstall = (context, options) => {
|
|
|
36
37
|
exports.getYarnInstall = getYarnInstall;
|
|
37
38
|
const DOCKER_COPY_FILES = `COPY --chown=node:node $APP_DIR .`;
|
|
38
39
|
const getDockerAppCopyAndBuildScript = (context) => {
|
|
40
|
+
var _a, _b, _c;
|
|
39
41
|
if (context.packageManagerInfo.isClassic) {
|
|
40
42
|
return new BashExpression_1.BashExpression(`
|
|
41
43
|
RUN ${YARN_INSTALL_CLASSIC} --production --ignore-scripts
|
|
@@ -43,6 +45,14 @@ ${DOCKER_COPY_FILES}
|
|
|
43
45
|
RUN ${YARN_INSTALL_CLASSIC} --production
|
|
44
46
|
`.trim());
|
|
45
47
|
}
|
|
48
|
+
const yarnRebuildEnabledDefault = context.build.type === "fromWorkspace"
|
|
49
|
+
? ((_b = (_a = context.build.workspaceBuildConfig.dockerDefaults) === null || _a === void 0 ? void 0 : _a.yarnRebuildEnabled) !== null && _b !== void 0 ? _b : true)
|
|
50
|
+
: true;
|
|
51
|
+
const yarnRebuildEnabled = "docker" in context.build.config &&
|
|
52
|
+
context.build.config.docker &&
|
|
53
|
+
"yarnRebuildEnabled" in context.build.config.docker
|
|
54
|
+
? ((_c = context.build.config.docker.yarnRebuildEnabled) !== null && _c !== void 0 ? _c : yarnRebuildEnabledDefault)
|
|
55
|
+
: yarnRebuildEnabledDefault;
|
|
46
56
|
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
47
57
|
// trying to import those fail on this version
|
|
48
58
|
const doesNotShipWithBuiltInPlugins = ["2", "3"].some((v) => context.packageManagerInfo.version.startsWith(v));
|
|
@@ -55,7 +65,8 @@ RUN ${YARN_INSTALL_CLASSIC} --production
|
|
|
55
65
|
ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
56
66
|
${DOCKER_COPY_FILES}
|
|
57
67
|
${maybeAddWorkspaceToolsCommand}
|
|
58
|
-
RUN ${
|
|
68
|
+
RUN ${YARN_BERRY_PROD_INSTALL}
|
|
69
|
+
${yarnRebuildEnabled ? `RUN ${YARN_BERRY_PROD_REBUILD}` : ""}
|
|
59
70
|
|
|
60
71
|
`.trim());
|
|
61
72
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../../../../../pipeline/src/build/node/yarn.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;
|
|
1
|
+
{"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../../../../../pipeline/src/build/node/yarn.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAG3D,uCAA0C;AAC1C,+CAAyD;AAEzD,MAAM,oBAAoB,GAAG,gCAAgC,CAAC;AAE9D,MAAM,uBAAuB,GAAG,oCAAoC,CAAC;AACrE,8CAA8C;AAC9C,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAE/C,MAAM,qBAAqB,GAAG,CAAC,OAAgB,EAAE,EAAE;IACjD,IAAI,OAAO,CAAC,kBAAkB,CAAC,SAAS,EAAE,CAAC;QACzC,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IACD,2GAA2G;IAC3G,OAAO,0CAA0C,CAAC;AACpD,CAAC,CAAC;AAEK,MAAM,iBAAiB,GAAG,CAAC,OAAgB,EAAE,EAAE,CACpD,IAAA,4BAAmB,EACjB,aAAa,EACb,qBAAqB,CACtB,CAAC;IACA,yDAAyD;IACzD,yEAAyE;CAC1E,CAAC,CAAC;AAPQ,QAAA,iBAAiB,qBAOzB;AAEE,MAAM,cAAc,GAAG,CAC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ACtB,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM;QAChC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM;QAC3B,oBAAoB,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM;QACjD,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,mCAC/C,yBAAyB,CAAC;QAC5B,CAAC,CAAC,yBAAyB,CAAC;IAEhC,wFAAwF;IACxF,8CAA8C;IAC9C,MAAM,6BAA6B,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAC1D,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CACjD,CAAC;IACF,MAAM,6BAA6B,GAAG,6BAA6B;QACjE,CAAC,CAAC,wCAAwC;QAC1C,CAAC,CAAC,EAAE,CAAC;IAEP,yCAAyC;IACzC,iGAAiG;IACjG,OAAO,IAAI,+BAAc,CACvB;;EAEF,iBAAiB;EACjB,6BAA6B;MACzB,uBAAuB;EAC3B,kBAAkB,CAAC,CAAC,CAAC,OAAO,uBAAuB,EAAE,CAAC,CAAC,CAAC,EAAE;;KAEvD,CAAC,IAAI,EAAE,CACT,CAAC;AACJ,CAAC,CAAC;AAhDW,QAAA,8BAA8B,kCAgDzC"}
|
|
@@ -168,6 +168,12 @@ type BuildConfigDockerWithAdditions = {
|
|
|
168
168
|
};
|
|
169
169
|
type BuildConfigDockerBuiltInNode = {
|
|
170
170
|
type: "node";
|
|
171
|
+
/**
|
|
172
|
+
* whether to run yarn rebuild after yarn install. Defaults to true.
|
|
173
|
+
*
|
|
174
|
+
* Future versions of catladder will default to false.
|
|
175
|
+
*/
|
|
176
|
+
yarnRebuildEnabled?: boolean;
|
|
171
177
|
} & BuildConfigDockerWithAdditions;
|
|
172
178
|
type BuildConfigDockerBuiltInMeteor = {
|
|
173
179
|
type: "meteor";
|
|
@@ -342,6 +348,11 @@ export type WorkspaceBuildConfigBase = {
|
|
|
342
348
|
export type WorkspaceBuildConfigNode = {
|
|
343
349
|
type: "node";
|
|
344
350
|
buildCommand?: string | string[];
|
|
351
|
+
/**
|
|
352
|
+
* set docker config defaults for the node build type.
|
|
353
|
+
* Currently not all options are supported.
|
|
354
|
+
*/
|
|
355
|
+
dockerDefaults?: Pick<BuildConfigDockerBuiltInNode, "yarnRebuildEnabled">;
|
|
345
356
|
} & WorkspaceBuildConfigBase;
|
|
346
357
|
export type WorkspaceBuildConfig = WorkspaceBuildConfigNode;
|
|
347
358
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../pipeline/src/build/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../pipeline/src/build/types.ts"],"names":[],"mappings":";;;AAqXO,MAAM,uBAAuB,GAAG,CACrC,CAAsB,EACM,EAAE;IAC9B,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;AACxB,CAAC,CAAC;AALW,QAAA,uBAAuB,2BAKlC;AAEK,MAAM,aAAa,GAAG,CAC3B,CAAc,EACd,GAAG,KAAQ,EACqC,EAAE;IAClD,IAAI,CAAC,IAAA,+BAAuB,EAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB"}
|