@devup-ui/next-plugin 1.0.56 → 1.0.57
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 +39 -35
- package/package.json +2 -2
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"),n=require("@devup-ui/wasm"),x=require("@devup-ui/webpack-plugin"),y=require("./preload.cjs");function _(s,o={}){if(process.env.TURBOPACK==="1"||process.env.TURBOPACK==="auto"){s??={},s.turbopack??={},s.turbopack.rules??={};const{package:c="@devup-ui/react",distDir:e="df",cssDir:i=r.resolve(e,"devup-ui"),singleCss:a=!1,devupFile:u="devup.json",include:S=[]}=o,T=r.join(e,"sheet.json"),D=r.join(e,"classMap.json"),O=r.join(e,"fileMap.json"),d=r.join(e,".gitignore");t.existsSync(e)||t.mkdirSync(e,{recursive:!0}),t.existsSync(i)||t.mkdirSync(i,{recursive:!0}),t.existsSync(d)||t.writeFileSync(d,"*");const v=t.existsSync(u)?JSON.parse(t.readFileSync(u,"utf-8"))?.theme:{};n.registerTheme(v);const h=n.getThemeInterface(c,"CustomColors","DevupThemeTypography","DevupTheme");h&&t.writeFileSync(r.join(e,"theme.d.ts"),h);const m=new RegExp(`(node_modules(?!.*(${["@devup-ui",...S].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"),n.getCss(null,!1))):y.preload(m,c,a,i);const f=JSON.parse(n.exportSheet()),E=JSON.parse(n.exportClassMap()),b=JSON.parse(n.exportFileMap()),l=n.getDefaultTheme();l&&(process.env.DEVUP_UI_DEFAULT_THEME=l,s.env??={},Object.assign(s.env,{DEVUP_UI_DEFAULT_THEME:l}));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:c,cssDir:i,sheetFile:T,classMapFile:D,fileMapFile:O,themeFile:u,defaultSheet:f,defaultClassMap:E,defaultFileMap:b,watch:process.env.NODE_ENV==="development",singleCss:a,theme:v}}],condition:{not:{path:m}}}};return Object.assign(s.turbopack.rules,j),s}const{webpack:p}=s;return s.webpack=(c,e)=>(o.cssDir??=r.resolve(e.dev?o.distDir??"df":".next/cache",`devup-ui_${e.buildId}`),c.plugins.push(new x.DevupUIWebpackPlugin({...o,watch:e.dev})),typeof p=="function"?p(c,e):c),s}exports.DevupUI=_;
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAYA,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,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAYA,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,CAyIZ"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import { existsSync as
|
|
2
|
-
import { resolve as
|
|
3
|
-
import { registerTheme as
|
|
4
|
-
import { DevupUIWebpackPlugin as
|
|
1
|
+
import { existsSync as c, mkdirSync as f, writeFileSync as u, readFileSync as F } from "node:fs";
|
|
2
|
+
import { resolve as T, join as p, relative as U } from "node:path";
|
|
3
|
+
import { registerTheme as g, getThemeInterface as j, getCss as k, exportSheet as P, exportClassMap as M, exportFileMap as w, getDefaultTheme as C } from "@devup-ui/wasm";
|
|
4
|
+
import { DevupUIWebpackPlugin as I } from "@devup-ui/webpack-plugin";
|
|
5
5
|
import { preload as y } from "./preload.js";
|
|
6
|
-
function K(s,
|
|
6
|
+
function K(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 =
|
|
13
|
-
singleCss:
|
|
14
|
-
devupFile:
|
|
15
|
-
include:
|
|
16
|
-
} =
|
|
17
|
-
|
|
12
|
+
cssDir: r = T(e, "devup-ui"),
|
|
13
|
+
singleCss: n = !1,
|
|
14
|
+
devupFile: a = "devup.json",
|
|
15
|
+
include: D = []
|
|
16
|
+
} = o, O = p(e, "sheet.json"), E = p(e, "classMap.json"), x = p(e, "fileMap.json"), d = p(e, ".gitignore");
|
|
17
|
+
c(e) || f(e, {
|
|
18
18
|
recursive: !0
|
|
19
|
-
}),
|
|
19
|
+
}), c(r) || f(r, {
|
|
20
20
|
recursive: !0
|
|
21
|
-
}),
|
|
22
|
-
const v =
|
|
23
|
-
|
|
24
|
-
const
|
|
21
|
+
}), c(d) || u(d, "*");
|
|
22
|
+
const v = c(a) ? JSON.parse(F(a, "utf-8"))?.theme : {};
|
|
23
|
+
g(v);
|
|
24
|
+
const h = j(
|
|
25
25
|
t,
|
|
26
26
|
"CustomColors",
|
|
27
27
|
"DevupThemeTypography",
|
|
28
28
|
"DevupTheme"
|
|
29
29
|
);
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
`(node_modules(?!.*(${["@devup-ui", ...
|
|
30
|
+
h && u(p(e, "theme.d.ts"), h);
|
|
31
|
+
const m = new RegExp(
|
|
32
|
+
`(node_modules(?!.*(${["@devup-ui", ...D].join("|").replaceAll("/", "[\\/\\\\_]")})([\\/\\\\.]|$)))|(.mdx.[tj]sx?$)`
|
|
33
33
|
);
|
|
34
|
-
process.env.NODE_ENV !== "production" ? (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
process.env.NODE_ENV !== "production" ? (fetch("http://localhost:" + process.env.PORT), fetch("http://localhost:" + process.debugPort).catch(() => {
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
process.exit(77);
|
|
37
|
+
}, 500);
|
|
38
|
+
}), process.env.TURBOPACK_DEBUG_JS = "*", process.env.NODE_OPTIONS ??= "", process.env.NODE_OPTIONS += " --inspect-brk", u(p(r, "devup-ui.css"), k(null, !1))) : y(m, t, n, r);
|
|
39
|
+
const b = JSON.parse(P()), N = JSON.parse(M()), S = JSON.parse(w()), l = C();
|
|
40
|
+
l && (process.env.DEVUP_UI_DEFAULT_THEME = l, s.env ??= {}, Object.assign(s.env, {
|
|
41
|
+
DEVUP_UI_DEFAULT_THEME: l
|
|
38
42
|
}));
|
|
39
43
|
const _ = {
|
|
40
44
|
[`./${U(process.cwd(), r).replaceAll("\\", "/")}/*.css`]: [
|
|
@@ -53,14 +57,14 @@ function K(s, a = {}) {
|
|
|
53
57
|
package: t,
|
|
54
58
|
cssDir: r,
|
|
55
59
|
sheetFile: O,
|
|
56
|
-
classMapFile:
|
|
60
|
+
classMapFile: E,
|
|
57
61
|
fileMapFile: x,
|
|
58
|
-
themeFile:
|
|
59
|
-
defaultSheet:
|
|
60
|
-
defaultClassMap:
|
|
62
|
+
themeFile: a,
|
|
63
|
+
defaultSheet: b,
|
|
64
|
+
defaultClassMap: N,
|
|
61
65
|
defaultFileMap: S,
|
|
62
66
|
watch: process.env.NODE_ENV === "development",
|
|
63
|
-
singleCss:
|
|
67
|
+
singleCss: n,
|
|
64
68
|
// for turbopack, load theme is required on loader
|
|
65
69
|
theme: v
|
|
66
70
|
}
|
|
@@ -68,23 +72,23 @@ function K(s, a = {}) {
|
|
|
68
72
|
],
|
|
69
73
|
condition: {
|
|
70
74
|
not: {
|
|
71
|
-
path:
|
|
75
|
+
path: m
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
};
|
|
76
80
|
return Object.assign(s.turbopack.rules, _), s;
|
|
77
81
|
}
|
|
78
|
-
const { webpack:
|
|
79
|
-
return s.webpack = (t, e) => (
|
|
80
|
-
e.dev ?
|
|
82
|
+
const { webpack: i } = s;
|
|
83
|
+
return s.webpack = (t, e) => (o.cssDir ??= T(
|
|
84
|
+
e.dev ? o.distDir ?? "df" : ".next/cache",
|
|
81
85
|
`devup-ui_${e.buildId}`
|
|
82
86
|
), t.plugins.push(
|
|
83
|
-
new
|
|
84
|
-
...
|
|
87
|
+
new I({
|
|
88
|
+
...o,
|
|
85
89
|
watch: e.dev
|
|
86
90
|
})
|
|
87
|
-
), typeof
|
|
91
|
+
), typeof i == "function" ? i(t, e) : t), s;
|
|
88
92
|
}
|
|
89
93
|
export {
|
|
90
94
|
K as DevupUI
|
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.57",
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"next": "^16.0",
|
|
49
49
|
"glob": "^12.0",
|
|
50
50
|
"@devup-ui/webpack-plugin": "1.0.49",
|
|
51
|
-
"@devup-ui/wasm": "1.0.
|
|
51
|
+
"@devup-ui/wasm": "1.0.48"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"vite": "^7.2",
|