@stacksjs/defaults 0.70.102 → 0.70.103

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.70.102",
5
+ "version": "0.70.103",
6
6
  "description": "Default Stacks scaffold resources (views, layouts, components, preloader) — shipped so apps consuming the framework from node_modules get the same fallback resources a vendored checkout provides. Source of truth: storage/framework/defaults.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -36,7 +36,13 @@ const fastCommands = [
36
36
  'scaffold:crud',
37
37
  ]
38
38
  const isRepl = !process.argv[1]
39
- const skipPreloader = isRepl || (args.length > 0 && fastCommands.some(cmd => args[0] === cmd || args[0].startsWith(`${cmd}:`)))
39
+ // Dependency installation runs package lifecycle scripts before Bun has finished
40
+ // linking every workspace package. Loading @stacksjs/env (or the wider auto-import
41
+ // graph) from a postinstall script can therefore fail even though the install is
42
+ // otherwise valid. Postinstall scripts are bootstrap work and must stay independent
43
+ // of the application runtime preloader.
44
+ const isPostinstall = process.env.npm_lifecycle_event === 'postinstall'
45
+ const skipPreloader = isRepl || isPostinstall || (args.length > 0 && fastCommands.some(cmd => args[0] === cmd || args[0].startsWith(`${cmd}:`)))
40
46
 
41
47
  if (!skipPreloader) {
42
48
  // Detect production/deployment commands and set environment accordingly BEFORE loading env files