From aa6adfca2c8ba67cabf2fbe4504a72ae479188cc Mon Sep 17 00:00:00 2001 From: Athar Shoyeb Date: Tue, 13 Dec 2022 22:07:12 +0530 Subject: [PATCH 01/86] Whitelist issue resolved --- packages/twitter-oauth/twitter_server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/twitter-oauth/twitter_server.js b/packages/twitter-oauth/twitter_server.js index 090d455172..60a1148ba4 100644 --- a/packages/twitter-oauth/twitter_server.js +++ b/packages/twitter-oauth/twitter_server.js @@ -13,7 +13,7 @@ var urls = { }; // https://dev.twitter.com/docs/api/1.1/get/account/verify_credentials -Twitter.whitelistedFields = ['profile_image_url', 'profile_image_url_https', 'lang', 'email']; +Twitter.whitelistedFields = ['profile_image_url', 'profile_image_url_https', 'lang', 'email','name']; OAuth.registerService('twitter', 1, urls, async function(oauthBinding) { const response = await oauthBinding.getAsync('https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true'); @@ -26,7 +26,7 @@ OAuth.registerService('twitter', 1, urls, async function(oauthBinding) { }; // include helpful fields from twitter - const { identity: fields } = Twitter.whitelistedFields; + const fields = Twitter.whitelistedFields.reduce((o, k) => { if ( identity[k]) o[k] = identity[k]; return o}, {}); Object.assign(serviceData, fields); return { From f26695e888b1604202d366e1c0ef8684e17c8c2f Mon Sep 17 00:00:00 2001 From: Athar <111640235+Atharshoyeb@users.noreply.github.com> Date: Fri, 16 Dec 2022 01:32:13 +0530 Subject: [PATCH 02/86] Update twitter_server.js --- packages/twitter-oauth/twitter_server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/twitter-oauth/twitter_server.js b/packages/twitter-oauth/twitter_server.js index 60a1148ba4..a570769997 100644 --- a/packages/twitter-oauth/twitter_server.js +++ b/packages/twitter-oauth/twitter_server.js @@ -13,7 +13,7 @@ var urls = { }; // https://dev.twitter.com/docs/api/1.1/get/account/verify_credentials -Twitter.whitelistedFields = ['profile_image_url', 'profile_image_url_https', 'lang', 'email','name']; +Twitter.whitelistedFields = ['profile_image_url', 'profile_image_url_https', 'lang', 'email',"name"]; OAuth.registerService('twitter', 1, urls, async function(oauthBinding) { const response = await oauthBinding.getAsync('https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true'); From 051d42406de0528915d7f570d6ec80f678ce878b Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Sat, 6 May 2023 11:04:26 +0200 Subject: [PATCH 03/86] Update guide code for GraphQL initialization --- guide/source/apollo.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/guide/source/apollo.md b/guide/source/apollo.md index 5bdbfde4c8..3364cf3a03 100644 --- a/guide/source/apollo.md +++ b/guide/source/apollo.md @@ -73,18 +73,37 @@ meteor add apollo On server you import `getUser` function and include it into the context option when setting up Apollo server: ```javascript -import { ApolloServer } from 'apollo-server-express'; +import { ApolloServer } from '@apollo/server'; +import { WebApp } from 'meteor/webapp'; import { getUser } from 'meteor/apollo'; import typeDefs from '/imports/apollo/schema.graphql'; import { resolvers } from '/server/resolvers'; +import express from 'express'; +import { expressMiddleware } from '@apollo/server/express4'; +import { json } from 'body-parser' + +const context = async ({ req }) => ({ + user: await getUser(req.headers.authorization) +}) const server = new ApolloServer({ + cache: 'bounded', typeDefs, resolvers, - context: async ({ req }) => ({ - user: await getUser(req.headers.authorization) - }) }); + +export async function startApolloServer() { + await server.start(); + + WebApp.connectHandlers.use( + '/graphql', // Configure the path as you want. + express() // Create new Express router. + .disable('etag') // We don't server GET requests, so there's no need for that. + .disable('x-powered-by') // A small safety measure. + .use(json()) // From `body-parser`. + .use(expressMiddleware(server, { context })), // From `@apollo/server/express4`. + ) +} ``` This will make user data available (if user is logged in) as the option in the query: From 9656bd0dbdf7ae97c332fa5e1cc93f1a9bba4f2c Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Sat, 6 May 2023 11:16:18 +0200 Subject: [PATCH 04/86] =?UTF-8?q?Update=20Apollo=20skeleton=20NPM=20depend?= =?UTF-8?q?encies=20=F0=9F=93=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/static-assets/skel-apollo/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/static-assets/skel-apollo/package.json b/tools/static-assets/skel-apollo/package.json index f0b3fcf289..6295d82ae4 100644 --- a/tools/static-assets/skel-apollo/package.json +++ b/tools/static-assets/skel-apollo/package.json @@ -8,10 +8,10 @@ "visualize": "meteor --production --extra-packages bundle-visualizer" }, "dependencies": { - "@apollo/client": "^3.7.5", - "@apollo/server": "^4.3.2", - "@babel/runtime": "^7.20.13", - "body-parser": "^1.20.1", + "@apollo/client": "^3.7.14", + "@apollo/server": "^4.7.1", + "@babel/runtime": "^7.21.5", + "body-parser": "^1.20.2", "express": "^4.18.2", "graphql": "^16.6.0", "meteor-node-stubs": "^1.2.5", From 6704fcbbcb9da498c34e27f1e5f8a70e82504832 Mon Sep 17 00:00:00 2001 From: William Reiske Date: Tue, 9 May 2023 19:57:18 -0700 Subject: [PATCH 05/86] Updated addRule documentation to include setErrorMessageOnRule --- packages/ddp-rate-limiter/ddp-rate-limiter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ddp-rate-limiter/ddp-rate-limiter.js b/packages/ddp-rate-limiter/ddp-rate-limiter.js index c1cb53883e..15922cbe94 100644 --- a/packages/ddp-rate-limiter/ddp-rate-limiter.js +++ b/packages/ddp-rate-limiter/ddp-rate-limiter.js @@ -74,7 +74,7 @@ DDPRateLimiter.setErrorMessageOnRule = (ruleId, message) => { * - `connectionId`: A string representing the user's DDP connection * - `clientAddress`: The IP address of the user * - * Returns unique `ruleId` that can be passed to `removeRule`. + * Returns unique `ruleId` that can be passed to `removeRule` and `setErrorMessageOnRule` * * @param {Object} matcher * Matchers specify which events are counted towards a rate limit. A matcher From 17124042588f144c9c1ea5cf629f7d6bba17c376 Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Mon, 15 May 2023 21:35:26 +0200 Subject: [PATCH 06/86] Update mongo.d.ts with projection Fields have been renamed to projection upstream and while in Meteor we can use both, it was not accounted for in the TS definitions. --- packages/mongo/mongo.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/mongo/mongo.d.ts b/packages/mongo/mongo.d.ts index ab1697aac0..65e9e8a041 100644 --- a/packages/mongo/mongo.d.ts +++ b/packages/mongo/mongo.d.ts @@ -32,6 +32,7 @@ export namespace Mongo { limit?: number | undefined; /** Dictionary of fields to return or exclude. */ fields?: FieldSpecifier | undefined; + projection?: FieldSpecifier | undefined; /** (Server only) Overrides MongoDB's default index selection and query optimization process. Specify an index to force its use, either by its name or index specification. */ hint?: NpmModuleMongodb.Hint | undefined; /** (Client only) Default `true`; pass `false` to disable reactivity */ From 346629330fbbc96b80de6d5656bac69986d7f691 Mon Sep 17 00:00:00 2001 From: Frederico Maia Date: Tue, 16 May 2023 08:18:49 -0300 Subject: [PATCH 07/86] chore: Setting The Viewport meta tag on skeletons --- tools/static-assets/skel-apollo/client/main.html | 1 + tools/static-assets/skel-blaze/client/main.html | 1 + tools/static-assets/skel-chakra-ui/client/main.html | 1 + tools/static-assets/skel-minimal/client/main.html | 1 + tools/static-assets/skel-react/client/main.html | 1 + tools/static-assets/skel-solid/client/main.html | 1 + tools/static-assets/skel-svelte/client/main.html | 1 + tools/static-assets/skel-tailwind/client/main.html | 9 +-------- tools/static-assets/skel-typescript/client/main.html | 1 + tools/static-assets/skel-vue-2/client/main.html | 1 + tools/static-assets/skel-vue/client/main.html | 9 +-------- 11 files changed, 11 insertions(+), 16 deletions(-) diff --git a/tools/static-assets/skel-apollo/client/main.html b/tools/static-assets/skel-apollo/client/main.html index b62c0b83d0..b0e2cf6b26 100644 --- a/tools/static-assets/skel-apollo/client/main.html +++ b/tools/static-assets/skel-apollo/client/main.html @@ -1,5 +1,6 @@ Apollo Skeleton + diff --git a/tools/static-assets/skel-blaze/client/main.html b/tools/static-assets/skel-blaze/client/main.html index 5b2ca5252f..e2f29f3248 100644 --- a/tools/static-assets/skel-blaze/client/main.html +++ b/tools/static-assets/skel-blaze/client/main.html @@ -1,5 +1,6 @@ ~name~ + diff --git a/tools/static-assets/skel-chakra-ui/client/main.html b/tools/static-assets/skel-chakra-ui/client/main.html index 27c3712e54..7c3d674342 100644 --- a/tools/static-assets/skel-chakra-ui/client/main.html +++ b/tools/static-assets/skel-chakra-ui/client/main.html @@ -1,5 +1,6 @@ ~name~ + diff --git a/tools/static-assets/skel-minimal/client/main.html b/tools/static-assets/skel-minimal/client/main.html index 19789db4de..2b017f6baf 100644 --- a/tools/static-assets/skel-minimal/client/main.html +++ b/tools/static-assets/skel-minimal/client/main.html @@ -1,5 +1,6 @@ Minimal Meteor app + diff --git a/tools/static-assets/skel-react/client/main.html b/tools/static-assets/skel-react/client/main.html index 27c3712e54..7c3d674342 100644 --- a/tools/static-assets/skel-react/client/main.html +++ b/tools/static-assets/skel-react/client/main.html @@ -1,5 +1,6 @@ ~name~ + diff --git a/tools/static-assets/skel-solid/client/main.html b/tools/static-assets/skel-solid/client/main.html index f6b88dd21d..11616e533c 100644 --- a/tools/static-assets/skel-solid/client/main.html +++ b/tools/static-assets/skel-solid/client/main.html @@ -1,5 +1,6 @@ ~name~ + diff --git a/tools/static-assets/skel-svelte/client/main.html b/tools/static-assets/skel-svelte/client/main.html index e0e3fddd46..bcad15b78e 100644 --- a/tools/static-assets/skel-svelte/client/main.html +++ b/tools/static-assets/skel-svelte/client/main.html @@ -1,5 +1,6 @@ ~name~ + diff --git a/tools/static-assets/skel-tailwind/client/main.html b/tools/static-assets/skel-tailwind/client/main.html index f8fa758857..c710d3dbd3 100644 --- a/tools/static-assets/skel-tailwind/client/main.html +++ b/tools/static-assets/skel-tailwind/client/main.html @@ -1,13 +1,6 @@ ~name~ - - - - - + diff --git a/tools/static-assets/skel-typescript/client/main.html b/tools/static-assets/skel-typescript/client/main.html index 27c3712e54..7c3d674342 100644 --- a/tools/static-assets/skel-typescript/client/main.html +++ b/tools/static-assets/skel-typescript/client/main.html @@ -1,5 +1,6 @@ ~name~ + diff --git a/tools/static-assets/skel-vue-2/client/main.html b/tools/static-assets/skel-vue-2/client/main.html index 99c3dfb74c..7a78efb67d 100644 --- a/tools/static-assets/skel-vue-2/client/main.html +++ b/tools/static-assets/skel-vue-2/client/main.html @@ -1,5 +1,6 @@ ~name~ + diff --git a/tools/static-assets/skel-vue/client/main.html b/tools/static-assets/skel-vue/client/main.html index 9e2393399c..ca180ae5b9 100644 --- a/tools/static-assets/skel-vue/client/main.html +++ b/tools/static-assets/skel-vue/client/main.html @@ -1,13 +1,6 @@ ~name~ - - - - - + From 98d3979eab961b87c1461d47f2da5f5b4be640c9 Mon Sep 17 00:00:00 2001 From: Frederico Maia Date: Tue, 16 May 2023 08:41:51 -0300 Subject: [PATCH 08/86] Fix solid skeleton --- .../skel-solid/imports/ui/Info.jsx | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/tools/static-assets/skel-solid/imports/ui/Info.jsx b/tools/static-assets/skel-solid/imports/ui/Info.jsx index cf6f585c2e..ef228ac43c 100644 --- a/tools/static-assets/skel-solid/imports/ui/Info.jsx +++ b/tools/static-assets/skel-solid/imports/ui/Info.jsx @@ -1,36 +1,37 @@ import { LinksCollection } from "../api/links"; -import { createSignal, For } from "solid-js"; +import { createSignal, For, Show } from "solid-js"; import { Tracker } from "meteor/tracker"; import { Meteor } from "meteor/meteor"; export const Info = () => { - const loading = Meteor.subscribe("links"); - const [isLoading, setIsLoading] = createSignal(loading.ready()); + const subscription = Meteor.subscribe("links"); + const [isReady, setIsReady] = createSignal(subscription.ready()); const [links, setLinks] = createSignal([]); - Tracker.autorun(() => { - setIsLoading(loading.ready()); - setLinks(LinksCollection.find().fetch()); + Tracker.autorun(async () => { + setIsReady(subscription.ready()); + setLinks(await LinksCollection.find().fetchAsync()); }); - if (isLoading()) { - return
Loading...
; - } - return ( -
-

Learn Meteor!

- -
+ Loading...} + > +
+

Learn Meteor!

