From 4b64000a7eaee9ebe4b570431760c6d35f78db5f Mon Sep 17 00:00:00 2001 From: Tristan Watanabe Date: Tue, 1 Nov 2022 19:16:27 -0400 Subject: [PATCH] chore(react-link): migrate to new package structure (#25471) --- ...eact-link-9e4af9e8-3bde-497c-a4f9-19fcecf1f66f.json | 7 +++++++ packages/react-components/react-link/.npmignore | 5 +++-- .../react-components/react-link/.storybook/main.js | 2 +- .../react-link/.storybook/tsconfig.json | 2 +- .../react-link/{ => docs}/MIGRATION.md | 0 .../react-components/react-link/{ => docs}/SPEC.md | 0 .../react-link/src/components/Link/Link.test.tsx | 2 +- .../react-link/src/{common => testing}/isConformant.ts | 0 .../{src => }/stories/Link/LinkAppearance.stories.tsx | 0 .../{src => }/stories/Link/LinkAsButton.stories.tsx | 0 .../{src => }/stories/Link/LinkBestPractices.md | 0 .../{src => }/stories/Link/LinkDefault.stories.tsx | 0 .../{src => }/stories/Link/LinkDescription.md | 0 .../{src => }/stories/Link/LinkDisabled.stories.tsx | 0 .../stories/Link/LinkDisabledFocusable.stories.tsx | 0 .../{src => }/stories/Link/LinkInline.stories.tsx | 0 .../{src => }/stories/Link/index.stories.tsx | 0 packages/react-components/react-link/tsconfig.lib.json | 2 +- .../react-components/react-link/tsconfig.spec.json | 10 +++++++++- 19 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 change/@fluentui-react-link-9e4af9e8-3bde-497c-a4f9-19fcecf1f66f.json rename packages/react-components/react-link/{ => docs}/MIGRATION.md (100%) rename packages/react-components/react-link/{ => docs}/SPEC.md (100%) rename packages/react-components/react-link/src/{common => testing}/isConformant.ts (100%) rename packages/react-components/react-link/{src => }/stories/Link/LinkAppearance.stories.tsx (100%) rename packages/react-components/react-link/{src => }/stories/Link/LinkAsButton.stories.tsx (100%) rename packages/react-components/react-link/{src => }/stories/Link/LinkBestPractices.md (100%) rename packages/react-components/react-link/{src => }/stories/Link/LinkDefault.stories.tsx (100%) rename packages/react-components/react-link/{src => }/stories/Link/LinkDescription.md (100%) rename packages/react-components/react-link/{src => }/stories/Link/LinkDisabled.stories.tsx (100%) rename packages/react-components/react-link/{src => }/stories/Link/LinkDisabledFocusable.stories.tsx (100%) rename packages/react-components/react-link/{src => }/stories/Link/LinkInline.stories.tsx (100%) rename packages/react-components/react-link/{src => }/stories/Link/index.stories.tsx (100%) diff --git a/change/@fluentui-react-link-9e4af9e8-3bde-497c-a4f9-19fcecf1f66f.json b/change/@fluentui-react-link-9e4af9e8-3bde-497c-a4f9-19fcecf1f66f.json new file mode 100644 index 00000000000000..bb02000884fe4d --- /dev/null +++ b/change/@fluentui-react-link-9e4af9e8-3bde-497c-a4f9-19fcecf1f66f.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: Migrate to new package structure.", + "packageName": "@fluentui/react-link", + "email": "tristan.watanabe@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-link/.npmignore b/packages/react-components/react-link/.npmignore index 52d2a7273a151d..f7ce568a6dbf7c 100644 --- a/packages/react-components/react-link/.npmignore +++ b/packages/react-components/react-link/.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-link/.storybook/main.js b/packages/react-components/react-link/.storybook/main.js index f57cfd09509e78..26536b61b387f6 100644 --- a/packages/react-components/react-link/.storybook/main.js +++ b/packages/react-components/react-link/.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-link/.storybook/tsconfig.json b/packages/react-components/react-link/.storybook/tsconfig.json index f9f60e1234ed49..ea89218a3d916f 100644 --- a/packages/react-components/react-link/.storybook/tsconfig.json +++ b/packages/react-components/react-link/.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-link/MIGRATION.md b/packages/react-components/react-link/docs/MIGRATION.md similarity index 100% rename from packages/react-components/react-link/MIGRATION.md rename to packages/react-components/react-link/docs/MIGRATION.md diff --git a/packages/react-components/react-link/SPEC.md b/packages/react-components/react-link/docs/SPEC.md similarity index 100% rename from packages/react-components/react-link/SPEC.md rename to packages/react-components/react-link/docs/SPEC.md diff --git a/packages/react-components/react-link/src/components/Link/Link.test.tsx b/packages/react-components/react-link/src/components/Link/Link.test.tsx index 6e84ced5b59b5e..76848ffc35635d 100644 --- a/packages/react-components/react-link/src/components/Link/Link.test.tsx +++ b/packages/react-components/react-link/src/components/Link/Link.test.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { render } from '@testing-library/react'; import { linkBehaviorDefinition, validateBehavior, ComponentTestFacade } from '@fluentui/a11y-testing'; -import { isConformant } from '../../common/isConformant'; +import { isConformant } from '../../testing/isConformant'; import { Link } from './Link'; import { LinkProps } from './Link.types'; diff --git a/packages/react-components/react-link/src/common/isConformant.ts b/packages/react-components/react-link/src/testing/isConformant.ts similarity index 100% rename from packages/react-components/react-link/src/common/isConformant.ts rename to packages/react-components/react-link/src/testing/isConformant.ts diff --git a/packages/react-components/react-link/src/stories/Link/LinkAppearance.stories.tsx b/packages/react-components/react-link/stories/Link/LinkAppearance.stories.tsx similarity index 100% rename from packages/react-components/react-link/src/stories/Link/LinkAppearance.stories.tsx rename to packages/react-components/react-link/stories/Link/LinkAppearance.stories.tsx diff --git a/packages/react-components/react-link/src/stories/Link/LinkAsButton.stories.tsx b/packages/react-components/react-link/stories/Link/LinkAsButton.stories.tsx similarity index 100% rename from packages/react-components/react-link/src/stories/Link/LinkAsButton.stories.tsx rename to packages/react-components/react-link/stories/Link/LinkAsButton.stories.tsx diff --git a/packages/react-components/react-link/src/stories/Link/LinkBestPractices.md b/packages/react-components/react-link/stories/Link/LinkBestPractices.md similarity index 100% rename from packages/react-components/react-link/src/stories/Link/LinkBestPractices.md rename to packages/react-components/react-link/stories/Link/LinkBestPractices.md diff --git a/packages/react-components/react-link/src/stories/Link/LinkDefault.stories.tsx b/packages/react-components/react-link/stories/Link/LinkDefault.stories.tsx similarity index 100% rename from packages/react-components/react-link/src/stories/Link/LinkDefault.stories.tsx rename to packages/react-components/react-link/stories/Link/LinkDefault.stories.tsx diff --git a/packages/react-components/react-link/src/stories/Link/LinkDescription.md b/packages/react-components/react-link/stories/Link/LinkDescription.md similarity index 100% rename from packages/react-components/react-link/src/stories/Link/LinkDescription.md rename to packages/react-components/react-link/stories/Link/LinkDescription.md diff --git a/packages/react-components/react-link/src/stories/Link/LinkDisabled.stories.tsx b/packages/react-components/react-link/stories/Link/LinkDisabled.stories.tsx similarity index 100% rename from packages/react-components/react-link/src/stories/Link/LinkDisabled.stories.tsx rename to packages/react-components/react-link/stories/Link/LinkDisabled.stories.tsx diff --git a/packages/react-components/react-link/src/stories/Link/LinkDisabledFocusable.stories.tsx b/packages/react-components/react-link/stories/Link/LinkDisabledFocusable.stories.tsx similarity index 100% rename from packages/react-components/react-link/src/stories/Link/LinkDisabledFocusable.stories.tsx rename to packages/react-components/react-link/stories/Link/LinkDisabledFocusable.stories.tsx diff --git a/packages/react-components/react-link/src/stories/Link/LinkInline.stories.tsx b/packages/react-components/react-link/stories/Link/LinkInline.stories.tsx similarity index 100% rename from packages/react-components/react-link/src/stories/Link/LinkInline.stories.tsx rename to packages/react-components/react-link/stories/Link/LinkInline.stories.tsx diff --git a/packages/react-components/react-link/src/stories/Link/index.stories.tsx b/packages/react-components/react-link/stories/Link/index.stories.tsx similarity index 100% rename from packages/react-components/react-link/src/stories/Link/index.stories.tsx rename to packages/react-components/react-link/stories/Link/index.stories.tsx diff --git a/packages/react-components/react-link/tsconfig.lib.json b/packages/react-components/react-link/tsconfig.lib.json index 5d7b14f1e0b70c..53770c42da6dd0 100644 --- a/packages/react-components/react-link/tsconfig.lib.json +++ b/packages/react-components/react-link/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-link/tsconfig.spec.json b/packages/react-components/react-link/tsconfig.spec.json index 469fcba4d7ba75..911456fe4b4d91 100644 --- a/packages/react-components/react-link/tsconfig.spec.json +++ b/packages/react-components/react-link/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" + ] }