@lotics/ui 20.0.1 → 20.0.2

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/src/vite.test.ts DELETED
@@ -1,41 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import * as fs from "node:fs";
3
- import * as path from "node:path";
4
- import { loticsOptimizeDeps } from "./vite.mjs";
5
-
6
- describe("@lotics/ui/vite", () => {
7
- it("exports a non-empty list of module-specifier strings", () => {
8
- expect(Array.isArray(loticsOptimizeDeps)).toBe(true);
9
- expect(loticsOptimizeDeps.length).toBeGreaterThan(0);
10
- for (const entry of loticsOptimizeDeps) {
11
- expect(typeof entry).toBe("string");
12
- expect(entry.length).toBeGreaterThan(0);
13
- }
14
- });
15
-
16
- it("is a zero-import leaf (it loads inside Vite's Node config context)", () => {
17
- // The module is imported by an app's `vite.config.ts`, evaluated by Node
18
- // before any resolve.alias or RN-Web shim exists. A single import would drag
19
- // react-native-web (and its Metro globals) into the Node config load and
20
- // crash it — so the runtime module must import nothing at all. Strip comments
21
- // first so the usage example in the header (which shows an `import` line) is
22
- // not mistaken for real code.
23
- const raw = fs.readFileSync(path.join(__dirname, "vite.mjs"), "utf-8");
24
- const code = raw
25
- .replace(/\/\*[\s\S]*?\*\//g, "")
26
- .replace(/(^|[^:])\/\/.*$/gm, "$1");
27
- expect(code).not.toMatch(/^\s*import\b/m);
28
- expect(code).not.toMatch(/\bfrom\s+["']/);
29
- expect(code).not.toMatch(/\brequire\s*\(/);
30
- });
31
-
32
- test("carries the load-bearing RN-Web interop entries (a missing one blanks the dev iframe)", () => {
33
- // RN-Web does `import normalizeColor from "@react-native/normalize-colors"`
34
- // (nested CJS): un-prebundled, the dev server serves it as ESM with no
35
- // default export and the iframe blanks the moment a colour-touching
36
- // component mounts. These membership pins port the scaffold-era literal
37
- // assertions to the list's owner.
38
- expect(loticsOptimizeDeps).toContain("react-native-web");
39
- expect(loticsOptimizeDeps).toContain("@react-native/normalize-colors");
40
- });
41
- });