@mnci/cli 1.16.0 → 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 +37 -9
- 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,30 @@ 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
|
+
}
|
|
1368
1392
|
var ROOT_LINT_TARGET = {
|
|
1369
1393
|
executor: "nx:run-commands",
|
|
1370
1394
|
cache: true,
|
|
@@ -1414,6 +1438,12 @@ __pycache__
|
|
|
1414
1438
|
.ruff_cache
|
|
1415
1439
|
.dart_tool
|
|
1416
1440
|
`;
|
|
1441
|
+
var VSCODE_RECOMMENDED_EXTENSIONS = [
|
|
1442
|
+
"dbaeumer.vscode-eslint",
|
|
1443
|
+
"esbenp.prettier-vscode",
|
|
1444
|
+
"nrwl.angular-console",
|
|
1445
|
+
"firsttris.vscode-jest-runner"
|
|
1446
|
+
];
|
|
1417
1447
|
function vscodeWorkspace(workspaceName, existingTasks) {
|
|
1418
1448
|
return JSON.stringify(
|
|
1419
1449
|
{
|
|
@@ -1444,14 +1474,7 @@ function vscodeWorkspace(workspaceName, existingTasks) {
|
|
|
1444
1474
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
1445
1475
|
}
|
|
1446
1476
|
},
|
|
1447
|
-
extensions: {
|
|
1448
|
-
recommendations: [
|
|
1449
|
-
"dbaeumer.vscode-eslint",
|
|
1450
|
-
"esbenp.prettier-vscode",
|
|
1451
|
-
"nrwl.angular-console",
|
|
1452
|
-
"firsttris.vscode-jest-runner"
|
|
1453
|
-
]
|
|
1454
|
-
},
|
|
1477
|
+
extensions: { recommendations: [...VSCODE_RECOMMENDED_EXTENSIONS] },
|
|
1455
1478
|
tasks: {
|
|
1456
1479
|
version: existingTasks?.version ?? "2.0.0",
|
|
1457
1480
|
tasks: existingTasks?.tasks ?? []
|
|
@@ -1531,6 +1554,7 @@ var GO_TOOL_PATH_PRELUDE = `const fs=require('node:fs'),cp=require('node:child_p
|
|
|
1531
1554
|
var GO_TOOL_PATH_AZURE = `node -e "${GO_TOOL_PATH_PRELUDE}console.log('##vso[task.prependpath]'+bin)"`;
|
|
1532
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'`})"`;
|
|
1533
1556
|
var FLUTTER_SDK_VERSION = "3.44.8";
|
|
1557
|
+
var NODE_VERSION = "24";
|
|
1534
1558
|
var FLUTTER_SDK_DIRECTORY_EXPRESSION = `require('node:path').join(require('node:os').homedir(),'.mnci-flutter-${FLUTTER_SDK_VERSION}')`;
|
|
1535
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)"`;
|
|
1536
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');`;
|
|
@@ -1828,7 +1852,7 @@ jobs:
|
|
|
1828
1852
|
|
|
1829
1853
|
- uses: actions/setup-node@v4
|
|
1830
1854
|
with:
|
|
1831
|
-
node-version:
|
|
1855
|
+
node-version: ${NODE_VERSION}
|
|
1832
1856
|
# Caches ~/.npm keyed on package-lock.json, so \`npm ci\` restores from
|
|
1833
1857
|
# the local cache instead of re-downloading every tarball on every run.
|
|
1834
1858
|
# Nothing to invalidate by hand: the action keys on the lockfile, so a
|
|
@@ -2083,6 +2107,10 @@ function applyOverlay(workspaceRoot, options) {
|
|
|
2083
2107
|
markExecutable(hookPath);
|
|
2084
2108
|
writeFileEnsured((0, import_node_path11.join)(workspaceRoot, "eslint.config.mjs"), ESLINT_CONFIG);
|
|
2085
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
|
+
);
|
|
2086
2114
|
writeFileEnsured((0, import_node_path11.join)(workspaceRoot, ".prettierignore"), PRETTIER_IGNORE);
|
|
2087
2115
|
removeNxScaffolding(workspaceRoot);
|
|
2088
2116
|
const codeWorkspacePath = (0, import_node_path11.join)(workspaceRoot, `${options.workspaceName}.code-workspace`);
|