@devup-ui/webpack-plugin 0.1.3 → 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 CHANGED
@@ -1,6 +1,6 @@
1
- :root{--text:green;}
2
1
  :root[data-theme=dark]{--text:#fff;}
3
- .typo-bold{font-family:Freesentation;font-size:14px;font-weight:800;line-height:120%;letter-spacing:-0.28px}.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}}.d15544298694588338936{color:green}.d12529347886882223583{position:relative}.d2683505337015604167{padding-right:20px}.d17565952947812156497{background:var(--text)}.d6188083034562313614{padding-top:28px;padding-bottom:28px;}.d7673073962820674314{font-size:48px}.d18131660931022743310{color:blue}.d8530366258308820036{cursor:pointer}.d5660377212820351369{font-size:128px}.d3005003370393598714{color:var(--d7726768185092795896)}.d9699708075224169605{color:var(--text)}.d3476602810702122842{color:grey}.d1370288632191954504:hover{cursor:cell}.d9474678031423794435:hover{background:yellow}
5
- @media (min-width:480px){.d322777003817739426{font-size:128px}}.d1474934651398901479{background: red;
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 l=Object.defineProperty;var f=(s,e,t)=>e in s?l(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var a=(s,e,t)=>f(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("node:fs"),m=require("node:module"),c=require("node:path"),g=require("node:url"),u=require("@devup-ui/wasm");var n=typeof document<"u"?document.currentScript:null;const v=g.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:n&&n.tagName.toUpperCase()==="SCRIPT"&&n.src||new URL("plugin.cjs",document.baseURI).href),y=c.dirname(v);class P{constructor({package:e="@devup-ui/react",cssFile:t=c.join(y,"devup-ui.css"),devupPath:o="devup.json",interfacePath:r=".df"}){a(this,"options");a(this,"watch",!1);this.options={package:e,cssFile:t,devupPath:o,interfacePath:r}}writeDataFiles(){var t;u.registerTheme((t=JSON.parse(i.readFileSync(this.options.devupPath,"utf-8")))==null?void 0:t.theme);const e=u.getThemeInterface(this.options.package,"DevupThemeColors","DevupThemeTypography");e&&(i.existsSync(this.options.interfacePath)||i.mkdirSync(this.options.interfacePath),i.writeFileSync(c.join(this.options.interfacePath,"theme.d.ts"),e,{encoding:"utf-8"})),i.writeFileSync(this.options.cssFile,u.getCss(),{encoding:"utf-8"})}apply(e){if(i.existsSync(this.options.devupPath)){try{this.writeDataFiles()}catch(o){console.error(o)}let t=null;e.hooks.afterCompile.tap("DevupUIWebpackPlugin",o=>{o.fileDependencies.add(this.options.devupPath),this.watch=!0}),e.hooks.watchRun.tapAsync("DevupUIWebpackPlugin",(o,r)=>{i.stat(this.options.devupPath,(p,h)=>{if(p)return console.error(`Error checking ${this.options.devupPath}:`,p),r();const d=h.mtimeMs;t&&t!==d&&this.writeDataFiles(),t=d,r()})})}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:m.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=P;
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;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAKvC,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,EAAE,2BAA2B,CAAA;IACpC,KAAK,UAAQ;gBAED,EACV,OAAO,EAAE,UAA8B,EACvC,OAAwC,EACxC,SAAwB,EACxB,aAAqB,GACtB,EAAE,OAAO,CAAC,2BAA2B,CAAC;IASvC,cAAc;IAyBd,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAsDzB"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAKvC,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,EAAE,2BAA2B,CAAA;IACpC,KAAK,UAAQ;gBAED,EACV,OAAO,EAAE,UAA8B,EACvC,OAAwC,EACxC,SAAwB,EACxB,aAAqB,GACtB,EAAE,OAAO,CAAC,2BAA2B,CAAC;IASvC,cAAc;IAyBd,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAqDzB"}
package/dist/plugin.js CHANGED
@@ -1,76 +1,76 @@
1
1
  var d = Object.defineProperty;
2
- var l = (i, e, t) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var n = (i, e, t) => l(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { readFileSync as m, existsSync as p, mkdirSync as f, writeFileSync as r, stat as g } from "node:fs";
5
- import { createRequire as v } from "node:module";
6
- import { dirname as P, join as c } from "node:path";
7
- import { fileURLToPath as k } from "node:url";
8
- import { registerTheme as y, getThemeInterface as D, getCss as w } from "@devup-ui/wasm";
9
- const F = k(import.meta.url), T = P(F);
2
+ var m = (i, e, t) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
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 a, stat as v } from "node:fs";
5
+ import { createRequire as P } from "node:module";
6
+ import { dirname as k, join as h } from "node:path";
7
+ import { fileURLToPath as D } from "node:url";
8
+ import { registerTheme as y, getThemeInterface as w, getCss as F } from "@devup-ui/wasm";
9
+ const T = D(import.meta.url), x = k(T);
10
10
  class _ {
11
11
  constructor({
12
12
  package: e = "@devup-ui/react",
13
- cssFile: t = c(T, "devup-ui.css"),
14
- devupPath: s = "devup.json",
15
- interfacePath: o = ".df"
13
+ cssFile: t = h(x, "devup-ui.css"),
14
+ devupPath: o = "devup.json",
15
+ interfacePath: s = ".df"
16
16
  }) {
17
17
  n(this, "options");
18
18
  n(this, "watch", !1);
19
19
  this.options = {
20
20
  package: e,
21
21
  cssFile: t,
22
- devupPath: s,
23
- interfacePath: o
22
+ devupPath: o,
23
+ interfacePath: s
24
24
  };
25
25
  }
26
26
  writeDataFiles() {
27
27
  var t;
28
28
  y(
29
- (t = JSON.parse(m(this.options.devupPath, "utf-8"))) == null ? void 0 : t.theme
29
+ (t = JSON.parse(f(this.options.devupPath, "utf-8"))) == null ? void 0 : t.theme
30
30
  );
31
- const e = D(
31
+ const e = w(
32
32
  this.options.package,
33
33
  "DevupThemeColors",
34
34
  "DevupThemeTypography"
35
35
  );
36
- e && (p(this.options.interfacePath) || f(this.options.interfacePath), r(
37
- c(this.options.interfacePath, "theme.d.ts"),
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
- )), r(this.options.cssFile, w(), {
42
+ )), a(this.options.cssFile, F(), {
43
43
  encoding: "utf-8"
44
44
  });
45
45
  }
46
46
  apply(e) {
47
- if (p(this.options.devupPath)) {
47
+ const t = p(this.options.devupPath);
48
+ if (t) {
48
49
  try {
49
50
  this.writeDataFiles();
50
51
  } catch (s) {
51
52
  console.error(s);
52
53
  }
53
- let t = null;
54
54
  e.hooks.afterCompile.tap("DevupUIWebpackPlugin", (s) => {
55
- s.fileDependencies.add(this.options.devupPath), this.watch = !0;
56
- }), e.hooks.watchRun.tapAsync(
57
- "DevupUIWebpackPlugin",
58
- (s, o) => {
59
- g(this.options.devupPath, (a, u) => {
60
- if (a)
61
- return console.error(`Error checking ${this.options.devupPath}:`, a), o();
62
- const h = u.mtimeMs;
63
- t && t !== h && this.writeDataFiles(), t = h, o();
64
- });
65
- }
66
- );
55
+ s.fileDependencies.add(this.options.devupPath);
56
+ });
67
57
  }
68
- p(this.options.cssFile) || r(this.options.cssFile, "", { encoding: "utf-8" }), e.options.module.rules.push({
58
+ let o = null;
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({
69
69
  test: /\.(tsx|ts|js|mjs|jsx)$/,
70
70
  exclude: /node_modules/,
71
71
  use: [
72
72
  {
73
- loader: v(import.meta.url).resolve(
73
+ loader: P(import.meta.url).resolve(
74
74
  "@devup-ui/webpack-plugin/loader"
75
75
  ),
76
76
  options: {
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.3",
4
+ "version": "0.1.5",
5
5
  "dependencies": {
6
- "webpack": "^5.97",
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"