Merge branch 'master' into devel

This commit is contained in:
filipenevola
2021-11-17 15:09:20 -04:00
18 changed files with 140 additions and 42 deletions

View File

@@ -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`

View File

@@ -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" %}

2
meteor
View File

@@ -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.

View File

@@ -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",

View File

@@ -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",

View File

@@ -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
};

View File

@@ -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.
***************************************
`;

View File

@@ -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"
},

View File

@@ -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 => {

View File

@@ -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];

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: 'The Meteor command-line tool',
version: '2.5.0',
version: '2.5.1',
});
Package.includeTool();

View File

@@ -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"

View File

@@ -1,6 +1,6 @@
{
"track": "METEOR",
"version": "2.5",
"version": "2.5.1",
"recommended": false,
"official": true,
"description": "The Official Meteor Distribution"

View File

@@ -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.

View File

@@ -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",

View File

@@ -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",

View File

@@ -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

View File

@@ -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)) {