Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency Manager in core #58

Closed
7 tasks done
Glavin001 opened this issue Mar 8, 2018 · 7 comments
Closed
7 tasks done

Dependency Manager in core #58

Glavin001 opened this issue Mar 8, 2018 · 7 comments
Assignees
Milestone

Comments

@Glavin001
Copy link
Member

Glavin001 commented Mar 8, 2018

Add support for beautifiers with executables (port from Atom-Beautify)

See Glavin001/atom-beautify#1687

@Glavin001
Copy link
Member Author

Glavin001 commented Mar 17, 2018

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"
      }
    },
  ]
}

@Glavin001
Copy link
Member Author

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.

@Glavin001
Copy link
Member Author

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"
      }
    }
  }
}

@stevenzeck
Copy link
Contributor

I would vote for the first example.

@Glavin001
Copy link
Member Author

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

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

@Glavin001
Copy link
Member Author

Pull Request in progress! #63

Glavin001 added a commit that referenced this issue Mar 22, 2018
Glavin001 added a commit that referenced this issue Mar 27, 2018
Glavin001 added a commit that referenced this issue Mar 29, 2018
@Glavin001 Glavin001 added this to the Next Release milestone Apr 1, 2018
@Glavin001 Glavin001 changed the title Add support for beautifiers with executables (port from Atom-Beautify) Dependency Manager in core Apr 6, 2018
Glavin001 added a commit that referenced this issue Apr 7, 2018
See #58. Improve Dependency not installed error message
Glavin001 added a commit that referenced this issue Apr 9, 2018
Glavin001 added a commit that referenced this issue Apr 10, 2018
@Glavin001
Copy link
Member Author

Published to v0.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants