@omnifyjp/ts 8.1.0 → 8.1.1

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/dist/cli.js +18 -0
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -126,6 +126,11 @@ program
126
126
  .option('-i, --input <spec>', 'schemas.json source: local path, http(s) URL, or npm package spec (overrides config)')
127
127
  .option('-o, --output <path>', 'Output directory for TypeScript (overrides config)')
128
128
  .option('--force', 'Force regeneration of auto-generated files', false)
129
+ .option('--platform <platform>', 'TypeScript target platform with --input/--output: web | expo')
130
+ .option('--auth <auth>', 'Auth strategy with --input/--output: cookie | secureStore')
131
+ .option('--enum-style <style>', 'Enum emission style with --input/--output: enum | const')
132
+ .option('--toast-import <module>', 'Module the generated hooks import `toast` from (default "sonner")')
133
+ .option('--no-hooks', 'Skip generating {Entity}Hooks.ts')
129
134
  .option('--frozen-lockfile', 'Fail if remote input differs from .omnify/input.lock.json (CI mode)', false)
130
135
  .option('--update', 'Force re-fetch of remote input and refresh the lockfile', false)
131
136
  .action(async (opts) => {
@@ -144,6 +149,19 @@ program
144
149
  // passed through unchanged so URLs/npm specs work too.
145
150
  inputSpec = opts.input;
146
151
  tsOutput = resolve(opts.output);
152
+ // The workspace dispatcher calls this mode once per TypeScript target
153
+ // and has no config file to point at, so the target's options arrive
154
+ // as flags. Before these flags existed every workspace target silently
155
+ // generated with the web/cookie/enum/"sonner" defaults.
156
+ tsPlatform = opts.platform;
157
+ tsAuth = opts.auth;
158
+ tsEnumStyle = opts.enumStyle;
159
+ if (opts.toastImport !== undefined || opts.hooks === false) {
160
+ tsHooks = {
161
+ ...(opts.hooks === false ? { enable: false } : {}),
162
+ ...(opts.toastImport !== undefined ? { toastImport: opts.toastImport } : {}),
163
+ };
164
+ }
147
165
  }
148
166
  else {
149
167
  // Read from omnify.yaml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnifyjp/ts",
3
- "version": "8.1.0",
3
+ "version": "8.1.1",
4
4
  "description": "TypeScript model type generator from Omnify schemas.json",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",