Comments (13)
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:
- Have a
docs/packs.md
file that displays each pack's dependant plugins. - 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.
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.
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.
Alright, I'll send a patch for cssnano's plugins. 😄
from postcss-plugins.
I would rather the packs identify which plugins they utilize. This might be inferable from package.json
from postcss-plugins.
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.
We can get the other by code, surely?
from postcss-plugins.
@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.
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.
....but what do you think is the best course of action? Tell me, I wanna know - what would you do?
from postcss-plugins.
I already started using the packs
property in the last pull request, so I would go with that. 😄
from postcss-plugins.
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.
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)
- Accessibility category
- Add postcss-resemble-image
- Guidance on plugin names HOT 2
- Plugin data collection proposal HOT 1
- Minify plugins.json
- Update readme: add yarn
- Only allow a max of 5 tags
- syntax error in plugins.json HOT 1
- npmignore
- opening a page in a new tab results in a 404 HOT 1
- cssnext vs. postcss-cssnext
- pre-commit hook failed HOT 5
- Auto-changelog
- Unable to resolve path to module '../../token.json' import/no-unresolved
- Linting issue when trying to commit changes HOT 3
- Add tags for old releases
- Add plugin postcss-hairlines HOT 1
- discard-comments leads to 404
- Better npm publish
- A11Y category/section HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postcss-plugins.