@doki-land/nifty 0.0.4 → 0.0.6

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.
Files changed (45) hide show
  1. package/cli/nifty.mjs +11 -11
  2. package/locales/en-US/cli.json +70 -68
  3. package/locales/locales.json +4 -4
  4. package/package.json +16 -20
  5. package/src/cli/authArgs.ts +52 -52
  6. package/src/cli/bump-cmd.ts +55 -55
  7. package/src/cli/bump.ts +237 -237
  8. package/src/cli/change-logs-cmd.ts +97 -97
  9. package/src/cli/cli.ts +47 -47
  10. package/src/cli/{reword-cmd.ts → commit-cmd.ts} +128 -87
  11. package/src/cli/context.ts +36 -36
  12. package/src/cli/format-cmd.ts +23 -23
  13. package/src/cli/format.ts +39 -28
  14. package/src/cli/index.ts +9 -9
  15. package/src/cli/install-native-cmd.ts +22 -22
  16. package/src/cli/install-native.ts +80 -80
  17. package/src/cli/lint-cmd.ts +35 -35
  18. package/src/cli/lint.ts +108 -102
  19. package/src/cli/main.ts +1 -1
  20. package/src/cli/options.ts +40 -40
  21. package/src/cli/publish-cmd.ts +38 -38
  22. package/src/cli/publish.ts +95 -95
  23. package/src/cli/resolveNpm.ts +16 -16
  24. package/src/cli/retime-cmd.ts +62 -62
  25. package/src/cli/trust-cmd.ts +38 -38
  26. package/src/cli/trust.ts +83 -83
  27. package/src/cli/update-cmd.ts +20 -20
  28. package/src/cli/update.ts +32 -32
  29. package/src/cli/upload-cmd.ts +44 -44
  30. package/src/cli/upload.ts +313 -313
  31. package/src/cli/workspace.ts +124 -124
  32. package/src/config/defineConfig.ts +12 -12
  33. package/src/config/detectProject.ts +189 -189
  34. package/src/config/formatPresets.ts +55 -0
  35. package/src/config/index.ts +28 -25
  36. package/src/config/loadConfig.ts +129 -129
  37. package/src/config/types.ts +78 -57
  38. package/src/git.ts +61 -61
  39. package/src/github.ts +184 -184
  40. package/src/gitmoji.ts +77 -77
  41. package/src/index.ts +40 -36
  42. package/src/native.ts +756 -665
  43. package/src/nifty.ts +95 -95
  44. package/src/types.ts +40 -40
  45. package/README.md +0 -29
