You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0a7b9b5
Browse filesBrowse the repository at this point in the historyBrowse files
fix(zero-swift): name codegen options in kebab-case so help examples print as typed (#21)
incur prints example option keys as-is, so camelCase keys printed
--schemaFile. The schema keys are now schema-file, schema-name and
type-prefix; legacyArgv still maps the camelCase spellings.
Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859
Co-authored-by: Amp <amp@ampcode.com>
`codegen`'s options are named `schema-file`, `schema-name`, and `type-prefix` in its JSON Schema (`--schema`), so its help prints the "Generate without a config file" example again, with `--schema-file` as it is typed. `--schemaFile`, `--schemaName`, and `--typePrefix` still work.
"Generate the Swift row types, schema, and query builder from the app's TypeScript schema. Options override zero-swift.json, which is read when present. See swift/Sources/Zero/Zero.docc/GettingStarted.md in github.com/wevm/zero.",
155
164
options: z.object({
156
-
config: z
165
+
'config': z
157
166
.string()
158
167
.optional()
159
168
.describe('Config file (default zero-swift.json, when present)'),
.describe('Export of the module that holds the schema (default schema)'),
168
-
out: z
177
+
'out': z
169
178
.string()
170
179
.optional()
171
180
.describe('Swift file to write (default Schema.swift)'),
172
-
schemaName: z
181
+
'schema-name': z
173
182
.string()
174
183
.optional()
175
184
.describe('Name of the generated ZeroSchema static (default app)'),
176
-
zql: z
185
+
'zql': z
177
186
.string()
178
187
.optional()
179
188
.describe('Name of the generated query builder global (default zql)'),
180
-
typePrefix: z
189
+
'type-prefix': z
181
190
.string()
182
191
.optional()
183
192
.describe('Prefix for every generated type name (default none)'),
184
-
access: z
193
+
'access': z
185
194
.enum(['public','internal'])
186
195
.optional()
187
196
.describe('Access level of the generated code (default public)'),
188
197
check,
189
198
}),
190
-
// incur 0.7.1 prints example options as `--camelKey value`, so the hint
191
-
// shows `--schema-file` and a bare `--check` instead.
192
-
examples: [{description: 'Generate from zero-swift.json'}],
193
-
hint: 'Without a config file: zero-swift codegen --schema-file shared/schema.ts --out Sources/App/Schema.swift. In CI, zero-swift codegen --check fails when the output is stale.',
199
+
// incur 0.7.1 prints a boolean example option as `--check true`, so the
200
+
// hint shows a bare `--check` instead.
201
+
examples: [
202
+
{description: 'Generate from zero-swift.json'},
203
+
{
204
+
options: {
205
+
'schema-file': 'shared/schema.ts',
206
+
'out': 'Sources/App/Schema.swift',
207
+
},
208
+
description: 'Generate without a config file',
209
+
},
210
+
],
211
+
hint: 'In CI, zero-swift codegen --check fails when the output is stale.',
0 commit comments