Giter Site home page Giter Site logo

Comments (14)

joelmoss avatar joelmoss commented on August 13, 2024 2

And ideally they should match the API options

from lightningcss.

devongovett avatar devongovett commented on August 13, 2024 1

Maybe, but I feel like at that point you should probably be using another build tool like a bundler. For example, like Parcel supports. I was thinking that the Parcel CSS CLI would mainly be used for very simple use cases, as well as debugging/testing. Will have to think about it more, but I don't want to jump straight to config files if we can help it. πŸ˜„

from lightningcss.

Shinyaigeek avatar Shinyaigeek commented on August 13, 2024 1

Well, in fact, few devs touch .swcrc directory and many devs handle swc feature via bundler. It would be better to implement only CLI flag and collect feedback from developers, and if there are many requests for such a config file, we would rethink πŸ˜„ .

from lightningcss.

Shinyaigeek avatar Shinyaigeek commented on August 13, 2024

I think it is a good idea to add CLI flags to specify parcel-css’s feature ! πŸŽ‰ .

I think it would be also good to add loading a config file .parcelcssrc like .swcrc to specify parcel-css’s feature as well as CLI flag, because in real development, devs may want to specify which β€˜parcel-css`’s feature is ON with a static config file. What do you think about this idea?

from lightningcss.

devongovett avatar devongovett commented on August 13, 2024

Maybe we could also use miette to get pretty error messages: https://github.com/zkat/miette

from lightningcss.

devongovett avatar devongovett commented on August 13, 2024

Also need to figure out a nice way of distributing the CLI. Right now you can install with cargo but that means you need to compile it yourself. We could potentially publish binaries to npm, or via direct download or something...

from lightningcss.

numToStr avatar numToStr commented on August 13, 2024

Hey, I was wondering are you planning to add subcommands? Or just bunch of flags and options to control the behaviour.

from lightningcss.

devongovett avatar devongovett commented on August 13, 2024

We could add some, but not sure what they would be. Did you have one in mind? Right now there's parcel_css minify but maybe it should be --minify so you could choose whether to enable it or not.

from lightningcss.

joelmoss avatar joelmoss commented on August 13, 2024

I don't think subcommands are the right fit here, as you want to be able to mix the options, just like you can with the API. They should be flags.

from lightningcss.

numToStr avatar numToStr commented on August 13, 2024

Yeah, I also think that only flags/options will be the best choice here.

from lightningcss.

rrcobb avatar rrcobb commented on August 13, 2024

I've got a branch where I've started adding some of these.

Leaving it for the night. I've started to write cli integration tests, and will hopefully wrap tomorrow with a good chunk of them done.

for sourcemap and css module files, I think it's probably right to make decent guesses about what the additional output files should be named, but only write to files if the output file option is specified. If not, putting them on stdout seems right, I think.

Questions:

  • multiple files option - do we just concat the files to pass them to Stylesheet::parse? If so, what should the 'filename' arg be?
  • for the 'directory' option for multiple files, how should the tree walking pick valid files?
  • how should sourcemap and css module json get formatted on stdout, when no output file is specified? (e.g. add a comment like /* styles.json */ to the output to distinguish them?)

from lightningcss.

shrirambalaji avatar shrirambalaji commented on August 13, 2024

Can multiple folks contribute towards this?

from lightningcss.

rrcobb avatar rrcobb commented on August 13, 2024

Can multiple folks contribute towards this?

Probably yes - my branch certainly isn't intended to cut off other contributions, I'm not affiliated with the project, just a web stranger.

It doesn't look like there's a contributors guide specific to this repo, so I'm inferring from parcel js's CONTRIBUTING.md and typical open source contribution ethos, but it's pretty normal for different folks to work on the same feature in parallel. At worst, there's some duplicated effort or bad feelings depending on the eventual outcome, but that's probably okay!

from lightningcss.

devongovett avatar devongovett commented on August 13, 2024

Added --targets in 7d9cec0.

from lightningcss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.