From fc2848c15925e6fade9edba5c689646cca367004 Mon Sep 17 00:00:00 2001 From: Martin Wragg Date: Tue, 7 Nov 2017 17:33:54 -0800 Subject: [PATCH] Polymer 1.x/2.x hybrid element support --- HISTORY.md | 4 + bower.json | 5 +- css/px-dropdown-styles.html | 2 +- demo/px-dropdown-demo.html | 9 +- gulpfile.js | 30 +- index.html | 6 +- package.json | 3 +- px-dropdown-api.json | 1524 ++++++++++++ yarn.lock | 4644 ++++++++++++++++++++++++++++++++++- 9 files changed, 6142 insertions(+), 85 deletions(-) create mode 100644 px-dropdown-api.json diff --git a/HISTORY.md b/HISTORY.md index e9696aa9..943658ea 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,7 @@ +v4.1.0 +================== +* Polymer 1.x/2.x hybrid element support + v4.0.18 ================== * fix demo diff --git a/bower.json b/bower.json index 79b38678..8f4669a9 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "px-dropdown", - "version": "4.0.18", + "version": "4.1.0", "main": [ "px-dropdown.html" ], @@ -43,7 +43,8 @@ "px-colors-design": "^1.0.0", "px-box-sizing-design": "^1.0.0", "px-helpers-design": "^1.0.0", - "web-component-tester": "^6.0.0" + "web-component-tester": "^6.0.0", + "px-demo": "^3.0.0" }, "resolutions": { "webcomponentsjs": "^1.0.0" diff --git a/css/px-dropdown-styles.html b/css/px-dropdown-styles.html index d56aca52..859d81e3 100644 --- a/css/px-dropdown-styles.html +++ b/css/px-dropdown-styles.html @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/demo/px-dropdown-demo.html b/demo/px-dropdown-demo.html index c593b584..fe4ddb43 100644 --- a/demo/px-dropdown-demo.html +++ b/demo/px-dropdown-demo.html @@ -28,16 +28,16 @@ - + - + - + - + diff --git a/gulpfile.js b/gulpfile.js index 5406f760..e04d6b2d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -11,6 +11,7 @@ const gulpif = require('gulp-if'); const combiner = require('stream-combiner2'); const bump = require('gulp-bump'); const argv = require('yargs').argv; +const exec = require('child_process').exec; const sassOptions = { importer: importOnce, @@ -44,13 +45,8 @@ function buildCSS(){ } gulp.task('sass', function() { - return gulp.src(['./sass/*.scss', '!./sass/*sketch.scss', '!./sass/*-demo.scss']) + return gulp.src(['./sass/*.scss']) .pipe(buildCSS()) - .pipe(gulpif(/.*predix/, - $.rename(function(path){ - path.basename = new RegExp('.+?(?=\-predix)').exec(path.basename)[0]; - }) - )) .pipe(stylemod({ moduleId: function(file) { return path.basename(file.path, path.extname(file.path)) + '-styles'; @@ -60,16 +56,17 @@ gulp.task('sass', function() { .pipe(browserSync.stream({match: 'css/*.html'})); }); -gulp.task('demosass', function() { - return gulp.src(['./sass/*-demo.scss']) - .pipe(buildCSS()) - .pipe(gulp.dest('css')) - .pipe(browserSync.stream({match: '**/*.css'})); +gulp.task('generate-api', function (cb) { + exec(`node_modules/.bin/polymer analyze ${pkg.name}.html > ${pkg.name}-api.json`, function (err, stdout, stderr) { + console.log(stdout); + console.log(stderr); + cb(err); + }); }); + gulp.task('watch', function() { - gulp.watch(['!sass/*-demo.scss', 'sass/*.scss'], ['sass']); - gulp.watch('sass/*-demo.scss', ['demosass']); + gulp.watch(['sass/*.scss'], ['sass']); }); gulp.task('serve', function() { @@ -82,9 +79,8 @@ gulp.task('serve', function() { server: ['./', 'bower_components'], }); - gulp.watch(['css/*-styles.html', 'css/*-demo.css', '*.html', '*.js']).on('change', browserSync.reload); - gulp.watch(['sass/*.scss', '!sass/*-demo.scss'], ['sass']); - gulp.watch('sass/*-demo.scss', ['demosass']); + gulp.watch(['css/*-styles.html', '*.html', '*.js', 'demo/*.html']).on('change', browserSync.reload); + gulp.watch(['sass/*.scss'], ['sass']); }); @@ -107,5 +103,5 @@ gulp.task('bump:major', function(){ }); gulp.task('default', function(callback) { - gulpSequence('clean', 'sass', 'demosass')(callback); + gulpSequence('clean', 'sass', 'generate-api')(callback); }); diff --git a/index.html b/index.html index 0c12cd02..1db5da26 100644 --- a/index.html +++ b/index.html @@ -30,7 +30,7 @@ if (!webComponentsSupported) { var script = document.createElement('script'); script.async = true; - script.src = '../webcomponentsjs/webcomponents-lite.min.js'; + script.src = '../webcomponentsjs/webcomponents-lite.js'; script.onload = onload; document.head.appendChild(script); } else { @@ -48,7 +48,9 @@ Load theme files, apply default theme. --> - + + +