+ +
+
); }; From 2f622486ade260249b566258f29cd26348845c48 Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Tue, 16 May 2023 16:06:51 +0200 Subject: [PATCH 09/86] Add @deprecated on fields --- packages/mongo/mongo.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/mongo/mongo.d.ts b/packages/mongo/mongo.d.ts index 65e9e8a041..7b6e9a92bc 100644 --- a/packages/mongo/mongo.d.ts +++ b/packages/mongo/mongo.d.ts @@ -30,8 +30,12 @@ export namespace Mongo { skip?: number | undefined; /** Maximum number of results to return */ limit?: number | undefined; - /** Dictionary of fields to return or exclude. */ + /** + * Dictionary of fields to return or exclude. + * @deprecated use projection instead + */ fields?: FieldSpecifier | undefined; + /** Dictionary of fields to return or exclude. */ projection?: FieldSpecifier | undefined; /** (Server only) Overrides MongoDB's default index selection and query optimization process. Specify an index to force its use, either by its name or index specification. */ hint?: NpmModuleMongodb.Hint | undefined; From fe5c7dcf01b5c99322544275141e1d6feb7f868b Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Tue, 16 May 2023 16:07:23 +0200 Subject: [PATCH 10/86] Fields to projections in oplog tailing --- packages/mongo/oplog_tailing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mongo/oplog_tailing.js b/packages/mongo/oplog_tailing.js index fc702318db..e1d0933ab5 100644 --- a/packages/mongo/oplog_tailing.js +++ b/packages/mongo/oplog_tailing.js @@ -146,7 +146,7 @@ Object.assign(OplogHandle.prototype, { try { lastEntry = self._oplogLastEntryConnection.findOne( OPLOG_COLLECTION, self._baseOplogSelector, - {fields: {ts: 1}, sort: {$natural: -1}}); + {projection: {ts: 1}, sort: {$natural: -1}}); break; } catch (e) { // During failover (eg) if we get an exception we should log and retry @@ -229,7 +229,7 @@ Object.assign(OplogHandle.prototype, { // Find the last oplog entry. var lastOplogEntry = self._oplogLastEntryConnection.findOne( - OPLOG_COLLECTION, {}, {sort: {$natural: -1}, fields: {ts: 1}}); + OPLOG_COLLECTION, {}, {sort: {$natural: -1}, projection: {ts: 1}}); var oplogSelector = _.clone(self._baseOplogSelector); if (lastOplogEntry) { From eb2bd2e6941f353de8a99bc3bea9c8e4c432ebda Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Wed, 17 May 2023 14:17:27 -0300 Subject: [PATCH 11/86] chore: updating mongo types --- packages/mongo/mongo.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mongo/mongo.d.ts b/packages/mongo/mongo.d.ts index ab1697aac0..5a2ed8080a 100644 --- a/packages/mongo/mongo.d.ts +++ b/packages/mongo/mongo.d.ts @@ -176,12 +176,12 @@ export namespace Mongo { * @param selector The query for filtering the set of documents to count * @param options All options are listed in [MongoDB documentation](https://mongodb.github.io/node-mongodb-native/4.11/interfaces/CountDocumentsOptions.html). Please note that not all of them are available on the client. */ - countDocuments(selector?: Selector | ObjectID | string, options?: MongoNpmModule.CountDocumentsOptions): Promise; + countDocuments(selector?: Selector | ObjectID | string, options?: NpmModuleMongodb.CountDocumentsOptions): Promise; /** * Gets an estimate of the count of documents in a collection using collection metadata. For an exact count of the documents in a collection see `countDocuments`. * @param options All options are listed in [MongoDB documentation](https://mongodb.github.io/node-mongodb-native/4.11/interfaces/CountDocumentsOptions.html). Please note that not all of them are available on the client. */ - estimatedDocumentCount(options?: MongoNpmModule.EstimatedDocumentCountOptions): Promise; + estimatedDocumentCount(options?: NpmModuleMongodb.EstimatedDocumentCountOptions): Promise; /** * Insert a document in the collection. Returns its unique _id. * @param doc The document to insert. May not yet have an _id attribute, in which case Meteor will generate one for you. From 43aa4782537a2226eda552363b5c4cb697b08207 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Wed, 17 May 2023 15:06:05 -0300 Subject: [PATCH 12/86] fix: fixing upsert warning when using upsertAsync --- packages/mongo/collection.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/mongo/collection.js b/packages/mongo/collection.js index c432cbcdad..d25477b46e 100644 --- a/packages/mongo/collection.js +++ b/packages/mongo/collection.js @@ -803,8 +803,9 @@ Object.assign(Mongo.Collection.prototype, { this._name, this.upsert.isCalledFromAsync ); - this.upsert.isCalledFromAsync = false; // will not trigger warning in `update` - + this.upsert.isCalledFromAsync = false; + // caught here https://github.com/meteor/meteor/issues/12626 + this.update.isCalledFromAsync = true; // to not trigger on the next call return this.update( selector, modifier, From 59d5cd3cf85df1d2c4dc722c080634503cccd91c Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Wed, 17 May 2023 15:06:19 -0300 Subject: [PATCH 13/86] tests: added upsertAsync to test --- packages/mongo/collection_tests.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/mongo/collection_tests.js b/packages/mongo/collection_tests.js index c38e6a617a..6d2b835332 100644 --- a/packages/mongo/collection_tests.js +++ b/packages/mongo/collection_tests.js @@ -449,8 +449,9 @@ Tinytest.addAsync('collection - should not block on cursor mismatch (#12516)', Meteor.isServer && Tinytest.addAsync('collection - simple add', async function(test){ var collectionName = 'add' + test.id; var collection = new Mongo.Collection(collectionName); - var id = await collection.insert({a: 1}); + var id = await collection.insertAsync({a: 1}); test.equal((await collection.findOneAsync(id)).a, 1); + collection.upsertAsync(id, {$set: {a: 2}}); id = await collection.insertAsync({a: 2}); test.equal((await collection.findOneAsync(id)).a, 2); await collection.removeAsync({}); From 6fd3906bc04c34d676ff38b94178c5fbb7a5d966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Miernik?= Date: Fri, 19 May 2023 13:19:47 +0200 Subject: [PATCH 14/86] Handled implicit collection creation oplog message (fixes #12627). --- packages/mongo/oplog_tailing.js | 3 +++ packages/mongo/oplog_tests.js | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/mongo/oplog_tailing.js b/packages/mongo/oplog_tailing.js index fc702318db..4b76e69c9e 100644 --- a/packages/mongo/oplog_tailing.js +++ b/packages/mongo/oplog_tailing.js @@ -308,6 +308,9 @@ Object.assign(OplogHandle.prototype, { trigger.collection = doc.o.drop; trigger.dropCollection = true; trigger.id = null; + } else if ("create" in doc.o && "idIndex" in doc.o) { + // A collection got implicitly created within a transaction. There's + // no need to do anything about it. } else { throw Error("Unknown command " + EJSON.stringify(doc)); } diff --git a/packages/mongo/oplog_tests.js b/packages/mongo/oplog_tests.js index bb3374f8fb..d96c72aa05 100644 --- a/packages/mongo/oplog_tests.js +++ b/packages/mongo/oplog_tests.js @@ -164,6 +164,21 @@ process.env.MONGO_OPLOG_URL && testAsyncMulti( ] ); +import { Mongo, MongoInternals } from 'meteor/mongo'; +process.env.MONGO_OPLOG_URL && Tinytest.addAsync( + 'mongo-livedata - oplog - x - implicit collection creation', + async test => { + const collection = new Mongo.Collection(`oplog-implicit-${test.runId()}`); + const { client } = MongoInternals.defaultRemoteCollectionDriver().mongo; + test.equal(await collection.find().countAsync(), 0); + await client.withSession(async session => { + await session.withTransaction(async () => { + await collection.rawCollection().insertOne({}, { session }); + }); + }); + test.equal(await collection.find().countAsync(), 1); + }, +); // Meteor.isServer && Tinytest.addAsync( // "mongo-livedata - oplog - _onFailover", From ca055dea6c10d0900cebf662e8aeefd5d79dce0f Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Fri, 19 May 2023 14:16:02 +0100 Subject: [PATCH 15/86] fix: add `Meteor.applyAsync` typings --- packages/meteor/meteor.d.ts | 74 +++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/packages/meteor/meteor.d.ts b/packages/meteor/meteor.d.ts index f47722eb15..8ebc07618b 100644 --- a/packages/meteor/meteor.d.ts +++ b/packages/meteor/meteor.d.ts @@ -159,6 +159,41 @@ export namespace Meteor { */ function callAsync(name: string, ...args: any[]): Promise; + interface MethodApplyOptions { + /** + * (Client only) If true, don't send this method until all previous method calls have completed, and don't send any subsequent method calls until this one is completed. + */ + wait?: boolean | undefined; + /** + * (Client only) This callback is invoked with the error or result of the method (just like `asyncCallback`) as soon as the error or result is available. The local cache may not yet reflect the writes performed by the method. + */ + onResultReceived?: + | (( + error: global_Error | Meteor.Error | undefined, + result?: Result + ) => void) + | undefined; + /** + * (Client only) if true, don't send this method again on reload, simply call the callback an error with the error code 'invocation-failed'. + */ + noRetry?: boolean | undefined; + /** + * (Client only) If true then in cases where we would have otherwise discarded the stub's return value and returned undefined, instead we go ahead and return it. Specifically, this is any time other than when (a) we are already inside a stub or (b) we are in Node and no callback was provided. Currently we require this flag to be explicitly passed to reduce the likelihood that stub return values will be confused with server return values; we may improve this in future. + */ + returnStubValue?: boolean | undefined; + /** + * (Client only) If true, exceptions thrown by method stubs will be thrown instead of logged, and the method will not be invoked on the server. + */ + throwStubExceptions?: boolean | undefined; + } + + /** + * Invokes a method with a sync stub, passing any number of arguments. + * @param name Name of method to invoke + * @param args Method arguments + * @param options Optional execution options + * @param asyncCallback Optional callback + */ function apply< Result extends | EJSONable @@ -168,26 +203,35 @@ export namespace Meteor { >( name: string, args: ReadonlyArray, - options?: { - wait?: boolean | undefined; - onResultReceived?: - | (( - error: global_Error | Meteor.Error | undefined, - result?: Result - ) => void) - | undefined; - /** - * (Client only) if true, don't send this method again on reload, simply call the callback an error with the error code 'invocation-failed'. - */ - noRetry?: boolean | undefined; - returnStubValue?: boolean | undefined; - throwStubExceptions?: boolean | undefined; - }, + options?: MethodApplyOptions, asyncCallback?: ( error: global_Error | Meteor.Error | undefined, result?: Result ) => void ): any; + + /** + * Invokes a method with an async stub, passing any number of arguments. + * @param name Name of method to invoke + * @param args Method arguments + * @param options Optional execution options + * @param asyncCallback Optional callback + */ + function applyAsync< + Result extends + | EJSONable + | EJSONable[] + | EJSONableProperty + | EJSONableProperty[] + >( + name: string, + args: ReadonlyArray, + options?: MethodApplyOptions, + asyncCallback?: ( + error: global_Error | Meteor.Error | undefined, + result?: Result + ) => void + ): Promise; /** Method **/ /** Url **/ From 9ed457e55d54d2dcb300498f889427ef0a26ded5 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 23 May 2023 15:00:27 -0300 Subject: [PATCH 16/86] updating meteor with latest blaze version --- packages/non-core/blaze | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/non-core/blaze b/packages/non-core/blaze index 225ded2701..6ba5ed7b0a 160000 --- a/packages/non-core/blaze +++ b/packages/non-core/blaze @@ -1 +1 @@ -Subproject commit 225ded27011815ad220cd0308289b44ad855ce1f +Subproject commit 6ba5ed7b0a1a4125b0318dc09a4d2cfebf354c32 From 831405582821069e25dacfc0cd456f24b1856c72 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 23 May 2023 15:23:00 -0300 Subject: [PATCH 17/86] Release Meteor 2 13 beta and RC [sc-819] --- docs/generators/changelog/versions/2.12.md | 32 +++++++++++----------- docs/generators/changelog/versions/2.13.md | 25 +++++++++++++++++ 2 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 docs/generators/changelog/versions/2.13.md diff --git a/docs/generators/changelog/versions/2.12.md b/docs/generators/changelog/versions/2.12.md index ae4b5709c0..35735edd74 100644 --- a/docs/generators/changelog/versions/2.12.md +++ b/docs/generators/changelog/versions/2.12.md @@ -44,22 +44,22 @@ you can use ```WARN_WHEN_USING_OLD_API``` before starting your meteor process. and in the [related issue](https://github.com/meteor/meteor-feature-requests/issues/20). - `onCreateUserHook` now accept promises and wait if necessary. -* `babel-compiler@get-version`: +* `babel-compiler@7.10.4`: - Added `es5` compatible syntax. -* `browser-policy-content@get-version`: +* `browser-policy-content@1.1.2`: - Added `es5` compatible syntax. -* `browser-policy-framing@get-version`: +* `browser-policy-framing@1.1.2`: - Added `es5` compatible syntax. -* `browser-policy@get-version`: +* `browser-policy@1.1.2`: - Updated test name. -* `callback-hook@get-version`: +* `callback-hook@1.5.1`: - Added async hooks possibility to make async migrations easier. -* `context@get-version`: +* `context@0.5.1`: - Added `es5` compatible syntax. * `ddp-rate-limiter@1.2.0`: @@ -68,22 +68,22 @@ you can use ```WARN_WHEN_USING_OLD_API``` before starting your meteor process. * `ddp-server@2.6.1`: - Updated sockjs version. -* `dev-error-overlay@get-version`: +* `dev-error-overlay@0.1.2`: - Added `es5` compatible syntax by adding the `ecmascript` package. -* `dynamic-import@get-version`: +* `dynamic-import@0.7.3`: - Added `es5` compatible syntax. -* `ecmascript@get-version`: +* `ecmascript@0.16.7`: - Updated tests location. -* `ecmascript-runtime@get-version`: +* `ecmascript-runtime@0.8.1`: - Updated npm dependencies. * `email@2.2.5`: - Updated type `CustomEmailOptions` to be a type instead of an interface. -* `hot-module-replacement@get-version`: +* `hot-module-replacement@0.5.3`: - Added `es5` compatible syntax. @@ -94,10 +94,10 @@ you can use ```WARN_WHEN_USING_OLD_API``` before starting your meteor process. * `minifier-css@1.6.4`: - Bump NPM versions for css minifiers. -* `minimongo@get-version`: +* `minimongo@1.9.3`: - Updated to be able to track old api usage. -* `modules-runtime-hot@get-version`: +* `modules-runtime-hot@0.14.2`: - Added `es5` compatible syntax. * `mongo@1.16.6`: @@ -116,7 +116,7 @@ you can use ```WARN_WHEN_USING_OLD_API``` before starting your meteor process. * `rate-limit@1.1.1`: - Added `ruleId` property that will be used for setting messages. -* `react-fast-refresh@get-version`: +* `react-fast-refresh@0.2.7`: - Added `es5` compatible syntax. * `socket-stream-client@0.5.0`: @@ -125,10 +125,10 @@ you can use ```WARN_WHEN_USING_OLD_API``` before starting your meteor process. * `standard-minifier-css@1.9.2`: - Bump NPM versions for css minifiers. -* `tracker@get-version`: +* `tracker@1.3.2`: - Updated types and updated JSDocs for `Tracker.withComputation`. -* `underscore@get-version`: +* `underscore@1.0.13`: - Updated npm dependencies. * `webapp@1.13.5`: diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md new file mode 100644 index 0000000000..20b4af9119 --- /dev/null +++ b/docs/generators/changelog/versions/2.13.md @@ -0,0 +1,25 @@ +## v2.13.0, 2023-05-XX + +### Highlights + +#### Breaking Changes + +N/A + +#### Internal API changes + +N/A + +#### Migration Steps + +TODO + +#### Meteor Version Release + + +* `Command line`: + - Corrected typo in XX XX + +* `npm mongo @4.13.0`: // You can use @get-version to get the version of the package + - Updated MongoDB driver to version 4.13.0 + From 17f80b77d63a4313a221bf470837ffa4f1eb7ae2 Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Thu, 25 May 2023 17:23:51 +0200 Subject: [PATCH 18/86] Replace deprecated reference with current one --- packages/mongo/collection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mongo/collection.js b/packages/mongo/collection.js index c432cbcdad..a2bb0ec16a 100644 --- a/packages/mongo/collection.js +++ b/packages/mongo/collection.js @@ -891,7 +891,7 @@ Object.assign(Mongo.Collection.prototype, { throw new Error( 'Can only call _createCappedCollection on server collections' ); - + // [FIBERS] // TODO: Remove this when 3.0 is released. warnUsingOldApi( @@ -979,7 +979,7 @@ Mongo.Collection.ObjectID = Mongo.ObjectID; Meteor.Collection = Mongo.Collection; // Allow deny stuff is now in the allow-deny package -Object.assign(Meteor.Collection.prototype, AllowDeny.CollectionPrototype); +Object.assign(Mongo.Collection.prototype, AllowDeny.CollectionPrototype); function popCallbackFromArgs(args) { // Pull off any callback (or perhaps a 'callback' variable that was passed From 70260c40e040cc86a66a9a1d7c32410487fa4aa0 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 25 May 2023 13:29:59 -0300 Subject: [PATCH 19/86] docs: started working in meteor release --- docs/generators/changelog/versions/2.13.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index 20b4af9119..ad82ec1ce8 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -2,6 +2,15 @@ ### Highlights +* Handled implicit collection creation oplog message by [GH radekmie] [PR #12643]. +* Fix upsert logs when using WARN_WHEN_USING_OLD_API flag by [GH Grubba27] [PR #12640]. +* Updating mongo types by [GH Grubba27] [PR #12639]. +* Fix solid skeleton by [GH fredmaiaarantes] [PR #12637]. +* Setting The Viewport meta tag on skeletons [GH fredmaiaarantes] [PR #12636]. +* Update mongo.d.ts with projection [GH StorytellerCZ] [PR #12635]. +* Update guide code for GraphQL [GH StorytellerCZ] [PR #12619]. +* Twitter Whitelist issue resolved [GH Atharshoyeb] [PR #12369]. + #### Breaking Changes N/A @@ -18,8 +27,8 @@ TODO * `Command line`: - - Corrected typo in XX XX - -* `npm mongo @4.13.0`: // You can use @get-version to get the version of the package - - Updated MongoDB driver to version 4.13.0 + - Updated metatags for skeletons. + - Updated solidjs skeleton to be more idiomatic. +* `mongo@get-version`: + TODO From 184ebac7f96faf7d4cad9e6245c0df2881b9912a Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 25 May 2023 13:30:17 -0300 Subject: [PATCH 20/86] chore: update meteor packages.js --- packages/meteor-tool/package.js | 2 +- packages/mongo/package.js | 2 +- packages/twitter-oauth/package.js | 2 +- scripts/admin/meteor-release-experimental.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/meteor-tool/package.js b/packages/meteor-tool/package.js index cdcd31f2e3..7671778d8f 100644 --- a/packages/meteor-tool/package.js +++ b/packages/meteor-tool/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'The Meteor command-line tool', - version: '2.12.0', + version: '2.12.0-beta.0', }); Package.includeTool(); diff --git a/packages/mongo/package.js b/packages/mongo/package.js index 4418e20309..563d7a17c1 100644 --- a/packages/mongo/package.js +++ b/packages/mongo/package.js @@ -9,7 +9,7 @@ Package.describe({ summary: "Adaptor for using MongoDB and Minimongo over DDP", - version: '1.16.6', + version: '1.16.7-beta2130.0', }); Npm.depends({ diff --git a/packages/twitter-oauth/package.js b/packages/twitter-oauth/package.js index 62d7646ca8..3bdd6298ed 100644 --- a/packages/twitter-oauth/package.js +++ b/packages/twitter-oauth/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Twitter OAuth flow", - version: '1.3.2' + version: '1.3.3-beta2130.0' }); Package.onUse(function(api) { diff --git a/scripts/admin/meteor-release-experimental.json b/scripts/admin/meteor-release-experimental.json index 2cd74b65fd..bb4513581a 100644 --- a/scripts/admin/meteor-release-experimental.json +++ b/scripts/admin/meteor-release-experimental.json @@ -1,6 +1,6 @@ { "track": "METEOR", - "version": "2.12-rc.0", + "version": "2.13-beta.0", "recommended": false, "official": false, "description": "Meteor experimental release" From 1d4aa133de2f29571f9962f97540207badffbbd0 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 25 May 2023 15:30:47 -0300 Subject: [PATCH 21/86] updated runner to show ALL errors --- packages/test-in-console/puppeteerRunner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/test-in-console/puppeteerRunner.js b/packages/test-in-console/puppeteerRunner.js index c6509bd93d..e96e847c47 100644 --- a/packages/test-in-console/puppeteerRunner.js +++ b/packages/test-in-console/puppeteerRunner.js @@ -29,7 +29,7 @@ async function runNextUrl(browser) { to run more than once. in the console. Test number total: ${ testNumber }`); console.log(`Tests complete with ${ failCount } failures`); console.log(`Tests complete with ${ await getPassCount(page) } passes`); - if (failCount > 0) { + if (failCount >= 0) { const failed = await getFailed(page); failed.map((f) => console.log(`${ f.name } failed: ${ f.info }`)); await page.close(); From 619b52b5fd874f2dd4590d7257a2bac90458bf38 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 25 May 2023 16:52:20 -0300 Subject: [PATCH 22/86] adjusted spacing --- packages/test-in-console/puppeteerRunner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/test-in-console/puppeteerRunner.js b/packages/test-in-console/puppeteerRunner.js index e96e847c47..bdff436e5b 100644 --- a/packages/test-in-console/puppeteerRunner.js +++ b/packages/test-in-console/puppeteerRunner.js @@ -26,7 +26,7 @@ async function runNextUrl(browser) { console.log(` The number of tests from Test number may be different because of the way the test is written. causing the test to fail or - to run more than once. in the console. Test number total: ${ testNumber }`); + to run more than once. in the console. Test number total: ${ testNumber }`); console.log(`Tests complete with ${ failCount } failures`); console.log(`Tests complete with ${ await getPassCount(page) } passes`); if (failCount >= 0) { From b690c73822fdb6333810f767b301a2b0c2d0e843 Mon Sep 17 00:00:00 2001 From: Yurii Synyshyn Date: Tue, 30 May 2023 14:32:03 +0300 Subject: [PATCH 23/86] fix #12642, #12628 https://jira.mongodb.org/browse/NODE-5316 --- packages/mongo/mongo_driver.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/mongo/mongo_driver.js b/packages/mongo/mongo_driver.js index f4e95a672c..f3be28c466 100644 --- a/packages/mongo/mongo_driver.js +++ b/packages/mongo/mongo_driver.js @@ -210,6 +210,7 @@ MongoConnection = function (url, options) { self._oplogHandle = new OplogHandle(options.oplogUrl, self.db.databaseName); self._docFetcher = new DocFetcher(self); } + Promise.await(self.client.connect()) }; MongoConnection.prototype.close = function() { From 33932b680a7e82e86955fb0dc5093574999c371a Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 13:54:16 -0300 Subject: [PATCH 24/86] tests: added log and updated on livedata server - async publish object --- packages/ddp-server/livedata_server_async_tests.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/ddp-server/livedata_server_async_tests.js b/packages/ddp-server/livedata_server_async_tests.js index d145aeee92..83b029debd 100644 --- a/packages/ddp-server/livedata_server_async_tests.js +++ b/packages/ddp-server/livedata_server_async_tests.js @@ -99,7 +99,7 @@ Meteor.publish({ async publicationObjectAsync() { await sleep(50); let callback = onSubscriptions; - if (callback) callback(); + if (callback) callback("publicationObjectAsync"); this.stop(); }, }); @@ -108,7 +108,7 @@ Meteor.publish({ publication_object_async: async function() { await sleep(50); let callback = onSubscriptions; - if (callback) callback(); + if (callback) callback("publication_object_async"); this.stop(); }, }); @@ -116,7 +116,7 @@ Meteor.publish({ Meteor.publish('publication_compatibility_async', async function() { await sleep(50); let callback = onSubscriptions; - if (callback) callback(); + if (callback) callback("publication_compatibility_async"); this.stop(); }); @@ -128,10 +128,12 @@ Tinytest.addAsync('livedata server - async publish object', function( let testsLength = 0; onSubscriptions = function(subscription) { - delete onSubscriptions; - clientConn.disconnect(); + // for debugging + // console.log('subscription is ok:', subscription) testsLength++; - if (testsLength == 3) { + delete onSubscriptions; + if (testsLength === 3) { + clientConn.disconnect(); onComplete(); } }; From 9f1e0c600c7f8df56afa123c519699e3b186dbd0 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 13:54:35 -0300 Subject: [PATCH 25/86] ci: updated failed default values --- packages/test-in-console/driver.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/test-in-console/driver.js b/packages/test-in-console/driver.js index 7b8711ad75..95904e20c5 100644 --- a/packages/test-in-console/driver.js +++ b/packages/test-in-console/driver.js @@ -1,7 +1,7 @@ // Global flag for phantomjs (or other browser) to eval to see if we're done. DONE = false; // Failure count for phantomjs exit code -FAILURES = null; +FAILURES = 0; // Where are the failures WHERE_FAILED = []; // Passed count for phantomjs exit code @@ -9,7 +9,7 @@ PASSED = null; TEST_STATUS = { DONE: false, - FAILURES: null, + FAILURES: 0, PASSED: null, WHERE_FAILED: [] }; @@ -149,6 +149,7 @@ runTests = function () { else log("Test failed with exception"); failed++; + whereFailed.push({ name: name, info: JSON.stringify(event) }); break; case "finish": switch (resultSet[name].status) { From 44d8680be2de5aa96bcc871671d0f0cd391b0a4b Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 13:54:48 -0300 Subject: [PATCH 26/86] ci: updated again test reporter --- packages/test-in-console/puppeteerRunner.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/test-in-console/puppeteerRunner.js b/packages/test-in-console/puppeteerRunner.js index bdff436e5b..f4735106c1 100644 --- a/packages/test-in-console/puppeteerRunner.js +++ b/packages/test-in-console/puppeteerRunner.js @@ -29,7 +29,7 @@ async function runNextUrl(browser) { to run more than once. in the console. Test number total: ${ testNumber }`); console.log(`Tests complete with ${ failCount } failures`); console.log(`Tests complete with ${ await getPassCount(page) } passes`); - if (failCount >= 0) { + if (failCount > 0) { const failed = await getFailed(page); failed.map((f) => console.log(`${ f.name } failed: ${ f.info }`)); await page.close(); @@ -89,11 +89,7 @@ async function getFailCount(page) { return TEST_STATUS.FAILURES; } - if (typeof FAILURES === 'undefined') { - return 1; - } - - return 0; + return typeof FAILURES !== 'undefined' && FAILURES; }); } From dc9f41b5f9fc851a0dd039f3b3394260e1420925 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 15:08:10 -0300 Subject: [PATCH 27/86] updated to latest --- packages/non-core/blaze | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/non-core/blaze b/packages/non-core/blaze index 6ba5ed7b0a..34b8f891ef 160000 --- a/packages/non-core/blaze +++ b/packages/non-core/blaze @@ -1 +1 @@ -Subproject commit 6ba5ed7b0a1a4125b0318dc09a4d2cfebf354c32 +Subproject commit 34b8f891efd9343c15c1dfc03b3e2bfbc1d8c119 From 2bf1f85706808116816745eb29512953acba29a5 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 18:01:54 -0300 Subject: [PATCH 28/86] ci: added 2.13 into docs --- docs/_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_config.yml b/docs/_config.yml index 5dbbd961c0..d8706c14f7 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,6 +1,7 @@ title: Meteor API Docs subtitle: API Docs versions: + - '2.13' - '2.12' - '2.11' - '2.10' From 1ac7659aca6b2d7596816a8cf627aa442c801472 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 18:01:59 -0300 Subject: [PATCH 29/86] ci: added 2.13 into guide --- guide/_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/guide/_config.yml b/guide/_config.yml index 9bf7c889bc..c7f339d4bc 100644 --- a/guide/_config.yml +++ b/guide/_config.yml @@ -5,6 +5,7 @@ edit_branch: 'devel' edit_path: 'guide' content_root: 'content' versions: + - '2.13' - '2.12' - '2.11' - '2.10' From 81cb744e33ba7c2986cf4680195ebea72f99e301 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 18:02:13 -0300 Subject: [PATCH 30/86] docs: started 2.13 migration guide --- guide/source/2.13-migration.md | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 guide/source/2.13-migration.md diff --git a/guide/source/2.13-migration.md b/guide/source/2.13-migration.md new file mode 100644 index 0000000000..c9f43f0305 --- /dev/null +++ b/guide/source/2.13-migration.md @@ -0,0 +1,46 @@ +--- +title: Migrating to Meteor 2.13 +description: How to migrate your application to Meteor 2.13. +--- + +Most of the new features in Meteor 2.13 are either applied directly behind the +scenes (in a backwards compatible manner) or are opt-in. For a complete +breakdown of the changes, please refer to the [changelog](http://docs.meteor.com/changelog.html). + +The above being said, there are a few items that you should implement to +have easier time in the future. + +TODO + +

Migrating from a version older than 2.12?

+ +If you're migrating from a version of Meteor older than Meteor 2.12, there may +be important considerations not listed in this guide. + Please review the older migration guides for details: + +* [Migrating to Meteor 2.12](2.12-migration.html) (from 2.11) +* [Migrating to Meteor 2.11](2.11-migration.html) (from 2.10) +* [Migrating to Meteor 2.10](2.10-migration.html) (from 2.9) +* [Migrating to Meteor 2.9](2.9-migration.html) (from 2.8) +* [Migrating to Meteor 2.8](2.8-migration.html) (from 2.7) +* [Migrating to Meteor 2.7](2.7-migration.html) (from 2.6) +* [Migrating to Meteor 2.6](2.6-migration.html) (from 2.5) +* [Migrating to Meteor 2.5](2.5-migration.html) (from 2.4) +* [Migrating to Meteor 2.4](2.4-migration.html) (from 2.3) +* [Migrating to Meteor 2.3](2.3-migration.html) (from 2.2) +* [Migrating to Meteor 2.2](2.2-migration.html) (from 2.0) +* [Migrating to Meteor 2.0](2.0-migration.html) (from 1.12) +* [Migrating to Meteor 1.12](1.12-migration.html) (from 1.11) +* [Migrating to Meteor 1.11](1.11-migration.html) (from 1.10.2) +* [Migrating to Meteor 1.10.2](1.10.2-migration.html) (from 1.10) +* [Migrating to Meteor 1.10](1.10-migration.html) (from 1.9.3) +* [Migrating to Meteor 1.9.3](1.9.3-migration.html) (from 1.9) +* [Migrating to Meteor 1.9](1.9-migration.html) (from 1.8.3) +* [Migrating to Meteor 1.8.3](1.8.3-migration.html) (from 1.8.2) +* [Migrating to Meteor 1.8.2](1.8.2-migration.html) (from 1.8) +* [Migrating to Meteor 1.8](1.8-migration.html) (from 1.7) +* [Migrating to Meteor 1.7](1.7-migration.html) (from 1.6) +* [Migrating to Meteor 1.6](1.6-migration.html) (from 1.5) +* [Migrating to Meteor 1.5](1.5-migration.html) (from 1.4) +* [Migrating to Meteor 1.4](1.4-migration.html) (from 1.3) +* [Migrating to Meteor 1.3](1.3-migration.html) (from 1.2) From fc5a0865bd46c6a927bafff6390c149684181e94 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 18:08:39 -0300 Subject: [PATCH 31/86] chore: bumped ddp-server package.js --- packages/ddp-server/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ddp-server/package.js b/packages/ddp-server/package.js index f696ac7f31..0702679d0c 100644 --- a/packages/ddp-server/package.js +++ b/packages/ddp-server/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Meteor's latency-compensated distributed data server", - version: '2.6.1', + version: '2.6.2-beta2130.0', documentation: null }); From 90266d2475af98ec458a679d4a2d7afb6de72318 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 18:08:57 -0300 Subject: [PATCH 32/86] :rocket: meteor 2.13-beta.0 --- packages/test-in-console/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/test-in-console/package.js b/packages/test-in-console/package.js index 9c35fa72cc..39924cecef 100644 --- a/packages/test-in-console/package.js +++ b/packages/test-in-console/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'Run tests noninteractively, with results going to the console.', - version: '1.2.4' + version: '1.2.5-beta2130.0', }); Package.onUse(function(api) { From 7d89f45233fe83f80ee5c4779ccf2a44f506505b Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 18:20:55 -0300 Subject: [PATCH 33/86] Revert ":rocket: meteor 2.13-beta.0" This reverts commit 90266d2475af98ec458a679d4a2d7afb6de72318. --- packages/test-in-console/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/test-in-console/package.js b/packages/test-in-console/package.js index 39924cecef..9c35fa72cc 100644 --- a/packages/test-in-console/package.js +++ b/packages/test-in-console/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'Run tests noninteractively, with results going to the console.', - version: '1.2.5-beta2130.0', + version: '1.2.4' }); Package.onUse(function(api) { From 348b5fb02ed10566097f0877dbf47abc020c1dca Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 18:21:42 -0300 Subject: [PATCH 34/86] =?UTF-8?q?Meteor=20version=20to=202.13-beta.0=C2=A0?= =?UTF-8?q?:comet:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/test-in-console/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/test-in-console/package.js b/packages/test-in-console/package.js index 9c35fa72cc..39924cecef 100644 --- a/packages/test-in-console/package.js +++ b/packages/test-in-console/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'Run tests noninteractively, with results going to the console.', - version: '1.2.4' + version: '1.2.5-beta2130.0', }); Package.onUse(function(api) { From 77fd2e93aed73b007e1c3d8edbe256cf423d7fa5 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 30 May 2023 18:25:13 -0300 Subject: [PATCH 35/86] Meteor version to 2.13-beta.0 :comet: --- packages/meteor-tool/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/meteor-tool/package.js b/packages/meteor-tool/package.js index 7671778d8f..b98455c8d5 100644 --- a/packages/meteor-tool/package.js +++ b/packages/meteor-tool/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'The Meteor command-line tool', - version: '2.12.0-beta.0', + version: '2.13.0-beta.0', }); Package.includeTool(); From 5fa8e4f721d49483e71fd7f77ee3b515650517d2 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 1 Jun 2023 09:53:03 -0300 Subject: [PATCH 36/86] ci: pinned puppeter version --- packages/test-in-console/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/test-in-console/run.sh b/packages/test-in-console/run.sh index 8b2aa13623..7c804ef27b 100755 --- a/packages/test-in-console/run.sh +++ b/packages/test-in-console/run.sh @@ -17,7 +17,7 @@ then ./meteor npm install -g phantomjs-prebuilt browserstack-webdriver else # Installs into dev_bundle/lib/node_modules/puppeteer. - ./meteor npm install -g puppeteer + ./meteor npm install -g puppeteer@20.4.0 fi export PATH=$METEOR_HOME:$PATH From 1fcd1d7c816faeac4e151decfe68b7c2a26856d8 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 1 Jun 2023 13:39:17 -0300 Subject: [PATCH 37/86] =?UTF-8?q?Meteor=20version=20to=202.13-rc.0=C2=A0:c?= =?UTF-8?q?omet:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ddp-server/package.js | 2 +- packages/meteor-tool/package.js | 2 +- packages/meteor/package.js | 2 +- packages/mongo/package.js | 2 +- packages/test-in-console/package.js | 2 +- packages/twitter-oauth/package.js | 2 +- scripts/admin/meteor-release-experimental.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/ddp-server/package.js b/packages/ddp-server/package.js index 0702679d0c..a0399c73ba 100644 --- a/packages/ddp-server/package.js +++ b/packages/ddp-server/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Meteor's latency-compensated distributed data server", - version: '2.6.2-beta2130.0', + version: '2.6.2-rc2130.0', documentation: null }); diff --git a/packages/meteor-tool/package.js b/packages/meteor-tool/package.js index b98455c8d5..b0012747e8 100644 --- a/packages/meteor-tool/package.js +++ b/packages/meteor-tool/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'The Meteor command-line tool', - version: '2.13.0-beta.0', + version: '2.13.0-rc.0', }); Package.includeTool(); diff --git a/packages/meteor/package.js b/packages/meteor/package.js index bc067d810b..2f790e156f 100644 --- a/packages/meteor/package.js +++ b/packages/meteor/package.js @@ -2,7 +2,7 @@ Package.describe({ summary: "Core Meteor environment", - version: '1.11.2', + version: '1.11.3-rc2130.0', }); Package.registerBuildPlugin({ diff --git a/packages/mongo/package.js b/packages/mongo/package.js index 563d7a17c1..dfdabfebad 100644 --- a/packages/mongo/package.js +++ b/packages/mongo/package.js @@ -9,7 +9,7 @@ Package.describe({ summary: "Adaptor for using MongoDB and Minimongo over DDP", - version: '1.16.7-beta2130.0', + version: '1.16.7-rc2130.0', }); Npm.depends({ diff --git a/packages/test-in-console/package.js b/packages/test-in-console/package.js index 39924cecef..fb5c686910 100644 --- a/packages/test-in-console/package.js +++ b/packages/test-in-console/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'Run tests noninteractively, with results going to the console.', - version: '1.2.5-beta2130.0', + version: '1.2.5-rc2130.0', }); Package.onUse(function(api) { diff --git a/packages/twitter-oauth/package.js b/packages/twitter-oauth/package.js index 3bdd6298ed..186f818e07 100644 --- a/packages/twitter-oauth/package.js +++ b/packages/twitter-oauth/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Twitter OAuth flow", - version: '1.3.3-beta2130.0' + version: '1.3.3-rc2130.0' }); Package.onUse(function(api) { diff --git a/scripts/admin/meteor-release-experimental.json b/scripts/admin/meteor-release-experimental.json index bb4513581a..d1f6ce2ea0 100644 --- a/scripts/admin/meteor-release-experimental.json +++ b/scripts/admin/meteor-release-experimental.json @@ -1,6 +1,6 @@ { "track": "METEOR", - "version": "2.13-beta.0", + "version": "2.13-rc.0", "recommended": false, "official": false, "description": "Meteor experimental release" From e82047a6609faca9ae979334cdfdc8fd8305fd93 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 22 Jun 2023 10:13:27 -0300 Subject: [PATCH 38/86] Updated history --- docs/generators/changelog/versions/2.13.md | 28 +++++++++----- docs/history.md | 44 ++++++++++++++++++++++ 2 files changed, 63 insertions(+), 9 deletions(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index ad82ec1ce8..e18405918b 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -2,14 +2,14 @@ ### Highlights -* Handled implicit collection creation oplog message by [GH radekmie] [PR #12643]. -* Fix upsert logs when using WARN_WHEN_USING_OLD_API flag by [GH Grubba27] [PR #12640]. -* Updating mongo types by [GH Grubba27] [PR #12639]. -* Fix solid skeleton by [GH fredmaiaarantes] [PR #12637]. -* Setting The Viewport meta tag on skeletons [GH fredmaiaarantes] [PR #12636]. -* Update mongo.d.ts with projection [GH StorytellerCZ] [PR #12635]. -* Update guide code for GraphQL [GH StorytellerCZ] [PR #12619]. -* Twitter Whitelist issue resolved [GH Atharshoyeb] [PR #12369]. +* Handled implicit collection creation oplog message by [radekmie](https://github.com/radekmie) [PR](https://github.com/meteor/meteor/pull/12643). +* Fix upsert logs when using WARN_WHEN_USING_OLD_API flag by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12640). +* Updating mongo types by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12639). +* Fix solid skeleton by [fredmaiaarantes](https://github.com/fredmaiaarantes) [PR](https://github.com/meteor/meteor/pull/12637). +* Setting The Viewport meta tag on skeletons [fredmaiaarantes](https://github.com/fredmaiaarantes) [PR](https://github.com/meteor/meteor/pull/12636). +* Update mongo.d.ts with projection [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12635). +* Update guide code for GraphQL [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12619). +* Twitter Whitelist issue resolved [Atharshoyeb](https://github.com/Atharshoyeb) [PR](https://github.com/meteor/meteor/pull/12369). #### Breaking Changes @@ -30,5 +30,15 @@ TODO - Updated metatags for skeletons. - Updated solidjs skeleton to be more idiomatic. -* `mongo@get-version`: +* `mongo@1.16.7`: TODO + + +#### Special thanks to + +- [@radekmie](https://github.com/radekmie). +- [@Grubba27](https://github.com/Grubba27). +- [@fredmaiaarantes](https://github.com/fredmaiaarantes). +- [@StorytellerCZ](https://github.com/StorytellerCZ). +- [@Atharshoyeb](https://github.com/Atharshoyeb). + diff --git a/docs/history.md b/docs/history.md index 46ed43a139..8cab3d8a3f 100644 --- a/docs/history.md +++ b/docs/history.md @@ -10,6 +10,50 @@ +## v2.13.0, 2023-05-XX + +### Highlights + +* Handled implicit collection creation oplog message by [radekmie](https://github.com/radekmie) [PR](https://github.com/meteor/meteor/pull/12643). +* Fix upsert logs when using WARN_WHEN_USING_OLD_API flag by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12640). +* Updating mongo types by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12639). +* Fix solid skeleton by [fredmaiaarantes](https://github.com/fredmaiaarantes) [PR](https://github.com/meteor/meteor/pull/12637). +* Setting The Viewport meta tag on skeletons [fredmaiaarantes](https://github.com/fredmaiaarantes) [PR](https://github.com/meteor/meteor/pull/12636). +* Update mongo.d.ts with projection [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12635). +* Update guide code for GraphQL [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12619). +* Twitter Whitelist issue resolved [Atharshoyeb](https://github.com/Atharshoyeb) [PR](https://github.com/meteor/meteor/pull/12369). + +#### Breaking Changes + +N/A + +#### Internal API changes + +N/A + +#### Migration Steps + +TODO + +#### Meteor Version Release + + +* `Command line`: + - Updated metatags for skeletons. + - Updated solidjs skeleton to be more idiomatic. + +* `mongo@1.16.7`: + TODO + + +#### Special thanks to + +- [@radekmie](https://github.com/radekmie). +- [@Grubba27](https://github.com/Grubba27). +- [@fredmaiaarantes](https://github.com/fredmaiaarantes). +- [@StorytellerCZ](https://github.com/StorytellerCZ). +- [@Atharshoyeb](https://github.com/Atharshoyeb). + ## v2.12.0, 2023-04-28 ### Highlights From e3e50ddaadaedfe344184d8dfd4ab59ec6623f3e Mon Sep 17 00:00:00 2001 From: zodern Date: Mon, 26 Jun 2023 18:15:35 -0500 Subject: [PATCH 39/86] Reduce parser plugins used in js-analyze This makes the parsing 3 -4x faster --- tools/isobuild/js-analyze.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/tools/isobuild/js-analyze.js b/tools/isobuild/js-analyze.js index 24bda2b580..5f2bf258b0 100644 --- a/tools/isobuild/js-analyze.js +++ b/tools/isobuild/js-analyze.js @@ -1,7 +1,7 @@ import { parse } from '@meteorjs/babel'; import { analyze as analyzeScope } from 'escope'; import LRU from "lru-cache"; - +import { Profile } from '../tool-env/profile'; import Visitor from "@meteorjs/reify/lib/visitor.js"; import { findPossibleIndexes } from "@meteorjs/reify/lib/utils.js"; @@ -26,9 +26,23 @@ function tryToParse(source, hash) { } let ast; - try { - ast = parse(source); + Profile.time('jsAnalyze.parse', () => { + ast = parse(source, { + strictMode: false, + sourceType: 'module', + allowImportExportEverywhere: true, + allowReturnOutsideFunction: true, + allowUndeclaredExports: true, + plugins: [ + // Only plugins for stage 3 features are enabled + // Enabling some plugins significantly affects parser performance + 'importAttributes', + 'explicitResourceManagement', + 'decorators' + ] + }); + }); } catch (e) { if (typeof e.loc === 'object') { e.$ParseError = true; @@ -71,7 +85,10 @@ export function findImportedModuleIdentifiers(source, hash) { } const ast = tryToParse(source, hash); - importedIdentifierVisitor.visit(ast, source, possibleIndexes); + Profile.time('findImportedModuleIdentifiersVisitor', () => { + importedIdentifierVisitor.visit(ast, source, possibleIndexes); + }); + return importedIdentifierVisitor.identifiers; } From d32995cdb6d749a0091a480c95e05d0668766c5a Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 27 Jun 2023 17:03:41 -0300 Subject: [PATCH 40/86] chore: started working in git create url --- tools/cli/commands.js | 543 +++++++++++++++++++++++++----------------- 1 file changed, 327 insertions(+), 216 deletions(-) diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 9bdaaf6994..d007d33913 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -23,6 +23,47 @@ var projectContextModule = require('../project-context.js'); var release = require('../packaging/release.js'); const { Profile } = require("../tool-env/profile"); +const { exec } = require("child_process"); +/** + * Run a command in the shell. + * @param command + * @return {Promise} + */ +const runCommand = async (command) => { + return new Promise((resolve, reject) => { + exec(command, (error, stdout, stderr) => { + if (error) { + console.log(red`error: ${ error.message }`); + reject(error); + return; + } + if (stderr) { + console.log(red`stderr: ${ stderr }`); + reject(stderr); + return; + } + resolve(stdout); + }); + }) +} +/** + * + * @param {Promise<() => T>} fn + * @returns {Promise<[T, null]> | Promise<[null, Error]>} + */ +const tryRun = async (fn) => { + try { return [await fn(), null] } catch (e) { return [null, e] } +} + +/** + * + * @param {string} bash command + * @param {[string, null] | [null, Error]}} Result or Error + * @returns + */ +const bash = + (text, ...values) => + tryRun(() => runCommand(String.raw({ raw: text }, ...values))); import { ensureDevBundleDependencies } from '../cordova/index.js'; import { CordovaRunner } from '../cordova/runner.js'; @@ -550,7 +591,8 @@ main.registerCommand({ tailwind: { type: Boolean }, 'chakra-ui': { type: Boolean }, solid: { type: Boolean }, - prototype: { type: Boolean } + prototype: { type: Boolean }, + from: { type: String }, }, catalogRefresh: new catalog.Refresh.Never() }, async function (options) { @@ -561,10 +603,12 @@ main.registerCommand({ var packageName = options.args[0]; if (options.prototype) { Console.error( - `The ${Console.command('--prototype')} option is no longer supported for packages.` + `The ${Console.command( + "--prototype" + )} option is no longer supported for packages.` ); Console.error(); - throw new main.ShowUsage; + throw new main.ShowUsage(); } if (options.list || options.example) { Console.error("No package examples exist at this time."); @@ -577,8 +621,9 @@ main.registerCommand({ throw new main.ShowUsage(); } - utils.validatePackageNameOrExit( - packageName, {detailedColonExplanation: true}); + utils.validatePackageNameOrExit(packageName, { + detailedColonExplanation: true, + }); // When we create a package, avoid introducing a colon into the file system // by naming the directory after the package name without the prefix. @@ -593,8 +638,9 @@ main.registerCommand({ // with at least two colons. Therefore we will at least try to // discourage people from putting a ton of colons in their package names // here. - Console.error(packageName + - ": Package names may not have more than one colon."); + Console.error( + packageName + ": Package names may not have more than one colon." + ); return 1; } @@ -603,7 +649,7 @@ main.registerCommand({ var packageDir; if (options.appDir) { - packageDir = files.pathResolve(options.appDir, 'packages', fsName); + packageDir = files.pathResolve(options.appDir, "packages", fsName); } else { packageDir = files.pathResolve(fsName); } @@ -616,8 +662,7 @@ main.registerCommand({ } var transform = async function (x) { - var xn = - x.replace(/~name~/g, packageName).replace(/~fs-name~/g, fsName); + var xn = x.replace(/~name~/g, packageName).replace(/~fs-name~/g, fsName); // If we are running from checkout, comment out the line sourcing packages // from a release, with the latest release filled in (in case they do want @@ -631,7 +676,7 @@ main.registerCommand({ relString = rel ? rel.version : "no-release"; } else { xn = xn.replace(/~cc~/g, ""); - relString = release.current.getDisplayName({noPrefix: true}); + relString = release.current.getDisplayName({ noPrefix: true }); } // If we are not in checkout, write the current release here. @@ -639,35 +684,37 @@ main.registerCommand({ }; try { - await files.cp_r(files.pathJoin(__dirnameConverted, '..', 'static-assets', 'skel-pack'), packageDir, { - transformFilename: function (f) { - return transform(f); - }, - transformContents: async function (contents, f) { - if ((/(\.html|\.[jt]sx?|\.css)/).test(f)) { - return Buffer.from(await transform(contents.toString())); - } else { - return contents; - } - }, - ignore: [/^local$/], - preserveSymlinks: true, - }); + await files.cp_r( + files.pathJoin(__dirnameConverted, "..", "static-assets", "skel-pack"), + packageDir, + { + transformFilename: function (f) { + return transform(f); + }, + transformContents: async function (contents, f) { + if (/(\.html|\.[jt]sx?|\.css)/.test(f)) { + return Buffer.from(await transform(contents.toString())); + } else { + return contents; + } + }, + ignore: [/^local$/], + preserveSymlinks: true, + } + ); } catch (err) { Console.error("Could not create package: " + err.message); return 1; } - var displayPackageDir = - files.convertToOSPath(files.pathRelative(files.cwd(), packageDir)); + var displayPackageDir = files.convertToOSPath( + files.pathRelative(files.cwd(), packageDir) + ); // Since the directory can't have colons, the directory name will often not // match the name of the package exactly, therefore we should tell people // where it was created. - Console.info( - packageName + ": created in", - Console.path(displayPackageDir) - ); + Console.info(packageName + ": created in", Console.path(displayPackageDir)); return 0; } @@ -682,8 +729,8 @@ main.registerCommand({ // (In particular, it's not sufficient to create the new app with // this version of the tools, and then stamp on the correct release // at the end.) - if (! release.current.isCheckout() && !release.forced) { - if (release.current.name !== await release.latestKnown()) { + if (!release.current.isCheckout() && !release.forced) { + if (release.current.name !== (await release.latestKnown())) { throw new main.SpringboardToLatestRelease(); } } @@ -691,38 +738,21 @@ main.registerCommand({ if (options.list) { Console.info("Available examples:"); _.each(EXAMPLE_REPOSITORIES, function (repoInfo, name) { - const branchInfo = repoInfo.branch ? `/tree/${repoInfo.branch}` : ''; + const branchInfo = repoInfo.branch ? `/tree/${repoInfo.branch}` : ""; Console.info( Console.command(`${name}: ${repoInfo.repo}${branchInfo}`), - Console.options({ indent: 2 })); + Console.options({ indent: 2 }) + ); }); Console.info(); - Console.info("To create an example, simply", Console.command("git clone"), + Console.info( + "To create an example, simply", + Console.command("git clone"), "the relevant repository and branch (run", Console.command("'meteor create --example '"), - " to see the full command)."); - return 0; - }; - - if (options.example) { - const repoInfo = EXAMPLE_REPOSITORIES[options.example]; - if (!repoInfo) { - Console.error(`${options.example}: no such example.`); - Console.error( - "List available applications with", - Console.command("'meteor create --list'") + "."); - return 1; - } - - const branchOption = repoInfo.branch ? ` -b ${repoInfo.branch}` : ''; - const path = options.args.length === 1 ? ` ${options.args[0]}` : ''; - - Console.info(`To create the ${options.example} example, please run:`); - Console.info( - Console.command(`git clone ${repoInfo.repo}${branchOption}${path}`), - Console.options({ indent: 2 })); - + " to see the full command)." + ); return 0; } @@ -736,7 +766,8 @@ main.registerCommand({ if (files.findAppDir(appPath)) { Console.error( - "You can't create a Meteor project inside another Meteor project."); + "You can't create a Meteor project inside another Meteor project." + ); return 1; } @@ -748,48 +779,199 @@ main.registerCommand({ appName = files.pathBasename(appPath); } - var transform = function (x) { return x.replace(/~name~/g, appName); }; // These file extensions are usually metadata, not app code - var nonCodeFileExts = ['.txt', '.md', '.json', '.sh']; + var nonCodeFileExts = [".txt", ".md", ".json", ".sh"]; var destinationHasCodeFiles = false; // If the directory doesn't exist, it clearly doesn't have any source code // inside itself if (files.exists(appPath)) { - destinationHasCodeFiles = _.any(files.readdir(appPath), - function thisPathCountsAsAFile(filePath) { - // We don't mind if there are hidden files or directories (this includes - // .git) and we don't need to check for .meteor here because the command - // will fail earlier - var isHidden = /^\./.test(filePath); - if (isHidden) { - // Not code - return false; - } + destinationHasCodeFiles = _.any( + files.readdir(appPath), + function thisPathCountsAsAFile(filePath) { + // We don't mind if there are hidden files or directories (this includes + // .git) and we don't need to check for .meteor here because the command + // will fail earlier + var isHidden = /^\./.test(filePath); + if (isHidden) { + // Not code + return false; + } - // We do mind if there are non-hidden directories, because we don't want - // to recursively check everything to do some crazy heuristic to see if - // we should try to create an app. - var stats = files.stat(files.pathJoin(appPath, filePath)); - if (stats.isDirectory()) { - // Could contain code + // We do mind if there are non-hidden directories, because we don't want + // to recursively check everything to do some crazy heuristic to see if + // we should try to create an app. + var stats = files.stat(files.pathJoin(appPath, filePath)); + if (stats.isDirectory()) { + // Could contain code + return true; + } + + // Check against our file extension white list + var ext = files.pathExtname(filePath); + if (ext == "" || nonCodeFileExts.includes(ext)) { + return false; + } + + // Everything not matched above is considered to be possible source code return true; } + ); + } - // Check against our file extension white list - var ext = files.pathExtname(filePath); - if (ext == '' || nonCodeFileExts.includes(ext)) { - return false; - } - - // Everything not matched above is considered to be possible source code - return true; + // Setup fn, which is called after the app is created, to print a message + // about how to run the app. + async function setup() { + // We are actually working with a new meteor project at this point, so + // set up its context. + var projectContext = new projectContextModule.ProjectContext({ + projectDir: appPath, + // Write .meteor/versions even if --release is specified. + alwaysWritePackageMap: true, + // examples come with a .meteor/versions file, but we shouldn't take it + // too seriously + allowIncompatibleUpdate: true, }); + await main.captureAndExit( + "=> Errors while creating your project", + async function () { + await projectContext.readProjectMetadata(); + if (buildmessage.jobHasMessages()) { + return; + } + + await projectContext.releaseFile.write( + release.current.isCheckout() ? "none" : release.current.name + ); + if (buildmessage.jobHasMessages()) { + return; + } + + // Also, write package version constraints from the current release + // If we are on a checkout, we don't need to do this as running from + // checkout still pins all package versions and if the user updates + // to a real release, the packages file will subsequently get updated + if (!release.current.isCheckout()) { + projectContext.projectConstraintsFile.updateReleaseConstraints( + release.current._manifest + ); + } + + // Any upgrader that is in this version of Meteor doesn't need to be run on + // this project. + var upgraders = require("../upgraders.js"); + projectContext.finishedUpgraders.appendUpgraders( + upgraders.allUpgraders() + ); + + await projectContext.prepareProjectForBuild(); + } + ); + // No need to display the PackageMapDelta here, since it would include all of + // the packages (or maybe an unpredictable subset based on what happens to be + // in the template's versions file). + + // Since some of the project skeletons include npm `devDependencies`, we need + // to make sure they're included when running `npm install`. + await require("./default-npm-deps.js").install(appPath, { + includeDevDependencies: true, + }); + + var appNameToDisplay = + appPathAsEntered === "." ? "current directory" : `'${appPathAsEntered}'`; + + var message = `Created a new Meteor app in ${appNameToDisplay}`; + + message += "."; + + Console.info(message + "\n"); + + // Print a nice message telling people we created their new app, and what to + // do next. + Console.info("To run your new app:"); + + function cmd(text) { + Console.info( + Console.command(text), + Console.options({ + indent: 2, + }) + ); + } + + if (appPathAsEntered !== ".") { + // Wrap the app path in quotes if it contains spaces + const appPathWithQuotesIfSpaces = + appPathAsEntered.indexOf(" ") === -1 + ? appPathAsEntered + : `'${appPathAsEntered}'`; + + // Don't tell people to 'cd .' + cmd("cd " + appPathWithQuotesIfSpaces); + } + + cmd("meteor"); + + Console.info(""); + Console.info( + "If you are new to Meteor, try some of the learning resources here:" + ); + Console.info( + Console.url("https://www.meteor.com/tutorials"), + Console.options({ indent: 2 }) + ); + + Console.info(""); + Console.info( + "When you’re ready to deploy and host your new Meteor application, check out Cloud:" + ); + Console.info( + Console.url("https://www.meteor.com/cloud"), + Console.options({ indent: 2 }) + ); + + } + + /** + * + * @param {string} url + */ + const setupExampleByURL = async (url) => { + const [ok, err] = await bash`git -v`; + if (err) throw new Error("git is not installed"); + await bash`git clone --progress ${url} ${appPath} `; + // remove ref from origin + await bash`rm -rf ${appPath}/.git`; + await setup(); + }; + + if (options.example) { + // publish this examples to a CDN as a json file so it can be dinamically + // updated + + const repoInfo = EXAMPLE_REPOSITORIES[options.example]; + if (!repoInfo) { + Console.error(`${options.example}: no such example.`); + Console.error( + "List available applications with", + Console.command("'meteor create --list'") + "." + ); + return 1; + } + // repoInfo.repo is the URL of the repo, and repoInfo.branch is the branch + await setupExampleByURL(repoInfo.repo); + return 0; + } + + + if (options.from) { + await setupExampleByURL(options.from); + return 0; } var toIgnore = [/^local$/, /^\.id$/]; @@ -799,153 +981,82 @@ main.registerCommand({ toIgnore.push(/(\.html|\.js|\.css)/); } - const skeletonExplicitOption = AVAILABLE_SKELETONS.find(skeleton => - !!options[skeleton]); + const skeletonExplicitOption = AVAILABLE_SKELETONS.find( + (skeleton) => !!options[skeleton] + ); const skeleton = skeletonExplicitOption || DEFAULT_SKELETON; - await files.cp_r(files.pathJoin(__dirnameConverted, '..', 'static-assets', - `skel-${skeleton}`), appPath, { - transformFilename: function (f) { - return transform(f); - }, - transformContents: function (contents, f) { - - // check if this app is just for prototyping if it is then we need to add autopublish and insecure in the packages file - if ((/packages/).test(f)) { - - const prototypePackages = - () => - 'autopublish # Publish all data to the clients (for prototyping)\n' + - 'insecure # Allow all DB writes from clients (for prototyping)'; - - // XXX: if there is the need to add more options maybe we should have a better abstraction for this if-else - if (options.prototype) { - return Buffer.from(contents.toString().replace(/~prototype~/g, prototypePackages())) - } else { - return Buffer.from(contents.toString().replace(/~prototype~/g, '')) - } - } - if ((/(\.html|\.[jt]sx?|\.css)/).test(f)) { - return Buffer.from(transform(contents.toString())); - } else { - return contents; - } - }, - ignore: toIgnore, - preserveSymlinks: true, - }); - - // We are actually working with a new meteor project at this point, so - // set up its context. - var projectContext = new projectContextModule.ProjectContext({ - projectDir: appPath, - // Write .meteor/versions even if --release is specified. - alwaysWritePackageMap: true, - // examples come with a .meteor/versions file, but we shouldn't take it - // too seriously - allowIncompatibleUpdate: true - }); - - await main.captureAndExit("=> Errors while creating your project", async function () { - await projectContext.readProjectMetadata(); - if (buildmessage.jobHasMessages()) { - return; - } - - await projectContext.releaseFile.write( - release.current.isCheckout() ? "none" : release.current.name); - if (buildmessage.jobHasMessages()) { - return; - } - - // Also, write package version constraints from the current release - // If we are on a checkout, we don't need to do this as running from - // checkout still pins all package versions and if the user updates - // to a real release, the packages file will subsequently get updated - if (!release.current.isCheckout()) { - projectContext.projectConstraintsFile - .updateReleaseConstraints(release.current._manifest); - } - - // Any upgrader that is in this version of Meteor doesn't need to be run on - // this project. - var upgraders = require('../upgraders.js'); - projectContext.finishedUpgraders.appendUpgraders(upgraders.allUpgraders()); - - await projectContext.prepareProjectForBuild(); - }); - // No need to display the PackageMapDelta here, since it would include all of - // the packages (or maybe an unpredictable subset based on what happens to be - // in the template's versions file). - - // Since some of the project skeletons include npm `devDependencies`, we need - // to make sure they're included when running `npm install`. - await require("./default-npm-deps.js").install( + await files.cp_r( + files.pathJoin( + __dirnameConverted, + "..", + "static-assets", + `skel-${skeleton}` + ), appPath, - { includeDevDependencies: true } + { + transformFilename: function (f) { + return transform(f); + }, + transformContents: function (contents, f) { + // check if this app is just for prototyping if it is then we need to add autopublish and insecure in the packages file + if (/packages/.test(f)) { + const prototypePackages = () => + "autopublish # Publish all data to the clients (for prototyping)\n" + + "insecure # Allow all DB writes from clients (for prototyping)"; + + // XXX: if there is the need to add more options maybe we should have a better abstraction for this if-else + if (options.prototype) { + return Buffer.from( + contents.toString().replace(/~prototype~/g, prototypePackages()) + ); + } else { + return Buffer.from(contents.toString().replace(/~prototype~/g, "")); + } + } + if (/(\.html|\.[jt]sx?|\.css)/.test(f)) { + return Buffer.from(transform(contents.toString())); + } else { + return contents; + } + }, + ignore: toIgnore, + preserveSymlinks: true, + } ); - var appNameToDisplay = appPathAsEntered === "." ? - "current directory" : `'${appPathAsEntered}'`; - var message = `Created a new Meteor app in ${appNameToDisplay}`; - - message += "."; - - Console.info(message + "\n"); - - // Print a nice message telling people we created their new app, and what to - // do next. - Console.info("To run your new app:"); - - function cmd(text) { - Console.info(Console.command(text), Console.options({ - indent: 2 - })); - } - - if (appPathAsEntered !== ".") { - // Wrap the app path in quotes if it contains spaces - const appPathWithQuotesIfSpaces = appPathAsEntered.indexOf(' ') === -1 ? - appPathAsEntered : - `'${appPathAsEntered}'`; - - // Don't tell people to 'cd .' - cmd("cd " + appPathWithQuotesIfSpaces); - } - - cmd("meteor"); - - Console.info(""); - Console.info("If you are new to Meteor, try some of the learning resources here:"); - Console.info( - Console.url("https://www.meteor.com/tutorials"), - Console.options({ indent: 2 })); - - Console.info(""); - Console.info("When you’re ready to deploy and host your new Meteor application, check out Cloud:"); - Console.info( - Console.url("https://www.meteor.com/cloud"), - Console.options({ indent: 2 })); + + await setup(); if (!!skeletonExplicitOption) { // Notify people about the skeleton options - Console.info([ - "", - "To start with a different app template, try one of the following:", - "", - ].join("\n")); + Console.info( + [ + "", + "To start with a different app template, try one of the following:", + "", + ].join("\n") + ); cmd("meteor create --bare # to create an empty app"); - cmd("meteor create --minimal # to create an app with as few Meteor packages as possible"); - cmd("meteor create --full # to create a more complete scaffolded app"); + cmd( + "meteor create --minimal # to create an app with as few Meteor packages as possible" + ); + cmd( + "meteor create --full # to create a more complete scaffolded app" + ); cmd("meteor create --react # to create a basic React-based app"); cmd("meteor create --vue # to create a basic Vue3-based app"); cmd("meteor create --vue-2 # to create a basic Vue2-based app"); cmd("meteor create --apollo # to create a basic Apollo + React app"); cmd("meteor create --svelte # to create a basic Svelte app"); - cmd("meteor create --typescript # to create an app using TypeScript and React"); + cmd( + "meteor create --typescript # to create an app using TypeScript and React" + ); cmd("meteor create --blaze # to create an app using Blaze"); - cmd("meteor create --tailwind # to create an app using React and Tailwind"); + cmd( + "meteor create --tailwind # to create an app using React and Tailwind" + ); cmd("meteor create --chakra-ui # to create an app Chakra UI and React"); cmd("meteor create --solid # to create a basic Solid app"); } From fde161c1082bf02bcc28f9a929d8fb0e334f8f0c Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 28 Jun 2023 11:08:38 -0300 Subject: [PATCH 41/86] chore: updated to not repeat the same --- tools/project-context.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/project-context.js b/tools/project-context.js index 1fb15c48f8..252ccdbd4c 100644 --- a/tools/project-context.js +++ b/tools/project-context.js @@ -1735,6 +1735,9 @@ Object.assign(exports.FinishedUpgraders.prototype, { appendUpgraders: function (upgraders) { var self = this; + /** + * @type {string} + */ var current = null; try { current = files.readFile(self.filename, 'utf8'); @@ -1757,6 +1760,7 @@ Object.assign(exports.FinishedUpgraders.prototype, { } _.each(upgraders, function (upgrader) { + if (current.includes(upgrader)) return; appendText += upgrader + '\n'; }); From 4e4e7dfcc449873d17e8e3fecaaa5b06bd7a42b6 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 28 Jun 2023 12:32:46 -0300 Subject: [PATCH 42/86] chore: skeletons now use git clone --- tools/cli/commands.js | 102 +++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 60 deletions(-) diff --git a/tools/cli/commands.js b/tools/cli/commands.js index d007d33913..f9717a26be 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -737,7 +737,20 @@ main.registerCommand({ if (options.list) { Console.info("Available examples:"); - _.each(EXAMPLE_REPOSITORIES, function (repoInfo, name) { + const [json, err] = await tryRun(() => + httpHelpers.request({ + url: 'cdn.meteor.com/examples.json', + method: "GET", + useSessionHeader: true, + useAuthHeader: true, + }) + ); + if (err) { + Console.error("Failed to fetch examples:", err.message); + Console.info("Using cached examples.json"); + } + const examples = err ? EXAMPLE_REPOSITORIES : JSON.parse(json); + _.each(examples, function (repoInfo, name) { const branchInfo = repoInfo.branch ? `/tree/${repoInfo.branch}` : ""; Console.info( Console.command(`${name}: ${repoInfo.repo}${branchInfo}`), @@ -748,10 +761,7 @@ main.registerCommand({ Console.info(); Console.info( "To create an example, simply", - Console.command("git clone"), - "the relevant repository and branch (run", - Console.command("'meteor create --example '"), - " to see the full command)." + Console.command("'meteor create --example '") ); return 0; } @@ -823,7 +833,14 @@ main.registerCommand({ } ); } - + function cmd(text) { + Console.info( + Console.command(text), + Console.options({ + indent: 2, + }) + ); + } // Setup fn, which is called after the app is created, to print a message // about how to run the app. async function setup() { @@ -895,14 +912,7 @@ main.registerCommand({ // do next. Console.info("To run your new app:"); - function cmd(text) { - Console.info( - Console.command(text), - Console.options({ - indent: 2, - }) - ); - } + if (appPathAsEntered !== ".") { // Wrap the app path in quotes if it contains spaces @@ -945,16 +955,28 @@ main.registerCommand({ const [ok, err] = await bash`git -v`; if (err) throw new Error("git is not installed"); await bash`git clone --progress ${url} ${appPath} `; - // remove ref from origin - await bash`rm -rf ${appPath}/.git`; + // remove .git folder from the example + await files.rm_recursive_async(files.pathJoin(appPath, ".git")); await setup(); }; if (options.example) { - // publish this examples to a CDN as a json file so it can be dinamically - // updated + const [json, err] = await tryRun(() => + httpHelpers.request({ + url: 'cdn.meteor.com/examples.json', + method: "GET", + useSessionHeader: true, + useAuthHeader: true, + }) + ); - const repoInfo = EXAMPLE_REPOSITORIES[options.example]; + if (err) { + Console.error("Failed to fetch examples:", err.message); + Console.info("Using cached examples.json"); + } + + const examples = err ? EXAMPLE_REPOSITORIES : JSON.parse(json); + const repoInfo = examples[options.example]; if (!repoInfo) { Console.error(`${options.example}: no such example.`); Console.error( @@ -985,47 +1007,7 @@ main.registerCommand({ (skeleton) => !!options[skeleton] ); const skeleton = skeletonExplicitOption || DEFAULT_SKELETON; - await files.cp_r( - files.pathJoin( - __dirnameConverted, - "..", - "static-assets", - `skel-${skeleton}` - ), - appPath, - { - transformFilename: function (f) { - return transform(f); - }, - transformContents: function (contents, f) { - // check if this app is just for prototyping if it is then we need to add autopublish and insecure in the packages file - if (/packages/.test(f)) { - const prototypePackages = () => - "autopublish # Publish all data to the clients (for prototyping)\n" + - "insecure # Allow all DB writes from clients (for prototyping)"; - - // XXX: if there is the need to add more options maybe we should have a better abstraction for this if-else - if (options.prototype) { - return Buffer.from( - contents.toString().replace(/~prototype~/g, prototypePackages()) - ); - } else { - return Buffer.from(contents.toString().replace(/~prototype~/g, "")); - } - } - if (/(\.html|\.[jt]sx?|\.css)/.test(f)) { - return Buffer.from(transform(contents.toString())); - } else { - return contents; - } - }, - ignore: toIgnore, - preserveSymlinks: true, - } - ); - - - + await setupExampleByURL(`https://github.com/meteor/skel-${skeleton}`) await setup(); if (!!skeletonExplicitOption) { From 0635aa1578e7c273ca482210e30da40771630987 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 28 Jun 2023 15:23:47 -0300 Subject: [PATCH 43/86] updated json link --- tools/cli/commands.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cli/commands.js b/tools/cli/commands.js index f9717a26be..3cf8d0eccb 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -739,7 +739,7 @@ main.registerCommand({ Console.info("Available examples:"); const [json, err] = await tryRun(() => httpHelpers.request({ - url: 'cdn.meteor.com/examples.json', + url: 'https://cdn.meteor.com/static/meteor.json', method: "GET", useSessionHeader: true, useAuthHeader: true, @@ -963,7 +963,7 @@ main.registerCommand({ if (options.example) { const [json, err] = await tryRun(() => httpHelpers.request({ - url: 'cdn.meteor.com/examples.json', + url: 'https://cdn.meteor.com/static/meteor.json', method: "GET", useSessionHeader: true, useAuthHeader: true, From 180304b8412ca1f9f310e9920115d0b5509d36ff Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:04:48 -0300 Subject: [PATCH 44/86] chore: updated getExampleJSON abstraction --- tools/cli/commands.js | 47 ++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 3cf8d0eccb..94a748bf07 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -554,6 +554,31 @@ main.registerCommand({ /////////////////////////////////////////////////////////////////////////////// // create /////////////////////////////////////////////////////////////////////////////// + +/** + * list of all the available skeletons similar to the property below + * { + * clock: { repo: 'https://github.com/meteor/clock' }, + * leaderboard: { repo: 'https://github.com/meteor/leaderboard' }, + * } + * @typedef {Object.} Skeletons + */ +/** + * Resolves into json with + * @returns {Promise<[Skeletons, null]> | Promise<[null, Error]>} + */ +function getExamplesJSON(){ + return tryRun(async () => { + const response = await httpHelpers.request({ + url: "https://cdn.meteor.com/static/meteor.json", + method: "GET", + useSessionHeader: true, + useAuthHeader: true, + }); + return JSON.parse(response.body); + }); +} + const DEFAULT_SKELETON = "react"; export const AVAILABLE_SKELETONS = [ "apollo", @@ -737,19 +762,12 @@ main.registerCommand({ if (options.list) { Console.info("Available examples:"); - const [json, err] = await tryRun(() => - httpHelpers.request({ - url: 'https://cdn.meteor.com/static/meteor.json', - method: "GET", - useSessionHeader: true, - useAuthHeader: true, - }) - ); + const [json, err] = await getExamplesJSON() if (err) { Console.error("Failed to fetch examples:", err.message); Console.info("Using cached examples.json"); } - const examples = err ? EXAMPLE_REPOSITORIES : JSON.parse(json); + const examples = err ? EXAMPLE_REPOSITORIES : json; _.each(examples, function (repoInfo, name) { const branchInfo = repoInfo.branch ? `/tree/${repoInfo.branch}` : ""; Console.info( @@ -961,21 +979,14 @@ main.registerCommand({ }; if (options.example) { - const [json, err] = await tryRun(() => - httpHelpers.request({ - url: 'https://cdn.meteor.com/static/meteor.json', - method: "GET", - useSessionHeader: true, - useAuthHeader: true, - }) - ); + const [json, err] = await getExamplesJSON(); if (err) { Console.error("Failed to fetch examples:", err.message); Console.info("Using cached examples.json"); } - const examples = err ? EXAMPLE_REPOSITORIES : JSON.parse(json); + const examples = err ? EXAMPLE_REPOSITORIES : json; const repoInfo = examples[options.example]; if (!repoInfo) { Console.error(`${options.example}: no such example.`); From 4829db0a40cfdfbdd9c5012c5a6c3259982111a0 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:26:49 -0300 Subject: [PATCH 45/86] Updated to use cached version --- tools/cli/commands.js | 50 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 94a748bf07..5b513af2a7 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -1018,9 +1018,55 @@ main.registerCommand({ (skeleton) => !!options[skeleton] ); const skeleton = skeletonExplicitOption || DEFAULT_SKELETON; - await setupExampleByURL(`https://github.com/meteor/skel-${skeleton}`) - await setup(); + try { + await setupExampleByURL(`https://github.com/meteor/skel-${skeleton}`); + } catch (e) { + Console.error( + `Something has happened while creating your app using git clone. + Will use cached version of skeletons. + Error message: `, e.message); + // TODO: decide if this should stay here or not. + await files.cp_r( + files.pathJoin( + __dirnameConverted, + "..", + "static-assets", + `skel-${skeleton}` + ), + appPath, + { + transformFilename: function (f) { + return transform(f); + }, + transformContents: function (contents, f) { + // check if this app is just for prototyping if it is then we need to add autopublish and insecure in the packages file + if (/packages/.test(f)) { + const prototypePackages = () => + "autopublish # Publish all data to the clients (for prototyping)\n" + + "insecure # Allow all DB writes from clients (for prototyping)"; + + // XXX: if there is the need to add more options maybe we should have a better abstraction for this if-else + if (options.prototype) { + return Buffer.from( + contents.toString().replace(/~prototype~/g, prototypePackages()) + ); + } else { + return Buffer.from(contents.toString().replace(/~prototype~/g, "")); + } + } + if (/(\.html|\.[jt]sx?|\.css)/.test(f)) { + return Buffer.from(transform(contents.toString())); + } else { + return contents; + } + }, + ignore: toIgnore, + preserveSymlinks: true, + } + ); + await setup(); + } if (!!skeletonExplicitOption) { // Notify people about the skeleton options Console.info( From f1aed3aada8ea0f8f91a6e6f47fec1835dec343e Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:27:24 -0300 Subject: [PATCH 46/86] reverted fde161c1082bf02bcc28f9a929d8fb0e334f8f0c --- tools/project-context.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/project-context.js b/tools/project-context.js index 252ccdbd4c..a16cefda73 100644 --- a/tools/project-context.js +++ b/tools/project-context.js @@ -1760,7 +1760,6 @@ Object.assign(exports.FinishedUpgraders.prototype, { } _.each(upgraders, function (upgrader) { - if (current.includes(upgrader)) return; appendText += upgrader + '\n'; }); From b58a582eb8ab6050ee48cd662bd207fe4381e6f7 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 29 Jun 2023 14:44:36 -0300 Subject: [PATCH 47/86] docs,cli: updated meteor create docs --- tools/cli/help.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/cli/help.txt b/tools/cli/help.txt index c5cc820414..e07b1225e1 100644 --- a/tools/cli/help.txt +++ b/tools/cli/help.txt @@ -152,6 +152,7 @@ Options: Create a new project. Usage: meteor create [--release ] [--bare|--minimal|--full|--react|--vue|--vue-2|--apollo|--svelte|--blaze|--tailwind|--chakra-ui|--solid] meteor create [--release ] --example [] + meteor create [--release ] --from [] meteor create --list meteor create --package [] @@ -178,6 +179,7 @@ currently no package examples. Options: --package Create a new meteor package instead of an app. --example Example template to use. + --from Clones a meteor project from a url. --list Show list of available examples. --bare Create an empty app. --minimal Create an app with as few Meteor packages as possible. @@ -192,7 +194,6 @@ Options: --tailwind Create a basic react-based app, with tailwind configured. --chakra-ui Create a basic react-based app, with chakra-ui configured. --solid Create a basic solid-based app. - --prototype Create a prototype app with the insecure & autopublish packages. Can be used along with other app commands >>> update From 0632cdca001374f34ee1c7e5c106d97e803c9984 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 29 Jun 2023 14:44:44 -0300 Subject: [PATCH 48/86] docs: updated meteor create docs --- docs/source/commandline.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/source/commandline.md b/docs/source/commandline.md index 0fec5f634d..9f984207ac 100644 --- a/docs/source/commandline.md +++ b/docs/source/commandline.md @@ -87,20 +87,20 @@ Create a new Meteor project. By default, it uses [React](https://guide.meteor.co and makes a subdirectory named *name* and copies in the template app. You can pass an absolute or relative path. +_This command requires an Internet connection and having git installed._ + +

Cloning from project

+ +You can also create a new Meteor project by cloning an existing project. You can +list them using the command `meteor create --list` it will list all the available +templates. You can then clone them using the command `meteor create --example ` +Or you can use the `--from` flag to clone a project from a git repository. For example +`meteor create --from "https://github.com/meteor/skel-react" ` +

Flags

**Flags for default packages** -`--prototype` - -Creates a package with the prototype purpose packages(`autopublish` and `insecure`) -if you use them you can change your collections quickly, -but it is not supposed to be used in production. -For more information about security you can check -it [here](https://guide.meteor.com/security.html#checklist) -It can be used together with other flags that create apps such as `--react` or `--typescript`. - - `--bare` Creates a basic, blaze project. From 8c83d11b12f9f7e5341a657568360bcfaf51bf7c Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:29:38 -0300 Subject: [PATCH 49/86] docs: updated changelog --- docs/generators/changelog/versions/3.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/changelog/versions/3.0.md b/docs/generators/changelog/versions/3.0.md index 972ff5cef8..d0db4c536c 100644 --- a/docs/generators/changelog/versions/3.0.md +++ b/docs/generators/changelog/versions/3.0.md @@ -356,7 +356,7 @@ - `meteor-tool@3.0.0`: - - Package was bumped due to a dependency update. No code changes were made. + - Changes to how meteor apps are being created [PR](https://github.com/meteor/meteor/pull/12697) - `meteor@2.0.0`: From 1da68d0112d7578318fa29ef44abafbf78f12ae2 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Mon, 3 Jul 2023 15:31:43 -0300 Subject: [PATCH 50/86] chore: updated list --- tools/cli/example-repositories.js | 37 +++++++++++-------------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/tools/cli/example-repositories.js b/tools/cli/example-repositories.js index 4324daf293..7bf472ec0d 100644 --- a/tools/cli/example-repositories.js +++ b/tools/cli/example-repositories.js @@ -1,26 +1,15 @@ export const EXAMPLE_REPOSITORIES = { - clock: { repo: 'https://github.com/meteor/clock' }, - leaderboard: { repo: 'https://github.com/meteor/leaderboard' }, - localmarket: { repo: 'https://github.com/meteor/localmarket' }, - 'simple-todos': { repo: 'https://github.com/meteor/simple-todos' }, - 'simple-todos-react': { - repo: 'https://github.com/meteor/simple-todos-react' - }, - 'simple-todos-angular': { - repo: 'https://github.com/meteor/simple-todos-angular' - }, - todos: { repo: 'https://github.com/meteor/todos' }, - 'todos-react': { - 'repo': 'https://github.com/meteor/todos', - 'branch': 'react', - }, - 'angular-boilerplate': { - repo: 'https://github.com/Urigo/angular-meteor-base.git' - }, - simpletasks: { repo: 'https://github.com/fredmaiaarantes/simpletasks' }, - chakraui: { repo: 'https://github.com/meteor/examples/blob/main/chakra-ui' }, - tailwindcss: { repo: 'https://github.com/meteor/examples/blob/main/tailwindcss' }, - wantch: { repo: 'https://github.com/filipenevola/wantch' }, - doubleapp: { repo: 'https://github.com/denihs/double-app/' }, - + "vue-2": { "repo": "https://github.com/meteor/skel-vue-2" }, + "vue": { "repo": "https://github.com/meteor/skel-vue" }, + "react": { "repo": "https://github.com/meteor/skel-react" }, + "full": { "repo": "https://github.com/meteor/skel-full" }, + "bare": { "repo": "https://github.com/meteor/skel-bare" }, + "blaze": { "repo": "https://github.com/meteor/skel-blaze" }, + "chakra-ui": { "repo": "https://github.com/meteor/skel-chakra-ui" }, + "apollo": { "repo": "https://github.com/meteor/skel-apollo" }, + "minimal": { "repo": "https://github.com/meteor/skel-minimal" }, + "solid": { "repo": "https://github.com/meteor/skel-solid" }, + "svelte": { "repo": "https://github.com/meteor/skel-svelte" }, + "tailwind": { "repo": "https://github.com/meteor/skel-tailwind" }, + "typescript": { "repo": "https://github.com/meteor/skel-typescript" }, }; From 1ec902ee322f9f46c7d1b2c79447dde4d9fb5007 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Mon, 3 Jul 2023 15:38:32 -0300 Subject: [PATCH 51/86] how to handle prototype opt --- tools/cli/commands.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 5b513af2a7..7bf3068b31 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -1020,12 +1020,21 @@ main.registerCommand({ const skeleton = skeletonExplicitOption || DEFAULT_SKELETON; try { + // Prototype option should use local skeleton. + // Maybe we should use a different skeleton for prototype + if (options.prototype) throw new Error("Using prototype option"); + await setupExampleByURL(`https://github.com/meteor/skel-${skeleton}`); } catch (e) { - Console.error( - `Something has happened while creating your app using git clone. - Will use cached version of skeletons. - Error message: `, e.message); + + if (e.message !== "Using prototype option") { + // something has happened while creating the app using git clone + Console.error( + `Something has happened while creating your app using git clone. + Will use cached version of skeletons. + Error message: `, e.message); + } + // TODO: decide if this should stay here or not. await files.cp_r( files.pathJoin( From d09fc639c865474300a6a4cf2fd8762d3af033ed Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 4 Jul 2023 09:29:29 -0300 Subject: [PATCH 52/86] tests: updated create main --- tools/tests/create.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tests/create.js b/tools/tests/create.js index a054b86365..a6a51eefe9 100644 --- a/tools/tests/create.js +++ b/tools/tests/create.js @@ -46,7 +46,7 @@ selftest.define("create main", async function () { run = s.run("create", "--list"); await run.read('Available'); - await run.match('leaderboard'); + await run.match('react'); await run.expectExit(0); }); From e191129e3bd489eb28a165868fd836bdd279da21 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 4 Jul 2023 14:01:23 -0300 Subject: [PATCH 53/86] docs,guide: updated about missing --prototype flag --- docs/source/commandline.md | 9 +++++++++ tools/cli/help.txt | 1 + 2 files changed, 10 insertions(+) diff --git a/docs/source/commandline.md b/docs/source/commandline.md index 9f984207ac..7ba58d166c 100644 --- a/docs/source/commandline.md +++ b/docs/source/commandline.md @@ -99,6 +99,15 @@ Or you can use the `--from` flag to clone a project from a git repository. For e

Flags

+`--prototype` + +Creates a package with the prototype purpose packages(`autopublish` and `insecure`) +if you use them you can change your collections quickly, +but it is not supposed to be used in production. +For more information about security you can check +it [here](https://guide.meteor.com/security.html#checklist) +It can be used together with other flags that create apps such as `--react` or `--typescript`. + **Flags for default packages** `--bare` diff --git a/tools/cli/help.txt b/tools/cli/help.txt index e07b1225e1..920a2ce472 100644 --- a/tools/cli/help.txt +++ b/tools/cli/help.txt @@ -194,6 +194,7 @@ Options: --tailwind Create a basic react-based app, with tailwind configured. --chakra-ui Create a basic react-based app, with chakra-ui configured. --solid Create a basic solid-based app. + --prototype Create a prototype app with the insecure & autopublish packages. Can be used along with other app commands >>> update From ddfb7bf0ac709af424e55fadd2be2010c8c85c9b Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 5 Jul 2023 09:38:26 -0300 Subject: [PATCH 54/86] chore: updated dev bundle to 14.21.4.0 --- meteor | 2 +- scripts/build-dev-bundle-common.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meteor b/meteor index 921503c9e0..bedeb03f1f 100755 --- a/meteor +++ b/meteor @@ -1,6 +1,6 @@ #!/usr/bin/env bash -BUNDLE_VERSION=14.21.3.2 +BUNDLE_VERSION=14.21.4.0 # OS Check. Put here because here is where we download the precompiled diff --git a/scripts/build-dev-bundle-common.sh b/scripts/build-dev-bundle-common.sh index 612b7a0b76..e24cb94592 100644 --- a/scripts/build-dev-bundle-common.sh +++ b/scripts/build-dev-bundle-common.sh @@ -5,7 +5,7 @@ set -u UNAME=$(uname) ARCH=$(uname -m) -NODE_VERSION=14.21.3 +NODE_VERSION=14.21.4 MONGO_VERSION_64BIT=6.0.3 MONGO_VERSION_32BIT=3.2.22 NPM_VERSION=6.14.17 From 6902e4e70cbf7545eefffaa2457b24f6ade9d050 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 5 Jul 2023 10:41:21 -0300 Subject: [PATCH 55/86] updated url --- scripts/build-node-for-dev-bundle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-node-for-dev-bundle.sh b/scripts/build-node-for-dev-bundle.sh index b0644914dc..766715e02a 100755 --- a/scripts/build-node-for-dev-bundle.sh +++ b/scripts/build-node-for-dev-bundle.sh @@ -18,7 +18,7 @@ then NODE_URL="https://github.com/meteor/node/archive/${NODE_COMMIT_HASH}.tar.gz" else echo "Building Node source from ${NODE_VERSION} src tarball..."; - NODE_URL="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz" + NODE_URL="https://static.meteor.com/dev-bundle-node-os/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz" fi else NODE_URL="https://nodejs.org/dist/v${NODE_VERSION}/${NODE_TGZ}" From 522ba24af76f59646281fa6a57300f72848f48ef Mon Sep 17 00:00:00 2001 From: Vitor Date: Sat, 17 Jun 2023 17:20:05 -0300 Subject: [PATCH 56/86] doc(guide): remove built-in regex expressions from simpleSchema --- guide/source/collections.md | 8 ++++++-- guide/source/methods.md | 10 ++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/guide/source/collections.md b/guide/source/collections.md index f3aa7d0dad..f91fecdd77 100644 --- a/guide/source/collections.md +++ b/guide/source/collections.md @@ -91,10 +91,14 @@ Let's assume that we have a `Lists` collection. To define a schema for this col ```js import SimpleSchema from 'simpl-schema'; +// Define a regular expression for MongoDB ObjectId. +// This is a simple example, you might want to use a more specific regular expression. +const userIdRegEx = /^[a-fA-F0-9]{24}$/; + Lists.schema = new SimpleSchema({ name: {type: String}, incompleteCount: {type: Number, defaultValue: 0}, - userId: {type: String, regEx: SimpleSchema.RegEx.Id, optional: true} + userId: {type: String, regEx: userIdRegEx, optional: true} }); ``` @@ -102,7 +106,7 @@ This example from the Todos app defines a schema with a few simple rules: 2. We specify that the `name` field of a list is required and must be a string. 3. We specify the `incompleteCount` is a number, which on insertion is set to `0` if not otherwise specified. -4. We specify that the `userId`, which is optional, must be a string that looks like the ID of a user document. +4. We specify that the `userId`, which is optional, must be a string that looks like the ID of a user document. SimpleSchema no more supports built-in regular expressions for security reasons, so we have to define it ourselves. Check out the [Simple Schema docs](https://github.com/longshotlabs/simpl-schema#regex) for more information. We attach the schema to the namespace of `Lists` directly, which allows us to check objects against this schema directly whenever we want, such as in a form or [Method](methods.html). In the [next section](#schemas-on-write) we'll see how to use this schema automatically when writing to the collection. diff --git a/guide/source/methods.md b/guide/source/methods.md index 0aa2bc07b8..40c47272c4 100644 --- a/guide/source/methods.md +++ b/guide/source/methods.md @@ -276,15 +276,21 @@ if (!this.isSimulation) { The main thing enabled by the `ValidationError` convention is integration between Methods and the forms that call them. In general, your app is likely to have a one-to-one mapping of forms in the UI to Methods. First, let's define a Method for our business logic: ```js +// Define a regular expression for email validation. +// SimpleSchema do not support built-in validations. +// Follow the doc for more details: https://github.com/longshotlabs/simpl-schema#regex +const emailRegEx = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g; +const amountRegEx = /^\d*\.(\d\d)?$/; + // This Method encodes the form validation requirements. // By defining them in the Method, we do client and server-side // validation in one place. export const insert = new ValidatedMethod({ name: 'Invoices.methods.insert', validate: new SimpleSchema({ - email: { type: String, regEx: SimpleSchema.RegEx.Email }, + email: { type: String, regEx: emailRegEx }, description: { type: String, min: 5 }, - amount: { type: String, regEx: /^\d*\.(\d\d)?$/ } + amount: { type: String, regEx: amountRegEx } }).validator(), run(newInvoice) { // In here, we can be sure that the newInvoice argument is From 87b6aeffae2fcd7f1aadc63815e25fa44b61778f Mon Sep 17 00:00:00 2001 From: Vitor Date: Tue, 20 Jun 2023 19:15:48 -0300 Subject: [PATCH 57/86] doc(guide): keep regEx.id and add a better description for SimpleSchema --- guide/source/collections.md | 10 ++++------ guide/source/methods.md | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/guide/source/collections.md b/guide/source/collections.md index f91fecdd77..c4b126787b 100644 --- a/guide/source/collections.md +++ b/guide/source/collections.md @@ -91,14 +91,10 @@ Let's assume that we have a `Lists` collection. To define a schema for this col ```js import SimpleSchema from 'simpl-schema'; -// Define a regular expression for MongoDB ObjectId. -// This is a simple example, you might want to use a more specific regular expression. -const userIdRegEx = /^[a-fA-F0-9]{24}$/; - Lists.schema = new SimpleSchema({ name: {type: String}, incompleteCount: {type: Number, defaultValue: 0}, - userId: {type: String, regEx: userIdRegEx, optional: true} + userId: {type: String, regEx: SimpleSchema.RegEx.Id, optional: true} }); ``` @@ -106,7 +102,9 @@ This example from the Todos app defines a schema with a few simple rules: 2. We specify that the `name` field of a list is required and must be a string. 3. We specify the `incompleteCount` is a number, which on insertion is set to `0` if not otherwise specified. -4. We specify that the `userId`, which is optional, must be a string that looks like the ID of a user document. SimpleSchema no more supports built-in regular expressions for security reasons, so we have to define it ourselves. Check out the [Simple Schema docs](https://github.com/longshotlabs/simpl-schema#regex) for more information. +4. We specify that the `userId`, which is optional, must be a string that looks like the ID of a user document. + +We're using the SimpleSchema for Meteor related funcitonality, like IDs, but we encourage you to create custom regEx expressions for security reasons, for fields like `email` or `name`. Check out the [Simple Schema docs](https://github.com/longshotlabs/simpl-schema#regex) for more information. We attach the schema to the namespace of `Lists` directly, which allows us to check objects against this schema directly whenever we want, such as in a form or [Method](methods.html). In the [next section](#schemas-on-write) we'll see how to use this schema automatically when writing to the collection. diff --git a/guide/source/methods.md b/guide/source/methods.md index 40c47272c4..a9689a2ef1 100644 --- a/guide/source/methods.md +++ b/guide/source/methods.md @@ -276,9 +276,7 @@ if (!this.isSimulation) { The main thing enabled by the `ValidationError` convention is integration between Methods and the forms that call them. In general, your app is likely to have a one-to-one mapping of forms in the UI to Methods. First, let's define a Method for our business logic: ```js -// Define a regular expression for email validation. -// SimpleSchema do not support built-in validations. -// Follow the doc for more details: https://github.com/longshotlabs/simpl-schema#regex +// Define a regular expression for email and amount validation. const emailRegEx = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g; const amountRegEx = /^\d*\.(\d\d)?$/; @@ -306,6 +304,8 @@ export const insert = new ValidatedMethod({ }); ``` +We encourage you to create custom regEx expressions for security reasons, for fields like `email` and `amout`. For Meteor related functionality, like `IDs`, you can use the `SimpleSchema.RegEx.Id` expression. Check out the [Simple Schema docs](https://github.com/longshotlabs/simpl-schema#regex) for more information. + Let's define an HTML form: ```html From 68cc51365c8f5bcb653cca0971f7ed36a936534f Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Fri, 7 Jul 2023 14:58:54 -0300 Subject: [PATCH 58/86] fix: updating guide edit me page --- guide/_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/_config.yml b/guide/_config.yml index 9bf7c889bc..927889c245 100644 --- a/guide/_config.yml +++ b/guide/_config.yml @@ -3,7 +3,7 @@ subtitle: The Official Guide github_repo: 'meteor/meteor' edit_branch: 'devel' edit_path: 'guide' -content_root: 'content' +content_root: 'source' versions: - '2.12' - '2.11' From 19ce645ff68372fb1650bdf857316ca80daec9d9 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Mon, 10 Jul 2023 18:35:11 -0300 Subject: [PATCH 59/86] Meteor version to 2.13-rc.1 :comet: --- packages/ddp-server/package.js | 2 +- packages/meteor-tool/package.js | 2 +- packages/meteor/package.js | 2 +- packages/mongo/package.js | 2 +- packages/test-in-console/package.js | 2 +- packages/twitter-oauth/package.js | 2 +- scripts/admin/meteor-release-experimental.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/ddp-server/package.js b/packages/ddp-server/package.js index a0399c73ba..b1531b3c67 100644 --- a/packages/ddp-server/package.js +++ b/packages/ddp-server/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Meteor's latency-compensated distributed data server", - version: '2.6.2-rc2130.0', + version: '2.6.2-rc2130.1', documentation: null }); diff --git a/packages/meteor-tool/package.js b/packages/meteor-tool/package.js index b0012747e8..33243fce15 100644 --- a/packages/meteor-tool/package.js +++ b/packages/meteor-tool/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'The Meteor command-line tool', - version: '2.13.0-rc.0', + version: '2.13.0-rc.1', }); Package.includeTool(); diff --git a/packages/meteor/package.js b/packages/meteor/package.js index 2f790e156f..e9627c6048 100644 --- a/packages/meteor/package.js +++ b/packages/meteor/package.js @@ -2,7 +2,7 @@ Package.describe({ summary: "Core Meteor environment", - version: '1.11.3-rc2130.0', + version: '1.11.3-rc2130.1', }); Package.registerBuildPlugin({ diff --git a/packages/mongo/package.js b/packages/mongo/package.js index dfdabfebad..cd0f9f974d 100644 --- a/packages/mongo/package.js +++ b/packages/mongo/package.js @@ -9,7 +9,7 @@ Package.describe({ summary: "Adaptor for using MongoDB and Minimongo over DDP", - version: '1.16.7-rc2130.0', + version: '1.16.7-rc2130.1', }); Npm.depends({ diff --git a/packages/test-in-console/package.js b/packages/test-in-console/package.js index fb5c686910..3a6d442458 100644 --- a/packages/test-in-console/package.js +++ b/packages/test-in-console/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'Run tests noninteractively, with results going to the console.', - version: '1.2.5-rc2130.0', + version: '1.2.5-rc2130.1', }); Package.onUse(function(api) { diff --git a/packages/twitter-oauth/package.js b/packages/twitter-oauth/package.js index 186f818e07..7c4aa0b580 100644 --- a/packages/twitter-oauth/package.js +++ b/packages/twitter-oauth/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Twitter OAuth flow", - version: '1.3.3-rc2130.0' + version: '1.3.3-rc2130.1' }); Package.onUse(function(api) { diff --git a/scripts/admin/meteor-release-experimental.json b/scripts/admin/meteor-release-experimental.json index d1f6ce2ea0..0383b329b7 100644 --- a/scripts/admin/meteor-release-experimental.json +++ b/scripts/admin/meteor-release-experimental.json @@ -1,6 +1,6 @@ { "track": "METEOR", - "version": "2.13-rc.0", + "version": "2.13-rc.1", "recommended": false, "official": false, "description": "Meteor experimental release" From 3ff1b7f5ea9aab3fc3751d4a38f6c98b1588fb9b Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Mon, 17 Jul 2023 09:59:45 -0300 Subject: [PATCH 60/86] Meteor version to 2.13-rc.1 :comet: From 526a10775daa938bf23cae8c3cdcb5e44781e9ea Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Mon, 17 Jul 2023 20:37:08 -0300 Subject: [PATCH 61/86] Meteor version to 2.13-rc.2 :comet: --- packages/ddp-server/package.js | 2 +- packages/meteor-tool/package.js | 2 +- packages/meteor/package.js | 2 +- packages/mongo/package.js | 2 +- packages/test-in-console/package.js | 2 +- packages/twitter-oauth/package.js | 2 +- scripts/admin/meteor-release-experimental.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/ddp-server/package.js b/packages/ddp-server/package.js index b1531b3c67..26feb702a7 100644 --- a/packages/ddp-server/package.js +++ b/packages/ddp-server/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Meteor's latency-compensated distributed data server", - version: '2.6.2-rc2130.1', + version: '2.6.2-rc2130.2', documentation: null }); diff --git a/packages/meteor-tool/package.js b/packages/meteor-tool/package.js index 33243fce15..77ca538ba9 100644 --- a/packages/meteor-tool/package.js +++ b/packages/meteor-tool/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'The Meteor command-line tool', - version: '2.13.0-rc.1', + version: '2.13.0-rc.2', }); Package.includeTool(); diff --git a/packages/meteor/package.js b/packages/meteor/package.js index e9627c6048..7ee2e05e8c 100644 --- a/packages/meteor/package.js +++ b/packages/meteor/package.js @@ -2,7 +2,7 @@ Package.describe({ summary: "Core Meteor environment", - version: '1.11.3-rc2130.1', + version: '1.11.3-rc2130.2', }); Package.registerBuildPlugin({ diff --git a/packages/mongo/package.js b/packages/mongo/package.js index cd0f9f974d..546ca243a5 100644 --- a/packages/mongo/package.js +++ b/packages/mongo/package.js @@ -9,7 +9,7 @@ Package.describe({ summary: "Adaptor for using MongoDB and Minimongo over DDP", - version: '1.16.7-rc2130.1', + version: '1.16.7-rc2130.2', }); Npm.depends({ diff --git a/packages/test-in-console/package.js b/packages/test-in-console/package.js index 3a6d442458..b023bc5e88 100644 --- a/packages/test-in-console/package.js +++ b/packages/test-in-console/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'Run tests noninteractively, with results going to the console.', - version: '1.2.5-rc2130.1', + version: '1.2.5-rc2130.2', }); Package.onUse(function(api) { diff --git a/packages/twitter-oauth/package.js b/packages/twitter-oauth/package.js index 7c4aa0b580..923ad1d223 100644 --- a/packages/twitter-oauth/package.js +++ b/packages/twitter-oauth/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Twitter OAuth flow", - version: '1.3.3-rc2130.1' + version: '1.3.3-rc2130.2' }); Package.onUse(function(api) { diff --git a/scripts/admin/meteor-release-experimental.json b/scripts/admin/meteor-release-experimental.json index 0383b329b7..4457f16188 100644 --- a/scripts/admin/meteor-release-experimental.json +++ b/scripts/admin/meteor-release-experimental.json @@ -1,6 +1,6 @@ { "track": "METEOR", - "version": "2.13-rc.1", + "version": "2.13-rc.2", "recommended": false, "official": false, "description": "Meteor experimental release" From b70e28b6f599ae30415cf34d9aaeb1c3d8a69faf Mon Sep 17 00:00:00 2001 From: vitor Date: Wed, 19 Jul 2023 20:02:36 -0300 Subject: [PATCH 62/86] fix(skell): remove builtin regex expressions from simpleSchema --- guide/source/collections.md | 2 ++ guide/source/methods.md | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/guide/source/collections.md b/guide/source/collections.md index f3aa7d0dad..c4b126787b 100644 --- a/guide/source/collections.md +++ b/guide/source/collections.md @@ -104,6 +104,8 @@ This example from the Todos app defines a schema with a few simple rules: 3. We specify the `incompleteCount` is a number, which on insertion is set to `0` if not otherwise specified. 4. We specify that the `userId`, which is optional, must be a string that looks like the ID of a user document. +We're using the SimpleSchema for Meteor related funcitonality, like IDs, but we encourage you to create custom regEx expressions for security reasons, for fields like `email` or `name`. Check out the [Simple Schema docs](https://github.com/longshotlabs/simpl-schema#regex) for more information. + We attach the schema to the namespace of `Lists` directly, which allows us to check objects against this schema directly whenever we want, such as in a form or [Method](methods.html). In the [next section](#schemas-on-write) we'll see how to use this schema automatically when writing to the collection. You can see that with relatively little code we've managed to restrict the format of a list significantly. You can read more about more complex things that can be done with schemas in the [Simple Schema docs](https://www.npmjs.com/package/simpl-schema). diff --git a/guide/source/methods.md b/guide/source/methods.md index 0aa2bc07b8..a9689a2ef1 100644 --- a/guide/source/methods.md +++ b/guide/source/methods.md @@ -276,15 +276,19 @@ if (!this.isSimulation) { The main thing enabled by the `ValidationError` convention is integration between Methods and the forms that call them. In general, your app is likely to have a one-to-one mapping of forms in the UI to Methods. First, let's define a Method for our business logic: ```js +// Define a regular expression for email and amount validation. +const emailRegEx = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g; +const amountRegEx = /^\d*\.(\d\d)?$/; + // This Method encodes the form validation requirements. // By defining them in the Method, we do client and server-side // validation in one place. export const insert = new ValidatedMethod({ name: 'Invoices.methods.insert', validate: new SimpleSchema({ - email: { type: String, regEx: SimpleSchema.RegEx.Email }, + email: { type: String, regEx: emailRegEx }, description: { type: String, min: 5 }, - amount: { type: String, regEx: /^\d*\.(\d\d)?$/ } + amount: { type: String, regEx: amountRegEx } }).validator(), run(newInvoice) { // In here, we can be sure that the newInvoice argument is @@ -300,6 +304,8 @@ export const insert = new ValidatedMethod({ }); ``` +We encourage you to create custom regEx expressions for security reasons, for fields like `email` and `amout`. For Meteor related functionality, like `IDs`, you can use the `SimpleSchema.RegEx.Id` expression. Check out the [Simple Schema docs](https://github.com/longshotlabs/simpl-schema#regex) for more information. + Let's define an HTML form: ```html From 76c3fda421598ba7fdeebee5ac85354108e78eac Mon Sep 17 00:00:00 2001 From: fauzi9331 <43085033+fauzi9331@users.noreply.github.com> Date: Thu, 20 Jul 2023 15:56:40 +0700 Subject: [PATCH 63/86] Update private npm modules link in structure.md --- guide/source/structure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/source/structure.md b/guide/source/structure.md index cbadb202c6..2dd23c34c3 100644 --- a/guide/source/structure.md +++ b/guide/source/structure.md @@ -316,7 +316,7 @@ The primary challenge is properly sharing code between the different application If you want to create Meteor applications with separate code, you'll have some modules that you'd like to share between them. If those modules are something the wider world could use, you should consider [publishing them to a package system](writing-packages.html), either npm or Atmosphere, depending on whether the code is Meteor-specific or otherwise. -If the code is private, or of no interest to others, it typically makes sense to include the same module in both applications (you *can* do this with [private npm modules](https://www.npmjs.com/private-modules)). There are several ways to do this: +If the code is private, or of no interest to others, it typically makes sense to include the same module in both applications (you *can* do this with [private npm modules](https://docs.npmjs.com/about-private-packages)). There are several ways to do this: - a straightforward approach is to include the common code as a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) of both applications. From e07b89f77b76713adeefe6332922602817ff2062 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 20 Jul 2023 15:23:31 -0300 Subject: [PATCH 64/86] docs: updated changelog --- docs/generators/changelog/versions/2.13.md | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index e18405918b..f3ec8d0fa9 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -26,12 +26,29 @@ TODO #### Meteor Version Release + +* `ddp-server@get-version`: + - Updated livedata server test to be more easily debbuged. + * `Command line`: - Updated metatags for skeletons. - - Updated solidjs skeleton to be more idiomatic. + - Updated solidjs skeleton to be more idiomatic. -* `mongo@1.16.7`: - TODO +* `meteor@1.11.3`: + - Added types for applyAsync and added more documentation for appluAsync options. + +* `mongo@1.16.7`: + - Updated types with projection. + - Fixed wrong upsert logs when using WARN_WHEN_USING_OLD_API flag. + - Handled implicit collection creation oplog message. + +* `test-in-console@1.2.5`: + - Adjusted log indentation. + - All errors will be logged to console. + - Will always use puppeteer@20.4.0 + +* `twitter-oauth@1.3.3`: + - Fixed twitter whitelist issue. #### Special thanks to From e3dd5381cce0abe59b64c993e3df3723f61ba627 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 20 Jul 2023 17:37:14 -0300 Subject: [PATCH 65/86] updated date --- docs/generators/changelog/versions/2.13.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index f3ec8d0fa9..3b3a9a442d 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -1,4 +1,4 @@ -## v2.13.0, 2023-05-XX +## v2.13.0, 2023-08-XX ### Highlights From a97edb2d6f1465a18462f725b5f11b7f741a45ee Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 20 Jul 2023 17:39:01 -0300 Subject: [PATCH 66/86] Update docs/generators/changelog/versions/2.13.md Co-authored-by: zodern --- docs/generators/changelog/versions/2.13.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index 3b3a9a442d..18f207419b 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -35,7 +35,7 @@ TODO - Updated solidjs skeleton to be more idiomatic. * `meteor@1.11.3`: - - Added types for applyAsync and added more documentation for appluAsync options. + - Added types for applyAsync and added more documentation for applyAsync options. * `mongo@1.16.7`: - Updated types with projection. From 3873365bd7895e6864210365999416bb57452318 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 20 Jul 2023 18:20:57 -0300 Subject: [PATCH 67/86] docs: added internal changes section --- docs/generators/changelog/versions/2.13.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index 3b3a9a442d..2f46d2db08 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -15,7 +15,7 @@ N/A -#### Internal API changes +#### Internal changes N/A From e49d16a818fcab815ec228b3a7f4caf9810fb00e Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 20 Jul 2023 18:21:16 -0300 Subject: [PATCH 68/86] docs: added internal changes section --- docs/generators/changelog/versions/2.13.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index 27c3dc9dda..058bf3cd0b 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -17,7 +17,8 @@ N/A #### Internal changes -N/A +* `ddp-server@get-version`: + - Updated livedata server test to be more easily debbuged. #### Migration Steps @@ -27,9 +28,6 @@ TODO -* `ddp-server@get-version`: - - Updated livedata server test to be more easily debbuged. - * `Command line`: - Updated metatags for skeletons. - Updated solidjs skeleton to be more idiomatic. From 584fd1b7e92c6e31f550a59b7f1ad0a50f4b4e73 Mon Sep 17 00:00:00 2001 From: Andre Luis Date: Fri, 21 Jul 2023 15:46:57 -0300 Subject: [PATCH 69/86] docs(flowbite): added flowbite-ui integration docs --- guide/_config.yml | 8 +- guide/source/flowbite.md | 165 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+), 3 deletions(-) create mode 100644 guide/source/flowbite.md diff --git a/guide/_config.yml b/guide/_config.yml index 9bf7c889bc..48678cd570 100644 --- a/guide/_config.yml +++ b/guide/_config.yml @@ -30,7 +30,7 @@ versions: - '1.3' - '1.2' versioned-netlify-redirects: - netlify_site_id: meteor-guide + netlify_site_id: meteor-guide logo: title: @@ -56,6 +56,8 @@ sidebar_categories: - react - angular - vue + Integrations: + - flowbite Mobile: - cordova - react-native @@ -88,7 +90,7 @@ redirects: '/using-packages.html#using-npm': using-npm-packages.html#using-npm '/using-packages.html#npm-styles': using-npm-packages.html#npm-styles '/using-packages.html#npm-shrinkwrap': using-npm-packages.html#npm-shrinkwrap - '/using-packages.html#atmosphere': using-atmosphere-packages.html + '/using-packages.html#atmosphere': using-atmosphere-packages.html '/using-packages.html#atmosphere-searching': using-atmosphere-packages.html#atmosphere-searching '/using-packages.html#atmosphere-naming': using-atmosphere-packages.html#atmosphere-naming '/using-packages.html#installing-atmosphere': using-atmosphere-packages.html#installing-atmosphere @@ -100,7 +102,7 @@ redirects: '/using-packages.html#bind-environment': using-npm-packages.html#bind-environment '/using-packages.html#wrap-async': using-npm-packages.html#wrap-async '/using-packages.html#promises': using-npm-packages.html#promises - '/using-packages.html#overriding-packages': writing-npm-packages.html#overriding-npm-packages + '/using-packages.html#overriding-packages': writing-npm-packages.html#overriding-npm-packages '/using-packages.html#npm-overriding': writing-npm-packages.html#overriding-npm-packages '/using-packages.html#atmosphere-overriding': writing-atmosphere-packages.html#overriding-atmosphere-packages '/using-packages.html#npm-shrinkpack': using-npm-packages.html#npm-shrinkpack diff --git a/guide/source/flowbite.md b/guide/source/flowbite.md new file mode 100644 index 0000000000..ccc0e52497 --- /dev/null +++ b/guide/source/flowbite.md @@ -0,0 +1,165 @@ +--- +title: Flowbite UI +description: Learn how to install Tailwind CSS with Flowbite for your Meteor.js project to build full-stack JavaScript or TypeScript web, mobile, and desktop applications +---## Introduction + +[Flowbite](https://flowbite.com/) is an open-source library of UI components based on the utility-first Tailwind CSS framework featuring dark mode support, a Figma design system, templates, and more. + +It includes all of the commonly used components that a website requires, such as buttons, dropdowns, navigation bars, modals, but also some more advanced interactive elements such as datepickers. + +Using both Meteor.js, Tailwind CSS and Flowbite can help you get started building modern UI web applications by leveraging the extensive framework features of Meteor.js, the utility-first approach of the Tailwind CSS framework and the open-source UI components from the Flowbite Library. + +## Requirements + +Make sure that you have [Node.js v14](https://nodejs.org/en/) installed on your computer to be able to install Meteor.js, Tailwind CSS and Flowbite using NPX and NPM. +For more information on how to install Meteor.js, check out the [official installation guide](https://docs.meteor.com/install.html#prereqs). + +## Create a new meteor project + +#### Create a new `meteor` starter project: + +The easiest way to create a new Meteor.js project is by first installed the CLI globally: + +```bash +npm install -g meteor +``` + +After you have `meteor` installed globally you can go ahead and create a new project: + +```sh +meteor create flowbite-app --tailwind +cd flowbite-app +``` + +This will create a new `meteor` project with `tailwindcss` support. + +No extra configuration needed as we added the `--tailwind` flag when setting up the project. + +Now that you have created a new Meteor.js project with Tailwind CSS configured automatically we can proceed with installing Flowbite and Flowbite React to start leveraging the open-source UI components. + +## Install Flowbite + +1. Install Flowbite and Flowbite React via NPM: + +```bash +npm install --save flowbite flowbite-react +``` + +2. Make sure that you set up the Flowbite plugin and template paths in your `tailwind.config.js` file: + +```js +module.exports = { + content: [ + './imports/ui/**/*.{js,jsx,ts,tsx}', + './client/*.html', + 'node_modules/flowbite-react/**/*.{js,jsx,ts,tsx}', + ], + theme: { + extend: {}, + }, + plugins: [require('flowbite/plugin')], +}; +``` + +3. Now that you have installed the packages you can start importing the UI components: + +```js +import { Alert } from 'flowbite-react'; + +export default function MyPage() { + return Alert!; +} +``` + +The code above will import the `` component that you can use to send feedback messages. + +## Flowbite UI components + +To get you started you can check out the full collection of React components from the [Flowbite React website](https://flowbite-react.com/) and browse the documentation for the source code of each component. + +Here's an example of how you can use the modal and button components by importing them from the Flowbite React package inside your Meteor.js project: + +```javascript +import { Button, Modal } from 'flowbite-react'; + +export default function DefaultModal() { + const [openModal, setOpenModal] = useState(); + const props = { openModal, setOpenModal }; + + return ( + <> + + props.setOpenModal(undefined)}> + Terms of Service + +
+

+ With less than a month to go before the European Union enacts new consumer privacy laws for its citizens, + companies around the world are updating their terms of service agreements to comply. +

+

+ The European Union’s General Data Protection Regulation (G.D.P.R.) goes into effect on May 25 and is meant to + ensure a common set of data rights in the European Union. It requires organizations to notify users as soon as + possible of high-risk data breaches that could personally affect them. +

+
+
+ + + + +
+ + ) +} +``` + +Here's another example of how you can use the dropdown component: + +```javascript +import { Dropdown } from 'flowbite-react'; + + + Dashboard + Settings + Earnings + Sign out +; +``` + +Finally, another example on how you can use the navbar component: + +```javascript +import { Navbar } from 'flowbite-react'; + + + + Flowbite Logo + + Flowbite + + + + + + Home + + About + Services + Pricing + Contact + +; +``` + +To learn more about Flowbite React make sure to check out to the [repository](https://github.com/themesberg/flowbite-react) and the [main website](https://flowbite-react.com/). + +## Meteor.js starter project + +The Flowbite community has created an open-source Meteor.js starter project that has Tailwind CSS and Flowbite React set up beforehand and you can go ahead and clone it by checking out the [repository on GitHub](https://github.com/meteor/flowbite-meteor-starter). From 4f7b3ddb889076c84cacbe1f80c27348344c458e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Luis=20de=20Oliveira?= <65047921+anddreluis2@users.noreply.github.com> Date: Fri, 21 Jul 2023 17:01:27 -0300 Subject: [PATCH 70/86] updated introduction tag Co-authored-by: Frederico Maia --- guide/source/flowbite.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/guide/source/flowbite.md b/guide/source/flowbite.md index ccc0e52497..b1568fd80f 100644 --- a/guide/source/flowbite.md +++ b/guide/source/flowbite.md @@ -1,7 +1,9 @@ --- title: Flowbite UI description: Learn how to install Tailwind CSS with Flowbite for your Meteor.js project to build full-stack JavaScript or TypeScript web, mobile, and desktop applications ----## Introduction +--- + +## Introduction [Flowbite](https://flowbite.com/) is an open-source library of UI components based on the utility-first Tailwind CSS framework featuring dark mode support, a Figma design system, templates, and more. From a38b2afc2912c4aebdd0aa03e9ccade37c2bc21e Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Mon, 24 Jul 2023 13:49:51 -0300 Subject: [PATCH 71/86] Meteor version to 2.13-rc.3 :comet: --- packages/ddp-server/package.js | 2 +- packages/meteor-tool/package.js | 2 +- packages/meteor/package.js | 2 +- packages/mongo/package.js | 2 +- packages/test-in-console/package.js | 2 +- packages/twitter-oauth/package.js | 2 +- scripts/admin/meteor-release-experimental.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/ddp-server/package.js b/packages/ddp-server/package.js index 26feb702a7..26ab084558 100644 --- a/packages/ddp-server/package.js +++ b/packages/ddp-server/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Meteor's latency-compensated distributed data server", - version: '2.6.2-rc2130.2', + version: '2.6.2-rc2130.3', documentation: null }); diff --git a/packages/meteor-tool/package.js b/packages/meteor-tool/package.js index 77ca538ba9..a648921d02 100644 --- a/packages/meteor-tool/package.js +++ b/packages/meteor-tool/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'The Meteor command-line tool', - version: '2.13.0-rc.2', + version: '2.13.0-rc.3', }); Package.includeTool(); diff --git a/packages/meteor/package.js b/packages/meteor/package.js index 7ee2e05e8c..875ac4661f 100644 --- a/packages/meteor/package.js +++ b/packages/meteor/package.js @@ -2,7 +2,7 @@ Package.describe({ summary: "Core Meteor environment", - version: '1.11.3-rc2130.2', + version: '1.11.3-rc2130.3', }); Package.registerBuildPlugin({ diff --git a/packages/mongo/package.js b/packages/mongo/package.js index 546ca243a5..d6cdac9379 100644 --- a/packages/mongo/package.js +++ b/packages/mongo/package.js @@ -9,7 +9,7 @@ Package.describe({ summary: "Adaptor for using MongoDB and Minimongo over DDP", - version: '1.16.7-rc2130.2', + version: '1.16.7-rc2130.3', }); Npm.depends({ diff --git a/packages/test-in-console/package.js b/packages/test-in-console/package.js index b023bc5e88..74a12c54c9 100644 --- a/packages/test-in-console/package.js +++ b/packages/test-in-console/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'Run tests noninteractively, with results going to the console.', - version: '1.2.5-rc2130.2', + version: '1.2.5-rc2130.3', }); Package.onUse(function(api) { diff --git a/packages/twitter-oauth/package.js b/packages/twitter-oauth/package.js index 923ad1d223..c3fc7ff23b 100644 --- a/packages/twitter-oauth/package.js +++ b/packages/twitter-oauth/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Twitter OAuth flow", - version: '1.3.3-rc2130.2' + version: '1.3.3-rc2130.3' }); Package.onUse(function(api) { diff --git a/scripts/admin/meteor-release-experimental.json b/scripts/admin/meteor-release-experimental.json index 4457f16188..9ed485d9d8 100644 --- a/scripts/admin/meteor-release-experimental.json +++ b/scripts/admin/meteor-release-experimental.json @@ -1,6 +1,6 @@ { "track": "METEOR", - "version": "2.13-rc.2", + "version": "2.13-rc.3", "recommended": false, "official": false, "description": "Meteor experimental release" From 42472e17856445ba702fbe7d38ad072baac8741f Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:19:21 -0300 Subject: [PATCH 72/86] docs: added missing PRs --- docs/generators/changelog/versions/2.13.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index 058bf3cd0b..666b313a68 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -10,6 +10,10 @@ * Update mongo.d.ts with projection [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12635). * Update guide code for GraphQL [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12619). * Twitter Whitelist issue resolved [Atharshoyeb](https://github.com/Atharshoyeb) [PR](https://github.com/meteor/meteor/pull/12369). +* Node security patch (14.21.4) [PR](https://github.com/meteor/node-v14-esm/pull/1) +* Updated deprecated reference in Mongo package by [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12653/files) +* Updated blazejs git ref in core meteor to 2.7.1 by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12651) +* Added `Meteor.applyAsync` types by [Julusian](https://github.com/Julusian) [PR](https://github.com/meteor/meteor/pull/12645) #### Breaking Changes @@ -20,14 +24,16 @@ N/A * `ddp-server@get-version`: - Updated livedata server test to be more easily debbuged. +* `mongo@get-version`: + - Updated deprecated reference in Mongo package. + #### Migration Steps -TODO +N/A #### Meteor Version Release - * `Command line`: - Updated metatags for skeletons. - Updated solidjs skeleton to be more idiomatic. From 602545ed1d51a5781131bda82993b4b17b8fd825 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 26 Jul 2023 08:24:17 -0300 Subject: [PATCH 73/86] docs: added missing thanks username --- docs/generators/changelog/versions/2.13.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index 666b313a68..655f1c8c41 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -62,4 +62,5 @@ N/A - [@fredmaiaarantes](https://github.com/fredmaiaarantes). - [@StorytellerCZ](https://github.com/StorytellerCZ). - [@Atharshoyeb](https://github.com/Atharshoyeb). +- [@Julusian](https://github.com/Julusian). From 81000f650f71e577d609ed5bcc5e3faa168978bf Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 26 Jul 2023 08:24:26 -0300 Subject: [PATCH 74/86] docs: updated migration guide --- guide/source/2.13-migration.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/guide/source/2.13-migration.md b/guide/source/2.13-migration.md index c9f43f0305..1b98886134 100644 --- a/guide/source/2.13-migration.md +++ b/guide/source/2.13-migration.md @@ -3,18 +3,23 @@ title: Migrating to Meteor 2.13 description: How to migrate your application to Meteor 2.13. --- -Most of the new features in Meteor 2.13 are either applied directly behind the +Most of the new features in Meteor 2.13 are either applied directly behind the scenes (in a backwards compatible manner) or are opt-in. For a complete breakdown of the changes, please refer to the [changelog](http://docs.meteor.com/changelog.html). -The above being said, there are a few items that you should implement to +The above being said, there are a few items that you should implement to have easier time in the future. -TODO +For this release all the changes are for quality of life improvements and +there are no breaking changes. + +for more information on the changes in this release, please refer to the +[changelog](http://docs.meteor.com/changelog.html). +

Migrating from a version older than 2.12?

-If you're migrating from a version of Meteor older than Meteor 2.12, there may +If you're migrating from a version of Meteor older than Meteor 2.12, there may be important considerations not listed in this guide. Please review the older migration guides for details: From 255389f4e2b088ed236dcf396cd4dec95ef89bb8 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 26 Jul 2023 08:24:36 -0300 Subject: [PATCH 75/86] chore: formated script --- docs/generators/changelog/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generators/changelog/script.js b/docs/generators/changelog/script.js index 3239d2c29e..d762fbb241 100755 --- a/docs/generators/changelog/script.js +++ b/docs/generators/changelog/script.js @@ -46,7 +46,7 @@ const main = async () => { .map(file => { console.log(`reading file: ${ file }`); return { - fileName: file, + fileName: file, buf : fs.readFile(`./generators/changelog/versions/${ file }`, 'utf8') }; }) @@ -80,7 +80,7 @@ const main = async () => { ) return file; // add the contribuitors - const contribuitorsList = + const contribuitorsList = Array .from(contribuitors) .map(name => `- [@${ name }](https://github.com/${ name }).`) From 685ea6c66fa4b76a83c3b6d4ffd2e932be2f4533 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 26 Jul 2023 10:54:27 -0300 Subject: [PATCH 76/86] docs: removed unecessary bit for migration guide --- docs/generators/changelog/versions/2.13.md | 1 + guide/source/2.13-migration.md | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index 655f1c8c41..e905837bec 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -15,6 +15,7 @@ * Updated blazejs git ref in core meteor to 2.7.1 by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12651) * Added `Meteor.applyAsync` types by [Julusian](https://github.com/Julusian) [PR](https://github.com/meteor/meteor/pull/12645) + #### Breaking Changes N/A diff --git a/guide/source/2.13-migration.md b/guide/source/2.13-migration.md index 1b98886134..5dba0f0102 100644 --- a/guide/source/2.13-migration.md +++ b/guide/source/2.13-migration.md @@ -7,9 +7,6 @@ Most of the new features in Meteor 2.13 are either applied directly behind the scenes (in a backwards compatible manner) or are opt-in. For a complete breakdown of the changes, please refer to the [changelog](http://docs.meteor.com/changelog.html). -The above being said, there are a few items that you should implement to -have easier time in the future. - For this release all the changes are for quality of life improvements and there are no breaking changes. From b6092b3e7f77a2a1699eedcbba7272359646b44f Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 26 Jul 2023 14:52:02 -0300 Subject: [PATCH 77/86] =?UTF-8?q?Meteor=20version=20to=202.13=C2=A0:comet:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/generators/changelog/versions/2.13.md | 2 +- npm-packages/meteor-installer/config.js | 2 +- packages/ddp-server/package.js | 2 +- packages/meteor-tool/package.js | 2 +- packages/meteor/package.js | 2 +- packages/mongo/package.js | 2 +- packages/test-in-console/package.js | 2 +- packages/twitter-oauth/package.js | 2 +- scripts/admin/meteor-release-official.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index e905837bec..bc3cada768 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -1,4 +1,4 @@ -## v2.13.0, 2023-08-XX +## v2.13.0, 2023-07-26 ### Highlights diff --git a/npm-packages/meteor-installer/config.js b/npm-packages/meteor-installer/config.js index 1189460dfc..9648480e92 100644 --- a/npm-packages/meteor-installer/config.js +++ b/npm-packages/meteor-installer/config.js @@ -1,7 +1,7 @@ const path = require('path'); const os = require('os'); -const METEOR_LATEST_VERSION = '2.12'; +const METEOR_LATEST_VERSION = '2.13'; const sudoUser = process.env.SUDO_USER || ''; function isRoot() { return process.getuid && process.getuid() === 0; diff --git a/packages/ddp-server/package.js b/packages/ddp-server/package.js index 26ab084558..a88a70d07e 100644 --- a/packages/ddp-server/package.js +++ b/packages/ddp-server/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Meteor's latency-compensated distributed data server", - version: '2.6.2-rc2130.3', + version: '2.6.2', documentation: null }); diff --git a/packages/meteor-tool/package.js b/packages/meteor-tool/package.js index a648921d02..3b939ba9b3 100644 --- a/packages/meteor-tool/package.js +++ b/packages/meteor-tool/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'The Meteor command-line tool', - version: '2.13.0-rc.3', + version: '2.13.0', }); Package.includeTool(); diff --git a/packages/meteor/package.js b/packages/meteor/package.js index 875ac4661f..e537ce4a9d 100644 --- a/packages/meteor/package.js +++ b/packages/meteor/package.js @@ -2,7 +2,7 @@ Package.describe({ summary: "Core Meteor environment", - version: '1.11.3-rc2130.3', + version: '1.11.3', }); Package.registerBuildPlugin({ diff --git a/packages/mongo/package.js b/packages/mongo/package.js index d6cdac9379..5058e52517 100644 --- a/packages/mongo/package.js +++ b/packages/mongo/package.js @@ -9,7 +9,7 @@ Package.describe({ summary: "Adaptor for using MongoDB and Minimongo over DDP", - version: '1.16.7-rc2130.3', + version: '1.16.7', }); Npm.depends({ diff --git a/packages/test-in-console/package.js b/packages/test-in-console/package.js index 74a12c54c9..424ac2e8ac 100644 --- a/packages/test-in-console/package.js +++ b/packages/test-in-console/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'Run tests noninteractively, with results going to the console.', - version: '1.2.5-rc2130.3', + version: '1.2.5', }); Package.onUse(function(api) { diff --git a/packages/twitter-oauth/package.js b/packages/twitter-oauth/package.js index c3fc7ff23b..fb73a52662 100644 --- a/packages/twitter-oauth/package.js +++ b/packages/twitter-oauth/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Twitter OAuth flow", - version: '1.3.3-rc2130.3' + version: '1.3.3' }); Package.onUse(function(api) { diff --git a/scripts/admin/meteor-release-official.json b/scripts/admin/meteor-release-official.json index dc54967094..65c2ce96a4 100644 --- a/scripts/admin/meteor-release-official.json +++ b/scripts/admin/meteor-release-official.json @@ -1,6 +1,6 @@ { "track": "METEOR", - "version": "2.12", + "version": "2.13", "recommended": false, "official": true, "description": "The Official Meteor Distribution" From c0de58c2ca2d0eb719e22c8bd113a71aab583bd5 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 26 Jul 2023 16:07:22 -0300 Subject: [PATCH 78/86] chore: added latest npm --- npm-packages/meteor-installer/README.md | 1 + npm-packages/meteor-installer/package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/npm-packages/meteor-installer/README.md b/npm-packages/meteor-installer/README.md index e3c5bb6110..a83364d492 100644 --- a/npm-packages/meteor-installer/README.md +++ b/npm-packages/meteor-installer/README.md @@ -14,6 +14,7 @@ npm install -g meteor | NPM Package | Meteor Official Release | |-------------|-------------------------| +| 2.13.0 | 2.13.0 | | 2.12.1 | 2.12.0 | | 2.12.0 | 2.12.0 | | 2.11.0 | 2.11.0 | diff --git a/npm-packages/meteor-installer/package.json b/npm-packages/meteor-installer/package.json index 3fd7d4a177..f3e5669f1b 100644 --- a/npm-packages/meteor-installer/package.json +++ b/npm-packages/meteor-installer/package.json @@ -1,6 +1,6 @@ { "name": "meteor", - "version": "2.12.1", + "version": "2.13.0", "description": "Install Meteor", "main": "install.js", "scripts": { From e4de9661c26cbee9f1ab4c7086797c8ded91edee Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:22:20 -0300 Subject: [PATCH 79/86] Update docs/generators/changelog/versions/2.13.md Co-authored-by: Frederico Maia --- docs/generators/changelog/versions/2.13.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index bc3cada768..e80349a7ba 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -13,7 +13,7 @@ * Node security patch (14.21.4) [PR](https://github.com/meteor/node-v14-esm/pull/1) * Updated deprecated reference in Mongo package by [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12653/files) * Updated blazejs git ref in core meteor to 2.7.1 by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12651) -* Added `Meteor.applyAsync` types by [Julusian](https://github.com/Julusian) [PR](https://github.com/meteor/meteor/pull/12645) +* Added `Meteor.applyAsync` types by [Julusian](https://github.com/Julusian) [PR](https://github.com/meteor/meteor/pull/12645). #### Breaking Changes From 42f549bb7e608f9462fdaa5185c999f241477d81 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:22:26 -0300 Subject: [PATCH 80/86] Update docs/generators/changelog/versions/2.13.md Co-authored-by: Frederico Maia --- docs/generators/changelog/versions/2.13.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index e80349a7ba..b26ad332c5 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -12,7 +12,7 @@ * Twitter Whitelist issue resolved [Atharshoyeb](https://github.com/Atharshoyeb) [PR](https://github.com/meteor/meteor/pull/12369). * Node security patch (14.21.4) [PR](https://github.com/meteor/node-v14-esm/pull/1) * Updated deprecated reference in Mongo package by [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12653/files) -* Updated blazejs git ref in core meteor to 2.7.1 by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12651) +* Updated BlazeJS git ref in core meteor to 2.7.1 by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12651). * Added `Meteor.applyAsync` types by [Julusian](https://github.com/Julusian) [PR](https://github.com/meteor/meteor/pull/12645). From 0f04f3c2ecbe7cd78772db1b03ad617da5e7800f Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:22:33 -0300 Subject: [PATCH 81/86] Update docs/generators/changelog/versions/2.13.md Co-authored-by: Frederico Maia --- docs/generators/changelog/versions/2.13.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index b26ad332c5..30292a2c81 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -11,7 +11,7 @@ * Update guide code for GraphQL [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12619). * Twitter Whitelist issue resolved [Atharshoyeb](https://github.com/Atharshoyeb) [PR](https://github.com/meteor/meteor/pull/12369). * Node security patch (14.21.4) [PR](https://github.com/meteor/node-v14-esm/pull/1) -* Updated deprecated reference in Mongo package by [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12653/files) +* Updated deprecated reference in MongoDB package by [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12653/files). * Updated BlazeJS git ref in core meteor to 2.7.1 by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12651). * Added `Meteor.applyAsync` types by [Julusian](https://github.com/Julusian) [PR](https://github.com/meteor/meteor/pull/12645). From 26ecda266058b3c19e61b4999b7cca9a756ff4cf Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:22:40 -0300 Subject: [PATCH 82/86] Update docs/generators/changelog/versions/2.13.md Co-authored-by: Frederico Maia --- docs/generators/changelog/versions/2.13.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index 30292a2c81..7055420148 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -10,7 +10,7 @@ * Update mongo.d.ts with projection [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12635). * Update guide code for GraphQL [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12619). * Twitter Whitelist issue resolved [Atharshoyeb](https://github.com/Atharshoyeb) [PR](https://github.com/meteor/meteor/pull/12369). -* Node security patch (14.21.4) [PR](https://github.com/meteor/node-v14-esm/pull/1) +* Node security patch (14.21.4) [PR](https://github.com/meteor/node-v14-esm/pull/1). * Updated deprecated reference in MongoDB package by [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12653/files). * Updated BlazeJS git ref in core meteor to 2.7.1 by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12651). * Added `Meteor.applyAsync` types by [Julusian](https://github.com/Julusian) [PR](https://github.com/meteor/meteor/pull/12645). From a67df6571808a08a60a67223931f538ed542b024 Mon Sep 17 00:00:00 2001 From: Caio Borghi Date: Sun, 30 Jul 2023 18:56:15 -0300 Subject: [PATCH 83/86] fix react logo on README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ff1089850..9cb1309dc0 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Use the same code whether you’re developing for web, iOS, Android, or desktop How about trying a getting started tutorial in your favorite technology? -| [ React](https://react-tutorial.meteor.com/) | +| [ React](https://react-tutorial.meteor.com/) | | - | | [ Blaze](https://blaze-tutorial.meteor.com/) | | [ Vue](https://vue-tutorial.meteor.com/) | From 4992aad99f4b6ad05b118ed5220e46a6a2099801 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 1 Aug 2023 11:32:21 -0300 Subject: [PATCH 84/86] small docs update --- docs/generators/changelog/versions/2.13.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/changelog/versions/2.13.md b/docs/generators/changelog/versions/2.13.md index 7055420148..52751ecae3 100644 --- a/docs/generators/changelog/versions/2.13.md +++ b/docs/generators/changelog/versions/2.13.md @@ -11,7 +11,7 @@ * Update guide code for GraphQL [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12619). * Twitter Whitelist issue resolved [Atharshoyeb](https://github.com/Atharshoyeb) [PR](https://github.com/meteor/meteor/pull/12369). * Node security patch (14.21.4) [PR](https://github.com/meteor/node-v14-esm/pull/1). -* Updated deprecated reference in MongoDB package by [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12653/files). +* Updated deprecated reference in mongo package by [StorytellerCZ](https://github.com/StorytellerCZ) [PR](https://github.com/meteor/meteor/pull/12653/files). * Updated BlazeJS git ref in core meteor to 2.7.1 by [Grubba27](https://github.com/Grubba27) [PR](https://github.com/meteor/meteor/pull/12651). * Added `Meteor.applyAsync` types by [Julusian](https://github.com/Julusian) [PR](https://github.com/meteor/meteor/pull/12645). From cb6c97dc5f9897b61a5479d415a61ae2b61d1fac Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 1 Aug 2023 15:42:29 -0300 Subject: [PATCH 85/86] chore: updated to be on par with 3.0 --- packages/mongo/collection_tests.js | 2 +- packages/mongo/mongo_driver.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mongo/collection_tests.js b/packages/mongo/collection_tests.js index 116730ffc7..b8084aa783 100644 --- a/packages/mongo/collection_tests.js +++ b/packages/mongo/collection_tests.js @@ -471,7 +471,7 @@ Meteor.isServer && Tinytest.addAsync('collection - simple add', async function(t var collection = new Mongo.Collection(collectionName); var id = await collection.insertAsync({a: 1}); test.equal((await collection.findOneAsync(id)).a, 1); - collection.upsertAsync(id, {$set: {a: 2}}); + await collection.upsertAsync(id, {$set: {a: 2}}); id = await collection.insertAsync({a: 2}); test.equal((await collection.findOneAsync(id)).a, 2); await collection.removeAsync({}); diff --git a/packages/mongo/mongo_driver.js b/packages/mongo/mongo_driver.js index f4e84847c3..9e5036634d 100644 --- a/packages/mongo/mongo_driver.js +++ b/packages/mongo/mongo_driver.js @@ -212,7 +212,7 @@ MongoConnection = function (url, options) { self._oplogHandle = new OplogHandle(options.oplogUrl, self.db.databaseName); self._docFetcher = new DocFetcher(self); } - Promise.await(self.client.connect()) + }; MongoConnection.prototype._close = async function() { From 70739af59061f4899a1979a16c596da945918373 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Tue, 1 Aug 2023 17:08:47 -0300 Subject: [PATCH 86/86] removed isCallFromAsync --- packages/minimongo/cursor.js | 1 - packages/mongo/collection.js | 62 ++-------------------------------- packages/mongo/mongo_driver.js | 3 +- 3 files changed, 3 insertions(+), 63 deletions(-) diff --git a/packages/minimongo/cursor.js b/packages/minimongo/cursor.js index c8cb2f9b7a..eedb89988d 100644 --- a/packages/minimongo/cursor.js +++ b/packages/minimongo/cursor.js @@ -538,7 +538,6 @@ ASYNC_CURSOR_METHODS.forEach(method => { const asyncName = getAsyncMethodName(method); Cursor.prototype[asyncName] = function(...args) { try { - this[method].isCalledFromAsync = true; return Promise.resolve(this[method].apply(this, args)); } catch (error) { return Promise.reject(error); diff --git a/packages/mongo/collection.js b/packages/mongo/collection.js index b2d34f96b6..73d8590563 100644 --- a/packages/mongo/collection.js +++ b/packages/mongo/collection.js @@ -6,24 +6,7 @@ import { } from "meteor/minimongo/constants"; import { normalizeProjection } from "./mongo_utils"; -export function warnUsingOldApi ( - methodName, - collectionName, - isCalledFromAsync - ){ - if ( - process.env.WARN_WHEN_USING_OLD_API && // also ensures it is on the server - !isCalledFromAsync // must be true otherwise we should log - ) { - if (collectionName === undefined || collectionName.includes('oplog')) return - console.warn(` - Calling method ${collectionName}.${methodName} from old API on server. - This method will be removed, from the server, in version 3. - Trace is below:`) - console.trace() - }; -} /** * @summary Namespace for MongoDB-related items * @namespace @@ -671,14 +654,6 @@ Object.assign(Mongo.Collection.prototype, { throw new Error('insert requires an argument'); } - // [FIBERS] - // TODO: Remove this when 3.0 is released. - warnUsingOldApi( - "insert", - this._name, - this.insert.isCalledFromAsync - ); - this.insert.isCalledFromAsync = false; // Make a shallow clone of the document, preserving its prototype. doc = Object.create( @@ -962,15 +937,6 @@ Object.assign(Mongo.Collection.prototype, { } } - // [FIBERS] - // TODO: Remove this when 3.0 is released. - warnUsingOldApi( - "update", - this._name, - this.update.isCalledFromAsync - ); - this.update.isCalledFromAsync = false; - selector = Mongo.Collection._rewriteSelector(selector, { fallbackId: insertedId, }); @@ -1043,14 +1009,7 @@ Object.assign(Mongo.Collection.prototype, { return this._callMutatorMethod('remove', [selector]); } - // [FIBERS] - // TODO: Remove this when 3.0 is released. - warnUsingOldApi( - "remove", - this._name, - this.remove.isCalledFromAsync - ); - this.remove.isCalledFromAsync = false; + // it's my collection. descend into the collection1 object // and propagate any exception. return this._collection.remove(selector); @@ -1153,14 +1112,7 @@ Object.assign(Mongo.Collection.prototype, { var self = this; if (!self._collection.createIndexAsync) throw new Error('Can only call createIndexAsync on server collections'); - // [FIBERS] - // TODO: Remove this when 3.0 is released. - warnUsingOldApi( - "createIndex", - self._name, - self.createIndex.isCalledFromAsync - ); - self.createIndex.isCalledFromAsync = false; + try { await self._collection.createIndexAsync(index, options); } catch (e) { @@ -1213,16 +1165,6 @@ Object.assign(Mongo.Collection.prototype, { throw new Error( 'Can only call createCappedCollectionAsync on server collections' ); - - // [FIBERS] - // TODO: Remove this when 3.0 is released. - warnUsingOldApi( - "_createCappedCollection", - self._name, - self._createCappedCollection.isCalledFromAsync - ); - self._createCappedCollection.isCalledFromAsync = false; - self._collection._createCappedCollection(byteSize, maxDocuments); await self._collection.createCappedCollectionAsync(byteSize, maxDocuments); }, diff --git a/packages/mongo/mongo_driver.js b/packages/mongo/mongo_driver.js index 9e5036634d..0c2e021036 100644 --- a/packages/mongo/mongo_driver.js +++ b/packages/mongo/mongo_driver.js @@ -212,7 +212,7 @@ MongoConnection = function (url, options) { self._oplogHandle = new OplogHandle(options.oplogUrl, self.db.databaseName); self._docFetcher = new DocFetcher(self); } - + }; MongoConnection.prototype._close = async function() { @@ -887,7 +887,6 @@ Cursor.prototype.countAsync = async function () { const methodNameAsync = getAsyncMethodName(methodName); Cursor.prototype[methodNameAsync] = function (...args) { try { - this[methodName].isCalledFromAsync = true; return Promise.resolve(this[methodName](...args)); } catch (error) { return Promise.reject(error);