mirror of
https://github.com/skishore/makemeahanzi.git
synced 2025-11-01 12:07:15 +08:00
Get codePointAt/fromCodePoint working on the server
This commit is contained in:
@ -19,3 +19,5 @@ ejson
|
|||||||
spacebars
|
spacebars
|
||||||
check
|
check
|
||||||
ecmascript
|
ecmascript
|
||||||
|
meteorhacks:npm
|
||||||
|
npm-container
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
3
packages.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"es6-shim": "0.33.3"
|
||||||
|
}
|
||||||
1
packages/npm-container/.npm/package/.gitignore
vendored
Normal file
1
packages/npm-container/.npm/package/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
node_modules
|
||||||
7
packages/npm-container/.npm/package/README
Normal file
7
packages/npm-container/.npm/package/README
Normal 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.
|
||||||
7
packages/npm-container/.npm/package/npm-shrinkwrap.json
generated
Normal file
7
packages/npm-container/.npm/package/npm-shrinkwrap.json
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"es6-shim": {
|
||||||
|
"version": "0.33.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
packages/npm-container/index.js
Normal file
9
packages/npm-container/index.js
Normal 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);
|
||||||
|
};
|
||||||
30
packages/npm-container/package.js
Normal file
30
packages/npm-container/package.js
Normal 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
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user