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-shared-contexts): migrate to new DX #18998

Merged
merged 3 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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": "migrate to new DX",
"packageName": "@fluentui/react-shared-contexts",
"email": "[email protected]",
"dependentChangeType": "none"
}
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ module.exports = {
'<rootDir>/packages/react-slider',
'<rootDir>/packages/make-styles-webpack-loader',
'<rootDir>/packages/react-avatar',
'<rootDir>/packages/react-shared-contexts',
],
};
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"@fluentui/react-portal": { "tags": ["vNext"], "implicitDependencies": [] },
"@fluentui/react-positioning": { "tags": ["vNext"], "implicitDependencies": [] },
"@fluentui/react-provider": { "tags": ["vNext", "platform:web"], "implicitDependencies": [] },
"@fluentui/react-shared-contexts": { "implicitDependencies": [] },
"@fluentui/react-shared-contexts": { "tags": ["vNext", "platform:web"], "implicitDependencies": [] },
"@fluentui/react-storybook": { "implicitDependencies": [] },
"@fluentui/react-tabs": { "implicitDependencies": [] },
"@fluentui/react-tabster": { "tags": ["vNext", "platform:web"], "implicitDependencies": [] },
Expand Down
1 change: 1 addition & 0 deletions packages/react-shared-contexts/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist/<unscopedPackageName>/src/index.d.ts"
}
25 changes: 20 additions & 5 deletions packages/react-shared-contexts/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
let path = require('path');
let { createConfig } = require('@fluentui/scripts/jest/jest-resources');
module.exports = createConfig({
setupFiles: [path.resolve(path.join(__dirname, 'config', 'tests.js'))],
});
// @ts-check

/**
* @type {jest.InitialOptions}
*/
module.exports = {
displayName: 'react-shared-contexts',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsConfig: '<rootDir>/tsconfig.json',
diagnostics: false,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
};
5 changes: 3 additions & 2 deletions packages/react-shared-contexts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"code-style": "just-scripts code-style",
"just": "just-scripts",
"lint": "just-scripts lint",
"start-test": "just-scripts jest-watch",
"update-snapshots": "just-scripts jest -u"
"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-shared-contexts/src && yarn docs",
"test": "jest --passWithNoTests"
},
"devDependencies": {
"@fluentui/eslint-plugin": "^1.3.2",
Expand Down
18 changes: 6 additions & 12 deletions packages/react-shared-contexts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"target": "es5",
"outDir": "lib",
"module": "commonjs",
"target": "ES5",
"module": "CommonJS",
"lib": ["es5", "dom"],
"outDir": "dist",
"jsx": "react",
"declaration": true,
"sourceMap": true,
"experimentalDecorators": true,
"importHelpers": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"preserveConstEnums": true,
"skipLibCheck": true,
"typeRoots": ["../../node_modules/@types", "../../typings"],
"types": ["jest", "custom-global"]
},
"include": ["src"]
}
}
6 changes: 5 additions & 1 deletion workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@
"projectType": "library",
"sourceRoot": "packages/react-provider/src"
},
"@fluentui/react-shared-contexts": { "root": "packages/react-shared-contexts", "projectType": "library" },
"@fluentui/react-shared-contexts": {
"root": "packages/react-shared-contexts",
"projectType": "library",
"sourceRoot": "packages/react-shared-contexts/src"
},
"@fluentui/react-storybook": { "root": "packages/react-storybook", "projectType": "library" },
"@fluentui/react-tabs": { "root": "packages/react-tabs", "projectType": "library" },
"@fluentui/react-tabster": {
Expand Down