hazo_env 0.14.2 → 0.15.0
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/CHANGE_LOG.md +14 -0
- package/dist/cli.js +6 -0
- package/dist/deploy/init.d.ts +2 -0
- package/dist/deploy/init.d.ts.map +1 -1
- package/dist/deploy/init.js +15 -1
- package/dist/deploy/types.d.ts +6 -0
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/resolve/deploy.d.ts.map +1 -1
- package/dist/resolve/deploy.js +10 -0
- package/package.json +1 -1
package/CHANGE_LOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# hazo_env — Change Log
|
|
2
2
|
|
|
3
|
+
## 0.15.0 — 2026-11-23
|
|
4
|
+
|
|
5
|
+
New: `deploy init` now copies gitignored env files (`.env.local`,
|
|
6
|
+
`.env.production`, etc.) from the live directory to the freshly-cloned peer.
|
|
7
|
+
|
|
8
|
+
- **`env_files`** config field (`[deploy]` section): comma-separated list of
|
|
9
|
+
files to copy. Default: `.env.local`. Kinstripe sets
|
|
10
|
+
`env_files = .env.local, .env.production`.
|
|
11
|
+
- **`RunInitResult`**: gains `envFilesCopied` and `envFilesMissing` arrays.
|
|
12
|
+
- **CLI**: `deploy init` output now reports which env files were copied and
|
|
13
|
+
warns about any that were listed but not found.
|
|
14
|
+
|
|
15
|
+
Also includes the 0.14.1/0.14.2 fix (resolvePeerDir configSuffix).
|
|
16
|
+
|
|
3
17
|
## 0.14.2 — 2026-11-23
|
|
4
18
|
|
|
5
19
|
Republish of 0.14.1 — the 0.14.1 tarball was published with a stale dist/
|
package/dist/cli.js
CHANGED
|
@@ -275,6 +275,12 @@ async function runDeployInit() {
|
|
|
275
275
|
const result = runInit(config, nodeCommandRunner);
|
|
276
276
|
console.log(` ${pc.green('✓')} Peer directory created: ${result.peerDir}`);
|
|
277
277
|
console.log(` ${pc.dim(`cloned from ${result.originUrl}`)}`);
|
|
278
|
+
if (result.envFilesCopied.length) {
|
|
279
|
+
console.log(` ${pc.green('✓')} Env files copied: ${result.envFilesCopied.join(', ')}`);
|
|
280
|
+
}
|
|
281
|
+
if (result.envFilesMissing.length) {
|
|
282
|
+
console.log(` ${pc.yellow('⚠')} Env files not found (copy manually): ${result.envFilesMissing.join(', ')}`);
|
|
283
|
+
}
|
|
278
284
|
console.log('');
|
|
279
285
|
console.log(` Next steps:`);
|
|
280
286
|
console.log(` cd ${result.peerDir}`);
|
package/dist/deploy/init.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/deploy/init.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAe,MAAM,YAAY,CAAC;AAgD3E,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/deploy/init.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAe,MAAM,YAAY,CAAC;AAgD3E,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AA0CD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,GAAE,cAAmB,GAAG,aAAa,CA8C7G"}
|
package/dist/deploy/init.js
CHANGED
|
@@ -119,6 +119,20 @@ export function runInit(config, runner, opts = {}) {
|
|
|
119
119
|
fs.mkdirSync(path.dirname(peerIniPath), { recursive: true });
|
|
120
120
|
fs.writeFileSync(peerIniPath, swappedIni, 'utf-8');
|
|
121
121
|
ensurePeerDataDir(config, peerIniPath, peerDir);
|
|
122
|
+
const envFilesCopied = [];
|
|
123
|
+
const envFilesMissing = [];
|
|
124
|
+
for (const envFile of config.env_files) {
|
|
125
|
+
const src = path.join(currentDir, envFile);
|
|
126
|
+
const dest = path.join(peerDir, envFile);
|
|
127
|
+
if (fs.existsSync(src)) {
|
|
128
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
129
|
+
fs.copyFileSync(src, dest);
|
|
130
|
+
envFilesCopied.push(envFile);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
envFilesMissing.push(envFile);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
122
136
|
const state = {
|
|
123
137
|
app_name: config.app_name,
|
|
124
138
|
live_dir: currentDir,
|
|
@@ -127,5 +141,5 @@ export function runInit(config, runner, opts = {}) {
|
|
|
127
141
|
staging_port: config.staging_port,
|
|
128
142
|
};
|
|
129
143
|
writeState(state);
|
|
130
|
-
return { currentDir, peerDir, originUrl };
|
|
144
|
+
return { currentDir, peerDir, originUrl, envFilesCopied, envFilesMissing };
|
|
131
145
|
}
|
package/dist/deploy/types.d.ts
CHANGED
|
@@ -40,6 +40,12 @@ export interface DeployConfig {
|
|
|
40
40
|
* Default: []
|
|
41
41
|
*/
|
|
42
42
|
sidecar_apps: string[];
|
|
43
|
+
/**
|
|
44
|
+
* Gitignored files (relative to app root) copied from the live dir to the
|
|
45
|
+
* peer during `deploy init` — typically `.env.local`, `.env.production`.
|
|
46
|
+
* Comma-separated in the INI. Default: ['.env.local']
|
|
47
|
+
*/
|
|
48
|
+
env_files: string[];
|
|
43
49
|
}
|
|
44
50
|
/** Result of a single command execution. */
|
|
45
51
|
export interface CommandResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/deploy/types.ts"],"names":[],"mappings":"AAMA,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC3B,0GAA0G;IAC1G,QAAQ,EAAE,MAAM,CAAC;IACjB,gHAAgH;IAChH,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,aAAa,EAAE,MAAM,CAAC;IACtB,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IACxC,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6FAA6F;IAC7F,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/deploy/types.ts"],"names":[],"mappings":"AAMA,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC3B,0GAA0G;IAC1G,QAAQ,EAAE,MAAM,CAAC;IACjB,gHAAgH;IAChH,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,SAAS,EAAE,MAAM,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;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACzC,yDAAyD;IACzD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;GASG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/resolve/deploy.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/resolve/deploy.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA0GvD;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAyDlD"}
|
package/dist/resolve/deploy.js
CHANGED
|
@@ -98,6 +98,15 @@ function collectSidecarApps(section) {
|
|
|
98
98
|
.map((s) => s.trim())
|
|
99
99
|
.filter((s) => s.length > 0);
|
|
100
100
|
}
|
|
101
|
+
function collectEnvFiles(section) {
|
|
102
|
+
const raw = section['env_files'];
|
|
103
|
+
if (typeof raw !== 'string' || !raw.trim())
|
|
104
|
+
return ['.env.local'];
|
|
105
|
+
return raw
|
|
106
|
+
.split(',')
|
|
107
|
+
.map((s) => s.trim())
|
|
108
|
+
.filter((s) => s.length > 0);
|
|
109
|
+
}
|
|
101
110
|
const VALID_DB_STRATEGIES = new Set(['auto', 'copy', 'shared']);
|
|
102
111
|
/**
|
|
103
112
|
* Resolve the `[deploy]` section of hazo_env_config.ini into a typed
|
|
@@ -154,5 +163,6 @@ export function resolveDeployConfig() {
|
|
|
154
163
|
migrate_cmd: section['migrate_cmd'] ?? DEFAULTS.migrate_cmd,
|
|
155
164
|
post_switch_cmds: collectPostSwitchCmds(section),
|
|
156
165
|
sidecar_apps: collectSidecarApps(section),
|
|
166
|
+
env_files: collectEnvFiles(section),
|
|
157
167
|
};
|
|
158
168
|
}
|
package/package.json
CHANGED