mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
After publishing coffeescript@2.3.1_1, I noticed that the version of
babel-runtime (1.2.5) that is bundled into the compile-coffeescript plugin
was complaining about the presence of @babel/runtime@7.0.0-rc.1 in the
node_modules directory of Meteor 1.7.1-rc.3 apps, thanks to code added
recently to work around breaking changes in @babel/runtime@7.0.0-beta.56:
4d5fff99eb
The easiest way to fix this problem in the short term is to give the
compile-coffeescript plugin its own reliable copy of the @babel/runtime
npm package, rather than delegating to the version installed in the app.
The ideal long-term way to fix this problem would be to stop precompiling
Meteor compiler plugins before publishing them, and instead treat them
like any other Meteor package, which are compiled after installation.
Another issue that could have been prevented if compiler plugins were
compiled upon installation, like other packages: #10148
cc @hwillson @abernix @GeoffreyBooth
34 lines
1.0 KiB
JavaScript
34 lines
1.0 KiB
JavaScript
// The NPM `coffeescript` module requires Node 6+; but instead of checking for
|
|
// a Node runtime version, detect support for async functions, which were
|
|
// added in Node 7.6.
|
|
try {
|
|
new Function('async () => {}')();
|
|
} catch (exception) {
|
|
throw new Error('Your runtime does not support this version of CoffeeScript. Please upgrade to Meteor 1.6 or later, or use a 1.x version of CoffeeScript.');
|
|
}
|
|
|
|
|
|
Package.describe({
|
|
name: 'coffeescript-compiler',
|
|
summary: 'Compiler for CoffeeScript code, supporting the coffeescript package',
|
|
// This version of NPM `coffeescript` module, with _1, _2 etc.
|
|
// If you change this, make sure to also update ../coffeescript/package.js to match.
|
|
version: '2.3.1_2'
|
|
});
|
|
|
|
Npm.depends({
|
|
'coffeescript': '2.3.1',
|
|
'source-map': '0.5.7'
|
|
});
|
|
|
|
Package.onUse(function (api) {
|
|
api.use('babel-compiler@6.24.7||7.1.1');
|
|
api.use('ecmascript@0.11.1');
|
|
|
|
api.mainModule('coffeescript-compiler.js', 'server');
|
|
|
|
api.export('CoffeeScriptCompiler', 'server');
|
|
});
|
|
|
|
// See `coffeescript` package for tests.
|