From 735c81d66bc43cc0080db58a212a9507b74ba557 Mon Sep 17 00:00:00 2001 From: italo jose Date: Tue, 1 Jul 2025 15:21:11 -0300 Subject: [PATCH 1/5] fix help documentation formatting and add missing admin commands --- tools/cli/help.txt | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/tools/cli/help.txt b/tools/cli/help.txt index d0c16928be..c2f8d777da 100644 --- a/tools/cli/help.txt +++ b/tools/cli/help.txt @@ -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,18 @@ Usage: meteor admin [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 ' for details on an admin command. See 'meteor help admin ' for details on an admin command. @@ -875,12 +886,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 From b2725fae0d7f72c8f418660028d2311e8c765a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Tue, 8 Jul 2025 17:48:21 +0200 Subject: [PATCH 2/5] bump bundle_version --- meteor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meteor b/meteor index bc655c6fd9..a8d8b39b01 100755 --- a/meteor +++ b/meteor @@ -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. From 5194300ad2bd9647234a462f398cdf0b42a04b94 Mon Sep 17 00:00:00 2001 From: italo jose Date: Tue, 8 Jul 2025 14:30:23 -0300 Subject: [PATCH 3/5] refactor help text and update test for command matching --- tools/cli/help.txt | 2 -- tools/tests/help.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/cli/help.txt b/tools/cli/help.txt index c2f8d777da..7f9e083861 100644 --- a/tools/cli/help.txt +++ b/tools/cli/help.txt @@ -829,8 +829,6 @@ Commands: See 'meteor help admin ' for details on an admin command. -See 'meteor help admin ' for details on an admin command. - >>> admin make-bootstrap-tarballs Makes bootstrap tarballs. Usage: meteor admin make-bootstrap-tarballs release@version /tmp/tarballdir diff --git a/tools/tests/help.js b/tools/tests/help.js index e71e58993f..e249e1d523 100644 --- a/tools/tests/help.js +++ b/tools/tests/help.js @@ -38,7 +38,7 @@ selftest.define("help", async function () { var checkSubcommandList = async function (run) { await run.read("Usage: meteor admin "); 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")); From cc48324fd003d33a6b2bf959663f0a0eb73ab5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Wed, 9 Jul 2025 15:22:52 +0200 Subject: [PATCH 4/5] ensure babel parser is used when acorn can't handle the parsing --- tools/isobuild/import-scanner.ts | 25 ++++++++++++++++++++++--- tools/static-assets/server/runtime.js | 19 ++++++++++++++++--- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/tools/isobuild/import-scanner.ts b/tools/isobuild/import-scanner.ts index e05900b2f2..7aff1ee0e6 100644 --- a/tools/isobuild/import-scanner.ts +++ b/tools/isobuild/import-scanner.ts @@ -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 don’t support JSX, only with acorn-jsx, + // but it isn’t included in Reify. + result = reifyCompile(stripHashBang(source), { + ...reifyOptions, + parse: reifyBabelParse, + }).code; + } if (cacheFilePath) { Promise.resolve().then( diff --git a/tools/static-assets/server/runtime.js b/tools/static-assets/server/runtime.js index 9a1c6b15ef..3c15a6f9d1 100644 --- a/tools/static-assets/server/runtime.js +++ b/tools/static-assets/server/runtime.js @@ -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; From e9aa2bd7ca688dec7f9273f6cefcfb903103da9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Tue, 15 Jul 2025 17:33:13 +0200 Subject: [PATCH 5/5] update and match swc 1.12.14 version --- packages/babel-compiler/package.js | 2 +- packages/standard-minifier-js/package.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/babel-compiler/package.js b/packages/babel-compiler/package.js index 4a45656d27..c150378c01 100644 --- a/packages/babel-compiler/package.js +++ b/packages/babel-compiler/package.js @@ -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) { diff --git a/packages/standard-minifier-js/package.js b/packages/standard-minifier-js/package.js index cbb25a00bb..fbdfdef380 100644 --- a/packages/standard-minifier-js/package.js +++ b/packages/standard-minifier-js/package.js @@ -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',