@devup-ui/next-plugin 1.0.59 → 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 CHANGED
@@ -1 +1 @@
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:d=[]}=o,T=r.join(e,"sheet.json"),D=r.join(e,"classMap.json"),O=r.join(e,"fileMap.json"),v=r.join(e,".gitignore");t.existsSync(e)||t.mkdirSync(e,{recursive:!0}),t.existsSync(i)||t.mkdirSync(i,{recursive:!0}),t.existsSync(v)||t.writeFileSync(v,"*");const h=t.existsSync(u)?JSON.parse(t.readFileSync(u,"utf-8"))?.theme:{};n.registerTheme(h);const m=n.getThemeInterface(c,"CustomColors","DevupThemeTypography","DevupTheme");m&&t.writeFileSync(r.join(e,"theme.d.ts"),m);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"),n.getCss(null,!1))):y.preload(S,c,a,i,d);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:h}}],condition:{not:{path:S}}}};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
+ "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;
@@ -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,CAyIZ"}
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 T, writeFileSync as u, readFileSync as F } from "node:fs";
2
- import { resolve as D, 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
- import { preload as y } from "./preload.js";
6
- function K(s, o = {}) {
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 = D(e, "devup-ui"),
12
+ cssDir: r = O(e, "devup-ui"),
13
13
  singleCss: n = !1,
14
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"), v = p(e, ".gitignore");
17
- c(e) || T(e, {
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) || T(r, {
22
+ }), c(r) || D(r, {
20
23
  recursive: !0
21
- }), c(v) || u(v, "*");
22
- const h = c(a) ? JSON.parse(F(a, "utf-8"))?.theme : {};
23
- g(h);
24
- const m = j(
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
- m && u(p(e, "theme.d.ts"), m);
31
- const f = new RegExp(
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", u(p(r, "devup-ui.css"), k(null, !1))) : y(f, t, n, r, d);
39
- const b = JSON.parse(P()), N = JSON.parse(M()), S = JSON.parse(w()), l = C();
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: O,
60
- classMapFile: E,
61
- fileMapFile: x,
62
+ sheetFile: E,
63
+ classMapFile: x,
64
+ fileMapFile: b,
62
65
  themeFile: a,
63
- defaultSheet: b,
64
- defaultClassMap: N,
65
- defaultFileMap: S,
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: h
72
+ theme: m
70
73
  }
71
74
  }
72
75
  ],
73
76
  condition: {
74
77
  not: {
75
- path: f
78
+ path: T
76
79
  }
77
80
  }
78
81
  }
79
82
  };
80
- return Object.assign(s.turbopack.rules, _), s;
83
+ return Object.assign(s.turbopack.rules, F), s;
81
84
  }
82
- const { webpack: i } = s;
83
- return s.webpack = (t, e) => (o.cssDir ??= D(
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 I({
90
+ new A({
88
91
  ...o,
89
92
  watch: e.dev
90
93
  })
91
- ), typeof i == "function" ? i(t, e) : t), s;
94
+ ), typeof u == "function" ? u(t, e) : t), s;
92
95
  }
93
96
  export {
94
- K as DevupUI
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.59",
22
+ "version": "1.0.61",
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
@@ -45,13 +45,13 @@
45
45
  ],
46
46
  "types": "./dist/index.d.ts",
47
47
  "dependencies": {
48
- "next": "^16.0",
48
+ "next": "^16.1",
49
49
  "glob": "^13.0",
50
- "@devup-ui/webpack-plugin": "1.0.49",
51
- "@devup-ui/wasm": "1.0.51"
50
+ "@devup-ui/webpack-plugin": "^1.0.51",
51
+ "@devup-ui/wasm": "^1.0.54"
52
52
  },
53
53
  "devDependencies": {
54
- "vite": "^7.2",
54
+ "vite": "^7.3",
55
55
  "vite-plugin-dts": "^4.5",
56
56
  "vitest": "^4.0",
57
57
  "typescript": "^5.9",