Skip to content

Commit

Permalink
move to scoped packages
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Dec 6, 2022
1 parent 66fab46 commit 157860b
Show file tree
Hide file tree
Showing 50 changed files with 193 additions and 201 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
/npm/@esbuild/android-arm/exit0.js
/npm/@esbuild/android-arm/wasm_exec_node.js
/npm/@esbuild/android-arm/wasm_exec.js
/npm/esbuild-android-64/esbuild.wasm
/npm/esbuild-android-64/exit0.js
/npm/esbuild-android-64/wasm_exec_node.js
/npm/esbuild-android-64/wasm_exec.js
/npm/@esbuild/android-x64/esbuild.wasm
/npm/@esbuild/android-x64/exit0.js
/npm/@esbuild/android-x64/wasm_exec_node.js
/npm/@esbuild/android-x64/wasm_exec.js
/npm/esbuild-wasm/browser.js
/npm/esbuild-wasm/esbuild.wasm
/npm/esbuild-wasm/esm/
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,40 @@

**This release deliberately contains backwards-incompatible changes.** To avoid automatically picking up releases like this, you should either be pinning the exact version of `esbuild` in your `package.json` file (recommended) or be using a version range syntax that only accepts patch upgrades such as `~0.15.0`. See npm's documentation about [semver](https://docs.npmjs.com/cli/v6/using-npm/semver/) for more information.

* Move all binary executable packages to the `@esbuild/` scope

Binary package executables for esbuild are published as individual packages separate from the main `esbuild` package so you only have to download the relevant one for the current platform when you install esbuild. This release moves all of these packages under the `@esbuild/` scope to avoid collisions with 3rd-party packages. It also changes them to a consistent naming scheme that uses the `os` and `cpu` names from node.

The package name changes are as follows:

* `@esbuild/linux-loong64` => `@esbuild/linux-loong64` (no change)
* `esbuild-android-64` => `@esbuild/android-x64`
* `esbuild-android-arm64` => `@esbuild/android-arm64`
* `esbuild-darwin-64` => `@esbuild/darwin-x64`
* `esbuild-darwin-arm64` => `@esbuild/darwin-arm64`
* `esbuild-freebsd-64` => `@esbuild/freebsd-x64`
* `esbuild-freebsd-arm64` => `@esbuild/freebsd-arm64`
* `esbuild-linux-32` => `@esbuild/linux-ia32`
* `esbuild-linux-64` => `@esbuild/linux-x64`
* `esbuild-linux-arm` => `@esbuild/linux-arm`
* `esbuild-linux-arm64` => `@esbuild/linux-arm64`
* `esbuild-linux-mips64le` => `@esbuild/linux-mips64el`
* `esbuild-linux-ppc64le` => `@esbuild/linux-ppc64`
* `esbuild-linux-riscv64` => `@esbuild/linux-riscv64`
* `esbuild-linux-s390x` => `@esbuild/linux-s390x`
* `esbuild-netbsd-64` => `@esbuild/netbsd-x64`
* `esbuild-openbsd-64` => `@esbuild/openbsd-x64`
* `esbuild-sunos-64` => `@esbuild/sunos-x64`
* `esbuild-wasm` => `esbuild-wasm` (no change)
* `esbuild-windows-32` => `@esbuild/win32-ia32`
* `esbuild-windows-64` => `@esbuild/win32-x64`
* `esbuild-windows-arm64` => `@esbuild/win32-arm64`
* `esbuild` => `esbuild` (no change)

Normal usage of the `esbuild` and `esbuild-wasm` packages should not be affected. These name changes should only affect tools that hard-coded the individual binary executable package names into custom esbuild downloader scripts.

This change was not made with performance in mind. But as a bonus, installing esbuild with npm may potentially happen faster now. This is because npm's package installation protocol is inefficient: it always downloads metadata for all past versions of each package even when it only needs metadata about a single version. This makes npm package downloads O(n) in the number of published versions, which penalizes packages like esbuild that are updated regularly. Since most of esbuild's package names have now changed, npm will now need to download much less data when installing esbuild (8.72mb of package manifests before this change → 0.06mb of package manifests after this change). However, this is only a temporary improvement. Installing esbuild will gradually get slower again as further versions of esbuild are published.

* Fix some parameter names for the Go API

