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

feat: enable @internal api stripping in all packages and fix export maps #25319

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
be7fe1e
feat(babel-preset-global-context): migrate to internal api and export…
Hotell Oct 19, 2022
85c7e56
feat(global-context): migrate to internal api and export map fix
Hotell Oct 19, 2022
904c899
feat(keyboard-keys): migrate to internal api and export map fix
Hotell Oct 19, 2022
004eb03
feat(priority-overflow): migrate to internal api and export map fix
Hotell Oct 19, 2022
259a59f
feat(react-aria): migrate to internal api and export map fix
Hotell Oct 19, 2022
a8be86d
fix(react-avatar): export map fix
Hotell Oct 19, 2022
995d45e
fix(react-avatar-context): export map fix
Hotell Oct 19, 2022
af5c6fc
feat(react-badge): migrate to internal api and export map fix
Hotell Oct 19, 2022
74508ec
feat(react-button): migrate to internal api and export map fix
Hotell Oct 19, 2022
3acc9b9
feat(react-checkbox): migrate to internal api and export map fix
Hotell Oct 19, 2022
a2ecea9
feat(react-combobox): migrate to internal api and export map fix
Hotell Oct 19, 2022
ba7382d
feat(react-conformance-griffel): migrate to internal api and export m…
Hotell Oct 19, 2022
3219eac
feat(react-context-selector): migrate to internal api and export map fix
Hotell Oct 19, 2022
cc95112
fix(react-dialog): export map fix
Hotell Oct 19, 2022
d1861e4
feat(react-divider): migrate to internal api and export map fix
Hotell Oct 19, 2022
9142f05
feat(react-field): migrate to internal api and export map fix
Hotell Oct 19, 2022
295adcc
feat(react-input): migrate to internal api and export map fix
Hotell Oct 19, 2022
4499541
feat(react-label): migrate to internal api and export map fix
Hotell Oct 19, 2022
f6ada1d
feat(react-link): migrate to internal api and export map fix
Hotell Oct 19, 2022
02524ac
fix(react-overflow): export map fix
Hotell Oct 19, 2022
1b10afa
feat(react-persona): migrate to internal api and export map fix
Hotell Oct 19, 2022
e1be745
fix(react-popover): export map fix
Hotell Oct 20, 2022
e785016
feat(react-portal): migrate to internal api and export map fix
Hotell Oct 20, 2022
e370bc0
feat(react-portal-compat): migrate to internal api and export map fix
Hotell Oct 20, 2022
89f6e47
feat(react-portal-compat-context): migrate to internal api and export…
Hotell Oct 20, 2022
2e65eba
feat(react-positioning): migrate to internal api and export map fix
Hotell Oct 20, 2022
72339c8
feat(react-progress): migrate to internal api and export map fix
Hotell Oct 20, 2022
015434a
feat(react-provider): migrate to internal api and export map fix
Hotell Oct 20, 2022
5ccea8f
feat(react-radio): migrate to internal api and export map fix
Hotell Oct 20, 2022
a7dbdb3
feat(react-select): migrate to internal api and export map fix
Hotell Oct 20, 2022
3520b79
feat(react-shared-contexts): migrate to internal api and export map fix
Hotell Oct 20, 2022
8ed8811
feat(react-spinbutton): migrate to internal api and export map fix
Hotell Oct 20, 2022
d22cbac
feat(react-spinner): migrate to internal api and export map fix
Hotell Oct 20, 2022
29b4987
feat(react-storybook-addon): migrate to internal api and export map fix
Hotell Oct 20, 2022
e54e6c3
feat(react-storybook): migrate to internal api and export map fix
Hotell Oct 20, 2022
3bd2b4c
feat(react-switch): migrate to internal api and export map fix
Hotell Oct 20, 2022
62aaa99
feat(react-tabster): migrate to internal api and export map fix
Hotell Oct 20, 2022
edd8f92
feat(react-theme): migrate to internal api and export map fix
Hotell Oct 20, 2022
e53f8e9
feat(react-textarea): migrate to internal api and export map fix
Hotell Oct 20, 2022
586dbf7
feat(react-theme-sass): migrate to internal api and export map fix
Hotell Oct 20, 2022
c854100
feat(react-toolbar): migrate to internal api and export map fix
Hotell Oct 20, 2022
487eeed
feat(react-utilities): migrate to internal api and export map fix
Hotell Oct 20, 2022
67d6458
feat(theme-designer): migrate to internal api and export map fix
Hotell Oct 20, 2022
820fb8f
fix(react-tooltip): export map fix
Hotell Oct 20, 2022
46f3453
feat(react-components): migrate to internal api and export map fix
Hotell Oct 20, 2022
16c9248
chore(deps): resolve only to 1 @types/node version to mitigate global…
Hotell Oct 20, 2022
2781dbd
fix: fix type errors exposed by node 14 typings
Hotell Nov 3, 2022
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
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"@types/loader-utils": "2.0.3",
"@types/markdown-table": "2.0.0",
"@types/micromatch": "4.0.2",
"@types/node": "10.17.55",
"@types/node": "14.18.32",
"@types/node-fetch": "2.5.7",
"@types/prettier": "2.2.3",
"@types/progress": "2.0.5",
Expand Down Expand Up @@ -339,7 +339,8 @@
"@typescript-eslint/parser": "4.22.0",
"@types/jest-axe/axe-core": "4.2.1",
"eslint": "7.25.0",
"requestretry": "7.0.0"
"requestretry": "7.0.0",
"@types/node": "14.18.32"
},
"syncpack": {
"prod": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/bundle-size/src/utils/buildFixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ module.exports = async function buildFixture(preparedFixture, quiet) {
/* eslint-enable @typescript-eslint/naming-convention */
]);

