dprint-plugin-typescript 0.33.0

TypeScript code formatting plugin for dprint.
Documentation
name: CI

on: [push, pull_request]

jobs:
  build:
    name: ${{ matrix.config.kind }} ${{ matrix.config.os }}
    runs-on: ${{ matrix.config.os }}
    strategy:
      matrix:
        config:
          - os: ubuntu-16.04
            kind: test_release
          - os: ubuntu-16.04
            kind: test_debug

    env:
      CARGO_INCREMENTAL: 0
      RUST_BACKTRACE: full

    steps:
    - uses: actions/checkout@v2
    - name: Install wasm32 target
      if: matrix.config.kind == 'test_release'
      run: rustup target add wasm32-unknown-unknown

    - name: Cache cargo
      uses: actions/cache@v2
      with:
        path: |
          ~/.cargo/registry
          ~/.cargo/git
          target
        key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

    - name: Build debug
      if: matrix.config.kind == 'test_debug'
      run: cargo build --verbose
    - name: Test debug
      if: matrix.config.kind == 'test_debug'
      run: cargo test --verbose

    - name: Build release
      if: matrix.config.kind == 'test_release'
      run: cargo build --target wasm32-unknown-unknown --features "wasm" --release --verbose
    - name: Test release
      if: matrix.config.kind == 'test_release'
      run: cargo test --release --verbose

    - name: Get tag version
      if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/')
      id: get_tag_version
      run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}

    - name: Pre-release
      if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/')
      run: |
        cd target/wasm32-unknown-unknown/release/
        mv dprint_plugin_typescript.wasm typescript-${{ steps.get_tag_version.outputs.TAG_VERSION }}.wasm

    - name: Release
      uses: softprops/action-gh-release@v1
      if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/')
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        files: |
          target/wasm32-unknown-unknown/release/typescript-${{ steps.get_tag_version.outputs.TAG_VERSION }}.wasm
        body: |
          ## Install

          [Install](https://dprint.dev/install/) and [setup](https://dprint.dev/setup/) dprint.

          Then in your project's *.dprintrc.json*:

          1. Specify the plugin url in the `"plugins"` array.
          2. Ensure `.ts`, `.tsx`, `.js`, `.jsx`, `.mjs` file extensions are matched in an `"includes"` pattern.
          3. Add a `"typescript"` configuration property if desired.
             ```jsonc
             {
               // ...etc...
               "typescript": {
                 // TypeScript & JavaScript config goes here
               },
               "includes": [
                 "**/*.{ts,tsx,js,jsx,mjs}"
               ],
               "plugins": [
                 "https://plugins.dprint.dev/typescript-${{ steps.get_tag_version.outputs.TAG_VERSION }}.wasm"
               ]
             }
             ```
        draft: true