diff --git a/packages/cli/.gitignore b/packages/cli/.gitignore deleted file mode 100644 index 332d941..0000000 --- a/packages/cli/.gitignore +++ /dev/null @@ -1 +0,0 @@ -src/cmd/editor/template/*.bundle.* diff --git a/packages/cli/.npmignore b/packages/cli/.npmignore index e037888..3c3629e 100644 --- a/packages/cli/.npmignore +++ b/packages/cli/.npmignore @@ -1,2 +1 @@ node_modules -src/cmd/editor/template/*.bundle.* diff --git a/packages/cli/README.md b/packages/cli/README.md index dddb8ab..224ecb2 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -1 +1,27 @@ -## iMove-cli \ No newline at end of file +## iMove-cli + +### Install + +```bash +npm i -g @imove/cli +``` + +### Usage + +- 初始化项目,创建 `imove.config.js` + +```bash +imove -i +# OR +imove --init +``` + +- 启动开发服务及编辑器 + +```bash +imove -de +# OR +imove --dev --editor +``` + +浏览器打开 [http://127.0.0.1:3500/](http://127.0.0.1:3500/) diff --git a/packages/cli/src/cmd/editor/build.js b/packages/cli/src/cmd/editor/build.js index f2bde6a..828c7f7 100644 --- a/packages/cli/src/cmd/editor/build.js +++ b/packages/cli/src/cmd/editor/build.js @@ -6,8 +6,9 @@ require('esbuild') .build({ bundle: true, entryPoints: [path.join(__dirname, 'template/app.jsx')], - outfile: path.join(__dirname, 'template/app.bundle.js'), + outfile: path.join(__dirname, 'template/dist/app.bundle.js'), plugins: [ + // fix import('antd/dist/antd.less') { name: 'resolve-antd-dist-less', setup: (build) => { @@ -22,6 +23,7 @@ require('esbuild') ); }, }, + // less lessLoader({ javascriptEnabled: true, }), diff --git a/packages/cli/src/cmd/editor/index.js b/packages/cli/src/cmd/editor/index.js index 7275fc4..4101635 100644 --- a/packages/cli/src/cmd/editor/index.js +++ b/packages/cli/src/cmd/editor/index.js @@ -32,12 +32,12 @@ class Editor extends Base { } get dbFile() { - const { dbFile } = this._dfFile || this.config || ''; + const dbFile = this._dbFile || (this.config || '').dbFile; return dbFile; } set dbFile(val) { - this._dfFile = val; + this._dbFile = val; } queryGraph(req, res) { diff --git a/packages/cli/src/cmd/editor/template/index.html b/packages/cli/src/cmd/editor/template/index.html index b2240f8..ef0d12f 100644 --- a/packages/cli/src/cmd/editor/template/index.html +++ b/packages/cli/src/cmd/editor/template/index.html @@ -4,11 +4,10 @@ iMove Editor - - +
- +