@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 CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("node:fs"),t=require("node:path"),u=require("@devup-ui/wasm"),f=require("@devup-ui/webpack-plugin"),j=require("./preload.cjs");function x(r,c={}){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:a=!1,devupFile:l="devup.json",include:h=[]}=c,O=t.join(e,"sheet.json"),b=t.join(e,"classMap.json"),m=t.join(e,"fileMap.json"),o=t.join(e,".gitignore");s.existsSync(e)||s.mkdirSync(e,{recursive:!0}),s.existsSync(n)||s.mkdirSync(n,{recursive:!0}),s.existsSync(o)||s.writeFileSync(o,"*");const d=s.existsSync(l)?JSON.parse(s.readFileSync(l,"utf-8"))?.theme:{},v=u.getThemeInterface(i,"DevupThemeColors","DevupThemeTypography","DevupTheme");v&&s.writeFileSync(t.join(e,"theme.d.ts"),v);const S=new RegExp(`node_modules(?!.*(${["@devup-ui",...h].join("|").replaceAll("/","[\\/\\\\_]")})([\\/\\\\.]|$))`);process.env.NODE_ENV!=="production"?(process.env.TURBOPACK_DEBUG_JS="*",process.env.NODE_OPTIONS??="",process.env.NODE_OPTIONS+=" --inspect-brk"):j.preload(S,i,a,d,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:b,fileMapFile:m,defaultSheet:JSON.parse(u.exportSheet()),defaultClassMap:JSON.parse(u.exportClassMap()),defaultFileMap:JSON.parse(u.exportFileMap()),watch:process.env.NODE_ENV==="development",singleCss:a,theme:d}}],condition:{not:{path:S}}}};return Object.assign(r.turbopack.rules,D),r}const{webpack:p}=r;return r.webpack=(i,e)=>(c.cssDir??=t.resolve(e.dev?c.distDir??"df":".next/cache",`devup-ui_${e.buildId}`),i.plugins.push(new f.DevupUIWebpackPlugin({...c,watch:e.dev})),typeof p=="function"?p(i,e):i),r}exports.DevupUI=x;
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;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AASA,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,CAoHZ"}
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 N } from "node:fs";
2
- import { resolve as f, join as p, relative as T } from "node:path";
3
- import { getThemeInterface as k, exportFileMap as j, exportClassMap as F, exportSheet as g } from "@devup-ui/wasm";
4
- import { DevupUIWebpackPlugin as w } from "@devup-ui/webpack-plugin";
5
- import { preload as E } from "./preload.js";
6
- function _(s, a = {}) {
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: c = !1,
14
- devupFile: l = "devup.json",
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"), b = p(e, "fileMap.json"), o = p(e, ".gitignore");
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(o) || h(o, "*");
22
- const n = u(l) ? JSON.parse(N(l, "utf-8"))?.theme : {}, d = k(
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") : E(v, r, c, n, t);
33
- const x = {
34
- [`./${T(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") : 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: b,
49
- defaultSheet: JSON.parse(g()),
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: c,
55
+ singleCss: l,
54
56
  // for turbopack, load theme is required on loader
55
- theme: n
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, x), s;
68
+ return Object.assign(s.turbopack.rules, b), s;
67
69
  }
68
- const { webpack: i } = s;
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 w({
75
+ new E({
74
76
  ...a,
75
77
  watch: e.dev
76
78
  })
77
- ), typeof i == "function" ? i(r, e) : r), s;
79
+ ), typeof c == "function" ? c(r, e) : r), s;
78
80
  }
79
81
  export {
80
- _ as DevupUI
82
+ A as DevupUI
81
83
  };
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "webpack"
20
20
  ],
21
21
  "type": "module",
22
- "version": "1.0.47",
22
+ "version": "1.0.48",
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },