Commit Graph

6125 Commits

Author SHA1 Message Date
Ben Newman
bf9338b367 Support ./meteor publish-release --skip-tree-hashing ... flag. 2017-02-01 12:24:06 -05:00
Ben Newman
c683a79595 Unify file.emptyStub and file.imported === "implicit" as file.implicit.
Note that there was a typo in ResourceSlot#addStylesheet, so
file.emptyStub was never === true before.
2017-02-01 10:35:31 -05:00
Ben Newman
6c643a4763 Preserve true "main" and "browser" fields of package.json modules.
Previously, when building a JavaScript bundle for the client, if a
package.json file had a string-valued "browser" field, we would replace
the value of the "main" field of the bundled package.json module with the
value of the "browser" field. This trick was important because it allowed
an npm package to have a different entry point on the client than it had
on the server.

However, that approach became inconsistent if the package.json file was
also explicitly imported as a module, because the package.json stub used
for module resolution prevented the real contents of package.json from
getting bundled, and disagreed with the original package.json module about
the value of the "main" field.

To resolve that inconsistency, it seems better to avoid modifying the
"main" field of package.json modules, and instead rely on the runtime
module system to make sense of the "browser" field, regardless of whether
the package.json module is a stub used only for module resolution or
contains the full contents of the original package.json file.

The ability to understand "browser" fields of package.json modules was
introduced in install@0.8.3:
377d1a3b51

This is potentially a backwards-incompatible change for developers using
this version of `ImportScanner` and `Resolver` who have not yet upgraded
their `modules-runtime` package to at least version 0.7.8. The solution is
to upgrade `modules-runtime`, though it would be nice to enforce that
better somehow.
2017-02-01 10:34:52 -05:00
Ben Newman
2613582311 Always copy node_modules/.bin into bundle/programs/server/npm.
Fixes #8136.
2017-02-01 09:58:10 -05:00
Ben Newman
1b855047ae Limit InputFile#findControlFile to package source root directory.
This is an improvement that I noticed while investigating the
feasibility of fixing #8068.
2016-11-17 13:17:49 -05:00
Ben Newman
fc9c56a73e Improve InputFile#resolve. 2016-11-17 13:12:27 -05:00
Ben Newman
4cf06c37a6 Avoid global/method name ambiguity in InputFile#require. 2016-11-17 13:12:27 -05:00
David Burles
dc1bdc3a56 remove inline eslint rules 2016-11-16 11:22:45 -05:00
David Burles
851b6c5ae2 remove validation test 2016-11-16 11:22:45 -05:00
David Burles
311efd58cb remove url validation 2016-11-16 11:22:45 -05:00
David Burles
06fb2fbfb9 more concise export 2016-11-16 11:22:45 -05:00
David Burles
52b815cf33 code style changes for skel-full 2016-11-16 11:22:45 -05:00
Ben Newman
24b0ea9fdd Bump compiler/linker/bundler salts to trigger fresh builds. 2016-11-14 21:18:03 -05:00
Ben Newman
e4c7b0890c Watch all imported files in linked npm packages on server. 2016-11-14 14:25:22 -05:00
Ben Newman
e3387599a2 Test lazy main modules and stray imports in modules test app. 2016-11-14 13:35:50 -05:00
Ben Newman
41713dacf7 Include meteor npm install in new app instructions.
Thanks to @ptica for this suggestion:
https://github.com/meteor/meteor/issues/8042#issuecomment-260277876
2016-11-14 12:51:00 -05:00
Ben Newman
2437f72cd7 Strip unnecessary imports for packages with no modules.
Note that even an empty package needs to define Package[name] = {}, so
that other packages can tell at runtime whether it's installed.

Fixes #7927.
2016-11-14 12:51:00 -05:00
Ben Newman
911f25bbf4 Allow lazy api.mainModule modules.
If you call api.mainModule(path, where, { lazy: true }), that main
module will not be evaluated until other code imports it at runtime, and
won't even be bundled if no other code imports it.

Closes #6132.
2016-11-14 12:51:00 -05:00
Ben Newman
8d1133743d Fix options.transformFilename behavior in files.cp_r.
The options.transformFilename function is only supposed to transform
target file names, not the names of source files to be copied.

This behavior was broken by c5809a4a1c
between Meteor 1.4.0.1 and 1.4.1. Thank goodness for `git bisect`!

The biggest symptom of this mistake was that `meteor create --package`
no longer created files based on the ~fs-name~.js and ~fs-name~-tests.js
template files.

This probably merits a 1.4.1.4 release in addition to 1.4.2.2.
2016-11-14 11:50:50 -05:00
Mehdi AHRAOUI
0466fdd37f Scaffold an official project structure
Scaffold an official project structure
Add --bare option to meteor create

Notice scaffold options on meteor create

add full skeleton

add spaces

remove shell-server package from skew-full + add description of new packages

Add --bare option to meteor create

Notice scaffold options on meteor create

add full skeleton

add spaces

remove shell-server package from skew-full + add description of new packages

improve PR

resolve conflict

Fix rebase

fix static-assets readme

Fix tipo

Remove insecure and auto publish packages

Remove useraccounts-configuration.js

add tests

fix PR
2016-11-11 11:00:33 -05:00
Ben Newman
61ada2d27b Update statOrNull method of cached Resolver objects.
This solves a problem that sometimes occurs when new modules are added
to an app but the cached Resolver object cannot find them because its
statOrNull method is still using a previous instance of the
corresponding ImportScanner.

