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:
58581 . Update the dependencies in ` package.json ` to point to the local uncompressed package directories.
59592 . Directly copy the local uncompressed package directories into the ` node_modules/ ` directory
6060 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 4343 "resync-caretaker-app" : " ts-node --project scripts scripts/caretaking/resync-caretaker-app-prs.ts" ,
4444 "ts-circular-deps:check" : " yarn -s ts-circular-deps check --config ./src/circular-deps-test.conf.js" ,
4545 "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"
4748 },
4849 "version" : " 9.2.2" ,
4950 "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