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