4 ms·
Not everything is a node App. We don't have a lock file because we don't have any local npm dependencies (as already mentioned). We're using `npx tailwindcss` a
by mythz 2y ago
Not everything is a node App. We don't have a lock file because we don't have any local npm dependencies (as already mentioned). We're using `npx tailwindcss` as-is.
- jitl 2y agoYou clearly have a dependency on tailwindcss (if it can break you, you depend on it), and are using npm to fetch it (npx uses npm internally, they are installed together) so you can easily solve your problem by adding a couple json files with some version numbers in them. npx will pick up and use the version from your package.json, so no workflow change other than running `npm install …` once to generate package.json for your preferred semver specifier, and package-lock.json to guarantee your builds use a known-good version from now on.
- mythz 2y agoFFS we don't have local dependencies. Which means we don't have any local node_modules and have never ran npm install (there are no dependencies to install!). There is no lock file or dependencies. Our Apps don't have any npm dependencies nor needs to run npm install by design, we're not going to start now, as already stated we're switching to `tailwindcss@v3` instead. The point is this was a documented supported use-case which all our non node.js Apps used, which have now broken as a result of this release.
- Aeolun 2y agoI find it really hard to not immediately be reminded of this: https://xkcd.com/1172/ https://xkcd.com/1172/
- mythz 2y agoWe only use npm dependencies and bloated node_modules folders [1] if we absolutely have to and for our non node.js Apps we explicitly don't. [1] https://www.reddit.com/r/ProgrammerHumor/comments/6s0wov/heaviest_objects_in_the_universe/ https://www.reddit.com/r/ProgrammerHumor/comments/6s0wov/hea...
- preisschild 2y agoBut why not though I also use tailwindcss in a non-node project, but use npm package / lock files to easily lock javascript / css dependencies and make renovate able to update them for me.
- mythz 2y agoI've linked to why. We prefer #NoBuild solutions where we'd only use local npm deps/node_modules if we absolutely have to, and for non JS Apps we don't.
- jitl 2y agoThe node_modules folder is still somewhere on your system (~/.npm/_npx probably?) containing the same tailwindcss dependency files, but if it helps you sleep easier at night it’s okay to pretend it doesn’t exist.
- mythz 2y agoNo kidding, I thought global tools worked with fairy cloud dust, now I wont be able to sleep! But knowing there's not a going to be a bloated node_modules folder and local dependencies running different versions unnecessarily maintained in every project will definitely help.
- thiht 2y agoYOU DO have a local dependency. Just add a mostly empty package.json like this: { "devDependencies": { "tailwindcss": "^3.4.17" } } Run npm install once, and be done with it. You could even commit your node_modules if it helps.
- mythz 2y agoWe don't, we use npx to avoid needing any local dependencies. `npx tailwind@v3` is the solution, definitely wont be committing node_modules to git, ever.
- arcanemachiner 2y agoFWIW Tailwind can be used as a standalone executable. This is how Phoenix/Elixir bundles Tailwind without requiring npm.
- jitl 2y agoI don’t care how you do it, just make getting your dependencies deterministic based on files committed to your repo! Happily the Tailwind hex package encourages you configure a fixed version number, so you’ll never get surprise breakage as long as you’re committing your mix.lock file as well. I’m only suggesting package.json/package-lock.json because their projects are already using the npm ecosystem to fetch the tailwind dependency. A Makefile that does `curl $TAILWIND_GITHUB_RELEASE_URL -o ./departing/tailwind` is fine too (this is what Tailwind.hex is doing under the hood).
- preisschild 2y agoAFAIK using the tailwindcss-cli without npm makes it impossible to use Tailwind plugins, such as DaisyUI.
- arcanemachiner 2y agoI believe that is true, although there is a project which bundles Tailwinds and DaisyUI into a single standalone executable: https://github.com/dobicinaitis/tailwind-cli-extra https://github.com/dobicinaitis/tailwind-cli-extra I have not tried this out yet, personally.
- J_Shelby_J 2y agoI just tried it... failed to load with very strange errors about postcss and unknown words. FWIW, the tailwind binary from the official channel works great. I install it in my build.rs.
- krnsi 2y agoThis is not true, here is a demo projects which uses the Hex Tailwind and DaisyUI: https://github.com/naymspace/backpex/tree/develop/demo https://github.com/naymspace/backpex/tree/develop/demo
- nejsjsjsbsb 2y agoShove an @ version in it
- mythz 2y agoYep `npx tailwindcss@v3` is the solution we ended up with. Just had to change this in all our Apps and project templates.
- nejsjsjsbsb 2y agoI wish @-less wasn't be allowed. Like you can do @latest but then human confirm is needed. That way you don't get this problem in scripts.
- jakubmazanec 2y ago> then human confirm is needed "Suppress this prompt with the -y or --yes option" [1] [1] https://docs.npmjs.com/cli/v11/commands/npx https://docs.npmjs.com/cli/v11/commands/npx
- GrzegorzWidla 2y agoSo why not npx tailwindcss@^3.0.0 (or whatever version was there when you started)?