Giter Site home page Giter Site logo

jossydevers / transpiler-js Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 2.0 7 KB

Transpile javascript code with Babel 7 to make it cross-browser compatible.

Home Page: https://github.com/marketplace/actions/transpiler-js-action

License: MIT License

Dockerfile 7.55% Shell 92.45%
babel7 javascript js compile transpile ecmascript ecmascript2015 es5-javascript compatible browser

transpiler-js's Introduction

Transpiler-JS Action

Package Managers

License

MIT License

Version

GitHub Release

Github action to transpile javascript code to make it cross-browser compatible, using @babel/cli, @babel/core and @babel/preset-env packages.

Usage

Here the target branch is master. You need to checkout your repository so the ES2015 Trasnpiler job can access it. Then, you can auto-commit the files to the repository if desired.

name: Transpiler-JS Workflow
on:
  push:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      # Checks-out your repository
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.ref }}
          
      # Job for transpiler the code
      - name: 'Transpiler-JS Action'
        uses: jossydevers/[email protected]
        with:
          # If the typename is specified, the transpilation result file will be as follows path/filename.{tipename}.js
          # By default the value is 'release'
          typename: 'release' # (OPTIONAL)
          # Directory in which to start searching for files to transpile
          # By default the entire repository is transpiled
          directory: 'src/' # (OPTIONAL)
          # Directory where the transpilation result will be stored
          # By default each transpiled file is saved in the folder next to the original file
          output: 'transpile/' # (OPTIONAL)
          
      # Auto-commit to repository
      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: 'Github Action : Code Transpiled'
          branch: ${{ github.ref }}

transpiler-js's People

Contributors

jossydevers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

transpiler-js's Issues

Commits the node_modules directory in a non-node project

It does not have support for Class properties.

SyntaxError: /github/workspace/assets/js/main.js: Support for the experimental syntax 'classProperties' isn't currently enabled (2:27):

  1 | class  Theme{
> 2 |     hasMenuOpacityEnabled = false;
    |                           ^
  3 |     hoveredIn = false;
  4 | 
  5 |     LIGHT_LIGHT = "light_light_theme";

There is already a fix around on stackoverflow - Link here.

Typename breaks all the require statements

I'm currently trying to use this action to transpile my package code before publishing to npm and unfortunately it breaks every require links because of the new file names, is there any way to fix this?

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.