Related issues and comments:

https://forums.meteor.com/t/meteor-not-detecting-new-files/31151
https://github.com/Akryum/meteor-vue-component/issues/80
https://github.com/meteor/meteor/pull/7975#issuecomment-259263650
https://github.com/meteor/meteor/issues/8008
2016-11-10 17:50:59 -05:00
Ben Newman
7abd832f75 Upgrade modules test app to Meteor 1.4.2.1. 2016-11-10 17:50:59 -05:00
Ben Newman
8f07a87bd5 Give package test modules access to Npm.depends dependencies.
Similar in spirit to bbac272530.

Fixes #7999.
2016-11-08 15:36:36 -05:00
Ben Newman
932115120f Don't let options.hash override File#hash() salting. 2016-11-08 14:08:08 -05:00
Ben Newman
4ada5c8a17 Bump LINKER_CACHE_SALT and compiler.BUILT_BY for good measure.
This will trigger recompilation and relinking, which should help prevent
various stale caching issues, e.g. #7977.
2016-11-08 13:50:32 -05:00
Ben Newman
940cc4f4d6 Add salt to File#hash in bundler.js.
This is what determines, among other things, source map URL names of the
form <hash>.map, so this may help to avoid #7977.
2016-11-08 13:48:54 -05:00
Ben Newman
a43d66991b Allow watch.sha1 to accept multiple arguments. 2016-11-08 13:48:23 -05:00
Ben Newman
a7ac32e00a Tolerate ENOENT errors in Builder#copyDirectory. 2016-11-08 13:33:20 -05:00
Ben Newman
ad460e0d7d Tolerate files.realpath throwing ELOOP exceptions. 2016-11-04 18:45:51 -04:00
Ben Newman
52697c7167 Cache getProdPackageNames optimistically. 2016-11-04 18:26:03 -04:00
Ben Newman
7f35e94713 Tolerate files.realpath throwing ENOENT exceptions. 2016-11-04 18:14:09 -04:00
Ben Newman
af51b8160c Use absolute paths for external symlinks in Builder#copyDirectory.
Thanks to @worldsayshi for reporting this issue with a reproduction.

Fixes #8005.
Fixes #2876.
Fixes #7154.
2016-11-04 17:44:42 -04:00
Ben Newman
57fe26161d Use Meteor.setTimeout to re-run tryInsert function. 2016-11-03 12:18:42 -04:00
Ben Newman
f290abc72e Another attempt to make "run --once" test more reliable. 2016-11-03 11:48:02 -04:00
Ben Newman
19fdc5c65f Make npm-rebuild.js more Windows-friendly.
Fixes #8007.
2016-11-03 10:25:55 -04:00
Ben Newman
acc98c7c15 Set NPM_CONFIG_PREFIX to dev_bundle by default. 2016-11-02 19:23:09 -04:00
Ben Newman
cfc167a67b Make test more reliable by calling insert in Meteor.startup. 2016-11-02 17:25:26 -04:00
Ben Newman
e345fc2d27 Separate failing part of "run --once" test into own test. 2016-11-02 17:07:50 -04:00
Ben Newman
476d6bf7b3 Attempt to fix "run --once" test by giving Mongo a chance to exit.
This test has been failing intermittently on Circle CI.
2016-11-02 16:25:37 -04:00
Ben Newman
31e7b8bb48 Clean up temporary package.json files. 2016-11-02 15:45:04 -04:00
Ben Newman
643a9f12da Move default npm deps install function into own module.
This extraction was necessary because importing tools/cli/commands.js is
not entirely side-effect-free, and was interfering with older tests.
2016-11-02 15:38:39 -04:00
Ben Newman
4bf69409fa Call installDefaultNpmDeps in old bundler-assets test. 2016-11-02 15:16:30 -04:00
Ben Newman
fd57b86125 Run npm install in test apps even if package.json exists. 2016-11-02 14:18:43 -04:00
Ben Newman
5f0ffc5217 Remove coffeescript version constraint in modules test app. 2016-11-02 14:18:42 -04:00
Ben Newman
a90011b885 Improve meteor shell self-test. 2016-11-02 14:18:42 -04:00
Ben Newman
5dc2eaa0f7 Add babel-runtime to test app package.json files. 2016-11-02 13:32:01 -04:00
Ben Newman
8bc4fe20c6 Cache .meteor-portable values temporarily in memory.
This is another way to fix the bug I previously fixed by passing
options.allowSyntaxError to optimisticReadJsonOrNull.

To reproduce the bug (and/or verify that it is fixed), run the following
commands in a terminal:

  rm -rf meteor/packages/npm-mongo/.npm
  meteor/meteor --get-ready

Before these two commits, optimisticReadJsonOrNull would throw a
SyntaxError when reading one of the .meteor-portable files because an
asynchronous write to the same file had not yet finished.
2016-11-02 13:15:57 -04:00
Ben Newman
909419b36e Optionally tolerate SyntaxError in optimisticReadJsonOrNull. 2016-11-02 13:04:09 -04:00
Ben Newman
6b6a71b073 Fix and improve app creation tests. 2016-11-02 12:47:01 -04:00
Ben Newman
270b5cc8ef Run meteor npm install as part of meteor create tests. 2016-11-02 12:05:33 -04:00