Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-fastboot-server

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-fastboot-server - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

46

lib/ember-app.js
var fs = require('fs');
var path = require('path');
var createSandbox = require('./sandbox').createSandbox;
var runInSandbox = require('./sandbox').runInSandbox;
var Contextify = require('contextify');
var SimpleDOM = require('simple-dom');

@@ -36,6 +35,9 @@ var RSVP = require('rsvp');

runInSandbox(vendorFilePath, sandbox);
var appFile = fs.readFileSync(appFilePath, 'utf8');
var vendorFile = fs.readFileSync(vendorFilePath, 'utf8');
sandbox.run(vendorFile, vendorFilePath);
debug("vendor file evaluated");
runInSandbox(appFilePath, sandbox);
sandbox.run(appFile, appFilePath);
debug("app file evaluated");

@@ -74,2 +76,38 @@

function createSandbox(dependencies) {
var wrappedConsole = Object.create(console);
wrappedConsole.error = function() {
console.error.apply(console, Array.prototype.map.call(arguments, function(a) {
return typeof a === 'string' ? chalk.red(a) : a;
}));
};
var sandbox = {
// Expose the console to the FastBoot environment so we can debug
console: wrappedConsole,
// setTimeout and clearTimeout are an assumed part of JavaScript environments. Expose it.
setTimeout: setTimeout,
clearTimeout: clearTimeout,
// Convince jQuery not to assume it's in a browser
module: { exports: {} },
URL: require("url")
};
for (var dep in dependencies) {
sandbox[dep] = dependencies[dep];
}
// Set the global as `window`.
sandbox.window = sandbox;
sandbox.window.self = sandbox;
// The sandbox is now a JavaScript context O_o
Contextify(sandbox);
return sandbox;
}
function buildWhitelistedRequire(whitelist, distPath) {

@@ -76,0 +114,0 @@ return function(moduleName) {

4

lib/server.js

@@ -104,3 +104,3 @@ var chalk = require('chalk');

return {
appFile: path.join(distPath, manifest.appFile),
appFile: path.join(distPath, manifest.appFile),
vendorFile: path.join(distPath, manifest.vendorFile),

@@ -111,3 +111,3 @@ htmlFile: path.join(distPath, manifest.htmlFile),

} catch (e) {
console.error("Couldn't find %s. You may need to update your version of ember-cli-fastboot.", pkgPath);
console.log("Couldn't find %s. You may need to update your version of ember-cli-fastboot.", pkgPath);
}

@@ -114,0 +114,0 @@ }

{
"name": "ember-fastboot-server",
"version": "0.4.1",
"version": "0.4.2",
"description": "Production server for running Ember applications using FastBoot",
"main": "./lib/server",
"scripts": {
"postinstall": "scripts/is-legacy-vm && npm install contextify@^0.1.11",
"test": "echo \"Error: no test specified\" && exit 1"

@@ -29,2 +28,3 @@ },

"chalk": "^0.5.1",
"contextify": "^0.1.11",
"debug": "^2.1.0",

@@ -31,0 +31,0 @@ "express": "^4.13.3",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc