Skip to content

Commit c004710

Browse files
authored
Merge pull request #283 from jonathantneal/feature/postcss6
Use PostCSS 6
2 parents 1389208 + 019cd17 commit c004710

22 files changed

+148
-92
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
language: node_js
22
node_js:
3-
- 'stable'
4-
- '0.12'
3+
- stable
4+
- 4.5

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
environment:
44
matrix:
5-
- nodejs_version: 5
6-
- nodejs_version: 0.12
5+
- nodejs_version: 7
6+
- nodejs_version: 4.5
77

88
version: "{build}"
99
build: off

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
// builtin tooling
12
var path = require("path")
3+
4+
// external tooling
25
var assign = require("object-assign")
36
var postcss = require("postcss")
7+
8+
// internal tooling
49
var joinMedia = require("./lib/join-media")
510
var resolveId = require("./lib/resolve-id")
611
var loadContent = require("./lib/load-content")

lib/parse-statements.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// external tooling
12
var valueParser = require("postcss-value-parser")
3+
4+
// extended tooling
25
var stringify = valueParser.stringify
36

47
function split(params, start) {

lib/process-content.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
// builtin tooling
12
var path = require("path")
3+
4+
// external tooling
25
var postcss = require("postcss")
6+
7+
// placeholder tooling
38
var sugarss
49

510
module.exports = function processContent(

lib/resolve-id.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1+
// external tooling
12
var resolve = require("resolve")
2-
var jspmResolve
3-
// Works around https://github.com/jspm/jspm-cli/pull/1779 is released
4-
try {
5-
jspmResolve = require("pkg-resolve")
6-
}
7-
catch (ex) {
8-
// pass
9-
}
103

114
var moduleDirectories = [
125
"web_modules",
@@ -47,12 +40,6 @@ module.exports = function(id, base, options) {
4740
.catch(function() {
4841
return resolveModule(id, resolveOpts)
4942
})
50-
.catch(function() {
51-
return jspmResolve.default(id, {
52-
basedir: resolveOpts.basedir,
53-
extensions : resolveOpts.extensions,
54-
})
55-
})
5643
.catch(function() {
5744
if (paths.indexOf(base) === -1) {
5845
paths.unshift(base)

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@
1919
],
2020
"dependencies": {
2121
"object-assign": "^4.0.1",
22-
"postcss": "^5.0.14",
22+
"postcss": "^6.0.1",
2323
"postcss-value-parser": "^3.2.3",
2424
"read-cache": "^1.0.0",
2525
"resolve": "^1.1.7"
2626
},
2727
"devDependencies": {
28-
"ava": "^0.16.0",
29-
"eslint": "^1.10.3",
30-
"eslint-config-i-am-meticulous": "^2.0.0",
28+
"ava": "^0.19.1",
29+
"eslint": "^3.19.0",
30+
"eslint-config-i-am-meticulous": "^6.0.1",
31+
"eslint-plugin-import": "^2.2.0",
3132
"npmpub": "^3.0.1",
32-
"postcss-scss": "^0.1.3",
33-
"sugarss": "^0.2.0"
33+
"postcss-scss": "^1.0.0",
34+
"sugarss": "^1.0.0"
3435
},
3536
"jspm": {
3637
"name": "postcss-import",

test/custom-load.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// external tooling
12
import test from "ava"
3+
4+
// internal tooling
25
import compareFixtures from "./helpers/compare-fixtures"
36

47
test.serial("should accept content", t => {

test/custom-resolve.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1+
// builtin tooling
2+
import path from "path"
3+
4+
// external tooling
15
import test from "ava"
2-
import compareFixtures from "./helpers/compare-fixtures"
36
import postcss from "postcss"
7+
8+
// internal tooling
9+
import compareFixtures from "./helpers/compare-fixtures"
10+
11+
// plugin
412
import atImport from ".."
5-
import path from "path"
613

714
test.serial("should accept file", t => {
815
return compareFixtures(t, "custom-resolve-file", {
916
resolve: () => {
10-
return path.resolve("fixtures/imports/custom-resolve-1.css")
17+
return path.resolve("test/fixtures/imports/custom-resolve-1.css")
1118
},
1219
})
1320
})
@@ -16,7 +23,7 @@ test.serial("should accept promised file", t => {
1623
return compareFixtures(t, "custom-resolve-file", {
1724
resolve: () => {
1825
return Promise.resolve(
19-
path.resolve("fixtures/imports/custom-resolve-1.css")
26+
path.resolve("test/fixtures/imports/custom-resolve-1.css")
2027
)
2128
},
2229
})
@@ -26,9 +33,9 @@ test.serial("should accept array of files", t => {
2633
return compareFixtures(t, "custom-resolve-array", {
2734
resolve: () => {
2835
return [
29-
path.resolve("fixtures/imports/custom-resolve-1.css"),
30-
path.resolve("fixtures/imports/custom-resolve-2.css"),
31-
path.resolve("fixtures/imports/custom-resolve-1.css"),
36+
path.resolve("test/fixtures/imports/custom-resolve-1.css"),
37+
path.resolve("test/fixtures/imports/custom-resolve-2.css"),
38+
path.resolve("test/fixtures/imports/custom-resolve-1.css"),
3239
]
3340
},
3441
})
@@ -38,9 +45,9 @@ test.serial("should accept promised array of files", t => {
3845
return compareFixtures(t, "custom-resolve-array", {
3946
resolve: () => {
4047
return Promise.resolve([
41-
path.resolve("fixtures/imports/custom-resolve-1.css"),
42-
path.resolve("fixtures/imports/custom-resolve-2.css"),
43-
path.resolve("fixtures/imports/custom-resolve-1.css"),
48+
path.resolve("test/fixtures/imports/custom-resolve-1.css"),
49+
path.resolve("test/fixtures/imports/custom-resolve-2.css"),
50+
path.resolve("test/fixtures/imports/custom-resolve-1.css"),
4451
])
4552
},
4653
})
@@ -55,11 +62,11 @@ test(
5562
return path.replace("foo", "imports/bar")
5663
},
5764
load: p => {
58-
t.is(p, path.resolve("fixtures/imports", "bar.css"))
65+
t.is(p, path.resolve("test/fixtures/imports", "bar.css"))
5966
return "/* comment */"
6067
},
6168
}))
62-
.process(`@import "foo.css";`, { from: "fixtures/custom-resolve-file" })
69+
.process(`@import "foo.css";`, { from: "test/fixtures/custom-resolve-file" })
6370
.then(result => {
6471
t.is(result.css, "/* comment */")
6572
})

test/custom-syntax-parser.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
// external tooling
12
import test from "ava"
23
import scss from "postcss-scss"
34
import sugarss from "sugarss"
5+
6+
// internal tooling
47
import compareFixtures from "./helpers/compare-fixtures"
58
import compareFixturesExt from "./helpers/compare-fixtures-ext"
69

0 commit comments

Comments
 (0)