@optique/git 0.9.0-dev.270 → 0.9.0-dev.274

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 (2) hide show
  1. package/README.md +17 -17
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -31,7 +31,7 @@ Quick start
31
31
  ~~~~ typescript
32
32
  import { gitBranch, gitTag, gitCommit } from "@optique/git";
33
33
  import { argument, option, object } from "@optique/core/primitives";
34
- import { parse } from "@optique/core/parser";
34
+ import { parseAsync } from "@optique/core/parser";
35
35
 
36
36
  const parser = object({
37
37
  branch: argument(gitBranch()),
@@ -39,7 +39,7 @@ const parser = object({
39
39
  commit: option("-c", "--commit", gitCommit()),
40
40
  });
41
41
 
42
- const result = await parse(parser, ["feature/login"]);
42
+ const result = await parseAsync(parser, ["feature/login"]);
43
43
  // result.success === true
44
44
  // result.value.branch === "feature/login"
45
45
  ~~~~
@@ -54,7 +54,7 @@ Use `createGitParsers()` to create parsers for a different repository:
54
54
  ~~~~ typescript
55
55
  import { createGitParsers } from "@optique/git";
56
56
  import { argument, object } from "@optique/core/primitives";
57
- import { parse } from "@optique/core/parser";
57
+ import { parseAsync } from "@optique/core/parser";
58
58
 
59
59
  const git = createGitParsers({ dir: "/path/to/repo" });
60
60
 
@@ -63,7 +63,7 @@ const parser = object({
63
63
  tag: option("-t", "--tag", git.tag()),
64
64
  });
65
65
 
66
- const result = await parse(parser, ["v1.0.0"]);
66
+ const result = await parseAsync(parser, ["v1.0.0"]);
67
67
  // result.success === true
68
68
  // result.value.tag === "v1.0.0"
69
69
  ~~~~
@@ -80,13 +80,13 @@ existing branch in the repository.
80
80
  ~~~~ typescript
81
81
  import { gitBranch } from "@optique/git";
82
82
  import { argument, object } from "@optique/core/primitives";
83
- import { parse } from "@optique/core/parser";
83
+ import { parseAsync } from "@optique/core/parser";
84
84
 
85
85
  const parser = object({
86
86
  branch: argument(gitBranch()),
87
87
  });
88
88
 
89
- const result = await parse(parser, ["main"]);
89
+ const result = await parseAsync(parser, ["main"]);
90
90
  // Valid branch
91
91
  ~~~~
92
92
 
@@ -103,13 +103,13 @@ existing branch on the specified remote.
103
103
  ~~~~ typescript
104
104
  import { gitRemoteBranch } from "@optique/git";
105
105
  import { option, object } from "@optique/core/primitives";
106
- import { parse } from "@optique/core/parser";
106
+ import { parseAsync } from "@optique/core/parser";
107
107
 
108
108
  const parser = object({
109
109
  branch: option("-b", "--branch", gitRemoteBranch("origin")),
110
110
  });
111
111
 
112
- const result = await parse(parser, ["--branch=main"]);
112
+ const result = await parseAsync(parser, ["--branch=main"]);
113
113
  // Valid remote branch on origin
114
114
  ~~~~
115
115
 
@@ -122,13 +122,13 @@ in the repository.
122
122
  ~~~~ typescript
123
123
  import { gitTag } from "@optique/git";
124
124
  import { option, object } from "@optique/core/primitives";
125
- import { parse } from "@optique/core/parser";
125
+ import { parseAsync } from "@optique/core/parser";
126
126
 
127
127
  const parser = object({
128
128
  tag: option("-t", "--tag", gitTag()),
129
129
  });
130
130
 
131
- const result = await parse(parser, ["--tag=v1.0.0"]);
131
+ const result = await parseAsync(parser, ["--tag=v1.0.0"]);
132
132
  // Valid tag
133
133
  ~~~~
134
134
 
@@ -141,13 +141,13 @@ remote in the repository.
141
141
  ~~~~ typescript
142
142
  import { gitRemote } from "@optique/git";
143
143
  import { option, object } from "@optique/core/primitives";
144
- import { parse } from "@optique/core/parser";
144
+ import { parseAsync } from "@optique/core/parser";
145
145
 
146
146
  const parser = object({
147
147
  remote: option("-r", "--remote", gitRemote()),
148
148
  });
149
149
 
150
- const result = await parse(parser, ["--remote=origin"]);
150
+ const result = await parseAsync(parser, ["--remote=origin"]);
151
151
  // Valid remote
152
152
  ~~~~
153
153
 
@@ -160,13 +160,13 @@ A value parser for commit SHAs. Validates that the input is a valid commit SHA
160
160
  ~~~~ typescript
161
161
  import { gitCommit } from "@optique/git";
162
162
  import { option, object } from "@optique/core/primitives";
163
- import { parse } from "@optique/core/parser";
163
+ import { parseAsync } from "@optique/core/parser";
164
164
 
165
165
  const parser = object({
166
166
  commit: option("-c", "--commit", gitCommit()),
167
167
  });
168
168
 
169
- const result = await parse(parser, ["--commit=abc1234"]);
169
+ const result = await parseAsync(parser, ["--commit=abc1234"]);
170
170
  // Valid commit SHA
171
171
  ~~~~
172
172
 
@@ -179,13 +179,13 @@ that the input resolves to a valid Git reference.
179
179
  ~~~~ typescript
180
180
  import { gitRef } from "@optique/git";
181
181
  import { option, object } from "@optique/core/primitives";
182
- import { parse } from "@optique/core/parser";
182
+ import { parseAsync } from "@optique/core/parser";
183
183
 
184
184
  const parser = object({
185
185
  ref: option("--ref", gitRef()),
186
186
  });
187
187
 
188
- const result = await parse(parser, ["--ref=v1.0.0"]);
188
+ const result = await parseAsync(parser, ["--ref=v1.0.0"]);
189
189
  // Valid branch, tag, or commit
190
190
  ~~~~
191
191
 
@@ -198,7 +198,7 @@ created by the factory share the same filesystem and directory options.
198
198
  ~~~~ typescript
199
199
  import { createGitParsers } from "@optique/git";
200
200
  import { argument, option, object } from "@optique/core/primitives";
201
- import { parse } from "@optique/core/parser";
201
+ import { parseAsync } from "@optique/core/parser";
202
202
 
203
203
  const git = createGitParsers({ dir: "/path/to/repo" });
204
204
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/git",
3
- "version": "0.9.0-dev.270+b5894625",
3
+ "version": "0.9.0-dev.274+cbf6ff12",
4
4
  "description": "Git value parsers for Optique",
5
5
  "keywords": [
6
6
  "CLI",