@omnifyjp/ts 8.1.0 → 8.1.2
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/dist/cli.js +18 -0
- package/dist/rn-query-setup-generator.js +5 -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
|
|
@@ -116,9 +116,12 @@ export function setupFocusManager(): () => void {
|
|
|
116
116
|
/**
|
|
117
117
|
* Call once at app startup to wire NetInfo → TanStack Query onlineManager.
|
|
118
118
|
* Queries pause when the device loses connectivity and resume when it's back.
|
|
119
|
+
*
|
|
120
|
+
* Returns nothing: TanStack Query v5's \`setEventListener\` is void and owns
|
|
121
|
+
* the unsubscribe itself (issue #331).
|
|
119
122
|
*/
|
|
120
|
-
export function setupOnlineManager():
|
|
121
|
-
|
|
123
|
+
export function setupOnlineManager(): void {
|
|
124
|
+
onlineManager.setEventListener((setOnline) => {
|
|
122
125
|
return NetInfo.addEventListener((state) => {
|
|
123
126
|
setOnline(!!state.isConnected);
|
|
124
127
|
});
|