File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -58,3 +58,9 @@ packages locally and test them by either of the following ways:
58
58
1 . Update the dependencies in ` package.json ` to point to the local uncompressed package directories.
59
59
2 . Directly copy the local uncompressed package directories into the ` node_modules/ ` directory
60
60
of a project.
61
+
62
+
63
+ ### Approving public API changes
64
+ If you're making changes to a public API, they need to be propagated to our public API golden files.
65
+ To save the changes you can run ` yarn approve-api <target> ` and to review the changes, you can look
66
+ at the file under ` tools/public_api_guard/<target>.d.ts ` .
Original file line number Diff line number Diff line change 43
43
"resync-caretaker-app" : " ts-node --project scripts scripts/caretaking/resync-caretaker-app-prs.ts" ,
44
44
"ts-circular-deps:check" : " yarn -s ts-circular-deps check --config ./src/circular-deps-test.conf.js" ,
45
45
"ts-circular-deps:approve" : " yarn -s ts-circular-deps approve --config ./src/circular-deps-test.conf.js" ,
46
- "merge" : " ts-node --project scripts scripts/merge-script/cli.ts --config ./merge-config.js"
46
+ "merge" : " ts-node --project scripts scripts/merge-script/cli.ts --config ./merge-config.js" ,
47
+ "approve-api" : " node ./scripts/approve-api-golden.js"
47
48
},
48
49
"version" : " 9.2.2" ,
49
50
"dependencies" : {
Original file line number Diff line number Diff line change
1
+ const shelljs = require ( 'shelljs' ) ;
2
+ const chalk = require ( 'chalk' ) ;
3
+ const path = require ( 'path' ) ;
4
+ const packageName = process . argv [ 2 ] ;
5
+
6
+ if ( ! packageName ) {
7
+ console . error ( chalk . red ( 'No package name has been passed in for API golden approval.' ) ) ;
8
+ process . exit ( 1 ) ;
9
+ }
10
+
11
+ // ShellJS should exit if any command fails.
12
+ shelljs . set ( '-e' ) ;
13
+ shelljs . cd ( path . join ( __dirname , '../' ) ) ;
14
+ shelljs . exec ( `yarn bazel run //tools/public_api_guard:${ packageName } .d.ts_api.accept` ) ;
You can’t perform that action at this time.
0 commit comments