@vlandoss/run-run 0.0.6-git-290164e.0 โ 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/package.json +3 -3
- package/src/program/__tests__/__snapshots__/snapshots.test.ts.snap +32 -46
- package/src/program/commands/{test-static.ts โ check.ts} +3 -3
- package/src/program/commands/format.ts +2 -2
- package/src/program/commands/typecheck.ts +2 -2
- package/src/program/index.ts +4 -6
- package/src/program/commands/info-pkg.ts +0 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vlandoss/run-run",
|
|
3
|
-
"version": "0.0.6
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "The CLI toolbox to fullstack common scripts in Variable Land",
|
|
5
5
|
"homepage": "https://github.com/variableland/dx/tree/main/packages/run-run#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"is-ci": "4.1.0",
|
|
34
34
|
"rimraf": "6.0.1",
|
|
35
35
|
"typescript": "5.8.2",
|
|
36
|
-
"@vlandoss/
|
|
37
|
-
"@vlandoss/
|
|
36
|
+
"@vlandoss/clibuddy": "0.0.4",
|
|
37
|
+
"@vlandoss/loggy": "0.0.3"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
@@ -10,13 +10,12 @@ Options:
|
|
|
10
10
|
-h, --help display help for command
|
|
11
11
|
|
|
12
12
|
Commands:
|
|
13
|
-
|
|
13
|
+
check|test:static [options] check format and lint issues ๐
|
|
14
14
|
lint [options] lint the code ๐งน
|
|
15
|
-
|
|
15
|
+
fmt|format [options] format the code ๐จ
|
|
16
|
+
tsc|typecheck check if TypeScript code is well typed ๐จ
|
|
16
17
|
clean [options] delete dirty folders or files such as
|
|
17
18
|
node_modules, etc ๐๏ธ
|
|
18
|
-
typecheck|tsc check if TypeScript code is well typed ๐จ
|
|
19
|
-
info:pkg [options] display run-run package.json โน๏ธ
|
|
20
19
|
help [command] display help for command
|
|
21
20
|
|
|
22
21
|
Acknowledgment:
|
|
@@ -38,13 +37,12 @@ Options:
|
|
|
38
37
|
-h, --help display help for command
|
|
39
38
|
|
|
40
39
|
Commands:
|
|
41
|
-
|
|
40
|
+
check|test:static [options] check format and lint issues ๐
|
|
42
41
|
lint [options] lint the code ๐งน
|
|
43
|
-
|
|
42
|
+
fmt|format [options] format the code ๐จ
|
|
43
|
+
tsc|typecheck check if TypeScript code is well typed ๐จ
|
|
44
44
|
clean [options] delete dirty folders or files such as
|
|
45
45
|
node_modules, etc ๐๏ธ
|
|
46
|
-
typecheck|tsc check if TypeScript code is well typed ๐จ
|
|
47
|
-
info:pkg [options] display run-run package.json โน๏ธ
|
|
48
46
|
help [command] display help for command
|
|
49
47
|
|
|
50
48
|
Acknowledgment:
|
|
@@ -66,17 +64,17 @@ exports[`should match command: "-v" 1`] = `
|
|
|
66
64
|
"
|
|
67
65
|
`;
|
|
68
66
|
|
|
69
|
-
exports[`should match help message for command "
|
|
70
|
-
"Usage: rr
|
|
67
|
+
exports[`should match help message for command "check" 1`] = `
|
|
68
|
+
"Usage: rr check|test:static [options]
|
|
71
69
|
|
|
72
|
-
format
|
|
70
|
+
check format and lint issues ๐
|
|
73
71
|
|
|
74
72
|
Options:
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-h, --help
|
|
73
|
+
-f, --fix try to fix issues automatically
|
|
74
|
+
--fix-staged try to fix staged files only
|
|
75
|
+
-h, --help display help for command
|
|
78
76
|
|
|
79
|
-
Under the hood, this command uses the biome CLI to
|
|
77
|
+
Under the hood, this command uses the biome CLI to check the code.
|
|
80
78
|
"
|
|
81
79
|
`;
|
|
82
80
|
|
|
@@ -94,36 +92,22 @@ Under the hood, this command uses the biome CLI to lint the code.
|
|
|
94
92
|
"
|
|
95
93
|
`;
|
|
96
94
|
|
|
97
|
-
exports[`should match help message for command "
|
|
98
|
-
"Usage: rr
|
|
99
|
-
|
|
100
|
-
check format and lint issues โ
|
|
101
|
-
|
|
102
|
-
Options:
|
|
103
|
-
-f, --fix try to fix issues automatically
|
|
104
|
-
--fix-staged try to fix staged files only
|
|
105
|
-
-h, --help display help for command
|
|
106
|
-
|
|
107
|
-
Under the hood, this command uses the biome CLI to check the code.
|
|
108
|
-
"
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
exports[`should match help message for command "clean" 1`] = `
|
|
112
|
-
"Usage: rr clean [options]
|
|
95
|
+
exports[`should match help message for command "fmt" 1`] = `
|
|
96
|
+
"Usage: rr fmt|format [options]
|
|
113
97
|
|
|
114
|
-
|
|
98
|
+
format the code ๐จ
|
|
115
99
|
|
|
116
100
|
Options:
|
|
117
|
-
--
|
|
118
|
-
--
|
|
101
|
+
-c, --check check if the code is formatted (default: true)
|
|
102
|
+
-f, --fix format all the code
|
|
119
103
|
-h, --help display help for command
|
|
120
104
|
|
|
121
|
-
Under the hood, this command uses the
|
|
105
|
+
Under the hood, this command uses the biome CLI to format the code.
|
|
122
106
|
"
|
|
123
107
|
`;
|
|
124
108
|
|
|
125
|
-
exports[`should match help message for command "
|
|
126
|
-
"Usage: rr typecheck
|
|
109
|
+
exports[`should match help message for command "tsc" 1`] = `
|
|
110
|
+
"Usage: rr tsc|typecheck [options]
|
|
127
111
|
|
|
128
112
|
check if TypeScript code is well typed ๐จ
|
|
129
113
|
|
|
@@ -134,15 +118,17 @@ Under the hood, this command uses the TypeScript CLI to check the code.
|
|
|
134
118
|
"
|
|
135
119
|
`;
|
|
136
120
|
|
|
137
|
-
exports[`should match help message for command "
|
|
138
|
-
"Usage: rr
|
|
121
|
+
exports[`should match help message for command "clean" 1`] = `
|
|
122
|
+
"Usage: rr clean [options]
|
|
139
123
|
|
|
140
|
-
|
|
124
|
+
delete dirty folders or files such as node_modules, etc ๐๏ธ
|
|
141
125
|
|
|
142
126
|
Options:
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
-h, --help
|
|
127
|
+
--only-dist delete 'dist' folders only
|
|
128
|
+
--dry-run outputs the paths that would be deleted
|
|
129
|
+
-h, --help display help for command
|
|
130
|
+
|
|
131
|
+
Under the hood, this command uses the rimraf.js to delete dirty folders or files.
|
|
146
132
|
"
|
|
147
133
|
`;
|
|
148
134
|
|
|
@@ -160,10 +146,10 @@ Commands:
|
|
|
160
146
|
"
|
|
161
147
|
`;
|
|
162
148
|
|
|
163
|
-
exports[`should match "
|
|
149
|
+
exports[`should match "check" command 1`] = `"biome check --colors=force"`;
|
|
164
150
|
|
|
165
151
|
exports[`should match "lint" command 1`] = `"biome check --colors=force --formatter-enabled=false"`;
|
|
166
152
|
|
|
167
|
-
exports[`should match "
|
|
153
|
+
exports[`should match "fmt" command 1`] = `"biome format --no-errors-on-unmatched --colors=force"`;
|
|
168
154
|
|
|
169
|
-
exports[`should match "
|
|
155
|
+
exports[`should match "tsc" command 1`] = `"tsc --noEmit"`;
|
|
@@ -3,13 +3,13 @@ import isCI from "is-ci";
|
|
|
3
3
|
import { BiomeService } from "~/services/biome";
|
|
4
4
|
import type { Context } from "~/services/ctx";
|
|
5
5
|
|
|
6
|
-
export function
|
|
6
|
+
export function createCheckCommand(ctx: Context) {
|
|
7
7
|
return createCommand("check")
|
|
8
8
|
.alias("test:static")
|
|
9
|
-
.description("check format and lint issues
|
|
9
|
+
.description("check format and lint issues ๐")
|
|
10
10
|
.option("-f, --fix", "try to fix issues automatically")
|
|
11
11
|
.option("--fix-staged", "try to fix staged files only")
|
|
12
|
-
.action(async function
|
|
12
|
+
.action(async function checkAction(options) {
|
|
13
13
|
const { $ } = new BiomeService(ctx.shell);
|
|
14
14
|
const toolCmd = (cmd = "check") => `biome ${cmd} --colors=force`;
|
|
15
15
|
|
|
@@ -3,8 +3,8 @@ import { BiomeService } from "~/services/biome";
|
|
|
3
3
|
import type { Context } from "~/services/ctx";
|
|
4
4
|
|
|
5
5
|
export function createFormatCommand(ctx: Context) {
|
|
6
|
-
return createCommand("
|
|
7
|
-
.alias("
|
|
6
|
+
return createCommand("fmt")
|
|
7
|
+
.alias("format")
|
|
8
8
|
.description("format the code ๐จ")
|
|
9
9
|
.option("-c, --check", "check if the code is formatted", true)
|
|
10
10
|
.option("-f, --fix", "format all the code")
|
|
@@ -4,8 +4,8 @@ import type { Context } from "~/services/ctx";
|
|
|
4
4
|
import { logger } from "~/services/logger";
|
|
5
5
|
|
|
6
6
|
export function createTypecheckCommand(ctx: Context) {
|
|
7
|
-
return createCommand("
|
|
8
|
-
.alias("
|
|
7
|
+
return createCommand("tsc")
|
|
8
|
+
.alias("typecheck")
|
|
9
9
|
.description("check if TypeScript code is well typed ๐จ")
|
|
10
10
|
.action(async function typecheckAction() {
|
|
11
11
|
const { appPkg, shell } = ctx;
|
package/src/program/index.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { getVersion } from "@vlandoss/clibuddy";
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
import { createContext } from "~/services/ctx";
|
|
4
|
+
import { createCheckCommand } from "./commands/check";
|
|
4
5
|
import { createCleanCommand } from "./commands/clean";
|
|
5
6
|
import { createFormatCommand } from "./commands/format";
|
|
6
|
-
import { createInfoPkgCommand } from "./commands/info-pkg";
|
|
7
7
|
import { createLintCommand } from "./commands/lint";
|
|
8
|
-
import { createTestStaticCommand } from "./commands/test-static";
|
|
9
8
|
import { createToolsCommand } from "./commands/tools";
|
|
10
9
|
import { createTypecheckCommand } from "./commands/typecheck";
|
|
11
10
|
import { BANNER_TEXT, CREDITS_TEXT } from "./ui";
|
|
@@ -22,12 +21,11 @@ export async function createProgram(options: Options) {
|
|
|
22
21
|
.version(getVersion(ctx.binPkg), "-v, --version")
|
|
23
22
|
.addHelpText("before", BANNER_TEXT)
|
|
24
23
|
.addHelpText("after", CREDITS_TEXT)
|
|
25
|
-
.addCommand(
|
|
24
|
+
.addCommand(createCheckCommand(ctx))
|
|
26
25
|
.addCommand(createLintCommand(ctx))
|
|
27
|
-
.addCommand(
|
|
28
|
-
.addCommand(createCleanCommand())
|
|
26
|
+
.addCommand(createFormatCommand(ctx))
|
|
29
27
|
.addCommand(createTypecheckCommand(ctx))
|
|
30
|
-
.addCommand(
|
|
28
|
+
.addCommand(createCleanCommand())
|
|
31
29
|
.addCommand(createToolsCommand(ctx), {
|
|
32
30
|
hidden: true,
|
|
33
31
|
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { createCommand } from "commander";
|
|
2
|
-
import type { Context } from "~/services/ctx";
|
|
3
|
-
import { logger } from "~/services/logger";
|
|
4
|
-
import { get } from "~/utils/get";
|
|
5
|
-
|
|
6
|
-
export function createInfoPkgCommand(ctx: Context) {
|
|
7
|
-
return createCommand("info:pkg")
|
|
8
|
-
.description("display run-run package.json โน๏ธ")
|
|
9
|
-
.option("-f, --filter <filter>", "lodash get id like to filter info by")
|
|
10
|
-
.option("-c, --current", "display package.json where run-run will be executed")
|
|
11
|
-
.action(async function pkgAction(options) {
|
|
12
|
-
const { appPkg, binPkg } = ctx;
|
|
13
|
-
|
|
14
|
-
const infoObject = options.current ? appPkg.info() : binPkg.info();
|
|
15
|
-
|
|
16
|
-
if (!options.filter) {
|
|
17
|
-
logger.info("%O", infoObject);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const { filter } = options;
|
|
22
|
-
const subInfoObject = get(infoObject.packageJson, filter);
|
|
23
|
-
|
|
24
|
-
if (!subInfoObject) {
|
|
25
|
-
logger.info("No info found");
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
logger.info("%O", { [filter]: subInfoObject });
|
|
30
|
-
});
|
|
31
|
-
}
|