hazo_env 0.14.0 → 0.14.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.
- package/CHANGE_LOG.md +21 -0
- package/dist/deploy/build.js +1 -1
- package/dist/deploy/init.js +1 -1
- package/dist/deploy/peer.d.ts +6 -2
- package/dist/deploy/peer.d.ts.map +1 -1
- package/dist/deploy/peer.js +15 -5
- package/package.json +3 -3
package/CHANGE_LOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# hazo_env — Change Log
|
|
2
2
|
|
|
3
|
+
## 0.14.2 — 2026-11-23
|
|
4
|
+
|
|
5
|
+
Republish of 0.14.1 — the 0.14.1 tarball was published with a stale dist/
|
|
6
|
+
that didn't contain the peer.ts fix. This version is built from the same
|
|
7
|
+
source with correct compiled output.
|
|
8
|
+
|
|
9
|
+
## 0.14.1 — 2026-11-23 (broken publish — use 0.14.2)
|
|
10
|
+
|
|
11
|
+
Fix: `resolvePeerDir()` no longer requires the current directory's basename
|
|
12
|
+
to end in `-blue`/`-green`. When no color suffix is found, it reads the
|
|
13
|
+
optional `configSuffix` parameter (populated from the INI's `dir_suffix`)
|
|
14
|
+
to compute the peer as `<basename>-<opposite>` — e.g. `~/kinstripe` with
|
|
15
|
+
`dir_suffix = blue` peers with `~/kinstripe-green`. This eliminates the
|
|
16
|
+
previously-"unavoidable" directory rename during the blue-green migration.
|
|
17
|
+
|
|
18
|
+
- **`resolvePeerDir()`** (`src/deploy/peer.ts`): new optional third
|
|
19
|
+
parameter `configSuffix?: string`.
|
|
20
|
+
- **`runBuild()`** (`src/deploy/build.ts`): passes `config.dir_suffix` on
|
|
21
|
+
the no-state fallback path.
|
|
22
|
+
- **`runInit()`** (`src/deploy/init.ts`): passes `config.dir_suffix`.
|
|
23
|
+
|
|
3
24
|
## 0.14.0 — 2026-11-09
|
|
4
25
|
|
|
5
26
|
New: `resolveConnectConfig()` (`src/resolve/connect.ts`) and `doctor()`'s
|
package/dist/deploy/build.js
CHANGED
|
@@ -196,7 +196,7 @@ export function runBuild(config, runner, opts = {}) {
|
|
|
196
196
|
? resolvePeerDir(cwd, opts.peerDir)
|
|
197
197
|
: state
|
|
198
198
|
? path.resolve(state.live_dir)
|
|
199
|
-
: resolvePeerDir(cwd,
|
|
199
|
+
: resolvePeerDir(cwd, undefined, config.dir_suffix);
|
|
200
200
|
// Step 1: auto-clean, then check disk free against min_disk_mb.
|
|
201
201
|
const cleanResult = autoClean(config, runner);
|
|
202
202
|
pass('clean', `reclaimed ${cleanResult.totalBytesReclaimed} bytes across ${cleanResult.targets.length} targets`);
|
package/dist/deploy/init.js
CHANGED
|
@@ -106,7 +106,7 @@ function ensurePeerDataDir(config, peerIniPath, peerDir) {
|
|
|
106
106
|
*/
|
|
107
107
|
export function runInit(config, runner, opts = {}) {
|
|
108
108
|
const currentDir = path.resolve(opts.cwd ?? process.cwd());
|
|
109
|
-
const peerDir = resolvePeerDir(currentDir, opts.peerDir);
|
|
109
|
+
const peerDir = resolvePeerDir(currentDir, opts.peerDir, config.dir_suffix);
|
|
110
110
|
if (fs.existsSync(peerDir)) {
|
|
111
111
|
throw new Error(`Peer directory already exists: ${peerDir}. "deploy init" only creates it fresh — remove it first (or run "deploy clean") if you want to re-init.`);
|
|
112
112
|
}
|
package/dist/deploy/peer.d.ts
CHANGED
|
@@ -11,8 +11,12 @@ export declare function swapColorSuffix(dirName: string): string | undefined;
|
|
|
11
11
|
* `currentDir`'s parent if not already absolute).
|
|
12
12
|
* - Otherwise, swap the blue/green suffix on `currentDir`'s basename and
|
|
13
13
|
* resolve it as a sibling (same parent directory).
|
|
14
|
+
* - If the basename has no suffix but `configSuffix` names this dir's color
|
|
15
|
+
* (from the INI's `dir_suffix`), the peer is `<basename>-<opposite>` as a
|
|
16
|
+
* sibling. This lets `deploy init` / first `deploy build` work from an
|
|
17
|
+
* unsuffixed checkout (e.g. `~/kinstripe`) without requiring a rename.
|
|
14
18
|
*
|
|
15
|
-
* Throws if
|
|
19
|
+
* Throws if none of the above resolve a peer.
|
|
16
20
|
*/
|
|
17
|
-
export declare function resolvePeerDir(currentDir: string, override?: string): string;
|
|
21
|
+
export declare function resolvePeerDir(currentDir: string, override?: string, configSuffix?: string): string;
|
|
18
22
|
//# sourceMappingURL=peer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../src/deploy/peer.ts"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQnE;AAED
|
|
1
|
+
{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../src/deploy/peer.ts"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAwBnG"}
|
package/dist/deploy/peer.js
CHANGED
|
@@ -30,10 +30,14 @@ export function swapColorSuffix(dirName) {
|
|
|
30
30
|
* `currentDir`'s parent if not already absolute).
|
|
31
31
|
* - Otherwise, swap the blue/green suffix on `currentDir`'s basename and
|
|
32
32
|
* resolve it as a sibling (same parent directory).
|
|
33
|
+
* - If the basename has no suffix but `configSuffix` names this dir's color
|
|
34
|
+
* (from the INI's `dir_suffix`), the peer is `<basename>-<opposite>` as a
|
|
35
|
+
* sibling. This lets `deploy init` / first `deploy build` work from an
|
|
36
|
+
* unsuffixed checkout (e.g. `~/kinstripe`) without requiring a rename.
|
|
33
37
|
*
|
|
34
|
-
* Throws if
|
|
38
|
+
* Throws if none of the above resolve a peer.
|
|
35
39
|
*/
|
|
36
|
-
export function resolvePeerDir(currentDir, override) {
|
|
40
|
+
export function resolvePeerDir(currentDir, override, configSuffix) {
|
|
37
41
|
const absCurrent = path.resolve(currentDir);
|
|
38
42
|
const parent = path.dirname(absCurrent);
|
|
39
43
|
if (override) {
|
|
@@ -41,8 +45,14 @@ export function resolvePeerDir(currentDir, override) {
|
|
|
41
45
|
}
|
|
42
46
|
const basename = path.basename(absCurrent);
|
|
43
47
|
const peerBasename = swapColorSuffix(basename);
|
|
44
|
-
if (
|
|
45
|
-
|
|
48
|
+
if (peerBasename) {
|
|
49
|
+
return path.join(parent, peerBasename);
|
|
46
50
|
}
|
|
47
|
-
|
|
51
|
+
if (configSuffix) {
|
|
52
|
+
const opposite = SUFFIX_SWAP[configSuffix];
|
|
53
|
+
if (opposite) {
|
|
54
|
+
return path.join(parent, `${basename}-${opposite}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
throw new Error(`Cannot resolve peer directory for "${basename}": no "-blue" or "-green" suffix found. Pass an explicit peer dir override.`);
|
|
48
58
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_env",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"description": "Canonical environment resolver — typed env names, per-env DB/file/secret config, doctor and CLI for hazo apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"@types/react": "^19.0.0",
|
|
92
92
|
"@types/react-dom": "^19.0.0",
|
|
93
93
|
"hazo_core": "^2.5.0",
|
|
94
|
-
"hazo_config": "^2.
|
|
95
|
-
"hazo_connect": "^4.
|
|
94
|
+
"hazo_config": "^2.9.2",
|
|
95
|
+
"hazo_connect": "^4.6.1",
|
|
96
96
|
"hazo_files": "^3.7.0",
|
|
97
97
|
"next": "^16.0.10",
|
|
98
98
|
"react": "^19.0.0",
|