@devup-ui/next-plugin 1.0.56 → 1.0.58

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 CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs"),r=require("node:path"),i=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:c=r.resolve(e,"devup-ui"),singleCss:p=!1,devupFile:l="devup.json",include:S=[]}=u,D=r.join(e,"sheet.json"),O=r.join(e,"classMap.json"),T=r.join(e,"fileMap.json"),d=r.join(e,".gitignore");t.existsSync(e)||t.mkdirSync(e,{recursive:!0}),t.existsSync(c)||t.mkdirSync(c,{recursive:!0}),t.existsSync(d)||t.writeFileSync(d,"*");const v=t.existsSync(l)?JSON.parse(t.readFileSync(l,"utf-8"))?.theme:{};i.registerTheme(v);const h=i.getThemeInterface(n,"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"?(process.env.TURBOPACK_DEBUG_JS="*",process.env.NODE_OPTIONS??="",process.env.NODE_OPTIONS+=" --inspect-brk",t.writeFileSync(r.join(c,"devup-ui.css"),i.getCss(null,!1))):y.preload(m,n,p,c);const E=JSON.parse(i.exportSheet()),j=JSON.parse(i.exportClassMap()),b=JSON.parse(i.exportFileMap()),o=i.getDefaultTheme();o&&(process.env.DEVUP_UI_DEFAULT_THEME=o,s.env??={},Object.assign(s.env,{DEVUP_UI_DEFAULT_THEME:o}));const f={[`./${r.relative(process.cwd(),c).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:c,sheetFile:D,classMapFile:O,fileMapFile:T,themeFile:l,defaultSheet:E,defaultClassMap:j,defaultFileMap:b,watch:process.env.NODE_ENV==="development",singleCss:p,theme:v}}],condition:{not:{path:m}}}};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=_;
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=_;
@@ -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,CAmIZ"}
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 o, mkdirSync as f, writeFileSync as l, readFileSync as F } from "node:fs";
2
- import { resolve as D, join as p, relative as U } from "node:path";
3
- import { registerTheme as j, getThemeInterface as k, getCss as g, exportSheet as M, exportClassMap as w, exportFileMap as C, getDefaultTheme as I } from "@devup-ui/wasm";
4
- import { DevupUIWebpackPlugin as P } from "@devup-ui/webpack-plugin";
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, a = {}) {
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 = D(e, "devup-ui"),
13
- singleCss: i = !1,
14
- devupFile: u = "devup.json",
15
- include: E = []
16
- } = a, O = p(e, "sheet.json"), T = p(e, "classMap.json"), x = p(e, "fileMap.json"), d = p(e, ".gitignore");
17
- o(e) || f(e, {
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
- }), o(r) || f(r, {
19
+ }), c(r) || f(r, {
20
20
  recursive: !0
21
- }), o(d) || l(d, "*");
22
- const v = o(u) ? JSON.parse(F(u, "utf-8"))?.theme : {};
23
- j(v);
24
- const m = k(
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
- m && l(p(e, "theme.d.ts"), m);
31
- const h = new RegExp(
32
- `(node_modules(?!.*(${["@devup-ui", ...E].join("|").replaceAll("/", "[\\/\\\\_]")})([\\/\\\\.]|$)))|(.mdx.[tj]sx?$)`
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" ? (process.env.TURBOPACK_DEBUG_JS = "*", process.env.NODE_OPTIONS ??= "", process.env.NODE_OPTIONS += " --inspect-brk", l(p(r, "devup-ui.css"), g(null, !1))) : y(h, t, i, r);
35
- const N = JSON.parse(M()), b = JSON.parse(w()), S = JSON.parse(C()), c = I();
36
- c && (process.env.DEVUP_UI_DEFAULT_THEME = c, s.env ??= {}, Object.assign(s.env, {
37
- DEVUP_UI_DEFAULT_THEME: c
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: T,
60
+ classMapFile: E,
57
61
  fileMapFile: x,
58
- themeFile: u,
59
- defaultSheet: N,
60
- defaultClassMap: b,
62
+ themeFile: a,
63
+ defaultSheet: b,
64
+ defaultClassMap: N,
61
65
  defaultFileMap: S,
62
66
  watch: process.env.NODE_ENV === "development",
63
- singleCss: i,
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: h
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: n } = s;
79
- return s.webpack = (t, e) => (a.cssDir ??= D(
80
- e.dev ? a.distDir ?? "df" : ".next/cache",
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 P({
84
- ...a,
87
+ new I({
88
+ ...o,
85
89
  watch: e.dev
86
90
  })
87
- ), typeof n == "function" ? n(t, e) : t), s;
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.56",
22
+ "version": "1.0.58",
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
@@ -46,9 +46,9 @@
46
46
  "types": "./dist/index.d.ts",
47
47
  "dependencies": {
48
48
  "next": "^16.0",
49
- "glob": "^12.0",
49
+ "glob": "^13.0",
50
50
  "@devup-ui/webpack-plugin": "1.0.49",
51
- "@devup-ui/wasm": "1.0.47"
51
+ "@devup-ui/wasm": "1.0.50"
52
52
  },
53
53
  "devDependencies": {
54
54
  "vite": "^7.2",