mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
tailwind: add support for plugins
Also add packages for - @tailwindcss/aspect-ratio - @tailwindcss/forms - @tailwindcss/language-server - @tailwindcss/line-clamp - @tailwindcss/typography
This commit is contained in:
parent
48343d24e4
commit
9f7d08df91
@ -382,18 +382,24 @@ let
|
||||
meta.broken = since "10";
|
||||
};
|
||||
|
||||
tailwindcss = super.tailwindcss.override {
|
||||
tailwindcss = super.tailwindcss.overrideAttrs (oldAttrs: {
|
||||
plugins = [ ];
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
postInstall = ''
|
||||
nodePath=""
|
||||
for p in "$out" "${self.postcss}" $plugins; do
|
||||
nodePath="$nodePath''${nodePath:+:}$p/lib/node_modules"
|
||||
done
|
||||
wrapProgram "$out/bin/tailwind" \
|
||||
--prefix NODE_PATH : ${self.postcss}/lib/node_modules
|
||||
--prefix NODE_PATH : "$nodePath"
|
||||
wrapProgram "$out/bin/tailwindcss" \
|
||||
--prefix NODE_PATH : ${self.postcss}/lib/node_modules
|
||||
--prefix NODE_PATH : "$nodePath"
|
||||
unset nodePath
|
||||
'';
|
||||
passthru.tests = {
|
||||
simple-execution = pkgs.callPackage ./package-tests/tailwindcss.nix { inherit (self) tailwindcss; };
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
tedicross = super."tedicross-git+https://github.com/TediCross/TediCross.git#v0.8.7".override {
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
|
@ -13,7 +13,11 @@
|
||||
, "@nerdwallet/shepherd"
|
||||
, "@nestjs/cli"
|
||||
, "@squoosh/cli"
|
||||
, "@tailwindcss/aspect-ratio"
|
||||
, "@tailwindcss/forms"
|
||||
, "@tailwindcss/language-server"
|
||||
, "@tailwindcss/line-clamp"
|
||||
, "@tailwindcss/typography"
|
||||
, "@uppy/companion"
|
||||
, "@vue/cli"
|
||||
, "@webassemblyjs/cli"
|
||||
|
819
pkgs/development/node-packages/node-packages.nix
generated
819
pkgs/development/node-packages/node-packages.nix
generated
File diff suppressed because it is too large
Load Diff
@ -1,15 +1,47 @@
|
||||
{ runCommand, tailwindcss }:
|
||||
{ runCommand, tailwindcss, nodePackages }:
|
||||
|
||||
let
|
||||
|
||||
inherit (tailwindcss) packageName version;
|
||||
|
||||
tailwindcssInput = builtins.toFile "input.css" ''
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
'';
|
||||
|
||||
tailwindcssWithPlugins = tailwindcss.overrideAttrs (oldAttrs: {
|
||||
plugins = [
|
||||
nodePackages."@tailwindcss/typography"
|
||||
];
|
||||
});
|
||||
|
||||
tailwindcssWithPluginsConfig = builtins.toFile "tailwind.config.js" ''
|
||||
module.exports = {
|
||||
content: ["./with-typography.input"],
|
||||
plugins: [
|
||||
require('@tailwindcss/typography'),
|
||||
],
|
||||
}
|
||||
'';
|
||||
|
||||
in
|
||||
|
||||
runCommand "${packageName}-tests" { meta.timeout = 60; }
|
||||
''
|
||||
mkdir $out
|
||||
|
||||
# Ensure CLI runs
|
||||
${tailwindcss}/bin/tailwind --help > /dev/null
|
||||
${tailwindcss}/bin/tailwindcss --help > /dev/null
|
||||
|
||||
# Needed for Nix to register the command as successful
|
||||
touch $out
|
||||
# Ensure CLI with plugins runs
|
||||
echo '"ml-4 prose"' > ./with-typography.input
|
||||
${tailwindcssWithPlugins}/bin/tailwind \
|
||||
--config ${tailwindcssWithPluginsConfig} \
|
||||
--input ${tailwindcssInput} \
|
||||
--output $out/with-typography.css
|
||||
|
||||
grep -q ml-4 $out/with-typography.css
|
||||
grep -q prose $out/with-typography.css
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user