leanweb 1.1.9 → 1.2.0

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/README.md CHANGED
@@ -688,6 +688,11 @@ being notified when a next event is fired.
688
688
  parameters. `eventName` is the name of the event, and `data` is the payload data
689
689
  of the event.
690
690
 
691
+ ### Post dist hook
692
+
693
+ If `post-dist` file is present in the project root directory, it will be called
694
+ after `lw dist` is done. This could be useful to copy dist/\* to somewhere else.
695
+
691
696
  ## More examples and tutorials
692
697
 
693
698
  https://leanweb.app
package/commands/dist.js CHANGED
@@ -61,5 +61,9 @@ if (args.length >= 3) {
61
61
  project.resources?.forEach(resource => {
62
62
  fse.copySync(`./${utils.dirs.build}/${resource}`, `./${utils.dirs.dist}/${resource}`, { dereference: true });
63
63
  });
64
+
65
+ if (fs.statSync(`./post-dist`).isFile()) {
66
+ await utils.exec(`./post-dist`);
67
+ }
64
68
  });
65
69
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leanweb",
3
- "version": "1.1.9",
3
+ "version": "1.2.0",
4
4
  "description": "Builds framework agnostic web components.",
5
5
  "bin": {
6
6
  "leanweb": "leanweb.js",
@@ -20,25 +20,25 @@
20
20
  "author": "Qian Chen",
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
- "@babel/core": "^7.17.8",
24
- "@babel/parser": "^7.17.8",
25
- "@babel/plugin-transform-runtime": "^7.17.0",
26
- "@babel/preset-env": "^7.16.11",
27
- "babel-loader": "^8.2.4",
28
- "clean-css": "^5.3.0",
23
+ "@babel/core": "^7.18.10",
24
+ "@babel/parser": "^7.18.10",
25
+ "@babel/plugin-transform-runtime": "^7.18.10",
26
+ "@babel/preset-env": "^7.18.10",
27
+ "babel-loader": "^8.2.5",
28
+ "clean-css": "^5.3.1",
29
29
  "css-loader": "^6.7.1",
30
- "fs-extra": "^10.0.1",
31
- "globby": "^13.1.1",
30
+ "fs-extra": "^10.1.0",
31
+ "globby": "^13.1.2",
32
32
  "html-minifier": "^4.0.0",
33
- "isomorphic-git": "^1.17.0",
33
+ "isomorphic-git": "^1.19.1",
34
34
  "json5-loader": "^4.0.1",
35
35
  "node-watch": "^0.7.3",
36
- "parse5": "^6.0.1",
36
+ "parse5": "^7.0.0",
37
37
  "raw-loader": "^4.0.2",
38
- "sass": "^1.49.11",
39
- "sass-loader": "^12.6.0",
40
- "semver": "^7.3.5",
41
- "webpack": "^5.71.0",
42
- "webpack-dev-server": "^4.8.0"
38
+ "sass": "^1.54.2",
39
+ "sass-loader": "^13.0.2",
40
+ "semver": "^7.3.7",
41
+ "webpack": "^5.74.0",
42
+ "webpack-dev-server": "^4.9.3"
43
43
  }
44
44
  }
@@ -193,7 +193,7 @@ export default class LWElement extends HTMLElement {
193
193
  }
194
194
 
195
195
  _bindMethods() {
196
- const methodNames = ['update', 'applyStyles'];
196
+ const methodNames = ['update'];
197
197
  const proto = Object.getPrototypeOf(this);
198
198
  methodNames.push(...Object.getOwnPropertyNames(proto).filter(name => hasMethod(proto, name)));
199
199
  methodNames.push(...Object.getOwnPropertyNames(this).filter(name => hasMethod(this, name)));
@@ -467,18 +467,4 @@ export default class LWElement extends HTMLElement {
467
467
  this.update(node);
468
468
  });
469
469
  }
470
-
471
- applyStyles(...styles) {
472
- if (!styles) {
473
- return;
474
- }
475
- styles.forEach(style => {
476
- if (typeof style !== 'string') {
477
- style = style.toString();
478
- }
479
- const styleNode = document.createElement('style');
480
- styleNode.innerHTML = style;
481
- this.shadowRoot.appendChild(styleNode);
482
- });
483
- }
484
470
  }