postcss-load-config
Advanced tools
Comparing version 1.0.0-alpha to 1.0.0-alpha2
@@ -9,4 +9,4 @@ // ------------------------------------ | ||
const loadPlugins = require('./lib/loadPlugins') | ||
const loadOptions = require('./lib/loadOptions') | ||
const loadOptions = require('postcss-load-options/lib/loadOptions.js') | ||
const loadPlugins = require('postcss-load-plugins/lib/loadPlugins.js') | ||
@@ -13,0 +13,0 @@ module.exports = function loadConfig (options) { |
{ | ||
"name": "postcss-load-config", | ||
"version": "1.0.0-alpha", | ||
"version": "1.0.0-alpha2", | ||
"description": "Autoload Config for PostCSS", | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"engines": {"node": ">=4"}, | ||
"main": "index.js", | ||
"scripts": { | ||
"clean": "echo '=> Cleaning' && rm -rf .nyc_output coverage test/node_modules", | ||
"clean": "echo '=> Cleaning' && rm -rf .nyc_output coverage", | ||
"pretest": "echo '=> Linting' && npm run clean && standard", | ||
"test": "echo '=> Testing' && nyc ava './test/index.js'", | ||
"test": "echo '=> Testing' && nyc ava 'test/index.js'", | ||
"start": "echo '=> Starting' && sudo npm test" | ||
}, | ||
"dependencies": { | ||
"cosmiconfig": "^1.1.0" | ||
"cosmiconfig": "^1.1.0", | ||
"postcss-load-options": "^1.0.0-alpha2", | ||
"postcss-load-plugins": "^2.0.0-alpha2" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.15.1", | ||
"babel-core": "^6.9.1", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babel-register": "^6.9.0", | ||
"ava": "^0.15.2", | ||
"coveralls": "^2.11.9", | ||
"nyc": "^6.4.4", | ||
"nyc": "^6.6.1", | ||
"postcss": "^5.0.21", | ||
"postcss-bem": "^0.4.1", | ||
"postcss-import": "^8.1.2", | ||
"postcss-less": "^0.12.0", | ||
"postcss-nested": "^1.0.0", | ||
"postcss-scss": "^0.1.8", | ||
"standard": "^7.1.1", | ||
"standard": "^7.1.2", | ||
"sugarss": "^0.1.3" | ||
}, | ||
"ava": { | ||
"babel": "inherit" | ||
"verbose": "true" | ||
}, | ||
"nyc": { | ||
"all": true, | ||
"require": "babel-register", | ||
"include": [ | ||
"lib", | ||
"test" | ||
], | ||
"extension": [ | ||
".js" | ||
] | ||
"include": ["test"], | ||
"extension": [".js"] | ||
}, | ||
"standard": { | ||
"ignore": [] | ||
}, | ||
"babel": { | ||
"env": { | ||
"development": { | ||
"sourceMaps": "inline" | ||
} | ||
}, | ||
"presets": [ | ||
"es2015" | ||
] | ||
}, | ||
"keywords": [ | ||
"PostCSS", | ||
"Autoload", | ||
"Config" | ||
"postcss", | ||
"postcssconfig" | ||
], | ||
@@ -66,0 +41,0 @@ "author": { |
109
README.md
[![NPM][npm]][npm-url] | ||
[![Node][node]][node-url] | ||
[![Dependencies][deps]][deps-url] | ||
[![DevDependencies][devdeps]][devdeps-url] | ||
[![Deps][deps]][deps-url] | ||
[![Tests][travis]][travis-url] | ||
[![Coverage][cover]][cover-url] | ||
[![Standard Code Style][style]][style-url] | ||
# PostCSS Load Config <img align="right" width="108" height="108" title="PostCSS" src="http://postcss.github.io/postcss/logo.svg" hspace="20"> | ||
<div align="center"> | ||
<a href="https://github.com/postcss/postcss"> | ||
<img width="108" height="108" title="PostCSS" src="http://postcss.github.io/postcss/logo.svg" hspace="20"> | ||
</a> | ||
<h1>Load Config</h1> | ||
<p>Autoload Config for PostCSS<p> | ||
</div> | ||
## Status | ||
| Branch | Build | Coverage | | ||
|:--------------------:|:-------------------------:|:------------------------:| | ||
| Master | ![travis] | ![cover] | | ||
| Release/v1.0.0 | ![travis-rel] | ![cover-rel] | | ||
## Install | ||
@@ -23,13 +22,6 @@ | ||
## Usage | ||
Install plugin as usual and make sure saving them to your ***package.json*** dependencies and/or devDependencies. | ||
[PostCSS Plugins](https://postcss.parts) | ||
Plugins will be loaded directly from your projects ***package.json*** file. | ||
Install them as usual with as deps/devDeps. | ||
``` | ||
npm i -S postcss-plugin | ||
``` | ||
``` | ||
npm i -D postcss-plugin | ||
@@ -40,3 +32,3 @@ ``` | ||
- Create **postcss.plugins** section in your projects **package.json**. | ||
- Create **postcss** section in your projects **package.json**. | ||
- Create a **postcss.config.js** or **postcssrc.json** file. | ||
@@ -46,25 +38,39 @@ | ||
Plugin **options** can either take ```null``` or an object ```{/* options */}``` | ||
Plugin **options** can either take ```null``` or an object literal ```{}``` | ||
as value. | ||
```null``` : Load plugin with no options (plugin defaults). | ||
```null``` : Plugin loads with no options (defaults). | ||
```[Object]``` : Load plugin with given options. | ||
```[Object]``` : Plugin loads with set options. | ||
## Ordering | ||
Plugin **order** will be determined by declaration in plugins section. | ||
Plugin **order** is determined by declaration in the plugins section. | ||
```js | ||
plugins: { | ||
'postcss-plugin1': null, | ||
'postcss-plugin2': null, | ||
'postcss-plugin3': {/* options */} | ||
postcss: { | ||
parser: require('sugarss'), | ||
from: 'app.sss' | ||
map: 'inline', | ||
to: 'app.css' | ||
plugins: { | ||
'postcss-plugin1': null, | ||
'postcss-plugin2': null, | ||
'postcss-plugin3': {option1: '', option2: ''} | ||
} | ||
} | ||
=> [ | ||
require('postcss-plugin1')(), | ||
require('postcss-plugin2')(), | ||
require('postcss-plugin3')(options) | ||
] | ||
// Loaded Options Setup | ||
{ | ||
parser: require('sugarss'), | ||
from: 'app.sss' | ||
map: 'inline', | ||
to: 'app.css' | ||
} | ||
// Loaded Plugin Setup | ||
[ | ||
require('postcss-plugin1')(), | ||
require('postcss-plugin2')(), | ||
require('postcss-plugin3')(options) | ||
] | ||
``` | ||
@@ -85,3 +91,3 @@ | ||
"parser": "sugarss", | ||
"from": "src/app.sss", | ||
"from": "app.sss", | ||
"map": "inline", | ||
@@ -115,3 +121,3 @@ "to": "app.css", | ||
parser: "sugarss", | ||
from: 'src/app.sss', | ||
from: 'app.sss', | ||
map: 'inline', | ||
@@ -143,3 +149,3 @@ to: 'app.css', | ||
"parser": "sugarss", | ||
"from": "src/app.sss", | ||
"from": "app.sss", | ||
"map": "inline", | ||
@@ -173,3 +179,3 @@ "to": "app.css", | ||
const fs = require('fs') | ||
const { readFileSync } = require('fs') | ||
@@ -179,3 +185,3 @@ const postcss = require('postcss') | ||
const css = fs.readFileSync('./index.css', 'utf-8') | ||
const css = readFileSync('./index.css', 'utf8') | ||
@@ -194,3 +200,3 @@ postcssrc.then(({ plugins, options }) => { | ||
const fs = require('fs') | ||
const { readFileSync } = require('fs') | ||
@@ -200,3 +206,3 @@ const postcss = require('postcss') | ||
const css = fs.readFileSync('./index.css', 'utf-8') | ||
const css = readFileSync('./index.css', 'utf8') | ||
@@ -210,3 +216,3 @@ postcssrc.then(({ plugins, options }) => { | ||
## LICENSE [![License MIT][license]][license-url] | ||
## LICENSE | ||
@@ -238,11 +244,5 @@ > License (MIT) | ||
[node]: https://img.shields.io/node/v/gh-badges.svg?maxAge=2592000 | ||
[node-url]: https://nodejs.org | ||
[deps]: https://david-dm.org/michael-ciniawsky/postcss-load-config.svg | ||
[deps-url]: https://david-dm.org/michael-ciniawsky/postcss-load-config | ||
[devdeps]: https://david-dm.org/michael-ciniawsky/postcss-load-config/dev-status.svg | ||
[devdeps-url]: https://david-dm.org/michael-ciniawsky/postcss-load-config#info=devDependencies | ||
[style]: https://img.shields.io/badge/code%20style-standard-yellow.svg | ||
@@ -254,18 +254,3 @@ [style-url]: http://standardjs.com/ | ||
[travis-rel]: http://img.shields.io/travis/michael-ciniawsky/postcss-load-config.svg?branch=release/1.0.0 | ||
[travis-rel-url]:https://travis-ci.org/michael-ciniawsky/postcss-load-config?branch=release/1.0.0 | ||
[travis-dev]: http://img.shields.io/travis/michael-ciniawsky/postcss-load-config.svg?branch=develop | ||
[travis-dev-url]: https://travis-ci.org/michael-ciniawsky/postcss-load-config?branch=develop | ||
[cover]: https://coveralls.io/repos/github/michael-ciniawsky/postcss-load-config/badge.svg?branch=master | ||
[cover-url]: https://coveralls.io/github/michael-ciniawsky/postcss-load-config?branch=master | ||
[cover-rel]: https://coveralls.io/repos/github/michael-ciniawsky/postcss-load-config/badge.svg?branch=release/1.0.0 | ||
[cover-rel-url]: https://coveralls.io/github/michael-ciniawsky/postcss-load-config?branch=release/1.0.0 | ||
[cover-dev]: https://coveralls.io/repos/github/michael-ciniawsk/postcss-load-config/badge.svg?branch=develop | ||
[cover-dev-url]: https://coveralls.io/github/michael-ciniawsky/postcss-load-config?branch=develop | ||
[license]: https://img.shields.io/github/license/michael-ciniawsky/postcss-load-config.svg | ||
[license-url]: https://raw.githubusercontent.com/michael-ciniawsky/postcss-load-config/master/LICENSE |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
9
0
9080
3
5
17
244
+ Addedcosmiconfig@2.2.2(transitive)
+ Addedis-directory@0.3.1(transitive)
+ Addedpostcss-load-options@1.2.0(transitive)
+ Addedpostcss-load-plugins@2.3.0(transitive)