diff --git a/docs/history.md b/docs/history.md index a1ebdc3b7a..6a845af21d 100644 --- a/docs/history.md +++ b/docs/history.md @@ -1,3 +1,54 @@ +## v2.9.1, 2022-12-27 + +### Highlights + +* Reverted missing types [PR](https://github.com/meteor/meteor/pull/12366) by [Grubba27](https://github.com/Grubba27). +* Fix fetch() type declaration [PR](https://github.com/meteor/meteor/pull/12352) by [zarvox](https://github.com/zarvox). +* update svelte skeleton [PR](https://github.com/meteor/meteor/pull/12350) by [tosinek](https://github.com/tosinek). +* Bump to node 14.21.2.0 [PR](https://github.com/meteor/meteor/pull/12370) by [Grubba27](https://github.com/Grubba27). +* resetPassword and verifyEmail to no longer sign in the user automatically [PR](https://github.com/meteor/meteor/pull/12385) by [denihs](https://github.com/denihs). +* Added missing vue2 declaration for skeletons [PR](https://github.com/meteor/meteor/pull/12396) by [Grubba27](https://github.com/Grubba27) & [mlanning](https://github.com/mlanning). + +#### Breaking Changes + +* `accounts-password@2.3.3` + - The methods `resetPassword` and `verifyEmail` no longer logs the user if they have 2FA enabled. Now, the functions work as before, but instead of automatically logging in the user at the end, an error with the code `2fa-enabled` will be thrown. + + +#### Internal API changes + +N/A + +#### Migration Steps + +N/A + +#### Meteor Version Release + +* `fetch@0.1.3`: + - Updated fetch type definition. + +* `meteor@1.10.4`: + - Added back meteor type definitions that were removed by mistake in earlier version. + +* `accounts-password@2.3.3` + - The methods `resetPassword` and `verifyEmail` no longer logs the user if they have 2FA enabled. Now, the functions work as before, but instead of automatically logging in the user at the end, an error with the code `2fa-enabled` will be thrown. + +* `Command line`: + - Updated Svelte skeleton to now be able to support typescript out of the box and added ``#each`` in links in the skeleton. + - Updated node to 14.21.2 changes can be seen [here](https://github.com/nodejs/node/releases/tag/v14.21.2). + - Solved [issue](https://github.com/meteor/meteor/issues/12395) that could not allow vue2 apps being created in command line. + +#### Special thanks to +- [@zarvox](https://github.com/zarvox). +- [@tosinek](https://github.com/tosinek). +- [@Grubba27](https://github.com/Grubba27). +- [@denihs](https://github.com/denihs). +- [@mlanning](https://github.com/mlanning). + +For making this great framework even better! + + ## v2.9, 2022-12-12 ### Highlights diff --git a/docs/source/api/passwords.md b/docs/source/api/passwords.md index 49bcff2e6d..a1967e174e 100644 --- a/docs/source/api/passwords.md +++ b/docs/source/api/passwords.md @@ -59,6 +59,10 @@ email with a link the user can use to verify their email address. {% apibox "Accounts.verifyEmail" %} +If the user trying to verify the email has 2FA enabled, this error will be thrown: +* "Email verified, but user not logged in because 2FA is enabled [2fa-enabled]": No longer signing in the user automatically if the user has 2FA enabled. + + This function accepts tokens passed into the callback registered with [`Accounts.onEmailVerificationLink`](#Accounts-onEmailVerificationLink). @@ -89,6 +93,9 @@ This function accepts tokens passed into the callbacks registered with [`AccountsClient#onResetPasswordLink`](#Accounts-onResetPasswordLink) and [`Accounts.onEnrollmentLink`](#Accounts-onEnrollmentLink). +If the user trying to reset the password has 2FA enabled, this error will be thrown: +* "Changed password, but user not logged in because 2FA is enabled [2fa-enabled]": No longer signing in the user automatically if the user has 2FA enabled. + {% apibox "Accounts.setPassword" %} {% apibox "Accounts.sendResetPasswordEmail" %} diff --git a/docs/source/commandline.md b/docs/source/commandline.md index a3a242df17..0fec5f634d 100644 --- a/docs/source/commandline.md +++ b/docs/source/commandline.md @@ -174,38 +174,38 @@ Create a basic [Solid](https://www.solidjs.com/) app. | | Default (`--react`) | `--bare` | `--full` | `--minimal` | `--blaze` | `--apollo` | `--vue-2` | `--svelte` | `--tailwind` | `--chakra-ui` | `--solid` | `--vue` | |------------------------------------------------------------------------------------------------------|:-------------------:|:--------:|:--------:|:-----------:|:---------:|:----------:|:---------:|:----------:|:------------:|:-------------:|:---------:|:-------:| -| [autopublish](https://atmospherejs.com/meteor/autopublish) | X | | | | X | | | X | X | X | X | | +| [autopublish](https://atmospherejs.com/meteor/autopublish) | X | | | | X | | | | X | X | X | | | [akryum:vue-component](https://atmospherejs.com/akryum/vue-component) | | | | | | | X | | | | | | | [apollo](https://atmospherejs.com/meteor/apollo) | | | | | | X | | | | | | | | [blaze-html-templates](https://atmospherejs.com/meteor/blaze-html-templates) | | | X | | X | | | | | | | | | [ecmascript](https://atmospherejs.com/meteor/ecmascript) | X | X | X | X | X | X | X | X | X | X | X | X | | [es5-shim](https://atmospherejs.com/meteor/es5-shim) | X | X | X | X | X | X | X | X | X | X | X | X | -| [hot-module-replacement](https://atmospherejs.com/meteor/hot-module-replacement) | X | | | | X | X | | | X | X | X | X | -| [insecure](https://atmospherejs.com/meteor/insecure) | X | | | | X | | | X | X | X | X | X | +| [hot-module-replacement](https://atmospherejs.com/meteor/hot-module-replacement) | X | | | | X | X | | X | X | X | X | X | +| [insecure](https://atmospherejs.com/meteor/insecure) | X | | | | X | | | | X | X | X | X | | [johanbrook:publication-collector](https://atmospherejs.com/meteor/johanbrook/publication-collector) | | | X | | | X | | | | | | | | [jquery](https://atmospherejs.com/meteor/jquery) | | | X | | X | | | | | | | | -| [ostrio:flow-router-extra](https://atmospherejs.com/meteor/ostrio/flow-router-extra) | | | X | | | | | | | | | | | [less](https://atmospherejs.com/meteor/less) | | | X | | | | | | | | | | | [meteor](https://atmospherejs.com/meteor/meteor) | | | | X | | | | | | | | | | [meteor-base](https://atmospherejs.com/meteor/meteor-base) | X | X | X | | X | X | X | X | X | X | X | X | | [mobile-experience](https://atmospherejs.com/meteor/mobile-experience) | X | X | X | | X | X | X | X | X | X | X | X | | [mongo](https://atmospherejs.com/meteor/mongo) | X | X | X | | X | X | X | X | X | X | X | X | | [meteortesting:mocha](https://atmospherejs.com/meteortesting/mocha) | | | X | | | | X | | | | | | -| [reactive-var](https://atmospherejs.com/meteor/reactive-var) | X | X | X | | X | X | X | X | X | X | X | X | -| [rdb:svelte-meteor-data](https://atmospherejs.com/rdb/svelte-meteor-data) | | | | | | | | X | | | | | +| [ostrio:flow-router-extra](https://atmospherejs.com/meteor/ostrio/flow-router-extra) | | | X | | | | | | | | | | +| [react-meteor-data](https://atmospherejs.com/meteor/react-meteor-data) | X | | | | | | | | X | X | | | +| [reactive-var](https://atmospherejs.com/meteor/reactive-var) | X | X | X | | X | X | X | | X | X | X | X | | [server-render](https://atmospherejs.com/meteor/server-render) | | | | X | | X | X | | | | | | | [shell-server](https://atmospherejs.com/meteor/shell-server) | | X | | X | X | X | X | X | X | X | X | X | | [standard-minifier-css](https://atmospherejs.com/meteor/standard-minifier-css) | X | X | X | X | X | X | X | X | X | X | X | X | | [standard-minifier-js](https://atmospherejs.com/meteor/standard-minifier-js) | X | X | X | X | X | X | X | X | X | X | X | X | | [static-html](https://atmospherejs.com/meteor/static-html) | | X | | X | | X | X | X | | | | | -| [svelte:compiler](https://atmospherejs.com/svelte/compiler) | | | | | | | | X | | | | | | [swydo:graphql](https://atmospherejs.com/swydo/graphql) | | | | | | X | | | | | | | | [tailwindcss](https://tailwindcss.com) | | X | X | | X | | X | | X | | | | | [tracker](https://atmospherejs.com/meteor/tracker) | | X | X | | X | | X | | | | | | | [typescript](https://atmospherejs.com/meteor/typescript) | X | X | X | X | X | X | X | X | X | X | X | | -| [webapp](https://atmospherejs.com/meteor/webapp) | | | | X | | | | | | | | | -| [react-meteor-data](https://atmospherejs.com/meteor/react-meteor-data) | X | | | | | | | | X | X | | | | [vite:bundler](https://atmospherejs.com/vite/bundler) | | | | | | | | | | | X | X | +| [webapp](https://atmospherejs.com/meteor/webapp) | | | | X | | | | | | | | | +| [zodern:melte](https://atmospherejs.com/zodern/melte) | | | | | | | | X | | | | | +| [zodern:types](https://atmospherejs.com/zodern/types) | | | | | | | | X | | | | |

