@lotics/cli 0.43.0 → 0.44.0
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/dist/src/cli.js
CHANGED
|
@@ -30179,7 +30179,7 @@ import { spawn as spawn2 } from "node:child_process";
|
|
|
30179
30179
|
import { tmpdir } from "node:os";
|
|
30180
30180
|
|
|
30181
30181
|
// src/starter_template.ts
|
|
30182
|
-
var STARTER_FALLBACK_UI_VERSION = "
|
|
30182
|
+
var STARTER_FALLBACK_UI_VERSION = "2.0.0";
|
|
30183
30183
|
var STARTER_FALLBACK_SDK_VERSION = "0.11.0";
|
|
30184
30184
|
var STARTER_REACT_NATIVE_VERSION = "0.85.3";
|
|
30185
30185
|
function buildStarterTemplate(args) {
|
|
@@ -30322,13 +30322,6 @@ export default defineConfig({
|
|
|
30322
30322
|
dedupe: ["react", "react-dom", "react-native-web"],
|
|
30323
30323
|
},
|
|
30324
30324
|
optimizeDeps: {
|
|
30325
|
-
// \`recharts\` (used by @lotics/ui chart_* + sparkline) imports
|
|
30326
|
-
// \`es-toolkit/compat/get\` as a default-export CJS module. Vite's dev
|
|
30327
|
-
// server treats \`compat/*\` as ESM and won't synthesize a default,
|
|
30328
|
-
// so \`import get from "es-toolkit/compat/get"\` fails to resolve.
|
|
30329
|
-
// Pre-bundling forces Vite to convert it to an ESM shim with a default
|
|
30330
|
-
// export. Production build (rollup) handles it correctly without this.
|
|
30331
|
-
include: ["recharts", "es-toolkit", "es-toolkit/compat"],
|
|
30332
30325
|
// The dep optimizer pre-bundles deps with a SEPARATE esbuild pass that
|
|
30333
30326
|
// top-level \`define\` doesn't always reach, so a pre-bundled RN dep can
|
|
30334
30327
|
// still hit \`__DEV__ is not defined\` under \`lotics app dev\`. Define it
|
|
@@ -39,7 +39,7 @@ export interface StarterFile {
|
|
|
39
39
|
* scaffolds resolve the live version via `fetchLatestNpmVersion` and only
|
|
40
40
|
* fall back here when the lookup fails.
|
|
41
41
|
*/
|
|
42
|
-
export declare const STARTER_FALLBACK_UI_VERSION = "
|
|
42
|
+
export declare const STARTER_FALLBACK_UI_VERSION = "2.0.0";
|
|
43
43
|
export declare const STARTER_FALLBACK_SDK_VERSION = "0.11.0";
|
|
44
44
|
/**
|
|
45
45
|
* react-native pin for scaffolded apps. Matches the monorepo frontend's pin so
|
package/dist/starter_template.js
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
* scaffolds resolve the live version via `fetchLatestNpmVersion` and only
|
|
36
36
|
* fall back here when the lookup fails.
|
|
37
37
|
*/
|
|
38
|
-
export const STARTER_FALLBACK_UI_VERSION = "
|
|
38
|
+
export const STARTER_FALLBACK_UI_VERSION = "2.0.0";
|
|
39
39
|
export const STARTER_FALLBACK_SDK_VERSION = "0.11.0";
|
|
40
40
|
/**
|
|
41
41
|
* react-native pin for scaffolded apps. Matches the monorepo frontend's pin so
|
|
@@ -184,13 +184,6 @@ export default defineConfig({
|
|
|
184
184
|
dedupe: ["react", "react-dom", "react-native-web"],
|
|
185
185
|
},
|
|
186
186
|
optimizeDeps: {
|
|
187
|
-
// \`recharts\` (used by @lotics/ui chart_* + sparkline) imports
|
|
188
|
-
// \`es-toolkit/compat/get\` as a default-export CJS module. Vite's dev
|
|
189
|
-
// server treats \`compat/*\` as ESM and won't synthesize a default,
|
|
190
|
-
// so \`import get from "es-toolkit/compat/get"\` fails to resolve.
|
|
191
|
-
// Pre-bundling forces Vite to convert it to an ESM shim with a default
|
|
192
|
-
// export. Production build (rollup) handles it correctly without this.
|
|
193
|
-
include: ["recharts", "es-toolkit", "es-toolkit/compat"],
|
|
194
187
|
// The dep optimizer pre-bundles deps with a SEPARATE esbuild pass that
|
|
195
188
|
// top-level \`define\` doesn't always reach, so a pre-bundled RN dep can
|
|
196
189
|
// still hit \`__DEV__ is not defined\` under \`lotics app dev\`. Define it
|
|
@@ -8,14 +8,15 @@ function fileNamed(files, path) {
|
|
|
8
8
|
}
|
|
9
9
|
describe("buildStarterTemplate", () => {
|
|
10
10
|
const baseArgs = { app_name: "Demo", app_id: "app_test", workspace_id: "wsp_test" };
|
|
11
|
-
test("vite.config.ts pre-bundles
|
|
11
|
+
test("vite.config.ts pre-bundles RN deps with __DEV__ + .web.js for the dev server", () => {
|
|
12
12
|
const config = fileNamed(buildStarterTemplate(baseArgs), "vite.config.ts");
|
|
13
|
-
//
|
|
14
|
-
//
|
|
13
|
+
// The optimizer runs a SEPARATE esbuild pass that ignores `resolve.extensions`
|
|
14
|
+
// and the top-level `define`, so `__DEV__` + `.web.js` must be repeated here —
|
|
15
|
+
// else a pre-bundled RN dep (e.g. react-native-svg, which @lotics/ui charts
|
|
16
|
+
// use) resolves to its native build and `__DEV__` is undefined.
|
|
15
17
|
expect(config).toMatch(/optimizeDeps:\s*\{/);
|
|
16
|
-
expect(config).toContain('"
|
|
17
|
-
expect(config).toContain('"
|
|
18
|
-
expect(config).toContain('"es-toolkit/compat"');
|
|
18
|
+
expect(config).toContain('__DEV__: "false"');
|
|
19
|
+
expect(config).toContain('".web.js"');
|
|
19
20
|
});
|
|
20
21
|
test("vite.config.ts defines the RN __DEV__ global (else the bundle throws at load → blank iframe)", () => {
|
|
21
22
|
// `__DEV__` is a Metro-injected global that RN-ecosystem deps reference at
|