Skip to content

Commit 752c49c

Browse files
feat!: update the build to use api-extractor types (GoogleCloudPlatform#383)
This commit updates our build config to use the types generated by the API extractor. This prevents us exposing private implementation details in our type declarations that are not marked `@public`
1 parent 05a0527 commit 752c49c

File tree

6 files changed

+7
-198
lines changed

6 files changed

+7
-198
lines changed

.github/workflows/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ jobs:
1616
- name: Install dependencies
1717
run: npm install
1818
- name: Build TypeScript project
19-
run: npm run docs
19+
run: npm run build
2020
- name: Ensure there are no changes in docs
2121
run: git diff --exit-code docs/

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ jobs:
1616
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
1717
run: |
1818
npm install
19-
npm run compile
19+
npm run build
2020
npm publish

api-extractor.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
"dtsRollup": {
2121
"enabled": true,
22-
"untrimmedFilePath": "docs/generated/api.d.ts",
22+
"untrimmedFilePath": "build/src/index.d.ts",
2323
"omitTrimmingComments": true
2424
},
2525

docs/generated/api.d.ts

-191
This file was deleted.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
},
1919
"scripts": {
2020
"test": "mocha build/test --recursive",
21+
"build": "npm run clean && npm run compile && npm run docs",
2122
"conformance": "./run_conformance_tests.sh",
2223
"check": "gts check",
2324
"clean": "gts clean",
24-
"compile": "rm -rf ./build && tsc -p .",
25+
"compile": "tsc -p .",
2526
"fix": "gts fix",
26-
"predocs": "npm run compile",
2727
"docs": "api-extractor run --local --verbose",
2828
"watch": "npm run compile -- --watch",
29-
"prepare": "npm run compile",
29+
"prepare": "npm run build",
3030
"pretest": "npm run compile"
3131
},
3232
"files": [

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "gts/tsconfig-google.json",
2+
"extends": "./node_modules/gts/tsconfig-google.json",
33
"compilerOptions": {
44
"rootDir": ".",
55
"outDir": "build",

0 commit comments

Comments
 (0)