@angeloashmore/prismic-cli-poc 0.0.0-pr.6.9baab87 → 0.0.0-pr.8.b80fefa

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 (63) hide show
  1. package/dist/index.mjs +277 -432
  2. package/package.json +1 -1
  3. package/src/custom-type-add-field-boolean.ts +5 -12
  4. package/src/custom-type-add-field-color.ts +6 -12
  5. package/src/custom-type-add-field-date.ts +6 -12
  6. package/src/custom-type-add-field-embed.ts +6 -12
  7. package/src/custom-type-add-field-geo-point.ts +6 -12
  8. package/src/custom-type-add-field-image.ts +6 -12
  9. package/src/custom-type-add-field-key-text.ts +6 -12
  10. package/src/custom-type-add-field-link.ts +5 -12
  11. package/src/custom-type-add-field-number.ts +6 -12
  12. package/src/custom-type-add-field-rich-text.ts +5 -12
  13. package/src/custom-type-add-field-select.ts +5 -12
  14. package/src/custom-type-add-field-timestamp.ts +6 -12
  15. package/src/custom-type-add-field-uid.ts +6 -12
  16. package/src/custom-type-connect-slice.ts +6 -12
  17. package/src/custom-type-create.ts +6 -12
  18. package/src/custom-type-disconnect-slice.ts +6 -12
  19. package/src/custom-type-remove-field.ts +6 -12
  20. package/src/custom-type-remove.ts +6 -12
  21. package/src/custom-type-set-name.ts +6 -12
  22. package/src/docs.ts +149 -0
  23. package/src/index.ts +5 -0
  24. package/src/page-type-add-field-boolean.ts +5 -12
  25. package/src/page-type-add-field-color.ts +6 -12
  26. package/src/page-type-add-field-date.ts +6 -12
  27. package/src/page-type-add-field-embed.ts +6 -12
  28. package/src/page-type-add-field-geo-point.ts +6 -12
  29. package/src/page-type-add-field-image.ts +6 -12
  30. package/src/page-type-add-field-key-text.ts +6 -12
  31. package/src/page-type-add-field-link.ts +5 -12
  32. package/src/page-type-add-field-number.ts +6 -12
  33. package/src/page-type-add-field-rich-text.ts +5 -12
  34. package/src/page-type-add-field-select.ts +5 -12
  35. package/src/page-type-add-field-timestamp.ts +6 -12
  36. package/src/page-type-add-field-uid.ts +6 -12
  37. package/src/page-type-connect-slice.ts +6 -12
  38. package/src/page-type-create.ts +6 -12
  39. package/src/page-type-disconnect-slice.ts +6 -12
  40. package/src/page-type-remove-field.ts +6 -12
  41. package/src/page-type-remove.ts +6 -12
  42. package/src/page-type-set-name.ts +6 -12
  43. package/src/page-type-set-repeatable.ts +6 -12
  44. package/src/pull.ts +1 -6
  45. package/src/slice-add-field-boolean.ts +5 -12
  46. package/src/slice-add-field-color.ts +6 -12
  47. package/src/slice-add-field-date.ts +6 -12
  48. package/src/slice-add-field-embed.ts +6 -12
  49. package/src/slice-add-field-geo-point.ts +6 -12
  50. package/src/slice-add-field-image.ts +6 -12
  51. package/src/slice-add-field-key-text.ts +6 -12
  52. package/src/slice-add-field-link.ts +5 -12
  53. package/src/slice-add-field-number.ts +6 -12
  54. package/src/slice-add-field-rich-text.ts +5 -12
  55. package/src/slice-add-field-select.ts +5 -12
  56. package/src/slice-add-field-timestamp.ts +6 -12
  57. package/src/slice-add-variation.ts +6 -12
  58. package/src/slice-create.ts +6 -12
  59. package/src/slice-remove-field.ts +6 -12
  60. package/src/slice-remove-variation.ts +6 -12
  61. package/src/slice-remove.ts +6 -12
  62. package/src/slice-rename.ts +6 -12
  63. package/src/status.ts +113 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angeloashmore/prismic-cli-poc",
3
- "version": "0.0.0-pr.6.9baab87",
3
+ "version": "0.0.0-pr.8.b80fefa",
4
4
  "description": "A proof-of-concept developer CLI for Prismic.",
