Definitions extracts the api-definition.json from the proto generated api.json.
()
| 141 | |
| 142 | // Definitions extracts the api-definition.json from the proto generated api.json. |
| 143 | func (k JsSDK) Definitions() error { |
| 144 | mg.Deps(Proto.JsSDK, JsSDK.AllowedFieldMaskPaths) |
| 145 | ok, err := target.Path( |
| 146 | filepath.Join("sdk", "js", "generated", "api-definition.json"), |
| 147 | filepath.Join("sdk", "js", "generated", "api.json"), |
| 148 | filepath.Join("sdk", "js", "generated", "allowed-field-mask-paths.json"), |
| 149 | ) |
| 150 | if err != nil { |
| 151 | return targetError(err) |
| 152 | } |
| 153 | if !ok { |
| 154 | return nil |
| 155 | } |
| 156 | if mg.Verbose() { |
| 157 | fmt.Println("Extracting api definitions from protos") |
| 158 | } |
| 159 | return k.runYarnCommandV("definitions") |
| 160 | } |
| 161 | |
| 162 | // DefinitionsClean removes the generated api-definition.json. |
| 163 | func (k JsSDK) DefinitionsClean(context.Context) error { |
no test coverage detected