diff --git a/change/@fluentui-react-aria-b846e53f-7462-49de-8c81-8cc97493c9c3.json b/change/@fluentui-react-aria-b846e53f-7462-49de-8c81-8cc97493c9c3.json new file mode 100644 index 00000000000000..462d66ac0bce51 --- /dev/null +++ b/change/@fluentui-react-aria-b846e53f-7462-49de-8c81-8cc97493c9c3.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "update tooling config", + "packageName": "@fluentui/react-aria", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/nx.json b/nx.json index cef6e0ffcec5e0..e24f97ebbef731 100644 --- a/nx.json +++ b/nx.json @@ -153,7 +153,7 @@ "implicitDependencies": [] }, "@fluentui/react-aria": { - "tags": ["vNext"], + "tags": ["vNext", "platform:web"], "implicitDependencies": [] }, "@fluentui/react-avatar": { diff --git a/packages/react-aria/.babelrc.json b/packages/react-aria/.babelrc.json index 38bf1f7a945cf8..b51a5457ced106 100644 --- a/packages/react-aria/.babelrc.json +++ b/packages/react-aria/.babelrc.json @@ -1,3 +1,3 @@ { - "plugins": ["annotate-pure-calls", "@babel/transform-react-pure-annotations"] + "plugins": ["module:@fluentui/babel-make-styles", "annotate-pure-calls", "@babel/transform-react-pure-annotations"] } diff --git a/packages/react-aria/.npmignore b/packages/react-aria/.npmignore index fa2d3a7f5111ca..e719afb921bc93 100644 --- a/packages/react-aria/.npmignore +++ b/packages/react-aria/.npmignore @@ -1,4 +1,3 @@ -.cache/ .storybook/ .vscode/ bundle-size/ diff --git a/packages/react-aria/.storybook/main.js b/packages/react-aria/.storybook/main.js index ec377d98606fa9..18a60b265c2cfb 100644 --- a/packages/react-aria/.storybook/main.js +++ b/packages/react-aria/.storybook/main.js @@ -1,12 +1,14 @@ const rootMain = require('../../../.storybook/main'); -module.exports = /** @type {Pick} */ ({ +module.exports = /** @type {Omit} */ ({ + ...rootMain, stories: [...rootMain.stories, '../src/**/*.stories.mdx', '../src/**/*.stories.@(ts|tsx)'], addons: [...rootMain.addons], webpackFinal: (config, options) => { const localConfig = { ...rootMain.webpackFinal(config, options) }; + // add your own webpack tweaks if needed + return localConfig; }, - previewHead: rootMain.previewHead, }); diff --git a/packages/react-aria/.storybook/preview.js b/packages/react-aria/.storybook/preview.js index b52409294c3304..10fd98d02c9454 100644 --- a/packages/react-aria/.storybook/preview.js +++ b/packages/react-aria/.storybook/preview.js @@ -1,3 +1,7 @@ import * as rootPreview from '../../../.storybook/preview'; +/** @type {typeof rootPreview.decorators} */ export const decorators = [...rootPreview.decorators]; + +/** @type {typeof rootPreview.parameters} */ +export const parameters = { ...rootPreview.parameters }; diff --git a/packages/react-aria/.storybook/tsconfig.json b/packages/react-aria/.storybook/tsconfig.json index 3bd9adcd2ee05e..29aa16f2f178f3 100644 --- a/packages/react-aria/.storybook/tsconfig.json +++ b/packages/react-aria/.storybook/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "outDir": "", "allowJs": true, - "checkJs": true + "checkJs": true, + "types": ["static-assets", "environment", "inline-style-expand-shorthand", "storybook__addons"] }, - "exclude": ["../**/*.test.ts", "../**/*.test.js", "../**/*.test.tsx", "../**/*.test.jsx"], - "include": ["../src/**/*", "*.js"] + "include": ["../src/**/*.stories.ts", "../src/**/*.stories.tsx", "*.js"] } diff --git a/packages/react-aria/config/api-extractor.json b/packages/react-aria/config/api-extractor.json index c8406ab42ca3cc..f890ae360b7f7f 100644 --- a/packages/react-aria/config/api-extractor.json +++ b/packages/react-aria/config/api-extractor.json @@ -1,3 +1,4 @@ { + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "extends": "@fluentui/scripts/api-extractor/api-extractor.common.json" } diff --git a/packages/react-aria/config/api-extractor.local.json b/packages/react-aria/config/api-extractor.local.json index c2ea401c1c3685..7974a129e8a337 100644 --- a/packages/react-aria/config/api-extractor.local.json +++ b/packages/react-aria/config/api-extractor.local.json @@ -1,5 +1,5 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "extends": "./api-extractor.json", - "mainEntryPointFilePath": "/dist//src/index.d.ts" + "mainEntryPointFilePath": "/dist/packages//src/index.d.ts" } diff --git a/packages/react-aria/jest.config.js b/packages/react-aria/jest.config.js index 618170f546f7e0..fa92b22ce39c15 100644 --- a/packages/react-aria/jest.config.js +++ b/packages/react-aria/jest.config.js @@ -8,7 +8,7 @@ module.exports = { preset: '../../jest.preset.js', globals: { 'ts-jest': { - tsConfig: '/tsconfig.json', + tsConfig: '/tsconfig.spec.json', diagnostics: false, }, }, diff --git a/packages/react-aria/package.json b/packages/react-aria/package.json index 9b904a9d938223..d42ebc25236a7f 100644 --- a/packages/react-aria/package.json +++ b/packages/react-aria/package.json @@ -20,8 +20,9 @@ "start": "yarn storybook", "test": "jest", "docs": "api-extractor run --config=config/api-extractor.local.json --local", - "build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-aria/src && yarn docs", - "storybook": "start-storybook" + "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-aria/src && yarn docs", + "storybook": "start-storybook", + "type-check": "tsc -b tsconfig.json" }, "devDependencies": { "@fluentui/eslint-plugin": "*", @@ -37,7 +38,8 @@ "enzyme-adapter-react-16": "^1.15.0", "react": "16.8.6", "react-dom": "16.8.6", - "react-test-renderer": "^16.3.0" + "react-test-renderer": "^16.3.0", + "@fluentui/babel-make-styles": "9.0.0-beta.3" }, "dependencies": { "@fluentui/keyboard-keys": "9.0.0-beta.1", diff --git a/packages/react-aria/tsconfig.json b/packages/react-aria/tsconfig.json index 6ed1f3d3bba6c6..affceae1828ae1 100644 --- a/packages/react-aria/tsconfig.json +++ b/packages/react-aria/tsconfig.json @@ -2,17 +2,24 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "target": "ES2019", - "lib": ["ES2019", "DOM"], - "outDir": "dist", - "jsx": "react", - "declaration": true, - "module": "CommonJS", - "experimentalDecorators": true, + "noEmit": true, + "isolatedModules": true, "importHelpers": true, + "jsx": "react", "noUnusedLocals": true, - "preserveConstEnums": true, - "types": ["jest", "custom-global", "inline-style-expand-shorthand"], - "isolatedModules": true + "preserveConstEnums": true }, - "include": ["src"] + "include": [], + "files": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + }, + { + "path": "./.storybook/tsconfig.json" + } + ] } diff --git a/packages/react-aria/tsconfig.lib.json b/packages/react-aria/tsconfig.lib.json new file mode 100644 index 00000000000000..51f5726b71c686 --- /dev/null +++ b/packages/react-aria/tsconfig.lib.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "lib": ["ES2019", "dom"], + "outDir": "dist", + "declaration": true, + "types": ["static-assets", "environment", "inline-style-expand-shorthand"] + }, + "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.stories.ts", "**/*.stories.tsx"], + "include": ["./src/**/*.ts", "./src/**/*.tsx"] +} diff --git a/packages/react-aria/tsconfig.spec.json b/packages/react-aria/tsconfig.spec.json new file mode 100644 index 00000000000000..28fa5226de4204 --- /dev/null +++ b/packages/react-aria/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "CommonJS", + "outDir": "dist", + "types": ["jest", "node", "inline-style-expand-shorthand"] + }, + "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"] +}