JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q43385F
  • License ISC

programming language interface to idl.and idl to programing language.

Package Exports

  • lang2idl

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lang2idl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

  1. What is it?

         this is a tool for create a json idl(interface description lanauge) from groovy/java/c# etc, and convert idl to typescript/java/groovy/c# etc.
  2. How use?

  • 1、install:

    • npm install:

      npm install -g lang2idl
        or
      git clone git@github.com:nofdev/lang2idl.git
      
      cd lang2idl
      
      npm link #this command will create a link to current folder.
  • 2、use

    • create json idl from groovy:

      groovy2idl "groovy files or dir path" // the files path is not must if current folder had groovy files.
    • create json idl from c#:

      cs2idl "cs files or dir path" // the files path is not must if current folder had cs files.

      Before execute commands below, you need change the json idl file name as a package name, for example:nofdev-userfacade.

    • create typescript from json idl:

      idl2ts "json idl file path" // the json idl file path is must.
    • create groovy from json idl:

      idl2groovy "json idl file path" // the json idl file path is must.
    • create cs from json idl:

      idl2cs "json idl file path" // the json idl file path is must.
  • 3、publish:

    After convert json idl to lang file, you can publish it to npmjs/nuget/maven repository, then other developer can use it as a package.

    • npm package:

      cd npm-package
      
      npm build
      
      npm publish
  1. About code document

    Standard code:

    
      /**
      * 换绑手机号(没有关联护照的账号,可以正常绑定手机号和修改绑定的手机号
      * @description 1.判断手机号是否已绑定网账号,如果已绑定,不能换绑
      * @description 2.判断手机号是否是护照
      * @description   2.1. 如果是护照,验证护照手机号+验证码登录的逻辑,换绑网手机号、绑定护照
      * @description   2.2. 如果不是护照,验证网换绑手机号的短信验证,走网换绑手机号的逻辑
      * @author MengQiang
      * @param mobile 换绑后的手机号 eg.13411011011
      * @param smsVerificationCode 短信验证码 eg.888888
      * @param smsTokenId 短信验证码TokenId
      * */
      void changeBindingMobileForMe(String mobile, String smsVerificationCode,String smsTokenId);Ï
    

    The comments that not start with '@' is method's comments. Start with '@author' is the author of code block. Start with '@param' are args comments, and the eg.xxx is for test value. Start with '@return' is the method return result comments.

  2. About import

    If import other package, must not use '*' in import code line, because the converter need match the custom type's package, use '*' can't match it nicety.

  3. About property(groovy)

    Property code must end with ';' for split property code block in groovy.