#769 updated some meteor packages, still not working

This commit is contained in:
Kevin Ross 2015-12-09 10:44:13 -06:00
parent d86580b891
commit 93d6bbfb75
7 changed files with 47 additions and 239 deletions

View File

@ -1,39 +0,0 @@
// package metadata file for Meteor.js
'use strict';
var packageName = 'fezvrasta:bootstrap-material-design-fullpalette'; // https://atmospherejs.com/fezvrasta/bootstrap-material-design-fullpalette
var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing.
var packageJson = JSON.parse(Npm.require("fs").readFileSync('package.json'));
Package.describe({
name: packageName,
summary: 'FezVrasta\'s Bootstrap theme implementing Google\'s Material (Paper) Design',
version: packageJson.version,
git: 'https://github.com/fezvrasta/bootstrap-material-design.git'
});
Package.onUse(function (api) {
api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0']);
api.use('twbs:bootstrap@3.3.1');
api.use('jquery');
api.addFiles([
// we bundle all font files, but the client will request only one of them via the CSS @font-face rule
'dist/fonts/Material-Design-Icons.eot', // IE8 or older
'dist/fonts/Material-Design-Icons.svg', // SVG fallback for iOS < 5 - http://caniuse.com/#feat=svg-fonts, http://stackoverflow.com/a/11002874/126903
'dist/fonts/Material-Design-Icons.ttf', // Android Browers 4.1, 4.3 - http://caniuse.com/#feat=ttf
'dist/fonts/Material-Design-Icons.woff', // Supported by all modern browsers
'dist/css/bootstrap-material-design.css',
'dist/css/ripples.css',
'dist/js/material.js',
'dist/js/ripples.js',
'meteor/init.js'
], where);
});
Package.onTest(function (api) {
api.use(packageName, where);
api.use(['tinytest', 'http'], where);
api.addFiles('meteor/test.js', where);
});

View File

@ -1,39 +0,0 @@
// package metadata file for Meteor.js
'use strict';
var packageName = 'fezvrasta:bootstrap-material-design-noglyph'; // https://atmospherejs.com/fezvrasta/bootstrap-material-design-noglyph
var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing.
var packageJson = JSON.parse(Npm.require("fs").readFileSync('package.json'));
Package.describe({
name: packageName,
summary: 'FezVrasta\'s Bootstrap Google Material Design theme. Material icons instead of Bootstrap glyphicons.',
version: packageJson.version,
git: 'https://github.com/fezvrasta/bootstrap-material-design.git'
});
Package.onUse(function (api) {
api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0']);
api.use('twbs:bootstrap-noglyph@3.3.1');
api.use('jquery');
api.addFiles([
// we bundle all font files, but the client will request only one of them via the CSS @font-face rule
'dist/fonts/Material-Design-Icons.eot', // IE8 or older
'dist/fonts/Material-Design-Icons.svg', // SVG fallback for iOS < 5 - http://caniuse.com/#feat=svg-fonts, http://stackoverflow.com/a/11002874/126903
'dist/fonts/Material-Design-Icons.ttf', // Android Browers 4.1, 4.3 - http://caniuse.com/#feat=ttf
'dist/fonts/Material-Design-Icons.woff', // Supported by all modern browsers
'dist/css/material.css', // includes @font-face rules to load the Roboto font
'dist/css/ripples.css',
'dist/js/material.js',
'dist/js/ripples.js',
'meteor/init.js'
], where);
});
Package.onTest(function (api) {
api.use(packageName, where);
api.use(['tinytest', 'http'], where);
api.addFiles('meteor/test.js', where); // same test because we don't test the glyphicons in particular (that's the job of twbs:bootstrap)
});

View File

@ -1,34 +0,0 @@
// package metadata file for Meteor.js
'use strict';
var packageName = 'fezvrasta:bootstrap-material-design-noicons'; // https://atmospherejs.com/fezvrasta/bootstrap-material-design-noicons
var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing.
var packageJson = JSON.parse(Npm.require("fs").readFileSync('package.json'));
Package.describe({
name: packageName,
summary: 'FezVrasta\'s Bootstrap theme implementing Google\'s Material Design (Paper Elements). No icons.',
version: packageJson.version,
git: 'https://github.com/fezvrasta/bootstrap-material-design.git'
});
Package.onUse(function (api) {
api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0']);
api.use('twbs:bootstrap-noglyph@3.3.1');
api.use('jquery');
api.addFiles([
'dist/css/material.css', // includes @font-face rules to load the Roboto font
'dist/css/ripples.css',
'dist/js/material.js',
'dist/js/ripples.js',
'meteor/init.js'
], where);
});
Package.onTest(function (api) {
api.use(packageName, where);
api.use(['tinytest', 'http'], where);
api.addFiles('meteor/test-noicons.js', where);
});

