@emeryld/manager 1.4.10 → 1.4.12
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 +23 -0
- package/dist/menu.js +2 -2
- package/dist/utils/package-filter.js +5 -4
- package/dist/utils/run.js +16 -0
- package/dist/workspace.js +24 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,29 @@ You can also decide where the report lands: the manager will ask whether to stre
|
|
|
73
73
|
- **Purpose**: give Codex agents, CI pipelines, and automation deterministic scans that print the same violation summaries as the interactive action.
|
|
74
74
|
- **Output**: prints `Format checker violations:` followed by grouped or per-file buckets (with severity, snippets, and location references); when no violations occur you get `Format checker found no violations.` and `Workspace meets the configured format limits.` Colors mirror the interactive report to keep results easy to scan.
|
|
75
75
|
|
|
76
|
+
## ESLint (in-editor)
|
|
77
|
+
|
|
78
|
+
If you want these checks surfaced as squiggles in your editor, you can run them as an ESLint rule.
|
|
79
|
+
|
|
80
|
+
1. Install ESLint in your workspace: `pnpm add -D eslint`
|
|
81
|
+
2. Add `eslint.config.js`:
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
import managerFormatChecker from '@emeryld/manager/dist/eslint-plugin-format-checker/index.js'
|
|
85
|
+
|
|
86
|
+
export default [
|
|
87
|
+
{
|
|
88
|
+
files: ['**/*.{ts,tsx,js,jsx,mjs,cjs}'],
|
|
89
|
+
plugins: { manager: managerFormatChecker },
|
|
90
|
+
rules: {
|
|
91
|
+
'manager/format-checker': 'warn',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The rule defaults to the same limits as `manager-cli` and will also pick up `manager.formatChecker` from `.vscode/settings.json` (override any setting via rule options if you prefer).
|
|
98
|
+
|
|
76
99
|
## Robot metadata
|
|
77
100
|
|
|
78
101
|
The `robot metadata` action now starts with the same interactive settings screen as the format checker: pick which kinds of symbols to include, decide whether to limit the scan to exported declarations, and adjust the column width. Use ↑/↓ to move between rows, type new values (comma-separated lists for the kinds), and press Enter once the validation message disappears.
|
package/dist/menu.js
CHANGED
|
@@ -66,7 +66,7 @@ function makeManagerStepEntries(targets, packages, state) {
|
|
|
66
66
|
if (targets.length === 1)
|
|
67
67
|
await testSingle(targets[0]);
|
|
68
68
|
else
|
|
69
|
-
await testAll();
|
|
69
|
+
await testAll(targets);
|
|
70
70
|
state.lastStep = 'test';
|
|
71
71
|
},
|
|
72
72
|
},
|
|
@@ -120,7 +120,7 @@ function makeManagerStepEntries(targets, packages, state) {
|
|
|
120
120
|
if (targets.length === 1)
|
|
121
121
|
await testSingle(targets[0]);
|
|
122
122
|
else
|
|
123
|
-
await testAll();
|
|
123
|
+
await testAll(targets);
|
|
124
124
|
if (targets.length === 1)
|
|
125
125
|
await buildSingle(targets[0]);
|
|
126
126
|
else
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export function packageFilterArg(pkg) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const dir = pkg.relativeDir ?? '';
|
|
3
|
+
if (dir && dir !== '.')
|
|
4
|
+
return `./${dir}`;
|
|
5
|
+
if (dir === '.')
|
|
5
6
|
return '.';
|
|
6
|
-
return
|
|
7
|
+
return pkg.name ?? '.';
|
|
7
8
|
}
|
package/dist/utils/run.js
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
// src/utils/run.js
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
|
+
import { colors, logGlobal } from './log.js';
|
|
3
4
|
// Always execute commands from the workspace where the CLI is invoked.
|
|
4
5
|
// This makes installs from node_modules behave correctly instead of
|
|
5
6
|
// running in the package's own directory.
|
|
6
7
|
export const rootDir = process.cwd();
|
|
8
|
+
function describeArgs(args) {
|
|
9
|
+
const normalized = args.map((arg) => {
|
|
10
|
+
if (!/\s/.test(arg))
|
|
11
|
+
return arg;
|
|
12
|
+
return `"${arg.replace(/"/g, '\\"')}"`;
|
|
13
|
+
});
|
|
14
|
+
return normalized.join(' ');
|
|
15
|
+
}
|
|
16
|
+
function describeCommand(command, args) {
|
|
17
|
+
const argList = describeArgs(args);
|
|
18
|
+
if (!argList)
|
|
19
|
+
return colors.bold(command);
|
|
20
|
+
return `${colors.bold(command)} ${colors.dim(argList)}`;
|
|
21
|
+
}
|
|
7
22
|
export function run(command, args, options = {}) {
|
|
23
|
+
logGlobal(`Executing ${describeCommand(command, args)}`);
|
|
8
24
|
return new Promise((resolve, reject) => {
|
|
9
25
|
const child = spawn(command, args, {
|
|
10
26
|
cwd: rootDir,
|
package/dist/workspace.js
CHANGED
|
@@ -208,17 +208,19 @@ const BUILD_SCENARIO = {
|
|
|
208
208
|
singleArgs: (pkg) => ['run', '--filter', packageFilterArg(pkg), 'build'],
|
|
209
209
|
singleMessage: 'Running build…',
|
|
210
210
|
};
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
'test',
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
211
|
+
function hasTestScript(pkg) {
|
|
212
|
+
const scripts = pkg.json?.scripts ?? {};
|
|
213
|
+
const value = scripts.test;
|
|
214
|
+
return typeof value === 'string' && value.trim().length > 0;
|
|
215
|
+
}
|
|
216
|
+
async function runPackageTest(pkg) {
|
|
217
|
+
if (!hasTestScript(pkg)) {
|
|
218
|
+
logPkg(pkg, 'No test script found; skipping.', colors.yellow);
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
logPkg(pkg, 'Running tests…');
|
|
222
|
+
await run('pnpm', ['run', 'test'], { cwd: pkg.path });
|
|
223
|
+
}
|
|
222
224
|
export async function runCleanInstall() {
|
|
223
225
|
logGlobal('Cleaning workspace…', colors.cyan);
|
|
224
226
|
await run('pnpm', ['run', 'clean']);
|
|
@@ -323,9 +325,17 @@ export async function buildPackageLocally(pkg) {
|
|
|
323
325
|
logPkg(pkg, 'Building local dist before publish…');
|
|
324
326
|
await run('pnpm', ['run', 'build'], { cwd: pkg.path });
|
|
325
327
|
}
|
|
326
|
-
export async function testAll() {
|
|
327
|
-
|
|
328
|
+
export async function testAll(targets) {
|
|
329
|
+
if (!targets.length) {
|
|
330
|
+
logGlobal('No packages selected for tests.', colors.yellow);
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
logGlobal(`Running tests for ${targets.length} packages…`, colors.cyan);
|
|
334
|
+
for (const pkg of targets) {
|
|
335
|
+
// eslint-disable-next-line no-await-in-loop
|
|
336
|
+
await runPackageTest(pkg);
|
|
337
|
+
}
|
|
328
338
|
}
|
|
329
339
|
export async function testSingle(pkg) {
|
|
330
|
-
await
|
|
340
|
+
await runPackageTest(pkg);
|
|
331
341
|
}
|