diff --git a/change/@fluentui-react-input-9a801924-e73d-441e-b108-fd37b0525087.json b/change/@fluentui-react-input-9a801924-e73d-441e-b108-fd37b0525087.json new file mode 100644 index 00000000000000..a7696b6ce7cb03 --- /dev/null +++ b/change/@fluentui-react-input-9a801924-e73d-441e-b108-fd37b0525087.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: Migrate to new package structure.", + "packageName": "@fluentui/react-input", + "email": "tristan.watanabe@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-input/.npmignore b/packages/react-components/react-input/.npmignore index 52d2a7273a151d..f7ce568a6dbf7c 100644 --- a/packages/react-components/react-input/.npmignore +++ b/packages/react-components/react-input/.npmignore @@ -3,10 +3,11 @@ bundle-size/ config/ coverage/ -e2e/ +docs/ etc/ node_modules/ src/ +stories/ dist/types/ temp/ __fixtures__ @@ -16,7 +17,7 @@ __tests__ *.api.json *.log *.spec.* -*.stories.* +*.cy.* *.test.* *.yml diff --git a/packages/react-components/react-input/.storybook/main.js b/packages/react-components/react-input/.storybook/main.js index f57cfd09509e78..26536b61b387f6 100644 --- a/packages/react-components/react-input/.storybook/main.js +++ b/packages/react-components/react-input/.storybook/main.js @@ -2,7 +2,7 @@ const rootMain = require('../../../../.storybook/main'); module.exports = /** @type {Omit} */ ({ ...rootMain, - stories: [...rootMain.stories, '../src/**/*.stories.mdx', '../src/**/index.stories.@(ts|tsx)'], + stories: [...rootMain.stories, '../stories/**/*.stories.mdx', '../stories/**/index.stories.@(ts|tsx)'], addons: [...rootMain.addons], webpackFinal: (config, options) => { const localConfig = { ...rootMain.webpackFinal(config, options) }; diff --git a/packages/react-components/react-input/.storybook/tsconfig.json b/packages/react-components/react-input/.storybook/tsconfig.json index f9f60e1234ed49..ea89218a3d916f 100644 --- a/packages/react-components/react-input/.storybook/tsconfig.json +++ b/packages/react-components/react-input/.storybook/tsconfig.json @@ -6,5 +6,5 @@ "checkJs": true, "types": ["static-assets", "environment", "storybook__addons"] }, - "include": ["../src/**/*.stories.ts", "../src/**/*.stories.tsx", "*.js"] + "include": ["../stories/**/*.stories.ts", "../stories/**/*.stories.tsx", "*.js"] } diff --git a/packages/react-components/react-input/Spec-styling.md b/packages/react-components/react-input/docs/Spec-styling.md similarity index 100% rename from packages/react-components/react-input/Spec-styling.md rename to packages/react-components/react-input/docs/Spec-styling.md diff --git a/packages/react-components/react-input/Spec-variants.md b/packages/react-components/react-input/docs/Spec-variants.md similarity index 100% rename from packages/react-components/react-input/Spec-variants.md rename to packages/react-components/react-input/docs/Spec-variants.md diff --git a/packages/react-components/react-input/Spec.md b/packages/react-components/react-input/docs/Spec.md similarity index 100% rename from packages/react-components/react-input/Spec.md rename to packages/react-components/react-input/docs/Spec.md diff --git a/packages/react-components/react-input/src/components/Input/Input.test.tsx b/packages/react-components/react-input/src/components/Input/Input.test.tsx index bcbc681f988cf3..1dfab60638d04b 100644 --- a/packages/react-components/react-input/src/components/Input/Input.test.tsx +++ b/packages/react-components/react-input/src/components/Input/Input.test.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { render, RenderResult, fireEvent, screen } from '@testing-library/react'; import { Input } from './Input'; -import { isConformant } from '../../common/isConformant'; +import { isConformant } from '../../testing/isConformant'; function getInput(): HTMLInputElement { return screen.getByRole('textbox') as HTMLInputElement; diff --git a/packages/react-components/react-input/src/common/isConformant.ts b/packages/react-components/react-input/src/testing/isConformant.ts similarity index 100% rename from packages/react-components/react-input/src/common/isConformant.ts rename to packages/react-components/react-input/src/testing/isConformant.ts diff --git a/packages/react-components/react-input/src/stories/Input/InputAppearance.stories.tsx b/packages/react-components/react-input/stories/Input/InputAppearance.stories.tsx similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputAppearance.stories.tsx rename to packages/react-components/react-input/stories/Input/InputAppearance.stories.tsx diff --git a/packages/react-components/react-input/src/stories/Input/InputBestPractices.md b/packages/react-components/react-input/stories/Input/InputBestPractices.md similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputBestPractices.md rename to packages/react-components/react-input/stories/Input/InputBestPractices.md diff --git a/packages/react-components/react-input/src/stories/Input/InputContentBeforeAfter.stories.tsx b/packages/react-components/react-input/stories/Input/InputContentBeforeAfter.stories.tsx similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputContentBeforeAfter.stories.tsx rename to packages/react-components/react-input/stories/Input/InputContentBeforeAfter.stories.tsx diff --git a/packages/react-components/react-input/src/stories/Input/InputControlled.stories.tsx b/packages/react-components/react-input/stories/Input/InputControlled.stories.tsx similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputControlled.stories.tsx rename to packages/react-components/react-input/stories/Input/InputControlled.stories.tsx diff --git a/packages/react-components/react-input/src/stories/Input/InputDefault.stories.tsx b/packages/react-components/react-input/stories/Input/InputDefault.stories.tsx similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputDefault.stories.tsx rename to packages/react-components/react-input/stories/Input/InputDefault.stories.tsx diff --git a/packages/react-components/react-input/src/stories/Input/InputDescription.md b/packages/react-components/react-input/stories/Input/InputDescription.md similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputDescription.md rename to packages/react-components/react-input/stories/Input/InputDescription.md diff --git a/packages/react-components/react-input/src/stories/Input/InputDisabled.stories.tsx b/packages/react-components/react-input/stories/Input/InputDisabled.stories.tsx similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputDisabled.stories.tsx rename to packages/react-components/react-input/stories/Input/InputDisabled.stories.tsx diff --git a/packages/react-components/react-input/src/stories/Input/InputInline.stories.tsx b/packages/react-components/react-input/stories/Input/InputInline.stories.tsx similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputInline.stories.tsx rename to packages/react-components/react-input/stories/Input/InputInline.stories.tsx diff --git a/packages/react-components/react-input/src/stories/Input/InputPlaceholder.stories.tsx b/packages/react-components/react-input/stories/Input/InputPlaceholder.stories.tsx similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputPlaceholder.stories.tsx rename to packages/react-components/react-input/stories/Input/InputPlaceholder.stories.tsx diff --git a/packages/react-components/react-input/src/stories/Input/InputSize.stories.tsx b/packages/react-components/react-input/stories/Input/InputSize.stories.tsx similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputSize.stories.tsx rename to packages/react-components/react-input/stories/Input/InputSize.stories.tsx diff --git a/packages/react-components/react-input/src/stories/Input/InputType.stories.tsx b/packages/react-components/react-input/stories/Input/InputType.stories.tsx similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputType.stories.tsx rename to packages/react-components/react-input/stories/Input/InputType.stories.tsx diff --git a/packages/react-components/react-input/src/stories/Input/InputUncontrolled.stories.tsx b/packages/react-components/react-input/stories/Input/InputUncontrolled.stories.tsx similarity index 100% rename from packages/react-components/react-input/src/stories/Input/InputUncontrolled.stories.tsx rename to packages/react-components/react-input/stories/Input/InputUncontrolled.stories.tsx diff --git a/packages/react-components/react-input/src/stories/Input/index.stories.tsx b/packages/react-components/react-input/stories/Input/index.stories.tsx similarity index 100% rename from packages/react-components/react-input/src/stories/Input/index.stories.tsx rename to packages/react-components/react-input/stories/Input/index.stories.tsx diff --git a/packages/react-components/react-input/tsconfig.lib.json b/packages/react-components/react-input/tsconfig.lib.json index 5d7b14f1e0b70c..53770c42da6dd0 100644 --- a/packages/react-components/react-input/tsconfig.lib.json +++ b/packages/react-components/react-input/tsconfig.lib.json @@ -10,7 +10,7 @@ "types": ["static-assets", "environment"] }, "exclude": [ - "./src/common/**", + "./src/testing/**", "**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", diff --git a/packages/react-components/react-input/tsconfig.spec.json b/packages/react-components/react-input/tsconfig.spec.json index 469fcba4d7ba75..911456fe4b4d91 100644 --- a/packages/react-components/react-input/tsconfig.spec.json +++ b/packages/react-components/react-input/tsconfig.spec.json @@ -5,5 +5,13 @@ "outDir": "dist", "types": ["jest", "node"] }, - "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"] + "include": [ + "**/*.spec.ts", + "**/*.spec.tsx", + "**/*.test.ts", + "**/*.test.tsx", + "**/*.d.ts", + "./src/testing/**/*.ts", + "./src/testing/**/*.tsx" + ] }