Skip to content

Commit

Permalink
#769 updated some meteor packages, still not working
Browse files Browse the repository at this point in the history
  • Loading branch information
rosskevin committed Dec 9, 2015
1 parent d86580b commit 93d6bbf
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 239 deletions.
39 changes: 0 additions & 39 deletions meteor/package-fullpalette.js

This file was deleted.

39 changes: 0 additions & 39 deletions meteor/package-noglyph.js

This file was deleted.

34 changes: 0 additions & 34 deletions meteor/package-noicons.js

This file was deleted.

11 changes: 2 additions & 9 deletions meteor/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,10 @@ Package.describe({

Package.onUse(function (api) {
api.versionsFrom('[email protected]');
api.use('twbs:[email protected].1');
api.use('twbs:[email protected].6');
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([
'dist/css/material.css',
'dist/css/bootstrap-material-design.css',
'dist/css/ripples.css',
'dist/js/material.js',
'dist/js/ripples.js',
Expand Down
63 changes: 0 additions & 63 deletions meteor/test-noicons.js

This file was deleted.

84 changes: 42 additions & 42 deletions meteor/test.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
'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

// 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
['eot', 'svg', 'ttf', 'woff'].forEach(function (font) {
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
if (!packageName)
Object.keys(Package).forEach(function(p) {
if (p.search(/local-test/) > -1)
packageName = p.replace('local-test:', ''); // we should stop the loop, but forEach can't do that
})

if (!packageName) {
test.exception({message: 'Package not quite loaded... go figure'});
return
}

var packagePath = packageName.replace(':', '_') // e.g. meteorpackaging_bootstrap-material-design

HTTP.get(
'/packages/' + packagePath + '/dist/fonts/Material-Design-Icons.' + font,
{
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
}
},
function callback(error, result) {
if (error) {
test.fail({message: 'Font failed to load'});
} else {
// 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');
}

done();
}
);
});
})
//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>/.
//// 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) {
// 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
// if (!packageName)
// Object.keys(Package).forEach(function(p) {
// if (p.search(/local-test/) > -1)
// packageName = p.replace('local-test:', ''); // we should stop the loop, but forEach can't do that
// })
//
// if (!packageName) {
// test.exception({message: 'Package not quite loaded... go figure'});
// return
// }
//
// var packagePath = packageName.replace(':', '_') // e.g. meteorpackaging_bootstrap-material-design
//
// HTTP.get(
// '/packages/' + packagePath + '/dist/fonts/Material-Design-Icons.' + font,
// {
// 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
// }
// },
// function callback(error, result) {
// if (error) {
// test.fail({message: 'Font failed to load'});
// } else {
// // 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');
// }
//
// done();
// }
// );
// });
//})

var plugins = ['affix', 'alert', 'button', 'carousel', 'collapse', 'dropdown', 'modal', 'popover', 'scrollspy', 'tab', 'tooltip'];

Expand Down Expand Up @@ -103,4 +103,4 @@ document.addEventListener('DOMContentLoaded', function() {

});

});
});
16 changes: 3 additions & 13 deletions package.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// package metadata file for Meteor.js

/* jshint strict:false */
/* global Package:true */
/* global Npm:true */
'use strict';

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.
Expand All @@ -18,17 +15,10 @@ Package.describe({

Package.onUse(function (api) {
api.versionsFrom('[email protected]');
api.use('twbs:[email protected].1');
api.use('twbs:[email protected].6');
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([
'dist/css/material.css',
'dist/css/bootstrap-material-design.css',
'dist/css/ripples.css',
'dist/js/material.js',
'dist/js/ripples.js',
Expand Down

0 comments on commit 93d6bbf

Please sign in to comment.