View File

@ -15,17 +15,10 @@ Package.describe({
Package.onUse(function (api) { Package.onUse(function (api) {
api.versionsFrom('METEOR@1.2'); api.versionsFrom('METEOR@1.2');
api.use('twbs:bootstrap@3.3.1'); api.use('twbs:bootstrap@3.3.6');
api.use('jquery'); api.use('jquery');
api.addAssets([
// we bundle all font files, but the client will request only one of them via the CSS @font-face rule
'dist/fonts/Material-Design-Icons.eot', // IE8 or older
'dist/fonts/Material-Design-Icons.svg', // SVG fallback for iOS < 5 - http://caniuse.com/#feat=svg-fonts, http://stackoverflow.com/a/11002874/126903
'dist/fonts/Material-Design-Icons.ttf', // Android Browers 4.1, 4.3 - http://caniuse.com/#feat=ttf
'dist/fonts/Material-Design-Icons.woff', // Supported by all modern browsers
], where);
api.addFiles([ api.addFiles([
'dist/css/material.css', 'dist/css/bootstrap-material-design.css',
'dist/css/ripples.css', 'dist/css/ripples.css',
'dist/js/material.js', 'dist/js/material.js',
'dist/js/ripples.js', 'dist/js/ripples.js',

View File

@ -1,63 +0,0 @@
'use strict';
var packageName; // there seems to be no official way of finding out the name of the very package we're testing - http://stackoverflow.com/questions/27180709/in-a-tinytest-test-file-how-do-i-get-the-name-of-the-package
var plugins = ['affix', 'alert', 'button', 'carousel', 'collapse', 'dropdown', 'modal', 'popover', 'scrollspy', 'tab', 'tooltip'];
// test plugins
plugins.forEach(function (plugin) {
Tinytest.add('Plugin - ' + plugin, function (test) {
test.instanceOf($(document.body)[plugin], Function, 'instantiated correctly');
});
});
// visual check
plugins.forEach(function (plugin) {
Tinytest.addAsync('Visual check - ' + plugin, function (test, done) {
var bootstrapDropZone = document.createElement('div');
document.body.appendChild(bootstrapDropZone);
HTTP.get('http://rawgit.com/twbs/bootstrap/master/js/tests/visual/' + plugin + '.html', function callback(error, result) {
if (error) {
test.fail('Error getting the test file. Do we have an Internet connection to rawgit.com?');
} else {
// [^] matches across newlines. Stay within the container div, or else the fragment will attempt to load resources on its own.
bootstrapDropZone.innerHTML = result.content.match(/<div[^]+<\/div>/);
test.ok({message: 'Test passed if the display looks OK *and* clicking dropdowns/popovers/tooltips works.'});
}
done();
});
});
});
Tinytest.addAsync('Visual check - Material Design', function (test, done) {
var bootstrapDropZone = document.createElement('div');
document.body.appendChild(bootstrapDropZone);
HTTP.get('http://rawgit.com/FezVrasta/bootstrap-material-design/master/bootstrap-elements.html', function callback(error, result) {
if (error) {
test.fail('Error getting the FezVrasta test file. Do we have an Internet connection to rawgit.com?');
} else {
// [^] matches across newlines. Stay within the container div, or else the fragment will attempt to load resources on its own.
bootstrapDropZone.innerHTML = result.content.match(/<meta name="viewport"[^]+<script src=/);
test.ok({message: 'Test passed if the display looks OK *and* clicking dropdowns/popovers/tooltips works.'});
// only does anything after loading the 'dropdown' plugin test
$('[data-toggle="dropdown"]').dropdown();
// only does anything after loading the 'popover' plugin test
$('[data-toggle="popover"]').popover();
// only does anything after loading the 'tooltip' plugin test
$('[data-toggle="tooltip"]').tooltip();
// don't initialize the modals because that messes up the Tinytest runner HTML
$.material.init();
}
done();
});
});

View File

@ -1,46 +1,46 @@
'use strict'; 'use strict';
var packageName; // there seems to be no official way of finding out the name of the very package we're testing - http://stackoverflow.com/questions/27180709/in-a-tinytest-test-file-how-do-i-get-the-name-of-the-package //var packageName; // there seems to be no official way of finding out the name of the very package we're testing - http://stackoverflow.com/questions/27180709/in-a-tinytest-test-file-how-do-i-get-the-name-of-the-package
//
// Check that the font files are downloadable. Meteor places assets at /packages/<packageName>/. //// Check that the font files are downloadable. Meteor places assets at /packages/<packageName>/.
// Only 'woff' for now, but 'woff2' may become available - https://github.com/FortAwesome/Font-Awesome/pull/5062#discussion_r20936453 //// Only 'woff' for now, but 'woff2' may become available - https://github.com/FortAwesome/Font-Awesome/pull/5062#discussion_r20936453
['eot', 'svg', 'ttf', 'woff'].forEach(function (font) { //['eot', 'svg', 'ttf', 'woff'].forEach(function (font) {
Tinytest.addAsync(font + ' fonts are shipped', function (test, done) { // Tinytest.addAsync(font + ' fonts are shipped', function (test, done) {
//
// curiously enough, the 'local-test:...' package isn't loaded into Package before calling Tinytest, so we can't do this determination outside this loop // // curiously enough, the 'local-test:...' package isn't loaded into Package before calling Tinytest, so we can't do this determination outside this loop
if (!packageName) // if (!packageName)
Object.keys(Package).forEach(function(p) { // Object.keys(Package).forEach(function(p) {
if (p.search(/local-test/) > -1) // if (p.search(/local-test/) > -1)
packageName = p.replace('local-test:', ''); // we should stop the loop, but forEach can't do that // packageName = p.replace('local-test:', ''); // we should stop the loop, but forEach can't do that
}) // })
//
if (!packageName) { // if (!packageName) {
test.exception({message: 'Package not quite loaded... go figure'}); // test.exception({message: 'Package not quite loaded... go figure'});
return // return
} // }
//
var packagePath = packageName.replace(':', '_') // e.g. meteorpackaging_bootstrap-material-design // var packagePath = packageName.replace(':', '_') // e.g. meteorpackaging_bootstrap-material-design
//
HTTP.get( // HTTP.get(
'/packages/' + packagePath + '/dist/fonts/Material-Design-Icons.' + font, // '/packages/' + packagePath + '/dist/fonts/Material-Design-Icons.' + font,
{ // {
headers: { // headers: {
'Cache-Control': 'no-cache' // because Meteor has cached fonts even after they were removed from package.js (!) - https://github.com/meteor/meteor/issues/3196 // 'Cache-Control': 'no-cache' // because Meteor has cached fonts even after they were removed from package.js (!) - https://github.com/meteor/meteor/issues/3196
} // }
}, // },
function callback(error, result) { // function callback(error, result) {
if (error) { // if (error) {
test.fail({message: 'Font failed to load'}); // test.fail({message: 'Font failed to load'});
} else { // } else {
// if the file is 404, Meteor will redirect to / and return the Meteor.js boilerplate // // if the file is 404, Meteor will redirect to / and return the Meteor.js boilerplate
test.isTrue(result.content.length > 100000, font + ' font could not be downloaded'); // test.isTrue(result.content.length > 100000, font + ' font could not be downloaded');
} // }
//
done(); // done();
} // }
); // );
}); // });
}) //})
var plugins = ['affix', 'alert', 'button', 'carousel', 'collapse', 'dropdown', 'modal', 'popover', 'scrollspy', 'tab', 'tooltip']; var plugins = ['affix', 'alert', 'button', 'carousel', 'collapse', 'dropdown', 'modal', 'popover', 'scrollspy', 'tab', 'tooltip'];

View File

@ -1,8 +1,5 @@
// package metadata file for Meteor.js // package metadata file for Meteor.js
'use strict';
/* jshint strict:false */
/* global Package:true */
/* global Npm:true */
var packageName = 'fezvrasta:bootstrap-material-design'; // https://atmospherejs.com/fezvrasta/bootstrap-material-design var packageName = 'fezvrasta:bootstrap-material-design'; // https://atmospherejs.com/fezvrasta/bootstrap-material-design
var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing. var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing.
@ -18,17 +15,10 @@ Package.describe({
Package.onUse(function (api) { Package.onUse(function (api) {
api.versionsFrom('METEOR@1.2'); api.versionsFrom('METEOR@1.2');
api.use('twbs:bootstrap@3.3.1'); api.use('twbs:bootstrap@3.3.6');
api.use('jquery'); api.use('jquery');
api.addAssets([
// we bundle all font files, but the client will request only one of them via the CSS @font-face rule
'dist/fonts/Material-Design-Icons.eot', // IE8 or older
'dist/fonts/Material-Design-Icons.svg', // SVG fallback for iOS < 5 - http://caniuse.com/#feat=svg-fonts, http://stackoverflow.com/a/11002874/126903
'dist/fonts/Material-Design-Icons.ttf', // Android Browers 4.1, 4.3 - http://caniuse.com/#feat=ttf
'dist/fonts/Material-Design-Icons.woff', // Supported by all modern browsers
], where);
api.addFiles([ api.addFiles([
'dist/css/material.css', 'dist/css/bootstrap-material-design.css',
'dist/css/ripples.css', 'dist/css/ripples.css',
'dist/js/material.js', 'dist/js/material.js',
'dist/js/ripples.js', 'dist/js/ripples.js',