Git Product home page Git Product logo

Comments (7)

Glavin001 avatar Glavin001 commented on May 31, 2024 2

I'm thinking of adding a dependencies property to the Beautifier.

Modelled after VSCode's launch.json: https://code.visualstudio.com/docs/editor/debugging#_launch-configurations

{
  "dependencies": [
    {
      "type": "node",
      "name": "Prettier",
      "package": "prettier"
    },
    {
      "type": "exec",
      "name": "PHP-CS-Fixer",
      "program": "php-cs-fixer",
      "version": {
        "parse": (text: string) => {
          try {
            return text.match(/version (.*) by/)[1] + ".0";
          } catch (error) {
            return text.match(/PHP CS Fixer (\d+\.\d+\.\d+)/)[1];
          }
        }
      },
      "docker": {
        "image": "unibeautify/php-cs-fixer"
      }
    },
  ]
}

from unibeautify.

Glavin001 avatar Glavin001 commented on May 31, 2024

Dependency types

node

Node.js package. Can be required from various sources, in order:

  1. local (in node_modules)
  2. global (requireg)
  3. builtin (such as editor extension)

exec

Execute a non-Node.js module from command-line.
Test installation by checking version.

docker

Fallback to using Docker.

from unibeautify.

Glavin001 avatar Glavin001 commented on May 31, 2024

Another idea is:

{
  "dependencies": {
    "Prettier": {
      "type": "node",
      "package": "prettier"
    },
    "PHP-CS-Fixer": {
      "type": "exec",
      "program": "php-cs-fixer",
      "version": {
        "parse": (text: string) => {
          try {
            return text.match(/version (.*) by/)[1] + ".0";
          } catch (error) {
            return text.match(/PHP CS Fixer (\d+\.\d+\.\d+)/)[1];
          }
        }
      },
      "docker": {
        "image": "unibeautify/php-cs-fixer"
      }
    }
  }
}

from unibeautify.

stevenzeck avatar stevenzeck commented on May 31, 2024

I would vote for the first example.

from unibeautify.

Glavin001 avatar Glavin001 commented on May 31, 2024

@szeck87 : Feel free to use the 👍 reaction 😉.

I do as well and am implementing it as such now.

from unibeautify.

Glavin001 avatar Glavin001 commented on May 31, 2024

Pull Request in progress! #63

from unibeautify.

Glavin001 avatar Glavin001 commented on May 31, 2024

Published to v0.12.0

from unibeautify.

Related Issues (20)

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.