Commit Graph

359 Commits

Author SHA1 Message Date
Slava Kim
deb03e3932 A preferred bundle path for node_modules never contains a colon 2015-01-20 22:04:23 -08:00
Slava Kim
1565475894 Never generate colons in file paths or serve paths
When building isopacks
2015-01-20 22:04:23 -08:00
Sashko Stubailo
2ad757275a Make stripLeadingSlash not reject relative paths 2015-01-20 22:04:22 -08:00
Slava Kim
78ddbd331a Add fake records for windows dev_bundles on warehouse 2015-01-20 22:03:23 -08:00
Slava Kim
70392aec79 Don't symlink node_modules on Windows
because symlinking is hard
2015-01-20 22:03:23 -08:00
Slava Kim
27066a6ecf serveRoot is always a url path, treat it as such
Don't use path.join or files.pathJoin to join url paths
2015-01-20 22:03:23 -08:00
Sashko Stubailo
82a37c2c7c Throw an error when we can't build an arch
Instead of failing silently
2015-01-20 22:03:22 -08:00
Maxime Quandalle
3a5a4dde6c Remove unused import in the bundler 2015-01-12 11:23:54 -08:00
David Glasser
096df9d62d Refactor parent pid check; drop --keepalive
This commit moves parent pid process from the webapp package to the boot
script. This means that daemonized apps without webapp will also exit
when the runner exits, if run from the runner. (For example, several
self-tests such as 'autoupdate' no longer leak node processes.) This is
controlled via the $METEOR_PARENT_PID environment variable instead of
from command line arguments, in order to make fewer assumptions about
how Meteor apps process arguments.

This also drops the old --keepalive support (which already has stopped
being used by the dev mode runner or any MDG deployment platforms).
Neither --parent-pid nor --keepalive were documented beforehand, and
--keepalive was already deprecated before 1.0.

These flags used to also incidentally trigger printing the LISTENING
line; this is now controlled by $METEOR_PRINT_ON_LISTEN.

Fixes #3315.
2015-01-05 15:48:32 -08:00
David Glasser
f6f4803a9a refactor: move pluginProviderPackageMap in Isopack
This also un-breaks soft refresh for troposphere packages:
previousIsopack was accidentally being set to an
{isopack,pluginProviderPackageMap} object, and so the "can we reuse the
previous one" check was never actually passing.
2014-12-17 00:13:07 -08:00
Ben Newman
2a7cd3268d Rewrite wrapFsFunc to decide whether to yield automatically. 2014-12-16 12:34:43 -05:00
David Glasser
c373120de7 Fix app build for Cordova
Caught by a zillion tests, oops.  But not by --prepare-app!
2014-12-15 17:29:49 -08:00
Sashko Stubailo
a2e62e23b5 Add comment explaining existsSync 2014-12-15 15:32:06 -08:00
Sashko Stubailo
e7167e5257 Factor out almost all fs. and path. calls in the tool
This will be useful when we want to be smart with windows file paths later
Also, all of the file calls are asynchronous with fibers now, which comes with
many benefits.

This is a combination of 23 commits. Original messages:
Wrap a large number of fs calls inside files.*

Convert a few more fs calls to files.*

More moving fs.* to files

Implement read/write streams and open/read/close

Get rid of fs from auth.js

Remove fs and unused imports from catalog-local and catalog-remote

Remove unused imports from catalog.js

Replace a whole lot of fs calls

Fix error

Migrate a lot more fs. calls to files.

Add a temporary symlink method

Convert old test to files.*

Use files.pathX instead of path.x everywhere

Replace path.x to files.pathX in tests

Small fixes to files.js and one rename

Make cleanup run in a fiber

Make wrapping functions take function name in case we need it

Add some timeouts and stuff to HCP tests

wrapFsFunc also makes a sync version of the function

Sometimes you just don't want to yield!

Make sure JsImage readFromDisk doesn't yield

Remove unused imports from npm test

Change order of test now that some things don't yield

Fix missing files import, and add a debug error printout
2014-12-15 15:32:06 -08:00
David Glasser
bc53d5f1e4 Use case in buildmessage titles consistently
Job names should not be capitalized (so they look OK in "While xxx"
messages), and are capitalized by the progress bar.

