Skip to content

Commit c7a483f

Browse files
committed
build: change build type by api-extractor
1 parent ea96be3 commit c7a483f

21 files changed

+179
-19
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ packages/*/lib/
55
packages/*/es/
66
packages/*/dist/
77
packages/*/output/
8+
packages/*/temp/
89
packages/demo/
910
package-lock.json
1011
yarn.lock

api-extractor.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
4+
"mainEntryPointFilePath": "<projectFolder>/temp/index.d.ts",
5+
6+
"compiler": {
7+
"tsconfigFilePath": "<projectFolder>/tsconfig.declaration.json"
8+
},
9+
10+
"dtsRollup": {
11+
"enabled": true,
12+
"untrimmedFilePath": "",
13+
"publicTrimmedFilePath": "<projectFolder>/dist/index.d.ts"
14+
},
15+
16+
"apiReport": {
17+
"enabled": false
18+
},
19+
20+
"docModel": {
21+
"enabled": false
22+
},
23+
"tsdocMetadata": {
24+
"enabled": false
25+
},
26+
27+
"messages": {
28+
"compilerMessageReporting": {
29+
"default": {
30+
"logLevel": "warning"
31+
}
32+
},
33+
34+
"tsdocMessageReporting": {
35+
"default": {
36+
"logLevel": "none"
37+
}
38+
},
39+
40+
"extractorMessageReporting": {
41+
"default": {
42+
"logLevel": "warning"
43+
},
44+
45+
"ae-missing-release-tag": {
46+
"logLevel": "none"
47+
},
48+
49+
"ae-extra-release-tag": {
50+
"logLevel": "none"
51+
}
52+
}
53+
}
54+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"@alilc/build-plugin-lce": "^0.0.5",
3535
"@alilc/lowcode-test-mate": "^1.0.1",
3636
"@changesets/cli": "^2.27.1",
37+
"@microsoft/api-extractor": "^7.43.0",
3738
"@types/node": "^20.11.30",
3839
"@types/react-router": "5.1.18",
3940
"@vitejs/plugin-react": "^4.2.1",
@@ -48,8 +49,7 @@
4849
"rimraf": "^5.0.2",
4950
"rollup": "^4.13.0",
5051
"vite": "^5.1.6",
51-
"vitest": "^1.3.1",
52-
"vite-plugin-dts": "^3.7.3"
52+
"vitest": "^1.3.1"
5353
},
5454
"engines": {
5555
"node": ">=18"

packages/types/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"module": "dist/lowcodeTypes.js",
88
"types": "dist/index.d.ts",
99
"exports": {
10-
".": "./dist/lowcodeTypes.js"
10+
".": {
11+
"import": "./dist/lowcodeTypes.js",
12+
"module": "./dist/lowcodeTypes.js",
13+
"types": "./dist/index.d.ts"
14+
},
15+
"./package.json": "./package.json"
1116
},
1217
"files": [
1318
"dist",
@@ -16,6 +21,7 @@
1621
],
1722
"scripts": {
1823
"build": "vite build",
24+
"build-dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
1925
"test": "vitest"
2026
},
2127
"dependencies": {

packages/types/src/event/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export interface EventConfig {
66
[eventName: string]: any;
77
}
88

9-
export type { Node };
9+
export { Node };

packages/types/src/event/node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as Prop from './prop';
22

3-
export type { Prop };
3+
export { Prop };
44

55
export interface RerenderOptions {
66
time: number;
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+
"emitDeclarationOnly": true,
5+
"declaration": true,
6+
"outDir": "temp",
7+
"stripInternal": true
8+
}
9+
}

packages/types/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
36
"include": ["src"]
47
}

packages/types/vite.config.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { defineConfig } from 'vite';
22
import { resolve } from 'node:path';
3-
import dts from 'vite-plugin-dts';
43

54
export default defineConfig({
65
build: {
@@ -13,12 +12,4 @@ export default defineConfig({
1312
fileName: 'lowcodeTypes',
1413
},
1514
},
16-
plugins: [
17-
dts({
18-
rollupTypes: true,
19-
compilerOptions: {
20-
stripInternal: true,
21-
},
22-
}),
23-
],
2415
});

packages/utils/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
"module": "dist/index.js",
88
"types": "dist/index.d.ts",
99
"exports": {
10-
".": "./dist/lowCodeUtils.js"
10+
".": {
11+
"import": "./dist/lowCodeUtils.js",
12+
"types": "./dist/index.d.ts"
13+
},
14+
"./package.json": "./package.json"
1115
},
1216
"sideEffects": [
1317
"*.css"
@@ -19,6 +23,7 @@
1923
],
2024
"scripts": {
2125
"build": "vite build",
26+
"build-dts": "tsc -p tsconfig.declaration.json && node ../../scripts/rollup-dts.mjs",
2227
"test": "vitest"
2328
},
2429
"dependencies": {

0 commit comments

Comments
 (0)