leanweb 1.3.6 → 2.0.1

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
@@ -1,51 +1,44 @@
1
- import fs from 'fs';
2
- import fse from 'fs-extra';
3
- import git from 'isomorphic-git';
4
- import { globby } from 'globby';
5
- import * as utils from './utils.js';
6
-
7
1
  import path from 'path';
8
2
  import { fileURLToPath } from 'url';
9
3
  const __filename = fileURLToPath(import.meta.url);
10
4
  const __dirname = path.dirname(__filename);
11
-
12
5
  import { createRequire } from "module";
13
6
  const require = createRequire(import.meta.url);
14
7
 
15
- (async () => {
16
- const args = process.argv;
8
+ import fs from 'fs';
9
+ import fse from 'fs-extra';
10
+ import git from 'isomorphic-git';
11
+ import { globby } from 'globby';
12
+ import * as utils from './utils.js';
17
13
 
18
- const leanwebJSONExisted = fs.existsSync(`${process.cwd()}/${utils.dirs.src}/leanweb.json`);
19
- const packageJSONExisted = fs.existsSync(`${process.cwd()}/package.json`);
14
+ (async () => {
15
+ const args = process.argv;
20
16
 
21
- const lwPackage = require(`${__dirname}/../package.json`);
17
+ const leanwebJSONExisted = fs.existsSync(`${process.cwd()}/${utils.dirs.src}/leanweb.json`);
22
18
 
23
- if (leanwebJSONExisted) {
24
- console.error('Error: leanweb.json existed.');
25
- return;
26
- }
19
+ const lwPackage = require(`${__dirname}/../package.json`);
27
20
 
28
- if (!packageJSONExisted) {
29
- utils.exec(`npm init -y`);
30
- }
21
+ if (leanwebJSONExisted) {
22
+ console.error('Error: leanweb.json existed.');
23
+ return;
24
+ }
31
25
 
32
- let projectName = path.basename(path.resolve());
26
+ let projectName = path.basename(path.resolve());
33
27
 
34
- if (args.length >= 3) {
35
- projectName = args[2];
36
- }
28
+ if (args.length >= 3) {
29
+ projectName = args[2];
30
+ }
37
31
 
38
- const leanwebData = {
39
- name: projectName,
40
- version: lwPackage.version,
41
- components: [],
42
- imports: [],
43
- resources: [
44
- 'resources/'
45
- ],
46
- };
32
+ const leanwebData = {
33
+ name: projectName,
34
+ version: lwPackage.version,
35
+ components: [],
36
+ resources: [
37
+ 'resources/'
38
+ ],
39
+ };
47
40
 
48
- const projectScss = `// html,
41
+ const projectScss = `// html,
49
42
  // body {
50
43
  // height: 100%;
51
44
  // width: 100%;
@@ -56,55 +49,53 @@ const require = createRequire(import.meta.url);
56
49
  // }
57
50
  `
58
51
 
59
- const globalScss = `// div {
52
+ const globalScss = `// div {
60
53
  // color: tomato;
61
54
  // }
62
55
  `;
63
56
 
64
- fs.mkdirSync(`${utils.dirs.src}/resources/`, { recursive: true });
65
- fs.writeFileSync(`${utils.dirs.src}/leanweb.json`, JSON.stringify(leanwebData, null, 2));
66
-
67
- utils.exec(`npm i -D @babel/runtime --loglevel=error`);
68
-
69
- utils.exec(`npx leanweb generate root`);
70
-
71
- fse.copySync(`${__dirname}/../templates/lib`, `./${utils.dirs.src}/lib/`);
72
-
73
- let htmlString = fs.readFileSync(`${__dirname}/../templates/index.html`, 'utf8');
74
- htmlString = htmlString.replace(/\$\{project\.name\}/g, projectName);
75
- fs.writeFileSync(`./${utils.dirs.src}/index.html`, htmlString);
76
- fs.writeFileSync(`./src/${projectName}.scss`, projectScss);
77
- fs.writeFileSync(`./${utils.dirs.src}/global-styles.scss`, globalScss);
78
- fse.copySync(`${__dirname}/../templates/favicon.svg`, `./${utils.dirs.src}/favicon.svg`);
79
- fse.copySync(`${__dirname}/../templates/env.js`, `./${utils.dirs.src}/env.js`);
80
- fse.copySync(`${__dirname}/../templates/env/`, `./${utils.dirs.src}/env/`);
81
-
82
- if (!(fs.existsSync(`${process.cwd()}/.git/`) && fs.statSync(`${process.cwd()}/.git/`).isDirectory())) {
83
- await git.init({ fs, dir: process.cwd() });
84
-
85
- if (fs.existsSync(`${process.cwd()}/.gitignore`) && fs.statSync(`${process.cwd()}/.gitignore`).isFile()) {
86
- fs.appendFileSync(`${process.cwd()}/.gitignore`, `\nnode_modules/\n${utils.dirs.build}/\n${utils.dirs.dist}/\n${utils.dirs.serve}/\n${utils.dirs.electron}/\n`, 'utf8');
87
- } else {
88
- fs.writeFileSync(`${process.cwd()}/.gitignore`, `node_modules/\n${utils.dirs.build}/\n${utils.dirs.dist}/\n${utils.dirs.serve}/\n${utils.dirs.electron}/\n`, 'utf8');
89
- }
90
-
91
- const paths = await globby(['./**', './**/.*'], { gitignore: true });
92
- for (const filepath of paths) {
93
- await git.add({ fs, dir: process.cwd(), filepath });
94
- }
95
- await git.commit({
96
- fs,
97
- dir: process.cwd(),
98
- author: {
99
- name: 'Leanweb',
100
- email: 'leanweb@leanweb.app',
101
- },
102
- message: 'lw init'
103
- });
104
- console.log('\nSome useful commands:');
105
- console.log('"lw s" to start the dev server.');
106
- console.log('"lw di" to build for production. The output will be in dist/ directory.');
107
- console.log('"lw g my-new-component" to generate a new standard web component.');
108
- console.log('"lw h" to get more help information.');
109
- }
57
+ fs.mkdirSync(`${utils.dirs.src}/resources/`, { recursive: true });
58
+ fs.writeFileSync(`${utils.dirs.src}/leanweb.json`, JSON.stringify(leanwebData, null, 2));
59
+
60
+ utils.exec(`npx leanweb generate root`);
61
+
62
+ fse.copySync(`${__dirname}/../templates/lib`, `./${utils.dirs.src}/lib/`);
63
+
64
+ let htmlString = fs.readFileSync(`${__dirname}/../templates/index.html`, 'utf8');
65
+ htmlString = htmlString.replace(/\$\{project\.name\}/g, projectName);
66
+ fs.writeFileSync(`./${utils.dirs.src}/index.html`, htmlString);
67
+ fs.writeFileSync(`./src/${projectName}.scss`, projectScss);
68
+ fs.writeFileSync(`./${utils.dirs.src}/global-styles.scss`, globalScss);
69
+ fse.copySync(`${__dirname}/../templates/favicon.svg`, `./${utils.dirs.src}/favicon.svg`);
70
+ fse.copySync(`${__dirname}/../templates/env.js`, `./${utils.dirs.src}/env.js`);
71
+ fse.copySync(`${__dirname}/../templates/env/`, `./${utils.dirs.src}/env/`);
72
+
73
+ if (!(fs.existsSync(`${process.cwd()}/.git/`) && fs.statSync(`${process.cwd()}/.git/`).isDirectory())) {
74
+ await git.init({ fs, dir: process.cwd() });
75
+
76
+ if (fs.existsSync(`${process.cwd()}/.gitignore`) && fs.statSync(`${process.cwd()}/.gitignore`).isFile()) {
77
+ fs.appendFileSync(`${process.cwd()}/.gitignore`, `\n${utils.dirs.build}/\n${utils.dirs.dist}/\n${utils.dirs.serve}/\n`, 'utf8');
78
+ } else {
79
+ fs.writeFileSync(`${process.cwd()}/.gitignore`, `${utils.dirs.build}/\n${utils.dirs.dist}/\n${utils.dirs.serve}/\n`, 'utf8');
80
+ }
81
+
82
+ const paths = await globby(['./**', './**/.*'], { gitignore: true });
83
+ for (const filepath of paths) {
84
+ await git.add({ fs, dir: process.cwd(), filepath });
85
+ }
86
+ await git.commit({
87
+ fs,
88
+ dir: process.cwd(),
89
+ author: {
90
+ name: 'Leanweb',
91
+ email: 'leanweb@leanweb.app',
92
+ },
93
+ message: 'lw init'
94
+ });
95
+ console.log('\nSome useful commands:');
96
+ console.log('"lw s" to start the dev server.');
97
+ console.log('"lw di" to build for production. The output will be in dist/ directory.');
98
+ console.log('"lw g my-new-component" to generate a new standard web component.');
99
+ console.log('"lw h" to get more help information.');
100
+ }
110
101
  })();
package/commands/serve.js CHANGED
@@ -1,17 +1,17 @@
1
+ import { createRequire } from "module";
2
+ const require = createRequire(import.meta.url);
3
+
1
4
  import fs from 'fs';
2
5
  import fse from 'fs-extra';
3
6
  import * as utils from './utils.js';
4
- import webpack from 'webpack';
5
7
  import watch from 'node-watch';
6
- import WebpackDevServer from 'webpack-dev-server';
8
+ import liveServer from 'live-server';
7
9
 
8
- import { createRequire } from "module";
9
- const require = createRequire(import.meta.url);
10
10
 
11
11
  let env = '';
12
12
  const args = process.argv;
13
13
  if (args.length >= 3) {
14
- env = args[2];
14
+ env = args[2];
15
15
  }
16
16
 
17
17
  const host = process.env.host || '127.0.0.1';
@@ -20,62 +20,41 @@ const noopen = process.env.noopen || false;
20
20
 
21
21
  (async () => {
22
22
 
23
- const project = require(`${process.cwd()}/${utils.dirs.src}/leanweb.json`);
24
-
25
- const build = async (eventType, filename) => {
26
- // console.log(eventType + ': ', filename);
27
- try {
28
- await utils.exec(`npx leanweb build ${env}`);
29
- fse.copySync(`./${utils.dirs.build}/index.html`, `./${utils.dirs.serve}/index.html`);
30
- fse.copySync(`./${utils.dirs.build}/${project.name}.css`, `./${utils.dirs.serve}/${project.name}.css`);
31
- fse.copySync(`./${utils.dirs.build}/favicon.svg`, `./${utils.dirs.serve}/favicon.svg`);
32
- project.resources?.forEach(resource => {
33
- const source = `./${utils.dirs.build}/${resource}`;
34
- if (fs.existsSync(source)) {
35
- fse.copySync(source, `./${utils.dirs.serve}/${resource}`, { filter: utils.copySymbolLinkFilter });
36
- }
37
- });
38
- } catch (e) {
39
- console.error(e);
40
- }
41
- };
42
-
43
- const throttledBuild = utils.throttle(build);
44
- watch(process.cwd() + `/${utils.dirs.src}/`, { recursive: true }, (eventType, filename) => {
45
- throttledBuild(eventType, filename);
46
- });
47
-
48
- build();
49
-
50
- const webpackConfig = utils.getWebPackConfig(utils.dirs.serve, project);
51
-
52
- const webpackDevConfig = {
53
- ...webpackConfig,
54
- mode: 'development',
55
- // watch: true,
56
- devtool: 'eval-cheap-module-source-map',
57
- performance: {
58
- hints: false,
59
- },
60
- };
61
-
62
- const compiler = webpack(webpackDevConfig);
63
-
64
- while (await utils.portInUse(port, host)) {
65
- ++port;
66
- }
67
-
68
- const devServerOptions = {
69
- ...webpackDevConfig.devServer,
70
- static: {
71
- directory: process.cwd() + `/${utils.dirs.serve}/`,
72
- watch: true,
73
- },
74
- port,
75
- host,
76
- open: !noopen,
77
- };
78
- const server = new WebpackDevServer(devServerOptions, compiler);
79
-
80
- server.start();
23
+ const project = require(`${process.cwd()}/${utils.dirs.src}/leanweb.json`);
24
+
25
+ const build = async (eventType, filename) => {
26
+ // console.log(eventType + ': ', filename);
27
+ try {
28
+ await utils.exec(`npx leanweb build ${env}`);
29
+ fse.copySync(`./${utils.dirs.build}/index.html`, `./${utils.dirs.serve}/index.html`);
30
+ fse.copySync(`./${utils.dirs.build}/${project.name}.css`, `./${utils.dirs.serve}/${project.name}.css`);
31
+ fse.copySync(`./${utils.dirs.build}/favicon.svg`, `./${utils.dirs.serve}/favicon.svg`);
32
+ project.resources?.forEach(resource => {
33
+ const source = `./${utils.dirs.build}/${resource}`;
34
+ if (fs.existsSync(source)) {
35
+ fse.copySync(source, `./${utils.dirs.serve}/${resource}`, { filter: utils.copySymbolLinkFilter });
36
+ }
37
+ });
38
+ } catch (e) {
39
+ console.error(e);
40
+ }
41
+ };
42
+
43
+ const throttledBuild = utils.throttle(build);
44
+ watch(process.cwd() + `/${utils.dirs.src}/`, { recursive: true }, (eventType, filename) => {
45
+ throttledBuild(eventType, filename);
46
+ });
47
+
48
+ build();
49
+
50
+ const params = {
51
+ port,
52
+ host,
53
+ root: utils.dirs.build,
54
+ open: !noopen,
55
+ file: 'index.html',
56
+ wait: 1000,
57
+ logLevel: 0,
58
+ };
59
+ liveServer.start(params);
81
60
  })();
@@ -1,61 +1,32 @@
1
- import fs from 'fs';
2
- import fse from 'fs-extra';
3
- import semver from 'semver';
4
- import * as utils from './utils.js';
5
-
6
1
  import path from 'path';
7
2
  import { fileURLToPath } from 'url';
8
3
  const __filename = fileURLToPath(import.meta.url);
9
4
  const __dirname = path.dirname(__filename);
10
-
11
5
  import { createRequire } from "module";
12
6
  const require = createRequire(import.meta.url);
13
7
 
8
+ import fs from 'fs';
9
+ import fse from 'fs-extra';
10
+ import semver from 'semver';
11
+ import * as utils from './utils.js';
12
+
14
13
  const leanwebPackageJSON = require(`${__dirname}/../package.json`);
15
14
  const projectLeanwebJSON = require(`${process.cwd()}/${utils.dirs.src}/leanweb.json`);
16
15
 
17
- const upgradeTo045 = () => {
18
- const projectName = projectLeanwebJSON.name;
19
- projectLeanwebJSON.components.forEach(cmp => {
20
- const component = projectName + '-' + cmp;
21
-
22
- const filePath = process.cwd() + `/${utils.dirs.src}/components/` + cmp + '/' + cmp + '.js';
23
- const oldSrc = fs.readFileSync(filePath, 'utf8');
24
- const newSrc = oldSrc.replace(/import\s+interpolation\s+from\s+\'.\/ast\.js\';/, 'import ast from \'./ast.js\';')
25
- .replace(/const\s+component\s+=\s+{\s+id\:\s+'.+?',\s+interpolation\s+};/, '')
26
- .replace(/component\.id/g, '\'' + component + '\'')
27
- .replace(/super\(component\);/, 'super(ast);');
28
- fs.writeFileSync(filePath, newSrc);
29
- });
30
- };
31
-
32
- const upgradeTo081 = () => {
33
- fse.copySync(`${__dirname}/../templates/env`, `./${utils.dirs.src}/env/`);
34
- fse.copySync(`${__dirname}/../templates/env.js`, `./${utils.dirs.src}/env.js`);
35
- };
36
-
37
16
  const upgradeTo088 = () => {
38
- utils.exec(`npm i -D @babel/runtime --loglevel=error`);
17
+ utils.exec(`npm i -D @babel/runtime --loglevel=error`);
39
18
  };
40
19
 
41
20
  const upgradeAvailable = semver.gt(leanwebPackageJSON.version, projectLeanwebJSON.version);
42
21
  if (upgradeAvailable) {
43
- fse.copySync(`${__dirname}/../templates/lib`, `./${utils.dirs.src}/lib/`, { dereference: true });
44
- const oldVersion = projectLeanwebJSON.version;
45
- projectLeanwebJSON.version = leanwebPackageJSON.version;
46
- fs.writeFileSync(`${process.cwd()}/${utils.dirs.src}/leanweb.json`, JSON.stringify(projectLeanwebJSON, null, 2));
47
-
48
- if (semver.gte(leanwebPackageJSON.version, '0.4.5') && semver.lt(oldVersion, '0.4.5')) {
49
- upgradeTo045();
50
- }
51
-
52
- if (semver.gte(leanwebPackageJSON.version, '0.8.1') && semver.lt(oldVersion, '0.8.1')) {
53
- upgradeTo081();
54
- }
22
+ fse.copySync(`${__dirname}/../templates/lib`, `./${utils.dirs.src}/lib/`, { dereference: true });
23
+ const oldVersion = projectLeanwebJSON.version;
24
+ projectLeanwebJSON.version = leanwebPackageJSON.version;
25
+ fs.writeFileSync(`${process.cwd()}/${utils.dirs.src}/leanweb.json`, JSON.stringify(projectLeanwebJSON, null, 2));
55
26
 
56
- if (semver.gte(leanwebPackageJSON.version, '0.8.8') && semver.lt(oldVersion, '0.8.8')) {
57
- upgradeTo088();
58
- }
27
+ if (semver.gte(leanwebPackageJSON.version, '0.8.8') && semver.lt(oldVersion, '0.8.8')) {
28
+ upgradeTo088();
29
+ }
59
30
 
60
- console.log('Leanweb upgraded:', oldVersion, '=>', leanwebPackageJSON.version);
31
+ console.log('Leanweb upgraded:', oldVersion, '=>', leanwebPackageJSON.version);
61
32
  }
package/commands/utils.js CHANGED
@@ -1,139 +1,76 @@
1
- // const { execSync } = require('child_process');
2
1
  import { execSync } from 'child_process';
3
- // const sass = require('sass');
4
2
  import sass from 'sass';
5
- // import path from 'path';
6
3
  import path from 'path';
7
- // const net = require('net');
8
4
  import net from 'net';
9
-
10
- // import fse from 'fs-extra';
11
5
  import fse from 'fs-extra';
12
6
 
13
- import { createRequire } from "module";
14
- const require = createRequire(import.meta.url);
15
-
16
7
  export const dirs = {
17
- src: 'src',
18
- build: 'build',
19
- serve: 'serve',
20
- dist: 'dist',
21
- electron: 'electron',
8
+ src: 'src',
9
+ build: 'build',
10
+ serve: 'serve',
11
+ dist: 'dist',
22
12
  };
23
13
 
24
14
  export const copySymbolLinkFilter = (src, dest) => {
25
- const destStats = fse.existsSync(dest) && fse.lstatSync(dest);
26
- return !destStats?.isSymbolicLink?.();
15
+ const destStats = fse.existsSync(dest) && fse.lstatSync(dest);
16
+ return !destStats?.isSymbolicLink?.();
27
17
  };
28
18
 
29
19
  export const exec = command => execSync(command, { encoding: 'utf8', stdio: 'inherit' });
30
20
 
31
21
  export const buildCSS = (scssString, ...currentPaths) => {
32
- if (scssString.trim()) {
33
- const loadPaths = [...currentPaths, path.resolve(process.cwd(), dirs.build), path.resolve(process.cwd(), 'node_modules')];
34
- const cssResult = sass.compileString(scssString, { loadPaths });
35
- return cssResult.css.toString().trim();
36
- }
37
- return '';
22
+ if (scssString.trim()) {
23
+ const loadPaths = [...currentPaths, path.resolve(process.cwd(), dirs.build)];
24
+ const cssResult = sass.compileString(scssString, { loadPaths });
25
+ return cssResult.css.toString().trim();
26
+ }
27
+ return '';
38
28
  };
39
29
 
40
30
  export const getComponentName = cmp => {
41
- const indexOfLastSlash = cmp.lastIndexOf('/');
42
- if (indexOfLastSlash > -1) {
43
- return cmp.substring(indexOfLastSlash + 1);
44
- }
45
- return cmp;
31
+ const indexOfLastSlash = cmp.lastIndexOf('/');
32
+ if (indexOfLastSlash > -1) {
33
+ return cmp.substring(indexOfLastSlash + 1);
34
+ }
35
+ return cmp;
46
36
  };
47
37
 
48
38
  export const getPathLevels = filePath => {
49
- filePath = path.normalize(filePath);
50
- const numSlashes = filePath.replace(/[^\/]/g, '').length;
51
- let ret = '';
52
- for (let i = 0; i < numSlashes; ++i) {
53
- ret += '../';
54
- }
55
- return ret;
39
+ filePath = path.normalize(filePath);
40
+ const numSlashes = filePath.replace(/[^\/]/g, '').length;
41
+ let ret = '';
42
+ for (let i = 0; i < numSlashes; ++i) {
43
+ ret += '../';
44
+ }
45
+ return ret;
56
46
  };
57
47
 
58
48
  export const throttle = (callback, limit = 100) => {
59
- let wait = false;
60
- return function () {
61
- if (!wait) {
62
- wait = true;
63
- setTimeout(() => {
64
- wait = false;
65
- callback.apply(null, arguments);
66
- }, limit);
67
- }
68
- };
69
- };
70
-
71
- export const getWebPackConfig = (outputDir, project) => {
72
- return {
73
- entry: process.cwd() + `/${dirs.build}/${project.name}.js`,
74
- output: {
75
- path: process.cwd() + `/${outputDir}/`,
76
- filename: `${project.name}.js`,
77
- },
78
- module: {
79
- rules: [{
80
- test: path.resolve(process.cwd()),
81
- exclude: /node_modules/,
82
- loader: require.resolve('babel-loader'),
83
- options: {
84
- presets: [require.resolve('@babel/preset-env'), {
85
- plugins: [
86
- '@babel/plugin-transform-runtime'
87
- ].map(require.resolve)
88
- }]
89
- },
90
- }, {
91
- test: /\.(scss|sass|css)$/i,
92
- use: [
93
- {
94
- loader: require.resolve('css-loader'),
95
- },
96
- {
97
- loader: require.resolve('sass-loader'),
98
- options: {
99
- sassOptions: {
100
- includePaths: [path.resolve(process.cwd(), 'node_modules')],
101
- }
102
- }
103
- },
104
- ],
105
- }, {
106
- test: /\.json$/i,
107
- loader: require.resolve('json5-loader'),
108
- options: {
109
- esModule: true,
110
- },
111
- type: 'javascript/auto',
112
- }, {
113
- loader: require.resolve('raw-loader'),
114
- exclude: [
115
- /\.(js|mjs|jsx|ts|tsx)$/i,
116
- /\.(json|json5)$/i,
117
- /\.(css|scss|sass)$/i
118
- ],
119
- }]
120
- },
121
- }
49
+ let wait = false;
50
+ return function () {
51
+ if (!wait) {
52
+ wait = true;
53
+ setTimeout(() => {
54
+ wait = false;
55
+ callback.apply(null, arguments);
56
+ }, limit);
57
+ }
58
+ };
122
59
  };
123
60
 
124
61
  export const portInUse = (port, address = '127.0.0.1') => {
125
- return new Promise((resolve, reject) => {
126
- const server = net.createServer(socket => socket.pipe(socket));
127
-
128
- server.listen(port, address);
129
- server.on('error', e => {
130
- resolve(true);
131
- });
132
- server.on('listening', e => {
133
- server.close();
134
- resolve(false);
135
- });
136
- });
62
+ return new Promise((resolve, reject) => {
63
+ const server = net.createServer(socket => socket.pipe(socket));
64
+
65
+ server.listen(port, address);
66
+ server.on('error', e => {
67
+ resolve(true);
68
+ });
69
+ server.on('listening', e => {
70
+ server.close();
71
+ resolve(false);
72
+ });
73
+ });
137
74
  };
138
75
 
139
76
  const initNote = `Usage: leanweb init or leanweb init project-name
@@ -216,10 +153,6 @@ const upgradeNote = `Usage: leanweb upgrade
216
153
  This will upgrade leanweb runtime in the src/lib directory.
217
154
  `;
218
155
 
219
- const electronNote = `Usage: leanweb electron [env]
220
- This will run the app as native desktop app using Electron.
221
- `;
222
-
223
156
  const destroyNote = `Usage leanweb destroy project-name
224
157
  This will remove the src/, build/ and dist/ directory. Please
225
158
  note the src directory will be deleted by this command.
@@ -236,15 +169,14 @@ const versionNote = `Usage: leanweb version
236
169
  Print version information for leanweb.`;
237
170
 
238
171
  export const targets = {
239
- 'init': { file: 'init.js', note: initNote },
240
- 'generate': { file: 'generate.js', note: generateNote },
241
- 'serve': { file: 'serve.js', note: serveNote },
242
- 'build': { file: 'build.js', note: buildNote },
243
- 'dist': { file: 'dist.js', note: distNote },
244
- 'upgrade': { file: 'upgrade.js', note: upgradeNote },
245
- 'clean': { file: 'clean.js', note: cleanNote },
246
- 'electron': { file: 'electron.js', note: electronNote },
247
- 'destroy': { file: 'destroy.js', note: destroyNote },
248
- 'help': { file: 'help.js', note: helpNote },
249
- 'version': { file: 'version.js', note: versionNote },
172
+ 'init': { file: 'init.js', note: initNote },
173
+ 'generate': { file: 'generate.js', note: generateNote },
174
+ 'serve': { file: 'serve.js', note: serveNote },
175
+ 'build': { file: 'build.js', note: buildNote },
176
+ 'dist': { file: 'dist.js', note: distNote },
177
+ 'upgrade': { file: 'upgrade.js', note: upgradeNote },
178
+ 'clean': { file: 'clean.js', note: cleanNote },
179
+ 'destroy': { file: 'destroy.js', note: destroyNote },
180
+ 'help': { file: 'help.js', note: helpNote },
181
+ 'version': { file: 'version.js', note: versionNote },
250
182
  };
@@ -1,4 +1,5 @@
1
1
  import { createRequire } from "module";
2
2
  const require = createRequire(import.meta.url);
3
+
3
4
  const packageJSON = require('../package.json');
4
5
  console.log(packageJSON.name, packageJSON.version);