5
5
  "keywords": [
6
6
  "prismic",
@@ -19,8 +19,6 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
@@ -28,7 +26,6 @@ FLAGS
28
26
  --true-label string Label shown when toggle is on
29
27
  --false-label string Label shown when toggle is off
30
28
  --types string Output file for generated types (default: "prismicio-types.d.ts")
31
- --no-types Skip type generation
32
29
  -h, --help Show help for command
33
30
 
34
31
  EXAMPLES
@@ -56,7 +53,6 @@ export async function customTypeAddFieldBoolean(): Promise<void> {
56
53
  "true-label": trueLabel,
57
54
  "false-label": falseLabel,
58
55
  types,
59
- "no-types": noTypes,
60
56
  },
61
57
  positionals: [typeId, fieldId],
62
58
  } = parseArgs({
@@ -68,7 +64,6 @@ export async function customTypeAddFieldBoolean(): Promise<void> {
68
64
  "true-label": { type: "string" },
69
65
  "false-label": { type: "string" },
70
66
  types: { type: "string" },
71
- "no-types": { type: "boolean" },
72
67
  help: { type: "boolean", short: "h" },
73
68
  },
74
69
  allowPositionals: true,
@@ -177,13 +172,11 @@ export async function customTypeAddFieldBoolean(): Promise<void> {
177
172
 
178
173
  console.info(`Added field "${fieldId}" (Boolean) to "${targetTab}" tab in ${typeId}`);
179
174
 
180
- if (!noTypes) {
181
- try {
182
- await buildTypes({ output: types });
183
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
184
- } catch (error) {
185
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
186
- }
175
+ try {
176
+ await buildTypes({ output: types });
177
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
178
+ } catch (error) {
179
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
187
180
  }
188
181
 
189
182
  console.info();
@@ -19,14 +19,11 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
27
25
  -p, --placeholder string Placeholder text
28
26
  --types string Output file for generated types (default: "prismicio-types.d.ts")
29
- --no-types Skip type generation
30
27
  -h, --help Show help for command
31
28
 
32
29
  EXAMPLES
@@ -46,7 +43,7 @@ const CustomTypeSchema = v.object({
46
43
 
47
44
  export async function customTypeAddFieldColor(): Promise<void> {
48
45
  const {
49
- values: { help, tab, label, placeholder, types, "no-types": noTypes },
46
+ values: { help, tab, label, placeholder, types },
50
47
  positionals: [typeId, fieldId],
51
48
  } = parseArgs({
52
49
  args: process.argv.slice(5), // skip: node, script, "custom-type", "add-field", "color"
@@ -55,7 +52,6 @@ export async function customTypeAddFieldColor(): Promise<void> {
55
52
  label: { type: "string", short: "l" },
56
53
  placeholder: { type: "string", short: "p" },
57
54
  types: { type: "string" },
58
- "no-types": { type: "boolean" },
59
55
  help: { type: "boolean", short: "h" },
60
56
  },
61
57
  allowPositionals: true,
@@ -162,13 +158,11 @@ export async function customTypeAddFieldColor(): Promise<void> {
162
158
 
163
159
  console.info(`Added field "${fieldId}" (Color) to "${targetTab}" tab in ${typeId}`);
164
160
 
165
- if (!noTypes) {
166
- try {
167
- await buildTypes({ output: types });
168
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
169
- } catch (error) {
170
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
171
- }
161
+ try {
162
+ await buildTypes({ output: types });
163
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
164
+ } catch (error) {
165
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
172
166
  }
173
167
 
174
168
  console.info();
@@ -19,15 +19,12 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
27
25
  -p, --placeholder string Placeholder text
28
26
  --default string Default date value (YYYY-MM-DD format)
29
27
  --types string Output file for generated types (default: "prismicio-types.d.ts")
30
- --no-types Skip type generation
31
28
  -h, --help Show help for command
32
29
 
33
30
  EXAMPLES
@@ -47,7 +44,7 @@ const CustomTypeSchema = v.object({
47
44
 
48
45
  export async function customTypeAddFieldDate(): Promise<void> {
49
46
  const {
50
- values: { help, tab, label, placeholder, default: defaultValue, types, "no-types": noTypes },
47
+ values: { help, tab, label, placeholder, default: defaultValue, types },
51
48
  positionals: [typeId, fieldId],
52
49
  } = parseArgs({
53
50
  args: process.argv.slice(5), // skip: node, script, "custom-type", "add-field", "date"
@@ -57,7 +54,6 @@ export async function customTypeAddFieldDate(): Promise<void> {
57
54
  placeholder: { type: "string", short: "p" },
58
55
  default: { type: "string" },
59
56
  types: { type: "string" },
60
- "no-types": { type: "boolean" },
61
57
  help: { type: "boolean", short: "h" },
62
58
  },
63
59
  allowPositionals: true,
@@ -165,13 +161,11 @@ export async function customTypeAddFieldDate(): Promise<void> {
165
161
 
166
162
  console.info(`Added field "${fieldId}" (Date) to "${targetTab}" tab in ${typeId}`);
167
163
 
168
- if (!noTypes) {
169
- try {
170
- await buildTypes({ output: types });
171
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
172
- } catch (error) {
173
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
174
- }
164
+ try {
165
+ await buildTypes({ output: types });
166
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
167
+ } catch (error) {
168
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
175
169
  }
176
170
 
177
171
  console.info();
@@ -19,14 +19,11 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
27
25
  -p, --placeholder string Placeholder text
28
26
  --types string Output file for generated types (default: "prismicio-types.d.ts")
29
- --no-types Skip type generation
30
27
  -h, --help Show help for command
31
28
 
32
29
  EXAMPLES
@@ -46,7 +43,7 @@ const CustomTypeSchema = v.object({
46
43
 
47
44
  export async function customTypeAddFieldEmbed(): Promise<void> {
48
45
  const {
49
- values: { help, tab, label, placeholder, types, "no-types": noTypes },
46
+ values: { help, tab, label, placeholder, types },
50
47
  positionals: [typeId, fieldId],
51
48
  } = parseArgs({
52
49
  args: process.argv.slice(5), // skip: node, script, "custom-type", "add-field", "embed"
@@ -55,7 +52,6 @@ export async function customTypeAddFieldEmbed(): Promise<void> {
55
52
  label: { type: "string", short: "l" },
56
53
  placeholder: { type: "string", short: "p" },
57
54
  types: { type: "string" },
58
- "no-types": { type: "boolean" },
59
55
  help: { type: "boolean", short: "h" },
60
56
  },
61
57
  allowPositionals: true,
@@ -162,13 +158,11 @@ export async function customTypeAddFieldEmbed(): Promise<void> {
162
158
 
163
159
  console.info(`Added field "${fieldId}" (Embed) to "${targetTab}" tab in ${typeId}`);
164
160
 
165
- if (!noTypes) {
166
- try {
167
- await buildTypes({ output: types });
168
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
169
- } catch (error) {
170
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
171
- }
161
+ try {
162
+ await buildTypes({ output: types });
163
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
164
+ } catch (error) {
165
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
172
166
  }
173
167
 
174
168
  console.info();
@@ -19,13 +19,10 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
27
25
  --types string Output file for generated types (default: "prismicio-types.d.ts")
28
- --no-types Skip type generation
29
26
  -h, --help Show help for command
30
27
 
31
28
  EXAMPLES
@@ -45,7 +42,7 @@ const CustomTypeSchema = v.object({
45
42
 
46
43
  export async function customTypeAddFieldGeoPoint(): Promise<void> {
47
44
  const {
48
- values: { help, tab, label, types, "no-types": noTypes },
45
+ values: { help, tab, label, types },
49
46
  positionals: [typeId, fieldId],
50
47
  } = parseArgs({
51
48
  args: process.argv.slice(5), // skip: node, script, "custom-type", "add-field", "geo-point"
@@ -53,7 +50,6 @@ export async function customTypeAddFieldGeoPoint(): Promise<void> {
53
50
  tab: { type: "string", short: "t" },
54
51
  label: { type: "string", short: "l" },
55
52
  types: { type: "string" },
56
- "no-types": { type: "boolean" },
57
53
  help: { type: "boolean", short: "h" },
58
54
  },
59
55
  allowPositionals: true,
@@ -159,13 +155,11 @@ export async function customTypeAddFieldGeoPoint(): Promise<void> {
159
155
 
160
156
  console.info(`Added field "${fieldId}" (GeoPoint) to "${targetTab}" tab in ${typeId}`);
161
157
 
162
- if (!noTypes) {
163
- try {
164
- await buildTypes({ output: types });
165
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
166
- } catch (error) {
167
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
168
- }
158
+ try {
159
+ await buildTypes({ output: types });
160
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
161
+ } catch (error) {
162
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
169
163
  }
170
164
 
171
165
  console.info();
@@ -19,14 +19,11 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
27
25
  -p, --placeholder string Placeholder text
28
26
  --types string Output file for generated types (default: "prismicio-types.d.ts")
29
- --no-types Skip type generation
30
27
  -h, --help Show help for command
31
28
 
32
29
  EXAMPLES
@@ -46,7 +43,7 @@ const CustomTypeSchema = v.object({
46
43
 
47
44
  export async function customTypeAddFieldImage(): Promise<void> {
48
45
  const {
49
- values: { help, tab, label, placeholder, types, "no-types": noTypes },
46
+ values: { help, tab, label, placeholder, types },
50
47
  positionals: [typeId, fieldId],
51
48
  } = parseArgs({
52
49
  args: process.argv.slice(5), // skip: node, script, "custom-type", "add-field", "image"
@@ -55,7 +52,6 @@ export async function customTypeAddFieldImage(): Promise<void> {
55
52
  label: { type: "string", short: "l" },
56
53
  placeholder: { type: "string", short: "p" },
57
54
  types: { type: "string" },
58
- "no-types": { type: "boolean" },
59
55
  help: { type: "boolean", short: "h" },
60
56
  },
61
57
  allowPositionals: true,
@@ -162,13 +158,11 @@ export async function customTypeAddFieldImage(): Promise<void> {
162
158
 
163
159
  console.info(`Added field "${fieldId}" (Image) to "${targetTab}" tab in ${typeId}`);
164
160
 
165
- if (!noTypes) {
166
- try {
167
- await buildTypes({ output: types });
168
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
169
- } catch (error) {
170
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
171
- }
161
+ try {
162
+ await buildTypes({ output: types });
163
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
164
+ } catch (error) {
165
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
172
166
  }
173
167
 
174
168
  console.info();
@@ -19,14 +19,11 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
27
25
  -p, --placeholder string Placeholder text
28
26
  --types string Output file for generated types (default: "prismicio-types.d.ts")
29
- --no-types Skip type generation
30
27
  -h, --help Show help for command
31
28
 
32
29
  EXAMPLES
@@ -46,7 +43,7 @@ const CustomTypeSchema = v.object({
46
43
 
47
44
  export async function customTypeAddFieldKeyText(): Promise<void> {
48
45
  const {
49
- values: { help, tab, label, placeholder, types, "no-types": noTypes },
46
+ values: { help, tab, label, placeholder, types },
50
47
  positionals: [typeId, fieldId],
51
48
  } = parseArgs({
52
49
  args: process.argv.slice(5), // skip: node, script, "custom-type", "add-field", "key-text"
@@ -55,7 +52,6 @@ export async function customTypeAddFieldKeyText(): Promise<void> {
55
52
  label: { type: "string", short: "l" },
56
53
  placeholder: { type: "string", short: "p" },
57
54
  types: { type: "string" },
58
- "no-types": { type: "boolean" },
59
55
  help: { type: "boolean", short: "h" },
60
56
  },
61
57
  allowPositionals: true,
@@ -162,13 +158,11 @@ export async function customTypeAddFieldKeyText(): Promise<void> {
162
158
 
163
159
  console.info(`Added field "${fieldId}" (Text) to "${targetTab}" tab in ${typeId}`);
164
160
 
165
- if (!noTypes) {
166
- try {
167
- await buildTypes({ output: types });
168
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
169
- } catch (error) {
170
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
171
- }
161
+ try {
162
+ await buildTypes({ output: types });
163
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
164
+ } catch (error) {
165
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
172
166
  }
173
167
 
174
168
  console.info();
@@ -19,8 +19,6 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
@@ -30,7 +28,6 @@ FLAGS
30
28
  --allow-target-blank Allow opening link in new tab
31
29
  --repeatable Allow multiple links
32
30
  --types string Output file for generated types (default: "prismicio-types.d.ts")
33
- --no-types Skip type generation
34
31
  -h, --help Show help for command
35
32
 
36
33
  EXAMPLES
@@ -61,7 +58,6 @@ export async function customTypeAddFieldLink(): Promise<void> {
61
58
  "allow-target-blank": allowTargetBlank,
62
59
  repeatable,
63
60
  types,
64
- "no-types": noTypes,
65
61
  },
66
62
  positionals: [typeId, fieldId],
67
63
  } = parseArgs({
@@ -75,7 +71,6 @@ export async function customTypeAddFieldLink(): Promise<void> {
75
71
  "allow-target-blank": { type: "boolean" },
76
72
  repeatable: { type: "boolean" },
77
73
  types: { type: "string" },
78
- "no-types": { type: "boolean" },
79
74
  help: { type: "boolean", short: "h" },
80
75
  },
81
76
  allowPositionals: true,
@@ -186,13 +181,11 @@ export async function customTypeAddFieldLink(): Promise<void> {
186
181
 
187
182
  console.info(`Added field "${fieldId}" (Link) to "${targetTab}" tab in ${typeId}`);
188
183
 
189
- if (!noTypes) {
190
- try {
191
- await buildTypes({ output: types });
192
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
193
- } catch (error) {
194
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
195
- }
184
+ try {
185
+ await buildTypes({ output: types });
186
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
187
+ } catch (error) {
188
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
196
189
  }
197
190
 
198
191
  console.info();
@@ -19,8 +19,6 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
@@ -29,7 +27,6 @@ FLAGS
29
27
  --max number Maximum value
30
28
  --step number Step increment
31
29
  --types string Output file for generated types (default: "prismicio-types.d.ts")
32
- --no-types Skip type generation
33
30
  -h, --help Show help for command
34
31
 
35
32
  EXAMPLES
@@ -49,7 +46,7 @@ const CustomTypeSchema = v.object({
49
46
 
50
47
  export async function customTypeAddFieldNumber(): Promise<void> {
51
48
  const {
52
- values: { help, tab, label, placeholder, min, max, step, types, "no-types": noTypes },
49
+ values: { help, tab, label, placeholder, min, max, step, types },
53
50
  positionals: [typeId, fieldId],
54
51
  } = parseArgs({
55
52
  args: process.argv.slice(5), // skip: node, script, "custom-type", "add-field", "number"
@@ -61,7 +58,6 @@ export async function customTypeAddFieldNumber(): Promise<void> {
61
58
  max: { type: "string" },
62
59
  step: { type: "string" },
63
60
  types: { type: "string" },
64
- "no-types": { type: "boolean" },
65
61
  help: { type: "boolean", short: "h" },
66
62
  },
67
63
  allowPositionals: true,
@@ -194,13 +190,11 @@ export async function customTypeAddFieldNumber(): Promise<void> {
194
190
 
195
191
  console.info(`Added field "${fieldId}" (Number) to "${targetTab}" tab in ${typeId}`);
196
192
 
197
- if (!noTypes) {
198
- try {
199
- await buildTypes({ output: types });
200
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
201
- } catch (error) {
202
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
203
- }
193
+ try {
194
+ await buildTypes({ output: types });
195
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
196
+ } catch (error) {
197
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
204
198
  }
205
199
 
206
200
  console.info();
@@ -19,8 +19,6 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
@@ -29,7 +27,6 @@ FLAGS
29
27
  --multi string Allowed block types for multi-line (comma-separated)
30
28
  --allow-target-blank Allow opening links in new tab
31
29
  --types string Output file for generated types (default: "prismicio-types.d.ts")
32
- --no-types Skip type generation
33
30
  -h, --help Show help for command
34
31
 
35
32
  BLOCK TYPES
@@ -64,7 +61,6 @@ export async function customTypeAddFieldRichText(): Promise<void> {
64
61
  multi,
65
62
  "allow-target-blank": allowTargetBlank,
66
63
  types,
67
- "no-types": noTypes,
68
64
  },
69
65
  positionals: [typeId, fieldId],
70
66
  } = parseArgs({
@@ -77,7 +73,6 @@ export async function customTypeAddFieldRichText(): Promise<void> {
77
73
  multi: { type: "string" },
78
74
  "allow-target-blank": { type: "boolean" },
79
75
  types: { type: "string" },
80
- "no-types": { type: "boolean" },
81
76
  help: { type: "boolean", short: "h" },
82
77
  },
83
78
  allowPositionals: true,
@@ -187,13 +182,11 @@ export async function customTypeAddFieldRichText(): Promise<void> {
187
182
 
188
183
  console.info(`Added field "${fieldId}" (StructuredText) to "${targetTab}" tab in ${typeId}`);
189
184
 
190
- if (!noTypes) {
191
- try {
192
- await buildTypes({ output: types });
193
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
194
- } catch (error) {
195
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
196
- }
185
+ try {
186
+ await buildTypes({ output: types });
187
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
188
+ } catch (error) {
189
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
197
190
  }
198
191
 
199
192
  console.info();
@@ -19,8 +19,6 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
@@ -28,7 +26,6 @@ FLAGS
28
26
  --option string Add an option (can be used multiple times)
29
27
  --default string Default selected value
30
28
  --types string Output file for generated types (default: "prismicio-types.d.ts")
31
- --no-types Skip type generation
32
29
  -h, --help Show help for command
33
30
 
34
31
  EXAMPLES
@@ -56,7 +53,6 @@ export async function customTypeAddFieldSelect(): Promise<void> {
56
53
  option,
57
54
  default: defaultValue,
58
55
  types,
59
- "no-types": noTypes,
60
56
  },
61
57
  positionals: [typeId, fieldId],
62
58
  } = parseArgs({
@@ -68,7 +64,6 @@ export async function customTypeAddFieldSelect(): Promise<void> {
68
64
  option: { type: "string", multiple: true },
69
65
  default: { type: "string" },
70
66
  types: { type: "string" },
71
- "no-types": { type: "boolean" },
72
67
  help: { type: "boolean", short: "h" },
73
68
  },
74
69
  allowPositionals: true,
@@ -177,13 +172,11 @@ export async function customTypeAddFieldSelect(): Promise<void> {
177
172
 
178
173
  console.info(`Added field "${fieldId}" (Select) to "${targetTab}" tab in ${typeId}`);
179
174
 
180
- if (!noTypes) {
181
- try {
182
- await buildTypes({ output: types });
183
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
184
- } catch (error) {
185
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
186
- }
175
+ try {
176
+ await buildTypes({ output: types });
177
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
178
+ } catch (error) {
179
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
187
180
  }
188
181
 
189
182
  console.info();
@@ -19,15 +19,12 @@ ARGUMENTS
19
19
  type-id Custom type identifier (required)
20
20
  field-id Field identifier (required)
21
21
 
22
- Types are generated by default after changes. Use --no-types to skip.
23
-
24
22
  FLAGS
25
23
  -t, --tab string Target tab (default: first existing tab, or "Main")
26
24
  -l, --label string Display label for the field (inferred from field-id if omitted)
27
25
  -p, --placeholder string Placeholder text
28
26
  --default string Default timestamp value (ISO 8601 format)
29
27
  --types string Output file for generated types (default: "prismicio-types.d.ts")
30
- --no-types Skip type generation
31
28
  -h, --help Show help for command
32
29
 
33
30
  EXAMPLES
@@ -47,7 +44,7 @@ const CustomTypeSchema = v.object({
47
44
 
48
45
  export async function customTypeAddFieldTimestamp(): Promise<void> {
49
46
  const {
50
- values: { help, tab, label, placeholder, default: defaultValue, types, "no-types": noTypes },
47
+ values: { help, tab, label, placeholder, default: defaultValue, types },
51
48
  positionals: [typeId, fieldId],
52
49
  } = parseArgs({
53
50
  args: process.argv.slice(5), // skip: node, script, "custom-type", "add-field", "timestamp"
@@ -57,7 +54,6 @@ export async function customTypeAddFieldTimestamp(): Promise<void> {
57
54
  placeholder: { type: "string", short: "p" },
58
55
  default: { type: "string" },
59
56
  types: { type: "string" },
60
- "no-types": { type: "boolean" },
61
57
  help: { type: "boolean", short: "h" },
62
58
  },
63
59
  allowPositionals: true,
@@ -165,13 +161,11 @@ export async function customTypeAddFieldTimestamp(): Promise<void> {
165
161
 
166
162
  console.info(`Added field "${fieldId}" (Timestamp) to "${targetTab}" tab in ${typeId}`);
167
163
 
168
- if (!noTypes) {
169
- try {
170
- await buildTypes({ output: types });
171
- console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
172
- } catch (error) {
173
- console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
174
- }
164
+ try {
165
+ await buildTypes({ output: types });
166
+ console.info(`Updated types in ${types ?? "prismicio-types.d.ts"}`);
167
+ } catch (error) {
168
+ console.warn(`Could not generate types: ${error instanceof Error ? error.message : error}`);
175
169
  }
176
170
 
177
171
  console.info();