Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use yarn and test with jest
  • Loading branch information
TrySound committed May 22, 2017
commit ebd237483ad067ab527f38efc03d7572eca7930d
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
lib/
coverage
lib
Empty file removed .npmignore
Empty file.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@ node_js:
- "4"
- "6"
- "node"
script: npm run travis

before_install:
- '[ "${TRAVIS_NODE_VERSION}" != "0.10" ] || npm install -g npm'
41 changes: 22 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@
"version": "1.3.0",
"description": "PostCSS plugin for CSS Modules to pass arbitrary values between your module files",
"main": "lib/index.js",
"files": [
"lib"
],
"scripts": {
"lint": "standard src test",
"build": "babel --out-dir lib src",
"autotest": "chokidar src test -c 'npm test'",
"test": "mocha --compilers js:babel-core/register",
"posttest": "npm run lint && npm run build",
"travis": "npm run test",
"prepublish": "npm run build"
"lint": "standard src test",
"test": "jest --coverage",
"posttest": "yarn run lint",
"prepublish": "yarn run build"
},
"babel": {
"presets": [
[
"env",
{
"targets": {
"node": 4
}
}
]
]
},
"repository": {
"type": "git",
Expand All @@ -29,23 +42,13 @@
"homepage": "https://github.com/css-modules/postcss-modules-values#readme",
"devDependencies": {
"babel-cli": "^6.5.2",
"babel-core": "^6.5.2",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-preset-es2015": "^6.3.13",
"chokidar": "^1.2.0",
"mocha": "^3.0.2",
"babel-jest": "^20.0.3",
"babel-preset-env": "^1.5.0",
"jest": "^20.0.3",
"standard": "^8.4.0"
},
"dependencies": {
"icss-replace-symbols": "^1.1.0",
"postcss": "^6.0.1"
},
"babel": {
"presets": [
"es2015"
],
"plugins": [
"add-module-exports"
]
}
}
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import postcss from 'postcss'
import replaceSymbols, {replaceAll} from 'icss-replace-symbols'
const postcss = require('postcss')
const {default: replaceSymbols, replaceAll} = require('icss-replace-symbols')

const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/
const matchValueDefinition = /(?:\s+|^)([\w-]+):?\s+(.+?)\s*$/g
Expand All @@ -8,7 +8,7 @@ let options = {}
let importIndex = 0
let createImportedName = options && options.createImportedName || ((importName/*, path*/) => `i__const_${importName.replace(/\W/g, '_')}_${importIndex++}`)

export default postcss.plugin('postcss-modules-values', () => (css, result) => {
module.exports = postcss.plugin('postcss-modules-values', () => (css, result) => {
let importAliases = []
let definitions = {}

Expand Down
158 changes: 0 additions & 158 deletions test/index.js

This file was deleted.

Loading