meteor generate

@@ -926,7 +926,7 @@ from npm to your `node_modules` directory and save its usage in your Using the `meteor npm ...` commands in place of traditional `npm ...` commands is particularly important when using Node.js modules that have binary dependencies that make native C calls (like [`bcrypt`](https://www.npmjs.com/package/bcrypt)) -because doing so ensures that they are built using the same libaries. +because doing so ensures that they are built using the same libraries. Additionally, this access to the npm that comes with Meteor avoids the need to download and install npm separately. diff --git a/meteor b/meteor index b99b7aedde..1146deb2ff 100755 --- a/meteor +++ b/meteor @@ -1,6 +1,7 @@ #!/usr/bin/env bash -BUNDLE_VERSION=14.21.1.7 +BUNDLE_VERSION=14.21.2.2 + # OS Check. Put here because here is where we download the precompiled # bundles that are arch specific. diff --git a/npm-packages/meteor-installer/README.md b/npm-packages/meteor-installer/README.md index 91ad13de8f..54dc2a47b1 100644 --- a/npm-packages/meteor-installer/README.md +++ b/npm-packages/meteor-installer/README.md @@ -14,6 +14,8 @@ npm install -g meteor | NPM Package | Meteor Official Release | |-------------|-------------------------| +| 2.9.1 | 2.9.1 | +| 2.9.0 | 2.9.0 | | 2.8.2 | 2.8.1 | | 2.8.1 | 2.8.1 | | 2.8.0 | 2.8.0 | diff --git a/npm-packages/meteor-installer/config.js b/npm-packages/meteor-installer/config.js index fcae57bcec..4c2e1ac925 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.9.0'; +const METEOR_LATEST_VERSION = '2.9.1'; const sudoUser = process.env.SUDO_USER || ''; function isRoot() { return process.getuid && process.getuid() === 0; diff --git a/npm-packages/meteor-installer/package.json b/npm-packages/meteor-installer/package.json index 53d344ef33..af52942de4 100644 --- a/npm-packages/meteor-installer/package.json +++ b/npm-packages/meteor-installer/package.json @@ -1,6 +1,6 @@ { "name": "meteor", - "version": "2.9.0", + "version": "2.9.1", "description": "Install Meteor", "main": "install.js", "scripts": { diff --git a/packages/accounts-password/package.js b/packages/accounts-password/package.js index 719191d8dc..2b23a6373d 100644 --- a/packages/accounts-password/package.js +++ b/packages/accounts-password/package.js @@ -5,7 +5,7 @@ Package.describe({ // 2.2.x in the future. The version was also bumped to 2.0.0 temporarily // during the Meteor 1.5.1 release process, so versions 2.0.0-beta.2 // through -beta.5 and -rc.0 have already been published. - version: '2.3.2', + version: '2.3.3', }); Npm.depends({ diff --git a/packages/accounts-password/password_client.js b/packages/accounts-password/password_client.js index 30d3b49450..a55609919e 100644 --- a/packages/accounts-password/password_client.js +++ b/packages/accounts-password/password_client.js @@ -201,7 +201,7 @@ Accounts.forgotPassword = (options, callback) => { // @param callback (optional) {Function(error|undefined)} /** - * @summary Reset the password for a user using a token received in email. Logs the user in afterwards. + * @summary Reset the password for a user using a token received in email. Logs the user in afterwards if the user doesn't have 2FA enabled. * @locus Client * @param {String} token The token retrieved from the reset password URL. * @param {String} newPassword A new password for the user. This is __not__ sent in plain text over the wire. @@ -234,7 +234,7 @@ Accounts.resetPassword = (token, newPassword, callback) => { // @param callback (optional) {Function(error|undefined)} /** - * @summary Marks the user's email address as verified. Logs the user in afterwards. + * @summary Marks the user's email address as verified. Logs the user in afterwards if the user doesn't have 2FA enabled. * @locus Client * @param {String} token The token retrieved from the verification URL. * @param {Function} [callback] Optional callback. Called with no arguments on success, or with a single `Error` argument on failure. diff --git a/packages/accounts-password/password_server.js b/packages/accounts-password/password_server.js index c44be77f66..198b7a9c34 100644 --- a/packages/accounts-password/password_server.js +++ b/packages/accounts-password/password_server.js @@ -687,6 +687,17 @@ Meteor.methods({resetPassword: async function (...args) { // password should invalidate existing sessions). Accounts._clearAllLoginTokens(user._id); + if (Accounts._check2faEnabled?.(user)) { + return { + userId: user._id, + error: Accounts._handleError( + 'Changed password, but user not logged in because 2FA is enabled', + false, + '2fa-enabled' + ), + }; + } + return {userId: user._id}; } ); @@ -778,6 +789,17 @@ Meteor.methods({verifyEmail: async function (...args) { {$set: {'emails.$.verified': true}, $pull: {'services.email.verificationTokens': {address: tokenRecord.address}}}); + if (Accounts._check2faEnabled?.(user)) { + return { + userId: user._id, + error: Accounts._handleError( + 'Email verified, but user not logged in because 2FA is enabled', + false, + '2fa-enabled' + ), + }; + } + return {userId: user._id}; } ); diff --git a/packages/fetch/fetch.d.ts b/packages/fetch/fetch.d.ts index 8d6eb289ad..9fdaddd3fd 100644 --- a/packages/fetch/fetch.d.ts +++ b/packages/fetch/fetch.d.ts @@ -1,4 +1,4 @@ -export declare function fetch(): typeof globalThis.fetch; +export declare var fetch: typeof globalThis.fetch; export declare var Headers: typeof globalThis.Headers; export declare var Request: typeof globalThis.Request; export declare var Response: typeof globalThis.Response; diff --git a/packages/fetch/package.js b/packages/fetch/package.js index 5648235dac..1d13e505d5 100644 --- a/packages/fetch/package.js +++ b/packages/fetch/package.js @@ -1,6 +1,6 @@ Package.describe({ name: "fetch", - version: '0.1.2', + version: '0.1.3', summary: "Isomorphic modern/legacy/Node polyfill for WHATWG fetch()", documentation: "README.md" }); diff --git a/packages/meteor-tool/package.js b/packages/meteor-tool/package.js index bafb59a62e..e31fcbacf3 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.9.0', + version: '2.9.1', }); Package.includeTool(); diff --git a/packages/meteor/package.js b/packages/meteor/package.js index 7007d77957..9056fec7d6 100644 --- a/packages/meteor/package.js +++ b/packages/meteor/package.js @@ -2,7 +2,7 @@ Package.describe({ summary: "Core Meteor environment", - version: '1.10.3' + version: '1.10.4' }); Package.registerBuildPlugin({ @@ -55,6 +55,8 @@ Package.onUse(function (api) { // People expect process.exit() to not swallow console output. // On Windows, it sometimes does, so we fix it for all apps and packages api.addFiles('flush-buffers-on-exit-in-windows.js', 'server'); + + api.addAssets('meteor.d.ts', 'server'); }); Package.onTest(function (api) { diff --git a/scripts/admin/meteor-release-experimental.json b/scripts/admin/meteor-release-experimental.json index acce35a806..7a18f6f0ef 100644 --- a/scripts/admin/meteor-release-experimental.json +++ b/scripts/admin/meteor-release-experimental.json @@ -1,6 +1,6 @@ { "track": "METEOR", - "version": "2.9.0", + "version": "2.9.1-rc.0", "recommended": false, "official": false, "description": "Meteor experimental release" diff --git a/scripts/admin/meteor-release-official.json b/scripts/admin/meteor-release-official.json index 27a0c865e4..2920330372 100644 --- a/scripts/admin/meteor-release-official.json +++ b/scripts/admin/meteor-release-official.json @@ -1,6 +1,6 @@ { "track": "METEOR", - "version": "2.9.0", + "version": "2.9.1", "recommended": false, "official": true, "description": "The Official Meteor Distribution" diff --git a/scripts/build-dev-bundle-common.sh b/scripts/build-dev-bundle-common.sh index ef6013c4e5..6928825c20 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.1 +NODE_VERSION=14.21.2 MONGO_VERSION_64BIT=5.0.5 MONGO_VERSION_32BIT=3.2.22 NPM_VERSION=6.14.17 diff --git a/tools/cli/commands-packages.js b/tools/cli/commands-packages.js index 6a5c4d071c..9f26b97089 100644 --- a/tools/cli/commands-packages.js +++ b/tools/cli/commands-packages.js @@ -927,7 +927,7 @@ main.registerCommand({ return; } toPublish.push(packageName); - Console.info("Will publish new version for " + packageName); + Console.info(`Will publish new version for ${ packageName }: ${ packageSource.version }`); return; } else { var isopk = projectContext.isopackCache.getIsopack(packageName); diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 22ffdebaeb..2467f05879 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -521,6 +521,7 @@ export const AVAILABLE_SKELETONS = [ DEFAULT_SKELETON, "typescript", "vue", + 'vue-2', "svelte", "tailwind", "chakra-ui", diff --git a/tools/isobuild/compiler-deprecated-compile-step.js b/tools/isobuild/compiler-deprecated-compile-step.js index fe3b9c76c8..0fad0c671d 100644 --- a/tools/isobuild/compiler-deprecated-compile-step.js +++ b/tools/isobuild/compiler-deprecated-compile-step.js @@ -1,7 +1,7 @@ // This file contains an old definition of CompileStep, an object that is passed // to the package-provided file handler. // Since then, the newer API called "Batch Plugins" have replaced it but we keep -// the functionality for the backwards-compitability. +// the functionality for the backwards-compatibility. // @deprecated // XXX COMPAT WITH 1.1.0.2 diff --git a/tools/static-assets/skel-svelte/.meteor/packages b/tools/static-assets/skel-svelte/.meteor/packages index 6880ea240a..b6c7d8a95d 100644 --- a/tools/static-assets/skel-svelte/.meteor/packages +++ b/tools/static-assets/skel-svelte/.meteor/packages @@ -7,7 +7,6 @@ meteor-base # Packages every Meteor app needs to have mobile-experience # Packages for a great mobile UX mongo # The database Meteor supports right now -reactive-var # Reactive variable for tracker standard-minifier-css # CSS minifier run for production mode standard-minifier-js # JS minifier run for production mode @@ -19,5 +18,5 @@ shell-server # Server-side component of the `meteor shell` command ~prototype~ static-html # Define static page content in .html files zodern:melte # Meteor package to allow us to create files with the .svelte extension -rdb:svelte-meteor-data # Meteor package which allows us to consume Meteor's reactive data sources inside of our Svelte components hot-module-replacement # Update client in development without reloading the page +zodern:types # Enable types from meteor/atmosphere packages diff --git a/tools/static-assets/skel-svelte/imports/ui/App.svelte b/tools/static-assets/skel-svelte/imports/ui/App.svelte index 4bbdfecdc4..d64c1297ee 100644 --- a/tools/static-assets/skel-svelte/imports/ui/App.svelte +++ b/tools/static-assets/skel-svelte/imports/ui/App.svelte @@ -1,8 +1,21 @@ @@ -13,10 +26,15 @@

You've pressed the button {counter} times.

Learn Meteor!

- + {#if subIsReady} + + {:else} +
Loading ...
+ {/if} +

Typescript ready

+

Just add lang="ts" to .svelte components.

diff --git a/tools/static-assets/skel-svelte/package.json b/tools/static-assets/skel-svelte/package.json index 0b0aae237d..0ae79b3327 100644 --- a/tools/static-assets/skel-svelte/package.json +++ b/tools/static-assets/skel-svelte/package.json @@ -8,9 +8,12 @@ "visualize": "meteor --production --extra-packages bundle-visualizer" }, "dependencies": { - "@babel/runtime": "^7.17.9", - "meteor-node-stubs": "^1.2.1", - "svelte": "^3.46.4" + "@babel/runtime": "^7.20.6", + "meteor-node-stubs": "^1.2.5", + "svelte": "^3.54.0" + }, + "devDependencies": { + "svelte-preprocess": "^5.0.0" }, "meteor": { "mainModule": { diff --git a/tools/static-assets/skel-svelte/server/main.js b/tools/static-assets/skel-svelte/server/main.js index b43489013b..886520b487 100644 --- a/tools/static-assets/skel-svelte/server/main.js +++ b/tools/static-assets/skel-svelte/server/main.js @@ -5,6 +5,10 @@ async function insertLink({ title, url }) { await LinksCollection.insertAsync({ title, url, createdAt: new Date() }); } +Meteor.publish('links.all', function publishLinksAll() { + return LinksCollection.find(); +}) + Meteor.startup(async () => { // If the Links collection is empty, add some data. if (await LinksCollection.find().countAsync() === 0) { diff --git a/tools/static-assets/skel-svelte/tsconfig.json b/tools/static-assets/skel-svelte/tsconfig.json new file mode 100644 index 0000000000..11f2c45698 --- /dev/null +++ b/tools/static-assets/skel-svelte/tsconfig.json @@ -0,0 +1,20 @@ +{ + // see https://guide.meteor.com/build-tool.html#typescript for a config example + "compilerOptions": { + "allowSyntheticDefaultImports": true, // to be able to import eg meteor/mongo + "baseUrl": ".", // required by "paths" + "module": "esNext", // required by "preserveValueImports" + "moduleResolution": "node", // required by zodern:types (not documented) + "paths": { + "/*": ["*"], // support absolute /imports/* with a leading '/' + // support Meteor/Atmospehere packages, required by zodern:types + "meteor/*": [ + "node_modules/@types/meteor/*", + ".meteor/local/types/packages.d.ts" + ] + }, + "preserveSymlinks": true, // required by zodern:types + "preserveValueImports": true // otherwise TS will remove imported components + }, + "exclude": ["./.meteor/**", "./packages/**"] // this may solve VS Code Svelte plugin warnings +} diff --git a/tools/utils/buildmessage.js b/tools/utils/buildmessage.js index 0d468624c1..48cbec19c4 100644 --- a/tools/utils/buildmessage.js +++ b/tools/utils/buildmessage.js @@ -75,7 +75,7 @@ Object.assign(Job.prototype, { } line += ": "; } else { - // not sure how to display messages without a filenanme.. try this? + // not sure how to display messages without a file name.. try this? line += "error: "; } // XXX line wrapping would be nice..