-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
prettier: Add official plugins #442943
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
Open
S0AndS0
wants to merge
6
commits into
NixOS:master
Choose a base branch
from
S0AndS0:prettier-plugins-official
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
prettier: Add official plugins #442943
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4bcd94c
prettier-plugin-xml: init at 3.4.2
S0AndS0 3b3e009
prettier-plugin-ruby: init at 4.0.4
S0AndS0 d73d6cd
prettier-plugin-pug: init at 3.4.2
S0AndS0 fa836af
prettier-plugin-php: init at 0.24.0
S0AndS0 ccf10b7
prettier: Update top-level doc-comment
S0AndS0 6538e98
prettier: delete impure import in `composition.nix`
S0AndS0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| pkgs: lib: self: super: | ||
|
|
||
| ### Deprecated aliases - for backward compatibility | ||
| ### | ||
| ### !!! NOTE !!! | ||
| ### Use `./remove-attr.py [attrname]` in this directory to remove your alias | ||
| ### from the `nodePackages` set without regenerating the entire file. | ||
|
|
||
| let | ||
| # Removing recurseForDerivation prevents derivations of aliased attribute | ||
| # set to appear while listing all the packages available. | ||
| removeRecurseForDerivations = | ||
| alias: | ||
| if alias.recurseForDerivations or false then | ||
| lib.removeAttrs alias [ "recurseForDerivations" ] | ||
| else | ||
| alias; | ||
|
|
||
| # Disabling distribution prevents top-level aliases for non-recursed package | ||
| # sets from building on Hydra. | ||
| removeDistribute = alias: if lib.isDerivation alias then lib.dontDistribute alias else alias; | ||
|
|
||
| # Make sure that we are not shadowing something from node-packages.nix. | ||
| checkInPkgs = | ||
| n: alias: | ||
| if builtins.hasAttr n super then throw "Alias ${n} is still in node-packages.nix" else alias; | ||
|
|
||
| mapAliases = | ||
| aliases: | ||
| lib.mapAttrs ( | ||
| n: alias: removeDistribute (removeRecurseForDerivations (checkInPkgs n alias)) | ||
| ) aliases; | ||
| in | ||
|
|
||
| mapAliases { | ||
| ## De-scope -> https://prettier.io/docs/plugins/#official-plugins | ||
| prettier-plugin-php = pkgs.prettier.plugins."@prettier/plugin-php"; | ||
| prettier-plugin-pug = pkgs.prettier.plugins."@prettier/plugin-pug"; | ||
| prettier-plugin-ruby = pkgs.prettier.plugins."@prettier/plugin-ruby"; | ||
| prettier-plugin-xml = pkgs.prettier.plugins."@prettier/plugin-xml"; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # This file has been generated by node2nix 1.11.1. Do not edit! | ||
|
|
||
| { | ||
| pkgs, | ||
| system ? builtins.currentSystem, | ||
| nodejs ? pkgs."nodejs_22", | ||
| }: | ||
|
|
||
| let | ||
| nodeEnv = import ./node-env.nix { | ||
| inherit (pkgs) | ||
| stdenv | ||
| lib | ||
| python2 | ||
| runCommand | ||
| writeTextFile | ||
| writeShellScript | ||
| ; | ||
| inherit pkgs nodejs; | ||
| libtool = if pkgs.stdenv.isDarwin then pkgs.cctools or pkgs.darwin.cctools else null; | ||
| }; | ||
| in | ||
| import ./node-packages.nix { | ||
| inherit (pkgs) | ||
| fetchurl | ||
| nix-gitignore | ||
| stdenv | ||
| lib | ||
| fetchgit | ||
| ; | ||
| inherit nodeEnv; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| config, | ||
| pkgs, | ||
| lib, | ||
| nodejs, | ||
| stdenv, | ||
| }: | ||
|
|
||
| let | ||
| inherit (lib) | ||
| composeManyExtensions | ||
| extends | ||
| makeExtensible | ||
| mapAttrs | ||
| ; | ||
|
|
||
| nodePackages = | ||
| final: | ||
| import ./composition.nix { | ||
| inherit pkgs nodejs; | ||
| inherit (stdenv.hostPlatform) system; | ||
| }; | ||
|
|
||
| mainProgramOverrides = | ||
| final: prev: | ||
| mapAttrs ( | ||
| pkgName: mainProgram: | ||
| prev.${pkgName}.override (oldAttrs: { | ||
| meta = oldAttrs.meta // { | ||
| inherit mainProgram; | ||
| }; | ||
| }) | ||
| ) (import ./main-programs.nix); | ||
|
|
||
| aliases = | ||
| final: prev: lib.optionalAttrs config.allowAliases (import ./aliases.nix pkgs lib final prev); | ||
|
|
||
| extensions = composeManyExtensions [ | ||
| aliases | ||
| mainProgramOverrides | ||
| (import ./overrides.nix { inherit pkgs nodejs; }) | ||
| ]; | ||
| in | ||
| makeExtensible (extends extensions nodePackages) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -eu -o pipefail | ||
|
|
||
| cd "$( dirname "${BASH_SOURCE[0]}" )" | ||
|
|
||
| node2nix=$(nix-build ../../../../.. -A nodePackages.node2nix) | ||
|
|
||
| rm -f ./node-env.nix | ||
|
|
||
| # Track the latest active nodejs LTS here: https://nodejs.org/en/about/releases/ | ||
| "${node2nix}/bin/node2nix" \ | ||
| -i node-packages.json \ | ||
| -o node-packages.nix \ | ||
| -c composition.nix \ | ||
| --pkg-name nodejs_22 | ||
|
|
||
| # using --no-out-link in nix-build argument would cause the | ||
| # gc to run before the script finishes | ||
| # which would cause a failure | ||
| # it's safer to just remove the link after the script finishes | ||
| # see https://github.com/NixOS/nixpkgs/issues/112846 for more details | ||
| rm ./result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Use this file to add `meta.mainProgram` to packages in `nodePackages`. | ||
| { | ||
| # Packages that provide multiple executables where one is clearly the `mainProgram`. | ||
|
|
||
| # Packages that provide a single executable. | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This shouldn't need quotes, because underscore is not a special character.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top of that file says;
... I'll remove the quotes, but expect 'em to resurrect next time
node2nixgets ideas ;-)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, missed that. I'd just leave it in that case.