Coder Social home page Coder Social logo

Comments (13)

himynameisdave avatar himynameisdave commented on June 18, 2024

Yeah this is actually super cool! Looking to add this stuff as well!

Here's how I'm thinking I'm going to implement this:

  1. Have a docs/packs.md file that displays each pack's dependant plugins.
  2. Go research the plugins used by packs like cssnano and make sure they are added to the main list

@ben-eb Make sense?

from postcss-plugins.

ben-eb avatar ben-eb commented on June 18, 2024

You could also have a packs property for each plugin (array type) that would list the packs that the plugin belongs to. 😄

from postcss-plugins.

himynameisdave avatar himynameisdave commented on June 18, 2024

That is so much smarter/better, and then if I really wanted to generate that packs.md it would be so much easier because that data would be available.

from postcss-plugins.

ben-eb avatar ben-eb commented on June 18, 2024

Alright, I'll send a patch for cssnano's plugins. 😄

from postcss-plugins.

jonathantneal avatar jonathantneal commented on June 18, 2024

I would rather the packs identify which plugins they utilize. This might be inferable from package.json

from postcss-plugins.

himynameisdave avatar himynameisdave commented on June 18, 2024

I like both of these ideas... so here's what I think is the most comprehensive:

{
  "name": "cool-plugin-pack",
  "tags": [
    "pack"
  ],
  "plugins_used": [
    "a-neat-plugin",
    "other-plugin"
  ]
},{
   "name": "a-neat-plugin",
   "tags": [
     "fun"
   ],
   "packs": [
      "cool-plugin-pack"
   ]
}

(obviously I left out some properties but you get the idea...)

from postcss-plugins.

ben-eb avatar ben-eb commented on June 18, 2024

We can get the other by code, surely?

from postcss-plugins.

himynameisdave avatar himynameisdave commented on June 18, 2024

@ben-eb how do you mean? I see it being used as such:

require("postcss-plugins").forEach(function(plugin){
  if( plugin.tags.indexOf("pack") < 0 ){
    // this plugin is a pack
    // plugin.plugins_used exists and can be iterated through
  }else{
     if( plugin.packs ){
       // this plugin is part of a pack, and plugin.packs can be iterated through
     }else{
       // this plugin is not a pack or part of a pack
     }
  }
});

Should there just be like an isPack property instead so that initial check is easier?

from postcss-plugins.

ben-eb avatar ben-eb commented on June 18, 2024

I mean that you can infer the relationship between the pack & each of its plugins without needing two properties, whichever you choose.

from postcss-plugins.

himynameisdave avatar himynameisdave commented on June 18, 2024

....but what do you think is the best course of action? Tell me, I wanna know - what would you do?

from postcss-plugins.

ben-eb avatar ben-eb commented on June 18, 2024

I already started using the packs property in the last pull request, so I would go with that. 😄

from postcss-plugins.

jonathantneal avatar jonathantneal commented on June 18, 2024

Related to #13, might we use https://registry.npmjs.org/${ name }/latest to get the list of dependencies as dependencies? We could use this to report the number of dependencies or what those dependencies are, as well as detect when those dependencies are other PostCSS plugins.

from postcss-plugins.

himynameisdave avatar himynameisdave commented on June 18, 2024

Well we kind of already have the packs property in the dataset, I'm not sure there is a ton of value in adding dependencies as well but maybe I'm wrong?

from postcss-plugins.

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.