Including an empty PUBLIC_SETTINGS object when there are no public
settings fixes a discrepancy between the way we calculated the client
hash for Cordova in CordovaBuilder and in webapp_server.js. This
discrepancy meant a Cordova app would always download a new version the
first time it started up, because the bundled version hash and the
server version hash would be different.
We only got away with this because we later use _.values to iterate over
the elements of the array, which just happens to do the right thing when
the array is overloaded with object properties. The order of iteration was
even the same because object keys are enumerated in order of assignment,
but when you're working with an ordered list of files it's better to use
an array the normal way (for its elements rather than its properties).
Fixes#4757
Uses environment variable CAFILE (to match NPM) which must contain a fully qualified path to a pem format root certificate to include in the list of trusted root certs.
This additional root certificate will be needed for those behind an SSL inspection proxy which acts as an SSL termination point and resigns the traffic with its own root certificate.
Now that we include it in published packages (as
node_modules/.package.json) we don't want it to change on every npm
update, or else we'll have to spuriously update package versions.
(The next release with this fix will spuriously update package versions,
though!)
If $METEOR_BINARY_DEP_WORKAROUND is set, then when bundling for a
non-host platform (build/bundle/deploy commands only), if a package has
no server unibuild for the target architecture, use the host
architecture and replace the npm modules with a package.json and
npm-shrinkwrap.json. Also write out a top-level setup.sh script (inside
programs/server) which runs npm install in all such directories.
To support this, we make sure to save the package.json and
npm-shrinkwrap.json files in various intermediate directories in case we
need them later. (We put them inside node_modules because that is what
gets copied from source tree to isopack.)
One big reason we need this is that the text format doesn't work on Windows
because of line endings. We could just replace the line endings based on
platform, but this seemed better overall.
Also, make sure to escape entities in HTML error page
We attempted to set default values for cordova-plugin-statusbar at
runtime. Because the plugin may not have been loaded at that point,
this gave inconsistent results. Instead, we now set the default options
while building, so they will get added to config.xml.
Fixes#5098
Specific improvements:
- Parentheses are now stripped from commands that look like named classes
so that they will be treated as class declarations rather than as named
class expressions.
- When the `ecmascript` package is installed, `compileForShell` errors are
now exposed to the `evalCommand` callback.
- Instead of using `vm.runInThisContext` to parse and evaluate commands at
the same time, `evalCommand` now parses commands by creating a new
`vm.Script` and later evaluates them using `script.runInThisContext()`,
so that `SyntaxError`s can be reported immediately. Fixes#5131.
Specific improvements:
- Parentheses are now stripped from commands that look like named classes
so that they will be treated as class declarations rather than as named
class expressions.
- When the `ecmascript` package is installed, `compileForShell` errors are
now exposed to the `evalCommand` callback.
- Instead of using `vm.runInThisContext` to parse and evaluate commands at
the same time, `evalCommand` now parses commands by creating a new
`vm.Script` and later evaluates them using `script.runInThisContext()`,
so that `SyntaxError`s can be reported immediately. Fixes#5131.
When Cordova plugins with old (pre-npm) IDs are installed, which
happens with older versions even when we have specified the new ID on
install, we need to convert these before checking whether to reinstall
all plugins.