@vistagenic/vista 0.2.10 → 0.2.12

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/bin/vista.js CHANGED
@@ -3,6 +3,14 @@
3
3
  const command = process.argv[2];
4
4
  const flags = process.argv.slice(3);
5
5
 
6
+ function forceRuntimeEnv(mode) {
7
+ if (mode === 'development') {
8
+ process.env.NODE_ENV = 'development';
9
+ return;
10
+ }
11
+ process.env.NODE_ENV = 'production';
12
+ }
13
+
6
14
  if (command === 'g' || command === 'generate') {
7
15
  const { runGenerateCommand } = require('../dist/bin/generate');
8
16
  runGenerateCommand(flags).then((code) => {
@@ -20,8 +28,9 @@ const useRSC = !useLegacy;
20
28
  const { markStartTime } = require('../dist/server/logger');
21
29
  markStartTime();
22
30
 
23
- if (command === 'dev') {
24
- if (useRSC) {
31
+ if (command === 'dev') {
32
+ forceRuntimeEnv('development');
33
+ if (useRSC) {
25
34
  // RSC Mode (default) - True React Server Components Architecture
26
35
  const { buildRSC } = require('../dist/bin/build-rsc');
27
36
  const { startRSCServer } = require('../dist/server/rsc-engine');
@@ -51,8 +60,9 @@ if (command === 'dev') {
51
60
  process.exit(1);
52
61
  });
53
62
  }
54
- } else if (command === 'build') {
55
- if (useRSC) {
63
+ } else if (command === 'build') {
64
+ forceRuntimeEnv('production');
65
+ if (useRSC) {
56
66
  // RSC Production Build (default)
57
67
  const { buildRSC } = require('../dist/bin/build-rsc');
58
68
 
@@ -78,8 +88,9 @@ if (command === 'dev') {
78
88
  process.exit(1);
79
89
  });
80
90
  }
81
- } else if (command === 'start') {
82
- if (useRSC) {
91
+ } else if (command === 'start') {
92
+ forceRuntimeEnv('production');
93
+ if (useRSC) {
83
94
  const { startRSCServer } = require('../dist/server/rsc-engine');
84
95
  startRSCServer({ port: process.env.PORT || 3003 });
85
96
  } else {
@@ -150,11 +150,25 @@ function reportDevRuntimeError(title: string, error: unknown): void {
150
150
  var indicator = (window as any).__VISTA_DEVTOOLS_INDICATOR__;
151
151
  var overlay = (window as any).__VISTA_DEV_ERROR_OVERLAY__;
152
152
  var message = buildRuntimeMessage(title, error);
153
+ var canRestoreFromIndicator = false;
154
+ if (indicator && indicator.hidden !== true && typeof indicator.setError === 'function') {
155
+ canRestoreFromIndicator = true;
156
+ if (typeof indicator.ensureAttached === 'function') {
157
+ try {
158
+ canRestoreFromIndicator = indicator.ensureAttached() !== false;
159
+ } catch {
160
+ canRestoreFromIndicator = false;
161
+ }
162
+ }
163
+ }
153
164
  if (indicator && typeof indicator.setError === 'function') {
154
165
  indicator.setError(title, 1);
155
166
  }
156
167
  if (overlay && typeof overlay.capture === 'function') {
157
168
  overlay.capture([message]);
169
+ if (!canRestoreFromIndicator && typeof overlay.show === 'function') {
170
+ overlay.show([message]);
171
+ }
158
172
  return;
159
173
  }
160
174
  if (overlay && typeof overlay.show === 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vistagenic/vista",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "The React Framework for Visionaries - Rust-powered SSR with Server Components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",