slicejs-cli 3.8.0 → 3.8.1

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,5 +1,6 @@
1
1
  import bundle from '../bundle/bundle.js';
2
2
  import buildProduction, { serveProductionBuild } from '../buildProduction/buildProduction.js';
3
+ import { loadConfigSync } from '../utils/loadConfig.js';
3
4
  import Print from '../Print.js';
4
5
 
5
6
  export default async function build(options = {}) {
@@ -15,6 +16,18 @@ export default async function build(options = {}) {
15
16
  return true;
16
17
  }
17
18
 
19
+ // Hard-fail before producing a bundle: ContextManager reactivity (setState →
20
+ // watch/bind) is delivered through EventManager, and EventManager is only
21
+ // bundled when events.enabled is true. context on + events off would ship a
22
+ // bundle where every context watcher is silently dead — catch it here so the
23
+ // broken bundle never gets built.
24
+ const config = loadConfigSync(import.meta.url);
25
+ if (config?.context?.enabled && !config?.events?.enabled) {
26
+ Print.error('sliceConfig: context.enabled requires events.enabled.');
27
+ Print.info('ContextManager reactivity (setState → watch/bind) runs through EventManager, which is only bundled when events.enabled is true. Set "events": { "enabled": true } in sliceConfig.json.');
28
+ process.exit(1);
29
+ }
30
+
18
31
  const success = await buildProduction({
19
32
  ...options,
20
33
  minify,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slicejs-cli",
3
- "version": "3.8.0",
3
+ "version": "3.8.1",
4
4
  "description": "Command client for developing web applications with Slice.js framework",
5
5
  "main": "client.js",
6
6
  "bin": {