await fs.writeFile(webpackOutputPath, terserOutput.code);
await fs.writeFile(terserOutputPath, terserOutputMinified.code);
await fs.writeFile(webpackOutputPath, terserOutput.code ?? '');
await fs.writeFile(terserOutputPath, terserOutputMinified.code ?? '');

if (!quiet) {
console.log(
Expand Down
7 changes: 6 additions & 1 deletion packages/bundle-size/src/utils/prepareFixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ const ajv = new Ajv();
/** @typedef {{ name: string }} FixtureMetadata */
/** @typedef {{ absolutePath: string, relativePath: string, name: string }} PreparedFixture */

/**
* @template T
* @typedef {NonNullable<T> & {[P in keyof T]-?: NonNullable<T[P]>;}} RequiredNonNullableRecord<T>
*/

/**
* Prepares a fixture file to be compiled with Webpack, grabs data from a default export and removes it.
*
Expand Down Expand Up @@ -59,7 +64,7 @@ module.exports = async function prepareFixture(fixture) {

/**
* @param {typeof result} value
* @return {value is Required<NonNullable<typeof result>> & {metadata: FixtureMetadata}}
* @return {value is RequiredNonNullableRecord<typeof result> & {metadata: FixtureMetadata}}
*/
function isTransformedFixtureResultHasMetadata(value) {
return Boolean(value && value.metadata && Object.keys(value.metadata).length);
Expand Down
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.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "9.0.0-beta.7",
"description": "Babel preset that transforms createContext calls to use global context shims",
"main": "lib-commonjs/index.js",
"typings": "dist/index.d.ts",
"typings": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/fluentui"
Expand All @@ -19,9 +19,8 @@
"just": "just-scripts",
"lint": "just-scripts lint",
"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/packages/react-components/babel-preset-global-context/src && yarn docs",
"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 @@ -46,5 +45,12 @@
"minor",
"patch"
]
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"compilerOptions": {
"noEmit": false,
"lib": ["ES2019"],
"outDir": "dist",
"declaration": true,
"declarationDir": "dist/types",
"declarationDir": "../../../dist/out-tsc/types",
"outDir": "../../../dist/out-tsc",
"inlineSources": true,
"types": ["static-assets", "environment", "node"],
"module": "CommonJS"
Expand Down
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.

15 changes: 11 additions & 4 deletions packages/react-components/global-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Extension of React createContext to be a true singleton on the global scope",
"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 @@ -21,9 +21,8 @@
"just": "just-scripts",
"lint": "just-scripts lint",
"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/packages/react-components/global-context/src && yarn docs",
"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 @@ -47,5 +46,13 @@
"minor",
"patch"
]
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
}
}
4 changes: 2 additions & 2 deletions packages/react-components/global-context/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", "node"]
},
Expand Down
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/keyboard-keys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Contains a set of keyboard constants for key and keyCode",
"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 @@ -17,10 +17,9 @@
"code-style": "just-scripts code-style",
"just": "just-scripts",
"lint": "just-scripts lint",
"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/packages/react-components/keyboard-keys/src && yarn docs",
"test": "jest --passWithNoTests",
"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 @@ -37,9 +36,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"
}
}
4 changes: 2 additions & 2 deletions packages/react-components/keyboard-keys/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
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.

15 changes: 11 additions & 4 deletions packages/react-components/priority-overflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Vanilla JS utilities to implement overflow menus",
"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,9 +19,8 @@
"just": "just-scripts",
"lint": "just-scripts lint",
"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/packages/react-components/priority-overflow/src && yarn docs",
"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 @@ -36,5 +35,13 @@
"minor",
"patch"
]
},
"exports": {
".": {
"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
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
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"
}
}
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-avatar-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Context to override avatar props",
"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 Down Expand Up @@ -46,5 +46,13 @@
"minor",
"patch"
]
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
}
}
Loading