Skip to content

Commit

Permalink
Bumped version number and supported node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dschenk committed Feb 14, 2022
1 parent 5f95df7 commit ec0d925
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
^10
^12
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
language: node_js
node_js:
- '8'
- '9'
- '10'
- '12'
- '14'
- '16'
matrix:
fast_finish: true
allow_failures:
- node_js: '8'
- node_js: '9'
after_success:
- 'yarn coverage'
- 'yarn coverall'
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# [2.0.0]
###### 2022-02-14

###### Changed
- Migration to PostCSS 8
- Updated compatible node versions


# [1.1.3]
###### 2021-03-02

Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ function postCSSReplace(opts = defaults) {
OnceExit(root) {
root[options.commentsOnly ? 'walkComments' : 'walk']((node) => {

// Before we had the switch statement, we just used node.replaceValues(). This could potentially lead to
// Before the switch statement was used, we used node.replaceValues(). This lead to
// incorrect behaviour as described in https://github.com/gridonic/postcss-replace/issues/5.
//
// So for example if the CSS contains at-rules like @media, calling replaceValues() would replace
// For example: if the CSS contains at-rules like @media, calling replaceValues() would replace
// everything inside the @media { … } statement and since we are walking through *all* nodes, we would
// encounter the nodes from the @media statement again in the next iteration/call of our walk function.
//
// This is why we have refactored the logic of the walk function to use a switch statement in order to do
// the replacement only on the relevant nodes and use the appropriate replacement logic.
//
// Furthermore it also makes adding/handling new cases quite comfortable.
// This makes adding/handling new cases quite comfortable.
//
// @see http://api.postcss.org/
switch (node.constructor.name) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-replace",
"version": "1.1.3",
"version": "2.0.0",
"author": "Gridonic <hello@gridonic.ch>",
"license": "MIT",
"keywords": [
Expand Down

0 comments on commit ec0d925

Please sign in to comment.