Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(react-aria): migrate to new package structure #25199

Merged
merged 11 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-aria",
"email": "[email protected]",
"dependentChangeType": "none"
}
5 changes: 3 additions & 2 deletions packages/react-components/react-aria/.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-aria/.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"]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "@fluentui/scripts/api-extractor/api-extractor.common.v-next.json",
"mainEntryPointFilePath": "<projectFolder>/dist/types/index.d.ts"
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "<projectFolder>/dist/index.d.ts"
}
}

This file was deleted.

12 changes: 6 additions & 6 deletions packages/react-components/react-aria/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "React helper to ensure ARIA",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"typings": "dist/index.d.ts",
"typings": "./dist/index.d.ts",
"sideEffects": false,
"repository": {
"type": "git",
Expand All @@ -19,10 +19,9 @@
"lint": "just-scripts lint",
"start": "yarn storybook",
"test": "jest --passWithNoTests",
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/types/packages/react-components/react-aria/src && yarn docs",
"storybook": "start-storybook",
"type-check": "tsc -b tsconfig.json"
"type-check": "tsc -b tsconfig.json",
"generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
},
"devDependencies": {
"@fluentui/eslint-plugin": "*",
Expand All @@ -48,9 +47,10 @@
},
"exports": {
".": {
"types": "./lib/index.d.ts",
"types": "./dist/index.d.ts",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
}
},
"./package.json": "./package.json"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
Copy link
Contributor

@bsunderhus bsunderhus Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I was planing to simply remove storybook from this package at the moment, since this is an internal package (internal in the meaning of not being re-exported by react-components), and this documentation is not being very helpful at the moment

import { useARIAButtonShorthand } from '../button';
import type { ARIAButtonSlotProps } from '../button';
import { useARIAButtonShorthand } from '@fluentui/react-aria';
import type { ARIAButtonSlotProps } from '@fluentui/react-aria';
import { getSlots } from '@fluentui/react-components';
import type { ComponentState, Slot } from '@fluentui/react-components';

Expand Down
4 changes: 2 additions & 2 deletions packages/react-components/react-aria/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"compilerOptions": {
"noEmit": false,
"lib": ["ES2019", "dom"],
"outDir": "dist",
"declaration": true,
"declarationDir": "dist/types",
"declarationDir": "../../../dist/out-tsc/types",
"outDir": "../../../dist/out-tsc",
"inlineSources": true,
"types": ["static-assets", "environment"]
},
Expand Down
10 changes: 9 additions & 1 deletion packages/react-components/react-aria/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}