@devup-ui/webpack-plugin 0.1.4 → 0.1.5
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/devup-ui.css +4 -4
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.js +20 -18
- package/package.json +2 -6
package/dist/devup-ui.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
:root{--text:green;}
|
|
2
1
|
:root[data-theme=dark]{--text:#fff;}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@media (min-width:
|
|
2
|
+
:root{--text:green;}
|
|
3
|
+
.typo-header{font-family:Freesentation;font-size:12px;font-weight:600;line-height:120%;letter-spacing:-0.24px}
|
|
4
|
+
@media (min-width:1280px){.typo-header{font-family:Freesentation;font-size:16px;font-weight:600;line-height:120%;letter-spacing:-0.32px}}.typo-bold{font-family:Freesentation;font-size:14px;font-weight:800;line-height:120%;letter-spacing:-0.28px}.d4{color:var(--d5)}.d12{color:blue}.d0{color:grey}.d7{font-size:128px}.d8{position:relative}.d13{padding-right:20px}.d10{color:var(--text)}.d3{background:var(--text)}.d14{font-size:48px}.d9{padding-top:28px;padding-bottom:28px;}.d11{color:green}.d6{cursor:pointer}.d1:hover{cursor:cell}.d2:hover{background:yellow}
|
|
5
|
+
@media (min-width:480px){.d15{font-size:128px}}.d1474934651398901479{background: red;
|
|
6
6
|
color: blue;}
|
package/dist/plugin.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var f=Object.defineProperty;var m=(s,e,t)=>e in s?f(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var a=(s,e,t)=>m(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("node:fs"),g=require("node:module"),
|
|
1
|
+
"use strict";var f=Object.defineProperty;var m=(s,e,t)=>e in s?f(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var a=(s,e,t)=>m(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("node:fs"),g=require("node:module"),u=require("node:path"),v=require("node:url"),c=require("@devup-ui/wasm");var n=typeof document<"u"?document.currentScript:null;const y=v.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:n&&n.tagName.toUpperCase()==="SCRIPT"&&n.src||new URL("plugin.cjs",document.baseURI).href),P=u.dirname(y);class S{constructor({package:e="@devup-ui/react",cssFile:t=u.join(P,"devup-ui.css"),devupPath:r="devup.json",interfacePath:o=".df"}){a(this,"options");a(this,"watch",!1);this.options={package:e,cssFile:t,devupPath:r,interfacePath:o}}writeDataFiles(){var t;c.registerTheme((t=JSON.parse(i.readFileSync(this.options.devupPath,"utf-8")))==null?void 0:t.theme);const e=c.getThemeInterface(this.options.package,"DevupThemeColors","DevupThemeTypography");e&&(i.existsSync(this.options.interfacePath)||i.mkdirSync(this.options.interfacePath),i.writeFileSync(u.join(this.options.interfacePath,"theme.d.ts"),e,{encoding:"utf-8"})),i.writeFileSync(this.options.cssFile,c.getCss(),{encoding:"utf-8"})}apply(e){const t=i.existsSync(this.options.devupPath);if(t){try{this.writeDataFiles()}catch(o){console.error(o)}e.hooks.afterCompile.tap("DevupUIWebpackPlugin",o=>{o.fileDependencies.add(this.options.devupPath)})}let r=null;e.hooks.watchRun.tapAsync("DevupUIWebpackPlugin",(o,h)=>{this.watch=!0,t&&i.stat(this.options.devupPath,(p,l)=>{if(p){console.error(`Error checking ${this.options.devupPath}:`,p);return}const d=l.mtimeMs;r&&r!==d&&this.writeDataFiles(),r=d}),h()}),i.existsSync(this.options.cssFile)||i.writeFileSync(this.options.cssFile,"",{encoding:"utf-8"}),e.options.module.rules.push({test:/\.(tsx|ts|js|mjs|jsx)$/,exclude:/node_modules/,use:[{loader:g.createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:n&&n.tagName.toUpperCase()==="SCRIPT"&&n.src||new URL("plugin.cjs",document.baseURI).href).resolve("@devup-ui/webpack-plugin/loader"),options:{plugin:this}}]})}}exports.DevupUIWebpackPlugin=S;
|
package/dist/plugin.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var m = (i, e, t) => e in i ?
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var m = (i, e, t) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var n = (i, e, t) => m(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { readFileSync as f, existsSync as p, mkdirSync as g, writeFileSync as
|
|
4
|
+
import { readFileSync as f, existsSync as p, mkdirSync as g, writeFileSync as a, stat as v } from "node:fs";
|
|
5
5
|
import { createRequire as P } from "node:module";
|
|
6
|
-
import { dirname as k, join as
|
|
6
|
+
import { dirname as k, join as h } from "node:path";
|
|
7
7
|
import { fileURLToPath as D } from "node:url";
|
|
8
8
|
import { registerTheme as y, getThemeInterface as w, getCss as F } from "@devup-ui/wasm";
|
|
9
9
|
const T = D(import.meta.url), x = k(T);
|
|
10
|
-
class
|
|
10
|
+
class _ {
|
|
11
11
|
constructor({
|
|
12
12
|
package: e = "@devup-ui/react",
|
|
13
|
-
cssFile: t =
|
|
13
|
+
cssFile: t = h(x, "devup-ui.css"),
|
|
14
14
|
devupPath: o = "devup.json",
|
|
15
15
|
interfacePath: s = ".df"
|
|
16
16
|
}) {
|
|
@@ -33,13 +33,13 @@ class b {
|
|
|
33
33
|
"DevupThemeColors",
|
|
34
34
|
"DevupThemeTypography"
|
|
35
35
|
);
|
|
36
|
-
e && (p(this.options.interfacePath) || g(this.options.interfacePath),
|
|
37
|
-
|
|
36
|
+
e && (p(this.options.interfacePath) || g(this.options.interfacePath), a(
|
|
37
|
+
h(this.options.interfacePath, "theme.d.ts"),
|
|
38
38
|
e,
|
|
39
39
|
{
|
|
40
40
|
encoding: "utf-8"
|
|
41
41
|
}
|
|
42
|
-
)),
|
|
42
|
+
)), a(this.options.cssFile, F(), {
|
|
43
43
|
encoding: "utf-8"
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -56,14 +56,16 @@ class b {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
let o = null;
|
|
59
|
-
e.hooks.watchRun.tapAsync("DevupUIWebpackPlugin", (s,
|
|
60
|
-
this.watch = !0, t && v(this.options.devupPath, (
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
e.hooks.watchRun.tapAsync("DevupUIWebpackPlugin", (s, u) => {
|
|
60
|
+
this.watch = !0, t && v(this.options.devupPath, (r, l) => {
|
|
61
|
+
if (r) {
|
|
62
|
+
console.error(`Error checking ${this.options.devupPath}:`, r);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const c = l.mtimeMs;
|
|
66
|
+
o && o !== c && this.writeDataFiles(), o = c;
|
|
67
|
+
}), u();
|
|
68
|
+
}), p(this.options.cssFile) || a(this.options.cssFile, "", { encoding: "utf-8" }), e.options.module.rules.push({
|
|
67
69
|
test: /\.(tsx|ts|js|mjs|jsx)$/,
|
|
68
70
|
exclude: /node_modules/,
|
|
69
71
|
use: [
|
|
@@ -80,5 +82,5 @@ class b {
|
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
export {
|
|
83
|
-
|
|
85
|
+
_ as DevupUIWebpackPlugin
|
|
84
86
|
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devup-ui/webpack-plugin",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"
|
|
7
|
-
"@devup-ui/wasm": "0.1.2"
|
|
6
|
+
"@devup-ui/wasm": "0.1.3"
|
|
8
7
|
},
|
|
9
8
|
"exports": {
|
|
10
9
|
".": {
|
|
@@ -27,9 +26,6 @@
|
|
|
27
26
|
"vitest": "^2.1.8",
|
|
28
27
|
"typescript": "^5.7.2"
|
|
29
28
|
},
|
|
30
|
-
"peerDependencies": {
|
|
31
|
-
"webpack": "*"
|
|
32
|
-
},
|
|
33
29
|
"scripts": {
|
|
34
30
|
"lint": "eslint",
|
|
35
31
|
"build": "tsc && vite build"
|