Git Product home page Git Product logo

snys98 / autorest.typescript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure/autorest.typescript

0.0 2.0 0.0 986 KB

Extension for AutoRest (https://github.com/Azure/autorest) that generates TypeScript code. The transpiled javascript code is isomorphic. It can be run in browser and in node.js environment.

License: MIT License

CoffeeScript 0.40% JavaScript 0.03% C# 4.46% TypeScript 95.11%

autorest.typescript's Introduction

Installation

npm install -g autorest

Usage

  • Basic Usage:
autorest --typescript --output-folder=<path-to-the-output-folder(usually upto lib or src folder of your project)> --license-header=MICROSOFT_MIT_NO_VERSION --input-file=<path-to-swagger-spec> --package-name=<your-package-name> --package-version<your-package-version>
  • If you have a markdown config file then there is no need to use --input-file, simply provide the path to the markdown file:
autorest --typescript --output-folder=<path-to-the-output-folder(usually upto lib or src folder of your project)> --license-header=MICROSOFT_MIT_NO_VERSION <path-to-readme.md> --package-name=<your-package-name> --package-version<your-package-version>
  • If you want to generate metadata files (package.json, .npmignore, webpack.config.js, tsconfig.json, README.md(with a sample)), then provide --generate-metadata=true:

NOTE: This will generate all the metadata files one level above the output-folder.

autorest --typescript --output-folder=<path-to-the-output-folder(usually upto lib or src folder of your project)> --license-header=MICROSOFT_MIT_NO_VERSION --input-file=<path-to-swagger-spec> --package-name=<your-package-name> --package-version<your-package-version> --generate-metadata=true
  • For generating a client for an azure service, provide --typescript.azure-arm=true:
autorest --typescript --output-folder=<path-to-the-output-folder(usually upto lib or src folder of your project)> --license-header=MICROSOFT_MIT_NO_VERSION --input-file=<path-to-swagger-spec> --package-name=<your-package-name> --package-version<your-package-version> --generate-metadata=true --typescript.azure-arm=true

Development

Building the project

After cloning the repo, execute:

  • npm install
  • npm install -g gulp (gulp should be installed globally too)
  • npm run build

Testing the developed changes

  • gulp regenerate
  • gulp test

Debugging using vscode

Add the --typescript.debugger to the command line and then use the Attach to Debugger option from vscode. Attach to the dotnet.exe process id that is provided in the command line. We have the .vscode folder in the repo that has the config for attaching to the debugger.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

AutoRest extension configuration

use-extension:
  "@microsoft.azure/autorest.modeler": "2.1.23"

pipeline:
  typescript/modeler:
    input: swagger-document/identity
    output-artifact: code-model-v1
    scope: typescript
  typescript/commonmarker:
    input: modeler
    output-artifact: code-model-v1
  typescript/cm/transform:
    input: commonmarker
    output-artifact: code-model-v1
  typescript/cm/emitter:
    input: transform
    scope: scope-cm/emitter
  typescript/generate:
    plugin: typescript
    input: cm/transform
    output-artifact: source-file-typescript
  typescript/transform:
    input: generate
    output-artifact: source-file-typescript
    scope: scope-transform-string
  typescript/emitter:
    input: transform
    scope: scope-typescript/emitter
    
scope-typescript/emitter:
  input-artifact: source-file-typescript
  output-uri-expr: $key

output-artifact:
- source-file-typescript

autorest.typescript's People

Contributors

amarzavery avatar fearthecowboy avatar msftgits avatar olydis avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.