@catladder/pipeline 4.2.0 → 4.2.2

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 (39) hide show
  1. package/dist/bash/bashEscape.js +1 -1
  2. package/dist/bash/getInjectVarsScript.js +2 -2
  3. package/dist/build/artifacts/createBuildJobArtifact.js +2 -2
  4. package/dist/build/base/createAppBuildJob.js +2 -2
  5. package/dist/build/base/writeDotEnv.js +2 -2
  6. package/dist/build/docker.js +2 -2
  7. package/dist/build/node/cache.js +2 -2
  8. package/dist/config/readConfig.js +6 -7
  9. package/dist/constants.js +1 -1
  10. package/dist/context/createComponentContext.js +2 -2
  11. package/dist/context/createWorkspaceContext.js +2 -2
  12. package/dist/context/getEnvConfig.js +3 -3
  13. package/dist/context/utils/envVars.js +2 -2
  14. package/dist/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +2 -2
  15. package/dist/deploy/cloudRun/utils/createArgsString.js +2 -2
  16. package/dist/deploy/kubernetes/kubeValues.js +2 -2
  17. package/dist/deploy/kubernetes/mongodb.js +2 -2
  18. package/dist/pipeline/gitlab/createGitlabJobs.js +7 -7
  19. package/dist/tsconfig.tsbuildinfo +1 -1
  20. package/dist/utils/index.js +3 -3
  21. package/examples/rails-k8s-with-worker-dockerfile.test.ts +1 -1
  22. package/package.json +5 -7
  23. package/src/bash/getInjectVarsScript.ts +1 -1
  24. package/src/build/artifacts/createBuildJobArtifact.ts +1 -1
  25. package/src/build/base/createAppBuildJob.ts +1 -1
  26. package/src/build/base/writeDotEnv.ts +1 -1
  27. package/src/build/docker.ts +1 -1
  28. package/src/build/node/cache.ts +1 -1
  29. package/src/config/readConfig.ts +7 -12
  30. package/src/context/createComponentContext.ts +1 -1
  31. package/src/context/createWorkspaceContext.ts +1 -1
  32. package/src/context/getEnvConfig.ts +1 -1
  33. package/src/context/utils/envVars.ts +1 -1
  34. package/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.ts +1 -1
  35. package/src/deploy/cloudRun/utils/createArgsString.ts +1 -1
  36. package/src/deploy/kubernetes/kubeValues.ts +1 -1
  37. package/src/deploy/kubernetes/mongodb.ts +1 -1
  38. package/src/pipeline/gitlab/createGitlabJobs.ts +1 -1
  39. package/src/utils/index.ts +1 -1
@@ -35,13 +35,13 @@ Object.defineProperty(exports, "__esModule", {
35
35
  value: true
36
36
  });
37
37
  exports.mergeWithMergingArrays = exports.ensureArray = exports.ensureArrayOrNull = exports.notNil = void 0;
38
- var lodash_1 = require("lodash");
38
+ var lodash_es_1 = require("lodash-es");
39
39
  function notNil(value) {
40
40
  return value !== null && value !== undefined;
41
41
  }
42
42
  exports.notNil = notNil;
43
43
  var ensureArrayOrNull = function (s) {
44
- return (0, lodash_1.isNil)(s) ? null : Array.isArray(s) ? s : [s];
44
+ return (0, lodash_es_1.isNil)(s) ? null : Array.isArray(s) ? s : [s];
45
45
  };
46
46
  exports.ensureArrayOrNull = ensureArrayOrNull;
