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