@@ -1,95 +1,95 @@
1
- import { loadNiftyNative } from "../native.js";
2
- import { authPayload, parseAuthArgs } from "./authArgs.js";
3
-
4
- export type PublishOptions = {
5
- cwd?: string;
6
- dryRun?: boolean;
7
- tag?: string;
8
- access?: string;
9
- };
10
-
11
- export type PublishReport = {
12
- root: string;
13
- order: string[];
14
- published: string[];
15
- skipped: string[];
16
- skippedVersions: string[];
17
- };
18
-
19
- export async function runPublish(argv: string[]): Promise<void> {
20
- const options = parsePublishArgs(argv);
21
- const native = loadNiftyNative();
22
- const report = native.publisher["publish-workspace"]({
23
- cwd: options.cwd,
24
- dryRun: options.dryRun,
25
- refresh: options.refresh,
26
- tag: options.tag,
27
- access: options.access,
28
- ...authPayload(options.auth),
29
- });
30
- printPublishReport(report, options.dryRun);
31
- }
32
-
33
- function parsePublishArgs(argv: string[]) {
34
- let cwd: string | undefined;
35
- let dryRun = false;
36
- let refresh = false;
37
- let tag: string | undefined;
38
- let access = "public";
39
- const auth = parseAuthArgs(argv);
40
-
41
- for (let i = 0; i < argv.length; i += 1) {
42
- const arg = argv[i];
43
- if (arg === "--dry-run") {
44
- dryRun = true;
45
- } else if (arg === "--refresh") {
46
- refresh = true;
47
- } else if (arg === "-C" || arg === "--cwd") {
48
- cwd = argv[++i];
49
- } else if (arg === "--tag") {
50
- tag = argv[++i];
51
- } else if (arg === "--access") {
52
- access = argv[++i];
53
- } else if (arg === "-h" || arg === "--help") {
54
- printPublishHelp();
55
- process.exit(0);
56
- } else if (arg.startsWith("-")) {
57
- continue;
58
- }
59
- }
60
-
61
- return { cwd, dryRun, refresh, tag, access, auth };
62
- }
63
-
64
- export function printPublishReport(report: PublishReport, dryRun?: boolean): void {
65
- const prefix = dryRun ? "would publish" : "published";
66
- console.log(`${prefix} workspace ${report.root}`);
67
- if (report.skipped.length > 0) {
68
- console.log(`skipped private packages: ${report.skipped.join(", ")}`);
69
- }
70
- if (report.skippedVersions.length > 0) {
71
- console.log(`skipped already published: ${report.skippedVersions.join(", ")}`);
72
- }
73
- console.log("publish order:");
74
- for (const name of report.order) {
75
- const marker = report.published.includes(name) ? prefix : "pending";
76
- console.log(` ${marker}: ${name}`);
77
- }
78
- }
79
-
80
- function printPublishHelp(): void {
81
- console.log(`nifty publish — publish workspace npm packages in dependency order
82
-
83
- OTP/TOTP is generated in nifty-publisher (set NPM_TOTP_SECRET in .env.placeholder.local).
84
- Publish state is cached in .cache/npm-placeholder.json.
85
-
86
- Usage:
87
- nifty publish
88
- nifty publish --dry-run
89
- nifty publish --refresh
90
- nifty publish --tag next
91
- nifty publish --access public
92
- nifty publish --otp 123456
93
- nifty publish -C <cwd>
94
- `);
95
- }
1
+ import { loadNiftyNative } from "../native.js";
2
+ import { authPayload, parseAuthArgs } from "./authArgs.js";
3
+
4
+ export type PublishOptions = {
5
+ cwd?: string;
6
+ dryRun?: boolean;
7
+ tag?: string;
8
+ access?: string;
9
+ };
10
+
11
+ export type PublishReport = {
12
+ root: string;
13
+ order: string[];
14
+ published: string[];
15
+ skipped: string[];
16
+ skippedVersions: string[];
17
+ };
18
+
19
+ export async function runPublish(argv: string[]): Promise<void> {
20
+ const options = parsePublishArgs(argv);
21
+ const native = loadNiftyNative();
22
+ const report = native.publisher["publish-workspace"]({
23
+ cwd: options.cwd,
24
+ dryRun: options.dryRun,
25
+ refresh: options.refresh,
26
+ tag: options.tag,
27
+ access: options.access,
28
+ ...authPayload(options.auth),
29
+ });
30
+ printPublishReport(report, options.dryRun);
31
+ }
32
+
33
+ function parsePublishArgs(argv: string[]) {
34
+ let cwd: string | undefined;
35
+ let dryRun = false;
36
+ let refresh = false;
37
+ let tag: string | undefined;
38
+ let access = "public";
39
+ const auth = parseAuthArgs(argv);
40
+
41
+ for (let i = 0; i < argv.length; i += 1) {
42
+ const arg = argv[i];
43
+ if (arg === "--dry-run") {
44
+ dryRun = true;
45
+ } else if (arg === "--refresh") {
46
+ refresh = true;
47
+ } else if (arg === "-C" || arg === "--cwd") {
48
+ cwd = argv[++i];
49
+ } else if (arg === "--tag") {
50
+ tag = argv[++i];
51
+ } else if (arg === "--access") {
52
+ access = argv[++i];
53
+ } else if (arg === "-h" || arg === "--help") {
54
+ printPublishHelp();
55
+ process.exit(0);
56
+ } else if (arg.startsWith("-")) {
57
+ continue;
58
+ }
59
+ }
60
+
61
+ return { cwd, dryRun, refresh, tag, access, auth };
62
+ }
63
+
64
+ export function printPublishReport(report: PublishReport, dryRun?: boolean): void {
65
+ const prefix = dryRun ? "would publish" : "published";
66
+ console.log(`${prefix} workspace ${report.root}`);
67
+ if (report.skipped.length > 0) {
68
+ console.log(`skipped private packages: ${report.skipped.join(", ")}`);
69
+ }
70
+ if (report.skippedVersions.length > 0) {
71
+ console.log(`skipped already published: ${report.skippedVersions.join(", ")}`);
72
+ }
73
+ console.log("publish order:");
74
+ for (const name of report.order) {
75
+ const marker = report.published.includes(name) ? prefix : "pending";
76
+ console.log(` ${marker}: ${name}`);
77
+ }
78
+ }
79
+
80
+ function printPublishHelp(): void {
81
+ console.log(`nifty publish — publish workspace npm packages in dependency order
82
+
83
+ OTP/TOTP is generated in nifty-publisher (set NPM_TOTP_SECRET in .env.placeholder.local).
84
+ Publish state is cached in .cache/npm-placeholder.json.
85
+
86
+ Usage:
87
+ nifty publish
88
+ nifty publish --dry-run
89
+ nifty publish --refresh
90
+ nifty publish --tag next
91
+ nifty publish --access public
92
+ nifty publish --otp 123456
93
+ nifty publish -C <cwd>
94
+ `);
95
+ }
@@ -1,16 +1,16 @@
1
- import { existsSync } from "node:fs";
2
- import { dirname, join } from "node:path";
3
-
4
- /** Resolve npm next to the active Node binary (Windows needs `npm.cmd`). */
5
- export function resolveNpmExecutable(): string {
6
- if (process.env.NIFTY_NPM) {
7
- return process.env.NIFTY_NPM;
8
- }
9
-
10
- const sibling = join(dirname(process.execPath), process.platform === "win32" ? "npm.cmd" : "npm");
11
- if (existsSync(sibling)) {
12
- return sibling;
13
- }
14
-
15
- return process.platform === "win32" ? "npm.cmd" : "npm";
16
- }
1
+ import { existsSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+
4
+ /** Resolve npm next to the active Node binary (Windows needs `npm.cmd`). */
5
+ export function resolveNpmExecutable(): string {
6
+ if (process.env.NIFTY_NPM) {
7
+ return process.env.NIFTY_NPM;
8
+ }
9
+
10
+ const sibling = join(dirname(process.execPath), process.platform === "win32" ? "npm.cmd" : "npm");
11
+ if (existsSync(sibling)) {
12
+ return sibling;
13
+ }
14
+
15
+ return process.platform === "win32" ? "npm.cmd" : "npm";
16
+ }
@@ -1,62 +1,62 @@
1
- import type { Cli, ParsedOptions } from "@vmz/commander";
2
-
3
- import { loadNiftyNative } from "../native.js";
4
- import { bootstrapFromOptions } from "./context.js";
5
- import { cwdFrom, str } from "./options.js";
6
-
7
- export function registerRetimeCommand(cli: Cli): void {
8
- const retime = cli.command("retime", "cli.cmd.retime")
9
- .option("-s, --start-date <start>", "cli.opt.start-date")
10
- .option("--end-date <end>", "cli.opt.end-date")
11
- .option("-b, --branch <branch>", "cli.opt.branch")
12
- .option("--tip <ref>", "cli.opt.tip");
13
-
14
- retime
15
- .command("root", "cli.cmd.retime.root")
16
- .option("-s, --start-date <start>", "cli.opt.start-date")
17
- .option("--end-date <end>", "cli.opt.end-date")
18
- .option("-b, --branch <branch>", "cli.opt.branch")
19
- .option("--tip <ref>", "cli.opt.tip")
20
- .option("-m, --message <text>", "cli.opt.message")
21
- .action(async (options) => cmdRetimeRoot(options));
22
-
23
- retime.action(async (options) => cmdRetimeRange(options));
24
- }
25
-
26
- export async function cmdRetimeRange(options: ParsedOptions): Promise<number> {
27
- await bootstrapFromOptions(options);
28
- const commit = options._[0];
29
- if (!commit) {
30
- throw new Error("missing commit hash for range retime");
31
- }
32
- const native = loadNiftyNative();
33
- const report = native.history["retime-range"]({
34
- cwd: cwdFrom(options),
35
- commit,
36
- startDate: str(options, "start-date"),
37
- endDate: str(options, "end-date"),
38
- branch: str(options, "branch"),
39
- tip: str(options, "tip"),
40
- });
41
- printRetimeSummary(report);
42
- return 0;
43
- }
44
-
45
- export async function cmdRetimeRoot(options: ParsedOptions): Promise<number> {
46
- await bootstrapFromOptions(options);
47
- const native = loadNiftyNative();
48
- const report = native.history["retime-root"]({
49
- cwd: cwdFrom(options),
50
- startDate: str(options, "start-date"),
51
- endDate: str(options, "end-date"),
52
- branch: str(options, "branch"),
53
- tip: str(options, "tip"),
54
- message: str(options, "message"),
55
- });
56
- printRetimeSummary(report);
57
- return 0;
58
- }
59
-
60
- function printRetimeSummary(report: { rewritten: number; branch: string; newTip: string }): void {
61
- console.log(`retimed ${report.rewritten} commit(s) on branch ${report.branch}; tip ${report.newTip}`);
62
- }
1
+ import type { Cli, ParsedOptions } from "@vmz/commander";
2
+
3
+ import { loadNiftyNative } from "../native.js";
4
+ import { bootstrapFromOptions } from "./context.js";
5
+ import { cwdFrom, str } from "./options.js";
6
+
7
+ export function registerRetimeCommand(cli: Cli): void {
8
+ const retime = cli.command("retime", "cli.cmd.retime")
9
+ .option("-s, --start-date <start>", "cli.opt.start-date")
10
+ .option("--end-date <end>", "cli.opt.end-date")
11
+ .option("-b, --branch <branch>", "cli.opt.branch")
12
+ .option("--tip <ref>", "cli.opt.tip");
13
+
14
+ retime
15
+ .command("root", "cli.cmd.retime.root")
16
+ .option("-s, --start-date <start>", "cli.opt.start-date")
17
+ .option("--end-date <end>", "cli.opt.end-date")
18
+ .option("-b, --branch <branch>", "cli.opt.branch")
19
+ .option("--tip <ref>", "cli.opt.tip")
20
+ .option("-m, --message <text>", "cli.opt.message")
21
+ .action(async (options) => cmdRetimeRoot(options));
22
+
23
+ retime.action(async (options) => cmdRetimeRange(options));
24
+ }
25
+
26
+ export async function cmdRetimeRange(options: ParsedOptions): Promise<number> {
27
+ await bootstrapFromOptions(options);
28
+ const commit = options._[0];
29
+ if (!commit) {
30
+ throw new Error("missing commit hash for range retime");
31
+ }
32
+ const native = loadNiftyNative();
33
+ const report = native.history["retime-range"]({
34
+ cwd: cwdFrom(options),
35
+ commit,
36
+ startDate: str(options, "start-date"),
37
+ endDate: str(options, "end-date"),
38
+ branch: str(options, "branch"),
39
+ tip: str(options, "tip"),
40
+ });
41
+ printRetimeSummary(report);
42
+ return 0;
43
+ }
44
+
45
+ export async function cmdRetimeRoot(options: ParsedOptions): Promise<number> {
46
+ await bootstrapFromOptions(options);
47
+ const native = loadNiftyNative();
48
+ const report = native.history["retime-root"]({
49
+ cwd: cwdFrom(options),
50
+ startDate: str(options, "start-date"),
51
+ endDate: str(options, "end-date"),
52
+ branch: str(options, "branch"),
53
+ tip: str(options, "tip"),
54
+ message: str(options, "message"),
55
+ });
56
+ printRetimeSummary(report);
57
+ return 0;
58
+ }
59
+
60
+ function printRetimeSummary(report: { rewritten: number; branch: string; newTip: string }): void {
61
+ console.log(`retimed ${report.rewritten} commit(s) on branch ${report.branch}; tip ${report.newTip}`);
62
+ }
@@ -1,38 +1,38 @@
1
- import type { Cli, ParsedOptions } from "@vmz/commander";
2
-
3
- import { loadNiftyNative } from "../native.js";
4
- import { authPayload } from "./authArgs.js";
5
- import { loadConfig } from "../config/loadConfig.js";
6
- import { bootstrapFromOptions } from "./context.js";
7
- import { printTrustReport } from "./trust.js";
8
- import { authFromOptions, cwdFrom, flag, str } from "./options.js";
9
-
10
- export function registerTrustCommand(cli: Cli): void {
11
- cli.command("trust", "cli.cmd.trust")
12
- .option("--dry-run", "cli.opt.dry-run")
13
- .option("--refresh", "cli.opt.refresh")
14
- .option("--only <package>", "cli.opt.only")
15
- .option("--otp <code>", "cli.opt.otp")
16
- .option("--totp-secret <secret>", "cli.opt.totp-secret")
17
- .option("--npm-token <token>", "cli.opt.npm-token")
18
- .action(async (options) => cmdTrust(options));
19
- }
20
-
21
- export async function cmdTrust(options: ParsedOptions): Promise<number> {
22
- await bootstrapFromOptions(options);
23
- const { config } = await loadConfig({ cwd: cwdFrom(options), createIfMissing: false });
24
- const native = loadNiftyNative();
25
- const report = native.publisher["trust-workspace"]({
26
- cwd: cwdFrom(options),
27
- dryRun: flag(options, "dry-run"),
28
- refresh: flag(options, "refresh"),
29
- only: str(options, "only"),
30
- packages: config.publish?.packages,
31
- ...authPayload(authFromOptions(options)),
32
- });
33
- printTrustReport(report);
34
- if (report.failed.length > 0) {
35
- throw new Error(`trust failed for ${report.failed.length} package(s)`);
36
- }
37
- return 0;
38
- }
1
+ import type { Cli, ParsedOptions } from "@vmz/commander";
2
+
3
+ import { loadNiftyNative } from "../native.js";
4
+ import { authPayload } from "./authArgs.js";
5
+ import { loadConfig } from "../config/loadConfig.js";
6
+ import { bootstrapFromOptions } from "./context.js";
7
+ import { printTrustReport } from "./trust.js";
8
+ import { authFromOptions, cwdFrom, flag, str } from "./options.js";
9
+
10
+ export function registerTrustCommand(cli: Cli): void {
11
+ cli.command("trust", "cli.cmd.trust")
12
+ .option("--dry-run", "cli.opt.dry-run")
13
+ .option("--refresh", "cli.opt.refresh")
14
+ .option("--only <package>", "cli.opt.only")
15
+ .option("--otp <code>", "cli.opt.otp")
16
+ .option("--totp-secret <secret>", "cli.opt.totp-secret")
17
+ .option("--npm-token <token>", "cli.opt.npm-token")
18
+ .action(async (options) => cmdTrust(options));
19
+ }
20
+
21
+ export async function cmdTrust(options: ParsedOptions): Promise<number> {
22
+ await bootstrapFromOptions(options);
23
+ const { config } = await loadConfig({ cwd: cwdFrom(options), createIfMissing: false });
24
+ const native = loadNiftyNative();
25
+ const report = native.publisher["trust-workspace"]({
26
+ cwd: cwdFrom(options),
27
+ dryRun: flag(options, "dry-run"),
28
+ refresh: flag(options, "refresh"),
29
+ only: str(options, "only"),
30
+ packages: config.publish?.packages,
31
+ ...authPayload(authFromOptions(options)),
32
+ });
33
+ printTrustReport(report);
34
+ if (report.failed.length > 0) {
35
+ throw new Error(`trust failed for ${report.failed.length} package(s)`);
36
+ }
37
+ return 0;
38
+ }
package/src/cli/trust.ts CHANGED
@@ -1,83 +1,83 @@
1
- import { loadNiftyNative } from "../native.js";
2
- import { authPayload, parseAuthArgs } from "./authArgs.js";
3
-
4
- export type TrustReport = {
5
- root: string;
6
- configured: string[];
7
- skipped: string[];
8
- failed: string[];
9
- };
10
-
11
- export async function runTrust(argv: string[]): Promise<void> {
12
- const options = parseTrustArgs(argv);
13
- const native = loadNiftyNative();
14
- const report = native.publisher["trust-workspace"]({
15
- cwd: options.cwd,
16
- dryRun: options.dryRun,
17
- refresh: options.refresh,
18
- only: options.only,
19
- ...authPayload(options.auth),
20
- });
21
- printTrustReport(report);
22
- }
23
-
24
- function parseTrustArgs(argv: string[]) {
25
- let cwd: string | undefined;
26
- let dryRun = false;
27
- let refresh = false;
28
- let only: string | undefined;
29
- const auth = parseAuthArgs(argv);
30
-
31
- for (let i = 0; i < argv.length; i += 1) {
32
- const arg = argv[i];
33
- if (arg === "--dry-run") {
34
- dryRun = true;
35
- } else if (arg === "--refresh") {
36
- refresh = true;
37
- } else if (arg === "-C" || arg === "--cwd") {
38
- cwd = argv[++i];
39
- } else if (arg === "--only") {
40
- only = argv[++i];
41
- } else if (arg === "-h" || arg === "--help") {
42
- printTrustHelp();
43
- process.exit(0);
44
- }
45
- }
46
-
47
- return { cwd, dryRun, refresh, only, auth };
48
- }
49
-
50
- export function printTrustReport(report: TrustReport): void {
51
- console.log(`trust workspace ${report.root}`);
52
- console.log(` configured: ${report.configured.length}`);
53
- for (const name of report.configured) {
54
- console.log(` + ${name}`);
55
- }
56
- console.log(` skipped: ${report.skipped.length}`);
57
- for (const name of report.skipped) {
58
- console.log(` = ${name}`);
59
- }
60
- if (report.failed.length > 0) {
61
- console.log(` failed: ${report.failed.length}`);
62
- for (const name of report.failed) {
63
- console.log(` ! ${name}`);
64
- }
65
- }
66
- }
67
-
68
- function printTrustHelp(): void {
69
- console.log(`nifty trust — configure npm Trusted Publisher for workspace packages
70
-
71
- Reads NPM_TOTP_SECRET / NPM_OTP / NPM_TOKEN from env or .env.placeholder.local.
72
- Trust list cache lives in .cache/npm-placeholder.json.
73
-
74
- Usage:
75
- nifty trust
76
- nifty trust --only @doki-land/nifty
77
- nifty trust --dry-run
78
- nifty trust --refresh
79
- nifty trust --totp-secret <base32>
80
- nifty trust --otp 123456
81
- nifty trust -C <cwd>
82
- `);
83
- }
1
+ import { loadNiftyNative } from "../native.js";
2
+ import { authPayload, parseAuthArgs } from "./authArgs.js";
3
+
4
+ export type TrustReport = {
5
+ root: string;
6
+ configured: string[];
7
+ skipped: string[];
8
+ failed: string[];
9
+ };
10
+
11
+ export async function runTrust(argv: string[]): Promise<void> {
12
+ const options = parseTrustArgs(argv);
13
+ const native = loadNiftyNative();
14
+ const report = native.publisher["trust-workspace"]({
15
+ cwd: options.cwd,
16
+ dryRun: options.dryRun,
17
+ refresh: options.refresh,
18
+ only: options.only,
19
+ ...authPayload(options.auth),
20
+ });
21
+ printTrustReport(report);
22
+ }
23
+
24
+ function parseTrustArgs(argv: string[]) {
25
+ let cwd: string | undefined;
26
+ let dryRun = false;
27
+ let refresh = false;
28
+ let only: string | undefined;
29
+ const auth = parseAuthArgs(argv);
30
+
31
+ for (let i = 0; i < argv.length; i += 1) {
32
+ const arg = argv[i];
33
+ if (arg === "--dry-run") {
34
+ dryRun = true;
35
+ } else if (arg === "--refresh") {
36
+ refresh = true;
37
+ } else if (arg === "-C" || arg === "--cwd") {
38
+ cwd = argv[++i];
39
+ } else if (arg === "--only") {
40
+ only = argv[++i];
41
+ } else if (arg === "-h" || arg === "--help") {
42
+ printTrustHelp();
43
+ process.exit(0);
44
+ }
45
+ }
46
+
47
+ return { cwd, dryRun, refresh, only, auth };
48
+ }
49
+
50
+ export function printTrustReport(report: TrustReport): void {
51
+ console.log(`trust workspace ${report.root}`);
52
+ console.log(` configured: ${report.configured.length}`);
53
+ for (const name of report.configured) {
54
+ console.log(` + ${name}`);
55
+ }
56
+ console.log(` skipped: ${report.skipped.length}`);
57
+ for (const name of report.skipped) {
58
+ console.log(` = ${name}`);
59
+ }
60
+ if (report.failed.length > 0) {
61
+ console.log(` failed: ${report.failed.length}`);
62
+ for (const name of report.failed) {
63
+ console.log(` ! ${name}`);
64
+ }
65
+ }
66
+ }
67
+
68
+ function printTrustHelp(): void {
69
+ console.log(`nifty trust — configure npm Trusted Publisher for workspace packages
70
+
71
+ Reads NPM_TOTP_SECRET / NPM_OTP / NPM_TOKEN from env or .env.placeholder.local.
72
+ Trust list cache lives in .cache/npm-placeholder.json.
73
+
74
+ Usage:
75
+ nifty trust
76
+ nifty trust --only @doki-land/nifty
77
+ nifty trust --dry-run
78
+ nifty trust --refresh
79
+ nifty trust --totp-secret <base32>
80
+ nifty trust --otp 123456
81
+ nifty trust -C <cwd>
82
+ `);
83
+ }
@@ -1,20 +1,20 @@
1
- import type { Cli, ParsedOptions } from "@vmz/commander";
2
-
3
- import { bootstrapFromOptions } from "./context.js";
4
- import { updateWorkspace } from "./update.js";
5
- import { cwdFrom, flag } from "./options.js";
6
-
7
- export function registerUpdateCommand(cli: Cli): void {
8
- cli.command("update", "cli.cmd.update")
9
- .option("-i, --interactive", "cli.opt.interactive")
10
- .action(async (options) => cmdUpdate(options));
11
- }
12
-
13
- export async function cmdUpdate(options: ParsedOptions): Promise<number> {
14
- await bootstrapFromOptions(options);
15
- await updateWorkspace({
16
- interactive: flag(options, "interactive"),
17
- cwd: cwdFrom(options),
18
- });
19
- return 0;
20
- }
1
+ import type { Cli, ParsedOptions } from "@vmz/commander";
2
+
3
+ import { bootstrapFromOptions } from "./context.js";
4
+ import { updateWorkspace } from "./update.js";
5
+ import { cwdFrom, flag } from "./options.js";
6
+
7
+ export function registerUpdateCommand(cli: Cli): void {
8
+ cli.command("update", "cli.cmd.update")
9
+ .option("-i, --interactive", "cli.opt.interactive")
10
+ .action(async (options) => cmdUpdate(options));
11
+ }
12
+
13
+ export async function cmdUpdate(options: ParsedOptions): Promise<number> {
14
+ await bootstrapFromOptions(options);
15
+ await updateWorkspace({
16
+ interactive: flag(options, "interactive"),
17
+ cwd: cwdFrom(options),
18
+ });
19
+ return 0;
20
+ }