From f536c2729b5c4781d17c36ef86382328b602c040 Mon Sep 17 00:00:00 2001 From: Brian Lukoff Date: Tue, 16 Jul 2024 16:57:46 -0500 Subject: [PATCH 1/2] Use async/await and Assets.getTextAsync for compatibility with Meteor 3. --- package.js | 1 + server/shell_server.js | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.js b/package.js index 84d8e3e..2345f7b 100644 --- a/package.js +++ b/package.js @@ -11,6 +11,7 @@ Package.onUse(function(api) { api.use([ 'ecmascript', + 'babel-compiler', 'shell-server@0.2.1', ], 'server'); diff --git a/server/shell_server.js b/server/shell_server.js index 68ee00e..cd86603 100644 --- a/server/shell_server.js +++ b/server/shell_server.js @@ -8,7 +8,7 @@ let MeteorShell = { return this; }, - ensureShellServer() { + async ensureShellServer() { try { if (process.env.METEOR_SHELL_DIR) { this.shellDir = process.env.METEOR_SHELL_DIR; @@ -18,7 +18,7 @@ let MeteorShell = { this.listen(this.shellDir); } - this.createShellClient(); + await this.createShellClient(); } catch(e) { console.error('qualia:prod-shell - Failed to start Meteor shell.', e.stack || e); @@ -73,8 +73,8 @@ let MeteorShell = { ); }, - createShellClient() { - let shellClientFile = Assets.getText('server/shell_client.js'); + async createShellClient() { + let shellClientFile = await Assets.getTextAsync('server/shell_client.js'); shellClientFile = `process.env.METEOR_SHELL_DIR = '${this.shellDir}';\n\n` + shellClientFile; shellClientFile = this.transpile(shellClientFile); @@ -83,7 +83,7 @@ let MeteorShell = { transpile(code) { process.env.BABEL_CACHE_DIR = process.env.BABEL_CACHE_DIR || process.cwd(); - return Package.ecmascript.ECMAScript.compileForShell(code); + return Babel.compileForShell(code); }, }.initialize(); From 860880ca2832bcbe61d98d3caaf46116c5f1d907 Mon Sep 17 00:00:00 2001 From: Brian Lukoff Date: Tue, 16 Jul 2024 22:44:55 -0500 Subject: [PATCH 2/2] Pin version. --- package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.js b/package.js index 2345f7b..2259826 100644 --- a/package.js +++ b/package.js @@ -11,7 +11,7 @@ Package.onUse(function(api) { api.use([ 'ecmascript', - 'babel-compiler', + 'babel-compiler@7.11.0', 'shell-server@0.2.1', ], 'server');