@jayfong/x-server 2.9.9 → 2.10.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/build_util.js +18 -0
- package/lib/cli/build_util.js +15 -0
- package/package.json +4 -3
|
@@ -126,6 +126,23 @@ class BuildUtil {
|
|
|
126
126
|
loader: 'js'
|
|
127
127
|
};
|
|
128
128
|
});
|
|
129
|
+
build.onLoad({
|
|
130
|
+
filter: /\/vm2\/lib\/vm\.js$/
|
|
131
|
+
}, async args => {
|
|
132
|
+
let js = await _fsExtra.default.readFile(args.path, 'utf-8');
|
|
133
|
+
|
|
134
|
+
const jsDir = _nodePath.default.dirname(args.path);
|
|
135
|
+
|
|
136
|
+
const assetsDir = _nodePath.default.join(distDir, 'assets/vm2');
|
|
137
|
+
|
|
138
|
+
await _fsExtra.default.ensureDir(assetsDir);
|
|
139
|
+
js = js.replace(/__dirname/g, '"./assets/vm2"');
|
|
140
|
+
await Promise.all([_fsExtra.default.copyFile(_nodePath.default.join(jsDir, 'bridge.js'), _nodePath.default.join(assetsDir, 'bridge.js')), _fsExtra.default.copyFile(_nodePath.default.join(jsDir, 'setup-sandbox.js'), _nodePath.default.join(assetsDir, 'setup-sandbox.js'))]);
|
|
141
|
+
return {
|
|
142
|
+
contents: js,
|
|
143
|
+
loader: 'js'
|
|
144
|
+
};
|
|
145
|
+
});
|
|
129
146
|
}
|
|
130
147
|
|
|
131
148
|
}]
|
|
@@ -183,6 +200,7 @@ class BuildUtil {
|
|
|
183
200
|
await (0, _execa.default)('tyn', {
|
|
184
201
|
cwd: distDir,
|
|
185
202
|
stdio: 'inherit',
|
|
203
|
+
// @ts-ignore
|
|
186
204
|
env: {
|
|
187
205
|
// 禁止 yarn 更新检测,因网络原因容易超时长时间卡住
|
|
188
206
|
// https://classic.yarnpkg.com/lang/en/docs/yarnrc/#toc-disable-self-update-check
|
package/lib/cli/build_util.js
CHANGED
|
@@ -99,6 +99,20 @@ export class BuildUtil {
|
|
|
99
99
|
loader: 'js'
|
|
100
100
|
};
|
|
101
101
|
});
|
|
102
|
+
build.onLoad({
|
|
103
|
+
filter: /\/vm2\/lib\/vm\.js$/
|
|
104
|
+
}, async args => {
|
|
105
|
+
let js = await fs.readFile(args.path, 'utf-8');
|
|
106
|
+
const jsDir = path.dirname(args.path);
|
|
107
|
+
const assetsDir = path.join(distDir, 'assets/vm2');
|
|
108
|
+
await fs.ensureDir(assetsDir);
|
|
109
|
+
js = js.replace(/__dirname/g, '"./assets/vm2"');
|
|
110
|
+
await Promise.all([fs.copyFile(path.join(jsDir, 'bridge.js'), path.join(assetsDir, 'bridge.js')), fs.copyFile(path.join(jsDir, 'setup-sandbox.js'), path.join(assetsDir, 'setup-sandbox.js'))]);
|
|
111
|
+
return {
|
|
112
|
+
contents: js,
|
|
113
|
+
loader: 'js'
|
|
114
|
+
};
|
|
115
|
+
});
|
|
102
116
|
}
|
|
103
117
|
|
|
104
118
|
}]
|
|
@@ -155,6 +169,7 @@ export class BuildUtil {
|
|
|
155
169
|
await exec('tyn', {
|
|
156
170
|
cwd: distDir,
|
|
157
171
|
stdio: 'inherit',
|
|
172
|
+
// @ts-ignore
|
|
158
173
|
env: {
|
|
159
174
|
// 禁止 yarn 更新检测,因网络原因容易超时长时间卡住
|
|
160
175
|
// https://classic.yarnpkg.com/lang/en/docs/yarnrc/#toc-disable-self-update-check
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jayfong/x-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "lib/_cjs/index.js",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"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",
|
|
19
19
|
"dev": "rm -rf lib && tsc -w -p ./tsconfig.build.json",
|
|
20
20
|
"release": "source proxy-use-trojan.sh && tyn test && standard-version -a && tyn build && npm publish && haoma run ./scripts/publish_client_helper_package.ts && git push --follow-tags origin master",
|
|
21
|
-
"test": "tsc --noEmit -p ./tsconfig.build.json && jest",
|
|
21
|
+
"test": "tsc --noEmit -p ./tsconfig.build.json && jest \"$(pwd)/src/\"",
|
|
22
|
+
"test_all": "tsc --noEmit -p ./tsconfig.build.json && jest",
|
|
22
23
|
"updeps": "tnpx npm-check-updates --target minor --upgrade"
|
|
23
24
|
},
|
|
24
25
|
"husky": {
|
|
@@ -73,7 +74,7 @@
|
|
|
73
74
|
"ts-morph": "^12.2.0",
|
|
74
75
|
"utf-8-validate": "^5.0.9",
|
|
75
76
|
"vscode-generate-index-standalone": "^1.7.1",
|
|
76
|
-
"vtils": "^4.
|
|
77
|
+
"vtils": "^4.85.2",
|
|
77
78
|
"yargs": "^17.4.1"
|
|
78
79
|
},
|
|
79
80
|
"devDependencies": {
|