Skip to content

Commit 2213a9c

Browse files
committed
Testing
1 parent 0ba3cb3 commit 2213a9c

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "superfly-css-task-deploy",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "Deploy task for superfly-css modules",
55
"main": "src/main/js/index.js",
66
"scripts": {
@@ -26,7 +26,21 @@
2626
},
2727
"homepage": "https://github.com/superfly-css/superfly-css-task-deploy#readme",
2828
"dependencies": {
29+
"gulp-cheerio": "^0.6.2",
2930
"gulp-uncss": "^1.0.6",
31+
"autoprefixer": "^6.7.7",
32+
"gulp-postcss": "^6.4.0",
33+
"postcss-apply": "^0.6.1",
34+
"postcss-calc": "^5.3.1",
35+
"postcss-color-function": "^3.0.0",
36+
"postcss-custom-media": "^5.0.1",
37+
"postcss-custom-properties": "^5.0.2",
38+
"postcss-each": "^0.9.3",
39+
"postcss-font-magician": "^1.6.1",
40+
"postcss-for": "^2.1.1",
41+
"postcss-import": "^9.1.0",
42+
"postcss-reporter": "^3.0.0",
43+
"postcss-sass-color-functions": "^1.1.0",
3044
"superfly-css-pli": "0.0.9"
3145
}
3246
}

src/main/js/index.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
//==================================================
32
// For the description see
43
// [SupeflyCSS Test Task](https://github.com/superfly-css/superfly-css-task-deploy/)
@@ -30,7 +29,7 @@
3029
// that are used have @font-face declarations generated.
3130
// Main and test css is sourced and the result of the task
3231
// is output to the corresponding deploy directories.
33-
// ---------------------------------------------------
32+
-// ---------------------------------------------------
3433
// deploy:html
3534
// ---------------------------------------------------
3635
// This updates the css import of the corresponding test html
@@ -47,6 +46,7 @@
4746
//==================================================
4847

4948
var gulp = require('gulp');
49+
var cheerio = require('gulp-cheerio');
5050
var pc = require('gulp-postcss');
5151
var pc_import = require('postcss-import');
5252
var pc_calc = require('postcss-calc');
@@ -72,28 +72,30 @@ var post_uncss_processors = [pc_font_magician, autoprefixer, pc_reporter({
7272

7373
gulp.task('deploy:test:css', function() {
7474
return gulp.src(PLI.SRC_TEST_CSS)
75+
.pipe(pc(pre_uncss_processors))
7576
.pipe(uncss({
76-
.pipe(pc(pre_uncss_processors))
7777
html: [PLI.TARGET_TEST_HTML]
7878
}))
7979
.pipe(pc(post_uncss_processors))
8080
.pipe(gulp.dest(PLI.deploy.test.css));
8181
});
8282

83-
84-
85-
var PLI = require('superfly-css-pli');
86-
87-
//---------------------------------
8883
gulp.task('deploy:test:html', function() {
8984
return gulp
9085
.src(PLI.TARGET_TEST_HTML)
9186
.pipe(cheerio(function($, file) {
92-
$('link[href="href="../../../target/test/css/index.css"]').a‌ttr('href',
93-
$('link[href="href="../../../target/test/css/index.css"]').
94-
a‌ttr('href').replace('target', 'deploy'));
87+
$('.Test_markup > code').each(function() {
88+
var markup = $(this).html();
89+
//Insert the Test-render block after the Test-then block
90+
//Append the markup block to the Test-render block
91+
$($(this).parent().parent().next().children('.Test_description')).after(renderTestBlock).next().append(markup);
9592
});
9693
}))
94+
/*
95+
$('link[href="href="../../../target/test/css/index.css"]').a‌​ttr('href',
96+
97+
});*/
98+
9799
.pipe(gulp.dest(PLI.deploy.test.html));
98100
});
99101

0 commit comments

Comments
 (0)