diff --git a/packages/autopublish/package.js b/packages/autopublish/package.js index e23b9ebcdd..483e6a4473 100644 --- a/packages/autopublish/package.js +++ b/packages/autopublish/package.js @@ -1,5 +1,5 @@ Package.describe({ - summary: "Publish the entire database to all clients", + summary: "(For prototyping only) Publish the entire database to all clients", version: '1.0.4-plugins.0' }); diff --git a/packages/autoupdate/package.js b/packages/autoupdate/package.js index 648337a1da..b7bf2ca174 100644 --- a/packages/autoupdate/package.js +++ b/packages/autoupdate/package.js @@ -25,10 +25,10 @@ Package.onUse(function (api) { 'underscore' ], ['client', 'server']); - api.use('reload', 'client', {weak: true}); + api.use('reload', 'client'); api.use(['http', 'random'], 'web.cordova'); - + api.addFiles('autoupdate_server.js', 'server'); api.addFiles('autoupdate_client.js', 'web.browser'); api.addFiles('autoupdate_cordova.js', 'web.cordova'); diff --git a/packages/blaze-html-templates/README.md b/packages/blaze-html-templates/README.md new file mode 100644 index 0000000000..84ad905655 --- /dev/null +++ b/packages/blaze-html-templates/README.md @@ -0,0 +1,9 @@ +# blaze-html-templates + +A meta-package that includes everything you need to compile and run Meteor templates with Spacebars and Blaze. + +For more details, see the documentation of the component packages: + +- [templating](https://atmospherejs.com/meteor/templating): compiles `.html` files +- [blaze](https://atmospherejs.com/meteor/blaze): the runtime library +- [spacebars](https://atmospherejs.com/meteor/spacebars): the templating language diff --git a/packages/blaze-html-templates/package.js b/packages/blaze-html-templates/package.js new file mode 100644 index 0000000000..12f570a747 --- /dev/null +++ b/packages/blaze-html-templates/package.js @@ -0,0 +1,25 @@ +Package.describe({ + name: 'blaze-html-templates', + version: '1.0.0', + // Brief, one-line summary of the package. + summary: 'Compile HTML templates into reactive UI with Meteor Blaze', + // By default, Meteor will default to using README.md for documentation. + // To avoid submitting documentation, set this field to null. + documentation: 'README.md' +}); + +Package.onUse(function(api) { + api.imply([ + // A library for reactive user interfaces + 'blaze', + + // The following packages are basically empty shells that just exist to + // satisfy code checking for the existence of a package. Rest assured that + // they are not adding any bloat to your bundle. + 'ui', // XXX COMPAT WITH PACKAGES BUILT FOR 0.9.0. + 'spacebars', // XXX COMPAT WITH PACKAGES BUILT FOR 0.9.0 + + // Compile .html files into Blaze reactive views + 'templating' + ]); +}); diff --git a/packages/blaze/preamble.js b/packages/blaze/preamble.js index b90acdb3c3..aba9384a76 100644 --- a/packages/blaze/preamble.js +++ b/packages/blaze/preamble.js @@ -26,8 +26,7 @@ Blaze._escape = (function() { Blaze._warn = function (msg) { msg = 'Warning: ' + msg; - if ((typeof Log !== 'undefined') && Log && Log.warn) - Log.warn(msg); // use Meteor's "logging" package - else if ((typeof console !== 'undefined') && console.log) - console.log(msg); + if ((typeof console !== 'undefined') && console.warn) { + console.warn(msg); + } }; diff --git a/packages/insecure/package.js b/packages/insecure/package.js index f103d36fd3..4a42028932 100644 --- a/packages/insecure/package.js +++ b/packages/insecure/package.js @@ -1,5 +1,5 @@ Package.describe({ - summary: "Allow all database writes by default", + summary: "(For prototyping only) Allow all database writes from the client", version: '1.0.4-plugins.0' }); diff --git a/packages/meteor-base/README.md b/packages/meteor-base/README.md new file mode 100644 index 0000000000..8a62ab8fc5 --- /dev/null +++ b/packages/meteor-base/README.md @@ -0,0 +1,11 @@ +# meteor-base + +A default set of packages that almost every app will have. You should only remove this package if you really, really know what you are doing. + +It comes with the following packages: + +1. [`meteor`](https://atmospherejs.com/meteor/meteor) - Super basic stuff about the programming environment, and a handler for the `css` file type. +2. [`webapp`](https://atmospherejs.com/meteor/webapp) - The actual web server that handles connections, serves files, etc. +3. [`underscore`](https://atmospherejs.com/meteor/underscore) - A library with lots of useful utilities that most of Meteor is built on. +4. [`autoupdate`](https://atmospherejs.com/meteor/autoupdate) - Refreshes the client automatically when the server has new code. +5. [`ddp`](https://atmospherejs.com/meteor/ddp) - A protocol for communicating between the client and server. This is what enables `Meteor.methods`, `Meteor.publish`, `Meteor.subscribe`, etc. diff --git a/packages/meteor-base/package.js b/packages/meteor-base/package.js new file mode 100644 index 0000000000..0b64f228d4 --- /dev/null +++ b/packages/meteor-base/package.js @@ -0,0 +1,31 @@ +Package.describe({ + name: 'meteor-base', + version: '1.0.0', + // Brief, one-line summary of the package. + summary: 'Packages that every Meteor app needs', + // By default, Meteor will default to using README.md for documentation. + // To avoid submitting documentation, set this field to null. + documentation: 'README.md' +}); + +Package.onUse(function(api) { + api.imply([ + // Super basic stuff about where your code is running and async utilities + 'meteor', + + // This package enables making client-server connections; currently Meteor + // only supports building client/server web applications so this is not + // removable + 'webapp', + + // Most Meteor core packages depend on Underscore right now + 'underscore', + + // The protocol and client/server libraries that Meteor uses to send data + 'ddp', + 'livedata', // XXX COMPAT WITH PACKAGES BUILT FOR 0.9.0. + + // Push code changes to the client and automatically reload the page + 'autoupdate' + ]); +}); diff --git a/packages/mobile-experience/README.md b/packages/mobile-experience/README.md new file mode 100644 index 0000000000..4c0d0a980d --- /dev/null +++ b/packages/mobile-experience/README.md @@ -0,0 +1,7 @@ +# mobile-experience + +A set of Cordova/PhoneGap-specific packages that set some good defaults when building for mobile. These packages only activate when you are building a native Android or iOS app. + +1. [fastclick](https://atmospherejs.com/meteor/fastclick) - avoid the 300ms touch delay +2. [mobile-status-bar](https://atmospherejs.com/meteor/mobile-status-bar) - avoid the status bar information covering up your app content +3. [launch-screen](https://atmospherejs.com/meteor/launch-screen) - cover the app with a launch image so that people don’t have to see things loading diff --git a/packages/mobile-experience/package.js b/packages/mobile-experience/package.js new file mode 100644 index 0000000000..cc0d804d20 --- /dev/null +++ b/packages/mobile-experience/package.js @@ -0,0 +1,22 @@ +Package.describe({ + name: 'mobile-experience', + version: '1.0.0', + // Brief, one-line summary of the package. + summary: 'Packages for a great mobile user experience', + // By default, Meteor will default to using README.md for documentation. + // To avoid submitting documentation, set this field to null. + documentation: 'README.md' +}); + +Package.onUse(function(api) { + api.imply([ + // Fastclick: remove the 300 ms click event lag in mobile browsers + "fastclick", + + // A nicer appearance for the status bar in PhoneGap/Cordova apps + "mobile-status-bar", + + // Show a nice splash image while your PhoneGap/Cordova app's UI is loading + "launch-screen" + ], "web.cordova"); +}); diff --git a/packages/meteor-platform/.gitignore b/packages/non-core/meteor-platform/.gitignore similarity index 100% rename from packages/meteor-platform/.gitignore rename to packages/non-core/meteor-platform/.gitignore diff --git a/packages/meteor-platform/README.md b/packages/non-core/meteor-platform/README.md similarity index 100% rename from packages/meteor-platform/README.md rename to packages/non-core/meteor-platform/README.md diff --git a/packages/meteor-platform/package.js b/packages/non-core/meteor-platform/package.js similarity index 100% rename from packages/meteor-platform/package.js rename to packages/non-core/meteor-platform/package.js diff --git a/tools/static-assets/skel/.meteor/packages b/tools/static-assets/skel/.meteor/packages index 792d1296b6..a9f8340d51 100644 --- a/tools/static-assets/skel/.meteor/packages +++ b/tools/static-assets/skel/.meteor/packages @@ -4,9 +4,17 @@ # 'meteor add' and 'meteor remove' will edit this file for you, # but you can also edit it by hand. -meteor-platform -standard-minifiers # JS/CSS minifiers run for production mode -autopublish # publishes all data to the clients for prototyping -insecure # allows all DB writes from clients for prototyping -es5-shim # ECMAScript 5 compatibility for older browsers. -ecmascript # allows ECMAScript2015+ syntax by default +meteor-base # Packages every Meteor app needs to have +mobile-experience # Packages for a great mobile UX +mongo # The database Meteor supports right now +blaze-html-templates # Compile .html files into Meteor Blaze views +session # Client-side reactive dictionary for your app +jquery # Helpful client-side library +tracker # Meteor's client-side reactive programming library + +standard-minifiers # JS/CSS minifiers run for production mode +es5-shim # ECMAScript 5 compatibility for older browsers. +ecmascript # Enable ECMAScript2015+ syntax in app code + +autopublish # Publish all data to the clients (for prototyping) +insecure # Allow all DB writes from clients (for prototyping) diff --git a/tools/upgraders.js b/tools/upgraders.js index 40ff72e3f8..d8a12f0293 100644 --- a/tools/upgraders.js +++ b/tools/upgraders.js @@ -132,6 +132,37 @@ var upgradersByName = { projectContext.projectConstraintsFile.addConstraints( ['standard-minifiers']); projectContext.projectConstraintsFile.writeIfModified(); + }, + + "1.2.0-meteor-platform-split": function (projectContext) { + const packagesFile = projectContext.projectConstraintsFile; + // meteor-platform is split into a series of smaller umbrella packages + // Only run this upgrader if the app has meteor-platform + if (packagesFile.getConstraint('meteor-platform')) { + packagesFile.removePackages(['meteor-platform']); + + packagesFile.addConstraints([ + // These packages replace meteor-platform in newly created apps + 'meteor-base', + 'mobile-experience', + 'mongo', + 'blaze-html-templates', + 'session', + 'jquery', + 'tracker', + + // These packages are not in newly created apps, but were in + // meteor-platform so we need to add them just in case + 'logging', + 'reload', + 'random', + 'ejson', + 'spacebars', + 'check', + ].map((pkgName) => {return {package: pkgName}})); + + packagesFile.writeIfModified(); + } } ////////////