Skip to content

Commit

Permalink
types: generate types for v3 apis
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 30, 2022
1 parent e5a6fe5 commit 2acb547
Show file tree
Hide file tree
Showing 62 changed files with 957 additions and 104 deletions.
9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@ node_modules
*.log
explorations
TODOs.md
dist/*.gz
dist/*.map
dist/vue.common.min.js
test/e2e/reports
test/e2e/screenshots
coverage
RELEASE_NOTE*.md
dist/*.js
packages/vue-server-renderer/basic.js
packages/vue-server-renderer/build.dev.js
packages/vue-server-renderer/build.prod.js
Expand All @@ -20,3 +13,5 @@ packages/vue-template-compiler/build.js
packages/vue-template-compiler/browser.js
.vscode
dist
temp
types/v3-generated.d.ts
63 changes: 63 additions & 0 deletions api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",

"projectFolder": ".",

"compiler": {
"tsconfigFilePath": "api-extractor.tsconfig.json"
},

"mainEntryPointFilePath": "./temp/src/v3/index.d.ts",

"dtsRollup": {
"enabled": true,
"publicTrimmedFilePath": "./types/v3-generated.d.ts"
},

"apiReport": {
"enabled": false
},

"docModel": {
"enabled": false
},

"tsdocMetadata": {
"enabled": false
},

"messages": {
"compilerMessageReporting": {
"default": {
"logLevel": "warning"
}
},

"extractorMessageReporting": {
"default": {
"logLevel": "warning",
"addToApiReportFile": true
},

"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-internal-missing-underscore": {
"logLevel": "none"
},
"ae-forgotten-export": {
"logLevel": "none"
}
},

"tsdocMessageReporting": {
"default": {
"logLevel": "warning"
},

"tsdoc-undefined-tag": {
"logLevel": "none"
}
}
}
}
35 changes: 35 additions & 0 deletions api-extractor.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"compilerOptions": {
"baseUrl": "./temp",
"outDir": "dist",
"sourceMap": true,
"target": "esnext",
"module": "ESNext",
"moduleResolution": "node",
"strict": true,

"allowJs": true,
"noImplicitAny": false,
"noImplicitThis": false,

"noUnusedLocals": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"removeComments": false,
"jsx": "preserve",
"lib": ["esnext", "dom"],
"paths": {
"compiler/*": ["src/compiler/*"],
"core/*": ["src/core/*"],
"server/*": ["src/server/*"],
"sfc/*": ["src/sfc/*"],
"shared/*": ["src/shared/*"],
"web/*": ["src/platforms/web/*"],
"v3": ["src/v3/index"],
"v3/*": ["src/v3/*"],
"vue": ["src/platforms/web/entry-runtime-with-compiler"]
}
},
"include": ["src", "typescript"]
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
"dev:compiler": "rollup -w -c scripts/config.js --environment TARGET:web-compiler ",
"build": "node scripts/build.js",
"build:ssr": "npm run build -- web-runtime-cjs,web-server-renderer",
"build:types": "rimraf temp && tsc --declaration --emitDeclarationOnly --outDir temp && api-extractor run",
"test": "npm run lint && npm run ts-check && npm run test:types && npm run test:unit && npm run test:e2e",
"test:unit": "vitest run test/unit",
"test:ssr": "npm run build:ssr && vitest run test/ssr",
"test:e2e": "npm run build -- web-full-prod,web-server-renderer-basic && vitest run test/e2e",
"test:transition": "karma start test/transition/karma.conf.js",
"test:types": "tsc -p ./types/tsconfig.json",
"test:types": "npm run build:types && tsc -p ./types/tsconfig.json",
"format": "prettier --write --parser typescript \"(src|test|packages|types)/**/*.ts\"",
"ts-check": "tsc -p tsconfig.json --noEmit",
"ts-check:test": "tsc -p test/tsconfig.json --noEmit",
Expand Down Expand Up @@ -62,6 +63,7 @@
},
"homepage": "https://github.com/vuejs/vue#readme",
"devDependencies": {
"@microsoft/api-extractor": "^7.24.2",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.2.1",
Expand Down Expand Up @@ -98,6 +100,7 @@
"prettier": "^2.6.2",
"puppeteer": "^14.1.1",
"resolve": "^1.22.0",
"rimraf": "^3.0.2",
"rollup": "^2.70.2",
"rollup-plugin-typescript2": "^0.31.2",
"serialize-javascript": "^6.0.0",
Expand Down
Loading

0 comments on commit 2acb547

Please sign in to comment.