@chanom/cli 0.4.1 → 0.4.2
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/index.js +9 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -290,7 +290,7 @@ const bundledVersions = {
|
|
|
290
290
|
oxlintTsgolint: "0.24.0",
|
|
291
291
|
oxfmt: "0.58.0",
|
|
292
292
|
knip: "6.26.0",
|
|
293
|
-
devConfig: "0.0.
|
|
293
|
+
devConfig: "0.0.4"
|
|
294
294
|
};
|
|
295
295
|
//#endregion
|
|
296
296
|
//#region src/domain/pkg.ts
|
|
@@ -330,7 +330,8 @@ var InstallFailed = class extends Data.TaggedError("InstallFailed") {};
|
|
|
330
330
|
/**
|
|
331
331
|
* Installs npm packages with the detected package manager, adding the
|
|
332
332
|
* workspace-root flag (pnpm `-w`, yarn classic `-W`) when the target
|
|
333
|
-
* directory is a workspace root.
|
|
333
|
+
* directory is a workspace root. Output is captured rather than inherited so
|
|
334
|
+
* the caller's spinner is not redrawn over the package manager's own progress.
|
|
334
335
|
*/
|
|
335
336
|
var PackageInstaller = class extends Effect.Service()("cli/PackageInstaller", { effect: Effect.gen(function* () {
|
|
336
337
|
const runner = yield* CommandRunner;
|
|
@@ -343,12 +344,15 @@ var PackageInstaller = class extends Effect.Service()("cli/PackageInstaller", {
|
|
|
343
344
|
hasWorkspacesField: hasWorkspacesField(cwd),
|
|
344
345
|
hasYarnBerryConfig: has(cwd, ".yarnrc.yml")
|
|
345
346
|
}, { concurrency: 3 });
|
|
346
|
-
return { installDev: (pm, cwd, packages) => workspaceHints(cwd).pipe(Effect.flatMap((hints) => runner.
|
|
347
|
+
return { installDev: (pm, cwd, packages) => workspaceHints(cwd).pipe(Effect.flatMap((hints) => runner.capture(pm, [
|
|
347
348
|
"add",
|
|
348
349
|
"-D",
|
|
349
350
|
...workspaceRootFlags(pm, hints),
|
|
350
351
|
...packages
|
|
351
|
-
], cwd)), Effect.filterOrFail((
|
|
352
|
+
], cwd)), Effect.filterOrFail((result) => result.exitCode === 0, (result) => new InstallFailed({
|
|
353
|
+
pm,
|
|
354
|
+
output: [result.stdout, result.stderr].filter(Boolean).join("\n")
|
|
355
|
+
})), Effect.asVoid) };
|
|
352
356
|
}) }) {};
|
|
353
357
|
//#endregion
|
|
354
358
|
//#region src/utils/detect-pm.ts
|
|
@@ -1101,7 +1105,7 @@ const run = (name, cwd = process.cwd(), options = {}) => {
|
|
|
1101
1105
|
UnknownCommand: (e) => reportError(`Unknown command: ${e.command ?? "(none)"}\nAvailable commands: ${Object.keys(commands).join(", ")}`),
|
|
1102
1106
|
PkgNotFound: (e) => reportError(`No package.json found in ${e.cwd}. Run this inside a project.`),
|
|
1103
1107
|
PkgInvalid: (e) => reportError(`Could not parse ${e.pkgPath}. Is it valid JSON?`),
|
|
1104
|
-
InstallFailed: (e) => reportError(`Package installation with ${e.pm} failed
|
|
1108
|
+
InstallFailed: (e) => reportError([`Package installation with ${e.pm} failed.`, e.output].filter(Boolean).join("\n")),
|
|
1105
1109
|
HuskyInitFailed: (e) => reportError(`\`husky init\` failed (exit code ${e.exitCode}).`),
|
|
1106
1110
|
NotAtRepoRoot: (e) => reportError(`Git hooks must be set up at the repository root: ${e.root}\nRun \`chanom brew\` there, or choose light sweetness.`)
|
|
1107
1111
|
}))).pipe(Logger.withMinimumLogLevel(debug ? LogLevel.Debug : LogLevel.Info));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chanom/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"tsdown": "0.22.3",
|
|
33
33
|
"typescript": "6.0.3",
|
|
34
34
|
"vitest": "3.2.6",
|
|
35
|
-
"@chanom/dev-config": "0.0.
|
|
35
|
+
"@chanom/dev-config": "0.0.4",
|
|
36
36
|
"@chanom/internal": "0.0.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|