Get codePointAt/fromCodePoint working on the server

This commit is contained in:
Shaunak Kishore
2015-09-24 23:03:46 -04:00
parent e55c9a3442
commit aff018a324
9 changed files with 66 additions and 0 deletions

View File

@ -19,3 +19,5 @@ ejson
spacebars spacebars
check check
ecmascript ecmascript
meteorhacks:npm
npm-container

View File

@ -33,12 +33,15 @@ livedata@1.0.15
logging@1.0.8 logging@1.0.8
meteor@1.1.7 meteor@1.1.7
meteor-base@1.0.1 meteor-base@1.0.1
meteorhacks:async@1.0.0
meteorhacks:npm@1.5.0
minifiers@1.1.7 minifiers@1.1.7
minimongo@1.0.9 minimongo@1.0.9
mobile-experience@1.0.1 mobile-experience@1.0.1
mobile-status-bar@1.0.6 mobile-status-bar@1.0.6
mongo@1.1.1 mongo@1.1.1
mongo-id@1.0.1 mongo-id@1.0.1
npm-container@1.2.0
npm-mongo@1.4.39_1 npm-mongo@1.4.39_1
observe-sequence@1.0.7 observe-sequence@1.0.7
ordered-dict@1.0.4 ordered-dict@1.0.4

View File

@ -8,3 +8,7 @@ this.assert = (condition, message) => {
} }
this.maybeRequire = (module) => Meteor.isServer ? Npm.require(module) : null; this.maybeRequire = (module) => Meteor.isServer ? Npm.require(module) : null;
if (Meteor.isServer) {
Meteor.npmRequire('es6-shim');
}

3
packages.json Normal file
View File

@ -0,0 +1,3 @@
{
"es6-shim": "0.33.3"
}

View File

@ -0,0 +1 @@
node_modules

View File

@ -0,0 +1,7 @@
This directory and the files immediately inside it are automatically generated
when you change this package's NPM dependencies. Commit the files in this
directory (npm-shrinkwrap.json, .gitignore, and this README) to source control
so that others run the same versions of sub-dependencies.
You should NOT check in the node_modules directory that Meteor automatically
creates; if you are using git, the .gitignore file tells git to ignore it.

View File

@ -0,0 +1,7 @@
{
"dependencies": {
"es6-shim": {
"version": "0.33.3"
}
}
}

View File

@ -0,0 +1,9 @@
Meteor.npmRequire = function(moduleName) {
var module = Npm.require(moduleName);
return module;
};
Meteor.require = function(moduleName) {
console.warn('Meteor.require is deprecated. Please use Meteor.npmRequire instead!');
return Meteor.npmRequire(moduleName);
};

View File

@ -0,0 +1,30 @@
var path = Npm.require('path');
var fs = Npm.require('fs');
Package.describe({
summary: 'Contains all your npm dependencies',
version: '1.2.0',
name: 'npm-container'
});
var packagesJsonFile = path.resolve('./packages.json');
try {
var fileContent = fs.readFileSync(packagesJsonFile);
var packages = JSON.parse(fileContent.toString());
Npm.depends(packages);
} catch (ex) {
console.error('ERROR: packages.json parsing error [ ' + ex.message + ' ]');
}
// Adding the app's packages.json as a used file for this package will get
// Meteor to watch it and reload this package when it changes
Package.onUse(function(api) {
api.addFiles('index.js', 'server');
if (api.addAssets) {
api.addAssets('../../packages.json', 'server');
} else {
api.addFiles('../../packages.json', 'server', {
isAsset: true
});
}
});