@mnci/cli 1.15.8 → 1.15.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +23 -11
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1364,7 +1364,10 @@ var ESLINT_CONFIG_VERSION = "^0.1.0";
|
|
|
1364
1364
|
function eslintConfigSpec() {
|
|
1365
1365
|
return process.env.MNCI_ESLINT_CONFIG_SPEC ?? ESLINT_CONFIG_VERSION;
|
|
1366
1366
|
}
|
|
1367
|
-
var ESLINT_VERSION = "^
|
|
1367
|
+
var ESLINT_VERSION = "^10.8.0";
|
|
1368
|
+
var ESLINT_PEER_OVERRIDES = {
|
|
1369
|
+
"eslint-plugin-jsx-a11y": { eslint: "$eslint" }
|
|
1370
|
+
};
|
|
1368
1371
|
function eslintToolchainDependencies(nxVersion) {
|
|
1369
1372
|
return {
|
|
1370
1373
|
eslint: ESLINT_VERSION,
|
|
@@ -2034,9 +2037,19 @@ function applyOverlay(workspaceRoot, options) {
|
|
|
2034
2037
|
...eslintToolchainDependencies(existingDevDeps?.nx ?? "latest"),
|
|
2035
2038
|
prettier: PRETTIER_VERSION
|
|
2036
2039
|
};
|
|
2040
|
+
const overrides = {
|
|
2041
|
+
...manifest.overrides,
|
|
2042
|
+
...ESLINT_PEER_OVERRIDES
|
|
2043
|
+
};
|
|
2037
2044
|
writeFileEnsured(
|
|
2038
2045
|
manifestPath,
|
|
2039
|
-
toJson({
|
|
2046
|
+
toJson({
|
|
2047
|
+
...manifest,
|
|
2048
|
+
name: `${options.scope}/source`,
|
|
2049
|
+
scripts,
|
|
2050
|
+
devDependencies: devDeps,
|
|
2051
|
+
overrides
|
|
2052
|
+
})
|
|
2040
2053
|
);
|
|
2041
2054
|
writeFileEnsured((0, import_node_path11.join)(workspaceRoot, ".npmrc"), npmrcContent(options.registry, options.scope));
|
|
2042
2055
|
writeFileEnsured((0, import_node_path11.join)(workspaceRoot, "commitlint.config.mjs"), COMMITLINT_CONFIG);
|
|
@@ -2070,7 +2083,7 @@ function applyOverlay(workspaceRoot, options) {
|
|
|
2070
2083
|
}
|
|
2071
2084
|
|
|
2072
2085
|
// src/commands/doctor.ts
|
|
2073
|
-
var SUPPORTED_ESLINT_MAJOR = ESLINT_VERSION.replace(/^\D*/, "").split(".")[0];
|
|
2086
|
+
var SUPPORTED_ESLINT_MAJOR = ESLINT_VERSION.replace(/^\D*/, "").split(".", 1)[0];
|
|
2074
2087
|
function checkEslintConfigs(workspaceRoot) {
|
|
2075
2088
|
const rootConfigs = (0, import_node_fs7.globSync)("eslint.config.{js,mjs,cjs,ts,mts,cts}", { cwd: workspaceRoot });
|
|
2076
2089
|
const projectConfigs = (0, import_node_fs7.globSync)("{apps,libs,packages}/*/eslint.config.{js,mjs,cjs,ts,mts,cts}", {
|
|
@@ -2103,7 +2116,7 @@ function checkPrettierConfig(workspaceRoot) {
|
|
|
2103
2116
|
function checkEslintPlugin(nxJson) {
|
|
2104
2117
|
const plugins = nxJson.plugins ?? [];
|
|
2105
2118
|
const registered = plugins.some(
|
|
2106
|
-
(entry) => typeof entry === "string" ? entry
|
|
2119
|
+
(entry) => (typeof entry === "string" ? entry : entry.plugin) === "@nx/eslint/plugin"
|
|
2107
2120
|
);
|
|
2108
2121
|
return {
|
|
2109
2122
|
check: "@nx/eslint/plugin registered",
|
|
@@ -2119,7 +2132,7 @@ function checkResolvedEslint(workspaceRoot) {
|
|
|
2119
2132
|
}
|
|
2120
2133
|
try {
|
|
2121
2134
|
const { version } = readJson(manifestPath);
|
|
2122
|
-
const major = version.split(".")[0];
|
|
2135
|
+
const major = version.split(".", 1)[0];
|
|
2123
2136
|
return {
|
|
2124
2137
|
check: `resolved eslint is ${SUPPORTED_ESLINT_MAJOR}.x`,
|
|
2125
2138
|
ok: major === SUPPORTED_ESLINT_MAJOR,
|
|
@@ -2164,7 +2177,6 @@ function checkVersionActions(workspaceRoot) {
|
|
|
2164
2177
|
const projectJson = readJson(projectJsonPath);
|
|
2165
2178
|
hasOverride = Boolean(projectJson.release?.version?.versionActions);
|
|
2166
2179
|
} catch {
|
|
2167
|
-
hasOverride = false;
|
|
2168
2180
|
}
|
|
2169
2181
|
return [
|
|
2170
2182
|
{
|
|
@@ -2421,15 +2433,15 @@ function runUpgrade(workspaceRoot, options) {
|
|
|
2421
2433
|
// src/commands/interactive.ts
|
|
2422
2434
|
async function runInteractive() {
|
|
2423
2435
|
const inWorkspace = fileExists((0, import_node_path15.join)(process.cwd(), "nx.json"));
|
|
2424
|
-
const
|
|
2425
|
-
const
|
|
2426
|
-
const
|
|
2436
|
+
const choiceNew = { name: "Create a new monorepo", value: "new" };
|
|
2437
|
+
const choiceAdd = { name: "Add a project to this workspace", value: "add" };
|
|
2438
|
+
const choiceUpgrade = {
|
|
2427
2439
|
name: "Upgrade this workspace (re-apply the latest overlay)",
|
|
2428
2440
|
value: "upgrade"
|
|
2429
2441
|
};
|
|
2430
2442
|
const action = await (0, import_prompts8.select)({
|
|
2431
2443
|
message: "What would you like to do?",
|
|
2432
|
-
choices: inWorkspace ? [
|
|
2444
|
+
choices: inWorkspace ? [choiceAdd, choiceUpgrade, choiceNew] : [choiceNew, choiceAdd, choiceUpgrade]
|
|
2433
2445
|
});
|
|
2434
2446
|
if (action === "new") {
|
|
2435
2447
|
await runNew(void 0, {});
|
|
@@ -2552,7 +2564,7 @@ async function main() {
|
|
|
2552
2564
|
checkForUpdate(cliVersion);
|
|
2553
2565
|
const arguments_ = new Set(process.argv.slice(2));
|
|
2554
2566
|
const requestedVersionFlag = arguments_.has("-v") || arguments_.has("--version");
|
|
2555
|
-
if (process.stdout.isTTY
|
|
2567
|
+
if (!requestedVersionFlag && process.stdout.isTTY) {
|
|
2556
2568
|
logger.info(`mnci v${cliVersion}`);
|
|
2557
2569
|
}
|
|
2558
2570
|
await program.parseAsync(process.argv);
|