diff --git a/History.md b/History.md index e6723400d9..0ac5af40fc 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,4 @@ -## v2.6, 2021-11- +## vNext, UNRELEASED #### Highlights @@ -8,9 +8,29 @@ #### Independent Releases -* `minifier-js@2.7.2` +## v2.5.1, 2021-11-17 + +#### Highlights +- Mac M1 Support - darwin arm64 + +#### Breaking Changes +- `Meteor.loginWithToken` from the new package `accounts-passwordless` was conflicting with another method with the same name on `accounts-base` so we had to rename the method of `accounts-passwordless` package to `Meteor.passwordlessLoginWithToken`. + +#### Meteor Version Release + +* `meteor-tool@2.5.1` + - Meteor supports now Mac M1 chips (darwin arm64) + +* `accounts-passwordless@2.0.0` + - `Meteor.loginWithToken` from the new package `accounts-passwordless` was conflicting with another method with the same name on `accounts-base` so we had to rename the method of `accounts-passwordless` package to `Meteor.passwordlessLoginWithToken`. + +#### Independent Releases +* `minifier-js@2.7.2` - Stopped using `evaluate` option in the compression to fix a [bug](https://github.com/meteor/meteor/issues/11756). - Updated `terser` to [v5.9.0](https://github.com/terser/terser/blob/master/CHANGELOG.md#v590) to fix various bugs + +* `standard-minifier-js@2.7.2` + - Using `minifier-js@2.7.2` * `github-oauth@1.3.2` - Migrate from `http` to `fetch` diff --git a/docs/source/packages/accounts-passwordless.md b/docs/source/packages/accounts-passwordless.md index ae620401ad..2035cc7c67 100644 --- a/docs/source/packages/accounts-passwordless.md +++ b/docs/source/packages/accounts-passwordless.md @@ -10,7 +10,7 @@ The first step to in the passwordless process is for the user to sign-up or requ If the user is signing up you can pass in the `userData` object like in [Accounts.createUser](/api/passwords.html#Accounts-createUser). -{% apibox "Meteor.loginWithToken" %} +{% apibox "Meteor.passwordlessLoginWithToken" %} The second step in the passwordless flow. Like all the other `loginWith` functions call this method to login the user with the token they have inputted. {% apibox "Accounts.sendLoginTokenEmail" %} diff --git a/meteor b/meteor index b340deca4e..bfa216cb60 100755 --- a/meteor +++ b/meteor @@ -1,6 +1,6 @@ #!/usr/bin/env bash -BUNDLE_VERSION=14.18.1.2 +BUNDLE_VERSION=14.18.1.4 # OS Check. Put here because here is where we download the precompiled # bundles that are arch specific. diff --git a/npm-packages/eslint-plugin-meteor/scripts/dev-bundle-server-package.js b/npm-packages/eslint-plugin-meteor/scripts/dev-bundle-server-package.js index f814d535a6..05dfef42fb 100644 --- a/npm-packages/eslint-plugin-meteor/scripts/dev-bundle-server-package.js +++ b/npm-packages/eslint-plugin-meteor/scripts/dev-bundle-server-package.js @@ -10,7 +10,7 @@ var packageJson = { dependencies: { // Keep the versions of these packages consistent with the versions // found in dev-bundle-tool-package.js. - fibers: "5.0.0", + fibers: "https://github.com/meteor/node-fibers/archive/refs/tags/5.0.0.tar.gz", "meteor-promise": "0.9.0", promise: "8.1.0", reify: "0.22.2", diff --git a/npm-packages/eslint-plugin-meteor/scripts/dev-bundle-tool-package.js b/npm-packages/eslint-plugin-meteor/scripts/dev-bundle-tool-package.js index 71642bdb00..f08b8068f8 100644 --- a/npm-packages/eslint-plugin-meteor/scripts/dev-bundle-tool-package.js +++ b/npm-packages/eslint-plugin-meteor/scripts/dev-bundle-tool-package.js @@ -19,7 +19,7 @@ var packageJson = { // Keep the versions of these packages consistent with the versions // found in dev-bundle-server-package.js. "meteor-promise": "0.9.0", - fibers: "5.0.0", + fibers: "https://github.com/meteor/node-fibers/archive/refs/tags/5.0.0.tar.gz", reify: "0.22.2", // So that Babel can emit require("@babel/runtime/helpers/...") calls. "@babel/runtime": "7.15.3", diff --git a/npm-packages/meteor-installer/config.js b/npm-packages/meteor-installer/config.js index dfd2401913..10cf679463 100644 --- a/npm-packages/meteor-installer/config.js +++ b/npm-packages/meteor-installer/config.js @@ -1,17 +1,31 @@ const path = require('path'); const os = require('os'); -const METEOR_LATEST_VERSION = '2.5'; +const METEOR_LATEST_VERSION = '2.5.1'; const sudoUser = process.env.SUDO_USER || ''; function isRoot() { return process.getuid && process.getuid() === 0; } +function isSudo() { + return isRoot() && !!sudoUser; +} const localAppData = process.env.LOCALAPPDATA; const isWindows = () => os.platform() === 'win32'; const isMac = () => os.platform() === 'darwin'; -const rootPath = isWindows() - ? localAppData - : `${isRoot() ? `/home/${sudoUser}` : os.homedir()}`; + +let rootPath; +if (isWindows()) { + rootPath = localAppData; +} else if (isRoot() && sudoUser) { + rootPath = `/home/${sudoUser}`; +} else { + if (isRoot()) { + console.info( + 'You are running the install script as root, without SUDO. This is not recommended and should be avoided. Continuing.' + ); + } + rootPath = os.homedir(); +} if (isWindows() && !localAppData) { throw new Error('LOCALAPPDATA env var is not set.'); @@ -21,6 +35,7 @@ const meteorLocalFolder = '.meteor'; const meteorPath = path.resolve(rootPath, meteorLocalFolder); module.exports = { + METEOR_LATEST_VERSION, extractPath: rootPath, meteorPath, release: process.env.INSTALL_METEOR_VERSION || METEOR_LATEST_VERSION, @@ -30,4 +45,5 @@ module.exports = { isWindows, isMac, isRoot, + isSudo }; diff --git a/npm-packages/meteor-installer/install.js b/npm-packages/meteor-installer/install.js index b752a80f3f..fc48fc85d3 100644 --- a/npm-packages/meteor-installer/install.js +++ b/npm-packages/meteor-installer/install.js @@ -14,9 +14,11 @@ const { startedPath, extractPath, isWindows, - isRoot, rootPath, sudoUser, + isSudo, + isMac, + METEOR_LATEST_VERSION, } = require('./config.js'); const { uninstall } = require('./uninstall'); const { @@ -24,14 +26,32 @@ const { extractWith7Zip, extractWithNativeTar, } = require('./extract.js'); +const semver = require('semver'); +const isInstalledGlobally = process.env.npm_config_global === 'true'; +if (!isInstalledGlobally) { + console.error('******************************************'); + console.error( + 'You are not using a global npm context to install, you should never add meteor to your package.json.' + ); + console.error('Make sure you pass -g to npm install.'); + console.error('Aborting'); + console.error('******************************************'); + process.exit(1); +} process.on('unhandledRejection', err => { throw err; }); - if (os.arch() !== 'x64') { - console.error('The current architecture is not supported:', os.arch()); - process.exit(1); + const isValidM1Version = semver.gte(METEOR_LATEST_VERSION, '2.5.1-beta.3'); + if (os.arch() !== 'arm64' || !isMac() || !isValidM1Version) { + console.error( + 'The current architecture is not supported in this version: ', + os.arch(), + '. Try Meteor 2.5.1-beta.3 or above.' + ); + process.exit(1); + } } const downloadPlatform = { @@ -42,9 +62,29 @@ const downloadPlatform = { const url = `https://packages.meteor.com/bootstrap-link?arch=os.${ downloadPlatform[os.platform()] -}.x86_64&release=${release}`; +}.${os.arch() === 'arm64' ? 'arm64' : 'x86_64'}&release=${release}`; -const tempPath = tmp.dirSync().name; +let tempDirObject; +try { + tempDirObject = tmp.dirSync(); +} catch (e) { + console.error(''); + console.error(''); + console.error('****************************'); + console.error("Couldn't create tmp dir for extracting meteor."); + console.error('There are 2 possible causes:'); + console.error( + '\t1. You are running npm install -g meteor as root without passing the --unsafe-perm option. Please rerun with this option enabled.' + ); + console.error( + '\t2. You might not have enough space in disk or permission to create folders' + ); + console.error('****************************'); + console.error(''); + console.error(''); + process.exit(1); +} +const tempPath = tempDirObject.name; const tarGzName = 'meteor.tar.gz'; const tarName = 'meteor.tar'; @@ -58,7 +98,7 @@ if (fs.existsSync(startedPath)) { } else if (fs.existsSync(meteorPath)) { console.log('Meteor is already installed at', meteorPath); console.log( -`If you want to reinstall it, run: + `If you want to reinstall it, run: $ meteor-installer uninstall $ meteor-installer install @@ -89,6 +129,7 @@ try { console.log('Assuming unable to create symlinks'); } } + download(); function download() { @@ -210,38 +251,40 @@ async function setup() { } async function setupExecPath() { if (isWindows()) { + //set for the current session and beyond child_process.execSync(`setx path "${meteorPath}/;%path%`); return; } - const appendPathToFile = async (file) => { - return fsPromises.appendFile( - `${rootPath}/${file}`, - `export PATH=${meteorPath}:$PATH\n` - ); + const exportCommand = `export PATH=${meteorPath}:$PATH`; - } - if(process.env.SHELL && process.env.SHELL.includes('zsh')){ + const appendPathToFile = async file => { + return fsPromises.appendFile(`${rootPath}/${file}`, `${exportCommand}\n`); + }; + + if (process.env.SHELL && process.env.SHELL.includes('zsh')) { await appendPathToFile('.zshrc'); - }else { + } else { await appendPathToFile('.bashrc'); await appendPathToFile('.bash_profile'); } - if (!isRoot()) { - return; + if (isSudo()) { + // if we identified sudo is being used, we need to change the ownership of the meteorpath folder + child_process.execSync(`chown -R ${sudoUser} "${meteorPath}"`); } - // if we identified sudo is being used, we need to change the ownership of the meteorpath folder - child_process.execSync(`chown -R ${sudoUser} "${meteorPath}"`); } function showGettingStarted() { + const exportCommand = `export PATH=${meteorPath}:$PATH`; + + const runCommand = isWindows() + ? `set path "${meteorPath}/;%path%` + : exportCommand; const message = ` *************************************** Meteor has been installed! -*You might need to open a new terminal windows to have access to the meteor command.* - To get started fast: $ meteor create ~/my_cool_app @@ -256,6 +299,12 @@ Deploy and host your app with Cloud: www.meteor.com/cloud +*************************************** +You might need to open a new terminal window to have access to the meteor command, or run this in your terminal: + +${runCommand} + +For adding it immediately to your path. *************************************** `; diff --git a/npm-packages/meteor-installer/package.json b/npm-packages/meteor-installer/package.json index cc09065097..2b9f0e1d84 100644 --- a/npm-packages/meteor-installer/package.json +++ b/npm-packages/meteor-installer/package.json @@ -1,7 +1,7 @@ { "name": "meteor", - "version": "2.5.0", - "description": "Install Meteor on Windows", + "version": "2.5.1-beta.9", + "description": "Install Meteor", "main": "install.js", "scripts": { "install": "node cli.js install" @@ -14,6 +14,7 @@ "node-7z": "^2.0.5", "node-downloader-helper": "^1.0.11", "rimraf": "^3.0.2", + "semver": "^7.3.5", "tar": "^6.1.0", "tmp": "^0.1.0" }, diff --git a/packages/accounts-passwordless/package.js b/packages/accounts-passwordless/package.js index 5640f96188..86cfa7293f 100644 --- a/packages/accounts-passwordless/package.js +++ b/packages/accounts-passwordless/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'No-password login/sign-up support for accounts', - version: '1.0.0', + version: '2.0.0', }); Package.onUse(api => { diff --git a/packages/accounts-passwordless/passwordless_client.js b/packages/accounts-passwordless/passwordless_client.js index 698f3cd947..dc1e5b0bd5 100644 --- a/packages/accounts-passwordless/passwordless_client.js +++ b/packages/accounts-passwordless/passwordless_client.js @@ -41,7 +41,7 @@ const transformSelector = selector => { * on failure. * @importFromPackage meteor */ -Meteor.loginWithToken = (selector, token, callback) => { +Meteor.passwordlessLoginWithToken = (selector, token, callback) => { Accounts.callLoginMethod({ methodArguments: [ { @@ -91,7 +91,7 @@ const checkToken = ({ selector, token }) => { const userId = Tracker.nonreactive(Meteor.userId); if (!userId) { - Meteor.loginWithToken(selector, token, () => { + Meteor.passwordlessLoginWithToken(selector, token, () => { // Make it look clean by removing the authToken from the URL if (window.history) { const url = window.location.href.split('?')[0]; diff --git a/packages/meteor-tool/package.js b/packages/meteor-tool/package.js index 1bce2fb230..df3e5a2a0a 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.5.0', + version: '2.5.1', }); Package.includeTool(); diff --git a/scripts/admin/meteor-release-experimental.json b/scripts/admin/meteor-release-experimental.json index 95fce6e667..88c577fe38 100644 --- a/scripts/admin/meteor-release-experimental.json +++ b/scripts/admin/meteor-release-experimental.json @@ -1,6 +1,6 @@ { "track": "METEOR", - "version": "2.5-rc.1", + "version": "2.5.1-beta.3", "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 e8fa614f33..7eb984c864 100644 --- a/scripts/admin/meteor-release-official.json +++ b/scripts/admin/meteor-release-official.json @@ -1,6 +1,6 @@ { "track": "METEOR", - "version": "2.5", + "version": "2.5.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 f8175f17e7..d94f954c1e 100644 --- a/scripts/build-dev-bundle-common.sh +++ b/scripts/build-dev-bundle-common.sh @@ -12,6 +12,7 @@ NPM_VERSION=6.14.15 if [ "$UNAME" == "Linux" ] ; then + NODE_BUILD_NUMBER= if [ "$ARCH" != "i686" -a "$ARCH" != "x86_64" ] ; then echo "Unsupported architecture: $ARCH" echo "Meteor only supports i686 and x86_64 for now." @@ -25,6 +26,7 @@ if [ "$UNAME" == "Linux" ] ; then } elif [ "$UNAME" == "Darwin" ] ; then if [ "$ARCH" != "arm64" ] ; then + NODE_BUILD_NUMBER= SYSCTL_64BIT=$(sysctl -n hw.cpu64bit_capable 2>/dev/null || echo 0) if [ "$ARCH" == "i386" -a "1" != "$SYSCTL_64BIT" ] ; then # some older macos returns i386 but can run 64 bit binaries. diff --git a/scripts/dev-bundle-server-package.js b/scripts/dev-bundle-server-package.js index f814d535a6..5cd5b07b23 100644 --- a/scripts/dev-bundle-server-package.js +++ b/scripts/dev-bundle-server-package.js @@ -10,7 +10,7 @@ var packageJson = { dependencies: { // Keep the versions of these packages consistent with the versions // found in dev-bundle-tool-package.js. - fibers: "5.0.0", + fibers: "https://github.com/meteor/node-fibers/archive/refs/tags/5.0.0-1.tar.gz", "meteor-promise": "0.9.0", promise: "8.1.0", reify: "0.22.2", diff --git a/scripts/dev-bundle-tool-package.js b/scripts/dev-bundle-tool-package.js index 07fb455a23..8d7ab23cbe 100644 --- a/scripts/dev-bundle-tool-package.js +++ b/scripts/dev-bundle-tool-package.js @@ -19,7 +19,7 @@ var packageJson = { // Keep the versions of these packages consistent with the versions // found in dev-bundle-server-package.js. "meteor-promise": "0.9.0", - fibers: "5.0.0", + fibers: "https://github.com/meteor/node-fibers/archive/refs/tags/5.0.0-1.tar.gz", reify: "0.22.2", // So that Babel can emit require("@babel/runtime/helpers/...") calls. "@babel/runtime": "7.15.3", diff --git a/tools/cli/main.js b/tools/cli/main.js index 1bc7b6f267..09a4873b3d 100644 --- a/tools/cli/main.js +++ b/tools/cli/main.js @@ -20,6 +20,12 @@ import { isEmacs } from "../utils/utils.js"; var main = exports; +if (process.platform === 'darwin' && process.arch === 'arm64') { + // pool size needs to be bigger on m1 because arm64 builds are using + // fibers with CORO_PTHREAD set. - default on fibers is 120 + Fiber.poolSize = 250; +} + require('./flush-buffers-on-exit-in-windows.js'); // node (v8) defaults to only recording 10 lines of stack trace. This diff --git a/tools/utils/archinfo.ts b/tools/utils/archinfo.ts index e223ad42d3..d454535355 100644 --- a/tools/utils/archinfo.ts +++ b/tools/utils/archinfo.ts @@ -164,7 +164,11 @@ export function host() { run('sysctl', '-n', 'hw.cpu64bit_capable') !== "1") { throw new Error("Only 64-bit Intel and M1 processors are supported on OS X"); } - _host = "os.osx.x86_64"; + if(arch === "arm"){ + _host = "os.osx.arm64"; + }else{ + _host = "os.osx.x86_64"; + } } else if (platform === "linux") { const machine = run('uname', '-m'); if (["x86_64", "amd64", "ia64"].includes(machine)) {