@catladder/pipeline 1.138.1 → 1.139.1

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.
@@ -0,0 +1,25 @@
1
+ import type { Config } from "../src";
2
+ import { createAllPipelines } from "./__utils__/helpers";
3
+ const config: Config = {
4
+ appName: "test-app",
5
+ customerName: "pan",
6
+ components: {
7
+ api: {
8
+ dotEnv: "local", // creates .env file only locally, not during build
9
+ envDTs: true, // creates type files based on env vars, so that process.env is typed
10
+ dir: "api",
11
+ build: {
12
+ type: "node",
13
+ },
14
+ deploy: {
15
+ type: "google-cloudrun",
16
+ projectId: "google-project-id",
17
+ region: "europe-west6",
18
+ },
19
+ },
20
+ },
21
+ };
22
+
23
+ it("matches snapshot", async () => {
24
+ expect(await createAllPipelines(config)).toMatchSnapshot();
25
+ });
package/package.json CHANGED
@@ -52,7 +52,7 @@
52
52
  }
53
53
  ],
54
54
  "license": "MIT",
55
- "version": "1.138.1",
55
+ "version": "1.139.1",
56
56
  "scripts": {
57
57
  "build:tsc": "yarn tsc",
58
58
  "build": "yarn build:compile && yarn build:inline-variables && yarn build:bundle",
@@ -34,7 +34,9 @@ export const createAppBuildJob = (
34
34
  },
35
35
 
36
36
  script: [
37
- ...(context.componentConfig.dotEnv ? writeDotEnv(context) : []),
37
+ ...(context.componentConfig.dotEnv === true // don't build when set to `local`
38
+ ? writeDotEnv(context)
39
+ : []),
38
40
  ...writeBuildInfo(context),
39
41
  ...ensureNodeVersion(context), // in pure node repos, we might want to have the nvmrc file in top-level
40
42
  `cd ${context.componentConfig.dir}`,
@@ -4,6 +4,7 @@ import type { DeployConfig } from "../deploy/types";
4
4
  import type { CatladderJob } from "./jobs";
5
5
  import type { Context } from "./context";
6
6
  import type { PartialDeep } from "./utils";
7
+ import { load } from "js-yaml";
7
8
  export type PipelineTrigger = "mainBranch" | "mr" | "taggedRelease";
8
9
 
9
10
  /**
@@ -146,13 +147,23 @@ export type ComponentConfig<C extends ConfigProps = never> = {
146
147
  customJobs?: CatladderJob[] | ((context: Context) => CatladderJob[]);
147
148
 
148
149
  /**
149
- * experimental. whether to create a .env localy and during build jobs
150
+ * whether to create a .env
150
151
  *
151
152
  * Be careful, this will overwrite any existing .env file!
153
+ *
154
+ * if set to true it will create .env locally and during build.
155
+ * Be careful: the .env file usually ends up in the build artifacts.
156
+ * Use this for apps and clients where env does not contain any secrets
157
+ *
158
+ *
159
+ * if set to "local" it will only create .env file locally.
160
+ * Use this in combination with @dotenvx/dotenvx or node 20 to start apps locally with .env files
161
+ * During build and runtime, it relies on the env vars set in the environment
162
+ *
152
163
  */
153
- dotEnv?: boolean;
164
+ dotEnv?: boolean | "local";
154
165
  /**
155
- * experimental. whether to create a env.d.ts localy and during build jobs
166
+ * whether to create a env.d.ts localy and during build jobs
156
167
  *
157
168
  * Be careful, this will overwrite any existing env.d.ts file!
158
169
  */