Skip to content

Commit

Permalink
chore(react-portal, portal-compat, portal-compat-context): migrate to…
Browse files Browse the repository at this point in the history
… new package structure (microsoft#25481)
  • Loading branch information
TristanWatanabe authored and Hotell committed Feb 9, 2023
1 parent 972eb6a commit ad9ff1b
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: Migrate to new package structure.",
"packageName": "@fluentui/react-portal",
"email": "tristan.watanabe@gmail.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: Migrate to new package structure.",
"packageName": "@fluentui/react-portal-compat",
"email": "tristan.watanabe@gmail.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: Migrate to new package structure.",
"packageName": "@fluentui/react-portal-compat-context",
"email": "tristan.watanabe@gmail.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
bundle-size/
config/
coverage/
e2e/
docs/
etc/
node_modules/
src/
stories/
dist/types/
temp/
__fixtures__
Expand All @@ -16,7 +17,7 @@ __tests__
*.api.json
*.log
*.spec.*
*.stories.*
*.cy.*
*.test.*
*.yml

Expand Down
5 changes: 3 additions & 2 deletions packages/react-components/react-portal-compat/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
bundle-size/
config/
coverage/
e2e/
docs/
etc/
node_modules/
src/
stories/
dist/types/
temp/
__fixtures__
Expand All @@ -16,7 +17,7 @@ __tests__
*.api.json
*.log
*.spec.*
*.stories.*
*.cy.*
*.test.*
*.yml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { mount as mountBase } from '@cypress/react';
import { FluentProvider } from '@fluentui/react-provider';
import { teamsLightTheme } from '@fluentui/react-theme';
import { PortalCompatProvider } from '../src';
import { PortalCompatProvider } from '@fluentui/react-portal-compat';
import { usePortalCompat } from '@fluentui/react-portal-compat-context';

const mount = (element: JSX.Element) => {
Expand All @@ -21,7 +21,7 @@ describe('PortalCompat', () => {
if (ref.current) {
return registerPortal(ref.current);
}
}, []);
}, [registerPortal]);

return (
<div ref={ref}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"extends": "../tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"isolatedModules": false,
"types": ["node", "cypress", "cypress-storybook/cypress", "cypress-real-events"],
"lib": ["ES2019", "dom"]
},
"include": ["**/*.ts", "**/*.tsx"]
"include": ["**/*.cy.ts", "**/*.cy.tsx"]
}
3 changes: 3 additions & 0 deletions packages/react-components/react-portal-compat/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
},
{
"path": "./tsconfig.spec.json"
},
{
"path": "./tsconfig.cy.json"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"inlineSources": true,
"types": ["static-assets", "environment"]
},
"exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"],
"exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.cy.ts", "**/*.cy.tsx"],
"include": ["./src/**/*.ts", "./src/**/*.tsx"]
}
5 changes: 3 additions & 2 deletions packages/react-components/react-portal/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
bundle-size/
config/
coverage/
e2e/
docs/
etc/
node_modules/
src/
stories/
dist/types/
temp/
__fixtures__
Expand All @@ -16,7 +17,7 @@ __tests__
*.api.json
*.log
*.spec.*
*.stories.*
*.cy.*
*.test.*
*.yml

Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/react-portal/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const rootMain = require('../../../../.storybook/main');

module.exports = /** @type {Omit<import('../../../../.storybook/main'), 'typescript'|'babel'>} */ ({
...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) };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}

0 comments on commit ad9ff1b

Please sign in to comment.