@tuya-sat/micro-script 3.0.19 → 3.0.20
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/dist/scripts/start.js +3 -1
- package/dist/template/index.js +2 -0
- package/package.json +4 -4
package/dist/scripts/start.js
CHANGED
|
@@ -17,9 +17,11 @@ const portfinder_1 = __importDefault(require("portfinder"));
|
|
|
17
17
|
const mock_1 = __importDefault(require("../module/mock"));
|
|
18
18
|
const bundleServer_1 = require("../module/bundleServer");
|
|
19
19
|
const proxy_1 = __importDefault(require("../module/proxy"));
|
|
20
|
+
const template_1 = __importDefault(require("../template"));
|
|
20
21
|
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
yield (0, template_1.default)();
|
|
21
23
|
let defaultPort = 9000;
|
|
22
|
-
console.log(chalk_1.default.yellow(
|
|
24
|
+
console.log(chalk_1.default.yellow('如果是pc端的微应用调试,请勿使用该命令,考虑使用`start --main`或`start --main --proxy`'));
|
|
23
25
|
//检测端口占用情况
|
|
24
26
|
const port = yield portfinder_1.default.getPortPromise({
|
|
25
27
|
port: defaultPort,
|
package/dist/template/index.js
CHANGED
|
@@ -51,6 +51,8 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
51
51
|
const microPath = path.join(process.cwd(), 'node_modules/.micro');
|
|
52
52
|
!fs.existsSync(microPath) && fs.mkdirSync(microPath, { recursive: true });
|
|
53
53
|
fs.copyFileSync(path.join(__dirname, './main-app/index.tsx'), path.join(microPath, 'index.tsx'));
|
|
54
|
+
fs.copyFileSync(path.join(__dirname, './main-app/index.tsx'), path.join(microPath, 'index.tsx'));
|
|
55
|
+
fs.copyFileSync(path.join(__dirname, './main-app/utils.ts'), path.join(microPath, 'utils.ts'));
|
|
54
56
|
}
|
|
55
57
|
if (isMonorepo()) {
|
|
56
58
|
fs.readdirSync(path.join(process.cwd(), 'apps')).forEach((dir) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuya-sat/micro-script",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.20",
|
|
4
4
|
"bin": "./dist/bin/cli.js",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"@babel/preset-typescript": "7.16.7",
|
|
24
24
|
"@babel/traverse": "^7.20.13",
|
|
25
25
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.4",
|
|
26
|
-
"@tuya-sat/micro-dev-loader": "3.0.
|
|
27
|
-
"@tuya-sat/micro-dev-proxy": "3.0.
|
|
28
|
-
"@tuya-sat/micro-utils": "3.0.
|
|
26
|
+
"@tuya-sat/micro-dev-loader": "3.0.20",
|
|
27
|
+
"@tuya-sat/micro-dev-proxy": "3.0.20",
|
|
28
|
+
"@tuya-sat/micro-utils": "3.0.20",
|
|
29
29
|
"@types/kill-port": "^2.0.0",
|
|
30
30
|
"babel-loader": "8.2.4",
|
|
31
31
|
"babel-plugin-import": "1.13.3",
|