2.2 KiB
2.2 KiB
Regenerating Code
- Please execute
npm install
locally from the root of the cloned repo (This will install gulp locally for the repo). - Please install gulp globally
npm install gulp -g
- Please install autorest
npm install -g autorest
- Check the help
autorest --help
- Make sure you have updated the mappings object correctly for generating the source code for your service
- To list all the tasks execute
gulp -T
from the root of the repo - Regenertion command options
- If you want to regenerate all the services then execute
gulp codegen
- If you want to generate for your project then execute
gulp codegen --project <your project name a.k.a the key of the mappings object in codegen_mappings.json>
- If you want to use a local file then save the file locally say "D:\sdk" and make sure to have the same path as defined in the source of your project in the mappings object. Execute
gulp codegen --spec-root "D:\sdk" --project <your-project-name>
.
- If you want to regenerate all the services then execute
- If generation is successful then you will see the generated code in the lib folder under
lib/services/<YourServiceName>
- Make sure you have License.txt (MIT), README.md and package.json file. Take a look at StorageManagement2 as an example.
- Please make sure to have accurate examples in README.md as that is what customers will see when they search for your client libraries on npm.
- If you are adding a brand new client library or adding a new client to your library then please make sure that a function to create a client for your service is exported in the rollup azure file (azure-sdk-for-node/lib/azure.js). You can take a look at an exported function as an example over here.
Publishing to npm
- Once your PR is merged into the master branch, you can publish your package to npm by following the instructions in "step 6" over here