-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: change build type by api-extractor
- Loading branch information
Showing
21 changed files
with
179 additions
and
19 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
|
||
"mainEntryPointFilePath": "<projectFolder>/temp/index.d.ts", | ||
|
||
"compiler": { | ||
"tsconfigFilePath": "<projectFolder>/tsconfig.declaration.json" | ||
}, | ||
|
||
"dtsRollup": { | ||
"enabled": true, | ||
"untrimmedFilePath": "", | ||
"publicTrimmedFilePath": "<projectFolder>/dist/index.d.ts" | ||
}, | ||
|
||
"apiReport": { | ||
"enabled": false | ||
}, | ||
|
||
"docModel": { | ||
"enabled": false | ||
}, | ||
"tsdocMetadata": { | ||
"enabled": false | ||
}, | ||
|
||
"messages": { | ||
"compilerMessageReporting": { | ||
"default": { | ||
"logLevel": "warning" | ||
} | ||
}, | ||
|
||
"tsdocMessageReporting": { | ||
"default": { | ||
"logLevel": "none" | ||
} | ||
}, | ||
|
||
"extractorMessageReporting": { | ||
"default": { | ||
"logLevel": "warning" | ||
}, | ||
|
||
"ae-missing-release-tag": { | ||
"logLevel": "none" | ||
}, | ||
|
||
"ae-extra-release-tag": { | ||
"logLevel": "none" | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -6,4 +6,4 @@ export interface EventConfig { | |
[eventName: string]: any; | ||
} | ||
|
||
export type { Node }; | ||
export { Node }; |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"emitDeclarationOnly": true, | ||
"declaration": true, | ||
"outDir": "temp", | ||
"stripInternal": 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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "dist" | ||
}, | ||
"include": ["src"] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"emitDeclarationOnly": true, | ||
"declaration": true, | ||
"outDir": "temp", | ||
"stripInternal": true, | ||
"paths": {} | ||
} | ||
} |
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
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": { | ||
"emitDeclarationOnly": true, | ||
"declaration": true, | ||
"outDir": "temp", | ||
"stripInternal": 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
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": { | ||
"emitDeclarationOnly": true, | ||
"declaration": true, | ||
"outDir": "temp", | ||
"stripInternal": 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
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": { | ||
"emitDeclarationOnly": true, | ||
"declaration": true, | ||
"outDir": "temp", | ||
"stripInternal": 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,43 @@ | ||
import { join } from 'node:path'; | ||
import { existsSync, readdirSync } from 'node:fs'; | ||
import { Extractor, ExtractorConfig } from '@microsoft/api-extractor'; | ||
import { rimraf } from 'rimraf'; | ||
|
||
const libPath = process.env.PWD; | ||
const packages = readdirSync(join(libPath, 'temp/packages')); | ||
const typeTempIndexPath = join(libPath, 'temp/packages', packages[0], 'src/index.d.ts'); | ||
|
||
if (!existsSync(typeTempIndexPath)) { | ||
console.error('🚨类型入口路径错误'); | ||
process.exit(1); | ||
} | ||
|
||
async function run() { | ||
const configObject = ExtractorConfig.loadFile('../../api-extractor.json'); | ||
configObject.mainEntryPointFilePath = typeTempIndexPath; | ||
|
||
const extractorConfig = ExtractorConfig.prepare({ | ||
configObject, | ||
projectFolderLookupToken: libPath, | ||
packageJsonFullPath: join(libPath, 'package.json'), | ||
}); | ||
|
||
const extractorResult = Extractor.invoke(extractorConfig, { | ||
localBuild: true, | ||
showVerboseMessages: true, | ||
}); | ||
|
||
if (extractorResult.succeeded) { | ||
console.log(`🚀类型声明文件生成成功!!!`); | ||
|
||
await rimraf(join(libPath, 'temp')); | ||
} else { | ||
console.error( | ||
'🚨类型声明文件生成失败:' + | ||
+`\n\t${extractorResult.errorCount} errors``\n\tand ${extractorResult.warningCount} warnings`, | ||
); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
run(); |
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