diff --git a/native/.npmignore b/native/.npmignore new file mode 100644 index 000000000..2f7896d1d --- /dev/null +++ b/native/.npmignore @@ -0,0 +1 @@ +target/ diff --git a/package.json b/package.json index d5e6b42a2..6744c04c0 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "pkg", "src/resources", "scripts/postinstall.js", + "native/addon", "package.json", "README.md" ], diff --git a/packages/native/src/native.ts b/packages/native/src/native.ts index a78a4f849..91ade924c 100644 --- a/packages/native/src/native.ts +++ b/packages/native/src/native.ts @@ -33,10 +33,19 @@ function loadNative(): Record { } const details = errors.map((e) => ` - ${e}`).join("\n"); + const supportedPlatforms = [ + "darwin-arm64", + "darwin-x64", + "linux-x64", + "linux-arm64", + "win32-x64", + ]; throw new Error( `Failed to load gsd_engine native addon for ${platformTag}.\n\n` + `Tried:\n${details}\n\n` + - `Build with: npm run build:native -w @gsd/native`, + `Supported platforms: ${supportedPlatforms.join(", ")}\n` + + `If your platform is listed, try reinstalling: npm i -g gsd-pi\n` + + `Otherwise, please open an issue: https://github.com/gsd-build/gsd-2/issues`, ); }