@tamagui/cli 2.7.7 → 3.0.0-beta.1097.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 (46) hide show
  1. package/dist/add.cjs +76 -87
  2. package/dist/build.cjs +425 -278
  3. package/dist/cli.cjs +361 -340
  4. package/dist/generate-prompt.cjs +484 -362
  5. package/dist/generate.cjs +45 -54
  6. package/dist/index.cjs +1 -1
  7. package/dist/migrate.cjs +437 -0
  8. package/dist/setup-prompt.cjs +216 -0
  9. package/dist/to-tailwind-default-config.cjs +789 -0
  10. package/dist/to-tailwind.cjs +213 -0
  11. package/dist/update-template.cjs +43 -52
  12. package/dist/update.cjs +14 -18
  13. package/dist/upgrade.cjs +417 -401
  14. package/dist/utils.cjs +84 -101
  15. package/metro.cjs +1 -0
  16. package/metro.d.ts +1 -0
  17. package/metro.mjs +1 -0
  18. package/package.json +43 -13
  19. package/src/build.ts +594 -362
  20. package/src/cli.ts +113 -12
  21. package/src/generate-prompt.ts +428 -329
  22. package/src/migrate.ts +422 -0
  23. package/src/setup-prompt.ts +192 -0
  24. package/src/to-tailwind-default-config.ts +767 -0
  25. package/src/to-tailwind.ts +313 -0
  26. package/src/upgrade.ts +30 -33
  27. package/src/utils.ts +11 -9
  28. package/types/add.d.ts +1 -1
  29. package/types/add.d.ts.map +1 -1
  30. package/types/build.d.ts +2 -1
  31. package/types/build.d.ts.map +1 -1
  32. package/types/generate-prompt.d.ts +6 -2
  33. package/types/generate-prompt.d.ts.map +1 -1
  34. package/types/migrate.d.ts +7 -0
  35. package/types/migrate.d.ts.map +1 -0
  36. package/types/setup-prompt.d.ts +5 -0
  37. package/types/setup-prompt.d.ts.map +1 -0
  38. package/types/to-tailwind-default-config.d.ts +53 -0
  39. package/types/to-tailwind-default-config.d.ts.map +1 -0
  40. package/types/to-tailwind.d.ts +16 -0
  41. package/types/to-tailwind.d.ts.map +1 -0
  42. package/types/upgrade.d.ts.map +1 -1
  43. package/types/utils.d.ts.map +1 -1
  44. package/vite.cjs +1 -0
  45. package/vite.d.ts +1 -0
  46. package/vite.mjs +1 -0
package/dist/generate.cjs CHANGED
@@ -6,71 +6,62 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __export = (target, all) => {
9
- for (var name in all) __defProp(target, name, {
10
- get: all[name],
11
- enumerable: true
12
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
13
  };
14
14
  var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") {
16
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: () => from[key],
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
- });
20
- }
21
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
22
  };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
- value: mod,
30
- enumerable: true
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
31
26
  }) : target, mod));
32
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
33
- value: true
34
- }), mod);
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
28
  var generate_exports = {};
36
29
  __export(generate_exports, {
37
- generateTypes: () => generateTypes,
38
- getTypes: () => getTypes
30
+ generateTypes: () => generateTypes,
31
+ getTypes: () => getTypes
39
32
  });
40
33
  module.exports = __toCommonJS(generate_exports);
41
34
  var import_fs_extra = __toESM(require("fs-extra"));
42
35
  var import_ts_morph = require("ts-morph");
43
36
  var import_utils = require("./utils.cjs");
44
37
  async function generateTypes(options) {
45
- const types = await getTypes(options);
46
- await import_fs_extra.default.writeJSON(options.paths.types, types, {
47
- spaces: 2
48
- });
38
+ const types = await getTypes(options);
39
+ await import_fs_extra.default.writeJSON(options.paths.types, types, { spaces: 2 });
49
40
  }
