diff --git a/.storybook-s2/docs/Migrating.jsx b/.storybook-s2/docs/Migrating.jsx new file mode 100644 index 00000000000..a695e930146 --- /dev/null +++ b/.storybook-s2/docs/Migrating.jsx @@ -0,0 +1,779 @@ +import { style } from '../../packages/@react-spectrum/s2/style/spectrum-theme' with {type: 'macro'}; +import {Link} from '@react-spectrum/s2'; +import {P, Code, Pre, H3, H2} from './typography'; + +export function Migrating() { + return ( +
+
+

+ Migrating to Spectrum 2 +

+

An automated upgrade assistant is available by running the following command in the project you want to upgrade:

+
npx @react-spectrum/codemods s1-to-s2
+ +

For cases that the upgrade assistant doesn't handle automatically or where you'd rather upgrade some components manually, use the guide below.

+ +

Note that [PENDING] indicates that future changes will occur before the final release, and the current solution should be considered temporary.

+ +

Components

+

All components

+ + +

ActionButton

+

No updates needed.

+ +

ActionMenu

+ + +

Avatar

+ + +

Breadcrumbs

+ + +

Button

+ + +

ButtonGroup

+

No updates needed.

+ +

Checkbox

+

No updates needed.

+ +

CheckboxGroup

+ + +

ColorArea

+ + +

ColorField

+ + +

ColorSlider

+ + +

ColorSwatch

+

No updates needed.

+ +

ColorWheel

+ + +

ComboBox

+ + +

Dialog

+ + +

DialogTrigger

+ + +

Divider

+ + +

Flex

+ + +

Form

+ + +

Grid

+ + +

IllustratedMessage

+

No updates needed.

+ +

InlineAlert

+ + +

Item

+ + +

Link

+ + +

ListBox

+ + +

Menu

+ + +

MenuTrigger

+ + +

Picker

+ + +

ProgressBar

+ + +

ProgressCircle

+ + +

Radio

+

No updates needed.

+ +

RadioGroup

+ + +

RangeSlider

+ + +

SearchField

+ + +

Section

+ + +

Slider

+ + +

StatusLight

+ + +

SubmenuTrigger

+

No updates needed.

+ +

Switch

+

No updates needed.

+ +

Tabs

+ + +

TagGroup

+ + +

TextArea

+ + +

TextField

+ + +

ToggleButton

+

No updates needed.

+ +

Tooltip

+ + +

TooltipTrigger

+ + +

View

+ + +

Style props

+

React Spectrum v3 supported a limited set of style props for layout and positioning using Spectrum-defined values. Usage of these should be updated to instead use the style macro.

+

Example:

+
+          
{`- import {ActionButton} from '@adobe/react-spectrum';`}
+
{`+ import {ActionButton} from '@react-spectrum/s2';`}
+
{`+ import {style} from '@react-spectrum/s2/style' with {type: 'macro'};`}
+
{'\n'}
+
{`- `}
+
{`+ `}
+
{` Edit`}
+
{` `}
+
+ +

Border width

+

Affected style props: borderWidth, borderStartWidth, borderEndWidth, borderTopWidth, borderBottomWidth, borderXWidth, borderYWidth.

+

Example:

+
+          
{`- `}
+
{`+
`}
+
+

Border widths should be updated to use pixel values. Use the following mappings:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Spectrum 1Spectrum 2
'none'0
'thin'1
'thick'2
'thicker'4
'thickest''[8px]'
+ +

Border radius

+

Affected style props: borderRadius, borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadius.

+

Example:

+
+          
{`- `}
+
{`+
`}
+
+

Border radius values should be updated to use pixel values. Use the following mappings:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Spectrum 1Spectrum 2
'xsmall''[1px]'
'small''sm'
'regular''default'
'medium''lg'
'large''xl'
+ +

Dimension values

+

Affected style props: width, minWidth, maxWidth, height, minHeight, maxHeight, margin, marginStart, marginEnd, marginTop, marginBottom, marginX, marginY, top, bottom, left, right, start, end, flexBasis, gap, columnGap, rowGap, padding, paddingX, paddingY, paddingStart, paddingEnd, paddingTop, paddingBottom.

+

Example:

+
+          
{`- `}
+
{`+ `}
+
{` Edit`}
+
{` `}
+
+

Dimension values should be converted to pixel values. Use the following mappings:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Spectrum 1Spectrum 2
'size-0'0
'size-10'1
'size-25'2
'size-40'3
'size-50'4
'size-65'5
'size-75'6
'size-85'7
'size-100'8
'size-115'9
'size-125'10
'size-130'11
'size-150'12
'size-160'13
'size-175'14
'size-200'16
'size-225'18
'size-250'20
'size-275'22
'size-300'24
'size-325'26
'size-350'28
'size-400'32
'size-450'36
'size-500'40
'size-550'44
'size-600'48
'size-675'54
'size-700'56
'size-800'64
'size-900'72
'size-1000'80
'size-1200'96
'size-1250'100
'size-1600'128
'size-1700'136
'size-2000'160
'size-2400'192
'size-3000'240
'size-3400'272
'size-3600'288
'size-4600'368
'size-5000'400
'size-6000'480
'static-size-0'0
'static-size-10'1
'static-size-25'2
'static-size-40'3
'static-size-50'4
'static-size-65'5
'static-size-100'8
'static-size-115'9
'static-size-125'10
'static-size-130'11
'static-size-150'12
'static-size-160'13
'static-size-175'14
'static-size-200'16
'static-size-225'18
'static-size-250'20
'static-size-300'24
'static-size-400'32
'static-size-450'36
'static-size-500'40
'static-size-550'44
'static-size-600'48
'static-size-700'56
'static-size-800'64
'static-size-900'72
'static-size-1000'80
'static-size-1200'96
'static-size-1700'136
'static-size-2400'192
'static-size-2600'208
'static-size-3400'272
'static-size-3600'288
'static-size-4600'368
'static-size-5000'400
'static-size-6000'480
'single-line-height'32
'single-line-width'192
+ +

Break points

+

Break points previously used in style props can be used in the style macro with updated keys. Use the following mappings:

+ + + + + + + + + + + + + + + + + + + + + +
Spectrum 1Spectrum 2
basedefault
Ssm
Mmd
Llg
+

Example:

+
+          
{`- `}
+
{`+
`}
+
+
+
+ ); +} diff --git a/.storybook-s2/docs/Migrating.mdx b/.storybook-s2/docs/Migrating.mdx new file mode 100644 index 00000000000..16fdc003ea0 --- /dev/null +++ b/.storybook-s2/docs/Migrating.mdx @@ -0,0 +1,4 @@ +import {Migrating} from './Migrating.jsx'; +import {H3} from './typography'; + + diff --git a/.storybook-s2/docs/typography.js b/.storybook-s2/docs/typography.js index 64e3f183764..be02b53ebeb 100644 --- a/.storybook-s2/docs/typography.js +++ b/.storybook-s2/docs/typography.js @@ -1,19 +1,48 @@ import { style } from '../../packages/@react-spectrum/s2/style/spectrum-theme' with {type: 'macro'}; import {Link} from '@react-spectrum/s2'; +import {useFocusRing, useHover} from 'react-aria'; + +function AnchorLink({id, isHovered}) { + let { isFocusVisible, focusProps } = useFocusRing({within: true}); + const url = `${location.origin}${location.pathname.replace('iframe', 'index')}${location.search.replace('viewMode=docs&id=', 'path=/docs/')}#${id}`; + return ( + + # + + ); +} export function H2({children}) { let id = anchorId(children); - return

{children}

+ let {hoverProps, isHovered} = useHover({}); + return ( +

+ {children} + +

+ ) } export function H3({children}) { let id = anchorId(children); - return

{children}

+ let {hoverProps, isHovered} = useHover({}); + return ( +

+ {children} + +

+ ); } export function H4({children}) { let id = anchorId(children); - return

{children}

+ let {hoverProps, isHovered} = useHover({}); + return ( +

+ {children} + +

+ ); } export function P({children}) { @@ -21,7 +50,7 @@ export function P({children}) { } export function Code({children}) { - return {children}; + return {children}; } export function Strong({children}) { diff --git a/packages/@react-spectrum/upgrade-cli/package.json b/packages/dev/codemods/package.json similarity index 81% rename from packages/@react-spectrum/upgrade-cli/package.json rename to packages/dev/codemods/package.json index e0a08448450..a15f67aa76c 100644 --- a/packages/@react-spectrum/upgrade-cli/package.json +++ b/packages/dev/codemods/package.json @@ -1,14 +1,16 @@ { - "name": "@react-spectrum/upgrade-cli", + "name": "@react-spectrum/codemods", "version": "0.0.1", "private": true, - "source": "src/index.ts", "main": "dist/index.js", - "bin": { - "upgrade-react-spectrum": "./dist/index.js" + "source": "src/index.ts", + "bin": "dist/index.js", + "targets": { + "main": false }, "scripts": { - "start": "node --loader=ts-node/esm src/index.ts" + "build": "tsc", + "prepublishOnly": "yarn build" }, "files": [ "dist" @@ -23,12 +25,12 @@ "@babel/parser": "^7.24.5", "@babel/traverse": "^7.24.5", "@babel/types": "^7.24.5", + "@react-spectrum/s2": "^0.2.0", "@react-types/shared": "^3.24.0", "@types/node": "^20", "boxen": "^5.1.2", "build": "^0.1.4", "chalk": "^4.0.0", - "commander": "^12.0.0", "execa": "^5.1.1", "jscodeshift": "^0.15.2", "ts-node": "^10.9.2", diff --git a/packages/dev/codemods/src/index.ts b/packages/dev/codemods/src/index.ts new file mode 100644 index 00000000000..f5397efbc2e --- /dev/null +++ b/packages/dev/codemods/src/index.ts @@ -0,0 +1,100 @@ +const {parseArgs} = require('node:util'); +import {s1_to_s2} from './s1-to-s2/src'; +import {use_monopackages} from './use-monopackages/src'; + +interface JSCodeshiftOptions { + /** + * The parser for jscodeshift to use for parsing the source files: https://github.com/facebook/jscodeshift?tab=readme-ov-file#parser. + * + * @default 'tsx' + */ + parser?: 'babel' | 'babylon' | 'flow' | 'ts' |' tsx', + /** + * A glob pattern of files to ignore: https://github.com/facebook/jscodeshift?tab=readme-ov-file#ignoring-files-and-directories. + * + * @default '*\*\/node_modules/*\*\' + */ + ignorePattern?: string, + /** + * Whether to run the codemod in dry mode, which will not write any changes to disk. + * + * @default false + */ + dry?: boolean, + /** + * The path to the directory to run the codemod in. + * + * @default '.' + */ + path?: string +} + +export interface S1ToS2CodemodOptions extends JSCodeshiftOptions { + /** + * An optional subset of components to have the s1-to-s2 codemod apply to. + * Provide a comma-separated list of component names. + */ + components?: string +} + +export interface UseMonopackagesCodemodOptions extends JSCodeshiftOptions { + /** + * The packages to apply the use-monopackages codemod to. + */ + packages?: string +} + +const codemods: Record void> = { + 's1-to-s2': s1_to_s2, + 'use-monopackages': use_monopackages +}; + +// https://github.com/facebook/jscodeshift?tab=readme-ov-file#usage-cli +const options = { + 'parser': { + type: 'string' + }, + 'ignore-pattern': { + type: 'string' + }, + 'dry': { + type: 'boolean', + short: 'd' + }, + 'path': { + type: 'string' + }, + 'components': { + type: 'string' + } +}; + +const {values, positionals} = parseArgs({ + options, + allowPositionals: true +}); + +if (positionals.length < 1) { + console.error('Please specify a codemod to run. Available codemods: ', Object.keys(codemods).join(', ')); + process.exit(1); +} + +const codemodName = positionals[0]; +const codemodFunction = codemods[codemodName]; + +if (!codemodFunction) { + console.error(`Unknown codemod: ${codemodName}, available codemods: ${Object.keys(codemods).join(', ')}`); + process.exit(1); +} + +try { + codemodFunction({ + parser: 'tsx', + ignorePattern: '**/node_modules/**', + path: '.', + ...values + }); +} catch (error) { + console.error(`Error running codemod: ${error}`); + process.exit(1); +} diff --git a/packages/@react-spectrum/upgrade-cli/README.md b/packages/dev/codemods/src/s1-to-s2/README.md similarity index 83% rename from packages/@react-spectrum/upgrade-cli/README.md rename to packages/dev/codemods/src/s1-to-s2/README.md index fae0ec4a682..c2db857dd15 100644 --- a/packages/@react-spectrum/upgrade-cli/README.md +++ b/packages/dev/codemods/src/s1-to-s2/README.md @@ -4,7 +4,7 @@ A CLI tool for upgrading React Spectrum components to Spectrum 2. ## Usage -Run `npx @react-spectrum/upgrade-cli` from the directory you want to upgrade. +Run `npx @react-spectrum/codemods s1-to-s2` from the directory you want to upgrade. ### Options diff --git a/packages/@react-spectrum/upgrade-cli/UPGRADE.md b/packages/dev/codemods/src/s1-to-s2/UPGRADE.md similarity index 99% rename from packages/@react-spectrum/upgrade-cli/UPGRADE.md rename to packages/dev/codemods/src/s1-to-s2/UPGRADE.md index aa503d5cc6c..362b916d7bf 100644 --- a/packages/@react-spectrum/upgrade-cli/UPGRADE.md +++ b/packages/dev/codemods/src/s1-to-s2/UPGRADE.md @@ -85,7 +85,6 @@ Note that `[PENDING]` indicates that future changes will occur before the final - Remove `isReadOnly` (it is no longer supported) - Remove `validationState` (it is no longer supported) - Remove `validationBehavior` (it is no longer supported) -- TODO: Clarify/verify the above ## Grid - Update `Grid` to be a `div` and apply grid styles using the style macro @@ -357,8 +356,8 @@ Dimension values should be converted to pixel values. Use the following mappings | `'static-size-0'` | `0` | | `'static-size-10'` | `1` | | `'static-size-25'` | `2` | -| `'static-size-50'` | `4` | | `'static-size-40'` | `3` | +| `'static-size-50'` | `4` | | `'static-size-65'` | `5` | | `'static-size-100'` | `8` | | `'static-size-115'` | `9` | diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/actionbutton.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/actionbutton.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/actionbutton.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/actionbutton.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/actionmenu.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/actionmenu.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/actionmenu.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/actionmenu.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/avatar.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/avatar.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/avatar.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/avatar.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/badge.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/badge.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/badge.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/badge.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/breadcrumbs.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/breadcrumbs.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/breadcrumbs.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/breadcrumbs.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/button.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/button.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/button.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/button.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/buttongroup.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/buttongroup.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/buttongroup.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/buttongroup.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/calendar.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/calendar.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/calendar.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/calendar.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/checkbox.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/checkbox.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/checkbox.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/checkbox.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/checkboxgroup.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/checkboxgroup.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/checkboxgroup.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/checkboxgroup.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/colorarea.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/colorarea.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/colorarea.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/colorarea.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/colorfield.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/colorfield.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/colorfield.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/colorfield.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/colorslider.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/colorslider.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/colorslider.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/colorslider.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/colorswatch.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/colorswatch.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/colorswatch.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/colorswatch.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/colorwheel.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/colorwheel.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/colorwheel.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/colorwheel.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/combobox.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/combobox.test.ts.snap similarity index 98% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/combobox.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/combobox.test.ts.snap index ad88016c19b..580806b80eb 100644 --- a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/combobox.test.ts.snap +++ b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/combobox.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Dynamic - Renames Item to ComboboxItem 1`] = ` +exports[`Dynamic - Renames Item to ComboBoxItem 1`] = ` "import { ComboBoxItem, ComboBox } from "@react-spectrum/s2"; import { Item } from '@adobe/react-spectrum'; let options = [ @@ -140,7 +140,7 @@ let props = {menuWidth: 'size-10'}; " `; -exports[`Static - Renames Item to ComboboxItem 1`] = ` +exports[`Static - Renames Item to ComboBoxItem 1`] = ` "import { ComboBoxItem, ComboBox } from "@react-spectrum/s2"; import { Item } from '@adobe/react-spectrum';
diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/contextualhelp.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/contextualhelp.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/contextualhelp.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/contextualhelp.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/datefield.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/datefield.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/datefield.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/datefield.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/datepicker.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/datepicker.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/datepicker.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/datepicker.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/daterangepicker.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/daterangepicker.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/daterangepicker.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/daterangepicker.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/dialog.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/dialog.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/dialog.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/dialog.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/dialogcontainer.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/dialogcontainer.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/dialogcontainer.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/dialogcontainer.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/divider.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/divider.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/divider.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/divider.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/dropzone.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/dropzone.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/dropzone.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/dropzone.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/form.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/form.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/form.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/form.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/icon.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/icon.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/icon.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/icon.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/illustratedmessage.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/illustratedmessage.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/illustratedmessage.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/illustratedmessage.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/imports.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/imports.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/imports.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/imports.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/inlinealert.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/inlinealert.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/inlinealert.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/inlinealert.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/link.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/link.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/link.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/link.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/listbox.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/listbox.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/listbox.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/listbox.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/menu.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/menu.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/menu.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/menu.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/meter.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/meter.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/meter.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/meter.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/multi-collection.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/multi-collection.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/multi-collection.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/multi-collection.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/picker.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/picker.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/picker.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/picker.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/progressbar.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/progressbar.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/progressbar.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/progressbar.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/progresscircle.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/progresscircle.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/progresscircle.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/progresscircle.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/provider.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/provider.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/provider.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/provider.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/radio.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/radio.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/radio.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/radio.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/radiogroup.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/radiogroup.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/radiogroup.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/radiogroup.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/rangeslider.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/rangeslider.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/rangeslider.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/rangeslider.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/searchfield.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/searchfield.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/searchfield.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/searchfield.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/slider.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/slider.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/slider.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/slider.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/statuslight.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/statuslight.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/statuslight.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/statuslight.test.ts.snap diff --git a/packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/styleProps.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/styleProps.test.ts.snap similarity index 100% rename from packages/@react-spectrum/upgrade-cli/__tests__/__snapshots__/styleProps.test.ts.snap rename to packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/styleProps.test.ts.snap diff --git a/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/subset.test.ts.snap b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/subset.test.ts.snap new file mode 100644 index 00000000000..4d313138b30 --- /dev/null +++ b/packages/dev/codemods/src/s1-to-s2/__tests__/__snapshots__/subset.test.ts.snap @@ -0,0 +1,33 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Should not update components that are not provided to --components option 1`] = ` +"import {Button, TextArea} from '@adobe/react-spectrum'; + +
+ + +