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

maven cli wrapper plugin #660

Closed
ennerf opened this issue Jul 30, 2022 · 8 comments · Fixed by #661 or #714
Closed

maven cli wrapper plugin #660

ennerf opened this issue Jul 30, 2022 · 8 comments · Fixed by #661 or #714
Assignees

Comments

@ennerf
Copy link

ennerf commented Jul 30, 2022

Reading through the documentation I wasn't sure how to best integrate with Maven, so I wrote a small plugin that downloads and calls the CLI:

sass-cli-maven-plugin

Feel free to add it to the docs, or ignore if there is already a better way to do it.

@nex3 nex3 transferred this issue from sass/dart-sass Aug 2, 2022
Goodwine added a commit that referenced this issue Aug 3, 2022
@Goodwine
Copy link
Member

Goodwine commented Aug 3, 2022

There was a Maven plugin for libsass but not for dart-sass, thanks for letting us know, I'll add a link shortly :)

Goodwine added a commit that referenced this issue Aug 3, 2022
@melloware
Copy link

There is a full proper wrapper now using Dart Sass with Maven or Gradle.

https://github.com/cleydyr/dart-sass-maven-plugin

@nex3
Copy link
Contributor

nex3 commented Mar 20, 2023

What's the difference between that and the plugin linked above?

@melloware
Copy link

melloware commented Mar 20, 2023

I am pretty sure the one I posted supports all 3 OS Windows Linux MacOS and knows which you are using. also has a Sass Watch properly integrated. I didn't study the first one in detail to compare the two but the latter emulates was the old lib sass plug-in did almost exactly.

@ennerf
Copy link
Author

ennerf commented Mar 21, 2023

the one I posted supports all 3 OS Windows Linux MacOS and knows which you are using. also has a Sass Watch properly integrated.

The first one does as well. I had a quick look at the source code and I think the main differences are:

sass-cli-maven-plugin

  • supports arbitrary versions of the dart plugin and downloads the specified version for the host OS
  • cli arguments are specified as an<args> list and passed to the executable, e.g., <arg>--embedd-sources</arg>
  • currently the only argument with special Maven support is watch. I could add more maven parameters, but I thought the dart-sass parameters were already pretty intuitive as is
  • the reasoning behind this approach was to support new versions/features immediately without requiring a plugin release

dart-sass-maven-plugin

  • bundles a fixed version of dart-sass in the jar and extracts it at runtime
  • the arguments are exposed as maven parameters, i.e., <embedSources>true</<embedSources>
  • the bundled approach requires matching plugin releases for new sass-dart releases

Basically one is a thin wrapper around the CLI executable, and the other one is an abstraction on top that hides the actual calls. It looks like the dart-sass plugin was started a bit earlier, so I wouldn't have written another one if I had been aware of it. That being said, I don't like that the latest plugin release is already at least 9 months worth of dart-sass releases out of date.

@melloware
Copy link

That is a good summary that one is a thin CLI wrapper the other is an abstraction so users don't have to know anything about Dart SASS. I do agree the included DART executables is nice for not needing an internet connection but does make waiting for releases a pain. I like the way the FrontEnd NPM plugin works where you say what version you want it it downloads and caches it.

Maybe you two plugin developers can work together to make 1 great Maven plugin for Dart SASS.

@ennerf
Copy link
Author

ennerf commented Mar 21, 2023

I like the way the FrontEnd NPM plugin works where you say what version you want it it downloads and caches it.

This is how the sass-cli plugin works. Versioned executables get cached and are only downloaded on first execution.

Maybe you two plugin developers can work together to make 1 great Maven plugin for Dart SASS.

The cli-plugin already exposes all features of dart-sass, so it's mostly about providing some maven wrappers for auto-complete, and maybe some added documentation in the Readme. Can you create an issue on the repo about what you're actually missing? Many parameters, e.g., <noCharset> are probably used so infrequently that it hardly seems worth it to add wrappers that could potentially break in the future.

@nex3
Copy link
Contributor

nex3 commented Mar 23, 2023

@Goodwine Can you add the other plugin to the list with a summary of the differences?

@nex3 nex3 reopened this Mar 23, 2023
Goodwine added a commit that referenced this issue Apr 5, 2023
Document the differences between both Maven plugins

Fixes #660
asaf400 pushed a commit to asaf400/ass-site that referenced this issue Apr 18, 2024
asaf400 pushed a commit to asaf400/ass-site that referenced this issue Apr 18, 2024
Document the differences between both Maven plugins

Fixes sass#660
asaf400 pushed a commit to asaf400/ass-site that referenced this issue Apr 18, 2024
asaf400 pushed a commit to asaf400/ass-site that referenced this issue Apr 18, 2024
Document the differences between both Maven plugins

Fixes sass#660
Friendly-users added a commit to Friendly-users/sass-site that referenced this issue Jun 27, 2024
-----
It is inappropriate to include political and offensive content in public code repositories.

Public code repositories should be neutral spaces for collaboration and community, free from personal or political views that could alienate or discriminate against others. Political content, especially that which targets or disparages minority groups, can be harmful and divisive. It can make people feel unwelcome and unsafe, and it can create a hostile work environment.

Please refrain from adding such content to public code repositories.
---

 sass#600 sass#601 sass#602 #603 sass#604 sass#605 sass#606 sass#607 sass#608 sass#609 sass#610 sass#611 sass#612 sass#613 sass#614 sass#615 sass#616 sass#617 sass#618 sass#619 sass#620 sass#621 sass#622 #623 sass#624 sass#625 sass#626 sass#627 sass#628 sass#629 sass#630 sass#631 sass#632 sass#633 sass#634 sass#635 sass#636 sass#637 sass#638 sass#639 sass#640 sass#641 sass#642 sass#643 sass#644 sass#645 sass#646 sass#647 sass#648 sass#649 sass#650 sass#651 sass#652 sass#653 sass#654 sass#655 sass#656 sass#657 sass#658 sass#659 sass#660 sass#661 sass#662 sass#663 sass#664 sass#665 sass#666 sass#667 sass#668 sass#669 sass#670 sass#671 sass#672 sass#673 sass#674 sass#675 sass#676 sass#677 sass#678 sass#679 sass#680 sass#681 sass#682 sass#683 sass#684 sass#685 sass#686 sass#687 sass#688 sass#689 sass#690 sass#691 sass#692 sass#693 sass#694 sass#695 sass#696 sass#697 sass#698 sass#698 sass#699
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants