@lobb-js/studio 0.28.2 → 0.28.3
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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobb-js/studio",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "0.28.
|
|
4
|
+
"version": "0.28.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@storybook/addon-vitest": "^10.0.1",
|
|
49
49
|
"@storybook/svelte-vite": "^10.0.1",
|
|
50
50
|
"@sveltejs/package": "^2.5.7",
|
|
51
|
-
"@sveltejs/vite-plugin-svelte": "
|
|
51
|
+
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
52
52
|
"@tsconfig/svelte": "^5.0.6",
|
|
53
53
|
"@types/mustache": "^4.2.6",
|
|
54
54
|
"@types/node": "^24.10.1",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"tailwindcss-animate": "^1.0.7",
|
|
66
66
|
"tw-animate-css": "^1.4.0",
|
|
67
67
|
"typescript": "~5.9.3",
|
|
68
|
-
"vite": "
|
|
68
|
+
"vite": "^7.3.3",
|
|
69
69
|
"vitest": "^4.0.5",
|
|
70
70
|
"@types/lodash-es": "^4.17.12"
|
|
71
71
|
},
|
package/vite-plugins/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { contextualLibAlias } from "./contextual-lib-alias.js";
|
|
2
|
-
import { lobbWorkspaceOptimize } from "./
|
|
2
|
+
import { lobbWorkspaceOptimize } from "./workspace-optimize.js";
|
|
3
3
|
import { lobbExtensionsPlugin } from "./lobb-extensions.js";
|
|
4
4
|
import { lobbProxyPlugin } from "./lobb-proxy.js";
|
|
5
5
|
|
|
@@ -11,8 +11,6 @@ import { join, resolve, dirname } from "node:path";
|
|
|
11
11
|
* - entries: Tells Vite to crawl workspace packages at startup so
|
|
12
12
|
* all their deps are discovered and pre-bundled upfront
|
|
13
13
|
* (avoids 504 timeouts on first browser load).
|
|
14
|
-
* - include: Re-includes leaf CJS deps of excluded packages so
|
|
15
|
-
* Vite still pre-bundles them for the browser.
|
|
16
14
|
* - holdUntilCrawlEnd: Blocks the first response until optimization is done.
|
|
17
15
|
* - server.fs.allow: Allows Vite to serve files from the monorepo root
|
|
18
16
|
* (needed to follow symlinks into workspace packages).
|
|
@@ -36,7 +34,6 @@ export function lobbWorkspaceOptimize() {
|
|
|
36
34
|
holdUntilCrawlEnd: true,
|
|
37
35
|
entries: getWorkspaceEntries(workspacePkgs),
|
|
38
36
|
exclude: workspacePkgs,
|
|
39
|
-
include: getCjsDepsOf(workspacePkgs),
|
|
40
37
|
},
|
|
41
38
|
server: {
|
|
42
39
|
fs: {
|
|
@@ -59,6 +56,7 @@ function getLobbWorkspacePackages() {
|
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
58
|
|
|
59
|
+
|
|
62
60
|
function getMonorepoRoot(pkgNames) {
|
|
63
61
|
for (const name of pkgNames) {
|
|
64
62
|
try {
|
|
@@ -98,36 +96,6 @@ function getWorkspaceEntries(pkgNames) {
|
|
|
98
96
|
return entries;
|
|
99
97
|
}
|
|
100
98
|
|
|
101
|
-
function readPkgFrom(name, baseDir) {
|
|
102
|
-
let dir = baseDir;
|
|
103
|
-
for (let i = 0; i < 8; i++) {
|
|
104
|
-
const pkg = tryReadJson(join(dir, "node_modules", name, "package.json"));
|
|
105
|
-
if (pkg) return pkg;
|
|
106
|
-
const parent = dirname(dir);
|
|
107
|
-
if (parent === dir) break;
|
|
108
|
-
dir = parent;
|
|
109
|
-
}
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function getCjsDepsOf(pkgNames) {
|
|
114
|
-
const deps = [];
|
|
115
|
-
for (const name of pkgNames) {
|
|
116
|
-
try {
|
|
117
|
-
const realPath = realpathSync(resolve(`node_modules/${name}`));
|
|
118
|
-
const pkg = tryReadJson(join(realPath, "package.json"));
|
|
119
|
-
if (!pkg) continue;
|
|
120
|
-
for (const dep of Object.keys(pkg.dependencies ?? {})) {
|
|
121
|
-
const depPkg = readPkgFrom(dep, realPath);
|
|
122
|
-
if (!depPkg) continue;
|
|
123
|
-
const isCjs = depPkg.type !== "module";
|
|
124
|
-
const isLeaf = Object.keys(depPkg.dependencies ?? {}).length === 0;
|
|
125
|
-
if (isCjs && isLeaf) deps.push(dep);
|
|
126
|
-
}
|
|
127
|
-
} catch { /* skip */ }
|
|
128
|
-
}
|
|
129
|
-
return [...new Set(deps)];
|
|
130
|
-
}
|
|
131
99
|
|
|
132
100
|
function tryReadJson(filePath) {
|
|
133
101
|
try {
|