Skip to content

Commit 26d3145

Browse files
committed
plugins/postcss-custom-media
1 parent 35e62c0 commit 26d3145

26 files changed

+442
-2355
lines changed

plugins/postcss-custom-media/.editorconfig

-15
This file was deleted.
+3-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
node_modules
2-
index.*.*
32
package-lock.json
4-
*.log*
3+
yarn.lock
54
*.result.css
6-
.*
7-
!.editorconfig
8-
!.gitignore
9-
!.rollup.js
10-
!.tape.js
11-
!.travis.yml
5+
*.result.css.map
6+
dist/*

plugins/postcss-custom-media/.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16.13.1

plugins/postcss-custom-media/.rollup.js

-20
This file was deleted.

plugins/postcss-custom-media/.tape.js renamed to plugins/postcss-custom-media/.tape.cjs

+28-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
module.exports = {
1+
const postcssTape = require('../../packages/postcss-tape/dist/index.cjs');
2+
const plugin = require('postcss-custom-media');
3+
const fs = require('fs');
4+
5+
postcssTape(plugin)({
26
'basic': {
37
message: 'supports basic usage'
48
},
@@ -8,6 +12,15 @@ module.exports = {
812
preserve: true
913
}
1014
},
15+
'examples/example': {
16+
message: 'minimal example',
17+
},
18+
'examples/example:preserve': {
19+
message: 'minimal example',
20+
options: {
21+
preserve: true
22+
}
23+
},
1124
'import': {
1225
message: 'supports { importFrom: { customMedia: { ... } } } usage',
1326
options: {
@@ -86,7 +99,7 @@ module.exports = {
8699
'import:css-from-type': {
87100
message: 'supports { importFrom: [ { from: "test/import-media.css", type: "css" } ] } usage',
88101
options: {
89-
importFrom: [ { from: 'test/import-media.css', type: 'css' } ]
102+
importFrom: [{ from: 'test/import-media.css', type: 'css' }]
90103
},
91104
expect: 'import.expect.css',
92105
result: 'import.result.css'
@@ -148,10 +161,10 @@ module.exports = {
148161
expect: 'basic.expect.css',
149162
result: 'basic.result.css',
150163
before() {
151-
global.__exportMediaString = require('fs').readFileSync('test/export-media.json', 'utf8');
164+
global.__exportMediaString = fs.readFileSync('test/export-media.json', 'utf8');
152165
},
153166
after() {
154-
if (global.__exportMediaString !== require('fs').readFileSync('test/export-media.json', 'utf8')) {
167+
if (global.__exportMediaString !== fs.readFileSync('test/export-media.json', 'utf8')) {
155168
throw new Error('The original file did not match the freshly exported copy');
156169
}
157170
}
@@ -164,10 +177,10 @@ module.exports = {
164177
expect: 'basic.expect.css',
165178
result: 'basic.result.css',
166179
before() {
167-
global.__exportMediaString = require('fs').readFileSync('test/export-media.js', 'utf8');
180+
global.__exportMediaString = fs.readFileSync('test/export-media.js', 'utf8');
168181
},
169182
after() {
170-
if (global.__exportMediaString !== require('fs').readFileSync('test/export-media.js', 'utf8')) {
183+
if (global.__exportMediaString !== fs.readFileSync('test/export-media.js', 'utf8')) {
171184
throw new Error('The original file did not match the freshly exported copy');
172185
}
173186
}
@@ -180,10 +193,10 @@ module.exports = {
180193
expect: 'basic.expect.css',
181194
result: 'basic.result.css',
182195
before() {
183-
global.__exportMediaString = require('fs').readFileSync('test/export-media.mjs', 'utf8');
196+
global.__exportMediaString = fs.readFileSync('test/export-media.mjs', 'utf8');
184197
},
185198
after() {
186-
if (global.__exportMediaString !== require('fs').readFileSync('test/export-media.mjs', 'utf8')) {
199+
if (global.__exportMediaString !== fs.readFileSync('test/export-media.mjs', 'utf8')) {
187200
throw new Error('The original file did not match the freshly exported copy');
188201
}
189202
}
@@ -196,10 +209,10 @@ module.exports = {
196209
expect: 'basic.expect.css',
197210
result: 'basic.result.css',
198211
before() {
199-
global.__exportMediaString = require('fs').readFileSync('test/export-media.css', 'utf8');
212+
global.__exportMediaString = fs.readFileSync('test/export-media.css', 'utf8');
200213
},
201214
after() {
202-
if (global.__exportMediaString !== require('fs').readFileSync('test/export-media.css', 'utf8')) {
215+
if (global.__exportMediaString !== fs.readFileSync('test/export-media.css', 'utf8')) {
203216
throw new Error('The original file did not match the freshly exported copy');
204217
}
205218
}
@@ -212,10 +225,10 @@ module.exports = {
212225
expect: 'basic.expect.css',
213226
result: 'basic.result.css',
214227
before() {
215-
global.__exportMediaString = require('fs').readFileSync('test/export-media.css', 'utf8');
228+
global.__exportMediaString = fs.readFileSync('test/export-media.css', 'utf8');
216229
},
217230
after() {
218-
if (global.__exportMediaString !== require('fs').readFileSync('test/export-media.css', 'utf8')) {
231+
if (global.__exportMediaString !== fs.readFileSync('test/export-media.css', 'utf8')) {
219232
throw new Error('The original file did not match the freshly exported copy');
220233
}
221234
}
@@ -228,12 +241,12 @@ module.exports = {
228241
expect: 'basic.expect.css',
229242
result: 'basic.result.css',
230243
before() {
231-
global.__exportMediaString = require('fs').readFileSync('test/export-media.css', 'utf8');
244+
global.__exportMediaString = fs.readFileSync('test/export-media.css', 'utf8');
232245
},
233246
after() {
234-
if (global.__exportMediaString !== require('fs').readFileSync('test/export-media.css', 'utf8')) {
247+
if (global.__exportMediaString !== fs.readFileSync('test/export-media.css', 'utf8')) {
235248
throw new Error('The original file did not match the freshly exported copy');
236249
}
237250
}
238251
}
239-
};
252+
});

plugins/postcss-custom-media/.travis.yml

-11
This file was deleted.

plugins/postcss-custom-media/CHANGELOG.md

100755100644
File mode changed.

plugins/postcss-custom-media/CONTRIBUTING.md

-65
This file was deleted.

0 commit comments

Comments
 (0)