leanweb 1.0.2 → 1.0.6

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/commands/init.js CHANGED
@@ -91,7 +91,11 @@
91
91
  name: 'Leanweb',
92
92
  email: 'leanweb@leanweb.app',
93
93
  },
94
- message: 'Init commit.'
95
- })
94
+ message: 'lw init'
95
+ });
96
+ console.log('\nSome useful commands:');
97
+ console.log('"lw s" to start the dev server.');
98
+ console.log('"lw d" to build for production. The output will be in dist/ directory.');
99
+ console.log('"lw g my-new-component" to generate a new standard web component.');
96
100
  }
97
101
  })();
package/commands/serve.js CHANGED
@@ -10,7 +10,7 @@ if (args.length >= 3) {
10
10
  env = args[2];
11
11
  }
12
12
 
13
- const address = process.env.address || '127.0.0.1';
13
+ const host = process.env.host || '127.0.0.1';
14
14
  let port = process.env.port || 2020;
15
15
  const noopen = process.env.noopen || false;
16
16
 
@@ -54,19 +54,21 @@ const noopen = process.env.noopen || false;
54
54
 
55
55
  const compiler = webpack(webpackDevConfig);
56
56
 
57
+ while (await utils.portInUse(port, host)) {
58
+ ++port;
59
+ }
60
+
57
61
  const devServerOptions = {
58
62
  ...webpackDevConfig.devServer,
59
- contentBase: process.cwd() + `/${utils.dirs.serve}/`,
60
- watchContentBase: true,
61
- publicPath: '/',
62
- hot: true,
63
+ static: {
64
+ directory: process.cwd() + `/${utils.dirs.serve}/`,
65
+ watch: true,
66
+ },
67
+ port,
68
+ host,
63
69
  open: !noopen,
64
- stats: 'errors-warnings',
65
70
  };
66
- const server = new WebpackDevServer(compiler, devServerOptions);
71
+ const server = new WebpackDevServer(devServerOptions, compiler);
67
72
 
68
- while (await utils.portInUse(port, address)) {
69
- ++port;
70
- }
71
- server.listen(port, address);
73
+ server.start();
72
74
  })();
package/commands/utils.js CHANGED
@@ -68,7 +68,6 @@ module.exports.getWebPackConfig = (outputDir, project) => {
68
68
  options: {
69
69
  presets: [require.resolve('@babel/preset-env'), {
70
70
  plugins: [
71
- // '@babel/plugin-proposal-class-properties',
72
71
  '@babel/plugin-transform-runtime'
73
72
  ].map(require.resolve)
74
73
  }]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leanweb",
3
- "version": "1.0.2",
3
+ "version": "1.0.6",
4
4
  "description": "Builds framework agnostic web components.",
5
5
  "bin": {
6
6
  "leanweb": "leanweb.js",
@@ -19,25 +19,25 @@
19
19
  "author": "Qian Chen",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@babel/core": "^7.14.3",
23
- "@babel/parser": "^7.14.3",
24
- "@babel/plugin-transform-runtime": "^7.14.3",
25
- "@babel/preset-env": "^7.14.2",
26
- "babel-loader": "^8.2.2",
27
- "clean-css": "^5.1.2",
28
- "css-loader": "^5.2.5",
22
+ "@babel/core": "^7.16.5",
23
+ "@babel/parser": "^7.16.6",
24
+ "@babel/plugin-transform-runtime": "^7.16.5",
25
+ "@babel/preset-env": "^7.16.5",
26
+ "babel-loader": "^8.2.3",
27
+ "clean-css": "^5.2.2",
28
+ "css-loader": "^6.5.1",
29
29
  "fs-extra": "^10.0.0",
30
- "globby": "^11.0.3",
30
+ "globby": "^11.0.4",
31
31
  "html-minifier": "^4.0.0",
32
- "isomorphic-git": "^1.8.2",
32
+ "isomorphic-git": "^1.10.2",
33
33
  "json5-loader": "^4.0.1",
34
- "node-watch": "^0.7.1",
34
+ "node-watch": "^0.7.2",
35
35
  "parse5": "^6.0.1",
36
36
  "raw-loader": "^4.0.2",
37
- "sass": "^1.34.0",
38
- "sass-loader": "^11.1.1",
37
+ "sass": "^1.45.0",
38
+ "sass-loader": "^12.4.0",
39
39
  "semver": "^7.3.5",
40
- "webpack": "^5.37.1",
41
- "webpack-dev-server": "^3.11.2"
40
+ "webpack": "^5.65.0",
41
+ "webpack-dev-server": "^4.6.0"
42
42
  }
43
43
  }