Skip to content

Commit 17c38c1

Browse files
react-checkbox: Migration to new DX (#19063)
* Merge to new DX * Change files
1 parent dfe3969 commit 17c38c1

File tree

15 files changed

+87
-29
lines changed

15 files changed

+87
-29
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Merge to new DX",
4+
"packageName": "@fluentui/react-checkbox",
5+
"email": "tkrasniqi@microsoft.com",
6+
"dependentChangeType": "none"
7+
}

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ module.exports = {
3333
'<rootDir>/packages/react-shared-contexts',
3434
'<rootDir>/packages/react-tooltip',
3535
'<rootDir>/packages/react-card',
36+
'<rootDir>/packages/react-checkbox',
3637
],
3738
};

nx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"@fluentui/react-card": { "tags": ["vNext", "platform:web"], "implicitDependencies": [] },
8282
"@fluentui/react-cards": { "implicitDependencies": [] },
8383
"@fluentui/react-charting": { "implicitDependencies": [] },
84-
"@fluentui/react-checkbox": { "implicitDependencies": [] },
84+
"@fluentui/react-checkbox": { "tags": ["vNext", "platform:web"], "implicitDependencies": [] },
8585
"@fluentui/react-components": { "implicitDependencies": [] },
8686
"@fluentui/react-compose": { "implicitDependencies": [] },
8787
"@fluentui/react-conformance": { "implicitDependencies": [] },
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const rootMain = require('../../../.storybook/main');
2+
3+
module.exports = /** @type {Pick<import('../../../.storybook/main').StorybookConfig,'addons'|'stories'|'webpackFinal'>} */ ({
4+
stories: [...rootMain.stories, '../src/**/*.stories.mdx', '../src/**/*.stories.@(ts|tsx)'],
5+
addons: [...rootMain.addons],
6+
webpackFinal: (config, options) => {
7+
const localConfig = { ...rootMain.webpackFinal(config, options) };
8+
9+
return localConfig;
10+
},
11+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as rootPreview from '../../../.storybook/preview';
2+
3+
/** @type {typeof rootPreview.decorators} */
4+
export const decorators = [...rootPreview.decorators];
5+
6+
/** @type {typeof rootPreview.parameters} */
7+
export const parameters = { ...rootPreview.parameters };
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"checkJs": true
6+
},
7+
"exclude": ["../**/*.test.ts", "../**/*.test.js", "../**/*.test.tsx", "../**/*.test.jsx"],
8+
"include": ["../src/**/*", "*.js"]
9+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
23
"extends": "@fluentui/scripts/api-extractor/api-extractor.common.json"
34
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
"extends": "./api-extractor.json",
4+
"mainEntryPointFilePath": "<projectFolder>/dist/<unscopedPackageName>/src/index.d.ts"
5+
}
Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
const { createConfig } = require('@fluentui/scripts/jest/jest-resources');
2-
const path = require('path');
1+
// @ts-check
32

4-
const config = createConfig({
5-
setupFiles: [path.resolve(path.join(__dirname, 'config', 'tests.js'))],
3+
/**
4+
* @type {jest.InitialOptions}
5+
*/
6+
module.exports = {
7+
displayName: 'react-checkbox',
8+
preset: '../../jest.preset.js',
9+
globals: {
10+
'ts-jest': {
11+
tsConfig: '<rootDir>/tsconfig.json',
12+
diagnostics: false,
13+
},
14+
},
15+
transform: {
16+
'^.+\\.tsx?$': 'ts-jest',
17+
},
18+
coverageDirectory: './coverage',
19+
setupFilesAfterEnv: ['./config/tests.js'],
620
snapshotSerializers: ['@fluentui/jest-serializer-make-styles'],
7-
});
8-
9-
module.exports = config;
21+
};

packages/react-checkbox/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
"code-style": "just-scripts code-style",
1818
"just": "just-scripts",
1919
"lint": "just-scripts lint",
20-
"start": "just-scripts dev:storybook",
21-
"start-test": "just-scripts jest-watch",
22-
"test": "just-scripts test",
23-
"update-snapshots": "just-scripts jest -u"
20+
"start": "yarn storybook",
21+
"test": "jest",
22+
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
23+
"build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-checkbox/src && yarn docs",
24+
"storybook": "start-storybook"
2425
},
2526
"devDependencies": {
2627
"@fluentui/eslint-plugin": "^1.3.2",

0 commit comments

Comments
 (0)