This release changes some parameter names for the Go API to be consistent with the JavaScript and CLI APIs:
Expand Down
172 changes: 86 additions & 86 deletions Makefile

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions lib/deno/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,17 @@ async function install(): Promise<string> {

const platformKey = Deno.build.target
const knownWindowsPackages: Record<string, string> = {
'x86_64-pc-windows-msvc': 'esbuild-windows-64',
'x86_64-pc-windows-msvc': '@esbuild/win32-x64',
}
const knownUnixlikePackages: Record<string, string> = {
// These are the only platforms that Deno supports
'aarch64-apple-darwin': 'esbuild-darwin-arm64',
'aarch64-unknown-linux-gnu': 'esbuild-linux-arm64',
'x86_64-apple-darwin': 'esbuild-darwin-64',
'x86_64-unknown-linux-gnu': 'esbuild-linux-64',
'aarch64-apple-darwin': '@esbuild/darwin-arm64',
'aarch64-unknown-linux-gnu': '@esbuild/linux-arm64',
'x86_64-apple-darwin': '@esbuild/darwin-x64',
'x86_64-unknown-linux-gnu': '@esbuild/linux-x64',

// These platforms are not supported by Deno
'x86_64-unknown-freebsd': 'esbuild-freebsd-64',
'x86_64-unknown-freebsd': '@esbuild/freebsd-x64',
}

// Pick a package to install
Expand Down
44 changes: 22 additions & 22 deletions lib/npm/node-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,38 @@ declare const ESBUILD_VERSION: string;
// external code relies on this.
export var ESBUILD_BINARY_PATH: string | undefined = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;

const packageDarwin_arm64 = 'esbuild-darwin-arm64'
const packageDarwin_x64 = 'esbuild-darwin-64'
const packageDarwin_arm64 = '@esbuild/darwin-arm64'
const packageDarwin_x64 = '@esbuild/darwin-x64'

export const knownWindowsPackages: Record<string, string> = {
'win32 arm64 LE': 'esbuild-windows-arm64',
'win32 ia32 LE': 'esbuild-windows-32',
'win32 x64 LE': 'esbuild-windows-64',
'win32 arm64 LE': '@esbuild/win32-arm64',
'win32 ia32 LE': '@esbuild/win32-ia32',
'win32 x64 LE': '@esbuild/win32-x64',
};

export const knownUnixlikePackages: Record<string, string> = {
'android arm64 LE': 'esbuild-android-arm64',
'darwin arm64 LE': 'esbuild-darwin-arm64',
'darwin x64 LE': 'esbuild-darwin-64',
'freebsd arm64 LE': 'esbuild-freebsd-arm64',
'freebsd x64 LE': 'esbuild-freebsd-64',
'linux arm LE': 'esbuild-linux-arm',
'linux arm64 LE': 'esbuild-linux-arm64',
'linux ia32 LE': 'esbuild-linux-32',
'linux mips64el LE': 'esbuild-linux-mips64le',
'linux ppc64 LE': 'esbuild-linux-ppc64le',
'linux riscv64 LE': 'esbuild-linux-riscv64',
'linux s390x BE': 'esbuild-linux-s390x',
'linux x64 LE': 'esbuild-linux-64',
'android arm64 LE': '@esbuild/android-arm64',
'darwin arm64 LE': '@esbuild/darwin-arm64',
'darwin x64 LE': '@esbuild/darwin-x64',
'freebsd arm64 LE': '@esbuild/freebsd-arm64',
'freebsd x64 LE': '@esbuild/freebsd-x64',
'linux arm LE': '@esbuild/linux-arm',
'linux arm64 LE': '@esbuild/linux-arm64',
'linux ia32 LE': '@esbuild/linux-ia32',
'linux mips64el LE': '@esbuild/linux-mips64el',
'linux ppc64 LE': '@esbuild/linux-ppc64',
'linux riscv64 LE': '@esbuild/linux-riscv64',
'linux s390x BE': '@esbuild/linux-s390x',
'linux x64 LE': '@esbuild/linux-x64',
'linux loong64 LE': '@esbuild/linux-loong64',
'netbsd x64 LE': 'esbuild-netbsd-64',
'openbsd x64 LE': 'esbuild-openbsd-64',
'sunos x64 LE': 'esbuild-sunos-64',
'netbsd x64 LE': '@esbuild/netbsd-x64',
'openbsd x64 LE': '@esbuild/openbsd-x64',
'sunos x64 LE': '@esbuild/sunos-x64',
};

export const knownWebAssemblyFallbackPackages: Record<string, string> = {
'android arm LE': '@esbuild/android-arm',
'android x64 LE': 'esbuild-android-64',
'android x64 LE': '@esbuild/android-x64',
};

export function pkgAndSubpathForCurrentPlatform(): { pkg: string, subpath: string, isWASM: boolean } {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-android-arm64",
"name": "@esbuild/android-arm64",
"version": "0.15.18",
"description": "The Android ARM 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-android-64",
"name": "@esbuild/android-x64",
"version": "0.15.18",
"description": "A WebAssembly shim for esbuild on Android x64.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-darwin-arm64",
"name": "@esbuild/darwin-arm64",
"version": "0.15.18",
"description": "The macOS ARM 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-darwin-64",
"name": "@esbuild/darwin-x64",
"version": "0.15.18",
"description": "The macOS 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-freebsd-arm64",
"name": "@esbuild/freebsd-arm64",
"version": "0.15.18",
"description": "The FreeBSD ARM 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-freebsd-64",
"name": "@esbuild/freebsd-x64",
"version": "0.15.18",
"description": "The FreeBSD 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-linux-arm",
"name": "@esbuild/linux-arm",
"version": "0.15.18",
"description": "The Linux ARM binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-linux-arm64",
"name": "@esbuild/linux-arm64",
"version": "0.15.18",
"description": "The Linux ARM 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-linux-32",
"name": "@esbuild/linux-ia32",
"version": "0.15.18",
"description": "The Linux 32-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-linux-mips64le",
"name": "@esbuild/linux-mips64el",
"version": "0.15.18",
"description": "The Linux MIPS 64-bit Little Endian binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-linux-ppc64le",
"name": "@esbuild/linux-ppc64",
"version": "0.15.18",
"description": "The Linux PowerPC 64-bit Little Endian binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-linux-riscv64",
"name": "@esbuild/linux-riscv64",
"version": "0.15.18",
"description": "The Linux RISC-V 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-linux-s390x",
"name": "@esbuild/linux-s390x",
"version": "0.15.18",
"description": "The Linux IBM Z 64-bit Big Endian binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-linux-64",
"name": "@esbuild/linux-x64",
"version": "0.15.18",
"description": "The Linux 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-netbsd-64",
"name": "@esbuild/netbsd-x64",
"version": "0.15.18",
"description": "The NetBSD AMD64 binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-openbsd-64",
"name": "@esbuild/openbsd-x64",
"version": "0.15.18",
"description": "The OpenBSD 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-sunos-64",
"name": "@esbuild/sunos-x64",
"version": "0.15.18",
"description": "The illumos 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-windows-arm64",
"name": "@esbuild/win32-arm64",
"version": "0.15.18",
"description": "The Windows ARM 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-windows-32",
"name": "@esbuild/win32-ia32",
"version": "0.15.18",
"description": "The Windows 32-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "esbuild-windows-64",
"name": "@esbuild/win32-x64",
"version": "0.15.18",
"description": "The Windows 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
Expand Down
14 changes: 0 additions & 14 deletions npm/esbuild-windows-32/bin/esbuild

This file was deleted.

14 changes: 0 additions & 14 deletions npm/esbuild-windows-64/bin/esbuild

This file was deleted.

14 changes: 0 additions & 14 deletions npm/esbuild-windows-arm64/bin/esbuild

This file was deleted.

40 changes: 20 additions & 20 deletions npm/esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@
},
"optionalDependencies": {
"@esbuild/android-arm": "0.15.18",
"@esbuild/android-arm64": "0.15.18",
"@esbuild/android-x64": "0.15.18",
"@esbuild/darwin-arm64": "0.15.18",
"@esbuild/darwin-x64": "0.15.18",
"@esbuild/freebsd-arm64": "0.15.18",
"@esbuild/freebsd-x64": "0.15.18",
"@esbuild/linux-arm": "0.15.18",
"@esbuild/linux-arm64": "0.15.18",
"@esbuild/linux-ia32": "0.15.18",
"@esbuild/linux-loong64": "0.15.18",
"esbuild-android-64": "0.15.18",
"esbuild-android-arm64": "0.15.18",
"esbuild-darwin-64": "0.15.18",
"esbuild-darwin-arm64": "0.15.18",
"esbuild-freebsd-64": "0.15.18",
"esbuild-freebsd-arm64": "0.15.18",
"esbuild-linux-32": "0.15.18",
"esbuild-linux-64": "0.15.18",
"esbuild-linux-arm": "0.15.18",
"esbuild-linux-arm64": "0.15.18",
"esbuild-linux-mips64le": "0.15.18",
"esbuild-linux-ppc64le": "0.15.18",
"esbuild-linux-riscv64": "0.15.18",
"esbuild-linux-s390x": "0.15.18",
"esbuild-netbsd-64": "0.15.18",
"esbuild-openbsd-64": "0.15.18",
"esbuild-sunos-64": "0.15.18",
"esbuild-windows-32": "0.15.18",
"esbuild-windows-64": "0.15.18",
"esbuild-windows-arm64": "0.15.18"
"@esbuild/linux-mips64el": "0.15.18",
"@esbuild/linux-ppc64": "0.15.18",
"@esbuild/linux-riscv64": "0.15.18",
"@esbuild/linux-s390x": "0.15.18",
"@esbuild/linux-x64": "0.15.18",
"@esbuild/netbsd-x64": "0.15.18",
"@esbuild/openbsd-x64": "0.15.18",
"@esbuild/sunos-x64": "0.15.18",
"@esbuild/win32-arm64": "0.15.18",
"@esbuild/win32-ia32": "0.15.18",
"@esbuild/win32-x64": "0.15.18"
},
"license": "MIT"
}
2 changes: 1 addition & 1 deletion scripts/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ module.exports = ${JSON.stringify(exit0Map, null, 2)};
// Also copy this into the WebAssembly shim directories
for (const dir of [
path.join(repoDir, 'npm', '@esbuild', 'android-arm'),
path.join(repoDir, 'npm', 'esbuild-android-64'),
path.join(repoDir, 'npm', '@esbuild', 'android-x64'),
]) {
fs.mkdirSync(path.join(dir, 'bin'), { recursive: true })
fs.writeFileSync(path.join(dir, 'wasm_exec.js'), wasm_exec_js);
Expand Down

0 comments on commit 157860b

Please sign in to comment.