Skip to content

Commit

Permalink
Merge branch 'release/3.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Oberlehner committed Apr 23, 2018
2 parents ebdfd9b + 83d36c9 commit 27c98d9
Show file tree
Hide file tree
Showing 29 changed files with 5,189 additions and 1,586 deletions.
17 changes: 17 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
]
],
"env": {
"test": {
"presets": [
"@babel/preset-env"
]
}
}
}
11 changes: 11 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"root": true,
"parserOptions": {
"ecmaVersion": 8
},
"env": {
"node": true,
"jest": true
},
"extends": "@avalanche/eslint-config"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ nbproject
Thumbs.db

# Folders to ignore
coverage
dist
node_modules
4 changes: 2 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
test

.babelrc
.editorconfig
.travis.yml

CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
tsconfig.json
tslint.json
rollup.config.js
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_js:
- "7"
- "node"
script:
- npm run build
- npm run scripts
- npm run lint
- npm test
- npm test -- --maxWorkers=4
- npm run coveralls
6 changes: 6 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
Expand All @@ -21,19 +23,23 @@ Examples of unacceptable behavior by participants include:
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at markus.oberlehner@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# css-node-extract

[![Patreon](https://img.shields.io/badge/patreon-donate-blue.svg)](https://www.patreon.com/maoberlehner)
[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://paypal.me/maoberlehner)
[![Build Status](https://travis-ci.org/maoberlehner/css-node-extract.svg?branch=master)](https://travis-ci.org/maoberlehner/css-node-extract)
[![Coverage Status](https://coveralls.io/repos/github/maoberlehner/css-node-extract/badge.svg?branch=master)](https://coveralls.io/github/maoberlehner/css-node-extract?branch=master)
[![GitHub stars](https://img.shields.io/github/stars/maoberlehner/css-node-extract.svg?style=social&label=Star)](https://github.com/maoberlehner/css-node-extract)

Extract certain nodes from CSS code.

## Filters

- **at-rules**: `@media`, `@supports`, `@mixin`,...
- **declarations**: `$variable`, `@variable`,...
- **functions**: `@function`
Expand All @@ -14,6 +20,7 @@ Extract certain nodes from CSS code.
- **make-your-own**: Define custom filters

## Demos

```js
const cssNodeExtract = require('css-node-extract');
const postcssScssSyntax = require('postcss-scss');
Expand All @@ -38,6 +45,7 @@ console.log(extractedCss); // Outputs: '$variable: "value";'.
```

### Custom filter

```js
const cssNodeExtract = require('css-node-extract');

Expand All @@ -61,6 +69,7 @@ cssNodeExtract.process(options).then((extractedCss) => {
```

### Preserve lines

Usually `css-node-extract` removes all nodes which do not match the given filters. However under some circumstances it might be useful to preserve the original line numbers (e.g. to keep source map references intact).

```js
Expand All @@ -81,6 +90,7 @@ cssNodeExtract.process(options).then((extractedCss) => {
```

### ES2015 named exports

```js
import { process, processSync } from 'css-node-extract';
import postcssScssSyntax from 'postcss-scss';
Expand All @@ -105,9 +115,11 @@ console.log(extractedCss); // Outputs: '$variable: "value";'.
```

## Upgrade from 1.x.x to 2.x.x

With version 2.0.0 the handling of custom filters was changed. The `customFilter` option was renamed to `customFilters` and this option now takes an object instead of an array. Instead of defining one custom filter named `custom`, you can now define unlimited custom filters with custom names.

## Upgrade from 0.x.x to 1.x.x

With version 1.0.0 the `filterNames` option was renamed to `filters`.

```js
Expand All @@ -127,19 +139,25 @@ const options = {
```

## Development

See [CONTRIBUTING.md](https://github.com/maoberlehner/css-node-extract/blob/master/CONTRIBUTING.md)

### Testing

```bash
npm test
```

## About

### Author

Markus Oberlehner
Website: https://markus.oberlehner.net
Twitter: https://twitter.com/MaOberlehner
PayPal.me: https://paypal.me/maoberlehner
PayPal.me: https://paypal.me/maoberlehner
Patreon: https://www.patreon.com/maoberlehner

### License

MIT
Loading

0 comments on commit 27c98d9

Please sign in to comment.