utiller 1.0.383 → 1.0.385
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.
|
@@ -1108,7 +1108,7 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
1108
1108
|
_iterator7 = _createForOfIteratorHelper(packagejsons);
|
|
1109
1109
|
_context14.prev = 8;
|
|
1110
1110
|
_loop = /*#__PURE__*/_regenerator["default"].mark(function _loop() {
|
|
1111
|
-
var path, tempFolderPath, release, pathOfPackageJson, indexFileName, templatePath, _yield$_this7$upgrade, moduleName, version;
|
|
1111
|
+
var path, tempFolderPath, release, localBabelPath, pathOfPackageJson, indexFileName, templatePath, _yield$_this7$upgrade, moduleName, version;
|
|
1112
1112
|
return _regenerator["default"].wrap(function _loop$(_context13) {
|
|
1113
1113
|
while (1) switch (_context13.prev = _context13.next) {
|
|
1114
1114
|
case 0:
|
|
@@ -1118,7 +1118,7 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
1118
1118
|
return !_this7.has(path, projectName);
|
|
1119
1119
|
};
|
|
1120
1120
|
})))) {
|
|
1121
|
-
_context13.next =
|
|
1121
|
+
_context13.next = 47;
|
|
1122
1122
|
break;
|
|
1123
1123
|
}
|
|
1124
1124
|
_context13.next = 4;
|
|
@@ -1128,11 +1128,12 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
1128
1128
|
/** 產生release資料夾 */
|
|
1129
1129
|
release = _this7.persistByPath(_path4["default"].join(path, "release"));
|
|
1130
1130
|
/** 利用babel 產生出 es5相容性高的src file */
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1131
|
+
localBabelPath = "".concat(path, "/node_modules/.bin/babel");
|
|
1132
|
+
_context13.next = 9;
|
|
1133
|
+
return _this7.executeCommandLine("cd ".concat(path, " && ").concat(localBabelPath, " ./temp --out-dir ./release/lib"));
|
|
1134
|
+
case 9:
|
|
1134
1135
|
pathOfPackageJson = _path4["default"].join(path, "package.json");
|
|
1135
|
-
_context13.prev =
|
|
1136
|
+
_context13.prev = 10;
|
|
1136
1137
|
indexFileName = "sample.npm.module.index.js";
|
|
1137
1138
|
/** 複製公版的index.js */
|
|
1138
1139
|
_this7.copySingleFile("/Users/davidtu/cross-achieve/high/idea-inventer/utiller/template/".concat(indexFileName), release, "index.js", true);
|
|
@@ -1140,71 +1141,71 @@ var NodeUtiller = /*#__PURE__*/function (_Utiller) {
|
|
|
1140
1141
|
/** template就是樣板的概念 */
|
|
1141
1142
|
templatePath = _path4["default"].join(path, "template");
|
|
1142
1143
|
if (!_this7.isPathExist(templatePath)) {
|
|
1143
|
-
_context13.next =
|
|
1144
|
+
_context13.next = 17;
|
|
1144
1145
|
break;
|
|
1145
1146
|
}
|
|
1146
|
-
_context13.next =
|
|
1147
|
+
_context13.next = 17;
|
|
1147
1148
|
return _this7.copyFromFolderToDestFolder(templatePath, _this7.persistByPath(_path4["default"].join(release, "template")));
|
|
1148
|
-
case
|
|
1149
|
+
case 17:
|
|
1149
1150
|
if (!deployToNPMServer) {
|
|
1150
|
-
_context13.next =
|
|
1151
|
+
_context13.next = 25;
|
|
1151
1152
|
break;
|
|
1152
1153
|
}
|
|
1153
|
-
_context13.next =
|
|
1154
|
+
_context13.next = 20;
|
|
1154
1155
|
return _this7.upgradePackageJsonVersion(pathOfPackageJson);
|
|
1155
|
-
case
|
|
1156
|
+
case 20:
|
|
1156
1157
|
_yield$_this7$upgrade = _context13.sent;
|
|
1157
1158
|
moduleName = _yield$_this7$upgrade.moduleName;
|
|
1158
1159
|
version = _yield$_this7$upgrade.version;
|
|
1159
|
-
_context13.next =
|
|
1160
|
+
_context13.next = 25;
|
|
1160
1161
|
return _this7.updateVersionOfTemplate(moduleName, version);
|
|
1161
|
-
case
|
|
1162
|
+
case 25:
|
|
1162
1163
|
/** 把package.json release放進去 */
|
|
1163
1164
|
_this7.copySingleFile(pathOfPackageJson, _path4["default"].join(release, "package.json"), undefined, true);
|
|
1164
1165
|
|
|
1165
1166
|
/** 安裝一個沒有devDependency 的node_module */
|
|
1166
1167
|
if (!(forceInstallNodeModule || !_this7.isPathExist(_path4["default"].join(release, "node_module")))) {
|
|
1167
|
-
_context13.next =
|
|
1168
|
+
_context13.next = 31;
|
|
1168
1169
|
break;
|
|
1169
1170
|
}
|
|
1170
|
-
_context13.next =
|
|
1171
|
+
_context13.next = 29;
|
|
1171
1172
|
return _this7.executeCommandLine("cd ".concat(release, " && yarn install --production"));
|
|
1172
|
-
case
|
|
1173
|
-
_context13.next =
|
|
1173
|
+
case 29:
|
|
1174
|
+
_context13.next = 32;
|
|
1174
1175
|
break;
|
|
1175
|
-
case 30:
|
|
1176
|
-
_this7.appendInfo("ignore node-module install behavior");
|
|
1177
1176
|
case 31:
|
|
1177
|
+
_this7.appendInfo("ignore node-module install behavior");
|
|
1178
|
+
case 32:
|
|
1178
1179
|
_this7.appendInfo("build ".concat(path, " succeed"));
|
|
1179
1180
|
|
|
1180
1181
|
/** 部署到 local server*/
|
|
1181
1182
|
if (!deployToNPMServer) {
|
|
1182
|
-
_context13.next =
|
|
1183
|
+
_context13.next = 36;
|
|
1183
1184
|
break;
|
|
1184
1185
|
}
|
|
1185
|
-
_context13.next =
|
|
1186
|
+
_context13.next = 36;
|
|
1186
1187
|
return _this7.executeCommandLine("cd ".concat(release, " && npm publish"));
|
|
1187
|
-
case
|
|
1188
|
-
_context13.next =
|
|
1188
|
+
case 36:
|
|
1189
|
+
_context13.next = 43;
|
|
1189
1190
|
break;
|
|
1190
|
-
case
|
|
1191
|
-
_context13.prev =
|
|
1192
|
-
_context13.t0 = _context13["catch"](
|
|
1193
|
-
_context13.next =
|
|
1191
|
+
case 38:
|
|
1192
|
+
_context13.prev = 38;
|
|
1193
|
+
_context13.t0 = _context13["catch"](10);
|
|
1194
|
+
_context13.next = 42;
|
|
1194
1195
|
return _this7.deleteSelfByPath(release, true);
|
|
1195
|
-
case 41:
|
|
1196
|
-
throw new _index2["default"](9999, "generatePackage \u5831\u932F, ".concat(_context13.t0.message));
|
|
1197
1196
|
case 42:
|
|
1198
|
-
_context13.
|
|
1199
|
-
|
|
1197
|
+
throw new _index2["default"](9999, "generatePackage \u5831\u932F, ".concat(_context13.t0.message));
|
|
1198
|
+
case 43:
|
|
1199
|
+
_context13.prev = 43;
|
|
1200
|
+
_context13.next = 46;
|
|
1200
1201
|
return _this7.deleteSelfByPath(tempFolderPath, true);
|
|
1201
|
-
case 45:
|
|
1202
|
-
return _context13.finish(42);
|
|
1203
1202
|
case 46:
|
|
1203
|
+
return _context13.finish(43);
|
|
1204
|
+
case 47:
|
|
1204
1205
|
case "end":
|
|
1205
1206
|
return _context13.stop();
|
|
1206
1207
|
}
|
|
1207
|
-
}, _loop, null, [[
|
|
1208
|
+
}, _loop, null, [[10, 38, 43, 47]]);
|
|
1208
1209
|
});
|
|
1209
1210
|
_iterator7.s();
|
|
1210
1211
|
case 11:
|
package/package.json
CHANGED