Skip to content

Commit f192921

Browse files
committed
plugins/postcss-custom-selectors
1 parent bf85f33 commit f192921

31 files changed

+570
-2800
lines changed

plugins/postcss-custom-selectors/.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/*
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16.13.1

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

-26
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
module.exports = {
1+
const postcssTape = require('../../packages/postcss-tape/dist/index.cjs');
2+
const plugin = require('postcss-custom-selectors');
3+
4+
postcssTape(plugin)({
25
'basic': {
36
message: 'supports basic usage'
47
},
@@ -11,7 +14,7 @@ module.exports = {
1114
'safety': {
1215
message: 'supports safe tag ordering (.foo:--h1 becomes h1.foo instead of .fooh1)'
1316
},
14-
'basic:import': {
17+
'basic-import': {
1518
message: 'supports { importFrom: { customSelectors: { ... } } } usage',
1619
options: {
1720
importFrom: {
@@ -21,7 +24,7 @@ module.exports = {
2124
}
2225
}
2326
},
24-
'basic:import-fn': {
27+
'basic-import:fn': {
2528
message: 'supports { importFrom() } usage',
2629
options: {
2730
importFrom() {
@@ -32,10 +35,9 @@ module.exports = {
3235
};
3336
}
3437
},
35-
expect: 'basic.import.expect.css',
36-
result: 'basic.import.result.css'
38+
expect: 'basic-import.expect.css'
3739
},
38-
'basic:import-fn-promise': {
40+
'basic-import:fn-promise': {
3941
message: 'supports { async importFrom() } usage',
4042
options: {
4143
importFrom() {
@@ -48,58 +50,51 @@ module.exports = {
4850
});
4951
}
5052
},
51-
expect: 'basic.import.expect.css',
52-
result: 'basic.import.result.css'
53+
expect: 'basic-import.expect.css'
5354
},
54-
'basic:import-json': {
55+
'basic-import:json': {
5556
message: 'supports { importFrom: "test/import-selectors.json" } usage',
5657
options: {
5758
importFrom: 'test/import-selectors.json'
5859
},
59-
expect: 'basic.import.expect.css',
60-
result: 'basic.import.result.css'
60+
expect: 'basic-import.expect.css'
6161
},
62-
'basic:import-js': {
62+
'basic-import:js': {
6363
message: 'supports { importFrom: "test/import-selectors.js" } usage',
6464
options: {
6565
importFrom: 'test/import-selectors.js'
6666
},
67-
expect: 'basic.import.expect.css',
68-
result: 'basic.import.result.css'
67+
expect: 'basic-import.expect.css'
6968
},
70-
'basic:import-css': {
69+
'basic-import:css': {
7170
message: 'supports { importFrom: "test/import-selectors.css" } usage',
7271
options: {
7372
importFrom: 'test/import-selectors.css'
7473
},
75-
expect: 'basic.import.expect.css',
76-
result: 'basic.import.result.css'
74+
expect: 'basic-import.expect.css'
7775
},
78-
'basic:import-css-from': {
76+
'basic-import:css-from': {
7977
message: 'supports { importFrom: { from: "test/import-selectors.css" } } usage',
8078
options: {
8179
importFrom: { from: 'test/import-selectors.css' }
8280
},
83-
expect: 'basic.import.expect.css',
84-
result: 'basic.import.result.css'
81+
expect: 'basic-import.expect.css'
8582
},
86-
'basic:import-css-from-multiple-files': {
83+
'basic-import:css-from-multiple-files': {
8784
message: 'supports { importFrom: ["test/empty.css", "test/import-selectors.css"] } usage',
8885
options: {
8986
importFrom: ["test/empty.css", "test/import-selectors.css"]
9087
},
91-
expect: 'basic.import.expect.css',
92-
result: 'basic.import.result.css'
88+
expect: 'basic-import.expect.css'
9389
},
94-
'basic:import-css-from-type': {
90+
'basic-import:css-from-type': {
9591
message: 'supports { importFrom: [ { from: "test/import-selectors.css", type: "css" } ] } usage',
9692
options: {
97-
importFrom: [ { from: 'test/import-selectors.css', type: 'css' } ]
93+
importFrom: [{ from: 'test/import-selectors.css', type: 'css' }]
9894
},
99-
expect: 'basic.import.expect.css',
100-
result: 'basic.import.result.css'
95+
expect: 'basic-import.expect.css'
10196
},
102-
'basic:import-empty': {
97+
'basic-import:empty': {
10398
message: 'supports { importFrom: {} } usage',
10499
options: {
105100
importFrom: {}
@@ -112,8 +107,6 @@ module.exports = {
112107
customSelectors: null
113108
})
114109
},
115-
expect: 'basic.expect.css',
116-
result: 'basic.result.css',
117110
after() {
118111
if (__exportSelectorObject.customSelectors[':--foo'] !== '.foo') {
119112
throw new Error('The exportTo function failed');
@@ -129,8 +122,7 @@ module.exports = {
129122
}
130123
}
131124
},
132-
expect: 'basic.expect.css',
133-
result: 'basic.result.css'
125+
expect: 'basic.expect.css'
134126
},
135127
'basic:export-fn-promise': {
136128
message: 'supports { async exportTo() } usage',
@@ -145,103 +137,96 @@ module.exports = {
145137
});
146138
}
147139
},
148-
expect: 'basic.expect.css',
149-
result: 'basic.result.css'
140+
expect: 'basic.expect.css'
150141
},
151142
'basic:export-json': {
152143
message: 'supports { exportTo: "test/export-selectors.json" } usage',
153144
options: {
154145
exportTo: 'test/export-selectors.json'
155146
},
156-
expect: 'basic.expect.css',
157-
result: 'basic.result.css',
158147
before() {
159148
global.__exportSelectorsString = require('fs').readFileSync('test/export-selectors.json', 'utf8');
160149
},
161150
after() {
162151
if (global.__exportSelectorsString !== require('fs').readFileSync('test/export-selectors.json', 'utf8')) {
163152
throw new Error('The original file did not match the freshly exported copy');
164153
}
165-
}
154+
},
155+
expect: 'basic.expect.css'
166156
},
167157
'basic:export-js': {
168158
message: 'supports { exportTo: "test/export-selectors.js" } usage',
169159
options: {
170160
exportTo: 'test/export-selectors.js'
171161
},
172-
expect: 'basic.expect.css',
173-
result: 'basic.result.css',
174162
before() {
175163
global.__exportSelectorsString = require('fs').readFileSync('test/export-selectors.js', 'utf8');
176164
},
177165
after() {
178166
if (global.__exportSelectorsString !== require('fs').readFileSync('test/export-selectors.js', 'utf8')) {
179167
throw new Error('The original file did not match the freshly exported copy');
180168
}
181-
}
169+
},
170+
expect: 'basic.expect.css'
182171
},
183172
'basic:export-mjs': {
184173
message: 'supports { exportTo: "test/export-selectors.mjs" } usage',
185174
options: {
186175
exportTo: 'test/export-selectors.mjs'
187176
},
188-
expect: 'basic.expect.css',
189-
result: 'basic.result.css',
190177
before() {
191178
global.__exportSelectorsString = require('fs').readFileSync('test/export-selectors.mjs', 'utf8');
192179
},
193180
after() {
194181
if (global.__exportSelectorsString !== require('fs').readFileSync('test/export-selectors.mjs', 'utf8')) {
195182
throw new Error('The original file did not match the freshly exported copy');
196183
}
197-
}
184+
},
185+
expect: 'basic.expect.css'
198186
},
199187
'basic:export-css': {
200188
message: 'supports { exportTo: "test/export-selectors.css" } usage',
201189
options: {
202190
exportTo: 'test/export-selectors.css'
203191
},
204-
expect: 'basic.expect.css',
205-
result: 'basic.result.css',
206192
before() {
207193
global.__exportSelectorsString = require('fs').readFileSync('test/export-selectors.css', 'utf8');
208194
},
209195
after() {
210196
if (global.__exportSelectorsString !== require('fs').readFileSync('test/export-selectors.css', 'utf8')) {
211197
throw new Error('The original file did not match the freshly exported copy');
212198
}
213-
}
199+
},
200+
expect: 'basic.expect.css'
214201
},
215202
'basic:export-css-to': {
216203
message: 'supports { exportTo: { to: "test/export-selectors.css" } } usage',
217204
options: {
218205
exportTo: { to: 'test/export-selectors.css' }
219206
},
220-
expect: 'basic.expect.css',
221-
result: 'basic.result.css',
222207
before() {
223208
global.__exportSelectorsString = require('fs').readFileSync('test/export-selectors.css', 'utf8');
224209
},
225210
after() {
226211
if (global.__exportSelectorsString !== require('fs').readFileSync('test/export-selectors.css', 'utf8')) {
227212
throw new Error('The original file did not match the freshly exported copy');
228213
}
229-
}
214+
},
215+
expect: 'basic.expect.css'
230216
},
231217
'basic:export-css-to-type': {
232218
message: 'supports { exportTo: { to: "test/export-selectors.css", type: "css" } } usage',
233219
options: {
234220
exportTo: { to: 'test/export-selectors.css', type: 'css' }
235221
},
236-
expect: 'basic.expect.css',
237-
result: 'basic.result.css',
238222
before() {
239223
global.__exportSelectorsString = require('fs').readFileSync('test/export-selectors.css', 'utf8');
240224
},
241225
after() {
242226
if (global.__exportSelectorsString !== require('fs').readFileSync('test/export-selectors.css', 'utf8')) {
243227
throw new Error('The original file did not match the freshly exported copy');
244228
}
245-
}
229+
},
230+
expect: 'basic.expect.css'
246231
}
247-
};
232+
});

0 commit comments

Comments
 (0)