50
41
  async function getTypes(options) {
51
- const tamagui = await (0, import_utils.loadTamagui)(options.tamaguiOptions);
52
- if (!tamagui) {
53
- throw new Error(`No tamagui config`);
54
- }
55
- const nameToPaths = tamagui.nameToPaths || [];
56
- const uniqueViewExportingPaths = new Set(Object.keys(nameToPaths).map(name => {
57
- return `${[...nameToPaths[name]][0]}.ts*`;
58
- }));
59
- const project = new import_ts_morph.Project({
60
- compilerOptions: {
61
- noEmit: false,
62
- declaration: true,
63
- emitDeclarationOnly: true
64
- },
65
- skipAddingFilesFromTsConfig: true,
66
- tsConfigFilePath: options.tsconfigPath
67
- });
68
- const files = project.addSourceFilesAtPaths([...uniqueViewExportingPaths]);
69
- return Object.fromEntries(files.flatMap(x => {
70
- return [...x.getExportedDeclarations()].map(([k, v]) => {
71
- return [k, v[0].getType().getApparentType().getProperties().map(prop => {
72
- return [prop.getEscapedName(), prop.getValueDeclaration()?.getType().getText()];
73
- })];
74
- });
75
- }));
76
- }
42
+ const tamagui = await (0, import_utils.loadTamagui)(options.tamaguiOptions);
43
+ if (!tamagui) {
44
+ throw new Error(`No tamagui config`);
45
+ }
46
+ const nameToPaths = tamagui.nameToPaths || [];
47
+ const uniqueViewExportingPaths = new Set(Object.keys(nameToPaths).map((name) => {
48
+ return `${[...nameToPaths[name]][0]}.ts*`;
49
+ }));
50
+ const project = new import_ts_morph.Project({
51
+ compilerOptions: {
52
+ noEmit: false,
53
+ declaration: true,
54
+ emitDeclarationOnly: true
55
+ },
56
+ skipAddingFilesFromTsConfig: true,
57
+ tsConfigFilePath: options.tsconfigPath
58
+ });
59
+ const files = project.addSourceFilesAtPaths([...uniqueViewExportingPaths]);
60
+ return Object.fromEntries(files.flatMap((x) => {
61
+ return [...x.getExportedDeclarations()].map(([k, v]) => {
62
+ return [k, v[0].getType().getApparentType().getProperties().map((prop) => {
63
+ return [prop.getEscapedName(), prop.getValueDeclaration()?.getType().getText()];
64
+ })];
65
+ });
66
+ }));
67
+ }
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- require("./cli.cjs");
2
+ require("./cli.cjs");
@@ -0,0 +1,437 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var migrate_exports = {};
22
+ __export(migrate_exports, {
23
+ getMigrationPrompt: () => getMigrationPrompt,
24
+ printMigrationPrompt: () => printMigrationPrompt
25
+ });
26
+ module.exports = __toCommonJS(migrate_exports);
27
+ function printMigrationPrompt({ from }) {
28
+ process.stdout.write(getMigrationPrompt({ from }));
29
+ }
30
+ function getMigrationPrompt({ from } = {}) {
31
+ const source = normalizeFrom(from);
32
+ if (source === "v1") {
33
+ return `${promptHeader("v1", "v3")}
34
+
35
+ ${v1ToV2Prompt}
36
+
37
+ After the v1 to v2 pass is complete, apply the v2 to v3 pass below.
38
+
39
+ ${v2ToV3Prompt}
40
+ `;
41
+ }
42
+ return `${promptHeader("v2", "v3")}
43
+
44
+ ${v2ToV3Prompt}
45
+ `;
46
+ }
47
+ function normalizeFrom(from) {
48
+ const value = (from || "v2").toLowerCase().replace(/^from-?/, "");
49
+ if (value === "1" || value === "v1") return "v1";
50
+ if (value === "2" || value === "v2") return "v2";
51
+ throw new Error("Usage: tamagui migrate --from v2 | --from v1");
52
+ }
53
+ function promptHeader(from, to) {
54
+ return `You are migrating a Tamagui app from ${from} to ${to}.
55
+
56
+ Work like a careful coding agent:
57
+
58
+ - Read the app's Tamagui config, package manager, bundler, and component usage before editing.
59
+ - Keep changes scoped to the migration.
60
+ - Run the codemods listed below, then review the diff by hand.
61
+ - Do not publish packages, rotate secrets, or change production infrastructure.
62
+ - Validate with typecheck/build and at least one real app run or browser/native smoke test.
63
+ - Report any behavior that cannot be migrated mechanically.`;
64
+ }
65
+ const v2ToV3Prompt = `## v2 -> v3 migration prompt
66
+
67
+ ### 0. Choose the intermediate checkpoint before editing
68
+
69
+ The Tamagui package version and the config version are separate. Tamagui V3
70
+ supports Config v5; upgrading the runtime does not require Config v6.
71
+
72
+ - Coming from V2: first reach V3 packages and APIs with the app's existing token, theme, font, media, and animation values. Keep custom config values. If an old config entry is no longer exported, preserve its resolved values in an app-owned config; do not substitute v6 defaults.
73
+ - Coming from Config v5 or v5-subtle: keep that config during the V3 API upgrade. Keep the 12-step adaptive colors, spacing, radii, font scales, and breakpoint meanings. Do not remap them to the v6 scale.
74
+ - Already running V3 with Config v5: this intermediate checkpoint is valid. Inventory remaining V2 APIs before applying codemods; do not repeat completed work or treat Config v5 as an upgrade failure.
75
+ - Do not combine this pass with wholesale \`html.*\` adoption, Tailwind conversion, new skins, or a theme redesign unless separately requested.
76
+
77
+ Record the starting package/config versions and representative light/dark,
78
+ responsive, and native screenshots. Name the intended checkpoint in the plan:
79
+ "V3 API, existing design values." Visual changes during this pass need an
80
+ explanation or a fix, not automatic screenshot acceptance.
81
+
82
+ The checkpoint is complete when the required API migration, report review,
83
+ typecheck/build, and real app checks in step 15 pass. Leave Config v6 and other
84
+ optional design changes in a separate follow-up; do not start them just because
85
+ the V3 API work is finished.
86
+
87
+ ### 1. Update dependencies
88
+
89
+ - Bump every \`tamagui\` and \`@tamagui/*\` package together to v3.
90
+ - Keep \`@tamagui/core\`, \`@tamagui/web\`, and \`tamagui\` deduped in the lockfile.
91
+ - Run:
92
+
93
+ \`\`\`bash
94
+ npx tamagui check
95
+ \`\`\`
96
+
97
+ ### 2. Migrate tokens and conditional styles
98
+
99
+ V3 accepts bare token/theme names and flat clauses only. Run the transactional
100
+ flat-values codemod from your project root, dry run first:
101
+
102
+ \`\`\`bash
103
+ npx @tamagui/codemod-flat-values --report flat-values-report.md ./src
104
+ npx @tamagui/codemod-flat-values --write \\
105
+ --report flat-values-report.md \\
106
+ --json flat-values-report.json \\
107
+ ./src
108
+ \`\`\`
109
+
110
+ For example, this V2 input:
111
+
112
+ \`\`\`tsx
113
+ <View bg="$background" hoverStyle={{ bg: '$backgroundHover' }} $sm={{ p: '$6' }} p="$4" />
114
+ \`\`\`
115
+
116
+ becomes:
117
+
118
+ \`\`\`tsx
119
+ <View bg="background hover:background-hover" p="4 sm:6" />
120
+ \`\`\`
121
+
122
+ Resolve every report row and rerun until the app has no V2 authoring. Do not
123
+ add a compatibility setting or restore condition-object parsing.
124
+
125
+ ### 3. Preserve config values while migrating required APIs
126
+
127
+ - Existing Config v5 applications should keep \`@tamagui/config/v5\` or \`/v5-subtle\` while migrating incrementally. These are frozen static compatibility packs, so they preserve the V5 token and theme values but will not receive new theme-builder features.
128
+ - Import animations from \`@tamagui/config/animations-css\`, \`animations-rn\`, \`animations-reanimated\`, or \`animations-motion\`.
129
+ - Apps using Sheet or animated-number hooks with the CSS driver must import \`createAnimations\` from \`@tamagui/animations-css/extras\`. The root entry omits those hooks.
130
+ - Remove \`@tamagui/theme-builder\` and V5 builder imports from packages that no longer export them. Static \`@tamagui/themes/v5\`, \`/v5-subtle\`, and \`/v5-tokens\` imports remain supported.
131
+ - An app that GENERATES its v5 themes (\`createV5Theme\`, \`subtleChildrenThemes\`, \`createPalettes\`) has two ways to stay on v5 for this migration: run the builder once and serialize the result to a static literal, or import the same builders from \`@tamagui/config-v5\` (and \`@tamagui/config-v5/builder\`), the opt-in package that carries them. Take one of those when the themes are built from values the app only knows at runtime; the optional v6 recipe move in the appendix is a separate migration.
132
+ - Component names no longer select uppercase theme segments automatically. Replace component themes with explicit normal theme or \`level2\` boundaries in component skins.
133
+
134
+ Do not apply the v6 color remap or recipe conversion in the optional appendix
135
+ while keeping Config v5. Reserved API/theme-key spelling changes still apply;
136
+ preserve the resolved values behind the renamed keys.
137
+
138
+ ### 4. Migrate Sheet anatomy
139
+
140
+ The flat-values codemod from step 2 rewrites every provable \`Sheet.Frame\` to
141
+ \`Sheet.Container\` with a \`Sheet.Background\` first child carrying the surface
142
+ props, and reports spreads and \`styled(Sheet.Frame, \u2026)\` targets for review.
143
+ Check each rewritten callsite against these rules:
144
+
145
+ - Replace \`Sheet.Frame\` with \`Sheet.Container\` plus \`Sheet.Background\`.
146
+ - Keep layout props such as \`padding\`, \`gap\`, \`height\`, \`maxHeight\`, and flex props on \`Sheet.Container\`.
147
+ - Move visual surface props such as \`bg\`, \`borderRadius\`, \`elevation\`, and \`shadow*\` to \`Sheet.Background\`.
148
+ - Keep \`Sheet.Overlay\` as a direct child of \`Sheet\`.
149
+ - Add explicit clipping if old \`Sheet.Frame\` overflow clipping mattered.
150
+ - \`disableHideBottomOverflow\` belongs on \`Sheet.Background\`.
151
+
152
+ Before:
153
+
154
+ \`\`\`tsx
155
+ <Sheet>
156
+ <Sheet.Overlay />
157
+ <Sheet.Frame padding="$4" bg="$background" borderTopRadius="$6">
158
+ <Sheet.ScrollView>{children}</Sheet.ScrollView>
159
+ </Sheet.Frame>
160
+ </Sheet>
161
+ \`\`\`
162
+
163
+ After:
164
+
165
+ \`\`\`tsx
166
+ <Sheet>
167
+ <Sheet.Overlay />
168
+ <Sheet.Container padding="4">
169
+ <Sheet.Background bg="background" borderTopRadius="6" />
170
+ <Sheet.ScrollView>{children}</Sheet.ScrollView>
171
+ </Sheet.Container>
172
+ </Sheet>
173
+ \`\`\`
174
+
175
+ ### 5. Remove deprecated v2 APIs
176
+
177
+ Search:
178
+
179
+ \`\`\`bash
180
+ rg "focusable|fullscreen|themeInverse|<Theme inverse|Sheet\\.Frame|styleable\\(|inlineWhenUnflattened|\\$true|getTokenRelative|stepTokenUpOrDown|forceRemoveScrollEnabled|sizeAdjust|getExpandedShorthands|usePropsAndStyle|useProps|useStyle"
181
+ \`\`\`
182
+
183
+ Replace:
184
+
185
+ - \`focusable\` -> \`tabIndex\`.
186
+ - \`fullscreen\` -> explicit \`position\` and \`inset\` props.
187
+ - \`themeInverse\` -> \`theme="inverse"\`.
188
+ - \`<Theme inverse>\` -> \`<Theme name="inverse">\`.
189
+ - \`Sheet.Frame\` -> \`Sheet.Container\` plus \`Sheet.Background\`.
190
+ - \`Component.styleable(fn)\` -> \`createStyledHOC(Component, fn)\` (same behavior, standalone function).
191
+ - forwardRef wrapper statics -> direct refs and normal composition.
192
+ - \`inlineWhenUnflattened\` -> remove it.
193
+ - deprecated UI kit aliases -> current component names.
194
+ - old platform style keys -> flat \`web:\`, \`native:\`, \`ios:\`, and \`android:\` clauses.
195
+ - \`forceRemoveScrollEnabled\` -> \`disableRemoveScroll\` with inverted intent.
196
+ - \`createCheckbox\` \`sizeAdjust\` -> explicit sizing math or component styles.
197
+ - \`getExpandedShorthands\` -> \`getExpandedShorthand(key, props)\` when behavior code needs one authored prop and must accept its configured shorthand.
198
+ - \`useProps\`, \`useStyle\`, and \`usePropsAndStyle\` -> keep conditional values on styled Tamagui components; use \`splitStyleProps\` only when a wrapper must partition authored props.
199
+
200
+ V2 could spread one style across its base prop, pseudo-style objects, media
201
+ objects, and platform objects. The removed hooks gathered those separate
202
+ objects into resolved props and styles. V3 keeps every base and conditional
203
+ clause for a style on that style's single property, for example
204
+ \`opacity="1 hover:0.7 sm:0.8"\`. The styled component interprets that value,
205
+ so a wrapper should pass it through instead of flattening the component's
206
+ styles in JavaScript.
207
+
208
+ \`splitStyleProps(props)\` returns \`[styleProps, regularProps]\` in one pass.
209
+ Pass \`{ expandShorthands: true }\` to canonicalize selected keys. Its optional
210
+ filter map selects only those canonical keys, leaving rejected style props in
211
+ the second object. The filter may instead be a callback receiving
212
+ \`(key, value, originalKey, isStyleProp)\`.
213
+
214
+ \`getExpandedShorthand(key, props)\` only chooses the longhand or configured
215
+ shorthand for one property. It does not resolve tokens or select the active
216
+ clause. Neither does \`splitStyleProps\`. Use \`useMedia()\` or \`useTheme()\`
217
+ when behavior itself needs active responsive or theme state.
218
+
219
+ ### 6. Replace true tokens
220
+
221
+ - Default v3 configs no longer export the legacy \`$true\` token key.
222
+ - The codemod writes \`$true\` on style props as \`4\` and reports a \`legacy-true-token\` warning; confirm the app's config aliased it there.
223
+ - On \`size\`, \`elevation\`, and \`iconSize\` it writes the boolean \`true\`, which resolves to the component default size.
224
+ - Token definitions and custom variants are not edited; search them for the alias by hand.
225
+ - Do not change unrelated boolean props or boolean variant values.
226
+
227
+ ### 7. Replace token stepping
228
+
229
+ Removed from \`@tamagui/get-token\`:
230
+
231
+ - \`stepTokenUpOrDown\`
232
+ - \`getTokenRelative\`
233
+ - the second options argument to \`getSize\`, \`getSpace\`, and \`getRadius\`
234
+ - \`shift\`, \`bounds\`, and \`excludeHalfSteps\`
235
+
236
+ Before:
237
+
238
+ \`\`\`tsx
239
+ const padding = getSize(size, { shift: -2 })
240
+ \`\`\`
241
+
242
+ After:
243
+
244
+ \`\`\`tsx
245
+ const padding = getVariableValue(getSize(size)) * 0.6
246
+ \`\`\`
247
+
248
+ Use explicit token keys when you need a named smaller or larger token. Use numeric multiplication when proportional sizing is intended.
249
+
250
+ ### 8. Audit font size values
251
+
252
+ - \`fontSize={17}\` is a raw numeric platform value and keeps platform-default line-height behavior.
253
+ - \`fontSize="17px"\` is an exact pixel value.
254
+ - Configured font \`size\` and \`lineHeight\` tokens should use px strings when exact web pixels are intended.
255
+ - Convert custom config font tokens to px strings if exact pixels were intended.
256
+
257
+ ### 9. Update FocusScope
258
+
259
+ - Function-as-children is removed. Pass JSX children directly.
260
+ - FocusScope renders a \`display: contents\` wrapper.
261
+ - Use \`noFocus\` for zero-focus mode when focus should be rejected entirely.
262
+
263
+ Before:
264
+
265
+ \`\`\`tsx
266
+ <FocusScope loop>
267
+ {({ ref, onKeyDown, tabIndex }) => (
268
+ <View ref={ref} onKeyDown={onKeyDown} tabIndex={tabIndex} />
269
+ )}
270
+ </FocusScope>
271
+ \`\`\`
272
+
273
+ After:
274
+
275
+ \`\`\`tsx
276
+ <FocusScope loop>
277
+ <View />
278
+ </FocusScope>
279
+ \`\`\`
280
+
281
+ ### 10. Update Dialog, Popover, Select, and Adapt flows
282
+
283
+ - Dialog, Popover, and Select use one Adapt handoff model.
284
+ - Adapted Sheet content stays mounted through the sheet slide-out.
285
+ - Parts own their presence animation lifecycles.
286
+ - The \`onDidAnimate\` prop is replaced by the typed \`onTransition\` lifecycle: \`onTransition={(e) => e.phase === 'end' && e.cause === 'enter' && done()}\`.
287
+ - \`Popover.Content forceMount\` now matches Dialog semantics.
288
+ - \`Dialog.Content\` no longer accepts the old no-op \`size\` variant.
289
+ - Non-modal Dialog content no longer enables RemoveScroll while open.
290
+ - Remove internal imports such as \`useShowPopoverSheet\`, \`PopoverAdaptHiddenContext\`, or \`useSelectBreakpointActive\` if the app used them.
291
+
292
+ ### 11. Update Select
293
+
294
+ - Keep \`name\` when Select participates in a form. Remove the unsupported \`autoComplete\` prop.
295
+ - Use \`Select.Separator\` for visual grouping.
296
+ - \`Select.Content\` accepts \`onEscapeKeyDown\` and \`onInteractOutside\`.
297
+ - \`Select.Trigger\` and web \`Select.Viewport\` expose \`data-state="open" | "closed"\`.
298
+
299
+ ### 12. Update themed icons
300
+
301
+ - \`<Icon size="4" />\` now resolves through the current font's \`font.size['4']\` scale.
302
+ - Raw numeric icon sizes are unchanged.
303
+ - Themed icons no longer accept Tamagui media or pseudo props directly.
304
+ - Wrap icons in a styled \`View\` for media and state clauses.
305
+
306
+ ### 13. Check ScrollView web usage
307
+
308
+ \`@tamagui/scroll-view\` now has its own web implementation. It supports \`scrollTo\`, \`scrollToEnd\`, \`getScrollableNode\`, RN-shaped \`onScroll\`, \`contentContainerStyle\`, \`horizontal\`, and indicator props.
309
+
310
+ Replace unsupported old web/lite usage such as momentum events, \`snapTo*\`, and \`keyboardDismissMode\`.
311
+
312
+ ### 14. Optional Tailwind frontend
313
+
314
+ Skip this in the intermediate V3 API checkpoint unless Tailwind adoption was
315
+ separately requested. It does not require changing the whole app to Config v6.
316
+
317
+ Tailwind authoring is selected by the component package, with no global config:
318
+
319
+ \`\`\`tsx
320
+ import { View, Text, styled } from '@tamagui/tailwind'
321
+ \`\`\`
322
+
323
+ Keep importing regular Tamagui components from \`tamagui\` or
324
+ \`@tamagui/core\`. Do not mix utility classes and Tamagui style props on the
325
+ same component; choose the import whose styling language that component uses.
326
+
327
+ ### Required API follow-ups
328
+
329
+ - Transition values: replace arrays with \`{ preset: 'quick', opacity: 'lazy' }\`, rename the transition object's \`default\` to \`preset\`, and place physics under \`spring\`. Move \`animateOnly\` into \`transition.properties\`. Read the upgrade guide's transition section before converting driver-specific options.
330
+ - Groups and containers: \`group="card"\` enables \`group-hover/card:\` and other group states. Size queries require \`container="card"\` and use \`@sm/card:\`; a group alone no longer enables container measurement.
331
+ - Control sizes: Config v6 uses \`xs | sm | md | lg | xl\` (default \`md\`). Keep numeric token keys while retaining Config v5, then map control sizes when separately adopting v6. Shape and icon geometry still uses size tokens or numbers.
332
+ - Remove top-level \`createTamagui({ defaultProps })\`. Put default styles in \`styled()\` definitions and inherited non-style defaults in \`Component.Props\`.
333
+ - Toast: replace \`useToastController().show(title, { message })\` with \`toast(title, { description: message })\`. Import \`Toast\` and \`toast\` from \`tamagui/toast\`; mount \`Toast.Root\` and \`Toast.List\` with the desired parts once in the app. The old provider/controller API is removed.
334
+ - Replace \`ThemeableStack\` and \`SizableStack\` with \`YStack\` or \`XStack\` plus explicit styles; use \`elevation\` for elevation and border width/color for borders.
335
+ - Checked/selected states: Checkbox, Switch, Tabs and ToggleGroup read \`background-press\`; customize \`activeStyle\` to override it per instance. Audit the resulting active background against the previous app and customize its theme or skin where needed.
336
+
337
+ ### 15. Verification
338
+
339
+ - Run \`npx tamagui check --strict\`.
340
+ - Run typecheck and build.
341
+ - Start the app and manually test screens using Sheet, Dialog, Popover, Select, FocusScope, icons, and ScrollView.
342
+ - Test Adapt breakpoints where popovers/selects/dialogs become sheets.
343
+ - Verify keyboard focus, Escape, outside click, scroll locking, and close animations.
344
+ - Inspect icon alignment next to text at each app size token.
345
+ - If the Tailwind frontend is used, compare web and native output for the classes used.
346
+ - Compare the same screens and resolved control dimensions with the baseline. Keeping Config v5 preserves the scales, but does not prove that changed component APIs preserve every layout.
347
+ - Report the final package version, retained config, manual fixes, runtime evidence, and deferred optional work. A validated V3 app on Config v5 is a completed migration.
348
+
349
+ ### Optional follow-up: Config v6, only when separately requested
350
+
351
+ This appendix is not part of the intermediate V3 API checkpoint. Start a new
352
+ reviewable change after that checkpoint is validated. Record new visual
353
+ acceptance criteria before changing design values.
354
+
355
+ - New apps can start with \`defaultConfig\` from \`@tamagui/config/v6\`.
356
+ - For an existing app, inventory and compare resolved spacing, size, radius, font, icon, and media values. Map by resolved value when preserving appearance; the same token name can mean a different number in v6.
357
+ - Preserve breakpoint meaning: changing a max-width key to a min-width key can invert responsive behavior.
358
+
359
+ - Use \`createThemes\`, \`levels\`, scales, and the other recipe helpers from \`@tamagui/themes/builder\`.
360
+ - Remove \`componentThemes\`, \`templates\`, \`masks\`, \`childrenThemes\`, and \`grandChildrenThemes\`. Express hierarchy in the recipe tree, semantic values in scales, and exact one-theme overrides in \`values\`.
361
+
362
+ Rename the adaptive 12-step ramp approximately:
363
+
364
+ - \`color1\` -> \`color1\`
365
+ - \`color2\` -> \`color2\`
366
+ - \`color3\` -> \`color3\`
367
+ - \`color4\` -> \`color4\`
368
+ - \`color5\` -> \`color5\`
369
+ - \`color6\` and \`color7\` -> \`color6\`
370
+ - \`color8\` -> \`color7\`
371
+ - \`color9\` -> \`color8\`
372
+ - \`color10\` -> \`color9\`
373
+ - \`color11\` -> \`color10\`
374
+ - \`color12\` -> \`color11\`
375
+
376
+ The endpoints are exact; inspect contrast in the compressed middle. Replace
377
+ \`surface1\` with \`level2\`, \`surface2\` with \`level3\`, and \`surface3\`
378
+ or \`surface4\` with \`level4\`. Levels are relative and preserve a surrounding
379
+ color theme when nested.
380
+
381
+ Search the config and application together:
382
+
383
+ \`\`\`bash
384
+ rg "@tamagui/theme-builder|v5-builder|createV5Theme|componentThemes|grandChildrenThemes|surface[1-4]|color12"
385
+ \`\`\`
386
+
387
+ Validate the config change separately with light/dark screenshots, responsive
388
+ layouts, text and icon alignment, and every platform the app ships. Do not
389
+ accept visual drift merely because the codemod and typecheck are green.`;
390
+ const v1ToV2Prompt = `## v1 -> v2 migration pass
391
+
392
+ Bring the app to the v2 baseline before applying v3 changes.
393
+
394
+ ### Requirements
395
+
396
+ - React 19+
397
+ - React Native 0.81+ with New Architecture support
398
+ - TypeScript 5+
399
+
400
+ ### Config
401
+
402
+ - Preserve the app's existing token, theme, font, and breakpoint values while reaching the v2 API baseline. Keep supported Config v5 imports or serialize the old generated config into app-owned values when an entry is no longer exported. Config v6 is a separate optional migration after the v3 checkpoint below.
403
+ - Import animations separately from \`@tamagui/config/animations-css\`, \`animations-rn\`, \`animations-reanimated\`, or \`animations-motion\`.
404
+ - Move root \`createTamagui\` settings into \`settings\`.
405
+ - Account for the defaults \`flexBasis: 0\` and \`position: static\`. Use \`styleCompat: 'legacy'\` or explicit props if needed.
406
+ - Rename media queries: \`$2xl\` -> \`$xxl\`, \`$2xs\` -> \`$xxs\`, and max queries to kebab-case such as \`$max-md\`.
407
+ - Preserve resolved colors and themes; defer v6 recipe conversion to the optional follow-up below.
408
+
409
+ ### v1 prop and API changes
410
+
411
+ - \`animation\` -> \`transition\`.
412
+ - \`AnimationProp\` -> \`TransitionProp\`.
413
+ - \`tag\` -> \`render\`.
414
+ - \`Stack\` -> \`View\`.
415
+ - \`StackProps\` -> \`ViewProps\`.
416
+ - \`space\` and \`spaceDirection\` -> \`gap\`.
417
+ - \`themeInverse\` and \`<Theme inverse>\` -> \`theme="inverse"\` and \`<Theme name="inverse">\`.
418
+ - \`onHoverIn\` / \`onHoverOut\` -> \`onPointerEnter\` / \`onPointerLeave\` or mouse events.
419
+ - \`ellipse\` -> \`numberOfLines={1}\`.
420
+ - React Native accessibility props -> ARIA/web equivalents where applicable.
421
+ - React Native shadow props -> \`boxShadow\`.
422
+
423
+ ### v1 component changes
424
+
425
+ - Input and Image prefer web-standard props such as \`type\`, \`inputMode\`, \`src\`, \`alt\`, and \`objectFit\`.
426
+ - Button and ListItem no longer take direct text style props. Style text through child components.
427
+ - Tabs uses \`Tabs.Tab\` instead of \`Tabs.Trigger\`; \`activationMode\` defaults to \`manual\`.
428
+ - Group requires \`Group.Item\`; remove old separator/space/scrollable auto-cloning props.
429
+ - Replace old \`Popover.Sheet\` subcomponents with standalone \`Sheet\` inside \`Adapt\`.
430
+ - Add native setup imports where needed: \`@tamagui/native/setup-teleport\`, \`setup-gesture-handler\`, \`setup-expo-ui-menu\` or \`setup-zeego\`, \`setup-burnt\`, and linear-gradient setup.
431
+
432
+ ### v1 -> v2 verification
433
+
434
+ - Run the app before starting v3 changes.
435
+ - Verify layout affected by flex/position defaults.
436
+ - Verify forms, tabs, groups, portals, native sheets, and Input/Image behavior.
437
+ - Commit the v1 -> v2 migration separately if possible.`;