@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.
- package/cli/nifty.mjs +11 -11
- package/locales/en-US/cli.json +70 -68
- package/locales/locales.json +4 -4
- package/package.json +16 -20
- package/src/cli/authArgs.ts +52 -52
- package/src/cli/bump-cmd.ts +55 -55
- package/src/cli/bump.ts +237 -237
- package/src/cli/change-logs-cmd.ts +97 -97
- package/src/cli/cli.ts +47 -47
- package/src/cli/{reword-cmd.ts → commit-cmd.ts} +128 -87
- package/src/cli/context.ts +36 -36
- package/src/cli/format-cmd.ts +23 -23
- package/src/cli/format.ts +39 -28
- package/src/cli/index.ts +9 -9
- package/src/cli/install-native-cmd.ts +22 -22
- package/src/cli/install-native.ts +80 -80
- package/src/cli/lint-cmd.ts +35 -35
- package/src/cli/lint.ts +108 -102
- package/src/cli/main.ts +1 -1
- package/src/cli/options.ts +40 -40
- package/src/cli/publish-cmd.ts +38 -38
- package/src/cli/publish.ts +95 -95
- package/src/cli/resolveNpm.ts +16 -16
- package/src/cli/retime-cmd.ts +62 -62
- package/src/cli/trust-cmd.ts +38 -38
- package/src/cli/trust.ts +83 -83
- package/src/cli/update-cmd.ts +20 -20
- package/src/cli/update.ts +32 -32
- package/src/cli/upload-cmd.ts +44 -44
- package/src/cli/upload.ts +313 -313
- package/src/cli/workspace.ts +124 -124
- package/src/config/defineConfig.ts +12 -12
- package/src/config/detectProject.ts +189 -189
- package/src/config/formatPresets.ts +55 -0
- package/src/config/index.ts +28 -25
- package/src/config/loadConfig.ts +129 -129
- package/src/config/types.ts +78 -57
- package/src/git.ts +61 -61
- package/src/github.ts +184 -184
- package/src/gitmoji.ts +77 -77
- package/src/index.ts +40 -36
- package/src/native.ts +756 -665
- package/src/nifty.ts +95 -95
- package/src/types.ts +40 -40
- package/README.md +0 -29
package/src/cli/update.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { loadNiftyNative } from "../native.js";
|
|
2
|
-
|
|
3
|
-
export type UpdateOptions = {
|
|
4
|
-
interactive: boolean;
|
|
5
|
-
cwd?: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export async function runUpdate(argv: string[]): Promise<void> {
|
|
9
|
-
await updateWorkspace(parseUpdateArgs(argv));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export async function updateWorkspace(options: UpdateOptions): Promise<void> {
|
|
13
|
-
const native = loadNiftyNative();
|
|
14
|
-
native.updater.run({
|
|
15
|
-
cwd: options.cwd,
|
|
16
|
-
interactive: options.interactive,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function parseUpdateArgs(argv: string[]): UpdateOptions {
|
|
21
|
-
let interactive = false;
|
|
22
|
-
let cwd: string | undefined;
|
|
23
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
24
|
-
const arg = argv[i];
|
|
25
|
-
if (arg === "-i" || arg === "--interactive") {
|
|
26
|
-
interactive = true;
|
|
27
|
-
} else if (arg === "-C" || arg === "--cwd") {
|
|
28
|
-
cwd = argv[++i];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return { interactive, cwd };
|
|
32
|
-
}
|
|
1
|
+
import { loadNiftyNative } from "../native.js";
|
|
2
|
+
|
|
3
|
+
export type UpdateOptions = {
|
|
4
|
+
interactive: boolean;
|
|
5
|
+
cwd?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export async function runUpdate(argv: string[]): Promise<void> {
|
|
9
|
+
await updateWorkspace(parseUpdateArgs(argv));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function updateWorkspace(options: UpdateOptions): Promise<void> {
|
|
13
|
+
const native = loadNiftyNative();
|
|
14
|
+
native.updater.run({
|
|
15
|
+
cwd: options.cwd,
|
|
16
|
+
interactive: options.interactive,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function parseUpdateArgs(argv: string[]): UpdateOptions {
|
|
21
|
+
let interactive = false;
|
|
22
|
+
let cwd: string | undefined;
|
|
23
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
24
|
+
const arg = argv[i];
|
|
25
|
+
if (arg === "-i" || arg === "--interactive") {
|
|
26
|
+
interactive = true;
|
|
27
|
+
} else if (arg === "-C" || arg === "--cwd") {
|
|
28
|
+
cwd = argv[++i];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return { interactive, cwd };
|
|
32
|
+
}
|
package/src/cli/upload-cmd.ts
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import type { Cli, ParsedOptions } from "@vmz/commander";
|
|
2
|
-
|
|
3
|
-
import { bootstrapFromOptions } from "./context.js";
|
|
4
|
-
import { uploadFromOptions } from "./upload.js";
|
|
5
|
-
import { cwdFrom, flag, str } from "./options.js";
|
|
6
|
-
|
|
7
|
-
export function registerUploadCommand(cli: Cli): void {
|
|
8
|
-
cli.command("upload", "cli.cmd.upload")
|
|
9
|
-
.option("--release", "cli.opt.release")
|
|
10
|
-
.option("--pages", "cli.opt.pages")
|
|
11
|
-
.option("--both", "cli.opt.both")
|
|
12
|
-
.option("-d, --dir <path>", "cli.opt.dir")
|
|
13
|
-
.option("-t, --tag <tag>", "cli.opt.tag")
|
|
14
|
-
.option("--repo <repo>", "cli.opt.repo")
|
|
15
|
-
.option("--token <token>", "cli.opt.token")
|
|
16
|
-
.option("--name <title>", "cli.opt.name")
|
|
17
|
-
.option("--notes <body>", "cli.opt.notes")
|
|
18
|
-
.option("--notes-file <path>", "cli.opt.notes-file")
|
|
19
|
-
.option("--draft", "cli.opt.draft")
|
|
20
|
-
.option("--no-generate-notes", "cli.opt.no-generate-notes")
|
|
21
|
-
.option("--github-action", "cli.opt.github-action")
|
|
22
|
-
.action(async (options) => cmdUpload(options));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export async function cmdUpload(options: ParsedOptions): Promise<number> {
|
|
26
|
-
await bootstrapFromOptions(options);
|
|
27
|
-
await uploadFromOptions({
|
|
28
|
-
release: flag(options, "release"),
|
|
29
|
-
pages: flag(options, "pages"),
|
|
30
|
-
both: flag(options, "both"),
|
|
31
|
-
dir: str(options, "dir") ?? "dist",
|
|
32
|
-
tag: str(options, "tag"),
|
|
33
|
-
repo: str(options, "repo"),
|
|
34
|
-
token: str(options, "token"),
|
|
35
|
-
name: str(options, "name"),
|
|
36
|
-
notes: str(options, "notes"),
|
|
37
|
-
notesFile: str(options, "notes-file"),
|
|
38
|
-
draft: flag(options, "draft"),
|
|
39
|
-
generateNotes: !flag(options, "no-generate-notes"),
|
|
40
|
-
githubAction: flag(options, "github-action"),
|
|
41
|
-
cwd: cwdFrom(options),
|
|
42
|
-
});
|
|
43
|
-
return 0;
|
|
44
|
-
}
|
|
1
|
+
import type { Cli, ParsedOptions } from "@vmz/commander";
|
|
2
|
+
|
|
3
|
+
import { bootstrapFromOptions } from "./context.js";
|
|
4
|
+
import { uploadFromOptions } from "./upload.js";
|
|
5
|
+
import { cwdFrom, flag, str } from "./options.js";
|
|
6
|
+
|
|
7
|
+
export function registerUploadCommand(cli: Cli): void {
|
|
8
|
+
cli.command("upload", "cli.cmd.upload")
|
|
9
|
+
.option("--release", "cli.opt.release")
|
|
10
|
+
.option("--pages", "cli.opt.pages")
|
|
11
|
+
.option("--both", "cli.opt.both")
|
|
12
|
+
.option("-d, --dir <path>", "cli.opt.dir")
|
|
13
|
+
.option("-t, --tag <tag>", "cli.opt.tag")
|
|
14
|
+
.option("--repo <repo>", "cli.opt.repo")
|
|
15
|
+
.option("--token <token>", "cli.opt.token")
|
|
16
|
+
.option("--name <title>", "cli.opt.name")
|
|
17
|
+
.option("--notes <body>", "cli.opt.notes")
|
|
18
|
+
.option("--notes-file <path>", "cli.opt.notes-file")
|
|
19
|
+
.option("--draft", "cli.opt.draft")
|
|
20
|
+
.option("--no-generate-notes", "cli.opt.no-generate-notes")
|
|
21
|
+
.option("--github-action", "cli.opt.github-action")
|
|
22
|
+
.action(async (options) => cmdUpload(options));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export async function cmdUpload(options: ParsedOptions): Promise<number> {
|
|
26
|
+
await bootstrapFromOptions(options);
|
|
27
|
+
await uploadFromOptions({
|
|
28
|
+
release: flag(options, "release"),
|
|
29
|
+
pages: flag(options, "pages"),
|
|
30
|
+
both: flag(options, "both"),
|
|
31
|
+
dir: str(options, "dir") ?? "dist",
|
|
32
|
+
tag: str(options, "tag"),
|
|
33
|
+
repo: str(options, "repo"),
|
|
34
|
+
token: str(options, "token"),
|
|
35
|
+
name: str(options, "name"),
|
|
36
|
+
notes: str(options, "notes"),
|
|
37
|
+
notesFile: str(options, "notes-file"),
|
|
38
|
+
draft: flag(options, "draft"),
|
|
39
|
+
generateNotes: !flag(options, "no-generate-notes"),
|
|
40
|
+
githubAction: flag(options, "github-action"),
|
|
41
|
+
cwd: cwdFrom(options),
|
|
42
|
+
});
|
|
43
|
+
return 0;
|
|
44
|
+
}
|