Merge pull request #7340 from meteor/release-1.3.4.2

Release 1.3.4.2
This commit is contained in:
Ben Newman
2016-07-08 00:15:45 +00:00
committed by GitHub
53 changed files with 533 additions and 198 deletions

View File

@@ -1,6 +1,31 @@
## v.NEXT
* Adds App.appendToConfig allowing custom tags in config.xml [#7307](https://github.com/meteor/meteor/pull/7307)
## v1.3.4.2
* The `meteor node` and `meteor npm` commands now respect
`.meteor/release` when resolving which versions of `node` and `npm` to
invoke. Note that you must `meteor update` to 1.3.4.2 before this logic
will take effect, but it will work in all app directories after
updating, even those pinned to older versions.
[#7338](https://github.com/meteor/meteor/issue/7338)
* The Meteor installer now has the ability to resume downloads, so
installing Meteor on a spotty internet connection should be more
reliable. [#7348](https://github.com/meteor/meteor/pull/7348)
* When running `meteor test`, shared directories are symlinked (or
junction-linked on Windows) into the temporary test directory, not
copied, leading to much faster test start times after the initial build.
The directories: `.meteor/local/{bundler-cache,isopacks,plugin-cache}`
* `App.appendToConfig` allows adding custom tags to config.xml.
[#7307](https://github.com/meteor/meteor/pull/7307)
* Fixed bugs:
[#7149](https://github.com/meteor/meteor/issues/7149)
[#7296](https://github.com/meteor/meteor/issues/7296)
[#7309](https://github.com/meteor/meteor/issues/7309)
[#7312](https://github.com/meteor/meteor/issues/7312)
## v1.3.4.1

2
meteor
View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
BUNDLE_VERSION=0.6.15
BUNDLE_VERSION=0.6.16
# OS Check. Put here because here is where we download the precompiled
# bundles that are arch specific.

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Update the client when new client code is available",
version: '1.2.10'
version: '1.2.11'
});
Package.onUse(function (api) {

View File

@@ -21,13 +21,13 @@
"from": "ansi-styles@>=2.2.1 <3.0.0"
},
"ast-types": {
"version": "0.8.16",
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.8.16.tgz",
"version": "0.8.17",
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.8.17.tgz",
"from": "ast-types@>=0.8.16 <0.9.0"
},
"babel-code-frame": {
"version": "6.8.0",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.8.0.tgz",
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.11.0.tgz",
"from": "babel-code-frame@>=6.8.0 <7.0.0"
},
"babel-core": {
@@ -36,8 +36,8 @@
"from": "babel-core@>=6.9.1 <6.10.0"
},
"babel-generator": {
"version": "6.10.2",
"resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.10.2.tgz",
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.11.0.tgz",
"from": "babel-generator@>=6.9.0 <7.0.0"
},
"babel-helper-builder-react-jsx": {
@@ -216,8 +216,8 @@
"from": "babel-plugin-transform-es2015-typeof-symbol@>=6.8.0 <7.0.0"
},
"babel-plugin-transform-es2015-unicode-regex": {
"version": "6.8.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.8.0.tgz",
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.11.0.tgz",
"from": "babel-plugin-transform-es2015-unicode-regex@>=6.8.0 <7.0.0"
},
"babel-plugin-transform-es3-member-expression-literals": {
@@ -271,9 +271,9 @@
"from": "babel-plugin-transform-strict-mode@>=6.8.0 <7.0.0"
},
"babel-preset-meteor": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/babel-preset-meteor/-/babel-preset-meteor-6.11.0.tgz",
"from": "babel-preset-meteor@>=6.11.0 <6.12.0"
"version": "6.11.1",
"resolved": "https://registry.npmjs.org/babel-preset-meteor/-/babel-preset-meteor-6.11.1.tgz",
"from": "babel-preset-meteor@6.11.1"
},
"babel-preset-react": {
"version": "6.5.0",
@@ -308,7 +308,7 @@
"babylon": {
"version": "6.8.1",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-6.8.1.tgz",
"from": "babylon@>=6.8.1 <6.9.0"
"from": "babylon@6.8.1"
},
"balanced-match": {
"version": "0.4.1",
@@ -391,9 +391,9 @@
"from": "is-finite@>=1.0.0 <2.0.0"
},
"js-tokens": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.3.tgz",
"from": "js-tokens@>=1.0.2 <2.0.0"
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-2.0.0.tgz",
"from": "js-tokens@>=2.0.0 <3.0.0"
},
"jsesc": {
"version": "0.5.0",
@@ -413,17 +413,24 @@
"loose-envify": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.2.0.tgz",
"from": "loose-envify@>=1.0.0 <2.0.0"
"from": "loose-envify@>=1.0.0 <2.0.0",
"dependencies": {
"js-tokens": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.3.tgz",
"from": "js-tokens@>=1.0.1 <2.0.0"
}
}
},
"magic-string": {
"version": "0.15.1",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.15.1.tgz",
"version": "0.15.2",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.15.2.tgz",
"from": "magic-string@>=0.15.0 <0.16.0"
},
"meteor-babel": {
"version": "0.11.6",
"resolved": "https://registry.npmjs.org/meteor-babel/-/meteor-babel-0.11.6.tgz",
"from": "meteor-babel@0.11.6"
"version": "0.11.7",
"resolved": "https://registry.npmjs.org/meteor-babel/-/meteor-babel-0.11.7.tgz",
"from": "meteor-babel@0.11.7"
},
"meteor-babel-helpers": {
"version": "0.0.3",
@@ -493,9 +500,9 @@
"from": "regenerator-runtime@>=0.9.5 <0.10.0"
},
"regexpu-core": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz",
"from": "regexpu-core@>=1.0.0 <2.0.0"
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz",
"from": "regexpu-core@>=2.0.0 <3.0.0"
},
"regjsgen": {
"version": "0.2.0",
@@ -508,9 +515,9 @@
"from": "regjsparser@>=0.1.4 <0.2.0"
},
"reify": {
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/reify/-/reify-0.3.4.tgz",
"from": "reify@>=0.3.4 <0.4.0"
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/reify/-/reify-0.3.6.tgz",
"from": "reify@>=0.3.6 <0.4.0"
},
"repeating": {
"version": "1.1.3",

View File

@@ -6,11 +6,11 @@ Package.describe({
// isn't possible because you can't publish a non-recommended
// release with package versions that don't have a pre-release
// identifier at the end (eg, -dev)
version: '6.8.3'
version: '6.8.4'
});
Npm.depends({
'meteor-babel': '0.11.6',
'meteor-babel': '0.11.7',
});
Package.onUse(function (api) {

View File

@@ -1,6 +1,6 @@
Package.describe({
name: 'caching-compiler',
version: '1.0.5_1',
version: '1.0.6',
summary: 'An easy way to make compiler plugins cache',
documentation: 'README.md'
});

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Javascript dialect with fewer braces and semicolons",
version: "1.1.2_1"
version: "1.1.3"
});
Package.registerBuildPlugin({

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Meteor's latency-compensated distributed data client",
version: '1.2.8_1',
version: '1.2.9',
documentation: null
});

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Meteor's latency-compensated distributed data server",
version: '1.2.8_1',
version: '1.2.9',
documentation: null
});

View File

@@ -1,6 +1,6 @@
Package.describe({
name: "ecmascript-runtime",
version: "0.2.11_1",
version: "0.2.12",
summary: "Polyfills for new ECMAScript 2015 APIs like Map and Set",
git: "https://github.com/meteor/ecmascript-runtime",
documentation: "README.md"

View File

@@ -1,6 +1,6 @@
Package.describe({
name: 'ecmascript',
version: '0.4.6_1',
version: '0.4.7',
summary: 'Compiler plugin that supports ES2015+ in all .js files',
documentation: 'README.md'
});

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Send email messages",
version: "1.0.14_1"
version: "1.0.15"
});
Npm.depends({

View File

@@ -1,6 +1,6 @@
Package.describe({
name: "es5-shim",
version: "4.5.12_1",
version: "4.5.13",
summary: "Shims and polyfills to improve ECMAScript 5 support",
documentation: "README.md"
});

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Make HTTP calls to remote servers",
version: '1.1.7'
version: '1.1.8'
});
Npm.depends({

View File

@@ -1,6 +1,6 @@
Package.describe({
name: 'jshint',
version: '1.0.4_1',
version: '1.0.5',
summary: 'Lint all your JavaScript files with JSHint.',
documentation: 'README.md'
});

View File

@@ -1,6 +1,6 @@
Package.describe({
name: 'less',
version: '2.6.3_1',
version: '2.6.4',
summary: 'Leaner CSS language',
documentation: 'README.md'
});

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Logging facility.",
version: '1.0.13_1'
version: '1.0.14'
});
Npm.depends({

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "The Meteor command-line tool",
version: '1.3.4_1'
version: '1.3.4_2'
});
Package.includeTool();

View File

@@ -2,7 +2,7 @@
Package.describe({
summary: "Core Meteor environment",
version: '1.1.15_1'
version: '1.1.16'
});
Package.registerBuildPlugin({

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "CSS minifier",
version: "1.1.12_1"
version: "1.1.13"
});
Npm.depends({

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "JavaScript minifier",
version: "1.1.12_1"
version: "1.1.13"
});
Npm.depends({

View File

@@ -1,6 +1,6 @@
Package.describe({
name: "modules-runtime",
version: "0.6.4_1",
version: "0.6.5",
summary: "CommonJS module system",
git: "https://github.com/benjamn/install",
documentation: "README.md"

View File

@@ -6,19 +6,19 @@
"from": "acorn@>=3.2.0 <3.3.0"
},
"ast-types": {
"version": "0.8.16",
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.8.16.tgz",
"version": "0.8.17",
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.8.17.tgz",
"from": "ast-types@>=0.8.16 <0.9.0"
},
"magic-string": {
"version": "0.15.1",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.15.1.tgz",
"version": "0.15.2",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.15.2.tgz",
"from": "magic-string@>=0.15.0 <0.16.0"
},
"reify": {
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/reify/-/reify-0.3.4.tgz",
"from": "reify@0.3.4"
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/reify/-/reify-0.3.6.tgz",
"from": "reify@0.3.6"
},
"vlq": {
"version": "0.2.1",

View File

@@ -1,12 +1,12 @@
Package.describe({
name: "modules",
version: "0.6.4",
version: "0.6.5",
summary: "CommonJS module system",
documentation: "README.md"
});
Npm.depends({
reify: "0.3.4"
reify: "0.3.6"
});
Package.onUse(function(api) {

View File

@@ -3,7 +3,7 @@
Package.describe({
summary: "Wrapper around the mongo npm package",
version: '1.4.44_1',
version: '1.4.45',
documentation: null
});

View File

@@ -2,6 +2,7 @@
"dependencies": {
"meteor-promise": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/meteor-promise/-/meteor-promise-0.7.2.tgz",
"from": "meteor-promise@0.7.2"
},
"promise": {

View File

@@ -1,6 +1,6 @@
Package.describe({
name: "promise",
version: "0.7.2_1",
version: "0.7.3",
summary: "ECMAScript 2015 Promise polyfill with Fiber support",
git: "https://github.com/meteor/promise",
documentation: "README.md"

View File

@@ -1,6 +1,6 @@
Package.describe({
name: 'standard-minifier-css',
version: '1.0.7_1',
version: '1.0.8',
summary: 'Standard css minifier used with Meteor apps by default.',
documentation: 'README.md'
});

View File

@@ -1,6 +1,6 @@
Package.describe({
name: 'standard-minifier-js',
version: '1.0.7_1',
version: '1.0.8',
summary: 'Standard javascript minifiers used with Meteor apps by default.',
documentation: 'README.md'
});

View File

@@ -1,5 +1,5 @@
Package.describe({
version: '1.0.10_1',
version: '1.0.11',
// Brief, one-line summary of the package.
summary: 'Define static page content in .html files',
git: 'https://github.com/meteor/meteor',

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: 'Expressive, dynamic, robust CSS',
version: "2.512.3_1"
version: "2.512.4"
});
Package.registerBuildPlugin({

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Allows templates to be defined in .html files",
version: '1.1.12_1'
version: '1.1.13'
});
// Today, this package is closely intertwined with Handlebars, meaning

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Serves a Meteor app over HTTP",
version: '1.2.9_1'
version: '1.2.10'
});
Npm.depends({connect: "2.30.2",

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "An XML builder for node.js similar to java-xmlbuilder.",
version: '2.4.12_1'
version: '2.4.13'
});
Npm.depends({

View File

@@ -1,6 +1,6 @@
{
"track": "METEOR",
"version": "1.3.4.1-rc.0",
"version": "1.3.4.2-rc.1",
"recommended": false,
"official": false,
"description": "Meteor"

View File

@@ -1,6 +1,6 @@
{
"track": "METEOR",
"version": "1.3.4.1",
"version": "1.3.4.2",
"recommended": false,
"official": true,
"description": "The Official Meteor Distribution"

View File

@@ -14,7 +14,7 @@ var packageJson = {
npm: "3.9.6",
"node-gyp": "3.3.1",
"node-pre-gyp": "0.6.26",
"meteor-babel": "0.11.6",
"meteor-babel": "0.11.7",
"meteor-promise": "0.7.2",
fibers: "1.0.13",
promise: "7.1.1",

View File

@@ -1533,8 +1533,9 @@ var maybeUpdateRelease = function (options) {
main.captureAndExit("=> Errors while initializing project:", function () {
projectContext.prepareProjectForBuild();
});
// Write the new release to .meteor/release.
projectContext.releaseFile.write(solutionReleaseName);
projectContext.writeReleaseFileAndDevBundleLink(solutionReleaseName);
projectContext.packageMapDelta.displayOnConsole({
title: ("Changes to your project's package version selections from " +
"updating the release:")

View File

@@ -1611,23 +1611,30 @@ function doTestCommand(options) {
projectContextOptions.projectLocalDir = files.pathJoin(testRunnerAppDir, '.meteor', 'local');
// Copy the existing build and isopacks to speed up the initial start
const copyDirIntoTestRunnerApp = (...parts) => {
function copyDirIntoTestRunnerApp(allowSymlink, ...parts) {
// Depending on whether the user has run `meteor run` or other commands, they
// may or may not exist yet
const appDirPath = files.pathJoin(options.appDir, ...parts);
if (files.exists(appDirPath)) {
files.cp_r(
appDirPath,
files.pathJoin(testRunnerAppDir, ...parts),
{preserveSymlinks: true}
);
const testDirPath = files.pathJoin(testRunnerAppDir, ...parts);
files.mkdir_p(appDirPath);
files.mkdir_p(files.pathDirname(testDirPath));
if (allowSymlink) {
// Windows can create junction links without administrator
// privileges since both paths refer to directories.
files.symlink(appDirPath, testDirPath, "junction");
} else {
files.cp_r(appDirPath, testDirPath, {
preserveSymlinks: true
});
}
}
copyDirIntoTestRunnerApp('.meteor', 'local', 'build');
copyDirIntoTestRunnerApp('.meteor', 'local', 'bundler-cache');
copyDirIntoTestRunnerApp('.meteor', 'local', 'isopacks');
copyDirIntoTestRunnerApp('.meteor', 'local', 'plugin-cache');
copyDirIntoTestRunnerApp(false, '.meteor', 'local', 'build');
copyDirIntoTestRunnerApp(true, '.meteor', 'local', 'bundler-cache');
copyDirIntoTestRunnerApp(true, '.meteor', 'local', 'isopacks');
copyDirIntoTestRunnerApp(true, '.meteor', 'local', 'plugin-cache');
projectContext = new projectContextModule.ProjectContext(projectContextOptions);

View File

@@ -10,25 +10,38 @@ var win32Extensions = {
// command, as in `meteor npm` or `meteor node`, because we don't want to
// require("./main.js") for these commands.
var devBundleBinCommand = process.argv[2];
var args = process.argv.slice(3);
function getChildProcess() {
if (! win32Extensions.hasOwnProperty(devBundleBinCommand)) {
return Promise.resolve(null);
}
if (win32Extensions.hasOwnProperty(devBundleBinCommand)) {
var helpers = require("./dev-bundle-bin-helpers.js");
if (process.platform === "win32") {
devBundleBinCommand += win32Extensions[devBundleBinCommand];
}
var cmd = helpers.getCommandPath(devBundleBinCommand);
var args = process.argv.slice(3);
return Promise.all([
helpers.getCommandPath(devBundleBinCommand),
helpers.getEnv()
]).then(function (cmdAndEnv) {
var cmd = cmdAndEnv[0];
var env = cmdAndEnv[1];
var child = require("child_process").spawn(cmd, args, {
stdio: "inherit",
env: env
});
exports.process = require("child_process").spawn(cmd, args, {
stdio: "inherit",
env: helpers.getEnv()
});
require("./flush-buffers-on-exit-in-windows.js");
require("./flush-buffers-on-exit-in-windows.js");
child.on("exit", function (exitCode) {
process.exit(exitCode);
});
exports.process.on("exit", function (exitCode) {
process.exit(exitCode);
return child;
});
}
module.exports = getChildProcess();

View File

@@ -1,43 +1,54 @@
var fs = require("fs");
var path = require("path");
var devBundleDir = path.resolve(__dirname, "..", "..", "dev_bundle");
var binDir = path.join(devBundleDir, "bin");
var devBundlePromise = require("./dev-bundle.js");
var Promise = devBundlePromise.constructor;
var binDirPromise = devBundlePromise.then(function (devBundleDir) {
return path.join(devBundleDir, "bin");
});
exports.getCommandPath = function (command) {
return path.join(binDir, command);
return binDirPromise.then(function (binDir) {
return path.join(binDir, command);
});
};
exports.getEnv = function () {
var env = Object.create(process.env);
var paths = [
exports.getEnv = function() {
return Promise.all([
// When npm looks for node, it must find dev_bundle/bin/node.
binDir,
binDirPromise,
devBundlePromise
]).then(function (paths) {
var devBundleDir = paths[1];
// Also make available any scripts installed by packages in
// dev_bundle/lib/node_modules, such as node-gyp.
path.join(devBundleDir, "lib", "node_modules", ".bin"),
];
paths[1] = path.join(devBundleDir, "lib", "node_modules", ".bin");
var PATH = env.PATH || env.Path;
if (PATH) {
paths.push(PATH);
}
var env = Object.create(process.env);
env.PATH = paths.join(path.delimiter);
var PATH = env.PATH || env.Path;
if (PATH) {
paths.push(PATH);
}
if (process.platform === "win32") {
// On Windows we provide a reliable version of python.exe for use by
// node-gyp (the tool that rebuilds binary node modules). #WinPy
env.PYTHON = env.PYTHON || path.join(
devBundleDir, "python", "python.exe");
env.PATH = paths.join(path.delimiter);
// We don't try to install a compiler toolchain on the developer's
// behalf, but setting GYP_MSVS_VERSION helps select the right one.
env.GYP_MSVS_VERSION = env.GYP_MSVS_VERSION || "2015";
if (process.platform === "win32") {
// On Windows we provide a reliable version of python.exe for use by
// node-gyp (the tool that rebuilds binary node modules). #WinPy
env.PYTHON = env.PYTHON || path.join(
devBundleDir, "python", "python.exe");
// While the original process.env object allows for case insensitive
// access on Windows, Object.create interferes with that behavior, so
// here we ensure env.PATH === env.Path on Windows.
env.Path = env.PATH;
}
// We don't try to install a compiler toolchain on the developer's
// behalf, but setting GYP_MSVS_VERSION helps select the right one.
env.GYP_MSVS_VERSION = env.GYP_MSVS_VERSION || "2015";
return env;
// While the original process.env object allows for case insensitive
// access on Windows, Object.create interferes with that behavior,
// so here we ensure env.PATH === env.Path on Windows.
env.Path = env.PATH;
}
return env;
});
};

194
tools/cli/dev-bundle.js Normal file
View File

@@ -0,0 +1,194 @@
// Note that this file is required before we install our Babel hooks in
// ../tool-env/install-babel.js, so we can't use ES2015+ syntax here.
// This file replicates some functionality from elsewhere in tools code,
// but that's unavoidable if we don't want to install Babel and load all
// the rest of the code every time we run `meteor npm` or `meteor node`.
var fs = require("fs");
var path = require("path");
var rootDir = path.resolve(__dirname, "..", "..");
var defaultDevBundlePromise =
Promise.resolve(path.join(rootDir, "dev_bundle"));
function getDevBundleDir() {
// Note that this code does not care if we are running meteor from a
// checkout, because it's always better to respect the .meteor/release
// file of the current app, if possible.
var releaseFile = find(
process.cwd(),
makeStatTest("isFile"),
".meteor", "release"
);
if (! releaseFile) {
return defaultDevBundlePromise;
}
var devBundleLink = path.join(
path.dirname(releaseFile),
"dev_bundle"
);
var devBundleStat = statOrNull(devBundleLink, "isDirectory");
if (devBundleStat) {
return new Promise(function (resolve) {
resolve(fs.realpathSync(devBundleLink));
});
}
var release = fs.readFileSync(
releaseFile, "utf8"
).replace(/^\s+|\s+$/g, "");
if (! /^METEOR@\d+/.test(release)) {
return defaultDevBundlePromise;
}
return getDevBundleForRelease(release).then(function (devBundleDir) {
if (devBundleDir) {
fs.symlink(devBundleDir, devBundleLink, "junction");
return devBundleDir;
}
return defaultDevBundlePromise;
});
}
function getDevBundleForRelease(release) {
var parts = release.split("@");
if (parts.length < 2) {
return null;
}
var track = parts[0];
var version = parts.slice(1).join("@");
var packageMetadataDir = find(
rootDir,
makeStatTest("isDirectory"),
".meteor", "package-metadata"
);
if (! packageMetadataDir) {
return null;
}
var meteorToolDir = path.resolve(
packageMetadataDir,
"..", "packages", "meteor-tool"
);
var meteorToolStat = statOrNull(meteorToolDir, "isDirectory");
if (! meteorToolStat) {
return null;
}
var dbPath = path.join(
packageMetadataDir,
"v2.0.1",
"packages.data.db"
);
var dbStat = statOrNull(dbPath, "isFile");
if (! dbStat) {
return null;
}
var sqlite3 = require("sqlite3");
var db = new sqlite3.Database(dbPath);
return new Promise(function (resolve, reject) {
db.get(
"SELECT content FROM releaseVersions WHERE track=? AND version=?",
[track, version],
function (error, data) {
if (error) {
reject(error);
} else {
var tool = JSON.parse(data.content).tool;
var devBundleDir = path.join(
meteorToolDir,
tool.split("@").slice(1).join("@"),
"mt-" + getHostArch(),
"dev_bundle"
);
var devBundleStat = statOrNull(devBundleDir, "isDirectory");
if (devBundleStat) {
resolve(devBundleDir);
} else {
resolve(null);
}
}
}
);
});
}
function statOrNull(path, statMethod) {
try {
var stat = fs.statSync(path);
} catch (e) {
if (e.code !== "ENOENT") {
throw e;
}
}
if (stat) {
if (typeof statMethod === "string") {
if (stat[statMethod]()) {
return stat;
}
} else {
return stat;
}
}
return null;
}
function find(dir, predicate) {
var joinArgs = Array.prototype.slice.call(arguments, 2);
joinArgs.unshift(null);
while (true) {
joinArgs[0] = dir;
var joined = path.join.apply(path, joinArgs);
if (predicate(joined)) {
return joined;
}
var parentDir = path.dirname(dir);
if (parentDir === dir) break;
dir = parentDir;
}
return null;
}
function makeStatTest(method) {
return function (file) {
return statOrNull(file, method);
};
}
function getHostArch() {
if (process.platform === "win32") {
return "os.windows.x86_32";
}
if (process.platform === "linux") {
if (process.arch === "x64") {
return "os.linux.x86_64";
}
return "os.linux.x86_32";
}
if (process.platform === "darwin") {
return "os.osx.x86_64";
}
}
module.exports = getDevBundleDir();

View File

@@ -1,4 +1,20 @@
if (! require('./cli/dev-bundle-bin-commands.js').process) {
require("./tool-env/install-promise.js");
require("./cli/dev-bundle-bin-commands.js").then(function (child) {
if (! child) {
// Use process.nextTick here to prevent the Promise from swallowing
// errors from the rest of the setup code.
process.nextTick(continueSetup);
}
// If we spawned a process to handle a dev_bundle/bin command like
// `meteor npm` or `meteor node`, then don't run any other tool code.
}, function (error) {
process.nextTick(function () {
throw error;
});
});
function continueSetup() {
// Set up the Babel transpiler
require('./tool-env/install-babel.js');

View File

@@ -157,6 +157,7 @@ var compiler = require('./compiler.js');
var PackageSource = require('./package-source.js');
import Builder from './builder.js';
var compilerPluginModule = require('./compiler-plugin.js');
import { JsFile, CssFile } from './minifier-plugin.js';
var meteorNpm = require('./meteor-npm.js');
var files = require('../fs/files.js');
@@ -1057,11 +1058,8 @@ class Target {
// Minify the JS in this target
minifyJs(minifierDef, minifyMode) {
// Avoid circular deps from top-level import.
const minifierPluginModule = require('./minifier-plugin.js');
const sources = _.map(this.js, function (file) {
return new minifierPluginModule.JsFile(file, {
return new JsFile(file, {
arch: this.arch
});
});
@@ -1235,11 +1233,8 @@ class ClientTarget extends Target {
// Minify the CSS in this target
minifyCss(minifierDef, minifyMode) {
// Avoid circular deps from top-level import.
const minifierPluginModule = require('./minifier-plugin.js');
const sources = this.css.map((file) => {
return new minifierPluginModule.CssFile(file, {
return new CssFile(file, {
arch: this.arch
});
});
@@ -1890,8 +1885,7 @@ class JsImage {
};
if (nmd.local) {
var prodPackageNames =
meteorNpm.getProdPackageNames(nmd.sourcePath);
let prodPackageNames;
// When copying a local node_modules directory, ignore any npm
// package directories not in the list of production package
@@ -1906,8 +1900,15 @@ class JsImage {
copyOptions.directoryFilter = function (dir) {
var base = files.pathBasename(dir);
var parentBase = files.pathBasename(files.pathDirname(dir));
return parentBase !== "node_modules" ||
_.has(prodPackageNames, base);
if (parentBase !== "node_modules") {
return true;
}
// Compute prodPackageNames lazily.
prodPackageNames = prodPackageNames ||
meteorNpm.getProdPackageNames(nmd.sourcePath);
return _.has(prodPackageNames, base);
};
}

View File

@@ -59,7 +59,7 @@ import { isTestFilePath } from './test-files.js';
// Cache the (slightly post-processed) results of linker.fullLink.
const CACHE_SIZE = process.env.METEOR_LINKER_CACHE_SIZE || 1024*1024*100;
const CACHE_DEBUG = !! process.env.METEOR_TEST_PRINT_LINKER_CACHE_DEBUG;
const LINKER_CACHE_SALT = 7; // Increment this number to force relinking.
const LINKER_CACHE_SALT = 8; // Increment this number to force relinking.
const LINKER_CACHE = new LRU({
max: CACHE_SIZE,
// Cache is measured in bytes. We don't care about servePath.

View File

@@ -14,6 +14,7 @@ var buildmessage = require('../utils/buildmessage.js');
var utils = require('../utils/utils.js');
var runLog = require('../runners/run-log.js');
var Profile = require('../tool-env/profile.js').Profile;
import { execFileAsync } from "../utils/processes.js";
var meteorNpm = exports;
@@ -161,7 +162,7 @@ Profile("meteorNpm.rebuildIfNonPortable", function (nodeModulesDir) {
files.readdir(nodeModulesDir).forEach(function (pkg) {
const pkgPath = files.pathJoin(nodeModulesDir, pkg);
if (isPortable(pkgPath, true)) {
if (isPortable(pkgPath)) {
return;
}
@@ -239,33 +240,24 @@ Profile("meteorNpm.rebuildIfNonPortable", function (nodeModulesDir) {
return true;
});
function isPortable(dir, shouldCache) {
if (! files.lstat(dir).isDirectory()) {
return true;
function isPortable(dir) {
const lstat = files.lstat(dir);
if (! lstat.isDirectory()) {
// Non-directory files are portable unless they end with .node.
return ! dir.endsWith(".node");
}
return files.readdir(dir).every(itemName => {
const item = files.pathJoin(dir, itemName);
const pkgJsonStat = files.statOrNull(files.pathJoin(dir, "package.json"));
const canCache = pkgJsonStat && pkgJsonStat.isFile();
const portableFile = files.pathJoin(dir, ".meteor-portable");
if (! files.lstat(item).isDirectory()) {
// Non-directory files are portable unless they end with .node.
return ! itemName.endsWith(".node");
}
if (! shouldCache) {
// Once we stop caching, we keep calling isPortable recursively
// without caching.
return isPortable(item);
}
// Cache previous results by writing a boolean value to a hidden
// file called .meteor-portable. Although it's tempting to write
// this file once for the whole node_modules directory, it's
// important that we put separate files in the individual top-level
// package directories so that they will get cleared away the next
// time those packages are (re)installed.
const portableFile = files.pathJoin(item, ".meteor-portable");
if (canCache) {
// Cache previous results by writing a boolean value to a hidden file
// called .meteor-portable. Although it's tempting to write this file
// once for the whole node_modules directory, it's important that we
// put .meteor-portable files only in the individual top-level package
// directories, so that they will get cleared away the next time those
// packages are (re)installed.
try {
return JSON.parse(files.readFile(portableFile));
} catch (e) {
@@ -274,20 +266,29 @@ function isPortable(dir, shouldCache) {
throw e;
}
}
} else {
// Clean up any .meteor-portable files we mistakenly wrote in
// directories that do not contain package.json files. #7296
fs.unlink(portableFile, error => {});
}
const result = isPortable(item);
const result = files.readdir(dir).every(
// Ignore files that start with a ".", such as .bin directories.
itemName => itemName.startsWith(".") ||
isPortable(files.pathJoin(dir, itemName)));
if (canCache) {
// Write the .meteor-portable file asynchronously, and don't worry
// if it fails, e.g. because the file system is read-only (#6591).
// Failing to write the file only means more work next time.
fs.writeFile(
portableFile,
JSON.stringify(result) + "\n",
(error) => {}
error => {},
);
}
return result;
});
return result;
}
// Return true if all of a package's npm dependencies are portable
@@ -310,7 +311,7 @@ meteorNpm.dependenciesArePortable = function (nodeModulesDir) {
// Only check/write .meteor-portable files in each of the top-level
// package directories.
return isPortable(nodeModulesDir, true);
return isPortable(nodeModulesDir);
};
var makeNewPackageNpmDir = function (newPackageNpmDir) {
@@ -546,28 +547,34 @@ Profile("meteorNpm.runNpmCommand", function (args, cwd) {
cwd = files.convertToOSPath(cwd);
}
const env = require("../cli/dev-bundle-bin-helpers.js").getEnv();
var getEnv = require("../cli/dev-bundle-bin-helpers.js").getEnv;
// Make sure we don't honor any user-provided configuration files.
env.npm_config_userconfig = npmUserConfigFile;
return getEnv().then(env => {
// Make sure we don't honor any user-provided configuration files.
env.npm_config_userconfig = npmUserConfigFile;
var opts = { cwd: cwd, env: env, maxBuffer: 10 * 1024 * 1024 };
var opts = {
cwd: cwd,
env: env,
maxBuffer: 10 * 1024 * 1024
};
return new Promise(function (resolve) {
require('child_process').execFile(
npmPath, args, opts, function (err, stdout, stderr) {
if (meteorNpm._printNpmCalls) {
process.stdout.write(err ? 'failed\n' : 'done\n');
return new Promise(function (resolve) {
require('child_process').execFile(
npmPath, args, opts, function (err, stdout, stderr) {
if (meteorNpm._printNpmCalls) {
process.stdout.write(err ? 'failed\n' : 'done\n');
}
resolve({
success: ! err,
error: (err ? `${err.message}${stderr}` : stderr),
stdout: stdout,
stderr: stderr
});
}
resolve({
success: ! err,
error: (err ? `${err.message}${stderr}` : stderr),
stdout: stdout,
stderr: stderr
});
}
);
);
});
}).await();
});
@@ -721,7 +728,7 @@ var installNpmModule = function (name, version, dir) {
}
const pkgDir = files.pathJoin(dir, "node_modules", name);
if (! isPortable(pkgDir, true)) {
if (! isPortable(pkgDir)) {
recordLastRebuildVersions(pkgDir);
}

View File

@@ -365,6 +365,38 @@ _.extend(ProjectContext.prototype, {
self._completedStage = STAGE.READ_PROJECT_METADATA;
}),
// Write the new release to .meteor/release and create a
// .meteor/dev_bundle symlink to the corresponding dev_bundle.
writeReleaseFileAndDevBundleLink(releaseName) {
assert.strictEqual(files.inCheckout(), false);
this.releaseFile.write(releaseName);
// Make a symlink from .meteor/dev_bundle to the actual dev_bundle.
const devBundleLink = files.pathJoin(
files.pathDirname(this.releaseFile.filename),
"dev_bundle"
);
if (files.exists(devBundleLink)) {
files.rm_recursive(devBundleLink);
}
if (this.releaseFile.isCheckout()) {
// Only create the .meteor/dev_bundle symlink if it points to the
// dev_bundle of an actual release, but remove it first regardless.
return;
}
files.symlink(
files.getDevBundle(),
devBundleLink,
// Since the target is a directory, Windows can create a junction
// without needing administrator privileges.
"junction"
);
},
_ensureProjectDir: function () {
var self = this;
files.mkdir_p(files.pathJoin(self.projectDir, '.meteor'));

View File

@@ -174,9 +174,11 @@ _.extend(Proxy.prototype, {
try {
return fn();
} catch (e) {
resOrSocket.writeHead(400, {
'Content-Type': 'text/plain'
});
if (typeof resOrSocket.writeHead === "function") {
resOrSocket.writeHead(400, {
'Content-Type': 'text/plain'
});
}
resOrSocket.end("Bad request\n");
}
}

View File

@@ -134,7 +134,7 @@ Cp.setUpSocket = function setUpSocket(sock, key) {
sock.write(JSON.stringify({
terminal: ! process.env.EMACS,
key: key
}));
}) + "\n");
process.stderr.write(shellBanner());
process.stdin.pipe(sock);

View File

@@ -81,10 +81,16 @@ var wrapPathFunction = function (name, partialPaths) {
// forget about conversion of absolute paths for Windows
return toDosPath(p, partialPaths);
});
return toPosixPath(f.apply(path, args), partialPaths);
} else {
return f.apply(path, arguments);
var result = f.apply(path, args);
if (typeof result === "string") {
result = toPosixPath(result, partialPaths);
}
return result;
}
return f.apply(path, arguments);
};
};

View File

@@ -161,6 +161,12 @@ Sp.onConnection = function onConnection(socket) {
readJSONFromStream(socket, function (error, options, replInputSocket) {
clearTimeout(timeout);
if (error) {
socket = null;
console.error(error.stack);
return;
}
if (options.key !== self.key) {
if (socket) {
socket.end(EXITING_MESSAGE + "\n");

View File

@@ -0,0 +1,10 @@
// Install a global ES2015-compliant Promise constructor that knows how to
// run all its callbacks in Fibers.
var Promise = global.Promise = global.Promise ||
require("promise/lib/es6-extensions");
require("meteor-promise").makeCompatible(
Promise,
require("fibers")
);

View File

@@ -1,12 +1,8 @@
// Install ES2015-complaint polyfills for Object, Array, String, Function,
// Symbol, Map, and Set, patching the native implementations if available.
// Symbol, Map, Set, and Promise, patching the native implementations when
// they are available.
require("meteor-ecmascript-runtime");
// Install a global ES2015-compliant Promise constructor that knows how to
// run all its callbacks in Fibers.
var Promise = global.Promise = global.Promise ||
require("promise/lib/es6-extensions");
require("meteor-promise").makeCompatible(Promise, require("fibers"));
require("./install-promise.js");
// Verify that the babel-runtime package is available to be required.
// The .join("/") prevents babel-plugin-transform-runtime from