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