@devup-ui/next-plugin 1.0.60 → 1.0.61
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/plugin.cjs +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +37 -34
- package/package.json +3 -3
package/dist/plugin.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs"),r=require("node:path"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs"),r=require("node:path"),c=require("@devup-ui/wasm"),y=require("@devup-ui/webpack-plugin"),_=require("./preload.cjs");function g(s,o={}){if(process.env.TURBOPACK==="1"||process.env.TURBOPACK==="auto"){s??={},s.turbopack??={},s.turbopack.rules??={};const{package:n="@devup-ui/react",distDir:e="df",cssDir:i=r.resolve(e,"devup-ui"),singleCss:a=!1,devupFile:p="devup.json",include:d=[],prefix:v}=o;v&&c.setPrefix(v);const T=r.join(e,"sheet.json"),D=r.join(e,"classMap.json"),O=r.join(e,"fileMap.json"),h=r.join(e,".gitignore");t.existsSync(e)||t.mkdirSync(e,{recursive:!0}),t.existsSync(i)||t.mkdirSync(i,{recursive:!0}),t.existsSync(h)||t.writeFileSync(h,"*");const m=t.existsSync(p)?JSON.parse(t.readFileSync(p,"utf-8"))?.theme:{};c.registerTheme(m);const f=c.getThemeInterface(n,"CustomColors","DevupThemeTypography","DevupTheme");f&&t.writeFileSync(r.join(e,"theme.d.ts"),f);const S=new RegExp(`(node_modules(?!.*(${["@devup-ui",...d].join("|").replaceAll("/","[\\/\\\\_]")})([\\/\\\\.]|$)))|(.mdx.[tj]sx?$)`);process.env.NODE_ENV!=="production"?(fetch("http://localhost:"+process.env.PORT),fetch("http://localhost:"+process.debugPort).catch(()=>{setTimeout(()=>{process.exit(77)},500)}),process.env.TURBOPACK_DEBUG_JS="*",process.env.NODE_OPTIONS??="",process.env.NODE_OPTIONS+=" --inspect-brk",t.writeFileSync(r.join(i,"devup-ui.css"),c.getCss(null,!1))):_.preload(S,n,a,i,d);const x=JSON.parse(c.exportSheet()),E=JSON.parse(c.exportClassMap()),b=JSON.parse(c.exportFileMap()),u=c.getDefaultTheme();u&&(process.env.DEVUP_UI_DEFAULT_THEME=u,s.env??={},Object.assign(s.env,{DEVUP_UI_DEFAULT_THEME:u}));const j={[`./${r.relative(process.cwd(),i).replaceAll("\\","/")}/*.css`]:[{loader:"@devup-ui/next-plugin/css-loader",options:{watch:process.env.NODE_ENV==="development"}}],"*.{tsx,ts,js,mjs}":{loaders:[{loader:"@devup-ui/next-plugin/loader",options:{package:n,cssDir:i,sheetFile:T,classMapFile:D,fileMapFile:O,themeFile:p,defaultSheet:x,defaultClassMap:E,defaultFileMap:b,watch:process.env.NODE_ENV==="development",singleCss:a,theme:m}}],condition:{not:{path:S}}}};return Object.assign(s.turbopack.rules,j),s}const{webpack:l}=s;return s.webpack=(n,e)=>(o.cssDir??=r.resolve(e.dev?o.distDir??"df":".next/cache",`devup-ui_${e.buildId}`),n.plugins.push(new y.DevupUIWebpackPlugin({...o,watch:e.dev})),typeof l=="function"?l(n,e):n),s}exports.DevupUI=g;
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAItC,KAAK,wBAAwB,GAAG,IAAI,CAClC,OAAO,CAAC,2BAA2B,CAAC,EACpC,OAAO,CACR,CAAA;AAQD,wBAAgB,OAAO,CACrB,MAAM,EAAE,UAAU,EAClB,OAAO,GAAE,wBAA6B,GACrC,UAAU,CA8IZ"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,46 +1,49 @@
|
|
|
1
|
-
import { existsSync as c, mkdirSync as
|
|
2
|
-
import { resolve as
|
|
3
|
-
import {
|
|
4
|
-
import { DevupUIWebpackPlugin as
|
|
5
|
-
import { preload as
|
|
6
|
-
function
|
|
1
|
+
import { existsSync as c, mkdirSync as D, writeFileSync as i, readFileSync as P } from "node:fs";
|
|
2
|
+
import { resolve as O, join as p, relative as U } from "node:path";
|
|
3
|
+
import { setPrefix as g, registerTheme as j, getThemeInterface as k, getCss as M, exportSheet as w, exportClassMap as C, exportFileMap as I, getDefaultTheme as y } from "@devup-ui/wasm";
|
|
4
|
+
import { DevupUIWebpackPlugin as A } from "@devup-ui/webpack-plugin";
|
|
5
|
+
import { preload as R } from "./preload.js";
|
|
6
|
+
function L(s, o = {}) {
|
|
7
7
|
if (process.env.TURBOPACK === "1" || process.env.TURBOPACK === "auto") {
|
|
8
8
|
s ??= {}, s.turbopack ??= {}, s.turbopack.rules ??= {};
|
|
9
9
|
const {
|
|
10
10
|
package: t = "@devup-ui/react",
|
|
11
11
|
distDir: e = "df",
|
|
12
|
-
cssDir: r =
|
|
12
|
+
cssDir: r = O(e, "devup-ui"),
|
|
13
13
|
singleCss: n = !1,
|
|
14
14
|
devupFile: a = "devup.json",
|
|
15
|
-
include: d = []
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
include: d = [],
|
|
16
|
+
prefix: v
|
|
17
|
+
} = o;
|
|
18
|
+
v && g(v);
|
|
19
|
+
const E = p(e, "sheet.json"), x = p(e, "classMap.json"), b = p(e, "fileMap.json"), h = p(e, ".gitignore");
|
|
20
|
+
c(e) || D(e, {
|
|
18
21
|
recursive: !0
|
|
19
|
-
}), c(r) ||
|
|
22
|
+
}), c(r) || D(r, {
|
|
20
23
|
recursive: !0
|
|
21
|
-
}), c(
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
24
|
+
}), c(h) || i(h, "*");
|
|
25
|
+
const m = c(a) ? JSON.parse(P(a, "utf-8"))?.theme : {};
|
|
26
|
+
j(m);
|
|
27
|
+
const f = k(
|
|
25
28
|
t,
|
|
26
29
|
"CustomColors",
|
|
27
30
|
"DevupThemeTypography",
|
|
28
31
|
"DevupTheme"
|
|
29
32
|
);
|
|
30
|
-
|
|
31
|
-
const
|
|
33
|
+
f && i(p(e, "theme.d.ts"), f);
|
|
34
|
+
const T = new RegExp(
|
|
32
35
|
`(node_modules(?!.*(${["@devup-ui", ...d].join("|").replaceAll("/", "[\\/\\\\_]")})([\\/\\\\.]|$)))|(.mdx.[tj]sx?$)`
|
|
33
36
|
);
|
|
34
37
|
process.env.NODE_ENV !== "production" ? (fetch("http://localhost:" + process.env.PORT), fetch("http://localhost:" + process.debugPort).catch(() => {
|
|
35
38
|
setTimeout(() => {
|
|
36
39
|
process.exit(77);
|
|
37
40
|
}, 500);
|
|
38
|
-
}), process.env.TURBOPACK_DEBUG_JS = "*", process.env.NODE_OPTIONS ??= "", process.env.NODE_OPTIONS += " --inspect-brk",
|
|
39
|
-
const
|
|
41
|
+
}), process.env.TURBOPACK_DEBUG_JS = "*", process.env.NODE_OPTIONS ??= "", process.env.NODE_OPTIONS += " --inspect-brk", i(p(r, "devup-ui.css"), M(null, !1))) : R(T, t, n, r, d);
|
|
42
|
+
const N = JSON.parse(w()), S = JSON.parse(C()), _ = JSON.parse(I()), l = y();
|
|
40
43
|
l && (process.env.DEVUP_UI_DEFAULT_THEME = l, s.env ??= {}, Object.assign(s.env, {
|
|
41
44
|
DEVUP_UI_DEFAULT_THEME: l
|
|
42
45
|
}));
|
|
43
|
-
const
|
|
46
|
+
const F = {
|
|
44
47
|
[`./${U(process.cwd(), r).replaceAll("\\", "/")}/*.css`]: [
|
|
45
48
|
{
|
|
46
49
|
loader: "@devup-ui/next-plugin/css-loader",
|
|
@@ -56,40 +59,40 @@ function K(s, o = {}) {
|
|
|
56
59
|
options: {
|
|
57
60
|
package: t,
|
|
58
61
|
cssDir: r,
|
|
59
|
-
sheetFile:
|
|
60
|
-
classMapFile:
|
|
61
|
-
fileMapFile:
|
|
62
|
+
sheetFile: E,
|
|
63
|
+
classMapFile: x,
|
|
64
|
+
fileMapFile: b,
|
|
62
65
|
themeFile: a,
|
|
63
|
-
defaultSheet:
|
|
64
|
-
defaultClassMap:
|
|
65
|
-
defaultFileMap:
|
|
66
|
+
defaultSheet: N,
|
|
67
|
+
defaultClassMap: S,
|
|
68
|
+
defaultFileMap: _,
|
|
66
69
|
watch: process.env.NODE_ENV === "development",
|
|
67
70
|
singleCss: n,
|
|
68
71
|
// for turbopack, load theme is required on loader
|
|
69
|
-
theme:
|
|
72
|
+
theme: m
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
],
|
|
73
76
|
condition: {
|
|
74
77
|
not: {
|
|
75
|
-
path:
|
|
78
|
+
path: T
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
82
|
};
|
|
80
|
-
return Object.assign(s.turbopack.rules,
|
|
83
|
+
return Object.assign(s.turbopack.rules, F), s;
|
|
81
84
|
}
|
|
82
|
-
const { webpack:
|
|
83
|
-
return s.webpack = (t, e) => (o.cssDir ??=
|
|
85
|
+
const { webpack: u } = s;
|
|
86
|
+
return s.webpack = (t, e) => (o.cssDir ??= O(
|
|
84
87
|
e.dev ? o.distDir ?? "df" : ".next/cache",
|
|
85
88
|
`devup-ui_${e.buildId}`
|
|
86
89
|
), t.plugins.push(
|
|
87
|
-
new
|
|
90
|
+
new A({
|
|
88
91
|
...o,
|
|
89
92
|
watch: e.dev
|
|
90
93
|
})
|
|
91
|
-
), typeof
|
|
94
|
+
), typeof u == "function" ? u(t, e) : t), s;
|
|
92
95
|
}
|
|
93
96
|
export {
|
|
94
|
-
|
|
97
|
+
L as DevupUI
|
|
95
98
|
};
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"webpack"
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
|
-
"version": "1.0.
|
|
22
|
+
"version": "1.0.61",
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"next": "^16.1",
|
|
49
49
|
"glob": "^13.0",
|
|
50
|
-
"@devup-ui/webpack-plugin": "^1.0.
|
|
51
|
-
"@devup-ui/wasm": "^1.0.
|
|
50
|
+
"@devup-ui/webpack-plugin": "^1.0.51",
|
|
51
|
+
"@devup-ui/wasm": "^1.0.54"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"vite": "^7.3",
|