@mnci/cli 1.15.10 → 1.17.0
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/README.md +1 -1
- package/dist/cli.js +63 -10
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -178,7 +178,7 @@ itself calls — the one function that does every bit of `mnci`-owned file
|
|
|
178
178
|
writing (`nx.json`'s `release`/`sync`/`generators`/`namedInputs.sharedGlobals`/
|
|
179
179
|
`mnci` blocks, `.npmrc`,
|
|
180
180
|
`eslint.config.mjs`, `.prettierrc.json`, `commitlint.config.mjs`,
|
|
181
|
-
`.husky/commit-msg`, the CI pipeline file(s), the
|
|
181
|
+
`.husky/commit-msg`, the CI pipeline file(s), `.devcontainer/devcontainer.json`, the
|
|
182
182
|
`<workspace-name>.code-workspace` file, and the curated root `package.json`
|
|
183
183
|
scripts). Nothing else in the workspace — app/lib source, `project.json` targets
|
|
184
184
|
from `mnci add` — is ever touched, and it finishes by running Prettier over the
|
package/dist/cli.js
CHANGED
|
@@ -1365,6 +1365,45 @@ function eslintConfigSpec() {
|
|
|
1365
1365
|
return process.env.MNCI_ESLINT_CONFIG_SPEC ?? ESLINT_CONFIG_VERSION;
|
|
1366
1366
|
}
|
|
1367
1367
|
var ESLINT_VERSION = "^10.8.0";
|
|
1368
|
+
function devcontainerJson(workspaceName) {
|
|
1369
|
+
return `${toJson({
|
|
1370
|
+
name: workspaceName,
|
|
1371
|
+
image: `mcr.microsoft.com/devcontainers/typescript-node:${NODE_VERSION}-bookworm`,
|
|
1372
|
+
features: {
|
|
1373
|
+
"ghcr.io/devcontainers/features/python:1": { version: "3.12" },
|
|
1374
|
+
"ghcr.io/devcontainers/features/go:1": { version: "latest" }
|
|
1375
|
+
},
|
|
1376
|
+
// `npm ci` first: every guard after it runs through the workspace's own
|
|
1377
|
+
// scripts and Nx, which do not exist until the install completes.
|
|
1378
|
+
postCreateCommand: [
|
|
1379
|
+
"npm ci",
|
|
1380
|
+
"npm run python:install",
|
|
1381
|
+
GOLANGCI_LINT_INSTALL_GUARD,
|
|
1382
|
+
FLUTTER_SDK_INSTALL_GUARD
|
|
1383
|
+
].join(" && "),
|
|
1384
|
+
// The same recommendations the `.code-workspace` file carries, so opening
|
|
1385
|
+
// the folder in a container suggests the identical toolset.
|
|
1386
|
+
customizations: {
|
|
1387
|
+
vscode: { extensions: [...VSCODE_RECOMMENDED_EXTENSIONS] }
|
|
1388
|
+
}
|
|
1389
|
+
})}
|
|
1390
|
+
`;
|
|
1391
|
+
}
|
|
1392
|
+
var ROOT_LINT_TARGET = {
|
|
1393
|
+
executor: "nx:run-commands",
|
|
1394
|
+
cache: true,
|
|
1395
|
+
options: {
|
|
1396
|
+
command: [
|
|
1397
|
+
"eslint .",
|
|
1398
|
+
'--ignore-pattern "apps/**"',
|
|
1399
|
+
'--ignore-pattern "libs/**"',
|
|
1400
|
+
'--ignore-pattern "packages/**"',
|
|
1401
|
+
'--ignore-pattern "python-packages/**"',
|
|
1402
|
+
"--ignore-pattern package-lock.json"
|
|
1403
|
+
].join(" "),
|
|
1404
|
+
cwd: "."
|
|
1405
|
+
}
|
|
1406
|
+
};
|
|
1368
1407
|
var ESLINT_PEER_OVERRIDES = {
|
|
1369
1408
|
"eslint-plugin-jsx-a11y": { eslint: "$eslint" }
|
|
1370
1409
|
};
|
|
@@ -1399,6 +1438,12 @@ __pycache__
|
|
|
1399
1438
|
.ruff_cache
|
|
1400
1439
|
.dart_tool
|
|
1401
1440
|
`;
|
|
1441
|
+
var VSCODE_RECOMMENDED_EXTENSIONS = [
|
|
1442
|
+
"dbaeumer.vscode-eslint",
|
|
1443
|
+
"esbenp.prettier-vscode",
|
|
1444
|
+
"nrwl.angular-console",
|
|
1445
|
+
"firsttris.vscode-jest-runner"
|
|
1446
|
+
];
|
|
1402
1447
|
function vscodeWorkspace(workspaceName, existingTasks) {
|
|
1403
1448
|
return JSON.stringify(
|
|
1404
1449
|
{
|
|
@@ -1429,14 +1474,7 @@ function vscodeWorkspace(workspaceName, existingTasks) {
|
|
|
1429
1474
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
1430
1475
|
}
|
|
1431
1476
|
},
|
|
1432
|
-
extensions: {
|
|
1433
|
-
recommendations: [
|
|
1434
|
-
"dbaeumer.vscode-eslint",
|
|
1435
|
-
"esbenp.prettier-vscode",
|
|
1436
|
-
"nrwl.angular-console",
|
|
1437
|
-
"firsttris.vscode-jest-runner"
|
|
1438
|
-
]
|
|
1439
|
-
},
|
|
1477
|
+
extensions: { recommendations: [...VSCODE_RECOMMENDED_EXTENSIONS] },
|
|
1440
1478
|
tasks: {
|
|
1441
1479
|
version: existingTasks?.version ?? "2.0.0",
|
|
1442
1480
|
tasks: existingTasks?.tasks ?? []
|
|
@@ -1516,6 +1554,7 @@ var GO_TOOL_PATH_PRELUDE = `const fs=require('node:fs'),cp=require('node:child_p
|
|
|
1516
1554
|
var GO_TOOL_PATH_AZURE = `node -e "${GO_TOOL_PATH_PRELUDE}console.log('##vso[task.prependpath]'+bin)"`;
|
|
1517
1555
|
var GO_TOOL_PATH_GITHUB = `node -e "${GO_TOOL_PATH_PRELUDE}if(!process.env.GITHUB_PATH){console.log('Not running in GitHub Actions - skipping.');process.exit(0)}fs.appendFileSync(process.env.GITHUB_PATH,bin+${String.raw`'\n'`})"`;
|
|
1518
1556
|
var FLUTTER_SDK_VERSION = "3.44.8";
|
|
1557
|
+
var NODE_VERSION = "24";
|
|
1519
1558
|
var FLUTTER_SDK_DIRECTORY_EXPRESSION = `require('node:path').join(require('node:os').homedir(),'.mnci-flutter-${FLUTTER_SDK_VERSION}')`;
|
|
1520
1559
|
var FLUTTER_SDK_INSTALL_GUARD = `node -e "const fs=require('node:fs'),cp=require('node:child_process');if(!fs.existsSync('pubspec.yaml')){console.log('No Flutter projects - skipping.');process.exit(0)}if(cp.spawnSync('flutter',['--version'],{stdio:'ignore',shell:process.platform==='win32'}).status===0){console.log('Flutter SDK already on PATH - skipping.');process.exit(0)}const sdk=${FLUTTER_SDK_DIRECTORY_EXPRESSION};if(fs.existsSync(sdk)){console.log('Flutter SDK already installed at '+sdk+' - skipping.');process.exit(0)}process.exit(cp.spawnSync('git',['clone','--depth','1','--branch','${FLUTTER_SDK_VERSION}','https://github.com/flutter/flutter.git',sdk],{stdio:'inherit'}).status ?? 1)"`;
|
|
1521
1560
|
var FLUTTER_TOOL_PATH_PRELUDE = `const fs=require('node:fs'),path=require('node:path');if(!fs.existsSync('pubspec.yaml')){console.log('No Flutter projects - skipping.');process.exit(0)}const sdk=${FLUTTER_SDK_DIRECTORY_EXPRESSION};if(!fs.existsSync(sdk)){console.log('Flutter SDK was not installed by mnci (already on PATH) - skipping.');process.exit(0)}const bin=path.join(sdk,'bin');`;
|
|
@@ -1813,7 +1852,7 @@ jobs:
|
|
|
1813
1852
|
|
|
1814
1853
|
- uses: actions/setup-node@v4
|
|
1815
1854
|
with:
|
|
1816
|
-
node-version:
|
|
1855
|
+
node-version: ${NODE_VERSION}
|
|
1817
1856
|
# Caches ~/.npm keyed on package-lock.json, so \`npm ci\` restores from
|
|
1818
1857
|
# the local cache instead of re-downloading every tarball on every run.
|
|
1819
1858
|
# Nothing to invalidate by hand: the action keys on the lockfile, so a
|
|
@@ -2041,6 +2080,15 @@ function applyOverlay(workspaceRoot, options) {
|
|
|
2041
2080
|
...manifest.overrides,
|
|
2042
2081
|
...ESLINT_PEER_OVERRIDES
|
|
2043
2082
|
};
|
|
2083
|
+
const existingNx = manifest.nx;
|
|
2084
|
+
const nx = {
|
|
2085
|
+
...existingNx,
|
|
2086
|
+
includedScripts: existingNx?.includedScripts ?? [],
|
|
2087
|
+
targets: {
|
|
2088
|
+
...existingNx?.targets,
|
|
2089
|
+
lint: ROOT_LINT_TARGET
|
|
2090
|
+
}
|
|
2091
|
+
};
|
|
2044
2092
|
writeFileEnsured(
|
|
2045
2093
|
manifestPath,
|
|
2046
2094
|
toJson({
|
|
@@ -2048,7 +2096,8 @@ function applyOverlay(workspaceRoot, options) {
|
|
|
2048
2096
|
name: `${options.scope}/source`,
|
|
2049
2097
|
scripts,
|
|
2050
2098
|
devDependencies: devDeps,
|
|
2051
|
-
overrides
|
|
2099
|
+
overrides,
|
|
2100
|
+
nx
|
|
2052
2101
|
})
|
|
2053
2102
|
);
|
|
2054
2103
|
writeFileEnsured((0, import_node_path11.join)(workspaceRoot, ".npmrc"), npmrcContent(options.registry, options.scope));
|
|
@@ -2058,6 +2107,10 @@ function applyOverlay(workspaceRoot, options) {
|
|
|
2058
2107
|
markExecutable(hookPath);
|
|
2059
2108
|
writeFileEnsured((0, import_node_path11.join)(workspaceRoot, "eslint.config.mjs"), ESLINT_CONFIG);
|
|
2060
2109
|
writeFileEnsured((0, import_node_path11.join)(workspaceRoot, ".prettierrc.json"), PRETTIER_CONFIG);
|
|
2110
|
+
writeFileEnsured(
|
|
2111
|
+
(0, import_node_path11.join)(workspaceRoot, ".devcontainer/devcontainer.json"),
|
|
2112
|
+
devcontainerJson(options.workspaceName)
|
|
2113
|
+
);
|
|
2061
2114
|
writeFileEnsured((0, import_node_path11.join)(workspaceRoot, ".prettierignore"), PRETTIER_IGNORE);
|
|
2062
2115
|
removeNxScaffolding(workspaceRoot);
|
|
2063
2116
|
const codeWorkspacePath = (0, import_node_path11.join)(workspaceRoot, `${options.workspaceName}.code-workspace`);
|