@ng-atomic/schematics 20.67.0 → 20.69.4
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/index.js +812 -391
- package/lib/_utilities/index.js +812 -391
- package/lib/atomic-component/index.js +5 -11
- package/lib/ng-add/index.js +811 -390
- package/lib/page/index.js +811 -390
- package/lib/pages/index.js +5 -11
- package/lib/setup/index.js +812 -391
- package/package.json +1 -1
package/lib/_utilities/index.js
CHANGED
|
@@ -410962,7 +410962,7 @@ ${fromBody}`;
|
|
|
410962
410962
|
exports22.parseString = parseString;
|
|
410963
410963
|
}
|
|
410964
410964
|
});
|
|
410965
|
-
var
|
|
410965
|
+
var require_package3 = __commonJS22({
|
|
410966
410966
|
"node_modules/editorconfig/package.json"(exports22, module22) {
|
|
410967
410967
|
module22.exports = {
|
|
410968
410968
|
name: "editorconfig",
|
|
@@ -411164,7 +411164,7 @@ ${fromBody}`;
|
|
|
411164
411164
|
var fnmatch_1 = __importDefault22(require_fnmatch());
|
|
411165
411165
|
var ini_1 = require_ini();
|
|
411166
411166
|
exports22.parseString = ini_1.parseString;
|
|
411167
|
-
var package_json_1 = __importDefault22(
|
|
411167
|
+
var package_json_1 = __importDefault22(require_package3());
|
|
411168
411168
|
var knownProps = {
|
|
411169
411169
|
end_of_line: true,
|
|
411170
411170
|
indent_style: true,
|
|
@@ -430601,22 +430601,26 @@ var require_format_files = __commonJS({
|
|
|
430601
430601
|
"use strict";
|
|
430602
430602
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
430603
430603
|
exports2.formatFiles = formatFiles;
|
|
430604
|
+
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
430604
430605
|
var devkit_exports_1 = require("nx/src/devkit-exports");
|
|
430605
430606
|
var devkit_internals_1 = require("nx/src/devkit-internals");
|
|
430606
|
-
var path = require("path");
|
|
430607
|
+
var path = tslib_1.__importStar(require("path"));
|
|
430607
430608
|
async function formatFiles(tree, options = {}) {
|
|
430609
|
+
options.sortRootTsconfigPaths ??= process.env.NX_FORMAT_SORT_TSCONFIG_PATHS === "true";
|
|
430610
|
+
if (options.sortRootTsconfigPaths) {
|
|
430611
|
+
sortTsConfig(tree);
|
|
430612
|
+
}
|
|
430613
|
+
if (process.env.NX_SKIP_FORMAT === "true") {
|
|
430614
|
+
return;
|
|
430615
|
+
}
|
|
430608
430616
|
let prettier;
|
|
430609
430617
|
try {
|
|
430610
|
-
prettier = await Promise.resolve().then(() => require_prettier());
|
|
430618
|
+
prettier = await Promise.resolve().then(() => tslib_1.__importStar(require_prettier()));
|
|
430611
430619
|
if (!(0, devkit_internals_1.isUsingPrettierInTree)(tree)) {
|
|
430612
430620
|
return;
|
|
430613
430621
|
}
|
|
430614
430622
|
} catch {
|
|
430615
430623
|
}
|
|
430616
|
-
options.sortRootTsconfigPaths ??= process.env.NX_FORMAT_SORT_TSCONFIG_PATHS === "true";
|
|
430617
|
-
if (options.sortRootTsconfigPaths) {
|
|
430618
|
-
sortTsConfig(tree);
|
|
430619
|
-
}
|
|
430620
430624
|
if (!prettier)
|
|
430621
430625
|
return;
|
|
430622
430626
|
const files = new Set(tree.listChanges().filter((file) => file.type !== "DELETE"));
|
|
@@ -430972,16 +430976,18 @@ var require_binary_extensions = __commonJS({
|
|
|
430972
430976
|
}
|
|
430973
430977
|
});
|
|
430974
430978
|
|
|
430975
|
-
// node_modules/ejs/lib/utils.js
|
|
430979
|
+
// node_modules/ejs/lib/cjs/utils.js
|
|
430976
430980
|
var require_utils = __commonJS({
|
|
430977
|
-
"node_modules/ejs/lib/utils.js"(exports2) {
|
|
430981
|
+
"node_modules/ejs/lib/cjs/utils.js"(exports2, module2) {
|
|
430978
430982
|
"use strict";
|
|
430983
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
430984
|
+
var utils = {};
|
|
430979
430985
|
var regExpChars = /[|\\{}()[\]^$+*?.]/g;
|
|
430980
430986
|
var hasOwnProperty6 = Object.prototype.hasOwnProperty;
|
|
430981
430987
|
var hasOwn = function(obj, key) {
|
|
430982
430988
|
return hasOwnProperty6.apply(obj, [key]);
|
|
430983
430989
|
};
|
|
430984
|
-
|
|
430990
|
+
utils.escapeRegExpChars = function(string) {
|
|
430985
430991
|
if (!string) {
|
|
430986
430992
|
return "";
|
|
430987
430993
|
}
|
|
@@ -431010,7 +431016,7 @@ function encode_char(c) {
|
|
|
431010
431016
|
return _ENCODE_HTML_RULES[c] || c;
|
|
431011
431017
|
};
|
|
431012
431018
|
`;
|
|
431013
|
-
|
|
431019
|
+
utils.escapeXML = function(markup) {
|
|
431014
431020
|
return markup == void 0 ? "" : String(markup).replace(_MATCH_HTML, encode_char);
|
|
431015
431021
|
};
|
|
431016
431022
|
function escapeXMLToString() {
|
|
@@ -431018,14 +431024,14 @@ function encode_char(c) {
|
|
|
431018
431024
|
}
|
|
431019
431025
|
try {
|
|
431020
431026
|
if (typeof Object.defineProperty === "function") {
|
|
431021
|
-
Object.defineProperty(
|
|
431027
|
+
Object.defineProperty(utils.escapeXML, "toString", { value: escapeXMLToString });
|
|
431022
431028
|
} else {
|
|
431023
|
-
|
|
431029
|
+
utils.escapeXML.toString = escapeXMLToString;
|
|
431024
431030
|
}
|
|
431025
431031
|
} catch (err) {
|
|
431026
431032
|
console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)");
|
|
431027
431033
|
}
|
|
431028
|
-
|
|
431034
|
+
utils.shallowCopy = function(to, from) {
|
|
431029
431035
|
from = from || {};
|
|
431030
431036
|
if (to !== null && to !== void 0) {
|
|
431031
431037
|
for (var p in from) {
|
|
@@ -431040,7 +431046,7 @@ function encode_char(c) {
|
|
|
431040
431046
|
}
|
|
431041
431047
|
return to;
|
|
431042
431048
|
};
|
|
431043
|
-
|
|
431049
|
+
utils.shallowCopyFromList = function(to, from, list) {
|
|
431044
431050
|
list = list || [];
|
|
431045
431051
|
from = from || {};
|
|
431046
431052
|
if (to !== null && to !== void 0) {
|
|
@@ -431059,7 +431065,7 @@ function encode_char(c) {
|
|
|
431059
431065
|
}
|
|
431060
431066
|
return to;
|
|
431061
431067
|
};
|
|
431062
|
-
|
|
431068
|
+
utils.cache = {
|
|
431063
431069
|
_data: {},
|
|
431064
431070
|
set: function(key, val) {
|
|
431065
431071
|
this._data[key] = val;
|
|
@@ -431074,12 +431080,12 @@ function encode_char(c) {
|
|
|
431074
431080
|
this._data = {};
|
|
431075
431081
|
}
|
|
431076
431082
|
};
|
|
431077
|
-
|
|
431083
|
+
utils.hyphenToCamel = function(str) {
|
|
431078
431084
|
return str.replace(/-[a-z]/g, function(match) {
|
|
431079
431085
|
return match[1].toUpperCase();
|
|
431080
431086
|
});
|
|
431081
431087
|
};
|
|
431082
|
-
|
|
431088
|
+
utils.createNullProtoObjWherePossible = (function() {
|
|
431083
431089
|
if (typeof Object.create == "function") {
|
|
431084
431090
|
return function() {
|
|
431085
431091
|
return /* @__PURE__ */ Object.create(null);
|
|
@@ -431094,8 +431100,8 @@ function encode_char(c) {
|
|
|
431094
431100
|
return {};
|
|
431095
431101
|
};
|
|
431096
431102
|
})();
|
|
431097
|
-
|
|
431098
|
-
var o =
|
|
431103
|
+
utils.hasOwnOnlyObject = function(obj) {
|
|
431104
|
+
var o = utils.createNullProtoObjWherePossible();
|
|
431099
431105
|
for (var p in obj) {
|
|
431100
431106
|
if (hasOwn(obj, p)) {
|
|
431101
431107
|
o[p] = obj[p];
|
|
@@ -431103,71 +431109,30 @@ function encode_char(c) {
|
|
|
431103
431109
|
}
|
|
431104
431110
|
return o;
|
|
431105
431111
|
};
|
|
431112
|
+
if (typeof exports2 != "undefined") {
|
|
431113
|
+
module2.exports = utils;
|
|
431114
|
+
}
|
|
431115
|
+
exports2.default = utils;
|
|
431106
431116
|
}
|
|
431107
431117
|
});
|
|
431108
431118
|
|
|
431109
|
-
// node_modules/ejs/
|
|
431110
|
-
var require_package2 = __commonJS({
|
|
431111
|
-
"node_modules/ejs/package.json"(exports2, module2) {
|
|
431112
|
-
module2.exports = {
|
|
431113
|
-
name: "ejs",
|
|
431114
|
-
description: "Embedded JavaScript templates",
|
|
431115
|
-
keywords: [
|
|
431116
|
-
"template",
|
|
431117
|
-
"engine",
|
|
431118
|
-
"ejs"
|
|
431119
|
-
],
|
|
431120
|
-
version: "3.1.10",
|
|
431121
|
-
author: "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
|
|
431122
|
-
license: "Apache-2.0",
|
|
431123
|
-
bin: {
|
|
431124
|
-
ejs: "./bin/cli.js"
|
|
431125
|
-
},
|
|
431126
|
-
main: "./lib/ejs.js",
|
|
431127
|
-
jsdelivr: "ejs.min.js",
|
|
431128
|
-
unpkg: "ejs.min.js",
|
|
431129
|
-
repository: {
|
|
431130
|
-
type: "git",
|
|
431131
|
-
url: "git://github.com/mde/ejs.git"
|
|
431132
|
-
},
|
|
431133
|
-
bugs: "https://github.com/mde/ejs/issues",
|
|
431134
|
-
homepage: "https://github.com/mde/ejs",
|
|
431135
|
-
dependencies: {
|
|
431136
|
-
jake: "^10.8.5"
|
|
431137
|
-
},
|
|
431138
|
-
devDependencies: {
|
|
431139
|
-
browserify: "^16.5.1",
|
|
431140
|
-
eslint: "^6.8.0",
|
|
431141
|
-
"git-directory-deploy": "^1.5.1",
|
|
431142
|
-
jsdoc: "^4.0.2",
|
|
431143
|
-
"lru-cache": "^4.0.1",
|
|
431144
|
-
mocha: "^10.2.0",
|
|
431145
|
-
"uglify-js": "^3.3.16"
|
|
431146
|
-
},
|
|
431147
|
-
engines: {
|
|
431148
|
-
node: ">=0.10.0"
|
|
431149
|
-
},
|
|
431150
|
-
scripts: {
|
|
431151
|
-
test: "npx jake test"
|
|
431152
|
-
}
|
|
431153
|
-
};
|
|
431154
|
-
}
|
|
431155
|
-
});
|
|
431156
|
-
|
|
431157
|
-
// node_modules/ejs/lib/ejs.js
|
|
431119
|
+
// node_modules/ejs/lib/cjs/ejs.js
|
|
431158
431120
|
var require_ejs = __commonJS({
|
|
431159
|
-
"node_modules/ejs/lib/ejs.js"(exports2) {
|
|
431121
|
+
"node_modules/ejs/lib/cjs/ejs.js"(exports2, module2) {
|
|
431160
431122
|
"use strict";
|
|
431161
|
-
var
|
|
431162
|
-
|
|
431163
|
-
|
|
431164
|
-
|
|
431165
|
-
var
|
|
431123
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod) {
|
|
431124
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
431125
|
+
};
|
|
431126
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
431127
|
+
var fs_1 = __importDefault2(require("fs"));
|
|
431128
|
+
var path_1 = __importDefault2(require("path"));
|
|
431129
|
+
var utils_js_1 = __importDefault2(require_utils());
|
|
431130
|
+
var DECLARATION_KEYWORD = "var";
|
|
431131
|
+
var ejs = {};
|
|
431166
431132
|
var _DEFAULT_OPEN_DELIMITER = "<";
|
|
431167
431133
|
var _DEFAULT_CLOSE_DELIMITER = ">";
|
|
431168
431134
|
var _DEFAULT_DELIMITER = "%";
|
|
431169
431135
|
var _DEFAULT_LOCALS_NAME = "locals";
|
|
431170
|
-
var _NAME = "ejs";
|
|
431171
431136
|
var _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)";
|
|
431172
431137
|
var _OPTS_PASSABLE_WITH_DATA = [
|
|
431173
431138
|
"delimiter",
|
|
@@ -431175,7 +431140,6 @@ var require_ejs = __commonJS({
|
|
|
431175
431140
|
"context",
|
|
431176
431141
|
"debug",
|
|
431177
431142
|
"compileDebug",
|
|
431178
|
-
"client",
|
|
431179
431143
|
"_with",
|
|
431180
431144
|
"rmWhitespace",
|
|
431181
431145
|
"strict",
|
|
@@ -431185,14 +431149,14 @@ var require_ejs = __commonJS({
|
|
|
431185
431149
|
var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache");
|
|
431186
431150
|
var _BOM = /^\uFEFF/;
|
|
431187
431151
|
var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
|
|
431188
|
-
|
|
431189
|
-
|
|
431190
|
-
|
|
431191
|
-
|
|
431192
|
-
|
|
431193
|
-
var dirname =
|
|
431194
|
-
var extname =
|
|
431195
|
-
var resolve =
|
|
431152
|
+
ejs.cache = utils_js_1.default.cache;
|
|
431153
|
+
ejs.fileLoader = fs_1.default.readFileSync;
|
|
431154
|
+
ejs.localsName = _DEFAULT_LOCALS_NAME;
|
|
431155
|
+
ejs.promiseImpl = new Function("return this;")().Promise;
|
|
431156
|
+
ejs.resolveInclude = function(name, filename, isDir) {
|
|
431157
|
+
var dirname = path_1.default.dirname;
|
|
431158
|
+
var extname = path_1.default.extname;
|
|
431159
|
+
var resolve = path_1.default.resolve;
|
|
431196
431160
|
var includePath = resolve(isDir ? filename : dirname(filename), name);
|
|
431197
431161
|
var ext = extname(name);
|
|
431198
431162
|
if (!ext) {
|
|
@@ -431203,36 +431167,36 @@ var require_ejs = __commonJS({
|
|
|
431203
431167
|
function resolvePaths(name, paths) {
|
|
431204
431168
|
var filePath;
|
|
431205
431169
|
if (paths.some(function(v) {
|
|
431206
|
-
filePath =
|
|
431207
|
-
return
|
|
431170
|
+
filePath = ejs.resolveInclude(name, v, true);
|
|
431171
|
+
return fs_1.default.existsSync(filePath);
|
|
431208
431172
|
})) {
|
|
431209
431173
|
return filePath;
|
|
431210
431174
|
}
|
|
431211
431175
|
}
|
|
431212
|
-
function getIncludePath(
|
|
431176
|
+
function getIncludePath(path, options) {
|
|
431213
431177
|
var includePath;
|
|
431214
431178
|
var filePath;
|
|
431215
431179
|
var views = options.views;
|
|
431216
|
-
var match = /^[A-Za-z]+:\\|^\//.exec(
|
|
431180
|
+
var match = /^[A-Za-z]+:\\|^\//.exec(path);
|
|
431217
431181
|
if (match && match.length) {
|
|
431218
|
-
|
|
431182
|
+
path = path.replace(/^\/*/, "");
|
|
431219
431183
|
if (Array.isArray(options.root)) {
|
|
431220
|
-
includePath = resolvePaths(
|
|
431184
|
+
includePath = resolvePaths(path, options.root);
|
|
431221
431185
|
} else {
|
|
431222
|
-
includePath =
|
|
431186
|
+
includePath = ejs.resolveInclude(path, options.root || "/", true);
|
|
431223
431187
|
}
|
|
431224
431188
|
} else {
|
|
431225
431189
|
if (options.filename) {
|
|
431226
|
-
filePath =
|
|
431227
|
-
if (
|
|
431190
|
+
filePath = ejs.resolveInclude(path, options.filename);
|
|
431191
|
+
if (fs_1.default.existsSync(filePath)) {
|
|
431228
431192
|
includePath = filePath;
|
|
431229
431193
|
}
|
|
431230
431194
|
}
|
|
431231
431195
|
if (!includePath && Array.isArray(views)) {
|
|
431232
|
-
includePath = resolvePaths(
|
|
431196
|
+
includePath = resolvePaths(path, views);
|
|
431233
431197
|
}
|
|
431234
431198
|
if (!includePath && typeof options.includer !== "function") {
|
|
431235
|
-
throw new Error('Could not find the include file "' + options.escapeFunction(
|
|
431199
|
+
throw new Error('Could not find the include file "' + options.escapeFunction(path) + '"');
|
|
431236
431200
|
}
|
|
431237
431201
|
}
|
|
431238
431202
|
return includePath;
|
|
@@ -431245,7 +431209,7 @@ var require_ejs = __commonJS({
|
|
|
431245
431209
|
if (!filename) {
|
|
431246
431210
|
throw new Error("cache option requires a filename");
|
|
431247
431211
|
}
|
|
431248
|
-
func =
|
|
431212
|
+
func = ejs.cache.get(filename);
|
|
431249
431213
|
if (func) {
|
|
431250
431214
|
return func;
|
|
431251
431215
|
}
|
|
@@ -431258,17 +431222,17 @@ var require_ejs = __commonJS({
|
|
|
431258
431222
|
}
|
|
431259
431223
|
template = fileLoader(filename).toString().replace(_BOM, "");
|
|
431260
431224
|
}
|
|
431261
|
-
func =
|
|
431225
|
+
func = ejs.compile(template, options);
|
|
431262
431226
|
if (options.cache) {
|
|
431263
|
-
|
|
431227
|
+
ejs.cache.set(filename, func);
|
|
431264
431228
|
}
|
|
431265
431229
|
return func;
|
|
431266
431230
|
}
|
|
431267
431231
|
function tryHandleCache(options, data, cb) {
|
|
431268
431232
|
var result;
|
|
431269
431233
|
if (!cb) {
|
|
431270
|
-
if (typeof
|
|
431271
|
-
return new
|
|
431234
|
+
if (typeof ejs.promiseImpl == "function") {
|
|
431235
|
+
return new ejs.promiseImpl(function(resolve, reject) {
|
|
431272
431236
|
try {
|
|
431273
431237
|
result = handleCache(options)(data);
|
|
431274
431238
|
resolve(result);
|
|
@@ -431289,13 +431253,13 @@ var require_ejs = __commonJS({
|
|
|
431289
431253
|
}
|
|
431290
431254
|
}
|
|
431291
431255
|
function fileLoader(filePath) {
|
|
431292
|
-
return
|
|
431256
|
+
return ejs.fileLoader(filePath);
|
|
431293
431257
|
}
|
|
431294
|
-
function includeFile(
|
|
431295
|
-
var opts =
|
|
431296
|
-
opts.filename = getIncludePath(
|
|
431258
|
+
function includeFile(path, options) {
|
|
431259
|
+
var opts = utils_js_1.default.shallowCopy(utils_js_1.default.createNullProtoObjWherePossible(), options);
|
|
431260
|
+
opts.filename = getIncludePath(path, opts);
|
|
431297
431261
|
if (typeof options.includer === "function") {
|
|
431298
|
-
var includerResult = options.includer(
|
|
431262
|
+
var includerResult = options.includer(path, opts.filename);
|
|
431299
431263
|
if (includerResult) {
|
|
431300
431264
|
if (includerResult.filename) {
|
|
431301
431265
|
opts.filename = includerResult.filename;
|
|
@@ -431323,13 +431287,10 @@ var require_ejs = __commonJS({
|
|
|
431323
431287
|
function stripSemi(str) {
|
|
431324
431288
|
return str.replace(/;(\s*$)/, "$1");
|
|
431325
431289
|
}
|
|
431326
|
-
|
|
431290
|
+
ejs.compile = function compile(template, opts) {
|
|
431327
431291
|
var templ;
|
|
431328
431292
|
if (opts && opts.scope) {
|
|
431329
|
-
|
|
431330
|
-
console.warn("`scope` option is deprecated and will be removed in EJS 3");
|
|
431331
|
-
scopeOptionWarned = true;
|
|
431332
|
-
}
|
|
431293
|
+
console.warn("`scope` option is deprecated and will be removed in future EJS");
|
|
431333
431294
|
if (!opts.context) {
|
|
431334
431295
|
opts.context = opts.scope;
|
|
431335
431296
|
}
|
|
@@ -431338,15 +431299,15 @@ var require_ejs = __commonJS({
|
|
|
431338
431299
|
templ = new Template(template, opts);
|
|
431339
431300
|
return templ.compile();
|
|
431340
431301
|
};
|
|
431341
|
-
|
|
431342
|
-
var data = d ||
|
|
431343
|
-
var opts = o ||
|
|
431302
|
+
ejs.render = function(template, d, o) {
|
|
431303
|
+
var data = d || utils_js_1.default.createNullProtoObjWherePossible();
|
|
431304
|
+
var opts = o || utils_js_1.default.createNullProtoObjWherePossible();
|
|
431344
431305
|
if (arguments.length == 2) {
|
|
431345
|
-
|
|
431306
|
+
utils_js_1.default.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA);
|
|
431346
431307
|
}
|
|
431347
431308
|
return handleCache(opts, template)(data);
|
|
431348
431309
|
};
|
|
431349
|
-
|
|
431310
|
+
ejs.renderFile = function() {
|
|
431350
431311
|
var args = Array.prototype.slice.call(arguments);
|
|
431351
431312
|
var filename = args.shift();
|
|
431352
431313
|
var cb;
|
|
@@ -431359,7 +431320,7 @@ var require_ejs = __commonJS({
|
|
|
431359
431320
|
if (args.length) {
|
|
431360
431321
|
data = args.shift();
|
|
431361
431322
|
if (args.length) {
|
|
431362
|
-
|
|
431323
|
+
utils_js_1.default.shallowCopy(opts, args.pop());
|
|
431363
431324
|
} else {
|
|
431364
431325
|
if (data.settings) {
|
|
431365
431326
|
if (data.settings.views) {
|
|
@@ -431370,37 +431331,36 @@ var require_ejs = __commonJS({
|
|
|
431370
431331
|
}
|
|
431371
431332
|
viewOpts = data.settings["view options"];
|
|
431372
431333
|
if (viewOpts) {
|
|
431373
|
-
|
|
431334
|
+
utils_js_1.default.shallowCopy(opts, viewOpts);
|
|
431374
431335
|
}
|
|
431375
431336
|
}
|
|
431376
|
-
|
|
431337
|
+
utils_js_1.default.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS);
|
|
431377
431338
|
}
|
|
431378
431339
|
opts.filename = filename;
|
|
431379
431340
|
} else {
|
|
431380
|
-
data =
|
|
431341
|
+
data = utils_js_1.default.createNullProtoObjWherePossible();
|
|
431381
431342
|
}
|
|
431382
431343
|
return tryHandleCache(opts, data, cb);
|
|
431383
431344
|
};
|
|
431384
|
-
|
|
431385
|
-
|
|
431386
|
-
|
|
431345
|
+
ejs.Template = Template;
|
|
431346
|
+
ejs.clearCache = function() {
|
|
431347
|
+
ejs.cache.reset();
|
|
431387
431348
|
};
|
|
431388
431349
|
function Template(text, optsParam) {
|
|
431389
|
-
var opts =
|
|
431390
|
-
var options =
|
|
431350
|
+
var opts = utils_js_1.default.hasOwnOnlyObject(optsParam);
|
|
431351
|
+
var options = utils_js_1.default.createNullProtoObjWherePossible();
|
|
431391
431352
|
this.templateText = text;
|
|
431392
431353
|
this.mode = null;
|
|
431393
431354
|
this.truncate = false;
|
|
431394
431355
|
this.currentLine = 1;
|
|
431395
431356
|
this.source = "";
|
|
431396
|
-
options.
|
|
431397
|
-
options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML;
|
|
431357
|
+
options.escapeFunction = opts.escape || opts.escapeFunction || utils_js_1.default.escapeXML;
|
|
431398
431358
|
options.compileDebug = opts.compileDebug !== false;
|
|
431399
431359
|
options.debug = !!opts.debug;
|
|
431400
431360
|
options.filename = opts.filename;
|
|
431401
|
-
options.openDelimiter = opts.openDelimiter ||
|
|
431402
|
-
options.closeDelimiter = opts.closeDelimiter ||
|
|
431403
|
-
options.delimiter = opts.delimiter ||
|
|
431361
|
+
options.openDelimiter = opts.openDelimiter || ejs.openDelimiter || _DEFAULT_OPEN_DELIMITER;
|
|
431362
|
+
options.closeDelimiter = opts.closeDelimiter || ejs.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;
|
|
431363
|
+
options.delimiter = opts.delimiter || ejs.delimiter || _DEFAULT_DELIMITER;
|
|
431404
431364
|
options.strict = opts.strict || false;
|
|
431405
431365
|
options.context = opts.context;
|
|
431406
431366
|
options.cache = opts.cache || false;
|
|
@@ -431408,7 +431368,7 @@ var require_ejs = __commonJS({
|
|
|
431408
431368
|
options.root = opts.root;
|
|
431409
431369
|
options.includer = opts.includer;
|
|
431410
431370
|
options.outputFunctionName = opts.outputFunctionName;
|
|
431411
|
-
options.localsName = opts.localsName ||
|
|
431371
|
+
options.localsName = opts.localsName || ejs.localsName || _DEFAULT_LOCALS_NAME;
|
|
431412
431372
|
options.views = opts.views;
|
|
431413
431373
|
options.async = opts.async;
|
|
431414
431374
|
options.destructuredLocals = opts.destructuredLocals;
|
|
@@ -431431,9 +431391,9 @@ var require_ejs = __commonJS({
|
|
|
431431
431391
|
Template.prototype = {
|
|
431432
431392
|
createRegex: function() {
|
|
431433
431393
|
var str = _REGEX_STRING;
|
|
431434
|
-
var delim =
|
|
431435
|
-
var open =
|
|
431436
|
-
var close =
|
|
431394
|
+
var delim = utils_js_1.default.escapeRegExpChars(this.opts.delimiter);
|
|
431395
|
+
var open = utils_js_1.default.escapeRegExpChars(this.opts.openDelimiter);
|
|
431396
|
+
var close = utils_js_1.default.escapeRegExpChars(this.opts.closeDelimiter);
|
|
431437
431397
|
str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close);
|
|
431438
431398
|
return new RegExp(str);
|
|
431439
431399
|
},
|
|
@@ -431448,27 +431408,27 @@ var require_ejs = __commonJS({
|
|
|
431448
431408
|
var sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : "undefined";
|
|
431449
431409
|
if (!this.source) {
|
|
431450
431410
|
this.generateSource();
|
|
431451
|
-
prepended +=
|
|
431411
|
+
prepended += " ".concat(DECLARATION_KEYWORD, ' __output = "";\n') + " function __append(s) { if (s !== undefined && s !== null) __output += s }\n";
|
|
431452
431412
|
if (opts.outputFunctionName) {
|
|
431453
431413
|
if (!_JS_IDENTIFIER.test(opts.outputFunctionName)) {
|
|
431454
431414
|
throw new Error("outputFunctionName is not a valid JS identifier.");
|
|
431455
431415
|
}
|
|
431456
|
-
prepended += "
|
|
431416
|
+
prepended += " ".concat(DECLARATION_KEYWORD, " ") + opts.outputFunctionName + " = __append;\n";
|
|
431457
431417
|
}
|
|
431458
431418
|
if (opts.localsName && !_JS_IDENTIFIER.test(opts.localsName)) {
|
|
431459
431419
|
throw new Error("localsName is not a valid JS identifier.");
|
|
431460
431420
|
}
|
|
431461
431421
|
if (opts.destructuredLocals && opts.destructuredLocals.length) {
|
|
431462
|
-
var destructuring = "
|
|
431422
|
+
var destructuring = " ".concat(DECLARATION_KEYWORD, " __locals = (") + opts.localsName + " || {}),\n";
|
|
431463
431423
|
for (var i = 0; i < opts.destructuredLocals.length; i++) {
|
|
431464
|
-
var
|
|
431465
|
-
if (!_JS_IDENTIFIER.test(
|
|
431424
|
+
var name_1 = opts.destructuredLocals[i];
|
|
431425
|
+
if (!_JS_IDENTIFIER.test(name_1)) {
|
|
431466
431426
|
throw new Error("destructuredLocals[" + i + "] is not a valid JS identifier.");
|
|
431467
431427
|
}
|
|
431468
431428
|
if (i > 0) {
|
|
431469
431429
|
destructuring += ",\n ";
|
|
431470
431430
|
}
|
|
431471
|
-
destructuring +=
|
|
431431
|
+
destructuring += name_1 + " = __locals." + name_1;
|
|
431472
431432
|
}
|
|
431473
431433
|
prepended += destructuring + ";\n";
|
|
431474
431434
|
}
|
|
@@ -431480,16 +431440,10 @@ var require_ejs = __commonJS({
|
|
|
431480
431440
|
this.source = prepended + this.source + appended;
|
|
431481
431441
|
}
|
|
431482
431442
|
if (opts.compileDebug) {
|
|
431483
|
-
src = "
|
|
431443
|
+
src = "".concat(DECLARATION_KEYWORD, " __line = 1") + "\n , __lines = " + JSON.stringify(this.templateText) + "\n , __filename = " + sanitizedFilename + ";\ntry {\n" + this.source + "} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n";
|
|
431484
431444
|
} else {
|
|
431485
431445
|
src = this.source;
|
|
431486
431446
|
}
|
|
431487
|
-
if (opts.client) {
|
|
431488
|
-
src = "escapeFn = escapeFn || " + escapeFn.toString() + ";\n" + src;
|
|
431489
|
-
if (opts.compileDebug) {
|
|
431490
|
-
src = "rethrow = rethrow || " + rethrow.toString() + ";\n" + src;
|
|
431491
|
-
}
|
|
431492
|
-
}
|
|
431493
431447
|
if (opts.strict) {
|
|
431494
431448
|
src = '"use strict";\n' + src;
|
|
431495
431449
|
}
|
|
@@ -431529,22 +431483,19 @@ var require_ejs = __commonJS({
|
|
|
431529
431483
|
}
|
|
431530
431484
|
throw e;
|
|
431531
431485
|
}
|
|
431532
|
-
var returnedFn =
|
|
431533
|
-
var include = function(
|
|
431534
|
-
var d =
|
|
431486
|
+
var returnedFn = function anonymous(data) {
|
|
431487
|
+
var include = function(path, includeData) {
|
|
431488
|
+
var d = utils_js_1.default.shallowCopy(utils_js_1.default.createNullProtoObjWherePossible(), data);
|
|
431535
431489
|
if (includeData) {
|
|
431536
|
-
d =
|
|
431490
|
+
d = utils_js_1.default.shallowCopy(d, includeData);
|
|
431537
431491
|
}
|
|
431538
|
-
return includeFile(
|
|
431492
|
+
return includeFile(path, opts)(d);
|
|
431539
431493
|
};
|
|
431540
|
-
return fn.apply(
|
|
431541
|
-
opts.context,
|
|
431542
|
-
[data || utils.createNullProtoObjWherePossible(), escapeFn, include, rethrow]
|
|
431543
|
-
);
|
|
431494
|
+
return fn.apply(opts.context, [data || utils_js_1.default.createNullProtoObjWherePossible(), escapeFn, include, rethrow]);
|
|
431544
431495
|
};
|
|
431545
431496
|
if (opts.filename && typeof Object.defineProperty === "function") {
|
|
431546
431497
|
var filename = opts.filename;
|
|
431547
|
-
var basename =
|
|
431498
|
+
var basename = path_1.default.basename(filename, path_1.default.extname(filename));
|
|
431548
431499
|
try {
|
|
431549
431500
|
Object.defineProperty(returnedFn, "name", {
|
|
431550
431501
|
value: basename,
|
|
@@ -431562,12 +431513,16 @@ var require_ejs = __commonJS({
|
|
|
431562
431513
|
if (opts.rmWhitespace) {
|
|
431563
431514
|
this.templateText = this.templateText.replace(/[\r\n]+/g, "\n").replace(/^\s+|\s+$/gm, "");
|
|
431564
431515
|
}
|
|
431565
|
-
this.templateText = this.templateText.replace(/[ \t]*<%_/gm, "<%_").replace(/_%>[ \t]*/gm, "_%>");
|
|
431566
431516
|
var self2 = this;
|
|
431567
|
-
var matches = this.parseTemplateText();
|
|
431568
431517
|
var d = this.opts.delimiter;
|
|
431569
431518
|
var o = this.opts.openDelimiter;
|
|
431570
431519
|
var c = this.opts.closeDelimiter;
|
|
431520
|
+
var openWhitespaceSlurpTag = utils_js_1.default.escapeRegExpChars(o + d + "_");
|
|
431521
|
+
var closeWhitespaceSlurpTag = utils_js_1.default.escapeRegExpChars("_" + d + c);
|
|
431522
|
+
var openWhitespaceSlurpReplacement = o + d + "_";
|
|
431523
|
+
var closeWhitespaceSlurpReplacement = "_" + d + c;
|
|
431524
|
+
this.templateText = this.templateText.replace(new RegExp("[ \\t]*" + openWhitespaceSlurpTag, "gm"), openWhitespaceSlurpReplacement).replace(new RegExp(closeWhitespaceSlurpTag + "[ \\t]*", "gm"), closeWhitespaceSlurpReplacement);
|
|
431525
|
+
var matches = this.parseTemplateText();
|
|
431571
431526
|
if (matches && matches.length) {
|
|
431572
431527
|
matches.forEach(function(line, index) {
|
|
431573
431528
|
var closing;
|
|
@@ -431694,13 +431649,15 @@ var require_ejs = __commonJS({
|
|
|
431694
431649
|
}
|
|
431695
431650
|
}
|
|
431696
431651
|
};
|
|
431697
|
-
|
|
431698
|
-
|
|
431699
|
-
exports2.VERSION = _VERSION_STRING;
|
|
431700
|
-
exports2.name = _NAME;
|
|
431652
|
+
ejs.escapeXML = utils_js_1.default.escapeXML;
|
|
431653
|
+
ejs.__express = ejs.renderFile;
|
|
431701
431654
|
if (typeof window != "undefined") {
|
|
431702
|
-
window.ejs =
|
|
431655
|
+
window.ejs = ejs;
|
|
431656
|
+
}
|
|
431657
|
+
if (typeof module2 != "undefined") {
|
|
431658
|
+
module2.exports = ejs;
|
|
431703
431659
|
}
|
|
431660
|
+
exports2.default = ejs;
|
|
431704
431661
|
}
|
|
431705
431662
|
});
|
|
431706
431663
|
|
|
@@ -431711,8 +431668,9 @@ var require_generate_files = __commonJS({
|
|
|
431711
431668
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
431712
431669
|
exports2.OverwriteStrategy = void 0;
|
|
431713
431670
|
exports2.generateFiles = generateFiles;
|
|
431671
|
+
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
431714
431672
|
var fs_1 = require("fs");
|
|
431715
|
-
var path = require("path");
|
|
431673
|
+
var path = tslib_1.__importStar(require("path"));
|
|
431716
431674
|
var binary_extensions_1 = require_binary_extensions();
|
|
431717
431675
|
var devkit_exports_1 = require("nx/src/devkit-exports");
|
|
431718
431676
|
var OverwriteStrategy;
|
|
@@ -431984,6 +431942,18 @@ var require_semver = __commonJS({
|
|
|
431984
431942
|
var { safeRe: re, t } = require_re();
|
|
431985
431943
|
var parseOptions = require_parse_options();
|
|
431986
431944
|
var { compareIdentifiers } = require_identifiers();
|
|
431945
|
+
var isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
431946
|
+
const identifiers = identifier.split(".");
|
|
431947
|
+
if (identifiers.length > prerelease.length) {
|
|
431948
|
+
return false;
|
|
431949
|
+
}
|
|
431950
|
+
for (let i = 0; i < identifiers.length; i++) {
|
|
431951
|
+
if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
|
|
431952
|
+
return false;
|
|
431953
|
+
}
|
|
431954
|
+
}
|
|
431955
|
+
return true;
|
|
431956
|
+
};
|
|
431987
431957
|
var SemVer = class _SemVer {
|
|
431988
431958
|
constructor(version, options) {
|
|
431989
431959
|
options = parseOptions(options);
|
|
@@ -432230,8 +432200,9 @@ var require_semver = __commonJS({
|
|
|
432230
432200
|
if (identifierBase === false) {
|
|
432231
432201
|
prerelease = [identifier];
|
|
432232
432202
|
}
|
|
432233
|
-
if (
|
|
432234
|
-
|
|
432203
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
432204
|
+
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
432205
|
+
if (isNaN(prereleaseBase)) {
|
|
432235
432206
|
this.prerelease = prerelease;
|
|
432236
432207
|
}
|
|
432237
432208
|
} else {
|
|
@@ -432633,6 +432604,47 @@ var require_coerce = __commonJS({
|
|
|
432633
432604
|
}
|
|
432634
432605
|
});
|
|
432635
432606
|
|
|
432607
|
+
// node_modules/@nx/devkit/node_modules/semver/functions/truncate.js
|
|
432608
|
+
var require_truncate = __commonJS({
|
|
432609
|
+
"node_modules/@nx/devkit/node_modules/semver/functions/truncate.js"(exports2, module2) {
|
|
432610
|
+
"use strict";
|
|
432611
|
+
var parse2 = require_parse();
|
|
432612
|
+
var constants = require_constants();
|
|
432613
|
+
var SemVer = require_semver();
|
|
432614
|
+
var truncate = (version, truncation, options) => {
|
|
432615
|
+
if (!constants.RELEASE_TYPES.includes(truncation)) {
|
|
432616
|
+
return null;
|
|
432617
|
+
}
|
|
432618
|
+
const clonedVersion = cloneInputVersion(version, options);
|
|
432619
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
432620
|
+
};
|
|
432621
|
+
var cloneInputVersion = (version, options) => {
|
|
432622
|
+
const versionStringToParse = version instanceof SemVer ? version.version : version;
|
|
432623
|
+
return parse2(versionStringToParse, options);
|
|
432624
|
+
};
|
|
432625
|
+
var doTruncation = (version, truncation) => {
|
|
432626
|
+
if (isPrerelease(truncation)) {
|
|
432627
|
+
return version.version;
|
|
432628
|
+
}
|
|
432629
|
+
version.prerelease = [];
|
|
432630
|
+
switch (truncation) {
|
|
432631
|
+
case "major":
|
|
432632
|
+
version.minor = 0;
|
|
432633
|
+
version.patch = 0;
|
|
432634
|
+
break;
|
|
432635
|
+
case "minor":
|
|
432636
|
+
version.patch = 0;
|
|
432637
|
+
break;
|
|
432638
|
+
}
|
|
432639
|
+
return version.format();
|
|
432640
|
+
};
|
|
432641
|
+
var isPrerelease = (type) => {
|
|
432642
|
+
return type.startsWith("pre");
|
|
432643
|
+
};
|
|
432644
|
+
module2.exports = truncate;
|
|
432645
|
+
}
|
|
432646
|
+
});
|
|
432647
|
+
|
|
432636
432648
|
// node_modules/@nx/devkit/node_modules/semver/internal/lrucache.js
|
|
432637
432649
|
var require_lrucache = __commonJS({
|
|
432638
432650
|
"node_modules/@nx/devkit/node_modules/semver/internal/lrucache.js"(exports2, module2) {
|
|
@@ -432741,6 +432753,7 @@ var require_range = __commonJS({
|
|
|
432741
432753
|
return this.range;
|
|
432742
432754
|
}
|
|
432743
432755
|
parseRange(range) {
|
|
432756
|
+
range = range.replace(BUILDSTRIPRE, "");
|
|
432744
432757
|
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
432745
432758
|
const memoKey = memoOpts + ":" + range;
|
|
432746
432759
|
const cached = cache.get(memoKey);
|
|
@@ -432823,12 +432836,14 @@ var require_range = __commonJS({
|
|
|
432823
432836
|
var SemVer = require_semver();
|
|
432824
432837
|
var {
|
|
432825
432838
|
safeRe: re,
|
|
432839
|
+
src,
|
|
432826
432840
|
t,
|
|
432827
432841
|
comparatorTrimReplace,
|
|
432828
432842
|
tildeTrimReplace,
|
|
432829
432843
|
caretTrimReplace
|
|
432830
432844
|
} = require_re();
|
|
432831
432845
|
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
432846
|
+
var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
432832
432847
|
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
432833
432848
|
var isAny = (c) => c.value === "";
|
|
432834
432849
|
var isSatisfiable = (comparators, options) => {
|
|
@@ -432857,20 +432872,22 @@ var require_range = __commonJS({
|
|
|
432857
432872
|
return comp;
|
|
432858
432873
|
};
|
|
432859
432874
|
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
432875
|
+
var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
432860
432876
|
var replaceTildes = (comp, options) => {
|
|
432861
432877
|
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
432862
432878
|
};
|
|
432863
432879
|
var replaceTilde = (comp, options) => {
|
|
432864
432880
|
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
432881
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
432865
432882
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
432866
432883
|
debug("tilde", comp, _, M, m, p, pr);
|
|
432867
432884
|
let ret;
|
|
432868
432885
|
if (isX(M)) {
|
|
432869
432886
|
ret = "";
|
|
432870
432887
|
} else if (isX(m)) {
|
|
432871
|
-
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
432888
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
432872
432889
|
} else if (isX(p)) {
|
|
432873
|
-
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
432890
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
432874
432891
|
} else if (pr) {
|
|
432875
432892
|
debug("replaceTilde pr", pr);
|
|
432876
432893
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
@@ -432916,9 +432933,9 @@ var require_range = __commonJS({
|
|
|
432916
432933
|
debug("no pr");
|
|
432917
432934
|
if (M === "0") {
|
|
432918
432935
|
if (m === "0") {
|
|
432919
|
-
ret = `>=${M}.${m}.${p}
|
|
432936
|
+
ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
432920
432937
|
} else {
|
|
432921
|
-
ret = `>=${M}.${m}.${p}
|
|
432938
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
432922
432939
|
}
|
|
432923
432940
|
} else {
|
|
432924
432941
|
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
@@ -432937,6 +432954,9 @@ var require_range = __commonJS({
|
|
|
432937
432954
|
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
432938
432955
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
432939
432956
|
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
432957
|
+
if (invalidXRangeOrder(M, m, p)) {
|
|
432958
|
+
return comp;
|
|
432959
|
+
}
|
|
432940
432960
|
const xM = isX(M);
|
|
432941
432961
|
const xm = xM || isX(m);
|
|
432942
432962
|
const xp = xm || isX(p);
|
|
@@ -433584,7 +433604,7 @@ var require_subset = __commonJS({
|
|
|
433584
433604
|
if (higher === c && higher !== gt) {
|
|
433585
433605
|
return false;
|
|
433586
433606
|
}
|
|
433587
|
-
} else if (gt.operator === ">=" && !
|
|
433607
|
+
} else if (gt.operator === ">=" && !c.test(gt.semver)) {
|
|
433588
433608
|
return false;
|
|
433589
433609
|
}
|
|
433590
433610
|
}
|
|
@@ -433599,7 +433619,7 @@ var require_subset = __commonJS({
|
|
|
433599
433619
|
if (lower === c && lower !== lt) {
|
|
433600
433620
|
return false;
|
|
433601
433621
|
}
|
|
433602
|
-
} else if (lt.operator === "<=" && !
|
|
433622
|
+
} else if (lt.operator === "<=" && !c.test(lt.semver)) {
|
|
433603
433623
|
return false;
|
|
433604
433624
|
}
|
|
433605
433625
|
}
|
|
@@ -433667,6 +433687,7 @@ var require_semver2 = __commonJS({
|
|
|
433667
433687
|
var lte = require_lte();
|
|
433668
433688
|
var cmp = require_cmp();
|
|
433669
433689
|
var coerce = require_coerce();
|
|
433690
|
+
var truncate = require_truncate();
|
|
433670
433691
|
var Comparator = require_comparator();
|
|
433671
433692
|
var Range = require_range();
|
|
433672
433693
|
var satisfies = require_satisfies();
|
|
@@ -433705,6 +433726,7 @@ var require_semver2 = __commonJS({
|
|
|
433705
433726
|
lte,
|
|
433706
433727
|
cmp,
|
|
433707
433728
|
coerce,
|
|
433729
|
+
truncate,
|
|
433708
433730
|
Comparator,
|
|
433709
433731
|
Range,
|
|
433710
433732
|
satisfies,
|
|
@@ -433740,19 +433762,23 @@ var require_install_packages_task = __commonJS({
|
|
|
433740
433762
|
var child_process_1 = require("child_process");
|
|
433741
433763
|
var path_1 = require("path");
|
|
433742
433764
|
var devkit_exports_1 = require("nx/src/devkit-exports");
|
|
433743
|
-
function installPackagesTask(tree,
|
|
433744
|
-
|
|
433765
|
+
function installPackagesTask(tree, ensureInstall = false, cwd = "", packageManager = (0, devkit_exports_1.detectPackageManager)((0, path_1.join)(tree.root, cwd))) {
|
|
433766
|
+
const packageJsonPath = (0, devkit_exports_1.joinPathFragments)(cwd, "package.json");
|
|
433767
|
+
const packageJsonChanged = tree.listChanges().some((f) => f.path === packageJsonPath);
|
|
433768
|
+
if (!packageJsonChanged && !ensureInstall) {
|
|
433745
433769
|
return;
|
|
433746
433770
|
}
|
|
433747
|
-
const packageJsonValue = tree.read(
|
|
433748
|
-
|
|
433749
|
-
|
|
433771
|
+
const packageJsonValue = tree.read(packageJsonPath, "utf-8");
|
|
433772
|
+
const storedPackageJsonValue = global["__packageJsonInstallCache__"];
|
|
433773
|
+
const installAlreadyRan = storedPackageJsonValue != null;
|
|
433774
|
+
const packageJsonDiffers = storedPackageJsonValue != packageJsonValue;
|
|
433775
|
+
if (packageJsonDiffers || ensureInstall && !installAlreadyRan) {
|
|
433750
433776
|
global["__packageJsonInstallCache__"] = packageJsonValue;
|
|
433751
433777
|
const pmc = (0, devkit_exports_1.getPackageManagerCommand)(packageManager);
|
|
433752
433778
|
const execSyncOptions = {
|
|
433753
433779
|
cwd: (0, path_1.join)(tree.root, cwd),
|
|
433754
433780
|
stdio: process.env.NX_GENERATE_QUIET === "true" ? "ignore" : "inherit",
|
|
433755
|
-
windowsHide:
|
|
433781
|
+
windowsHide: true
|
|
433756
433782
|
};
|
|
433757
433783
|
if (process.env.npm_config_registry && process.env.npm_config_registry.match(/^https:\/\/registry\.(npmjs\.org|yarnpkg\.com)/)) {
|
|
433758
433784
|
delete process.env.npm_config_registry;
|
|
@@ -436551,6 +436577,26 @@ var require_js_yaml = __commonJS({
|
|
|
436551
436577
|
}
|
|
436552
436578
|
});
|
|
436553
436579
|
|
|
436580
|
+
// node_modules/@nx/devkit/src/utils/catalog/manager.js
|
|
436581
|
+
var require_manager = __commonJS({
|
|
436582
|
+
"node_modules/@nx/devkit/src/utils/catalog/manager.js"(exports2) {
|
|
436583
|
+
"use strict";
|
|
436584
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
436585
|
+
exports2.formatCatalogError = formatCatalogError;
|
|
436586
|
+
function formatCatalogError(error2, suggestions) {
|
|
436587
|
+
let message = error2;
|
|
436588
|
+
if (suggestions.length > 0) {
|
|
436589
|
+
message += "\n\nSuggestions:";
|
|
436590
|
+
suggestions.forEach((suggestion) => {
|
|
436591
|
+
message += `
|
|
436592
|
+
\u2022 ${suggestion}`;
|
|
436593
|
+
});
|
|
436594
|
+
}
|
|
436595
|
+
return message;
|
|
436596
|
+
}
|
|
436597
|
+
}
|
|
436598
|
+
});
|
|
436599
|
+
|
|
436554
436600
|
// node_modules/@nx/devkit/src/utils/catalog/pnpm-manager.js
|
|
436555
436601
|
var require_pnpm_manager = __commonJS({
|
|
436556
436602
|
"node_modules/@nx/devkit/src/utils/catalog/pnpm-manager.js"(exports2) {
|
|
@@ -436562,6 +436608,8 @@ var require_pnpm_manager = __commonJS({
|
|
|
436562
436608
|
var node_path_1 = require("node:path");
|
|
436563
436609
|
var devkit_exports_1 = require("nx/src/devkit-exports");
|
|
436564
436610
|
var devkit_internals_1 = require("nx/src/devkit-internals");
|
|
436611
|
+
var manager_1 = require_manager();
|
|
436612
|
+
var PNPM_WORKSPACE_FILENAME = "pnpm-workspace.yaml";
|
|
436565
436613
|
var PnpmCatalogManager = class {
|
|
436566
436614
|
constructor() {
|
|
436567
436615
|
this.name = "pnpm";
|
|
@@ -436581,18 +436629,21 @@ var require_pnpm_manager = __commonJS({
|
|
|
436581
436629
|
isDefaultCatalog: isDefault
|
|
436582
436630
|
};
|
|
436583
436631
|
}
|
|
436632
|
+
getCatalogDefinitionFilePaths() {
|
|
436633
|
+
return [PNPM_WORKSPACE_FILENAME];
|
|
436634
|
+
}
|
|
436584
436635
|
getCatalogDefinitions(treeOrRoot) {
|
|
436585
436636
|
if (typeof treeOrRoot === "string") {
|
|
436586
|
-
const
|
|
436587
|
-
if (!(0, node_fs_1.existsSync)(
|
|
436637
|
+
const configPath = (0, node_path_1.join)(treeOrRoot, PNPM_WORKSPACE_FILENAME);
|
|
436638
|
+
if (!(0, node_fs_1.existsSync)(configPath)) {
|
|
436588
436639
|
return null;
|
|
436589
436640
|
}
|
|
436590
|
-
return
|
|
436641
|
+
return readConfigFromFs(configPath);
|
|
436591
436642
|
} else {
|
|
436592
|
-
if (!treeOrRoot.exists(
|
|
436643
|
+
if (!treeOrRoot.exists(PNPM_WORKSPACE_FILENAME)) {
|
|
436593
436644
|
return null;
|
|
436594
436645
|
}
|
|
436595
|
-
return
|
|
436646
|
+
return readConfigFromTree(treeOrRoot, PNPM_WORKSPACE_FILENAME);
|
|
436596
436647
|
}
|
|
436597
436648
|
}
|
|
436598
436649
|
resolveCatalogReference(treeOrRoot, packageName, version) {
|
|
@@ -436600,15 +436651,15 @@ var require_pnpm_manager = __commonJS({
|
|
|
436600
436651
|
if (!catalogRef) {
|
|
436601
436652
|
return null;
|
|
436602
436653
|
}
|
|
436603
|
-
const
|
|
436604
|
-
if (!
|
|
436654
|
+
const catalogDefs = this.getCatalogDefinitions(treeOrRoot);
|
|
436655
|
+
if (!catalogDefs) {
|
|
436605
436656
|
return null;
|
|
436606
436657
|
}
|
|
436607
436658
|
let catalogToUse;
|
|
436608
436659
|
if (catalogRef.isDefaultCatalog) {
|
|
436609
|
-
catalogToUse =
|
|
436660
|
+
catalogToUse = catalogDefs.catalog ?? catalogDefs.catalogs?.default;
|
|
436610
436661
|
} else if (catalogRef.catalogName) {
|
|
436611
|
-
catalogToUse =
|
|
436662
|
+
catalogToUse = catalogDefs.catalogs?.[catalogRef.catalogName];
|
|
436612
436663
|
}
|
|
436613
436664
|
return catalogToUse?.[packageName] || null;
|
|
436614
436665
|
}
|
|
@@ -436617,35 +436668,35 @@ var require_pnpm_manager = __commonJS({
|
|
|
436617
436668
|
if (!catalogRef) {
|
|
436618
436669
|
throw new Error(`Invalid catalog reference syntax: "${version}". Expected format: "catalog:" or "catalog:name"`);
|
|
436619
436670
|
}
|
|
436620
|
-
const
|
|
436621
|
-
if (!
|
|
436622
|
-
throw new Error(formatCatalogError(
|
|
436671
|
+
const catalogDefs = this.getCatalogDefinitions(treeOrRoot);
|
|
436672
|
+
if (!catalogDefs) {
|
|
436673
|
+
throw new Error((0, manager_1.formatCatalogError)(`Cannot get Pnpm catalog definitions. No ${PNPM_WORKSPACE_FILENAME} found in workspace root.`, [`Create a ${PNPM_WORKSPACE_FILENAME} file in your workspace root`]));
|
|
436623
436674
|
}
|
|
436624
436675
|
let catalogToUse;
|
|
436625
436676
|
if (catalogRef.isDefaultCatalog) {
|
|
436626
|
-
const hasCatalog = !!
|
|
436627
|
-
const hasCatalogsDefault = !!
|
|
436677
|
+
const hasCatalog = !!catalogDefs.catalog;
|
|
436678
|
+
const hasCatalogsDefault = !!catalogDefs.catalogs?.default;
|
|
436628
436679
|
if (hasCatalog && hasCatalogsDefault) {
|
|
436629
436680
|
throw new Error("The 'default' catalog was defined multiple times. Use the 'catalog' field or 'catalogs.default', but not both.");
|
|
436630
436681
|
}
|
|
436631
|
-
catalogToUse =
|
|
436682
|
+
catalogToUse = catalogDefs.catalog ?? catalogDefs.catalogs?.default;
|
|
436632
436683
|
if (!catalogToUse) {
|
|
436633
|
-
const availableCatalogs = Object.keys(
|
|
436684
|
+
const availableCatalogs = Object.keys(catalogDefs.catalogs || {});
|
|
436634
436685
|
const suggestions = [
|
|
436635
|
-
|
|
436686
|
+
`Define a default catalog in ${PNPM_WORKSPACE_FILENAME} under the "catalog" key`
|
|
436636
436687
|
];
|
|
436637
436688
|
if (availableCatalogs.length > 0) {
|
|
436638
436689
|
suggestions.push(`Or select from the available named catalogs: ${availableCatalogs.map((c) => `"catalog:${c}"`).join(", ")}`);
|
|
436639
436690
|
}
|
|
436640
|
-
throw new Error(formatCatalogError(
|
|
436691
|
+
throw new Error((0, manager_1.formatCatalogError)(`No default catalog defined in ${PNPM_WORKSPACE_FILENAME}`, suggestions));
|
|
436641
436692
|
}
|
|
436642
436693
|
} else if (catalogRef.catalogName) {
|
|
436643
|
-
catalogToUse =
|
|
436694
|
+
catalogToUse = catalogDefs.catalogs?.[catalogRef.catalogName];
|
|
436644
436695
|
if (!catalogToUse) {
|
|
436645
|
-
const availableCatalogs = Object.keys(
|
|
436646
|
-
const defaultCatalog = !!
|
|
436696
|
+
const availableCatalogs = Object.keys(catalogDefs.catalogs || {}).filter((c) => c !== "default");
|
|
436697
|
+
const defaultCatalog = !!catalogDefs.catalog ? "catalog" : !catalogDefs.catalogs?.default ? "catalogs.default" : null;
|
|
436647
436698
|
const suggestions = [
|
|
436648
|
-
|
|
436699
|
+
`Define the catalog in ${PNPM_WORKSPACE_FILENAME} under the "catalogs" key`
|
|
436649
436700
|
];
|
|
436650
436701
|
if (availableCatalogs.length > 0) {
|
|
436651
436702
|
suggestions.push(`Or select from the available named catalogs: ${availableCatalogs.map((c) => `"catalog:${c}"`).join(", ")}`);
|
|
@@ -436653,25 +436704,25 @@ var require_pnpm_manager = __commonJS({
|
|
|
436653
436704
|
if (defaultCatalog) {
|
|
436654
436705
|
suggestions.push(`Or use the default catalog ("${defaultCatalog}")`);
|
|
436655
436706
|
}
|
|
436656
|
-
throw new Error(formatCatalogError(`Catalog "${catalogRef.catalogName}" not found in
|
|
436707
|
+
throw new Error((0, manager_1.formatCatalogError)(`Catalog "${catalogRef.catalogName}" not found in ${PNPM_WORKSPACE_FILENAME}`, suggestions));
|
|
436657
436708
|
}
|
|
436658
436709
|
}
|
|
436659
436710
|
if (!catalogToUse[packageName]) {
|
|
436660
436711
|
let catalogName;
|
|
436661
436712
|
if (catalogRef.isDefaultCatalog) {
|
|
436662
|
-
const hasCatalog = !!
|
|
436713
|
+
const hasCatalog = !!catalogDefs.catalog;
|
|
436663
436714
|
catalogName = hasCatalog ? 'default catalog ("catalog")' : 'default catalog ("catalogs.default")';
|
|
436664
436715
|
} else {
|
|
436665
436716
|
catalogName = `catalog '${catalogRef.catalogName}'`;
|
|
436666
436717
|
}
|
|
436667
436718
|
const availablePackages = Object.keys(catalogToUse);
|
|
436668
436719
|
const suggestions = [
|
|
436669
|
-
`Add "${packageName}" to ${catalogName} in
|
|
436720
|
+
`Add "${packageName}" to ${catalogName} in ${PNPM_WORKSPACE_FILENAME}`
|
|
436670
436721
|
];
|
|
436671
436722
|
if (availablePackages.length > 0) {
|
|
436672
436723
|
suggestions.push(`Or select from the available packages in ${catalogName}: ${availablePackages.map((p) => `"${p}"`).join(", ")}`);
|
|
436673
436724
|
}
|
|
436674
|
-
throw new Error(formatCatalogError(`Package "${packageName}" not found in ${catalogName}`, suggestions));
|
|
436725
|
+
throw new Error((0, manager_1.formatCatalogError)(`Package "${packageName}" not found in ${catalogName}`, suggestions));
|
|
436675
436726
|
}
|
|
436676
436727
|
}
|
|
436677
436728
|
updateCatalogVersions(treeOrRoot, updates) {
|
|
@@ -436679,46 +436730,46 @@ var require_pnpm_manager = __commonJS({
|
|
|
436679
436730
|
let readYaml;
|
|
436680
436731
|
let writeYaml;
|
|
436681
436732
|
if (typeof treeOrRoot === "string") {
|
|
436682
|
-
const
|
|
436683
|
-
checkExists = () => (0, node_fs_1.existsSync)(
|
|
436684
|
-
readYaml = () => (0, node_fs_1.readFileSync)(
|
|
436685
|
-
writeYaml = (content) => (0, node_fs_1.writeFileSync)(
|
|
436733
|
+
const configPath = (0, node_path_1.join)(treeOrRoot, PNPM_WORKSPACE_FILENAME);
|
|
436734
|
+
checkExists = () => (0, node_fs_1.existsSync)(configPath);
|
|
436735
|
+
readYaml = () => (0, node_fs_1.readFileSync)(configPath, "utf-8");
|
|
436736
|
+
writeYaml = (content) => (0, node_fs_1.writeFileSync)(configPath, content, "utf-8");
|
|
436686
436737
|
} else {
|
|
436687
|
-
checkExists = () => treeOrRoot.exists(
|
|
436688
|
-
readYaml = () => treeOrRoot.read(
|
|
436689
|
-
writeYaml = (content) => treeOrRoot.write(
|
|
436738
|
+
checkExists = () => treeOrRoot.exists(PNPM_WORKSPACE_FILENAME);
|
|
436739
|
+
readYaml = () => treeOrRoot.read(PNPM_WORKSPACE_FILENAME, "utf-8");
|
|
436740
|
+
writeYaml = (content) => treeOrRoot.write(PNPM_WORKSPACE_FILENAME, content);
|
|
436690
436741
|
}
|
|
436691
436742
|
if (!checkExists()) {
|
|
436692
436743
|
devkit_exports_1.output.warn({
|
|
436693
|
-
title:
|
|
436744
|
+
title: `No ${PNPM_WORKSPACE_FILENAME} found`,
|
|
436694
436745
|
bodyLines: [
|
|
436695
|
-
|
|
436696
|
-
|
|
436746
|
+
`Cannot update catalog versions without a ${PNPM_WORKSPACE_FILENAME} file.`,
|
|
436747
|
+
`Create a ${PNPM_WORKSPACE_FILENAME} file to use catalogs.`
|
|
436697
436748
|
]
|
|
436698
436749
|
});
|
|
436699
436750
|
return;
|
|
436700
436751
|
}
|
|
436701
436752
|
try {
|
|
436702
|
-
const
|
|
436703
|
-
const
|
|
436753
|
+
const configContent = readYaml();
|
|
436754
|
+
const configData = (0, js_yaml_1.load)(configContent) || {};
|
|
436704
436755
|
let hasChanges = false;
|
|
436705
436756
|
for (const update of updates) {
|
|
436706
436757
|
const { packageName, version, catalogName } = update;
|
|
436707
436758
|
const normalizedCatalogName = catalogName === "default" ? void 0 : catalogName;
|
|
436708
436759
|
let targetCatalog;
|
|
436709
436760
|
if (!normalizedCatalogName) {
|
|
436710
|
-
if (
|
|
436711
|
-
targetCatalog =
|
|
436712
|
-
} else if (
|
|
436713
|
-
targetCatalog =
|
|
436761
|
+
if (configData.catalog) {
|
|
436762
|
+
targetCatalog = configData.catalog;
|
|
436763
|
+
} else if (configData.catalogs?.default) {
|
|
436764
|
+
targetCatalog = configData.catalogs.default;
|
|
436714
436765
|
} else {
|
|
436715
|
-
|
|
436716
|
-
targetCatalog =
|
|
436766
|
+
configData.catalog ??= {};
|
|
436767
|
+
targetCatalog = configData.catalog;
|
|
436717
436768
|
}
|
|
436718
436769
|
} else {
|
|
436719
|
-
|
|
436720
|
-
|
|
436721
|
-
targetCatalog =
|
|
436770
|
+
configData.catalogs ??= {};
|
|
436771
|
+
configData.catalogs[normalizedCatalogName] ??= {};
|
|
436772
|
+
targetCatalog = configData.catalogs[normalizedCatalogName];
|
|
436722
436773
|
}
|
|
436723
436774
|
if (targetCatalog[packageName] !== version) {
|
|
436724
436775
|
targetCatalog[packageName] = version;
|
|
@@ -436726,7 +436777,7 @@ var require_pnpm_manager = __commonJS({
|
|
|
436726
436777
|
}
|
|
436727
436778
|
}
|
|
436728
436779
|
if (hasChanges) {
|
|
436729
|
-
writeYaml((0, js_yaml_1.dump)(
|
|
436780
|
+
writeYaml((0, js_yaml_1.dump)(configData, {
|
|
436730
436781
|
indent: 2,
|
|
436731
436782
|
quotingType: '"',
|
|
436732
436783
|
forceQuotes: true
|
|
@@ -436742,40 +436793,250 @@ var require_pnpm_manager = __commonJS({
|
|
|
436742
436793
|
}
|
|
436743
436794
|
};
|
|
436744
436795
|
exports2.PnpmCatalogManager = PnpmCatalogManager;
|
|
436745
|
-
function
|
|
436796
|
+
function readConfigFromFs(path) {
|
|
436746
436797
|
try {
|
|
436747
436798
|
return (0, devkit_internals_1.readYamlFile)(path);
|
|
436748
436799
|
} catch (error2) {
|
|
436749
436800
|
devkit_exports_1.output.warn({
|
|
436750
|
-
title:
|
|
436801
|
+
title: `Unable to parse ${PNPM_WORKSPACE_FILENAME}`,
|
|
436751
436802
|
bodyLines: [error2.toString()]
|
|
436752
436803
|
});
|
|
436753
436804
|
return null;
|
|
436754
436805
|
}
|
|
436755
436806
|
}
|
|
436756
|
-
function
|
|
436807
|
+
function readConfigFromTree(tree, path) {
|
|
436757
436808
|
const content = tree.read(path, "utf-8");
|
|
436758
|
-
const { load: load2 } = require_js_yaml();
|
|
436759
436809
|
try {
|
|
436760
|
-
return
|
|
436810
|
+
return (0, js_yaml_1.load)(content, { filename: path });
|
|
436761
436811
|
} catch (error2) {
|
|
436762
436812
|
devkit_exports_1.output.warn({
|
|
436763
|
-
title:
|
|
436813
|
+
title: `Unable to parse ${PNPM_WORKSPACE_FILENAME}`,
|
|
436764
436814
|
bodyLines: [error2.toString()]
|
|
436765
436815
|
});
|
|
436766
436816
|
return null;
|
|
436767
436817
|
}
|
|
436768
436818
|
}
|
|
436769
|
-
|
|
436770
|
-
|
|
436771
|
-
|
|
436772
|
-
|
|
436773
|
-
|
|
436774
|
-
|
|
436775
|
-
|
|
436819
|
+
}
|
|
436820
|
+
});
|
|
436821
|
+
|
|
436822
|
+
// node_modules/@nx/devkit/src/utils/catalog/yarn-manager.js
|
|
436823
|
+
var require_yarn_manager = __commonJS({
|
|
436824
|
+
"node_modules/@nx/devkit/src/utils/catalog/yarn-manager.js"(exports2) {
|
|
436825
|
+
"use strict";
|
|
436826
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
436827
|
+
exports2.YarnCatalogManager = void 0;
|
|
436828
|
+
var js_yaml_1 = require_js_yaml();
|
|
436829
|
+
var node_fs_1 = require("node:fs");
|
|
436830
|
+
var node_path_1 = require("node:path");
|
|
436831
|
+
var devkit_exports_1 = require("nx/src/devkit-exports");
|
|
436832
|
+
var devkit_internals_1 = require("nx/src/devkit-internals");
|
|
436833
|
+
var manager_1 = require_manager();
|
|
436834
|
+
var YARNRC_FILENAME = ".yarnrc.yml";
|
|
436835
|
+
var YarnCatalogManager = class {
|
|
436836
|
+
constructor() {
|
|
436837
|
+
this.name = "yarn";
|
|
436838
|
+
this.catalogProtocol = "catalog:";
|
|
436839
|
+
}
|
|
436840
|
+
isCatalogReference(version) {
|
|
436841
|
+
return version.startsWith(this.catalogProtocol);
|
|
436842
|
+
}
|
|
436843
|
+
parseCatalogReference(version) {
|
|
436844
|
+
if (!this.isCatalogReference(version)) {
|
|
436845
|
+
return null;
|
|
436846
|
+
}
|
|
436847
|
+
const catalogName = version.substring(this.catalogProtocol.length);
|
|
436848
|
+
const isDefault = !catalogName || catalogName === "default";
|
|
436849
|
+
return {
|
|
436850
|
+
catalogName: isDefault ? void 0 : catalogName,
|
|
436851
|
+
isDefaultCatalog: isDefault
|
|
436852
|
+
};
|
|
436853
|
+
}
|
|
436854
|
+
getCatalogDefinitionFilePaths() {
|
|
436855
|
+
return [YARNRC_FILENAME];
|
|
436856
|
+
}
|
|
436857
|
+
getCatalogDefinitions(treeOrRoot) {
|
|
436858
|
+
if (typeof treeOrRoot === "string") {
|
|
436859
|
+
const configPath = (0, node_path_1.join)(treeOrRoot, YARNRC_FILENAME);
|
|
436860
|
+
if (!(0, node_fs_1.existsSync)(configPath)) {
|
|
436861
|
+
return null;
|
|
436862
|
+
}
|
|
436863
|
+
return readConfigFromFs(configPath);
|
|
436864
|
+
} else {
|
|
436865
|
+
if (!treeOrRoot.exists(YARNRC_FILENAME)) {
|
|
436866
|
+
return null;
|
|
436867
|
+
}
|
|
436868
|
+
return readConfigFromTree(treeOrRoot, YARNRC_FILENAME);
|
|
436869
|
+
}
|
|
436870
|
+
}
|
|
436871
|
+
resolveCatalogReference(treeOrRoot, packageName, version) {
|
|
436872
|
+
const catalogRef = this.parseCatalogReference(version);
|
|
436873
|
+
if (!catalogRef) {
|
|
436874
|
+
return null;
|
|
436875
|
+
}
|
|
436876
|
+
const catalogDefs = this.getCatalogDefinitions(treeOrRoot);
|
|
436877
|
+
if (!catalogDefs) {
|
|
436878
|
+
return null;
|
|
436879
|
+
}
|
|
436880
|
+
let catalogToUse;
|
|
436881
|
+
if (catalogRef.isDefaultCatalog) {
|
|
436882
|
+
catalogToUse = catalogDefs.catalog ?? catalogDefs.catalogs?.default;
|
|
436883
|
+
} else if (catalogRef.catalogName) {
|
|
436884
|
+
catalogToUse = catalogDefs.catalogs?.[catalogRef.catalogName];
|
|
436885
|
+
}
|
|
436886
|
+
return catalogToUse?.[packageName] || null;
|
|
436887
|
+
}
|
|
436888
|
+
validateCatalogReference(treeOrRoot, packageName, version) {
|
|
436889
|
+
const catalogRef = this.parseCatalogReference(version);
|
|
436890
|
+
if (!catalogRef) {
|
|
436891
|
+
throw new Error(`Invalid catalog reference syntax: "${version}". Expected format: "catalog:" or "catalog:name"`);
|
|
436892
|
+
}
|
|
436893
|
+
const catalogDefs = this.getCatalogDefinitions(treeOrRoot);
|
|
436894
|
+
if (!catalogDefs) {
|
|
436895
|
+
throw new Error((0, manager_1.formatCatalogError)(`Cannot get Yarn catalog definitions. No ${YARNRC_FILENAME} found in workspace root.`, [`Create a ${YARNRC_FILENAME} file in your workspace root`]));
|
|
436896
|
+
}
|
|
436897
|
+
let catalogToUse;
|
|
436898
|
+
if (catalogRef.isDefaultCatalog) {
|
|
436899
|
+
const hasCatalog = !!catalogDefs.catalog;
|
|
436900
|
+
const hasCatalogsDefault = !!catalogDefs.catalogs?.default;
|
|
436901
|
+
if (hasCatalog && hasCatalogsDefault) {
|
|
436902
|
+
throw new Error("The 'default' catalog was defined multiple times. Use the 'catalog' field or 'catalogs.default', but not both.");
|
|
436903
|
+
}
|
|
436904
|
+
catalogToUse = catalogDefs.catalog ?? catalogDefs.catalogs?.default;
|
|
436905
|
+
if (!catalogToUse) {
|
|
436906
|
+
const availableCatalogs = Object.keys(catalogDefs.catalogs || {});
|
|
436907
|
+
const suggestions = [
|
|
436908
|
+
`Define a default catalog in ${YARNRC_FILENAME} under the "catalog" key`
|
|
436909
|
+
];
|
|
436910
|
+
if (availableCatalogs.length > 0) {
|
|
436911
|
+
suggestions.push(`Or select from the available named catalogs: ${availableCatalogs.map((c) => `"catalog:${c}"`).join(", ")}`);
|
|
436912
|
+
}
|
|
436913
|
+
throw new Error((0, manager_1.formatCatalogError)(`No default catalog defined in ${YARNRC_FILENAME}`, suggestions));
|
|
436914
|
+
}
|
|
436915
|
+
} else if (catalogRef.catalogName) {
|
|
436916
|
+
catalogToUse = catalogDefs.catalogs?.[catalogRef.catalogName];
|
|
436917
|
+
if (!catalogToUse) {
|
|
436918
|
+
const availableCatalogs = Object.keys(catalogDefs.catalogs || {}).filter((c) => c !== "default");
|
|
436919
|
+
const defaultCatalog = !!catalogDefs.catalog ? "catalog" : !catalogDefs.catalogs?.default ? "catalogs.default" : null;
|
|
436920
|
+
const suggestions = [
|
|
436921
|
+
`Define the catalog in ${YARNRC_FILENAME} under the "catalogs" key`
|
|
436922
|
+
];
|
|
436923
|
+
if (availableCatalogs.length > 0) {
|
|
436924
|
+
suggestions.push(`Or select from the available named catalogs: ${availableCatalogs.map((c) => `"catalog:${c}"`).join(", ")}`);
|
|
436925
|
+
}
|
|
436926
|
+
if (defaultCatalog) {
|
|
436927
|
+
suggestions.push(`Or use the default catalog ("${defaultCatalog}")`);
|
|
436928
|
+
}
|
|
436929
|
+
throw new Error((0, manager_1.formatCatalogError)(`Catalog "${catalogRef.catalogName}" not found in ${YARNRC_FILENAME}`, suggestions));
|
|
436930
|
+
}
|
|
436931
|
+
}
|
|
436932
|
+
if (!catalogToUse[packageName]) {
|
|
436933
|
+
let catalogName;
|
|
436934
|
+
if (catalogRef.isDefaultCatalog) {
|
|
436935
|
+
const hasCatalog = !!catalogDefs.catalog;
|
|
436936
|
+
catalogName = hasCatalog ? 'default catalog ("catalog")' : 'default catalog ("catalogs.default")';
|
|
436937
|
+
} else {
|
|
436938
|
+
catalogName = `catalog '${catalogRef.catalogName}'`;
|
|
436939
|
+
}
|
|
436940
|
+
const availablePackages = Object.keys(catalogToUse);
|
|
436941
|
+
const suggestions = [
|
|
436942
|
+
`Add "${packageName}" to ${catalogName} in ${YARNRC_FILENAME}`
|
|
436943
|
+
];
|
|
436944
|
+
if (availablePackages.length > 0) {
|
|
436945
|
+
suggestions.push(`Or select from the available packages in ${catalogName}: ${availablePackages.map((p) => `"${p}"`).join(", ")}`);
|
|
436946
|
+
}
|
|
436947
|
+
throw new Error((0, manager_1.formatCatalogError)(`Package "${packageName}" not found in ${catalogName}`, suggestions));
|
|
436948
|
+
}
|
|
436949
|
+
}
|
|
436950
|
+
updateCatalogVersions(treeOrRoot, updates) {
|
|
436951
|
+
let checkExists;
|
|
436952
|
+
let readYaml;
|
|
436953
|
+
let writeYaml;
|
|
436954
|
+
if (typeof treeOrRoot === "string") {
|
|
436955
|
+
const configPath = (0, node_path_1.join)(treeOrRoot, YARNRC_FILENAME);
|
|
436956
|
+
checkExists = () => (0, node_fs_1.existsSync)(configPath);
|
|
436957
|
+
readYaml = () => (0, node_fs_1.readFileSync)(configPath, "utf-8");
|
|
436958
|
+
writeYaml = (content) => (0, node_fs_1.writeFileSync)(configPath, content, "utf-8");
|
|
436959
|
+
} else {
|
|
436960
|
+
checkExists = () => treeOrRoot.exists(YARNRC_FILENAME);
|
|
436961
|
+
readYaml = () => treeOrRoot.read(YARNRC_FILENAME, "utf-8");
|
|
436962
|
+
writeYaml = (content) => treeOrRoot.write(YARNRC_FILENAME, content);
|
|
436963
|
+
}
|
|
436964
|
+
if (!checkExists()) {
|
|
436965
|
+
devkit_exports_1.output.warn({
|
|
436966
|
+
title: `No ${YARNRC_FILENAME} found`,
|
|
436967
|
+
bodyLines: [
|
|
436968
|
+
`Cannot update catalog versions without a ${YARNRC_FILENAME} file.`,
|
|
436969
|
+
`Create a ${YARNRC_FILENAME} file to use catalogs.`
|
|
436970
|
+
]
|
|
436971
|
+
});
|
|
436972
|
+
return;
|
|
436973
|
+
}
|
|
436974
|
+
try {
|
|
436975
|
+
const configContent = readYaml();
|
|
436976
|
+
const configData = (0, js_yaml_1.load)(configContent) || {};
|
|
436977
|
+
let hasChanges = false;
|
|
436978
|
+
for (const update of updates) {
|
|
436979
|
+
const { packageName, version, catalogName } = update;
|
|
436980
|
+
const normalizedCatalogName = catalogName === "default" ? void 0 : catalogName;
|
|
436981
|
+
let targetCatalog;
|
|
436982
|
+
if (!normalizedCatalogName) {
|
|
436983
|
+
if (configData.catalog) {
|
|
436984
|
+
targetCatalog = configData.catalog;
|
|
436985
|
+
} else if (configData.catalogs?.default) {
|
|
436986
|
+
targetCatalog = configData.catalogs.default;
|
|
436987
|
+
} else {
|
|
436988
|
+
configData.catalog ??= {};
|
|
436989
|
+
targetCatalog = configData.catalog;
|
|
436990
|
+
}
|
|
436991
|
+
} else {
|
|
436992
|
+
configData.catalogs ??= {};
|
|
436993
|
+
configData.catalogs[normalizedCatalogName] ??= {};
|
|
436994
|
+
targetCatalog = configData.catalogs[normalizedCatalogName];
|
|
436995
|
+
}
|
|
436996
|
+
if (targetCatalog[packageName] !== version) {
|
|
436997
|
+
targetCatalog[packageName] = version;
|
|
436998
|
+
hasChanges = true;
|
|
436999
|
+
}
|
|
437000
|
+
}
|
|
437001
|
+
if (hasChanges) {
|
|
437002
|
+
writeYaml((0, js_yaml_1.dump)(configData, {
|
|
437003
|
+
indent: 2,
|
|
437004
|
+
quotingType: '"',
|
|
437005
|
+
forceQuotes: true
|
|
437006
|
+
}));
|
|
437007
|
+
}
|
|
437008
|
+
} catch (error2) {
|
|
437009
|
+
devkit_exports_1.output.error({
|
|
437010
|
+
title: "Failed to update catalog versions",
|
|
437011
|
+
bodyLines: [error2 instanceof Error ? error2.message : String(error2)]
|
|
437012
|
+
});
|
|
437013
|
+
throw error2;
|
|
437014
|
+
}
|
|
437015
|
+
}
|
|
437016
|
+
};
|
|
437017
|
+
exports2.YarnCatalogManager = YarnCatalogManager;
|
|
437018
|
+
function readConfigFromFs(path) {
|
|
437019
|
+
try {
|
|
437020
|
+
return (0, devkit_internals_1.readYamlFile)(path);
|
|
437021
|
+
} catch (error2) {
|
|
437022
|
+
devkit_exports_1.output.warn({
|
|
437023
|
+
title: `Unable to parse ${YARNRC_FILENAME}`,
|
|
437024
|
+
bodyLines: [error2.toString()]
|
|
436776
437025
|
});
|
|
437026
|
+
return null;
|
|
437027
|
+
}
|
|
437028
|
+
}
|
|
437029
|
+
function readConfigFromTree(tree, path) {
|
|
437030
|
+
const content = tree.read(path, "utf-8");
|
|
437031
|
+
try {
|
|
437032
|
+
return (0, js_yaml_1.load)(content, { filename: path });
|
|
437033
|
+
} catch (error2) {
|
|
437034
|
+
devkit_exports_1.output.warn({
|
|
437035
|
+
title: `Unable to parse ${YARNRC_FILENAME}`,
|
|
437036
|
+
bodyLines: [error2.toString()]
|
|
437037
|
+
});
|
|
437038
|
+
return null;
|
|
436777
437039
|
}
|
|
436778
|
-
return message;
|
|
436779
437040
|
}
|
|
436780
437041
|
}
|
|
436781
437042
|
});
|
|
@@ -436788,11 +437049,14 @@ var require_manager_factory = __commonJS({
|
|
|
436788
437049
|
exports2.getCatalogManager = getCatalogManager;
|
|
436789
437050
|
var devkit_exports_1 = require("nx/src/devkit-exports");
|
|
436790
437051
|
var pnpm_manager_1 = require_pnpm_manager();
|
|
437052
|
+
var yarn_manager_1 = require_yarn_manager();
|
|
436791
437053
|
function getCatalogManager(workspaceRoot) {
|
|
436792
437054
|
const packageManager = (0, devkit_exports_1.detectPackageManager)(workspaceRoot);
|
|
436793
437055
|
switch (packageManager) {
|
|
436794
437056
|
case "pnpm":
|
|
436795
437057
|
return new pnpm_manager_1.PnpmCatalogManager();
|
|
437058
|
+
case "yarn":
|
|
437059
|
+
return new yarn_manager_1.YarnCatalogManager();
|
|
436796
437060
|
default:
|
|
436797
437061
|
return null;
|
|
436798
437062
|
}
|
|
@@ -437210,7 +437474,7 @@ var require_package_json = __commonJS({
|
|
|
437210
437474
|
if (process.env.NX_DRY_RUN && process.env.NX_DRY_RUN !== "false") {
|
|
437211
437475
|
throw new Error('NOTE: This generator does not support --dry-run. If you are running this in Nx Console, it should execute fine once you hit the "Generate" button.\n');
|
|
437212
437476
|
}
|
|
437213
|
-
const { tempDir } = (0, devkit_internals_1.installPackageToTmp)(pkg, requiredVersion);
|
|
437477
|
+
const { tempDir } = (0, devkit_internals_1.installPackageToTmp)(pkg, requiredVersion, (0, devkit_exports_1.detectPackageManager)(devkit_exports_1.workspaceRoot));
|
|
437214
437478
|
addToNodePath((0, path_1.join)(devkit_exports_1.workspaceRoot, "node_modules"));
|
|
437215
437479
|
addToNodePath((0, path_1.join)(tempDir, "node_modules"));
|
|
437216
437480
|
module_1.Module._initPaths();
|
|
@@ -437390,7 +437654,8 @@ var require_parse_target_string = __commonJS({
|
|
|
437390
437654
|
if (!projectGraph.nodes[maybeProject] && projectGraphOrCtx && "projectName" in projectGraphOrCtx && maybeProject !== projectGraphOrCtx.projectName) {
|
|
437391
437655
|
targetString = `${projectGraphOrCtx.projectName}:${targetString}`;
|
|
437392
437656
|
}
|
|
437393
|
-
const
|
|
437657
|
+
const currentProject = projectGraphOrCtx && "projectName" in projectGraphOrCtx ? projectGraphOrCtx.projectName : void 0;
|
|
437658
|
+
const [project, target, configuration] = (0, devkit_internals_1.splitTarget)(targetString, projectGraph, { currentProject });
|
|
437394
437659
|
if (!project || !target) {
|
|
437395
437660
|
throw new Error(`Invalid Target String: ${targetString}`);
|
|
437396
437661
|
}
|
|
@@ -447182,6 +447447,7 @@ var require_delegate = __commonJS({
|
|
|
447182
447447
|
_other;
|
|
447183
447448
|
constructor(_other) {
|
|
447184
447449
|
this._other = _other;
|
|
447450
|
+
this[interface_1.TreeSymbol] = () => this;
|
|
447185
447451
|
}
|
|
447186
447452
|
branch() {
|
|
447187
447453
|
return this._other.branch();
|
|
@@ -447240,9 +447506,6 @@ var require_delegate = __commonJS({
|
|
|
447240
447506
|
get actions() {
|
|
447241
447507
|
return this._other.actions;
|
|
447242
447508
|
}
|
|
447243
|
-
[interface_1.TreeSymbol]() {
|
|
447244
|
-
return this;
|
|
447245
|
-
}
|
|
447246
447509
|
};
|
|
447247
447510
|
exports2.DelegateTree = DelegateTree;
|
|
447248
447511
|
}
|
|
@@ -449131,6 +449394,7 @@ var require_scoped = __commonJS({
|
|
|
449131
449394
|
_root;
|
|
449132
449395
|
constructor(_base, scope) {
|
|
449133
449396
|
this._base = _base;
|
|
449397
|
+
this[interface_1.TreeSymbol] = () => this;
|
|
449134
449398
|
const normalizedScope = (0, core_1.normalize)("/" + scope);
|
|
449135
449399
|
this._root = new ScopedDirEntry(this._base.getDir(normalizedScope), normalizedScope);
|
|
449136
449400
|
}
|
|
@@ -449217,9 +449481,6 @@ var require_scoped = __commonJS({
|
|
|
449217
449481
|
}
|
|
449218
449482
|
return scopedActions;
|
|
449219
449483
|
}
|
|
449220
|
-
[interface_1.TreeSymbol]() {
|
|
449221
|
-
return this;
|
|
449222
|
-
}
|
|
449223
449484
|
_fullPath(path) {
|
|
449224
449485
|
return (0, core_1.join)(this._root.scope, (0, core_1.normalize)("/" + path));
|
|
449225
449486
|
}
|
|
@@ -449306,9 +449567,6 @@ var require_host_tree = __commonJS({
|
|
|
449306
449567
|
_recordSync;
|
|
449307
449568
|
_ancestry = /* @__PURE__ */ new Set();
|
|
449308
449569
|
_dirCache = /* @__PURE__ */ new Map();
|
|
449309
|
-
[interface_1.TreeSymbol]() {
|
|
449310
|
-
return this;
|
|
449311
|
-
}
|
|
449312
449570
|
static isHostTree(tree) {
|
|
449313
449571
|
if (tree instanceof _HostTree) {
|
|
449314
449572
|
return true;
|
|
@@ -449320,6 +449578,7 @@ var require_host_tree = __commonJS({
|
|
|
449320
449578
|
}
|
|
449321
449579
|
constructor(_backend = new core_1.virtualFs.Empty()) {
|
|
449322
449580
|
this._backend = _backend;
|
|
449581
|
+
this[interface_1.TreeSymbol] = () => this;
|
|
449323
449582
|
this._record = new core_1.virtualFs.CordHost(new core_1.virtualFs.SafeReadonlyHost(_backend));
|
|
449324
449583
|
this._recordSync = new core_1.virtualFs.SyncDelegateHost(this._record);
|
|
449325
449584
|
}
|
|
@@ -449727,8 +449986,8 @@ var require_null2 = __commonJS({
|
|
|
449727
449986
|
};
|
|
449728
449987
|
exports2.NullTreeDirEntry = NullTreeDirEntry;
|
|
449729
449988
|
var NullTree = class _NullTree {
|
|
449730
|
-
|
|
449731
|
-
|
|
449989
|
+
constructor() {
|
|
449990
|
+
this[interface_1.TreeSymbol] = () => this;
|
|
449732
449991
|
}
|
|
449733
449992
|
branch() {
|
|
449734
449993
|
return new _NullTree();
|
|
@@ -454066,7 +454325,7 @@ var init_yoctocolors = __esm({
|
|
|
454066
454325
|
}
|
|
454067
454326
|
});
|
|
454068
454327
|
|
|
454069
|
-
// node_modules/is-unicode-supported/index.js
|
|
454328
|
+
// node_modules/ora/node_modules/is-unicode-supported/index.js
|
|
454070
454329
|
function isUnicodeSupported() {
|
|
454071
454330
|
const { env: env2 } = import_node_process4.default;
|
|
454072
454331
|
const { TERM, TERM_PROGRAM } = env2;
|
|
@@ -454077,7 +454336,7 @@ function isUnicodeSupported() {
|
|
|
454077
454336
|
}
|
|
454078
454337
|
var import_node_process4;
|
|
454079
454338
|
var init_is_unicode_supported = __esm({
|
|
454080
|
-
"node_modules/is-unicode-supported/index.js"() {
|
|
454339
|
+
"node_modules/ora/node_modules/is-unicode-supported/index.js"() {
|
|
454081
454340
|
"use strict";
|
|
454082
454341
|
import_node_process4 = __toESM(require("node:process"), 1);
|
|
454083
454342
|
}
|
|
@@ -454113,7 +454372,7 @@ var init_log_symbols = __esm({
|
|
|
454113
454372
|
}
|
|
454114
454373
|
});
|
|
454115
454374
|
|
|
454116
|
-
// node_modules/ora/node_modules/strip-ansi/node_modules/ansi-regex/index.js
|
|
454375
|
+
// node_modules/ora/node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js
|
|
454117
454376
|
function ansiRegex({ onlyFirst = false } = {}) {
|
|
454118
454377
|
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
454119
454378
|
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
@@ -454122,12 +454381,12 @@ function ansiRegex({ onlyFirst = false } = {}) {
|
|
|
454122
454381
|
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
454123
454382
|
}
|
|
454124
454383
|
var init_ansi_regex = __esm({
|
|
454125
|
-
"node_modules/ora/node_modules/strip-ansi/node_modules/ansi-regex/index.js"() {
|
|
454384
|
+
"node_modules/ora/node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js"() {
|
|
454126
454385
|
"use strict";
|
|
454127
454386
|
}
|
|
454128
454387
|
});
|
|
454129
454388
|
|
|
454130
|
-
// node_modules/ora/node_modules/strip-ansi/index.js
|
|
454389
|
+
// node_modules/ora/node_modules/string-width/node_modules/strip-ansi/index.js
|
|
454131
454390
|
function stripAnsi(string) {
|
|
454132
454391
|
if (typeof string !== "string") {
|
|
454133
454392
|
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
@@ -454136,7 +454395,7 @@ function stripAnsi(string) {
|
|
|
454136
454395
|
}
|
|
454137
454396
|
var regex;
|
|
454138
454397
|
var init_strip_ansi = __esm({
|
|
454139
|
-
"node_modules/ora/node_modules/strip-ansi/index.js"() {
|
|
454398
|
+
"node_modules/ora/node_modules/string-width/node_modules/strip-ansi/index.js"() {
|
|
454140
454399
|
"use strict";
|
|
454141
454400
|
init_ansi_regex();
|
|
454142
454401
|
regex = ansiRegex();
|
|
@@ -454339,14 +454598,14 @@ var init_string_width = __esm({
|
|
|
454339
454598
|
}
|
|
454340
454599
|
});
|
|
454341
454600
|
|
|
454342
|
-
// node_modules/is-interactive/index.js
|
|
454601
|
+
// node_modules/ora/node_modules/is-interactive/index.js
|
|
454343
454602
|
function isInteractive({ stream = process.stdout } = {}) {
|
|
454344
454603
|
return Boolean(
|
|
454345
454604
|
stream && stream.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env)
|
|
454346
454605
|
);
|
|
454347
454606
|
}
|
|
454348
454607
|
var init_is_interactive = __esm({
|
|
454349
|
-
"node_modules/is-interactive/index.js"() {
|
|
454608
|
+
"node_modules/ora/node_modules/is-interactive/index.js"() {
|
|
454350
454609
|
"use strict";
|
|
454351
454610
|
}
|
|
454352
454611
|
});
|
|
@@ -454360,6 +454619,18 @@ var init_stdin_discarder = __esm({
|
|
|
454360
454619
|
ASCII_ETX_CODE = 3;
|
|
454361
454620
|
StdinDiscarder = class {
|
|
454362
454621
|
#activeCount = 0;
|
|
454622
|
+
#stdin;
|
|
454623
|
+
#stdinWasPaused = false;
|
|
454624
|
+
#stdinWasRaw = false;
|
|
454625
|
+
#handleInputBound = (chunk) => {
|
|
454626
|
+
if (!chunk?.length) {
|
|
454627
|
+
return;
|
|
454628
|
+
}
|
|
454629
|
+
const code = typeof chunk === "string" ? chunk.codePointAt(0) : chunk[0];
|
|
454630
|
+
if (code === ASCII_ETX_CODE) {
|
|
454631
|
+
import_node_process5.default.kill(import_node_process5.default.pid, "SIGINT");
|
|
454632
|
+
}
|
|
454633
|
+
};
|
|
454363
454634
|
start() {
|
|
454364
454635
|
this.#activeCount++;
|
|
454365
454636
|
if (this.#activeCount === 1) {
|
|
@@ -454367,38 +454638,47 @@ var init_stdin_discarder = __esm({
|
|
|
454367
454638
|
}
|
|
454368
454639
|
}
|
|
454369
454640
|
stop() {
|
|
454370
|
-
if (this.#activeCount <= 0) {
|
|
454371
|
-
throw new Error("`stop` called more times than `start`");
|
|
454372
|
-
}
|
|
454373
|
-
this.#activeCount--;
|
|
454374
454641
|
if (this.#activeCount === 0) {
|
|
454642
|
+
return;
|
|
454643
|
+
}
|
|
454644
|
+
if (--this.#activeCount === 0) {
|
|
454375
454645
|
this.#realStop();
|
|
454376
454646
|
}
|
|
454377
454647
|
}
|
|
454378
454648
|
#realStart() {
|
|
454379
|
-
|
|
454649
|
+
const { stdin } = import_node_process5.default;
|
|
454650
|
+
if (import_node_process5.default.platform === "win32" || !stdin?.isTTY || typeof stdin.setRawMode !== "function") {
|
|
454651
|
+
this.#stdin = void 0;
|
|
454380
454652
|
return;
|
|
454381
454653
|
}
|
|
454382
|
-
|
|
454383
|
-
|
|
454384
|
-
|
|
454654
|
+
this.#stdin = stdin;
|
|
454655
|
+
this.#stdinWasPaused = stdin.isPaused();
|
|
454656
|
+
this.#stdinWasRaw = Boolean(stdin.isRaw);
|
|
454657
|
+
stdin.setRawMode(true);
|
|
454658
|
+
stdin.prependListener("data", this.#handleInputBound);
|
|
454659
|
+
if (this.#stdinWasPaused) {
|
|
454660
|
+
stdin.resume();
|
|
454661
|
+
}
|
|
454385
454662
|
}
|
|
454386
454663
|
#realStop() {
|
|
454387
|
-
if (!
|
|
454664
|
+
if (!this.#stdin) {
|
|
454388
454665
|
return;
|
|
454389
454666
|
}
|
|
454390
|
-
|
|
454391
|
-
|
|
454392
|
-
|
|
454393
|
-
|
|
454394
|
-
#handleInput(chunk) {
|
|
454395
|
-
if (chunk[0] === ASCII_ETX_CODE) {
|
|
454396
|
-
import_node_process5.default.emit("SIGINT");
|
|
454667
|
+
const stdin = this.#stdin;
|
|
454668
|
+
stdin.off("data", this.#handleInputBound);
|
|
454669
|
+
if (stdin.isTTY) {
|
|
454670
|
+
stdin.setRawMode?.(this.#stdinWasRaw);
|
|
454397
454671
|
}
|
|
454672
|
+
if (this.#stdinWasPaused) {
|
|
454673
|
+
stdin.pause();
|
|
454674
|
+
}
|
|
454675
|
+
this.#stdin = void 0;
|
|
454676
|
+
this.#stdinWasPaused = false;
|
|
454677
|
+
this.#stdinWasRaw = false;
|
|
454398
454678
|
}
|
|
454399
454679
|
};
|
|
454400
454680
|
stdinDiscarder = new StdinDiscarder();
|
|
454401
|
-
stdin_discarder_default = stdinDiscarder;
|
|
454681
|
+
stdin_discarder_default = Object.freeze(stdinDiscarder);
|
|
454402
454682
|
}
|
|
454403
454683
|
});
|
|
454404
454684
|
|
|
@@ -454430,40 +454710,102 @@ async function oraPromise(action, options) {
|
|
|
454430
454710
|
throw error2;
|
|
454431
454711
|
}
|
|
454432
454712
|
}
|
|
454433
|
-
var import_node_process6, Ora;
|
|
454713
|
+
var import_node_process6, import_node_util, RENDER_DEFERRAL_TIMEOUT, SYNCHRONIZED_OUTPUT_ENABLE, SYNCHRONIZED_OUTPUT_DISABLE, activeHooksPerStream, Ora;
|
|
454434
454714
|
var init_ora = __esm({
|
|
454435
454715
|
"node_modules/ora/index.js"() {
|
|
454436
454716
|
"use strict";
|
|
454437
454717
|
import_node_process6 = __toESM(require("node:process"), 1);
|
|
454718
|
+
import_node_util = require("node:util");
|
|
454438
454719
|
init_source();
|
|
454439
454720
|
init_cli_cursor();
|
|
454440
454721
|
init_cli_spinners();
|
|
454441
454722
|
init_log_symbols();
|
|
454442
|
-
init_strip_ansi();
|
|
454443
454723
|
init_string_width();
|
|
454444
454724
|
init_is_interactive();
|
|
454445
454725
|
init_is_unicode_supported();
|
|
454446
454726
|
init_stdin_discarder();
|
|
454447
454727
|
init_cli_spinners();
|
|
454728
|
+
RENDER_DEFERRAL_TIMEOUT = 200;
|
|
454729
|
+
SYNCHRONIZED_OUTPUT_ENABLE = "\x1B[?2026h";
|
|
454730
|
+
SYNCHRONIZED_OUTPUT_DISABLE = "\x1B[?2026l";
|
|
454731
|
+
activeHooksPerStream = /* @__PURE__ */ new Map();
|
|
454448
454732
|
Ora = class {
|
|
454449
454733
|
#linesToClear = 0;
|
|
454450
|
-
#isDiscardingStdin = false;
|
|
454451
|
-
#lineCount = 0;
|
|
454452
454734
|
#frameIndex = -1;
|
|
454453
|
-
#
|
|
454454
|
-
#lastIndent = 0;
|
|
454735
|
+
#lastFrameTime = 0;
|
|
454455
454736
|
#options;
|
|
454456
454737
|
#spinner;
|
|
454457
454738
|
#stream;
|
|
454458
454739
|
#id;
|
|
454459
|
-
#
|
|
454460
|
-
#
|
|
454461
|
-
#
|
|
454462
|
-
#
|
|
454463
|
-
#
|
|
454464
|
-
#prefixText;
|
|
454465
|
-
#suffixText;
|
|
454740
|
+
#hookedStreams = /* @__PURE__ */ new Map();
|
|
454741
|
+
#isInternalWrite = false;
|
|
454742
|
+
#drainHandler;
|
|
454743
|
+
#deferRenderTimer;
|
|
454744
|
+
#isDiscardingStdin = false;
|
|
454466
454745
|
color;
|
|
454746
|
+
// Helper to execute writes while preventing hook recursion
|
|
454747
|
+
#internalWrite(fn) {
|
|
454748
|
+
this.#isInternalWrite = true;
|
|
454749
|
+
try {
|
|
454750
|
+
return fn();
|
|
454751
|
+
} finally {
|
|
454752
|
+
this.#isInternalWrite = false;
|
|
454753
|
+
}
|
|
454754
|
+
}
|
|
454755
|
+
// Helper to render if still spinning
|
|
454756
|
+
#tryRender() {
|
|
454757
|
+
if (this.isSpinning) {
|
|
454758
|
+
this.render();
|
|
454759
|
+
}
|
|
454760
|
+
}
|
|
454761
|
+
#stringifyChunk(chunk, encoding) {
|
|
454762
|
+
if (chunk === void 0 || chunk === null) {
|
|
454763
|
+
return "";
|
|
454764
|
+
}
|
|
454765
|
+
if (typeof chunk === "string") {
|
|
454766
|
+
return chunk;
|
|
454767
|
+
}
|
|
454768
|
+
if (Buffer.isBuffer(chunk) || ArrayBuffer.isView(chunk)) {
|
|
454769
|
+
const normalizedEncoding = typeof encoding === "string" && encoding && encoding !== "buffer" ? encoding : "utf8";
|
|
454770
|
+
return Buffer.from(chunk).toString(normalizedEncoding);
|
|
454771
|
+
}
|
|
454772
|
+
return String(chunk);
|
|
454773
|
+
}
|
|
454774
|
+
#chunkTerminatesLine(chunkString) {
|
|
454775
|
+
if (!chunkString) {
|
|
454776
|
+
return false;
|
|
454777
|
+
}
|
|
454778
|
+
const lastCharacter = chunkString.at(-1);
|
|
454779
|
+
return lastCharacter === "\n" || lastCharacter === "\r";
|
|
454780
|
+
}
|
|
454781
|
+
#scheduleRenderDeferral() {
|
|
454782
|
+
if (this.#deferRenderTimer) {
|
|
454783
|
+
return;
|
|
454784
|
+
}
|
|
454785
|
+
this.#deferRenderTimer = setTimeout(() => {
|
|
454786
|
+
this.#deferRenderTimer = void 0;
|
|
454787
|
+
if (this.isSpinning) {
|
|
454788
|
+
this.#tryRender();
|
|
454789
|
+
}
|
|
454790
|
+
}, RENDER_DEFERRAL_TIMEOUT);
|
|
454791
|
+
if (typeof this.#deferRenderTimer?.unref === "function") {
|
|
454792
|
+
this.#deferRenderTimer.unref();
|
|
454793
|
+
}
|
|
454794
|
+
}
|
|
454795
|
+
#clearRenderDeferral() {
|
|
454796
|
+
if (this.#deferRenderTimer) {
|
|
454797
|
+
clearTimeout(this.#deferRenderTimer);
|
|
454798
|
+
this.#deferRenderTimer = void 0;
|
|
454799
|
+
}
|
|
454800
|
+
}
|
|
454801
|
+
// Helper to build complete line with symbol, text, prefix, and suffix
|
|
454802
|
+
#buildOutputLine(symbol, text, prefixText, suffixText) {
|
|
454803
|
+
const fullPrefixText = this.#getFullPrefixText(prefixText, " ");
|
|
454804
|
+
const separatorText = symbol ? " " : "";
|
|
454805
|
+
const fullText = typeof text === "string" ? separatorText + text : "";
|
|
454806
|
+
const fullSuffixText = this.#getFullSuffixText(suffixText, " ");
|
|
454807
|
+
return fullPrefixText + symbol + fullText + fullSuffixText;
|
|
454808
|
+
}
|
|
454467
454809
|
constructor(options) {
|
|
454468
454810
|
if (typeof options === "string") {
|
|
454469
454811
|
options = {
|
|
@@ -454478,18 +454820,23 @@ var init_ora = __esm({
|
|
|
454478
454820
|
...options
|
|
454479
454821
|
};
|
|
454480
454822
|
this.color = this.#options.color;
|
|
454481
|
-
this.spinner = this.#options.spinner;
|
|
454482
|
-
this.#initialInterval = this.#options.interval;
|
|
454483
454823
|
this.#stream = this.#options.stream;
|
|
454484
|
-
|
|
454485
|
-
|
|
454824
|
+
if (typeof this.#options.isEnabled !== "boolean") {
|
|
454825
|
+
this.#options.isEnabled = isInteractive({ stream: this.#stream });
|
|
454826
|
+
}
|
|
454827
|
+
if (typeof this.#options.isSilent !== "boolean") {
|
|
454828
|
+
this.#options.isSilent = false;
|
|
454829
|
+
}
|
|
454830
|
+
const userInterval = this.#options.interval;
|
|
454831
|
+
this.spinner = this.#options.spinner;
|
|
454832
|
+
this.#options.interval = userInterval;
|
|
454486
454833
|
this.text = this.#options.text;
|
|
454487
454834
|
this.prefixText = this.#options.prefixText;
|
|
454488
454835
|
this.suffixText = this.#options.suffixText;
|
|
454489
454836
|
this.indent = this.#options.indent;
|
|
454490
454837
|
if (import_node_process6.default.env.NODE_ENV === "test") {
|
|
454491
454838
|
this._stream = this.#stream;
|
|
454492
|
-
this._isEnabled = this.#isEnabled;
|
|
454839
|
+
this._isEnabled = this.#options.isEnabled;
|
|
454493
454840
|
Object.defineProperty(this, "_linesToClear", {
|
|
454494
454841
|
get() {
|
|
454495
454842
|
return this.#linesToClear;
|
|
@@ -454505,30 +454852,36 @@ var init_ora = __esm({
|
|
|
454505
454852
|
});
|
|
454506
454853
|
Object.defineProperty(this, "_lineCount", {
|
|
454507
454854
|
get() {
|
|
454508
|
-
|
|
454855
|
+
const columns = this.#stream.columns ?? 80;
|
|
454856
|
+
const prefixText = typeof this.#options.prefixText === "function" ? "" : this.#options.prefixText;
|
|
454857
|
+
const suffixText = typeof this.#options.suffixText === "function" ? "" : this.#options.suffixText;
|
|
454858
|
+
const fullPrefixText = typeof prefixText === "string" && prefixText !== "" ? prefixText + " " : "";
|
|
454859
|
+
const fullSuffixText = typeof suffixText === "string" && suffixText !== "" ? " " + suffixText : "";
|
|
454860
|
+
const spinnerChar = "-";
|
|
454861
|
+
const fullText = " ".repeat(this.#options.indent) + fullPrefixText + spinnerChar + (typeof this.#options.text === "string" ? " " + this.#options.text : "") + fullSuffixText;
|
|
454862
|
+
return this.#computeLineCountFrom(fullText, columns);
|
|
454509
454863
|
}
|
|
454510
454864
|
});
|
|
454511
454865
|
}
|
|
454512
454866
|
}
|
|
454513
454867
|
get indent() {
|
|
454514
|
-
return this.#indent;
|
|
454868
|
+
return this.#options.indent;
|
|
454515
454869
|
}
|
|
454516
454870
|
set indent(indent = 0) {
|
|
454517
454871
|
if (!(indent >= 0 && Number.isInteger(indent))) {
|
|
454518
454872
|
throw new Error("The `indent` option must be an integer from 0 and up");
|
|
454519
454873
|
}
|
|
454520
|
-
this.#indent = indent;
|
|
454521
|
-
this.#updateLineCount();
|
|
454874
|
+
this.#options.indent = indent;
|
|
454522
454875
|
}
|
|
454523
454876
|
get interval() {
|
|
454524
|
-
return this.#
|
|
454877
|
+
return this.#options.interval ?? this.#spinner.interval ?? 100;
|
|
454525
454878
|
}
|
|
454526
454879
|
get spinner() {
|
|
454527
454880
|
return this.#spinner;
|
|
454528
454881
|
}
|
|
454529
454882
|
set spinner(spinner) {
|
|
454530
454883
|
this.#frameIndex = -1;
|
|
454531
|
-
this.#
|
|
454884
|
+
this.#options.interval = void 0;
|
|
454532
454885
|
if (typeof spinner === "object") {
|
|
454533
454886
|
if (!Array.isArray(spinner.frames) || spinner.frames.length === 0 || spinner.frames.some((frame) => typeof frame !== "string")) {
|
|
454534
454887
|
throw new Error("The given spinner must have a non-empty `frames` array of strings");
|
|
@@ -454548,25 +454901,22 @@ var init_ora = __esm({
|
|
|
454548
454901
|
}
|
|
454549
454902
|
}
|
|
454550
454903
|
get text() {
|
|
454551
|
-
return this.#text;
|
|
454904
|
+
return this.#options.text;
|
|
454552
454905
|
}
|
|
454553
454906
|
set text(value = "") {
|
|
454554
|
-
this.#text = value;
|
|
454555
|
-
this.#updateLineCount();
|
|
454907
|
+
this.#options.text = value;
|
|
454556
454908
|
}
|
|
454557
454909
|
get prefixText() {
|
|
454558
|
-
return this.#prefixText;
|
|
454910
|
+
return this.#options.prefixText;
|
|
454559
454911
|
}
|
|
454560
454912
|
set prefixText(value = "") {
|
|
454561
|
-
this.#prefixText = value;
|
|
454562
|
-
this.#updateLineCount();
|
|
454913
|
+
this.#options.prefixText = value;
|
|
454563
454914
|
}
|
|
454564
454915
|
get suffixText() {
|
|
454565
|
-
return this.#suffixText;
|
|
454916
|
+
return this.#options.suffixText;
|
|
454566
454917
|
}
|
|
454567
454918
|
set suffixText(value = "") {
|
|
454568
|
-
this.#suffixText = value;
|
|
454569
|
-
this.#updateLineCount();
|
|
454919
|
+
this.#options.suffixText = value;
|
|
454570
454920
|
}
|
|
454571
454921
|
get isSpinning() {
|
|
454572
454922
|
return this.#id !== void 0;
|
|
@@ -454578,110 +454928,179 @@ var init_ora = __esm({
|
|
|
454578
454928
|
}
|
|
454579
454929
|
return "";
|
|
454580
454930
|
}
|
|
454581
|
-
#getFullPrefixText(prefixText = this.#prefixText, postfix = " ") {
|
|
454931
|
+
#getFullPrefixText(prefixText = this.#options.prefixText, postfix = " ") {
|
|
454582
454932
|
return this.#formatAffix(prefixText, postfix, false);
|
|
454583
454933
|
}
|
|
454584
|
-
#getFullSuffixText(suffixText = this.#suffixText, prefix = " ") {
|
|
454934
|
+
#getFullSuffixText(suffixText = this.#options.suffixText, prefix = " ") {
|
|
454585
454935
|
return this.#formatAffix(suffixText, prefix, true);
|
|
454586
454936
|
}
|
|
454587
454937
|
#computeLineCountFrom(text, columns) {
|
|
454588
454938
|
let count = 0;
|
|
454589
|
-
for (const line of
|
|
454939
|
+
for (const line of (0, import_node_util.stripVTControlCharacters)(text).split("\n")) {
|
|
454590
454940
|
count += Math.max(1, Math.ceil(stringWidth(line) / columns));
|
|
454591
454941
|
}
|
|
454592
454942
|
return count;
|
|
454593
454943
|
}
|
|
454594
|
-
#updateLineCount() {
|
|
454595
|
-
const columns = this.#stream.columns ?? 80;
|
|
454596
|
-
const prefixText = typeof this.#prefixText === "function" ? "" : this.#prefixText;
|
|
454597
|
-
const suffixText = typeof this.#suffixText === "function" ? "" : this.#suffixText;
|
|
454598
|
-
const fullPrefixText = typeof prefixText === "string" && prefixText !== "" ? prefixText + " " : "";
|
|
454599
|
-
const fullSuffixText = typeof suffixText === "string" && suffixText !== "" ? " " + suffixText : "";
|
|
454600
|
-
const spinnerChar = "-";
|
|
454601
|
-
const fullText = " ".repeat(this.#indent) + fullPrefixText + spinnerChar + (typeof this.#text === "string" ? " " + this.#text : "") + fullSuffixText;
|
|
454602
|
-
this.#lineCount = this.#computeLineCountFrom(fullText, columns);
|
|
454603
|
-
}
|
|
454604
454944
|
get isEnabled() {
|
|
454605
|
-
return this.#isEnabled && !this.#isSilent;
|
|
454945
|
+
return this.#options.isEnabled && !this.#options.isSilent;
|
|
454606
454946
|
}
|
|
454607
454947
|
set isEnabled(value) {
|
|
454608
454948
|
if (typeof value !== "boolean") {
|
|
454609
454949
|
throw new TypeError("The `isEnabled` option must be a boolean");
|
|
454610
454950
|
}
|
|
454611
|
-
this.#isEnabled = value;
|
|
454951
|
+
this.#options.isEnabled = value;
|
|
454612
454952
|
}
|
|
454613
454953
|
get isSilent() {
|
|
454614
|
-
return this.#isSilent;
|
|
454954
|
+
return this.#options.isSilent;
|
|
454615
454955
|
}
|
|
454616
454956
|
set isSilent(value) {
|
|
454617
454957
|
if (typeof value !== "boolean") {
|
|
454618
454958
|
throw new TypeError("The `isSilent` option must be a boolean");
|
|
454619
454959
|
}
|
|
454620
|
-
this.#isSilent = value;
|
|
454960
|
+
this.#options.isSilent = value;
|
|
454621
454961
|
}
|
|
454622
454962
|
frame() {
|
|
454623
454963
|
const now = Date.now();
|
|
454624
|
-
if (this.#frameIndex === -1 || now - this.#
|
|
454625
|
-
this.#frameIndex =
|
|
454626
|
-
this.#
|
|
454964
|
+
if (this.#frameIndex === -1 || now - this.#lastFrameTime >= this.interval) {
|
|
454965
|
+
this.#frameIndex = (this.#frameIndex + 1) % this.#spinner.frames.length;
|
|
454966
|
+
this.#lastFrameTime = now;
|
|
454627
454967
|
}
|
|
454628
454968
|
const { frames } = this.#spinner;
|
|
454629
454969
|
let frame = frames[this.#frameIndex];
|
|
454630
454970
|
if (this.color) {
|
|
454631
454971
|
frame = source_default[this.color](frame);
|
|
454632
454972
|
}
|
|
454633
|
-
const fullPrefixText = this.#getFullPrefixText(this.#prefixText, " ");
|
|
454973
|
+
const fullPrefixText = this.#getFullPrefixText(this.#options.prefixText, " ");
|
|
454634
454974
|
const fullText = typeof this.text === "string" ? " " + this.text : "";
|
|
454635
|
-
const fullSuffixText = this.#getFullSuffixText(this.#suffixText, " ");
|
|
454975
|
+
const fullSuffixText = this.#getFullSuffixText(this.#options.suffixText, " ");
|
|
454636
454976
|
return fullPrefixText + frame + fullText + fullSuffixText;
|
|
454637
454977
|
}
|
|
454638
454978
|
clear() {
|
|
454639
|
-
if (!this
|
|
454979
|
+
if (!this.isEnabled || !this.#stream.isTTY) {
|
|
454640
454980
|
return this;
|
|
454641
454981
|
}
|
|
454642
|
-
this.#
|
|
454643
|
-
|
|
454644
|
-
|
|
454645
|
-
|
|
454982
|
+
this.#internalWrite(() => {
|
|
454983
|
+
this.#stream.cursorTo(0);
|
|
454984
|
+
for (let index = 0; index < this.#linesToClear; index++) {
|
|
454985
|
+
if (index > 0) {
|
|
454986
|
+
this.#stream.moveCursor(0, -1);
|
|
454987
|
+
}
|
|
454988
|
+
this.#stream.clearLine(1);
|
|
454646
454989
|
}
|
|
454647
|
-
this.#
|
|
454648
|
-
|
|
454649
|
-
|
|
454650
|
-
|
|
454651
|
-
}
|
|
454652
|
-
this.#lastIndent = this.#indent;
|
|
454990
|
+
if (this.#options.indent) {
|
|
454991
|
+
this.#stream.cursorTo(this.#options.indent);
|
|
454992
|
+
}
|
|
454993
|
+
});
|
|
454653
454994
|
this.#linesToClear = 0;
|
|
454654
454995
|
return this;
|
|
454655
454996
|
}
|
|
454997
|
+
// Helper to hook a single stream
|
|
454998
|
+
#hookStream(stream) {
|
|
454999
|
+
if (!stream || this.#hookedStreams.has(stream) || !stream.isTTY || typeof stream.write !== "function") {
|
|
455000
|
+
return;
|
|
455001
|
+
}
|
|
455002
|
+
if (activeHooksPerStream.has(stream)) {
|
|
455003
|
+
console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");
|
|
455004
|
+
}
|
|
455005
|
+
const originalWrite = stream.write;
|
|
455006
|
+
this.#hookedStreams.set(stream, originalWrite);
|
|
455007
|
+
activeHooksPerStream.set(stream, this);
|
|
455008
|
+
stream.write = (chunk, encoding, callback) => this.#hookedWrite(stream, originalWrite, chunk, encoding, callback);
|
|
455009
|
+
}
|
|
455010
|
+
/**
|
|
455011
|
+
Intercept stream writes while spinner is active to handle external writes cleanly without visual corruption.
|
|
455012
|
+
Hooks process stdio streams and the active spinner stream so console.log(), console.error(), and direct writes stay tidy.
|
|
455013
|
+
*/
|
|
455014
|
+
#installHook() {
|
|
455015
|
+
if (!this.isEnabled || this.#hookedStreams.size > 0) {
|
|
455016
|
+
return;
|
|
455017
|
+
}
|
|
455018
|
+
const streamsToHook = /* @__PURE__ */ new Set([this.#stream, import_node_process6.default.stdout, import_node_process6.default.stderr]);
|
|
455019
|
+
for (const stream of streamsToHook) {
|
|
455020
|
+
this.#hookStream(stream);
|
|
455021
|
+
}
|
|
455022
|
+
}
|
|
455023
|
+
#uninstallHook() {
|
|
455024
|
+
for (const [stream, originalWrite] of this.#hookedStreams) {
|
|
455025
|
+
stream.write = originalWrite;
|
|
455026
|
+
if (activeHooksPerStream.get(stream) === this) {
|
|
455027
|
+
activeHooksPerStream.delete(stream);
|
|
455028
|
+
}
|
|
455029
|
+
}
|
|
455030
|
+
this.#hookedStreams.clear();
|
|
455031
|
+
}
|
|
455032
|
+
// eslint-disable-next-line max-params -- Need stream and originalWrite for multi-stream support
|
|
455033
|
+
#hookedWrite(stream, originalWrite, chunk, encoding, callback) {
|
|
455034
|
+
if (typeof encoding === "function") {
|
|
455035
|
+
callback = encoding;
|
|
455036
|
+
encoding = void 0;
|
|
455037
|
+
}
|
|
455038
|
+
if (this.#isInternalWrite) {
|
|
455039
|
+
return originalWrite.call(stream, chunk, encoding, callback);
|
|
455040
|
+
}
|
|
455041
|
+
this.clear();
|
|
455042
|
+
const chunkString = this.#stringifyChunk(chunk, encoding);
|
|
455043
|
+
const chunkTerminatesLine = this.#chunkTerminatesLine(chunkString);
|
|
455044
|
+
const writeResult = originalWrite.call(stream, chunk, encoding, callback);
|
|
455045
|
+
if (chunkTerminatesLine) {
|
|
455046
|
+
this.#clearRenderDeferral();
|
|
455047
|
+
} else if (chunkString.length > 0) {
|
|
455048
|
+
this.#scheduleRenderDeferral();
|
|
455049
|
+
}
|
|
455050
|
+
if (this.isSpinning && !this.#deferRenderTimer) {
|
|
455051
|
+
this.render();
|
|
455052
|
+
}
|
|
455053
|
+
return writeResult;
|
|
455054
|
+
}
|
|
454656
455055
|
render() {
|
|
454657
|
-
if (!this
|
|
455056
|
+
if (!this.isEnabled || this.#drainHandler || this.#deferRenderTimer) {
|
|
454658
455057
|
return this;
|
|
454659
455058
|
}
|
|
454660
|
-
this.
|
|
454661
|
-
let
|
|
454662
|
-
|
|
454663
|
-
|
|
454664
|
-
|
|
454665
|
-
|
|
454666
|
-
|
|
454667
|
-
|
|
454668
|
-
frameContent =
|
|
454669
|
-
|
|
454670
|
-
|
|
454671
|
-
|
|
455059
|
+
const useSynchronizedOutput = this.#stream.isTTY;
|
|
455060
|
+
let shouldDisableSynchronizedOutput = false;
|
|
455061
|
+
try {
|
|
455062
|
+
if (useSynchronizedOutput) {
|
|
455063
|
+
this.#internalWrite(() => this.#stream.write(SYNCHRONIZED_OUTPUT_ENABLE));
|
|
455064
|
+
shouldDisableSynchronizedOutput = true;
|
|
455065
|
+
}
|
|
455066
|
+
this.clear();
|
|
455067
|
+
let frameContent = this.frame();
|
|
455068
|
+
const columns = this.#stream.columns ?? 80;
|
|
455069
|
+
const actualLineCount = this.#computeLineCountFrom(frameContent, columns);
|
|
455070
|
+
const consoleHeight = this.#stream.rows;
|
|
455071
|
+
if (consoleHeight && consoleHeight > 1 && actualLineCount > consoleHeight) {
|
|
455072
|
+
const lines = frameContent.split("\n");
|
|
455073
|
+
const maxLines = consoleHeight - 1;
|
|
455074
|
+
frameContent = [...lines.slice(0, maxLines), "... (content truncated to fit terminal)"].join("\n");
|
|
455075
|
+
}
|
|
455076
|
+
const canContinue = this.#internalWrite(() => this.#stream.write(frameContent));
|
|
455077
|
+
if (canContinue === false && this.#stream.isTTY) {
|
|
455078
|
+
this.#drainHandler = () => {
|
|
455079
|
+
this.#drainHandler = void 0;
|
|
455080
|
+
this.#tryRender();
|
|
455081
|
+
};
|
|
455082
|
+
this.#stream.once("drain", this.#drainHandler);
|
|
455083
|
+
}
|
|
455084
|
+
this.#linesToClear = this.#computeLineCountFrom(frameContent, columns);
|
|
455085
|
+
} finally {
|
|
455086
|
+
if (shouldDisableSynchronizedOutput) {
|
|
455087
|
+
this.#internalWrite(() => this.#stream.write(SYNCHRONIZED_OUTPUT_DISABLE));
|
|
455088
|
+
}
|
|
455089
|
+
}
|
|
454672
455090
|
return this;
|
|
454673
455091
|
}
|
|
454674
455092
|
start(text) {
|
|
454675
455093
|
if (text) {
|
|
454676
455094
|
this.text = text;
|
|
454677
455095
|
}
|
|
454678
|
-
if (this
|
|
455096
|
+
if (this.isSilent) {
|
|
454679
455097
|
return this;
|
|
454680
455098
|
}
|
|
454681
|
-
if (!this
|
|
454682
|
-
const
|
|
455099
|
+
if (!this.isEnabled) {
|
|
455100
|
+
const symbol = this.text ? "-" : "";
|
|
455101
|
+
const line = " ".repeat(this.#options.indent) + this.#buildOutputLine(symbol, this.text, this.#options.prefixText, this.#options.suffixText);
|
|
454683
455102
|
if (line.trim() !== "") {
|
|
454684
|
-
this.#stream.write(line + "\n");
|
|
455103
|
+
this.#internalWrite(() => this.#stream.write(line + "\n"));
|
|
454685
455104
|
}
|
|
454686
455105
|
return this;
|
|
454687
455106
|
}
|
|
@@ -454692,9 +455111,10 @@ var init_ora = __esm({
|
|
|
454692
455111
|
cli_cursor_default.hide(this.#stream);
|
|
454693
455112
|
}
|
|
454694
455113
|
if (this.#options.discardStdin && import_node_process6.default.stdin.isTTY) {
|
|
454695
|
-
this.#isDiscardingStdin = true;
|
|
454696
455114
|
stdin_discarder_default.start();
|
|
455115
|
+
this.#isDiscardingStdin = true;
|
|
454697
455116
|
}
|
|
455117
|
+
this.#installHook();
|
|
454698
455118
|
this.render();
|
|
454699
455119
|
this.#id = setInterval(this.render.bind(this), this.interval);
|
|
454700
455120
|
return this;
|
|
@@ -454702,16 +455122,23 @@ var init_ora = __esm({
|
|
|
454702
455122
|
stop() {
|
|
454703
455123
|
clearInterval(this.#id);
|
|
454704
455124
|
this.#id = void 0;
|
|
454705
|
-
this.#frameIndex =
|
|
454706
|
-
|
|
455125
|
+
this.#frameIndex = -1;
|
|
455126
|
+
this.#lastFrameTime = 0;
|
|
455127
|
+
this.#clearRenderDeferral();
|
|
455128
|
+
this.#uninstallHook();
|
|
455129
|
+
if (this.#drainHandler) {
|
|
455130
|
+
this.#stream.removeListener("drain", this.#drainHandler);
|
|
455131
|
+
this.#drainHandler = void 0;
|
|
455132
|
+
}
|
|
455133
|
+
if (this.isEnabled) {
|
|
454707
455134
|
this.clear();
|
|
454708
455135
|
if (this.#options.hideCursor) {
|
|
454709
455136
|
cli_cursor_default.show(this.#stream);
|
|
454710
455137
|
}
|
|
454711
455138
|
}
|
|
454712
|
-
if (this.#
|
|
454713
|
-
stdin_discarder_default.stop();
|
|
455139
|
+
if (this.#isDiscardingStdin) {
|
|
454714
455140
|
this.#isDiscardingStdin = false;
|
|
455141
|
+
stdin_discarder_default.stop();
|
|
454715
455142
|
}
|
|
454716
455143
|
return this;
|
|
454717
455144
|
}
|
|
@@ -454728,20 +455155,16 @@ var init_ora = __esm({
|
|
|
454728
455155
|
return this.stopAndPersist({ symbol: symbols_exports.info, text });
|
|
454729
455156
|
}
|
|
454730
455157
|
stopAndPersist(options = {}) {
|
|
454731
|
-
if (this
|
|
455158
|
+
if (this.isSilent) {
|
|
454732
455159
|
return this;
|
|
454733
455160
|
}
|
|
454734
|
-
const
|
|
454735
|
-
const fullPrefixText = this.#getFullPrefixText(prefixText, " ");
|
|
454736
|
-
const symbolText = options.symbol ?? " ";
|
|
455161
|
+
const symbol = options.symbol ?? " ";
|
|
454737
455162
|
const text = options.text ?? this.text;
|
|
454738
|
-
const
|
|
454739
|
-
const
|
|
454740
|
-
const
|
|
454741
|
-
const fullSuffixText = this.#getFullSuffixText(suffixText, " ");
|
|
454742
|
-
const textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + "\n";
|
|
455163
|
+
const prefixText = options.prefixText ?? this.#options.prefixText;
|
|
455164
|
+
const suffixText = options.suffixText ?? this.#options.suffixText;
|
|
455165
|
+
const textToWrite = this.#buildOutputLine(symbol, text, prefixText, suffixText) + "\n";
|
|
454743
455166
|
this.stop();
|
|
454744
|
-
this.#stream.write(textToWrite);
|
|
455167
|
+
this.#internalWrite(() => this.#stream.write(textToWrite));
|
|
454745
455168
|
return this;
|
|
454746
455169
|
}
|
|
454747
455170
|
};
|
|
@@ -454982,7 +455405,6 @@ var require_executor2 = __commonJS({
|
|
|
454982
455405
|
const errorStream = ignoreErrorStream ? "ignore" : process.stderr;
|
|
454983
455406
|
const spawnOptions = {
|
|
454984
455407
|
stdio: [process.stdin, outputStream, errorStream],
|
|
454985
|
-
shell: true,
|
|
454986
455408
|
cwd: path.join(rootDirectory, options.workingDirectory || ""),
|
|
454987
455409
|
env: {
|
|
454988
455410
|
...process.env,
|
|
@@ -454991,7 +455413,7 @@ var require_executor2 = __commonJS({
|
|
|
454991
455413
|
}
|
|
454992
455414
|
};
|
|
454993
455415
|
return new Promise((resolve, reject) => {
|
|
454994
|
-
(0, node_child_process_1.spawn)(
|
|
455416
|
+
(0, node_child_process_1.spawn)("git", args, spawnOptions).on("close", (code) => {
|
|
454995
455417
|
if (code === 0) {
|
|
454996
455418
|
resolve();
|
|
454997
455419
|
} else {
|
|
@@ -455017,7 +455439,7 @@ var require_executor2 = __commonJS({
|
|
|
455017
455439
|
await execute(["add", "."]);
|
|
455018
455440
|
if (options.commit) {
|
|
455019
455441
|
const message = options.message || "initial commit";
|
|
455020
|
-
await execute(["commit",
|
|
455442
|
+
await execute(["commit", "-m", message]);
|
|
455021
455443
|
}
|
|
455022
455444
|
context.logger.info("Successfully initialized git.");
|
|
455023
455445
|
} catch {
|
|
@@ -457983,20 +458405,20 @@ var require_internal = __commonJS({
|
|
|
457983
458405
|
});
|
|
457984
458406
|
|
|
457985
458407
|
// node_modules/@angular-devkit/architect/package.json
|
|
457986
|
-
var
|
|
458408
|
+
var require_package2 = __commonJS({
|
|
457987
458409
|
"node_modules/@angular-devkit/architect/package.json"(exports2, module2) {
|
|
457988
458410
|
module2.exports = {
|
|
457989
458411
|
name: "@angular-devkit/architect",
|
|
457990
|
-
version: "0.
|
|
458412
|
+
version: "0.2102.28",
|
|
457991
458413
|
description: "Angular Build Facade",
|
|
457992
458414
|
experimental: true,
|
|
457993
458415
|
bin: {
|
|
457994
|
-
architect: "
|
|
458416
|
+
architect: "bin/cli.js"
|
|
457995
458417
|
},
|
|
457996
458418
|
main: "src/index.js",
|
|
457997
458419
|
typings: "src/index.d.ts",
|
|
457998
458420
|
dependencies: {
|
|
457999
|
-
"@angular-devkit/core": "21.
|
|
458421
|
+
"@angular-devkit/core": "21.2.28",
|
|
458000
458422
|
rxjs: "7.8.2"
|
|
458001
458423
|
},
|
|
458002
458424
|
builders: "./builders/builders.json",
|
|
@@ -458009,9 +458431,9 @@ var require_package3 = __commonJS({
|
|
|
458009
458431
|
],
|
|
458010
458432
|
repository: {
|
|
458011
458433
|
type: "git",
|
|
458012
|
-
url: "https://github.com/angular/angular-cli.git"
|
|
458434
|
+
url: "git+https://github.com/angular/angular-cli.git"
|
|
458013
458435
|
},
|
|
458014
|
-
packageManager: "pnpm@10.
|
|
458436
|
+
packageManager: "pnpm@10.33.2",
|
|
458015
458437
|
engines: {
|
|
458016
458438
|
node: "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
458017
458439
|
npm: "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
@@ -458183,7 +458605,7 @@ var require_create_builder = __commonJS({
|
|
|
458183
458605
|
return {
|
|
458184
458606
|
handler,
|
|
458185
458607
|
[internal_1.BuilderSymbol]: true,
|
|
458186
|
-
[internal_1.BuilderVersionSymbol]:
|
|
458608
|
+
[internal_1.BuilderVersionSymbol]: require_package2().version,
|
|
458187
458609
|
// Only needed for type safety around `Builder` types.
|
|
458188
458610
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
458189
458611
|
__OptionT: null
|
|
@@ -459406,11 +459828,10 @@ lodash/lodash.js:
|
|
|
459406
459828
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
459407
459829
|
*)
|
|
459408
459830
|
|
|
459409
|
-
ejs/lib/ejs.js:
|
|
459831
|
+
ejs/lib/cjs/ejs.js:
|
|
459410
459832
|
(**
|
|
459411
459833
|
* @file Embedded JavaScript templating engine. {@link http://ejs.co}
|
|
459412
459834
|
* @author Matthew Eernisse <mde@fleegix.org>
|
|
459413
|
-
* @author Tiancheng "Timothy" Gu <timothygu99@gmail.com>
|
|
459414
459835
|
* @project EJS
|
|
459415
459836
|
* @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
|
|
459416
459837
|
*)
|
|
@@ -459496,7 +459917,7 @@ lodash-es/lodash.js:
|
|
|
459496
459917
|
(**
|
|
459497
459918
|
* @license
|
|
459498
459919
|
* Lodash (Custom Build) <https://lodash.com/>
|
|
459499
|
-
* Build: `lodash modularize exports="es" -o ./`
|
|
459920
|
+
* Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
|
|
459500
459921
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
459501
459922
|
* Released under MIT license <https://lodash.com/license>
|
|
459502
459923
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|