-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(scripts-tasks): make generate-api work in deterministic way (#28215)
* fix(scripts-tasks): disable api-extractor custom path aliases usage which causes invalid api.md and .d.ts rollup generation * chore: add generate-api task definition to lage config * feat(react-conformance): migrate package to v9 setup in order to be able to run generate-api task without build
- Loading branch information
Showing
16 changed files
with
243 additions
and
61 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-conformance-35e35a06-cb99-40ac-9617-72e443ec3109.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "BREAKING CHANGE: migrate package to v9 setup in order to be able to run generate-api task without build", | ||
"packageName": "@fluentui/react-conformance", | ||
"email": "martinhochel@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,37 @@ | ||
.storybook/ | ||
.vscode/ | ||
bundle-size/ | ||
config/ | ||
coverage/ | ||
docs/ | ||
etc/ | ||
node_modules/ | ||
src/ | ||
stories/ | ||
dist/types/ | ||
temp/ | ||
__fixtures__ | ||
__mocks__ | ||
__tests__ | ||
|
||
*.api.json | ||
*.config.js | ||
*.log | ||
*.nuspec | ||
*.spec.* | ||
*.cy.* | ||
*.test.* | ||
*.yml | ||
|
||
# config files | ||
*config.* | ||
*rc.* | ||
.editorconfig | ||
.eslintrc* | ||
.eslintcache | ||
.gitattributes | ||
.gitignore | ||
.vscode | ||
coverage | ||
dist/storybook | ||
dist/*.stats.html | ||
dist/*.stats.json | ||
dist/demo | ||
fabric-test* | ||
gulpfile.js | ||
images | ||
index.html | ||
jsconfig.json | ||
node_modules | ||
results | ||
src/**/* | ||
!src/**/examples/*.tsx | ||
!src/**/docs/**/*.md | ||
!src/**/*.types.ts | ||
temp | ||
tsconfig.json | ||
tsd.json | ||
tslint.json | ||
typings | ||
visualtests | ||
.eslint* | ||
.git* | ||
.prettierignore | ||
.swcrc | ||
|
||
# exclude gitignore patterns explicitly | ||
!lib | ||
!lib-commonjs | ||
!lib-amd | ||
!dist/*.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/swcrc", | ||
"exclude": [ | ||
"/testing", | ||
"/**/*.cy.ts", | ||
"/**/*.cy.tsx", | ||
"/**/*.spec.ts", | ||
"/**/*.spec.tsx", | ||
"/**/*.test.ts", | ||
"/**/*.test.tsx" | ||
], | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript", | ||
"tsx": true, | ||
"decorators": false, | ||
"dynamicImport": false | ||
}, | ||
"externalHelpers": true, | ||
"transform": { | ||
"react": { | ||
"runtime": "classic", | ||
"useSpread": true | ||
} | ||
}, | ||
"target": "es2019" | ||
}, | ||
"minify": false, | ||
"sourceMaps": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": "@fluentui/scripts-api-extractor/api-extractor.common.v-next.json", | ||
"mainEntryPointFilePath": "<projectFolder>/../../dist/out-tsc/types/packages/<unscopedPackageName>/src/index.d.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/** Jest test setup file. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
## API Report File for "@fluentui/react-conformance" | ||
|
||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
```ts | ||
|
||
import { ComponentDoc } from 'react-docgen-typescript'; | ||
import * as React_2 from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import * as ts from 'typescript'; | ||
|
||
// @public (undocumented) | ||
export type ConformanceTest<TProps = {}> = (componentInfo: ComponentDoc, testInfo: IsConformantOptions<TProps>, tsProgram: ts.Program) => void; | ||
|
||
// @public (undocumented) | ||
export function isConformant<TProps = {}>(...testInfo: Partial<IsConformantOptions<TProps>>[]): void; | ||
|
||
// @public (undocumented) | ||
export interface IsConformantOptions<TProps = {}> { | ||
Component: React_2.ComponentType<TProps>; | ||
componentPath: string; | ||
disabledTests?: string[]; | ||
displayName: string; | ||
elementRefName?: string; | ||
extraTests?: TestObject<TProps>; | ||
getTargetElement?: (renderResult: ReturnType<typeof render>, attr: keyof React_2.AllHTMLAttributes<HTMLElement> | 'ref' | `data-${string}`) => HTMLElement; | ||
isInternal?: boolean; | ||
primarySlot?: keyof TProps | 'root'; | ||
renderOptions?: Parameters<typeof render>[1]; | ||
requiredProps?: Partial<TProps>; | ||
testOptions?: TestOptions; | ||
tsConfig?: Partial<{ | ||
configName: string; | ||
configDir: string; | ||
}>; | ||
// @deprecated (undocumented) | ||
tsconfigDir?: string; | ||
useDefaultExport?: boolean; | ||
} | ||
|
||
// @public (undocumented) | ||
export interface TestObject<TProps = {}> { | ||
// (undocumented) | ||
[key: string]: ConformanceTest<TProps>; | ||
} | ||
|
||
// @public | ||
export interface TestOptions { | ||
// (undocumented) | ||
'component-has-static-classname'?: { | ||
prefix?: string; | ||
}; | ||
// (undocumented) | ||
'consistent-callback-args'?: { | ||
ignoreProps?: string[]; | ||
}; | ||
// (undocumented) | ||
'consistent-callback-names'?: { | ||
ignoreProps?: string[]; | ||
}; | ||
// (undocumented) | ||
'has-static-classnames'?: { | ||
props: { | ||
[key: string]: string | {}; | ||
}; | ||
expectedClassNames?: { | ||
[key: string]: string; | ||
}; | ||
getPortalElement?: (renderResult: ReturnType<typeof render>) => HTMLElement; | ||
}[]; | ||
} | ||
|
||
// (No @packageDocumentation comment for this package) | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
const { createV8Config: createConfig } = require('@fluentui/scripts-jest'); | ||
// @ts-check | ||
|
||
const config = createConfig({}); | ||
|
||
module.exports = config; | ||
/** | ||
* @type {import('@jest/types').Config.InitialOptions} | ||
*/ | ||
module.exports = { | ||
displayName: 'react-conformance', | ||
preset: '../../jest.preset.js', | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: '<rootDir>/tsconfig.spec.json', | ||
isolatedModules: true, | ||
}, | ||
}, | ||
transform: { | ||
'^.+\\.tsx?$': 'ts-jest', | ||
}, | ||
coverageDirectory: './coverage', | ||
setupFilesAfterEnv: ['./config/tests.js'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"outDir": "lib", | ||
"target": "es6", | ||
"module": "commonjs", | ||
"target": "ES2019", | ||
"noEmit": true, | ||
"jsx": "react", | ||
"declaration": true, | ||
"sourceMap": true, | ||
"experimentalDecorators": true, | ||
"isolatedModules": true, | ||
"importHelpers": true, | ||
"noUnusedLocals": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"moduleResolution": "node", | ||
"preserveConstEnums": true, | ||
"isolatedModules": true, | ||
"lib": ["es2017", "dom"], | ||
"types": ["jest", "node"] | ||
"noUnusedLocals": true | ||
}, | ||
"include": ["src"] | ||
"include": [], | ||
"files": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.lib.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"noEmit": false, | ||
"lib": ["DOM", "ES2019"], | ||
"declaration": true, | ||
"declarationDir": "../../dist/out-tsc/types", | ||
"outDir": "../../dist/out-tsc", | ||
"inlineSources": true, | ||
"types": ["static-assets", "environment", "jest", "node"], | ||
"module": "CommonJS" | ||
}, | ||
"exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"], | ||
"include": ["./src/**/*.ts", "./src/**/*.tsx"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"module": "CommonJS", | ||
"outDir": "dist", | ||
"types": ["jest", "node"] | ||
}, | ||
"include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.