From 4708b37e4bd4460362a930ec0eb7ca27ef0037d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zen=C3=A9ixe?= <1379179+Zeneixe@users.noreply.github.com> Date: Fri, 27 May 2022 10:44:38 +0200 Subject: [PATCH 1/2] Update with arm64 binary (#2) * Update with arm64 binary * Publish * Update README * Rename for compatibility Co-authored-by: Evan Czaplicki Co-authored-by: Federico Rebora --- README.md | 6 ++++++ installers/npm/download.js | 39 ++++++++++++++++++++++++++++++++++--- installers/npm/package.json | 7 +++++-- 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 54f01c748..76f7379fc 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ For multiple versions, previous versions, and uninstallation, see the instructio
+## carwow's notes + +The node package to use in our own projects `@carwow/elm` + +
+ ## Help If you are stuck, ask around on [the Elm slack channel][slack]. Folks are friendly and happy to help with questions! diff --git a/installers/npm/download.js b/installers/npm/download.js index 6ced746e6..e078fafd4 100644 --- a/installers/npm/download.js +++ b/installers/npm/download.js @@ -16,9 +16,18 @@ module.exports = function(callback) { // figure out URL of binary var version = package.version.replace(/^(\d+\.\d+\.\d+).*$/, '$1'); // turn '1.2.3-alpha' into '1.2.3' - var os = { 'darwin': 'mac', 'win32': 'windows', 'linux': 'linux' }[process.platform]; - var arch = { 'x64': '64-bit', 'ia32': '32-bit' }[process.arch]; - var url = 'https://github.com/elm/compiler/releases/download/' + version + '/binary-for-' + os + '-' + arch + '.gz'; + + var platform = { + darwin_x64: 'mac-64-bit', + darwin_arm64: 'mac-64-bit', + win32_x64: 'windows-64-bit', + linux_x64: 'linux-64-bit', + linux_arm64: 'linux-arm-64-bit' + }[process.platform + '_' + process.arch]; + + verifyPlatform(version, platform); + + var url = 'https://github.com/carwow/elm-compiler/releases/download/' + version + '/binary-for-' + platform + '.gz'; reportDownload(version, url); @@ -50,6 +59,30 @@ module.exports = function(callback) +// VERIFY PLATFORM + + +function verifyPlatform(version, platform) +{ + if (platform) return; + + var situation = process.platform + '_' + process.arch; + console.error( + '-- ERROR -----------------------------------------------------------------------\n\n' + + 'I am detecting that your computer (' + situation + ') may not be compatible with any\n' + + 'of the official pre-built binaries.\n\n' + + 'I recommend against using the npm installer for your situation. Check out the\n' + + 'alternative installers at https://github.com/elm/compiler/releases/tag/' + version + '\n' + + 'to see if there is something that will work better for you.\n\n' + + 'From there I recommend asking for guidance on Slack or Discourse to find someone\n' + + 'who can help with your specific situation.\n\n' + + '--------------------------------------------------------------------------------\n' + ); + process.exit(1); +} + + + // EXIT FAILURE diff --git a/installers/npm/package.json b/installers/npm/package.json index 9795c76b8..ba9b4f837 100644 --- a/installers/npm/package.json +++ b/installers/npm/package.json @@ -1,12 +1,15 @@ { - "name": "elm", + "name": "@carwow/elm", "version": "0.19.1", "description": "Installer for Elm: just downloads the binary into node_modules", "preferGlobal": true, "license": "BSD-3-Clause", + "publishConfig": { + "registry": "https://npm.pkg.github.com" + }, "repository": { "type": "git", - "url": "https://github.com/elm/compiler.git" + "url": "ssh://git@github.com/carwow/elm-compiler" }, "homepage": "https://github.com/elm/compiler/tree/master/installers/npm", "bugs": "https://github.com/elm/compiler/issues", From 858ce32967883283074ffaf19c659dd98b1e5e67 Mon Sep 17 00:00:00 2001 From: Zeneixe Date: Wed, 2 Oct 2024 18:21:18 +0200 Subject: [PATCH 2/2] Add linux_arm64 --- installers/npm/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/installers/npm/package.json b/installers/npm/package.json index 7c0bb1873..dc9a0a50a 100644 --- a/installers/npm/package.json +++ b/installers/npm/package.json @@ -38,6 +38,7 @@ "optionalDependencies": { "@elm_binaries/darwin_arm64": "0.19.1-0", "@elm_binaries/darwin_x64": "0.19.1-0", + "@elm_binaries/linux_arm64": "0.19.1-0", "@elm_binaries/linux_x64": "0.19.1-0", "@elm_binaries/win32_x64": "0.19.1-0" }