Merge branch 'release-3.3.1' into fix-id-strategy-default

This commit is contained in:
Nacho Codoñer
2025-07-17 14:07:43 +02:00
7 changed files with 59 additions and 18 deletions

2
meteor
View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
BUNDLE_VERSION=22.17.0.0
BUNDLE_VERSION=22.17.0.1
# OS Check. Put here because here is where we download the precompiled
# bundles that are arch specific.

View File

@@ -8,7 +8,7 @@ Npm.depends({
'@meteorjs/babel': '7.20.1',
'json5': '2.2.3',
'semver': '7.6.3',
"@meteorjs/swc-core": "1.1.3",
"@meteorjs/swc-core": "1.12.14",
});
Package.onUse(function (api) {

View File

@@ -12,7 +12,7 @@ Package.registerBuildPlugin({
'ecmascript'
],
npmDependencies: {
'@meteorjs/swc-core': '1.1.3',
'@meteorjs/swc-core': '1.12.14',
'acorn': '8.10.0',
"@babel/runtime": "7.18.9",
'@babel/parser': '7.22.7',

View File

@@ -492,7 +492,7 @@ Note that you must have mongosh installed to use this option.
Options:
--url, -U return a Mongo database URL
--verbose, -v to show the errors that have occurred while connecting to the
database
database
Currently, this feature can only be used when developing locally.
The opened Mongo shell connects to the current project's local
@@ -816,7 +816,16 @@ Usage: meteor admin <command> [args]
Rarely used commands for administering official Meteor services.
Commands:
{{commands}}
make-bootstrap-tarballs
recommend-release
change-homepage
set-unmigrated
set-banners
list-organizations
members
set-latest-readme
get-machine
See 'meteor help admin <command>' for details on an admin command.
@@ -875,12 +884,12 @@ for replacing the names, we offer $$PascalName$$, $$camelName$$, $$name$$.
This is a MeteorJS project command.
Options:
--help Show help.
--path The path to the folder where the files will be generated. Default is the current folder.
--templatePath Path to the template file check https://docs.meteor.com/commandline.html#meteorgenerate-templating for more info.
--replaceFn Replace function to replace the names in the template. Check https://docs.meteor.com/commandline.html#meteorgenerate-templating for more info.
--methods Generate methods.
--publications Generate publications.
--help Show help.
--path The path to the folder where the files will be generated. Default is the current folder.
--templatePath Path to the template file check https://docs.meteor.com/commandline.html#meteorgenerate-templating for more info.
--replaceFn Replace function to replace the names in the template. Check https://docs.meteor.com/commandline.html#meteorgenerate-templating for more info.
--methods Generate methods.
--publications Generate publications.
>>> publish-release

View File

@@ -46,6 +46,7 @@ import {
import { wrap } from "optimism";
const { compile: reifyCompile } = require("@meteorjs/reify/lib/compiler");
const { parse: reifyAcornParse } = require("@meteorjs/reify/lib/parsers/acorn");
const { parse: reifyBabelParse } = require("@meteorjs/reify/lib/parsers/babel");
import Resolver, { Resolution } from "./resolver";
import LRUCache from 'lru-cache';
@@ -87,14 +88,32 @@ const reifyCompileWithCache = Profile("reifyCompileWithCache", wrap(function (
}
const isLegacy = isLegacyArch(bundleArch);
let result = reifyCompile(stripHashBang(source), {
parse: reifyAcornParse,
const reifyOptions = {
generateLetDeclarations: !isLegacy,
avoidModernSyntax: isLegacy,
enforceStrictMode: false,
dynamicImport: true,
ast: false,
}).code;
};
let result;
try {
// First attempt: use Acorn
result = reifyCompile(stripHashBang(source), {
...reifyOptions,
parse: reifyAcornParse,
}).code;
} catch (acornError) {
// Fallback: use Babel parser
// acorn may throw SyntaxError due to the lack of support for
// some features, but babel should still be able to parse the file
// For example, acorn dont support JSX, only with acorn-jsx,
// but it isnt included in Reify.
result = reifyCompile(stripHashBang(source), {
...reifyOptions,
parse: reifyBabelParse,
}).code;
}
if (cacheFilePath) {
Promise.resolve().then(

View File

@@ -48,13 +48,15 @@ module.exports = function enable ({ cachePath, createLoader = true } = {}) {
const reifyVersion = require("@meteorjs/reify/package.json").version;
const reifyAcornParse = require("@meteorjs/reify/lib/parsers/acorn").parse;
const reifyBabelParse = require("@meteorjs/reify/lib/parsers/babel").parse;
const reifyCompile = require("@meteorjs/reify/lib/compiler").compile;
function compileContent (content) {
let identical = true;
let result;
try {
const result = reifyCompile(content, {
result = reifyCompile(content, {
parse: reifyAcornParse,
generateLetDeclarations: false,
ast: false,
@@ -63,9 +65,20 @@ module.exports = function enable ({ cachePath, createLoader = true } = {}) {
identical = false;
content = result.code;
}
} finally {
return { content, identical };
} catch (acornError) {
// Fallback: Babel
result = reifyCompile(content, {
parse: reifyBabelParse,
generateLetDeclarations: false,
ast: false,
});
if (!result.identical) {
identical = false;
content = result.code;
}
}
return { content, identical };
}
const _compile = Mp._compile;

View File

@@ -38,7 +38,7 @@ selftest.define("help", async function () {
var checkSubcommandList = async function (run) {
await run.read("Usage: meteor admin <command>");
await run.match("Commands:");
await run.match(/recommend-release\s*Recommend a previously published/);
await run.match(/\s*recommend-release\s*/);
await run.expectExit(0);
};
await checkCommandHelp(s.run("create", "--help"));