@devup-ui/next-plugin 1.0.44 → 1.0.45
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 +32 -26
- package/package.json +11 -10
package/dist/plugin.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("node:fs"),t=require("node:path"),k=require("@devup-ui/webpack-plugin");function O(s,c={}){if(process.env.TURBOPACK==="1"||process.env.TURBOPACK==="auto"){if(process.env.NODE_ENV==="production")throw new Error("Devup UI is not supported in production with turbopack");s??={},s.turbopack??={},s.turbopack.rules??={};const{package:i="@devup-ui/react",distDir:e="df",cssDir:u=t.resolve(e,"devup-ui"),singleCss:a=!1,devupFile:p="devup.json"}=c,l=t.join(e,"sheet.json"),d=t.join(e,"classMap.json"),v=t.join(e,"fileMap.json"),o=t.join(e,".gitignore");r.existsSync(e)||r.mkdirSync(e,{recursive:!0}),r.existsSync(u)||r.mkdirSync(u,{recursive:!0}),r.existsSync(o)||r.writeFileSync(o,"*"),process.env.TURBOPACK_DEBUG_JS="*",process.env.NODE_OPTIONS??="",process.env.NODE_OPTIONS+=" --inspect-brk";const b={[`./${t.relative(process.cwd(),u).replaceAll("\\","/")}/*.css`]:[{loader:"@devup-ui/webpack-plugin/css-loader"}],"*.{tsx,ts,js,mjs}":[{loader:"@devup-ui/webpack-plugin/loader",options:{package:i,cssDir:u,sheetFile:l,classMapFile:d,fileMapFile:v,watch:process.env.NODE_ENV==="development",singleCss:a,theme:r.existsSync(p)?JSON.parse(r.readFileSync(p,"utf-8"))?.theme:void 0}}]};return Object.assign(s.turbopack.rules,b),s}const{webpack:n}=s;return s.webpack=(i,e)=>(c.cssDir??=t.resolve(e.dev?c.distDir??"df":".next/cache",`devup-ui_${e.buildId}`),i.plugins.push(new k.DevupUIWebpackPlugin({...c,watch:e.dev})),typeof n=="function"?n(i,e):i),s}exports.DevupUI=O;
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAEtC,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,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAEtC,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,CAmFZ"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
import { existsSync as
|
|
2
|
-
import { resolve as
|
|
3
|
-
import { DevupUIWebpackPlugin as
|
|
4
|
-
function
|
|
5
|
-
if (process.env.TURBOPACK === "1") {
|
|
1
|
+
import { existsSync as p, mkdirSync as n, writeFileSync as w, readFileSync as D } from "node:fs";
|
|
2
|
+
import { resolve as l, join as u, relative as m } from "node:path";
|
|
3
|
+
import { DevupUIWebpackPlugin as h } from "@devup-ui/webpack-plugin";
|
|
4
|
+
function S(s, t = {}) {
|
|
5
|
+
if (process.env.TURBOPACK === "1" || process.env.TURBOPACK === "auto") {
|
|
6
|
+
if (process.env.NODE_ENV === "production")
|
|
7
|
+
throw new Error("Devup UI is not supported in production with turbopack");
|
|
6
8
|
s ??= {}, s.turbopack ??= {}, s.turbopack.rules ??= {};
|
|
7
9
|
const {
|
|
8
10
|
package: r = "@devup-ui/react",
|
|
9
11
|
distDir: e = "df",
|
|
10
|
-
cssDir:
|
|
11
|
-
singleCss:
|
|
12
|
-
|
|
13
|
-
u(e)
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
cssDir: i = l(e, "devup-ui"),
|
|
13
|
+
singleCss: d = !1,
|
|
14
|
+
devupFile: a = "devup.json"
|
|
15
|
+
} = t, v = u(e, "sheet.json"), b = u(e, "classMap.json"), k = u(e, "fileMap.json"), o = u(e, ".gitignore");
|
|
16
|
+
p(e) || n(e, {
|
|
17
|
+
recursive: !0
|
|
18
|
+
}), p(i) || n(i, {
|
|
19
|
+
recursive: !0
|
|
20
|
+
}), p(o) || w(o, "*"), process.env.TURBOPACK_DEBUG_JS = "*", process.env.NODE_OPTIONS ??= "", process.env.NODE_OPTIONS += " --inspect-brk";
|
|
21
|
+
const O = {
|
|
22
|
+
[`./${m(process.cwd(), i).replaceAll("\\", "/")}/*.css`]: [
|
|
16
23
|
{
|
|
17
|
-
loader: "@devup-ui/webpack-plugin/css-loader"
|
|
18
|
-
options: {
|
|
19
|
-
watch: process.env.NODE_ENV === "development"
|
|
20
|
-
}
|
|
24
|
+
loader: "@devup-ui/webpack-plugin/css-loader"
|
|
21
25
|
}
|
|
22
26
|
],
|
|
23
27
|
"*.{tsx,ts,js,mjs}": [
|
|
@@ -25,29 +29,31 @@ function g(s, t = {}) {
|
|
|
25
29
|
loader: "@devup-ui/webpack-plugin/loader",
|
|
26
30
|
options: {
|
|
27
31
|
package: r,
|
|
28
|
-
cssDir:
|
|
29
|
-
sheetFile:
|
|
30
|
-
classMapFile:
|
|
31
|
-
fileMapFile:
|
|
32
|
+
cssDir: i,
|
|
33
|
+
sheetFile: v,
|
|
34
|
+
classMapFile: b,
|
|
35
|
+
fileMapFile: k,
|
|
32
36
|
watch: process.env.NODE_ENV === "development",
|
|
33
|
-
singleCss:
|
|
37
|
+
singleCss: d,
|
|
38
|
+
// for turbopack, load theme is required on loader
|
|
39
|
+
theme: p(a) ? JSON.parse(D(a, "utf-8"))?.theme : void 0
|
|
34
40
|
}
|
|
35
41
|
}
|
|
36
42
|
]
|
|
37
43
|
};
|
|
38
|
-
return Object.assign(s.turbopack.rules,
|
|
44
|
+
return Object.assign(s.turbopack.rules, O), s;
|
|
39
45
|
}
|
|
40
|
-
const { webpack:
|
|
41
|
-
return s.webpack = (r, e) => (t.cssDir ??=
|
|
46
|
+
const { webpack: c } = s;
|
|
47
|
+
return s.webpack = (r, e) => (t.cssDir ??= l(
|
|
42
48
|
e.dev ? t.distDir ?? "df" : ".next/cache",
|
|
43
49
|
`devup-ui_${e.buildId}`
|
|
44
50
|
), r.plugins.push(
|
|
45
|
-
new
|
|
51
|
+
new h({
|
|
46
52
|
...t,
|
|
47
53
|
watch: e.dev
|
|
48
54
|
})
|
|
49
|
-
), typeof
|
|
55
|
+
), typeof c == "function" ? c(r, e) : r), s;
|
|
50
56
|
}
|
|
51
57
|
export {
|
|
52
|
-
|
|
58
|
+
S as DevupUI
|
|
53
59
|
};
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"webpack"
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
|
-
"version": "1.0.
|
|
22
|
+
"version": "1.0.45",
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
@@ -37,20 +37,21 @@
|
|
|
37
37
|
],
|
|
38
38
|
"types": "./dist/index.d.ts",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"next": "^
|
|
41
|
-
"
|
|
42
|
-
"@devup-ui/
|
|
40
|
+
"next": "^16.0",
|
|
41
|
+
"@devup-ui/webpack-plugin": "1.0.44",
|
|
42
|
+
"@devup-ui/wasm": "1.0.43"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"vite": "^7.1
|
|
46
|
-
"vite-plugin-dts": "^4.5
|
|
47
|
-
"vitest": "^
|
|
48
|
-
"typescript": "^5.9
|
|
49
|
-
"@types/webpack": "^5.28
|
|
45
|
+
"vite": "^7.1",
|
|
46
|
+
"vite-plugin-dts": "^4.5",
|
|
47
|
+
"vitest": "^4.0",
|
|
48
|
+
"typescript": "^5.9",
|
|
49
|
+
"@types/webpack": "^5.28"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@devup-ui/webpack-plugin": "*",
|
|
53
|
-
"next": "*"
|
|
53
|
+
"next": "*",
|
|
54
|
+
"@devup-ui/wasm": "*"
|
|
54
55
|
},
|
|
55
56
|
"scripts": {
|
|
56
57
|
"lint": "eslint",
|