@doki-land/nifty 0.0.8 → 0.0.9
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/locales/en-US/cli.json +1 -0
- package/package.json +6 -4
- package/src/cli/publish-cmd.ts +2 -0
- package/src/cli/publish.ts +11 -1
- package/src/native.ts +3 -0
package/locales/en-US/cli.json
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"cli.opt.check": "Check formatting without writing files",
|
|
45
45
|
"cli.opt.dry-run": "Print actions without writing or publishing",
|
|
46
46
|
"cli.opt.refresh": "Ignore publish/trust cache and re-check registry",
|
|
47
|
+
"cli.opt.placeholder": "Publish never-published workspace packages as 0.0.0 (name claim)",
|
|
47
48
|
"cli.opt.version": "Explicit semver target version",
|
|
48
49
|
"cli.opt.patch": "Bump patch segment",
|
|
49
50
|
"cli.opt.minor": "Bump minor segment",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doki-land/nifty",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Gitmoji-first commit conventions and release helpers (Node-API + TypeScript)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -24,9 +24,11 @@
|
|
|
24
24
|
"jiti": "^2.4.2"
|
|
25
25
|
},
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"@doki-land/nifty-win32-x64": "0.0.
|
|
28
|
-
"@doki-land/nifty-linux-x64": "0.0.
|
|
29
|
-
"@doki-land/nifty-
|
|
27
|
+
"@doki-land/nifty-win32-x64": "0.0.9",
|
|
28
|
+
"@doki-land/nifty-linux-x64": "0.0.9",
|
|
29
|
+
"@doki-land/nifty-linux-arm64": "0.0.9",
|
|
30
|
+
"@doki-land/nifty-darwin-arm64": "0.0.9",
|
|
31
|
+
"@doki-land/nifty-darwin-x64": "0.0.9"
|
|
30
32
|
},
|
|
31
33
|
"publishConfig": {
|
|
32
34
|
"access": "public"
|
package/src/cli/publish-cmd.ts
CHANGED
|
@@ -10,6 +10,7 @@ export function registerPublishCommand(cli: Cli): void {
|
|
|
10
10
|
cli.command("publish", "cli.cmd.publish")
|
|
11
11
|
.option("--dry-run", "cli.opt.dry-run")
|
|
12
12
|
.option("--refresh", "cli.opt.refresh")
|
|
13
|
+
.option("--placeholder", "cli.opt.placeholder")
|
|
13
14
|
.option("--package <name>", "cli.opt.package")
|
|
14
15
|
.option("--tag <tag>", "cli.opt.tag")
|
|
15
16
|
.option("--access <access>", "cli.opt.access")
|
|
@@ -27,6 +28,7 @@ export async function cmdPublish(options: ParsedOptions): Promise<number> {
|
|
|
27
28
|
cwd: cwdFrom(options),
|
|
28
29
|
dryRun: flag(options, "dry-run"),
|
|
29
30
|
refresh: flag(options, "refresh"),
|
|
31
|
+
placeholder: flag(options, "placeholder"),
|
|
30
32
|
tag: str(options, "tag"),
|
|
31
33
|
access: str(options, "access") ?? "public",
|
|
32
34
|
...(packages.length === 1 ? { only: packages[0] } : {}),
|
package/src/cli/publish.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { authPayload, parseAuthArgs } from "./authArgs.js";
|
|
|
4
4
|
export type PublishOptions = {
|
|
5
5
|
cwd?: string;
|
|
6
6
|
dryRun?: boolean;
|
|
7
|
+
refresh?: boolean;
|
|
8
|
+
placeholder?: boolean;
|
|
7
9
|
tag?: string;
|
|
8
10
|
access?: string;
|
|
9
11
|
};
|
|
@@ -23,6 +25,7 @@ export async function runPublish(argv: string[]): Promise<void> {
|
|
|
23
25
|
cwd: options.cwd,
|
|
24
26
|
dryRun: options.dryRun,
|
|
25
27
|
refresh: options.refresh,
|
|
28
|
+
placeholder: options.placeholder,
|
|
26
29
|
tag: options.tag,
|
|
27
30
|
access: options.access,
|
|
28
31
|
...authPayload(options.auth),
|
|
@@ -34,6 +37,7 @@ function parsePublishArgs(argv: string[]) {
|
|
|
34
37
|
let cwd: string | undefined;
|
|
35
38
|
let dryRun = false;
|
|
36
39
|
let refresh = false;
|
|
40
|
+
let placeholder = false;
|
|
37
41
|
let tag: string | undefined;
|
|
38
42
|
let access = "public";
|
|
39
43
|
const auth = parseAuthArgs(argv);
|
|
@@ -44,6 +48,8 @@ function parsePublishArgs(argv: string[]) {
|
|
|
44
48
|
dryRun = true;
|
|
45
49
|
} else if (arg === "--refresh") {
|
|
46
50
|
refresh = true;
|
|
51
|
+
} else if (arg === "--placeholder") {
|
|
52
|
+
placeholder = true;
|
|
47
53
|
} else if (arg === "-C" || arg === "--cwd") {
|
|
48
54
|
cwd = argv[++i];
|
|
49
55
|
} else if (arg === "--tag") {
|
|
@@ -58,7 +64,7 @@ function parsePublishArgs(argv: string[]) {
|
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
|
|
61
|
-
return { cwd, dryRun, refresh, tag, access, auth };
|
|
67
|
+
return { cwd, dryRun, refresh, placeholder, tag, access, auth };
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
export function printPublishReport(report: PublishReport, dryRun?: boolean): void {
|
|
@@ -87,9 +93,13 @@ Usage:
|
|
|
87
93
|
nifty publish
|
|
88
94
|
nifty publish --dry-run
|
|
89
95
|
nifty publish --refresh
|
|
96
|
+
nifty publish --placeholder
|
|
90
97
|
nifty publish --tag next
|
|
91
98
|
nifty publish --access public
|
|
92
99
|
nifty publish --otp 123456
|
|
93
100
|
nifty publish -C <cwd>
|
|
101
|
+
|
|
102
|
+
--placeholder publishes workspace packages that have no registry version yet as 0.0.0
|
|
103
|
+
(name claim / Trusted Publisher prep). Packages already on npm are skipped.
|
|
94
104
|
`);
|
|
95
105
|
}
|
package/src/native.ts
CHANGED
|
@@ -225,6 +225,7 @@ export type PublisherExports = {
|
|
|
225
225
|
cwd?: string;
|
|
226
226
|
dryRun?: boolean;
|
|
227
227
|
refresh?: boolean;
|
|
228
|
+
placeholder?: boolean;
|
|
228
229
|
only?: string;
|
|
229
230
|
packages?: string[];
|
|
230
231
|
tag?: string;
|
|
@@ -293,6 +294,7 @@ type NativeBinding = {
|
|
|
293
294
|
cwd?: string | null;
|
|
294
295
|
dryRun?: boolean | null;
|
|
295
296
|
refresh?: boolean | null;
|
|
297
|
+
placeholder?: boolean | null;
|
|
296
298
|
tag?: string | null;
|
|
297
299
|
access?: string | null;
|
|
298
300
|
npm?: string | null;
|
|
@@ -695,6 +697,7 @@ function wrapBinding(binding: NativeBinding): NiftyNative {
|
|
|
695
697
|
...(options.cwd !== undefined ? { cwd: options.cwd } : {}),
|
|
696
698
|
...(options.dryRun !== undefined ? { dryRun: options.dryRun } : {}),
|
|
697
699
|
...(options.refresh !== undefined ? { refresh: options.refresh } : {}),
|
|
700
|
+
...(options.placeholder !== undefined ? { placeholder: options.placeholder } : {}),
|
|
698
701
|
...(options.only !== undefined ? { only: options.only } : {}),
|
|
699
702
|
...(options.packages !== undefined ? { packages: options.packages } : {}),
|
|
700
703
|
...(options.tag !== undefined ? { tag: options.tag } : {}),
|