Merge branch 'devel' into release-1.6.1

This commit is contained in:
Ben Newman
2017-11-08 14:43:36 -05:00
29 changed files with 208 additions and 184 deletions

View File

@@ -6,6 +6,17 @@
several new features, including two-factor authentication, as described
in the [release notes](https://github.com/npm/npm/blob/latest/CHANGELOG.md#v551-2017-10-04).
* [`cordova-lib`](https://github.com/apache/cordova-cli) has been updated to
version 7.1.0, [`cordova-android`](https://github.com/apache/cordova-android/)
has been updated to version 6.3.0, and
[`cordova-ios`](https://github.com/apache/cordova-ios/)
has been updated to version 4.5.3. The cordova-plugins `cordova-plugin-console`,
`cordova-plugin-device-motion`, and `cordova-plugin-device-orientation` have been
[deprecated](https://cordova.apache.org/news/2017/09/22/plugins-release.html)
and will likely be removed in a future Meteor release.
[Feature Request #196](https://github.com/meteor/meteor-feature-requests/issues/196)
[PR #9213](https://github.com/meteor/meteor/pull/9213)
* iOS icons and launch screens have been updated to support iOS 11
[Issue #9196](https://github.com/meteor/meteor/issues/9196)
[PR #9198](https://github.com/meteor/meteor/pull/9198)
@@ -25,6 +36,26 @@
## v1.6, 2017-10-30
* **Important note for package maintainers:**
With the jump to Node 8, some packages published using Meteor 1.6 may no
longer be compatible with older Meteor versions. In order to maintain
compatibility with Meteor 1.5 apps when publishing your package, you can
specify a release version with the meteor publish command:
```
meteor --release 1.5.3 publish
```
If you're interested in taking advantage of Meteor 1.6 while still
supporting older Meteor versions, you can consider publishing for Meteor
1.6 from a new branch, with your package's minor or major version bumped.
You can then continue to publish for Meteor 1.5 from the original branch.
Note that the 1.6 branch version bump is important so that you can continue
publishing patch updates for Meteor 1.5 from the original branch.
[Issue #9308](https://github.com/meteor/meteor/issues/9308)
* Node.js has been upgraded to version 8.8.1, which will be entering
long-term support (LTS) coverage on 31 October 2017, lasting through
December 2019 ([full schedule](https://github.com/nodejs/Release#nodejs-release-working-group)).

View File

@@ -2,7 +2,7 @@ Package.describe({
// These tests are in a separate package so that we can Npm.depend on
// parse5, a html parsing library.
summary: "Tests for the boilerplate-generator package",
version: '1.1.0',
version: '1.1.1',
documentation: null
});
@@ -12,7 +12,11 @@ Npm.depends({
Package.onTest(function (api) {
api.use('ecmascript');
api.use(['tinytest', 'boilerplate-generator'], 'server');
api.use([
'underscore',
'tinytest',
'boilerplate-generator'
], 'server');
api.addFiles('web.browser-tests.js', 'server');
api.addFiles('web.cordova-tests.js', 'server');
});

View File

@@ -25,7 +25,7 @@ export function generateHTMLForArch(arch) {
// webapp_server usually constructs a Boilerplate object similarly
const inline = true;
const inlineScriptsAllowed = true;
const additionalStaticJs = [];
const additionalStaticJs = [{ contents: 'var a' }];
const meteorRuntimeConfig = 'config123';
const rootUrlPathPrefix = 'rootUrlPathPrefix';
const htmlAttributes = {

View File

@@ -1,4 +1,5 @@
import { parse, serialize } from 'parse5';
import { generateHTMLForArch } from './test-lib';
const html = generateHTMLForArch('web.browser');
@@ -39,3 +40,24 @@ Tinytest.add("boilerplate-generator-tests - web.browser - call rewriteHook", fun
Tinytest.add("boilerplate-generator-tests - web.browser - include runtime config", function (test) {
test.matches(html, /<script[^<>]*>[^<>]*__meteor_runtime_config__ =.*decodeURIComponent\(config123\)/);
});
// https://github.com/meteor/meteor/issues/9149
Tinytest.add(
"boilerplate-generator-tests - web.browser - properly render boilerplate " +
"elements when _.template settings are overridden",
function (test) {
import { _ } from 'meteor/underscore';
_.templateSettings = {
interpolate: /\{\{(.+?)\}\}/g
};
const newHtml = generateHTMLForArch('web.browser');
test.matches(newHtml, /foo="foobar"/);
test.matches(newHtml, /<link[^<>]*href="[^<>]*bootstrap[^<>]*">/);
test.matches(newHtml, /<script[^<>]*src="[^<>]*templating[^<>]*">/);
test.matches(newHtml, /<script>var a/);
test.matches(
newHtml,
/<script[^<>]*>[^<>]*__meteor_runtime_config__ =.*decodeURIComponent\(config123\)/
);
}
);

View File

@@ -1,4 +1,5 @@
import { parse, serialize } from 'parse5';
import { generateHTMLForArch } from './test-lib';
const html = generateHTMLForArch('web.cordova');
@@ -31,3 +32,23 @@ Tinytest.add("boilerplate-generator-tests - web.cordova - do not call rewriteHoo
Tinytest.add("boilerplate-generator-tests - web.cordova - include runtime config", function (test) {
test.matches(html, /<script[^<>]*>[^<>]*\n[^<>]*__meteor_runtime_config__ =[^<>]*decodeURIComponent\(config123\)\)/);
});
// https://github.com/meteor/meteor/issues/9149
Tinytest.add(
"boilerplate-generator-tests - web.cordova - properly render boilerplate " +
"elements when _.template settings are overridden",
function (test) {
import { _ } from 'meteor/underscore';
_.templateSettings = {
interpolate: /\{\{(.+?)\}\}/g
};
const newHtml = generateHTMLForArch('web.cordova');
test.matches(newHtml, /<link[^<>]*href="[^<>]*bootstrap[^<>]*">/);
test.matches(newHtml, /<script[^<>]*src="[^<>]*templating[^<>]*">/);
test.matches(newHtml, /<script>var a/);
test.matches(
newHtml,
/<script[^<>]*>[^<>]*__meteor_runtime_config__ =.*decodeURIComponent\(config123\)/
);
}
);

View File

@@ -6,6 +6,8 @@ import WebCordovaTemplate from './template-web.cordova';
// Copied from webapp_server
const readUtf8FileSync = filename => Meteor.wrapAsync(readFile)(filename, 'utf8');
const identity = value => value;
export class Boilerplate {
constructor(arch, manifest, options = {}) {
this.template = _getTemplate(arch);
@@ -38,8 +40,8 @@ export class Boilerplate {
// Optionally takes pathMapper for resolving relative file system paths.
// Optionally allows to override fields of the data context.
_generateBoilerplateFromManifest(manifest, {
urlMapper = _.identity,
pathMapper = _.identity,
urlMapper = identity,
pathMapper = identity,
baseDataExtension,
inline,
} = {}) {
@@ -53,7 +55,7 @@ export class Boilerplate {
...baseDataExtension,
};
_.each(manifest, item => {
manifest.forEach(item => {
const urlPath = urlMapper(item.url);
const itemObj = { url: urlPath };

View File

@@ -1,13 +1,11 @@
Package.describe({
summary: "Generates the boilerplate html from program's manifest",
version: '1.3.0'
version: '1.3.1'
});
Package.onUse(api => {
api.use('ecmascript');
api.use([
'underscore',
], 'server');
api.use('underscore', 'server');
api.mainModule('generator.js', 'server');
api.export('Boilerplate', 'server');
});

View File

@@ -1,5 +1,6 @@
// Template function for rendering the boilerplate html for browsers
import template from './template';
// Template function for rendering the boilerplate html for browsers
export default function({
meteorRuntimeConfig,
rootUrlPathPrefix,
@@ -16,17 +17,17 @@ export default function({
}) {
return [].concat(
[
'<html' +_.map(htmlAttributes, (value, key) =>
_.template(' <%= attrName %>="<%- attrValue %>"')({
'<html' + Object.keys(htmlAttributes || {}).map(key =>
template(' <%= attrName %>="<%- attrValue %>"')({
attrName: key,
attrValue: value
attrValue: htmlAttributes[key]
})
).join('') + '>',
'<head>'
],
_.map(css, ({url}) =>
_.template(' <link rel="stylesheet" type="text/css" class="__meteor-css__" href="<%- href %>">')({
(css || []).map(({ url }) =>
template(' <link rel="stylesheet" type="text/css" class="__meteor-css__" href="<%- href %>">')({
href: bundledJsCssUrlRewriteHook(url)
})
),
@@ -40,28 +41,28 @@ export default function({
dynamicBody,
'',
(inlineScriptsAllowed
? _.template(' <script type="text/javascript">__meteor_runtime_config__ = JSON.parse(decodeURIComponent(<%= conf %>))</script>')({
? template(' <script type="text/javascript">__meteor_runtime_config__ = JSON.parse(decodeURIComponent(<%= conf %>))</script>')({
conf: meteorRuntimeConfig
})
: _.template(' <script type="text/javascript" src="<%- src %>/meteor_runtime_config.js"></script>')({
: template(' <script type="text/javascript" src="<%- src %>/meteor_runtime_config.js"></script>')({
src: rootUrlPathPrefix
})
) ,
''
],
_.map(js, ({url}) =>
_.template(' <script type="text/javascript" src="<%- src %>"></script>')({
(js || []).map(({ url }) =>
template(' <script type="text/javascript" src="<%- src %>"></script>')({
src: bundledJsCssUrlRewriteHook(url)
})
),
_.map(additionalStaticJs, ({contents, pathname}) => (
(additionalStaticJs || []).map(({ contents, pathname }) => (
(inlineScriptsAllowed
? _.template(' <script><%= contents %></script>')({
? template(' <script><%= contents %></script>')({
contents: contents
})
: _.template(' <script type="text/javascript" src="<%- src %>"></script>')({
: template(' <script type="text/javascript" src="<%- src %>"></script>')({
src: rootUrlPathPrefix + pathname
}))
)),
@@ -73,4 +74,3 @@ export default function({
],
).join('\n');
}

View File

@@ -1,5 +1,6 @@
// Template function for rendering the boilerplate html for cordova
import template from './template';
// Template function for rendering the boilerplate html for cordova
export default function({
meteorRuntimeConfig,
rootUrlPathPrefix,
@@ -25,14 +26,14 @@ export default function({
' <meta http-equiv="Content-Security-Policy" content="default-src * gap: data: blob: \'unsafe-inline\' \'unsafe-eval\' ws: wss:;">',
],
// We are explicitly not using bundledJsCssUrlRewriteHook: in cordova we serve assets up directly from disk, so rewriting the URL does not make sense
_.map(css, ({url}) =>
_.template(' <link rel="stylesheet" type="text/css" class="__meteor-css__" href="<%- href %>">')({
(css || []).map(({ url }) =>
template(' <link rel="stylesheet" type="text/css" class="__meteor-css__" href="<%- href %>">')({
href: url
})
),
[
' <script type="text/javascript">',
_.template(' __meteor_runtime_config__ = JSON.parse(decodeURIComponent(<%= conf %>));')({
template(' __meteor_runtime_config__ = JSON.parse(decodeURIComponent(<%= conf %>));')({
conf: meteorRuntimeConfig
}),
' if (/Android/i.test(navigator.userAgent)) {',
@@ -48,18 +49,18 @@ export default function({
'',
' <script type="text/javascript" src="/cordova.js"></script>'
],
_.map(js, ({url}) =>
_.template(' <script type="text/javascript" src="<%- src %>"></script>')({
(js || []).map(({ url }) =>
template(' <script type="text/javascript" src="<%- src %>"></script>')({
src: url
})
),
_.map(additionalStaticJs, ({contents, pathname}) => (
(additionalStaticJs || []).map(({ contents, pathname }) => (
(inlineScriptsAllowed
? _.template(' <script><%= contents %></script>')({
? template(' <script><%= contents %></script>')({
contents: contents
})
: _.template(' <script type="text/javascript" src="<%- src %>"></script>')({
: template(' <script type="text/javascript" src="<%- src %>"></script>')({
src: rootUrlPathPrefix + pathname
}))
)),
@@ -76,4 +77,3 @@ export default function({
],
).join('\n');
}

View File

@@ -0,0 +1,14 @@
import { _ } from 'meteor/underscore';
// As identified in issue #9149, when an application overrides the default
// _.template settings using _.templateSettings, those new settings are
// used anywhere _.template is used, including within the
// boilerplate-generator. To handle this, _.template settings that have
// been verified to work are overridden here on each _.template call.
export default function template(text) {
return _.template(text, null, {
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g,
escape : /<%-([\s\S]+?)%>/g,
});
};

View File

@@ -7,9 +7,9 @@
"integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ="
},
"http-parser-js": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.6.tgz",
"integrity": "sha1-GVJz9YcExFLWcQdr4gEyndNB3FU="
"version": "0.4.9",
"resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.9.tgz",
"integrity": "sha1-6hoE+2St/wJC6ZdPKX3Uw8rSceE="
},
"permessage-deflate": {
"version": "0.1.6",
@@ -17,14 +17,14 @@
"integrity": "sha1-WB8c7fvUQPrEfQd3vohjM4a5kt4="
},
"sockjs": {
"version": "0.3.18",
"resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.18.tgz",
"integrity": "sha1-2bKJMWyn33dZXvKZ4HXw+TfrQgc="
"version": "0.3.19",
"resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz",
"integrity": "sha512-V48klKZl8T6MzatbLlzzRNhMepEys9Y4oGFpypBFFn1gLI/QQ9HtLLyWJNbPlwGLelOVOEijUbTTJeLLI59jLw=="
},
"uuid": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz",
"integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho="
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz",
"integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g=="
},
"websocket-driver": {
"version": "0.7.0",

View File

@@ -1,12 +1,12 @@
Package.describe({
summary: "Meteor's latency-compensated distributed data server",
version: '2.1.0',
version: '2.1.1',
documentation: null
});
Npm.depends({
"permessage-deflate": "0.1.6",
sockjs: "0.3.18"
sockjs: "0.3.19"
});
Package.onUse(function (api) {

View File

@@ -20,12 +20,20 @@ meteorInstall.fetch = function (ids) {
var dynamicVersions = require("./dynamic-versions.js");
var missing;
function addSource(id, source) {
addToTree(tree, id, makeModuleFunction(id, source, ids[id].options));
}
function addMissing(id) {
addToTree(missing = missing || Object.create(null), id, 1);
}
Object.keys(ids).forEach(function (id) {
var version = dynamicVersions.get(id);
if (version) {
versions[id] = version;
} else {
addToTree(missing = missing || Object.create(null), id, 1);
addMissing(id);
}
});
@@ -33,10 +41,9 @@ meteorInstall.fetch = function (ids) {
Object.keys(sources).forEach(function (id) {
var source = sources[id];
if (source) {
var info = ids[id];
addToTree(tree, id, makeModuleFunction(id, source, info.options));
addSource(id, source);
} else {
addToTree(missing = missing || Object.create(null), id, 1);
addMissing(id);
}
});
@@ -46,9 +53,7 @@ meteorInstall.fetch = function (ids) {
Object.keys(flatResults).forEach(function (id) {
var source = flatResults[id];
var info = ids[id];
addToTree(tree, id, makeModuleFunction(id, source, info.options));
addSource(id, source);
var version = dynamicVersions.get(id);
if (version) {

View File

@@ -1,6 +1,6 @@
Package.describe({
name: "dynamic-import",
version: "0.2.0",
version: "0.2.1",
summary: "Runtime support for Meteor 1.5 dynamic import(...) syntax",
documentation: "README.md"
});

View File

@@ -10,29 +10,43 @@
Click "Add a New App".
</li>
<li>
Select "Website" and type a name for your app.
Add a "Display Name" for your app and click on "Create App ID".
</li>
<li>
Click "Create New Facebook App ID".
Answer the "Security Check" CAPTCHA and click on "Submit".
</li>
<li>
Select a category in the dropdown and click "Create App ID".
When the new app dashboard loads, click on "Settings" in the left hand menu.
</li>
<li>
Under "Tell us about your website", set Site URL to: <span class="url">{{siteUrl}}</span> and click "Next".
From the top of the "Basic" settings page, note down your "App ID" and "App Secret" (you will be asked for them at the bottom of this popup).
</li>
<li>
Click "Skip to Developer Dashboard".
Click on the "Add Platform" button, and select "Website".
</li>
<li>
Go to the "Settings" tab and add an email address under "Contact Email". Click "Save Changes".
In the "Website" section, set the "Site URL" to <span class="url">{{siteUrl}}</span> and click on "Save Changes".
</li>
<li>
Go to the "Status & Review" tab and select Yes for "Do you want to make this app and
all its live features available to the general public?". Click "Confirm".
Click on "Add Product" in the left hand menu.
</li>
<li>
Go back to the Dashboard tab.
Hover over "Facebook Login", click on "Set Up".
</li>
<li>
Click on "Facebook Login > Settings" from the left hand menu.
</li>
<li>
Set "Valid OAuth redirect URIs" to <span class="url">{{siteUrl}}_oauth/facebook</span> and click on "Save Changes".
</li>
<li>
Select "App Review" from the left hand menu.
</li>
<li>
Toggle the "Make app public" switch to "Yes".
</li>
<li>
Select a "Category" in the "Make app public" popup and click on "Confirm".
</li>
</ol>
</template>

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Blaze configuration templates for Facebook OAuth.",
version: "1.0.0"
version: "1.0.1"
});
Package.onUse(function(api) {

View File

@@ -12,7 +12,7 @@ Npm.strip({
});
Cordova.depends({
'cordova-plugin-console': '1.0.7'
'cordova-plugin-console': '1.1.0' // Dreprecated, remove in future
});
Package.onUse(function (api) {

View File

@@ -2080,6 +2080,10 @@ Tinytest.add('minimongo - sort', test => {
for (let j = 0; j < 2; j++) {c.insert({a: i, b: j, _id: `${i}_${j}`});}
}
test.equal(c.find(null, {sort: {b: -1, a: 1}, limit: 5}).fetch(), []);
test.equal(c.find(undefined, {sort: {b: -1, a: 1}, limit: 5}).fetch(), []);
test.equal(c.find(false, {sort: {b: -1, a: 1}, limit: 5}).fetch(), []);
test.equal(
c.find({a: {$gt: 10}}, {sort: {b: -1, a: 1}, limit: 5}).fetch(), [
{a: 11, b: 1, _id: '11_1'},
@@ -3025,7 +3029,7 @@ Tinytest.add('minimongo - modify', test => {
// Test for https://github.com/meteor/meteor/issues/9167
upsert({key: 123, keyName: '321'}, {$set: {name: 'Todo'}}, {key: 123, keyName: '321', name: 'Todo'});
upsertException({key: 123, "key.name": '321'}, {$set:{}});
// Nested fields don't work with literal objects
upsertException({"a": {}, "a.b": "foo"}, {});
// You can't have an ambiguious ID
@@ -3795,13 +3799,13 @@ Tinytest.add('minimongo - reactive skip/limit count while updating', test => {
Tracker.flush({_throwFirstError: true});
test.equal(count, 1);
test.equal(unlimitedCount, 2);
// Make sure a second update also works
X.update({}, {$set: {foo: 2}});
Tracker.flush({_throwFirstError: true});
test.equal(count, 1);
test.equal(unlimitedCount, 2);
c.stop();
});

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Meteor's client-side datastore: a port of MongoDB to Javascript",
version: '1.4.0'
version: '1.4.1'
});
Package.onUse(api => {

View File

@@ -354,6 +354,12 @@ export default class Sorter {
const selector = matcher._selector;
// If the user just passed a falsey selector to find(),
// then we can't get a key filter from it.
if (!selector) {
return;
}
// If the user just passed a literal function to find(), then we can't get a
// key filter from it.
if (selector instanceof Function) {

View File

@@ -146,7 +146,7 @@ Tinytest.add("webapp - generating boilerplate should not change runtime config",
var boilerplate = WebAppInternals.generateBoilerplateInstance(
"web.browser",
{}, // empty manifest
[], // empty manifest
{ runtimeConfigOverrides: { WEBAPP_TEST_KEY: true } }
);

View File

@@ -52,6 +52,7 @@ var packageJson = {
pathwatcher: "7.1.0",
optimism: "0.3.3",
'lru-cache': '4.0.1',
'cordova-lib': "7.1.0",
longjohn: '0.2.12'
}
};

View File

@@ -55,11 +55,13 @@ const launchIosSizes = {
'iphoneX_landscape': '2436x1125',
'ipad_portrait_2x': '1536x2048',
'ipad_landscape_2x': '2048x1536',
'ipad_portrait_pro_10_5': '1668x2224',
'ipad_landscape_pro_10_5': '2224x1668',
'ipad_portrait_pro_12_9': '2048x2732',
'ipad_landscape_pro_12_9': '2732x2048',
// Not yet supported in Xcode 9 or Cordova iOS 4.5.3
// 'ipad_portrait_pro_10_5': '1668x2224',
// 'ipad_landscape_pro_10_5': '2224x1668',
// 'ipad_portrait_pro_12_9': '2048x2732',
// 'ipad_landscape_pro_12_9': '2732x2048',
// Legacy
'iphone': '320x480',
'iphone_2x': '640x960',
'ipad_portrait': '768x1024',
'ipad_landscape': '1024x768'
@@ -603,10 +605,7 @@ configuration. The key may be deprecated.`);
* - `iphoneX_landscape` (2436x1125) // iPhone X
* - `ipad_portrait_2x` (1536x2048) // iPad, iPad mini
* - `ipad_landscape_2x` (2048x1536) // iPad, iPad mini
* - `ipad_portrait_pro_10_5` (1668x2224) // iPad Pro 10.5"
* - `ipad_landscape_pro_10_5` (2224x1668) // iPad Pro 10.5"
* - `ipad_portrait_pro_12_9` (2048x2732) // iPad Pro 12.9"
* - `ipad_landscape_pro_12_9` (2732x2048) // iPad Pro 12.9"
* - `iphone` (320x480) // Legacy
* - `iphone_2x` (640x960) // Legacy
* - `ipad_portrait` (768x1024) // Legacy
* - `ipad_landscape` (1024x768) // Legacy

View File

@@ -14,8 +14,8 @@ export const CORDOVA_DEV_BUNDLE_VERSIONS = {
};
export const CORDOVA_PLATFORM_VERSIONS = {
'android': '6.2.3',
'ios': '4.5.1'
'android': '6.3.0',
'ios': '4.5.3'
};
const PLATFORM_TO_DISPLAY_NAME_MAP = {

View File

@@ -53,11 +53,11 @@ const pinnedPlatformVersions = CORDOVA_PLATFORM_VERSIONS;
const pinnedPluginVersions = {
"cordova-plugin-battery-status": "1.2.4",
"cordova-plugin-camera": "2.4.1",
"cordova-plugin-console": "1.0.7",
"cordova-plugin-console": "1.1.0", // Deprecated, remove in future
"cordova-plugin-contacts": "2.3.1",
"cordova-plugin-device": "1.1.6",
"cordova-plugin-device-motion": "1.2.5",
"cordova-plugin-device-orientation": "1.0.7",
"cordova-plugin-device-motion": "2.0.0", // Deprecated, remove in future
"cordova-plugin-device-orientation": "2.0.0", // Deprecated, remove in future
"cordova-plugin-dialogs": "1.3.3",
"cordova-plugin-file": "4.3.3",
"cordova-plugin-file-transfer": "1.6.3",

View File

@@ -1300,7 +1300,6 @@ export class PackageSourceBatch {
imports: self.importedSymbolToPackageName,
// XXX report an error if there is a package called global-imports
includeSourceMapInstructions: isWeb,
noLineNumbers: !isWeb
};
const fileHashes = [];

View File

@@ -61,9 +61,6 @@ compiler.compile = Profile(function (packageSource, options) {
"` in package `" + packageSource.name + "`",
rootPath: packageSource.sourceRoot
}, function () {
// XXX we should probably also pass options.noLineNumbers into
// buildJsImage so it can pass it back to its call to
// compiler.compile
var buildResult = bundler.buildJsImage({
name: info.name,
packageMap: packageMap,
@@ -186,7 +183,6 @@ compiler.compile = Profile(function (packageSource, options) {
sourceArch: architecture,
isopackCache: isopackCache,
nodeModulesPath: nodeModulesPath,
noLineNumbers: options.noLineNumbers
});
_.extend(pluginProviderPackageNames,
@@ -345,8 +341,6 @@ var compileUnibuild = Profile(function (options) {
const inputSourceArch = options.sourceArch;
const isopackCache = options.isopackCache;
const nodeModulesPath = options.nodeModulesPath;
const noLineNumbers = options.noLineNumbers;
const isApp = ! inputSourceArch.pkg.name;
const resources = [];
const pluginProviderPackageNames = {};

View File

@@ -51,8 +51,6 @@ export class IsopackCache {
// Map from package name to Isopack.
self._isopacks = Object.create(null);
self._noLineNumbers = !! options.noLineNumbers;
self._lintLocalPackages = !! options.lintLocalPackages;
self._lintPackageWithSourceRoot = options.lintPackageWithSourceRoot;
@@ -362,7 +360,6 @@ export class IsopackCache {
isopack = compiler.compile(packageInfo.packageSource, {
packageMap: self._packageMap,
isopackCache: self,
noLineNumbers: self._noLineNumbers,
includeCordovaUnibuild: self._includeCordovaUnibuild,
includePluginProviderPackageMap: true,
pluginCacheDir: pluginCacheDir

View File

@@ -50,7 +50,6 @@ var Module = function (options) {
self.meteorInstallOptions = options.meteorInstallOptions;
self.useGlobalNamespace = options.useGlobalNamespace;
self.combinedServePath = options.combinedServePath;
self.noLineNumbers = options.noLineNumbers;
};
_.extend(Module.prototype, {
@@ -188,7 +187,6 @@ _.extend(Module.prototype, {
chunks.push(file.getPrelinkedOutput({
sourceWidth: sourceWidth,
noLineNumbers: self.noLineNumbers
}));
++fileCount;
@@ -255,7 +253,6 @@ _.extend(Module.prototype, {
const { code: source, map } =
file.getPrelinkedOutput({
sourceWidth: sourceWidth,
noLineNumbers: this.noLineNumbers
}).toStringWithSourceMap({
file: servePath,
});
@@ -340,7 +337,6 @@ _.extend(Module.prototype, {
chunks.push(t.getPrelinkedOutput({
sourceWidth,
noLineNumbers: self.noLineNumbers
}));
} else if (_.isObject(t)) {
@@ -429,7 +425,6 @@ _.extend(Module.prototype, {
if (file.bare) {
chunks.push("\n", file.getPrelinkedOutput({
sourceWidth,
noLineNumbers: this.noLineNumbers
}));
} else if (moduleCount > 0 && ! file.lazy) {
eagerModuleFiles.push(file);
@@ -695,8 +690,6 @@ _.extend(File.prototype, {
// - preserveLineNumbers: if true, decorate minimally so that line
// numbers don't change between input and output. In this case,
// sourceWidth is ignored.
// - noLineNumbers: We still include the banners and such, but
// no line number suffix.
// - sourceWidth: width in columns to use for the source code
//
// Returns a SourceNode.
@@ -704,18 +697,9 @@ _.extend(File.prototype, {
var self = this;
var width = options.sourceWidth || 70;
var bannerWidth = width + 3;
var noLineNumbers = options.noLineNumbers;
var preserveLineNumbers = options.preserveLineNumbers;
var result;
if (self.sourceMap) {
// If we have a source map, and options.noLineNumbers was not
// specified, it is important to annotate line numbers using that
// source map, since not all browsers support source maps.
if (typeof noLineNumbers === "undefined") {
noLineNumbers = false;
}
// Honoring options.preserveLineNumbers is likely impossible if we
// have a source map, since self.source has probably already been
// transformed in a way that does not preserve line numbers. That's
@@ -723,76 +707,12 @@ _.extend(File.prototype, {
// line numbers using comments (see above), just in case source maps
// are not supported.
preserveLineNumbers = false;
} else if (preserveLineNumbers) {
// If we don't have a source map, and we're supposed to be preserving line
// numbers (ie, we are not linking multiple files into one file, because
// we're the app), then we can get away without annotating line numbers
// (or making a source map), because they won't add any helpful
// information.
noLineNumbers = true;
}
let consumer;
let lines;
if (self.sourceMap) {
result = {
code: self.source,
map: self.sourceMap
};
consumer = new sourcemap.SourceMapConsumer(result.map);
} else {
result = {
code: self.source,
map: null,
};
// Generating line number comments for really big files is not
// really worth it when there's no meaningful self.sourceMap.
if (! noLineNumbers && result.code.length < 500000) {
consumer = {
originalPositionFor(pos) {
return pos;
}
};
}
}
if (consumer && ! noLineNumbers) {
var padding = bannerPadding(bannerWidth);
// We might have already done this split above.
lines = lines || result.code.split(/\r?\n/);
// Use the SourceMapConsumer object to compute the original line
// number for each line of result.code.
for (var i = 0, lineCount = lines.length; i < lineCount; ++i) {
var line = lines[i];
var len = line.length;
if (len < width &&
line[len - 1] !== "\\") {
var pos = consumer.originalPositionFor({
line: i + 1,
column: 0
});
if (pos) {
line += padding.slice(len, width) + " //";
// Not all source maps define a mapping for every line in the
// output. This is perfectly normal.
if (typeof pos.line === "number") {
line += " " + pos.line;
}
lines[i] = line;
}
}
}
result.code = lines.join("\n");
}
const result = {
code: self.source,
map: self.sourceMap || null,
};
var chunks = [];
var pathNoSlash = convertColons(self.servePath.replace(/^\//, ""));
@@ -827,11 +747,7 @@ _.extend(File.prototype, {
let chunk = result.code;
if (consumer instanceof sourcemap.SourceMapConsumer) {
chunk = sourcemap.SourceNode.fromStringWithSourceMap(
result.code, consumer);
} else if (consumer && result.map) {
if (result.map) {
chunk = sourcemap.SourceNode.fromStringWithSourceMap(
result.code,
new sourcemap.SourceMapConsumer(result.map),
@@ -943,7 +859,6 @@ export var prelink = Profile("linker.prelink", function (options) {
var module = new Module({
name: options.name,
combinedServePath: options.combinedServePath,
noLineNumbers: options.noLineNumbers
});
_.each(options.inputFiles, function (inputFile) {
@@ -1098,7 +1013,6 @@ export var fullLink = Profile("linker.fullLink", function (inputFiles, {
// True if JS files with source maps should have a comment explaining
// how to use them in a browser.
includeSourceMapInstructions,
noLineNumbers,
}) {
buildmessage.assertInJob();
@@ -1107,7 +1021,6 @@ export var fullLink = Profile("linker.fullLink", function (inputFiles, {
meteorInstallOptions,
useGlobalNamespace: isApp,
combinedServePath,
noLineNumbers
});
_.each(inputFiles, file => module.addFile(file));