Skip to content

Commit e76475c

Browse files
committed
chore: rename the nodeModules option to nodeModulesPath
1 parent 995dca5 commit e76475c

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

bin/micro-app-build

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
5+
6+
const { yParser } = require('@micro-app/shared-utils');
7+
const argv = yParser(process.argv.slice(2));
8+
const { service } = require('./base');
9+
10+
service.run('start', argv);

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"bin": {
77
"micro-app": "bin/micro-app",
88
"micro-app-dev": "bin/micro-app-dev",
9-
"micro-app-start": "bin/micro-app-start"
9+
"micro-app-start": "bin/micro-app-start",
10+
"micro-app-build": "./bin/micro-app-build"
1011
},
1112
"scripts": {
1213
"prepublishOnly": "npm run test",
@@ -57,7 +58,7 @@
5758
"jest": "^24.9.0"
5859
},
5960
"dependencies": {
60-
"@micro-app/core": "^0.3.15",
61+
"@micro-app/core": "^0.3.16",
6162
"@zkochan/cmd-shim": "^4.3.0",
6263
"read-cmd-shim": "^2.0.0",
6364
"update-notifier": "^4.1.0"

src/plugins/commands/update/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function updateMicro(api, name) {
3737
const microAppConfig = api.selfConfig;
3838
const micros = api.micros;
3939
const microsConfig = api.microsConfig;
40-
const currentNodeModules = microAppConfig.nodeModules;
40+
const currentNodeModulesPath = microAppConfig.nodeModulesPath;
4141
const currentPkgInfo = microAppConfig.package;
4242

4343
api.applyPluginHooks('beforeCommandUpdate', { name, logger, microsConfig });
@@ -46,7 +46,7 @@ function updateMicro(api, name) {
4646
const microConfig = microsConfig[name];
4747
if (microConfig) {
4848
const root = microConfig.originalRoot || microConfig.root;
49-
if (!root.startsWith(currentNodeModules)) {
49+
if (!root.startsWith(currentNodeModulesPath)) {
5050
// 丢弃非 node_modules 中的地址
5151
return;
5252
}
@@ -68,7 +68,7 @@ function updateMicro(api, name) {
6868
const microConfig = microsConfig[key];
6969
if (microConfig) {
7070
const root = microConfig.root;
71-
if (!root.startsWith(currentNodeModules)) {
71+
if (!root.startsWith(currentNodeModulesPath)) {
7272
// 丢弃软链接
7373
return false;
7474
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,10 @@
361361
"@types/istanbul-reports" "^1.1.1"
362362
"@types/yargs" "^13.0.0"
363363

364-
"@micro-app/core@^0.3.15":
365-
version "0.3.15"
366-
resolved "https://registry.yarnpkg.com/@micro-app/core/-/core-0.3.15.tgz#8ca042242ad0e31687b10e527db4ed87accb8c5e"
367-
integrity sha512-MemQiRtw8O/QdpqT6X99d8aOut01gOWGTQBLdErOuwVBW3kG0CfRpyEUrncq/ZSlGvfitpUjIwf4jPhSMEeuEw==
364+
"@micro-app/core@^0.3.16":
365+
version "0.3.16"
366+
resolved "https://registry.yarnpkg.com/@micro-app/core/-/core-0.3.16.tgz#be8d58cc3499d3b00dfe74f010f084126a16d772"
367+
integrity sha512-NTwxP+owYD1aR6Lw4v+pIyIBTi1cgVV31TcqDTVwmpWsRKLKc7qpgYtzrOBecA/iiGuxxpL+cB/DOEU9DQbhIA==
368368
dependencies:
369369
"@micro-app/shared-utils" "^0.1.16"
370370
dotenv "^8.2.0"

0 commit comments

Comments
 (0)