@db-ux/core-vite-plugin 4.7.2 → 4.7.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/CHANGELOG.md +5 -1
- package/build/generator.js +16 -2
- package/package.json +17 -14
package/CHANGELOG.md
CHANGED
package/build/generator.js
CHANGED
|
@@ -12,11 +12,25 @@ const FOUNDATION_IMPORTS = {
|
|
|
12
12
|
const THEME_SCOPES = ['@db-ux', '@db-ux-inner-source'];
|
|
13
13
|
/**
|
|
14
14
|
* Auto-detect the installed DB UX theme package (e.g. @db-ux/db-theme).
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* Tries to resolve known theme packages directly, falling back to
|
|
16
|
+
* filesystem scanning for custom theme packages.
|
|
17
17
|
* Returns the package specifier or null if no theme is found.
|
|
18
18
|
*/
|
|
19
19
|
function detectTheme(root, preferredTheme) {
|
|
20
|
+
// Try to resolve known/preferred theme packages directly first
|
|
21
|
+
const candidatePackages = preferredTheme
|
|
22
|
+
? [preferredTheme]
|
|
23
|
+
: THEME_SCOPES.flatMap((scope) => ['db-theme', 'db-theme-db'].map((name) => `${scope}/${name}`));
|
|
24
|
+
for (const pkg of candidatePackages) {
|
|
25
|
+
try {
|
|
26
|
+
require.resolve(`${pkg}/package.json`, { paths: [root] });
|
|
27
|
+
return pkg;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
// Not found, try next
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Fallback: filesystem scan for custom theme packages
|
|
20
34
|
let currentDir = root;
|
|
21
35
|
for (let i = 0; i < 10; i++) {
|
|
22
36
|
for (const scope of THEME_SCOPES) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@db-ux/core-vite-plugin",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Vite plugin for optimized DB UX Design System CSS imports",
|
|
6
6
|
"repository": {
|
|
@@ -28,17 +28,6 @@
|
|
|
28
28
|
"db-ux",
|
|
29
29
|
"design-system"
|
|
30
30
|
],
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "tsc",
|
|
33
|
-
"copy-output": "npm-run-all copy:*",
|
|
34
|
-
"copy:changelog": "cpr CHANGELOG.md ../../build-outputs/vite-plugin/CHANGELOG.md --overwrite",
|
|
35
|
-
"copy:index.css": "cpr index.css ../../build-outputs/vite-plugin/index.css -o",
|
|
36
|
-
"copy:outputs": "cpr build ../../build-outputs/vite-plugin/build -o",
|
|
37
|
-
"copy:package.json": "cpr package.json ../../build-outputs/vite-plugin/package.json -o",
|
|
38
|
-
"copy:readme": "cpr README.md ../../build-outputs/vite-plugin/README.md -o",
|
|
39
|
-
"test": "vitest run --config vitest.config.ts",
|
|
40
|
-
"test:update": "npm run test -- --update"
|
|
41
|
-
},
|
|
42
31
|
"peerDependencies": {
|
|
43
32
|
"vite": ">=4.0.0"
|
|
44
33
|
},
|
|
@@ -46,7 +35,10 @@
|
|
|
46
35
|
"fast-glob": "^3.3.3"
|
|
47
36
|
},
|
|
48
37
|
"devDependencies": {
|
|
38
|
+
"@db-ux/db-theme": "5.6.2",
|
|
49
39
|
"@types/node": "25.6.0",
|
|
40
|
+
"cpr": "3.0.1",
|
|
41
|
+
"npm-run-all2": "8.0.4",
|
|
50
42
|
"typescript": "5.9.3",
|
|
51
43
|
"vite": "8.0.10",
|
|
52
44
|
"vitest": "4.1.5"
|
|
@@ -55,5 +47,16 @@
|
|
|
55
47
|
"registry": "https://registry.npmjs.org/",
|
|
56
48
|
"access": "public"
|
|
57
49
|
},
|
|
58
|
-
"style": "index.css"
|
|
59
|
-
|
|
50
|
+
"style": "index.css",
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsc",
|
|
53
|
+
"copy-output": "run-p copy:*",
|
|
54
|
+
"copy:changelog": "cpr CHANGELOG.md ../../build-outputs/vite-plugin/CHANGELOG.md --overwrite",
|
|
55
|
+
"copy:index.css": "cpr index.css ../../build-outputs/vite-plugin/index.css -o",
|
|
56
|
+
"copy:outputs": "cpr build ../../build-outputs/vite-plugin/build -o",
|
|
57
|
+
"copy:package.json": "cpr package.json ../../build-outputs/vite-plugin/package.json -o",
|
|
58
|
+
"copy:readme": "cpr README.md ../../build-outputs/vite-plugin/README.md -o",
|
|
59
|
+
"test": "vitest run --config vitest.config.ts",
|
|
60
|
+
"test:update": "npm run test -- --update"
|
|
61
|
+
}
|
|
62
|
+
}
|