Fixes #3003.
2014-12-11 14:40:16 -08:00
Utkarsh Upadhyay
bf9b67e756 Call correct function on error in fetching assets.
Instead of trying (and failing) to call a function on underscore, call the correct `_callback`.
2014-12-04 19:49:39 -08:00
David Glasser
06fbe35d46 Support deploying to legacy Galaxy prototype 2014-12-01 17:42:13 -08:00
David Glasser
bf00def694 clean up comments and remove dead code
Part of #3006 cleanup.
2014-12-01 01:41:14 -08:00
David Glasser
ff3e4439d4 PackageSource and buildJsImage don't need catalog
It wasn't really being used for anything anymore except complaining
about api.versionsFrom being used during isopacket builds, which is now
implemented in a simpler way.
2014-12-01 01:41:13 -08:00
David Glasser
289d92f2ec separate server deps from tool deps
move package.json to a JS file so it can have comments.
2014-11-26 09:45:49 -08:00
David Glasser
1d4c3e7387 comment tweaks 2014-11-25 09:35:34 -08:00
David Glasser
2f7412573c remove some support for old versions.json files 2014-11-25 09:06:26 -08:00
David Glasser
45cc54fb63 comment and require cleanup 2014-11-25 09:06:20 -08:00
David Glasser
c3b6ab1cf2 main/plugin/app field of unibuild is now 'kind'
It was 'name' in unibuilds, and both 'self.archName' and 'name:' option
in SourceArch. And for some reason we stopped writing it to isopack.json
at some point.  Now we'll just call it 'kind' to make it clear it is
neither a name nor an arch.  (I think this used to be how we
differentiated main from tests, but that doesn't exist any more.)

This fixes a bug introduced on this branch where weak dependencies might
get ignored if the weakly-depended package was just recompiled.
2014-11-25 09:06:18 -08:00
David Glasser
4563258ec0 'meteor run' works once
restart crashes intentionally

(client-only changes to app code work; client-only changes to packages
don't get reloaded.)
2014-11-25 09:06:17 -08:00
David Glasser
a9a3411703 checkpoint on 'meteor run' 2014-11-25 09:06:17 -08:00
David Glasser
055575a80c Support .meteor/cordova-plugins 2014-11-25 09:06:17 -08:00
David Glasser
7998389287 Read .meteor/release in ProjectContext 2014-11-25 09:06:16 -08:00
David Glasser
ee649d3bda Move isopack-compiler back to compiler 2014-11-25 09:06:15 -08:00
David Glasser
8e484170ae Delete PackageLoader, references to it in new code
References are still sitting around in code that hasn't been
transitioned yet.
2014-11-25 09:06:14 -08:00
David Glasser
17f5cf6273 'meteor bundle' works with ProjectContext!
- the 'programs' subdirectory is no longer supported

- includeDebug is now an option to bundler.bundle, not global state

- some cordova-specific stuff has been disabled

- lots of other commands are presumably entirely broken
2014-11-25 09:06:12 -08:00
David Glasser
431004c089 Remove pluginProviderPackageDirs
This has been replaced by the pluginProviderPackageMap which is built at
a different level.
2014-11-25 09:06:11 -08:00
David Glasser
ebf881894b buildinfo file should contain all pkgs in plugin 2014-11-25 09:06:11 -08:00
David Glasser
23f5e354d0 I can compile everything! 2014-11-25 09:06:09 -08:00
David Glasser
399681e04f move sha1 from Builder to watch
since watch actually uses it and Builder doesn't
2014-11-12 17:13:41 -08:00
David Glasser
170c0acad7 Rename unibuild everywhere to isopackets 2014-11-07 16:45:58 -08:00
David Glasser
9cab094f18 uniload now works via named "isopackets"
You can only request a named set of packages, not a random assortment.

In future commits, we will pre-build these packages into JsImages and
load them from that. Building packages for uniload will eventually not
involve the .build.foo directories at all.  (All saved packages will be
built in app context, eventually.)
2014-11-07 16:45:57 -08:00
David Glasser
12eb34debd Ensure that Npm.strip is applied in all cases
An Isopack object can be created in one of two ways: by parsing a built
isopack from disk, or by compiling a PackageSource (which may or may not
get written to disk).

In the former case, its nodeModulesPath field will be something like
"npm/node_modules", referring to the node_modules directory inside the
built isopack, which has already had Npm.strip applied to it.

In the latter case, its nodeModulesPath field is actually the
pre-stripped node modules directory (eg '.npm/package/node_modules'). So
if we were to use such an Isopack object inside a bundler operation, we
would need to actually apply the strip operation at bundle time.

As far as I can tell it may not actually be possible to trigger this bug
yet, because for some reason we never quite seem to use the built
Isopack in bundler without cycling it through disk. But I've managed to
trigger it on the isopackets branch, and it's certainly a goal to use
our in-memory caches better (and not require unnecessary write/read
cycles).
2014-11-06 14:28:38 -08:00
David Glasser
c2a4134d97 Update Node to 0.10.33 from 0.10.29
Our npm patch is not yet in a Node 0.10 release (it's in npm 2.1.0).
2014-10-30 15:12:28 -07:00
David Glasser
17f16160e5 Remove buildmessage usage by release.js 2014-10-29 19:15:51 -07:00
Slava Kim
84e3b0d1a2 Revert "Don't rewrite relative paths for cordova builds."
This reverts commit 3f821867d0.
2014-10-24 11:31:23 -07:00
Emily Stark
97c85bc3da Exit 'meteor run' when cordova plugins or platforms change.
We don't have a way to HCP a changed set of plugins or platforms, so
just exit and ask the user to re-run. There are probably some cases
where we don't have to exit (e.g. if you add the android platform, we
probably don't need to exit out of 'meteor run ios'), but we exit in all
cases for simplicity.
2014-10-21 15:59:40 -07:00
Ben Newman
830acf651c Implement a meteor shell command.
Summary:
Invoking `meteor shell` starts an interactive REPL for evaluating server-side code.

Shell commands are evaluated in the server process, so the shell's input and output have to be piped through a socket from/to the parent process that runs the `meteor shell` command. This separation accounts for most of the complexity of this diff, but the end result is pretty seamless: tab completion, history, ctlr-c and ctrl-d, etc. all work as expected.

Task: https://app.asana.com/0/15750483766338/16576093991355

Test Plan: Run `meteor run` in one terminal and `meteor shell` in another, evaluate some commands, and verify that the commands seem to be running the context of the server process. Also check tab completion and history, and ensure that the server is running simultaneously with the shell.

Reviewers: dgreenspan, avital, slava, emily, nim, sashko

CC: sashko

Differential Revision: https://phabricator.meteor.com/D837
2014-10-20 14:44:09 -04:00
Ben Newman
647f13cabb Only require a ctl program when deploying to Galaxy. 2014-10-14 18:32:59 -04:00
David Glasser
5590d194c5 debug-only flag only affects bundler, not compiler 2014-10-07 18:26:21 -07:00
ekatek
e784341cf5 clean out the forProd option which we no longer use 2014-10-07 15:55:50 -07:00
ekatek
e0414f2ed5 allow user to mark packages as debugOnly and not have them bundle in production mode
(still outstanding: changes to package publication workflow)

A package marked debugOnly in the package source is not to be bundled in production.
Moreover, if a package/app depends on a debugOnly package, that entire tree should
not be bundled. (But we should take it into account when figuring out versions!)

Does the following:

- In the catalog, we have a function that takes in a set of versions and a set of original
constraints and traverses it, recursively, to build a subset of versions that we *should*
bundle, and the corresponding subset of versions that we shouldn't (because they are either
debugOnly themselves or pulled in by debugOnly packages). (We do this in the catalog because
it is an addon onto the results of the constraint solver, tied deeply into our representation
of data)

- In the packageLoader, we keep track packages & versions that we should bundle, and also,
packages that we should exclude. We do this in the package-loader because, essentially, that's the
object that we use to keep the results of the constraint-solver, and we already propagate it to all
functions that care about it. (Possibly we should subsequently rename it later).

- In the compiler, when we figure out buildTimeDependencies, we ask if we need to bundle debug
builds. If not, we filter them out (see above). Also, when we actually build together unibuilds,
we don't touch the ones that the packageloader tells us to exclude (which ensures that they don't make
it into the final product).

- In the project, we keep track of whether this project is building in debug mode. That's because the project
is where we keep the state of our curent project that we are building, and if we are ever in the state of
building multiple things, then that's the code that we would need to touch (see also that we make a similar
assumption when solving constraints).

- Adds the option to keepthe project debug-build-free and calls it in commands when approporiate.
2014-10-07 15:55:50 -07:00
Emily Stark
a22a5a3341 Update 'bundler.bundle' comment 2014-10-07 15:46:45 -07:00
Slava Kim
4aa42726a9 Make the "remove old sourceMappingURL" regex global
So we don't make an assumption there is only one of those. Thanks to Ben.
2014-09-30 14:08:33 -07:00
Slava Kim
5e7c1a45d8 Fix the server-side sourcemaps again
Partially reverts 431af48743 merged in #2385
2014-09-30 14:04:17 -07:00