47
47
  var ensureArray = function (s) {
@@ -51,7 +51,7 @@ var ensureArray = function (s) {
51
51
  exports.ensureArray = ensureArray;
52
52
  // see https://github.com/lodash/lodash/issues/5384
53
53
  var mergeWithMergingArrays = function (obj1, obj2) {
54
- return (0, lodash_1.mergeWith)({}, obj1, obj2, function (prop1, prop2) {
54
+ return (0, lodash_es_1.mergeWith)({}, obj1, obj2, function (prop1, prop2) {
55
55
  return Array.isArray(prop1) && Array.isArray(prop2) ? __spreadArray(__spreadArray([], __read(prop1), false), __read(prop2), false) : undefined;
56
56
  });
57
57
  };
@@ -1,7 +1,7 @@
1
1
  import { mkdir, rm, writeFile } from "fs/promises";
2
2
  import { createYamlLocalPipeline } from "./__utils__/helpers";
3
3
  import config from "./rails-k8s-with-worker";
4
- import { merge } from "lodash";
4
+ import { merge } from "lodash-es";
5
5
  import { join } from "path";
6
6
 
7
7
  it("matches snapshot with a Dockerfile", async () => {
package/package.json CHANGED
@@ -53,7 +53,7 @@
53
53
  }
54
54
  ],
55
55
  "license": "MIT",
56
- "version": "4.2.0",
56
+ "version": "4.2.2",
57
57
  "scripts": {
58
58
  "build:tsc": "yarn tsc",
59
59
  "build": "yarn build:compile && yarn build:inline-variables",
@@ -63,7 +63,7 @@
63
63
  "lint": "eslint \"src/**/*.ts\"",
64
64
  "lint:fix": "eslint \"src/**/*.ts\" --fix",
65
65
  "generate:gitlab-ci-yml-types": "ts-node ./scripts/generate-gitlab-ci-types.ts",
66
- "generate:examples-test": "tsx scripts/generate-examples-test.ts"
66
+ "generate:examples-test": "jiti scripts/generate-examples-test.ts"
67
67
  },
68
68
  "types": "dist/index.d.ts",
69
69
  "main": "dist/index.js",
@@ -74,20 +74,18 @@
74
74
  "@babel/plugin-syntax-typescript": "^7.25.4",
75
75
  "@babel/preset-typescript": "^7.24.7",
76
76
  "@types/child-process-promise": "^2.2.6",
77
- "@types/lodash": "^4.17.7",
77
+ "@types/lodash-es": "^4.17.12",
78
78
  "@types/node": "^22.5.1",
79
79
  "babel-plugin-transform-inline-environment-variables": "^0.4.3",
80
80
  "child-process-promise": "^2.2.1",
81
81
  "glob": "^11.0.0",
82
+ "jiti": "^2",
82
83
  "json-schema-to-typescript": "^13.0.2",
83
- "lodash": "^4.17.21",
84
+ "lodash-es": "^4.18.1",
84
85
  "memoizee": "^0.4.17",
85
86
  "path-equal": "1.2.5",
86
87
  "slugify": "^1.6.6",
87
88
  "typescript": "^5.4.5",
88
89
  "yaml": "^2.5.0"
89
- },
90
- "dependencies": {
91
- "tsx": "^4.21.0"
92
90
  }
93
91
  }
@@ -1,5 +1,5 @@
1
1
  import type { UnspecifiedEnvVars } from "../types";
2
- import { isNil } from "lodash";
2
+ import { isNil } from "lodash-es";
3
3
  import { bashEscape } from "./bashEscape";
4
4
 
5
5
  export const getInjectVarsScript = (vars?: UnspecifiedEnvVars) => {
@@ -5,7 +5,7 @@ import {
5
5
  type Context,
6
6
  } from "../../types";
7
7
  import type { CatladderJob } from "../../types/jobs";
8
- import { uniq } from "lodash";
8
+ import { uniq } from "lodash-es";
9
9
  import { componentContextNeedsBuildTimeDotEnv } from "../base/writeDotEnv";
10
10
 
11
11
  const uniqueAndAlphabeticalSort = (arr: string[]): string[] => {
@@ -1,4 +1,4 @@
1
- import { merge } from "lodash";
1
+ import { merge } from "lodash-es";
2
2
  import type {
3
3
  BuildContextStandalone,
4
4
  ComponentContext,
@@ -1,4 +1,4 @@
1
- import { isNil } from "lodash";
1
+ import { isNil } from "lodash-es";
2
2
  import { escapeForDotEnv } from "../../bash/bashEscape";
3
3
  import { ALL_BUILD_VARIABLES } from "../../context/getBuildInfoVariables";
4
4
  import type { ComponentContext } from "../../types";
@@ -1,5 +1,5 @@
1
1
  import { existsSync } from "fs";
2
- import { merge } from "lodash";
2
+ import { merge } from "lodash-es";
3
3
  import path from "path";
4
4
  import type { BuildConfig, BuildConfigDocker } from ".";
5
5
  import { isOfDeployType } from "../deploy";
@@ -1,4 +1,4 @@
1
- import { uniq } from "lodash";
1
+ import { uniq } from "lodash-es";
2
2
  import { join } from "path";
3
3
  import slugify from "slugify";
4
4
 
@@ -1,13 +1,9 @@
1
1
  import { existsSync, readFileSync } from "fs";
2
-
3
- // eslint-disable-next-line @typescript-eslint/no-require-imports
4
- const tsx = require("tsx/cjs/api");
2
+ import { createJiti } from "jiti";
5
3
 
6
4
  import { parse } from "yaml";
7
5
  import type { Config } from "../types";
8
6
 
9
- // allows us to load ts files
10
-
11
7
  const fullPath = (directory: string, ext: string) =>
12
8
  directory + "/catladder." + ext;
13
9
 
@@ -21,14 +17,14 @@ const readConfigInternal = async (
21
17
  if (found) {
22
18
  const filePath = fullPath(directory, found);
23
19
  if (found === "ts" || found === "js") {
24
- const result = await tsx.require(filePath, directory);
20
+ const jiti = createJiti(directory);
21
+ const result = await jiti.import(filePath);
25
22
 
26
- // weird: if target project is esm, result is under result.default, but if its commonjs, its under result.default.default
27
- const config = result.default.default || result.default;
23
+ const config = (result as any).default || result;
28
24
  return {
29
25
  path: filePath,
30
26
  ext: found,
31
- config,
27
+ config: config as Config,
32
28
  };
33
29
  } else {
34
30
  return {
@@ -51,9 +47,8 @@ export const readConfig = async (
51
47
  console.error(`
52
48
  This may happen due to various reasons:
53
49
  - Syntax errors in your catladder.ts file
54
- - tsx (the TypeScript loader used by catladder) needs to understand the syntax in your project.
55
- If your project uses newer TypeScript/JavaScript syntax, you may need to update catladder
56
- to get a newer version of tsx that supports it.
50
+ - The TypeScript loader (jiti) used by catladder needs to understand the syntax in your project.
51
+ If your project uses newer TypeScript/JavaScript syntax, you may need to update catladder.
57
52
  - Missing or incorrect dependencies in your project
58
53
  - TypeScript configuration issues in your tsconfig.json
59
54
  `);
@@ -1,4 +1,4 @@
1
- import { isFunction } from "lodash";
1
+ import { isFunction } from "lodash-es";
2
2
  import { BUILD_TYPES, isStandaloneBuildConfig } from "../build";
3
3
  import type { BuildConfig } from "../build/types";
4
4
  import { DEPLOY_TYPES } from "../deploy";
@@ -7,7 +7,7 @@ import {
7
7
  } from "..";
8
8
  import { getPackageManagerInfoBase } from "../pipeline/packageManager";
9
9
  import { mergeWithMergingArrays } from "../utils";
10
- import { uniq } from "lodash";
10
+ import { uniq } from "lodash-es";
11
11
 
12
12
  export async function createWorkspaceContext({
13
13
  env,
@@ -1,4 +1,4 @@
1
- import { cloneDeep, mergeWith } from "lodash";
1
+ import { cloneDeep, mergeWith } from "lodash-es";
2
2
  import type { Config, EnvConfigWithComponent } from "../types/config";
3
3
 
4
4
  export const getEnvConfig = (
@@ -1,4 +1,4 @@
1
- import { isObject } from "lodash";
1
+ import { isObject } from "lodash-es";
2
2
  import type { SecretEnvVar } from "../getEnvironmentVariables";
3
3
  import { getSecretVarName } from "../getEnvironmentVariables";
4
4
  import { getBashVariable } from "../../bash/BashExpression";
@@ -1,4 +1,4 @@
1
- import { omit } from "lodash";
1
+ import { omit } from "lodash-es";
2
2
  import type { ComponentContext } from "../../../types/context";
3
3
  import { collapseableSection } from "../../../utils/gitlab";
4
4
 
@@ -1,4 +1,4 @@
1
- import { isNil } from "lodash";
1
+ import { isNil } from "lodash-es";
2
2
  import type { BashExpression } from "../../../bash/BashExpression";
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { merge } from "lodash";
1
+ import { merge } from "lodash-es";
2
2
 
3
3
  import type {
4
4
  BuildContextComponent,
@@ -1,4 +1,4 @@
1
- import { range } from "lodash";
1
+ import { range } from "lodash-es";
2
2
  import { getSecretVarNameForContext } from "../../context/getEnvironmentVariables";
3
3
  import type { ComponentContext } from "../../types/context";
4
4
  import { isOfDeployType } from "../types";
@@ -1,4 +1,4 @@
1
- import { isEmpty, isObject, merge } from "lodash";
1
+ import { isEmpty, isObject, merge } from "lodash-es";
2
2
  import { getInjectVarsScript } from "../../bash/getInjectVarsScript";
3
3
  import { BASE_RETRY } from "../../defaults";
4
4
  import type {
@@ -1,4 +1,4 @@
1
- import { isNil, mergeWith } from "lodash";
1
+ import { isNil, mergeWith } from "lodash-es";
2
2
 
3
3
  export function notNil<TValue>(
4
4
  value: TValue | null | undefined,