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