@smoothbricks/cli 0.3.1 → 0.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"managed-files.d.ts","sourceRoot":"","sources":["../../src/monorepo/managed-files.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,iBAAiB,GAAG,SAAS,GAAG,YAAY,CAAC;CACxG;AAwED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,EAAE,CAG/F;AA0ED,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAIxD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQzD"}
1
+ {"version":3,"file":"managed-files.d.ts","sourceRoot":"","sources":["../../src/monorepo/managed-files.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,iBAAiB,GAAG,SAAS,GAAG,YAAY,CAAC;CACxG;AA8ED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,EAAE,CAG/F;AA0ED,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAIxD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQzD"}
@@ -4,6 +4,12 @@ import { fileURLToPath } from 'node:url';
4
4
  import { listReleasePackages, readPackageJson } from '../lib/workspace.js';
5
5
  import { renderPublishWorkflowYaml } from './publish-workflow.js';
6
6
  const managedFiles = [
7
+ {
8
+ kind: 'raw',
9
+ source: 'tooling/direnv/repo-path',
10
+ target: 'tooling/direnv/repo-path',
11
+ executable: true,
12
+ },
7
13
  {
8
14
  kind: 'raw',
9
15
  source: 'tooling/direnv/github-actions-bootstrap.sh',
@@ -14,11 +14,7 @@ clear_devenv_cache_state() {
14
14
  }
15
15
 
16
16
  add_repo_paths() {
17
- {
18
- echo "$repo_root/tooling/direnv/.devenv/profile/bin"
19
- echo "$repo_root/node_modules/.bin"
20
- echo "$repo_root/tooling"
21
- } >> "$GITHUB_PATH"
17
+ "$repo_root/tooling/direnv/repo-path" --github-path
22
18
  }
23
19
 
24
20
  restore_nix_store() {
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env bash
2
+ # Single source of truth for repo-local PATH entries.
3
+ # All tooling that sets up PATH must call this instead of hardcoding paths.
4
+ #
5
+ # Usage:
6
+ # export PATH="$(tooling/direnv/repo-path)" # shell
7
+ # tooling/direnv/repo-path --github-path # CI — appends to $GITHUB_PATH
8
+ # tooling/direnv/repo-path --print # debug — one entry per line
9
+ set -euo pipefail
10
+
11
+ root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
12
+
13
+ # Order: most-specific → least-specific.
14
+ entries=(
15
+ "$root/tooling/direnv/.devenv/profile/bin"
16
+ "$root/tooling/git-hooks"
17
+ "$root/tooling"
18
+ "$root/tooling/node_modules/.bin"
19
+ "$root/node_modules/.bin"
20
+ )
21
+
22
+ case "${1:-}" in
23
+ --github-path)
24
+ # GITHUB_PATH prepends entries; last line written = first in PATH.
25
+ # Reverse so most-specific directories are searched first.
26
+ for (( i=${#entries[@]}-1; i>=0; i-- )); do
27
+ echo "${entries[i]}"
28
+ done >> "$GITHUB_PATH" ;;
29
+ --print)
30
+ printf '%s\n' "${entries[@]}" ;;
31
+ *)
32
+ IFS=:
33
+ echo "${entries[*]}:$PATH" ;;
34
+ esac
@@ -2,13 +2,7 @@
2
2
  cd "$(git rev-parse --show-toplevel)"
3
3
  TOOLING="$PWD/tooling"
4
4
 
5
- # PATH order: most-specific → least-specific.
6
- # 1. git-hooks/ – hook-specific helper scripts
7
- # 2. tooling/ – the repo toolbox (curated tools like the smoo wrapper)
8
- # 3. tooling/node_modules/.bin – toolbox installed deps (@smoothbricks/cli)
9
- # 4. node_modules/.bin – root workspace deps (Nx, biome, etc.)
10
- # 5. devenv profile – upstream native/system tools
11
- export PATH="$TOOLING/git-hooks:$TOOLING:$TOOLING/node_modules/.bin:$PWD/node_modules/.bin:$TOOLING/direnv/.devenv/profile/bin:$PATH"
5
+ export PATH="$("$TOOLING/direnv/repo-path")"
12
6
 
13
7
  set -e -o pipefail
14
8
 
@@ -2,13 +2,7 @@
2
2
  cd "$(git rev-parse --show-toplevel)"
3
3
  TOOLING="$PWD/tooling"
4
4
 
5
- # PATH order: most-specific → least-specific.
6
- # 1. git-hooks/ – hook-specific helper scripts
7
- # 2. tooling/ – the repo toolbox (curated tools like the smoo wrapper)
8
- # 3. tooling/node_modules/.bin – toolbox installed deps (@smoothbricks/cli)
9
- # 4. node_modules/.bin – root workspace deps (Nx, biome, etc.)
10
- # 5. devenv profile – upstream native/system tools
11
- export PATH="$TOOLING/git-hooks:$TOOLING:$TOOLING/node_modules/.bin:$PWD/node_modules/.bin:$TOOLING/direnv/.devenv/profile/bin:$PATH"
5
+ export PATH="$("$TOOLING/direnv/repo-path")"
12
6
 
13
7
  set -e -o pipefail
14
8
 
@@ -20,9 +20,9 @@ runs:
20
20
  working-directory: tooling/direnv
21
21
  # build-shell normally adds repo paths to GITHUB_PATH, but this cleanup
22
22
  # must still run when build-shell fails before that happens.
23
- run:
24
- PATH="$PWD/.devenv/profile/bin:$PWD/../../node_modules/.bin:$PWD/../../tooling:$PATH" ../../tooling/smoo
25
- github-ci cleanup-cache
23
+ run: |
24
+ export PATH="$(../../tooling/direnv/repo-path)"
25
+ smoo github-ci cleanup-cache
26
26
 
27
27
  - name: 🧊 Save Nix profiles and store NAR
28
28
  if: ${{ steps.cleanup-cache.outputs.cache-ready == 'true' && inputs.nix-cache-hit != 'true' }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smoothbricks/cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "description": "SmoothBricks monorepo automation CLI",
6
6
  "bin": {
@@ -45,7 +45,7 @@
45
45
  ],
46
46
  "dependencies": {
47
47
  "@arethetypeswrong/cli": "^0.18.2",
48
- "@smoothbricks/nx-plugin": "0.2.1",
48
+ "@smoothbricks/nx-plugin": "0.2.2-next.0",
49
49
  "@smoothbricks/validation": "0.1.1",
50
50
  "commander": "^14.0.3",
51
51
  "publint": "^0.3.18",
@@ -26,6 +26,12 @@ interface ManagedFileContext {
26
26
  }
27
27
 
28
28
  const managedFiles: ManagedFile[] = [
29
+ {
30
+ kind: 'raw',
31
+ source: 'tooling/direnv/repo-path',
32
+ target: 'tooling/direnv/repo-path',
33
+ executable: true,
34
+ },
29
35
  {
30
36
  kind: 'raw',
31
37
  source: 'tooling/direnv/github-actions-bootstrap.sh',