@stacksjs/defaults 0.72.76 → 0.72.77

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.
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.72.76",
5
+ "version": "0.72.77",
6
6
  "description": "A modern Stacks development environment.",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/chrisbbreuer",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.72.76",
5
+ "version": "0.72.77",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/stacksjs/stacks.git",
@@ -51,7 +51,7 @@
51
51
  "dependencies": {
52
52
  "@iconify-json/f7": "^1.2.2",
53
53
  "@iconify-json/hugeicons": "^1.2.27",
54
- "@stacksjs/mobile": "^0.72.76",
54
+ "@stacksjs/mobile": "^0.72.77",
55
55
  "@stacksjs/sanitizer": "^0.2.113"
56
56
  },
57
57
  "scripts": {
package/project/buddy CHANGED
@@ -6,7 +6,6 @@ PANTRY_LOCAL_BIN="${ROOT_DIR}/pantry/.bin"
6
6
  PANTRY_DIR="${ROOT_DIR}/pantry"
7
7
  USER_LOCAL_BIN="${HOME}/.local/bin"
8
8
  PANTRY_INSTALLER="${ROOT_DIR}/storage/framework/scripts/pantry-install"
9
- PANTRY_SETUP_DONE="${PANTRY_DIR}/.postsetup-done"
10
9
  PANTRY_BOOTSTRAP_TIMEOUT_SECONDS="${PANTRY_BOOTSTRAP_TIMEOUT_SECONDS:-600}"
11
10
  PANTRY_DEPENDENCIES_TIMEOUT_SECONDS="${PANTRY_DEPENDENCIES_TIMEOUT_SECONDS:-1200}"
12
11
 
@@ -16,9 +15,13 @@ PANTRY_DEPENDENCIES_TIMEOUT_SECONDS="${PANTRY_DEPENDENCIES_TIMEOUT_SECONDS:-1200
16
15
  # 1. `storage/framework/core/buddy/src/cli.ts` — userland override (legacy
17
16
  # "framework lives in the project" layout). Kept FIRST so projects that
18
17
  # have published buddy via `buddy publish:core buddy` still win.
19
- # 2. `node_modules/@stacksjs/buddy/src/cli.ts` — installed package, TS source
18
+ # 2. `<deps>/@stacksjs/buddy/src/cli.ts` — installed package, TS source
20
19
  # (workspace symlink or a real npm install with `src/` shipped).
21
- # 3. `node_modules/@stacksjs/buddy/dist/cli.js` — published JS-only build.
20
+ # 3. `<deps>/@stacksjs/buddy/dist/cli.js` — published JS-only build.
21
+ #
22
+ # `<deps>` is node_modules or pantry: an app installed with pantry has no
23
+ # node_modules at all, so a node_modules-only list finds nothing and the shim
24
+ # refuses to run the CLI that is sitting right there in ./pantry.
22
25
  #
23
26
  # If none of these are present the script bails with a clear message instead
24
27
  # of `bun` exploding on a missing file.
@@ -27,6 +30,8 @@ resolve_buddy_entry() {
27
30
  "${ROOT_DIR}/storage/framework/core/buddy/src/cli.ts" \
28
31
  "${ROOT_DIR}/node_modules/@stacksjs/buddy/src/cli.ts" \
29
32
  "${ROOT_DIR}/node_modules/@stacksjs/buddy/dist/cli.js" \
33
+ "${PANTRY_DIR}/@stacksjs/buddy/src/cli.ts" \
34
+ "${PANTRY_DIR}/@stacksjs/buddy/dist/cli.js" \
30
35
  ; do
31
36
  if [ -f "${candidate}" ]; then
32
37
  echo "${candidate}"
@@ -38,8 +43,8 @@ resolve_buddy_entry() {
38
43
 
39
44
  if ! BUDDY_ENTRY=$(resolve_buddy_entry); then
40
45
  echo "buddy: could not locate CLI entrypoint." >&2
41
- echo " Tried: storage/framework/core/buddy/src/cli.ts, node_modules/@stacksjs/buddy/{src/cli.ts,dist/cli.js}." >&2
42
- echo " Run \`bun install\` or \`buddy publish:core buddy\` to make the CLI available." >&2
46
+ echo " Tried: storage/framework/core/buddy/src/cli.ts, {node_modules,pantry}/@stacksjs/buddy/{src/cli.ts,dist/cli.js}." >&2
47
+ echo " Run \`bun install\` (or \`pantry install\`), or \`buddy publish:core buddy\`, to make the CLI available." >&2
43
48
  exit 1
44
49
  fi
45
50
 
@@ -106,17 +111,26 @@ run_buddy() {
106
111
  # preload not found "@stacksjs/env/plugin.js"`, then Cannot-find-module for
107
112
  # every other import). In that case omit the flag and let bun/import/default
108
113
  # resolve the dist.
114
+ # The probe has to look wherever this project actually installs: pantry-only
115
+ # apps have no node_modules, so a node_modules-only probe reports "no src"
116
+ # for a vendored checkout and drops the flag — and then every import resolves
117
+ # to a ./dist the vendored source has never built.
109
118
  CONDITIONS=""
110
- if [ -d "${ROOT_DIR}/storage/framework/core" ] && [ -f "${ROOT_DIR}/node_modules/@stacksjs/env/src/index.ts" ]; then
119
+ if [ -d "${ROOT_DIR}/storage/framework/core" ] \
120
+ && { [ -f "${ROOT_DIR}/node_modules/@stacksjs/env/src/index.ts" ] || [ -f "${PANTRY_DIR}/@stacksjs/env/src/index.ts" ]; }; then
111
121
  CONDITIONS="--conditions development"
112
122
  fi
113
123
 
114
124
  # Installed dependencies are authoritative; Pantry is a fallback for tools
115
125
  # the app does not install. Keeping node_modules first prevents a stale local
116
126
  # Pantry snapshot from changing migrations, builds, or production commands.
117
- # Only add Pantry after setup completed so a partial bootstrap cannot affect
118
- # module resolution.
119
- if [ -f "${PANTRY_SETUP_DONE}" ]; then
127
+ #
128
+ # Add Pantry only once it holds packages. An empty (or absent) directory on
129
+ # NODE_PATH is what a half-finished bootstrap leaves behind, and pointing at
130
+ # it buys nothing; a directory with packages in it is the whole module root
131
+ # for a pantry-installed app, and leaving it off is what makes `buddy` die on
132
+ # `Cannot find module '@stacksjs/env'` from a preload.
133
+ if [ -d "${PANTRY_DIR}" ] && [ -n "$(ls -A "${PANTRY_DIR}" 2>/dev/null)" ]; then
120
134
  exec env PATH="${PANTRY_LOCAL_BIN}:${USER_LOCAL_BIN}:${PATH}" NODE_PATH="${ROOT_DIR}/node_modules:${PANTRY_DIR}${NODE_PATH:+:${NODE_PATH}}" "${BUN_CMD}" ${CONDITIONS} "${BUDDY_ENTRY}" "$@"
121
135
  fi
122
136
  exec env PATH="${PANTRY_LOCAL_BIN}:${USER_LOCAL_BIN}:${PATH}" "${BUN_CMD}" ${CONDITIONS} "${BUDDY_ENTRY}" "$@"