@jayfong/x-server 2.56.1 → 2.57.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/lib/_cjs/cli/cli.js +5 -2
- package/lib/cli/cli.js +5 -2
- package/package.json +5 -2
package/lib/_cjs/cli/cli.js
CHANGED
|
@@ -6,6 +6,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
6
6
|
var _chokidar = _interopRequireDefault(require("chokidar"));
|
|
7
7
|
var _execa = _interopRequireDefault(require("execa"));
|
|
8
8
|
var _fsExtra = _interopRequireDefault(require("fs-extra"));
|
|
9
|
+
var _ignore = _interopRequireDefault(require("ignore"));
|
|
9
10
|
var _vscodeGenerateIndexStandalone = require("vscode-generate-index-standalone");
|
|
10
11
|
var _vtils = require("vtils");
|
|
11
12
|
var _yargs = _interopRequireDefault(require("yargs"));
|
|
@@ -48,9 +49,11 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
await _template_util.TemplateUtil.init(process.cwd());
|
|
52
|
+
const xsignoreFile = _path.default.join(process.cwd(), '.xsignore');
|
|
53
|
+
const ignoreFilter = (await _fsExtra.default.pathExists(xsignoreFile)) ? (0, _ignore.default)().add(await _fsExtra.default.readFile(xsignoreFile, 'utf-8')).createFilter() : undefined;
|
|
51
54
|
const watcher = _chokidar.default.watch(['src', '.env', '.env.*'], {
|
|
52
55
|
cwd: process.cwd(),
|
|
53
|
-
ignored: '**/*.test.*'
|
|
56
|
+
ignored: ['**/*.test.*', ...(ignoreFilter ? [ignoreFilter] : [])]
|
|
54
57
|
});
|
|
55
58
|
watcher.on('all', (0, _vtils.debounce)(async () => {
|
|
56
59
|
await _env_util.EnvUtil.importFile({
|
|
@@ -78,7 +81,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
78
81
|
console.log('==== 启动服务中 ====');
|
|
79
82
|
run();
|
|
80
83
|
}
|
|
81
|
-
},
|
|
84
|
+
}, 30));
|
|
82
85
|
}).command('build', '构建', _ => _.positional('external', {
|
|
83
86
|
alias: 'e',
|
|
84
87
|
describe: '不应该被打的包',
|
package/lib/cli/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ import path from 'path';
|
|
|
3
3
|
import chokidar from 'chokidar';
|
|
4
4
|
import execa from 'execa';
|
|
5
5
|
import fs from 'fs-extra';
|
|
6
|
+
import ignore from 'ignore';
|
|
6
7
|
import { generateManyIndex } from 'vscode-generate-index-standalone';
|
|
7
8
|
import { castArray, debounce } from 'vtils';
|
|
8
9
|
import yargs from 'yargs';
|
|
@@ -45,9 +46,11 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
await TemplateUtil.init(process.cwd());
|
|
49
|
+
const xsignoreFile = path.join(process.cwd(), '.xsignore');
|
|
50
|
+
const ignoreFilter = (await fs.pathExists(xsignoreFile)) ? ignore().add(await fs.readFile(xsignoreFile, 'utf-8')).createFilter() : undefined;
|
|
48
51
|
const watcher = chokidar.watch(['src', '.env', '.env.*'], {
|
|
49
52
|
cwd: process.cwd(),
|
|
50
|
-
ignored: '**/*.test.*'
|
|
53
|
+
ignored: ['**/*.test.*', ...(ignoreFilter ? [ignoreFilter] : [])]
|
|
51
54
|
});
|
|
52
55
|
watcher.on('all', debounce(async () => {
|
|
53
56
|
await EnvUtil.importFile({
|
|
@@ -75,7 +78,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
75
78
|
console.log('==== 启动服务中 ====');
|
|
76
79
|
run();
|
|
77
80
|
}
|
|
78
|
-
},
|
|
81
|
+
}, 30));
|
|
79
82
|
}).command('build', '构建', _ => _.positional('external', {
|
|
80
83
|
alias: 'e',
|
|
81
84
|
describe: '不应该被打的包',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jayfong/x-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.57.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "lib/_cjs/index.js",
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"bin": {
|
|
10
10
|
"xs": "lib/_cjs/cli/cli.js"
|
|
11
11
|
},
|
|
12
|
-
"files": [
|
|
12
|
+
"files": [
|
|
13
|
+
"lib"
|
|
14
|
+
],
|
|
13
15
|
"scripts": {
|
|
14
16
|
"build": "haoma compile",
|
|
15
17
|
"build_test_pkg": "tyn build && rm -rf ./lib_test && mkdir -p ./lib_test && cp -r ./lib ./lib_test/lib && cp ./package.json ./lib_test/package.json && cd ./tests/app && tyn add file:../../lib_test",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
"globby": "^11",
|
|
50
52
|
"got": "^11.8.2",
|
|
51
53
|
"http-errors": "^2.0.0",
|
|
54
|
+
"ignore": "^6.0.2",
|
|
52
55
|
"ioredis": "^5.3.2",
|
|
53
56
|
"jsonwebtoken": "^8.5.1",
|
|
54
57
|
"lru-cache": "^10.0.0",
|