Skip to content

Commit 48e904f

Browse files
refactor: code (css-modules#25)
1 parent fd4ffce commit 48e904f

File tree

13 files changed

+2598
-1998
lines changed

13 files changed

+2598
-1998
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"parserOptions": {
3-
"ecmaVersion": 2018
4-
},
5-
"env": {
6-
"node": true
7-
},
8-
"rules": {
9-
"quotes": [2, "single"]
10-
}
2+
"parserOptions": {
3+
"ecmaVersion": 2018
4+
},
5+
"env": {
6+
"es6": true,
7+
"node": true,
8+
"jest": true
9+
},
10+
"extends": "eslint:recommended"
1111
}

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
node_modules
1+
.idea
2+
*.iml
3+
.nyc_output
24
coverage
3-
lib
5+
node_modules

.travis.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
language: node_js
2+
23
node_js:
3-
- "6"
4-
- "8"
54
- "10"
65
- "12"
7-
script: npm run travis
6+
- "14"
7+
8+
script: yarn ci
89

910
after_success:
1011
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
# Change Log
2+
23
All notable changes to this project will be documented in this file.
34
This project adheres to [Semantic Versioning](http://semver.org/).
45

56
## [2.2.0] - 2020-03-19
7+
68
- added the `exportGlobals` option to export global classes and ids
79

810
## [2.1.1] - 2019-03-05
11+
912
### Fixed
13+
1014
- add additional space after the escape sequence (#17)
1115

1216
## [2.1.0] - 2019-03-05
17+
1318
### Fixed
19+
1420
- handles properly selector with escaping characters (like: `.\31 a2b3c { color: red }`)
21+
1522
### Feature
23+
1624
- `generateExportEntry` option (allow to setup key and value for `:export {}` rule)

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ into:
2424
so it doesn't pollute CSS global scope and can be simply used in JS like so:
2525

2626
```js
27-
import styles from './buttons.css'
28-
elem.innerHTML = `<button class="${styles.continueButton}">Continue</button>`
27+
import styles from "./buttons.css";
28+
elem.innerHTML = `<button class="${styles.continueButton}">Continue</button>`;
2929
```
3030

3131
## Composition
@@ -79,8 +79,8 @@ npm test
7979

8080
[![Build Status](https://travis-ci.org/css-modules/postcss-modules-scope.svg?branch=master)](https://travis-ci.org/css-modules/postcss-modules-scope)
8181

82-
* Lines: [![Coverage Status](https://coveralls.io/repos/css-modules/postcss-modules-scope/badge.svg?branch=master)](https://coveralls.io/r/css-modules/postcss-modules-scope?branch=master)
83-
* Statements: [![codecov.io](http://codecov.io/github/css-modules/postcss-modules-scope/coverage.svg?branch=master)](http://codecov.io/github/css-modules/postcss-modules-scope?branch=master)
82+
- Lines: [![Coverage Status](https://coveralls.io/repos/css-modules/postcss-modules-scope/badge.svg?branch=master)](https://coveralls.io/r/css-modules/postcss-modules-scope?branch=master)
83+
- Statements: [![codecov.io](http://codecov.io/github/css-modules/postcss-modules-scope/coverage.svg?branch=master)](http://codecov.io/github/css-modules/postcss-modules-scope?branch=master)
8484

8585
## Development
8686

@@ -97,4 +97,5 @@ ISC
9797
- Guy Bedford
9898

9999
---
100+
100101
Glen Maddern, 2015.

package.json

+17-21
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
"description": "A CSS Modules transform to extract export statements from local-scope classes",
55
"main": "src/index.js",
66
"engines": {
7-
"node": ">= 6"
7+
"node": ">= 10.13.0 || >= 12.13.0 || >= 14"
88
},
99
"scripts": {
10-
"lint": "eslint src test",
10+
"prettier": "prettier -l --ignore-path .gitignore . \"!test/test-cases\"",
11+
"eslint": "eslint --ignore-path .gitignore .",
12+
"lint": "yarn eslint && yarn prettier",
1113
"pretest": "yarn lint",
12-
"test": "mocha",
13-
"autotest": "chokidar src test -c 'yarn test'",
14-
"precover": "yarn lint",
15-
"cover": "nyc mocha",
16-
"travis": "yarn cover",
17-
"prepublish": "yarn run test"
14+
"test": "jest",
15+
"autotest": "jest --watch",
16+
"cover": "jest --coverage --collectCoverageFrom=\"src/**/*\"",
17+
"ci": "yarn pretest && yarn cover",
18+
"prepublishOnly": "yarn test"
1819
},
1920
"repository": {
2021
"type": "git",
@@ -34,22 +35,17 @@
3435
"url": "https://github.com/css-modules/postcss-modules-scope/issues"
3536
},
3637
"homepage": "https://github.com/css-modules/postcss-modules-scope",
37-
"prettier": {
38-
"semi": true,
39-
"singleQuote": true,
40-
"trailingComma": "es5"
41-
},
4238
"dependencies": {
43-
"postcss": "^7.0.6",
44-
"postcss-selector-parser": "^6.0.0"
39+
"postcss-selector-parser": "^6.0.3"
4540
},
4641
"devDependencies": {
4742
"cssesc": "^3.0.0",
48-
"chokidar-cli": "^1.0.1",
49-
"codecov.io": "^0.1.2",
50-
"coveralls": "^3.0.2",
51-
"eslint": "^5.9.0",
52-
"mocha": "^6.0.2",
53-
"nyc": "^14.1.0"
43+
"eslint": "^7.9.0",
44+
"jest": "^26.4.2",
45+
"postcss": "^8.0.3",
46+
"prettier": "^2.1.2"
47+
},
48+
"peerDependencies": {
49+
"postcss": "^8.0.0"
5450
}
5551
}

0 commit comments

Comments
 (0)