diff --git a/.gitignore b/.gitignore index 9d7df451161..24504092fd7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,3 @@ /demo/ /github/ /node_modules/ -/pkg/ diff --git a/Makefile b/Makefile index be9a97c87a9..bd97435c14c 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ ESBUILD_VERSION = $(shell cat version.txt) -esbuild: src/esbuild/*/*.go - GOPATH=`pwd` go build -o esbuild esbuild/main +esbuild: pkg/*/*.go cmd/*/*.go + go build -o esbuild ./cmd/esbuild test: - GOPATH=`pwd` go test ./... + go test ./... update-version-go: - echo "package main\n\nconst esbuildVersion = \"$(ESBUILD_VERSION)\"" > src/esbuild/main/version.go + echo "package main\n\nconst esbuildVersion = \"$(ESBUILD_VERSION)\"" > cmd/esbuild/version.go platform-all: update-version-go test make -j5 platform-windows platform-darwin platform-linux platform-wasm platform-neutral @@ -15,20 +15,20 @@ platform-all: update-version-go test platform-windows: mkdir -p npm/esbuild-windows-64/bin cd npm/esbuild-windows-64 && npm version "$(ESBUILD_VERSION)" --allow-same-version - GOOS=windows GOARCH=amd64 GOPATH=`pwd` go build -o npm/esbuild-windows-64/esbuild.exe esbuild/main + GOOS=windows GOARCH=amd64 go build -o npm/esbuild-windows-64/esbuild.exe ./cmd/esbuild platform-darwin: mkdir -p npm/esbuild-darwin-64/bin cd npm/esbuild-darwin-64 && npm version "$(ESBUILD_VERSION)" --allow-same-version - GOOS=darwin GOARCH=amd64 GOPATH=`pwd` go build -o npm/esbuild-darwin-64/bin/esbuild esbuild/main + GOOS=darwin GOARCH=amd64 go build -o npm/esbuild-darwin-64/bin/esbuild ./cmd/esbuild platform-linux: mkdir -p npm/esbuild-linux-64/bin cd npm/esbuild-linux-64 && npm version "$(ESBUILD_VERSION)" --allow-same-version - GOOS=linux GOARCH=amd64 GOPATH=`pwd` go build -o npm/esbuild-linux-64/bin/esbuild esbuild/main + GOOS=linux GOARCH=amd64 go build -o npm/esbuild-linux-64/bin/esbuild ./cmd/esbuild platform-wasm: - GOOS=js GOARCH=wasm GOPATH=`pwd` go build -o npm/esbuild-wasm/esbuild.wasm esbuild/main + GOOS=js GOARCH=wasm go build -o npm/esbuild-wasm/esbuild.wasm ./cmd/esbuild cd npm/esbuild-wasm && npm version "$(ESBUILD_VERSION)" --allow-same-version cp "$(shell go env GOROOT)/misc/wasm/wasm_exec.js" npm/esbuild-wasm/wasm_exec.js diff --git a/src/esbuild/main/main.go b/cmd/esbuild/main.go similarity index 97% rename from src/esbuild/main/main.go rename to cmd/esbuild/main.go index 7b18f3b3c39..04bf5235923 100644 --- a/src/esbuild/main/main.go +++ b/cmd/esbuild/main.go @@ -1,14 +1,14 @@ package main import ( - "esbuild/ast" - "esbuild/bundler" - "esbuild/fs" - "esbuild/lexer" - "esbuild/logging" - "esbuild/parser" - "esbuild/resolver" "fmt" + "github.com/evanw/esbuild/pkg/ast" + "github.com/evanw/esbuild/pkg/bundler" + "github.com/evanw/esbuild/pkg/fs" + "github.com/evanw/esbuild/pkg/lexer" + "github.com/evanw/esbuild/pkg/logging" + "github.com/evanw/esbuild/pkg/parser" + "github.com/evanw/esbuild/pkg/resolver" "io/ioutil" "os" "path/filepath" diff --git a/cmd/esbuild/version.go b/cmd/esbuild/version.go new file mode 100644 index 00000000000..5af462c3a22 --- /dev/null +++ b/cmd/esbuild/version.go @@ -0,0 +1,3 @@ +package main + +const esbuildVersion = "0.0.17" diff --git a/go.mod b/go.mod new file mode 100644 index 00000000000..e9b07ca8126 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/evanw/esbuild + +go 1.13 diff --git a/npm/esbuild-darwin-64/package.json b/npm/esbuild-darwin-64/package.json index 1c1a3f06252..f9f80acd3a2 100644 --- a/npm/esbuild-darwin-64/package.json +++ b/npm/esbuild-darwin-64/package.json @@ -1,6 +1,6 @@ { "name": "esbuild-darwin-64", - "version": "0.0.16", + "version": "0.0.17", "description": "The macOS 64-bit binary for esbuild, a JavaScript bundler.", "repository": "https://github.com/evanw/esbuild", "license": "MIT", diff --git a/npm/esbuild-linux-64/package.json b/npm/esbuild-linux-64/package.json index 38c7ca61c3d..d32c97c2c2e 100644 --- a/npm/esbuild-linux-64/package.json +++ b/npm/esbuild-linux-64/package.json @@ -1,6 +1,6 @@ { "name": "esbuild-linux-64", - "version": "0.0.16", + "version": "0.0.17", "description": "The Linux 64-bit binary for esbuild, a JavaScript bundler.", "repository": "https://github.com/evanw/esbuild", "license": "MIT", diff --git a/npm/esbuild-wasm/package.json b/npm/esbuild-wasm/package.json index d49324e5b62..5a7e88d65bc 100644 --- a/npm/esbuild-wasm/package.json +++ b/npm/esbuild-wasm/package.json @@ -1,6 +1,6 @@ { "name": "esbuild-wasm", - "version": "0.0.16", + "version": "0.0.17", "description": "The cross-platform WebAssembly binary for esbuild, a JavaScript bundler.", "repository": "https://github.com/evanw/esbuild", "license": "MIT", diff --git a/npm/esbuild-windows-64/package.json b/npm/esbuild-windows-64/package.json index 36d50bc5252..3506cec8ba6 100644 --- a/npm/esbuild-windows-64/package.json +++ b/npm/esbuild-windows-64/package.json @@ -1,6 +1,6 @@ { "name": "esbuild-windows-64", - "version": "0.0.16", + "version": "0.0.17", "description": "The Windows 64-bit binary for esbuild, a JavaScript bundler.", "repository": "https://github.com/evanw/esbuild", "license": "MIT", diff --git a/npm/esbuild/package.json b/npm/esbuild/package.json index 6843cfae9e4..abfee7f1046 100644 --- a/npm/esbuild/package.json +++ b/npm/esbuild/package.json @@ -1,6 +1,6 @@ { "name": "esbuild", - "version": "0.0.16", + "version": "0.0.17", "description": "An extremely fast JavaScript bundler and minifier.", "repository": "https://github.com/evanw/esbuild", "scripts": { diff --git a/src/esbuild/ast/ast.go b/pkg/ast/ast.go similarity index 100% rename from src/esbuild/ast/ast.go rename to pkg/ast/ast.go diff --git a/src/esbuild/bundler/bundler.go b/pkg/bundler/bundler.go similarity index 99% rename from src/esbuild/bundler/bundler.go rename to pkg/bundler/bundler.go index a36dab1e76d..8142a556323 100644 --- a/src/esbuild/bundler/bundler.go +++ b/pkg/bundler/bundler.go @@ -3,14 +3,14 @@ package bundler import ( "bytes" "encoding/base64" - "esbuild/ast" - "esbuild/fs" - "esbuild/lexer" - "esbuild/logging" - "esbuild/parser" - "esbuild/printer" - "esbuild/resolver" "fmt" + "github.com/evanw/esbuild/pkg/ast" + "github.com/evanw/esbuild/pkg/fs" + "github.com/evanw/esbuild/pkg/lexer" + "github.com/evanw/esbuild/pkg/logging" + "github.com/evanw/esbuild/pkg/parser" + "github.com/evanw/esbuild/pkg/printer" + "github.com/evanw/esbuild/pkg/resolver" "sort" "strings" "sync" diff --git a/src/esbuild/bundler/bundler_test.go b/pkg/bundler/bundler_test.go similarity index 99% rename from src/esbuild/bundler/bundler_test.go rename to pkg/bundler/bundler_test.go index c90764a42bd..9b56d1a4d3d 100644 --- a/src/esbuild/bundler/bundler_test.go +++ b/pkg/bundler/bundler_test.go @@ -1,10 +1,10 @@ package bundler import ( - "esbuild/fs" - "esbuild/logging" - "esbuild/parser" - "esbuild/resolver" + "github.com/evanw/esbuild/pkg/fs" + "github.com/evanw/esbuild/pkg/logging" + "github.com/evanw/esbuild/pkg/parser" + "github.com/evanw/esbuild/pkg/resolver" "path" "testing" ) diff --git a/src/esbuild/bundler/renamer.go b/pkg/bundler/renamer.go similarity index 99% rename from src/esbuild/bundler/renamer.go rename to pkg/bundler/renamer.go index 6df558adc08..8d11c6b1ee8 100644 --- a/src/esbuild/bundler/renamer.go +++ b/pkg/bundler/renamer.go @@ -1,8 +1,8 @@ package bundler import ( - "esbuild/ast" - "esbuild/lexer" + "github.com/evanw/esbuild/pkg/ast" + "github.com/evanw/esbuild/pkg/lexer" "sort" "strconv" ) diff --git a/src/esbuild/fs/fs.go b/pkg/fs/fs.go similarity index 100% rename from src/esbuild/fs/fs.go rename to pkg/fs/fs.go diff --git a/src/esbuild/fs/fs_test.go b/pkg/fs/fs_test.go similarity index 100% rename from src/esbuild/fs/fs_test.go rename to pkg/fs/fs_test.go diff --git a/src/esbuild/lexer/lexer.go b/pkg/lexer/lexer.go similarity index 99% rename from src/esbuild/lexer/lexer.go rename to pkg/lexer/lexer.go index 250131f5ac2..7c8f8cf1258 100644 --- a/src/esbuild/lexer/lexer.go +++ b/pkg/lexer/lexer.go @@ -14,9 +14,9 @@ package lexer // accurately. import ( - "esbuild/ast" - "esbuild/logging" "fmt" + "github.com/evanw/esbuild/pkg/ast" + "github.com/evanw/esbuild/pkg/logging" "strconv" "strings" "unicode" diff --git a/src/esbuild/lexer/lexer_test.go b/pkg/lexer/lexer_test.go similarity index 99% rename from src/esbuild/lexer/lexer_test.go rename to pkg/lexer/lexer_test.go index 261666f067c..e299efeaad1 100644 --- a/src/esbuild/lexer/lexer_test.go +++ b/pkg/lexer/lexer_test.go @@ -1,8 +1,8 @@ package lexer import ( - "esbuild/logging" "fmt" + "github.com/evanw/esbuild/pkg/logging" "math" "strings" "testing" diff --git a/src/esbuild/lexer/tables.go b/pkg/lexer/tables.go similarity index 100% rename from src/esbuild/lexer/tables.go rename to pkg/lexer/tables.go diff --git a/src/esbuild/logging/logging.go b/pkg/logging/logging.go similarity index 99% rename from src/esbuild/logging/logging.go rename to pkg/logging/logging.go index d8069ccf8be..0417b65f916 100644 --- a/src/esbuild/logging/logging.go +++ b/pkg/logging/logging.go @@ -6,8 +6,8 @@ package logging // default. import ( - "esbuild/ast" "fmt" + "github.com/evanw/esbuild/pkg/ast" "os" "os/exec" "runtime" diff --git a/src/esbuild/parser/parser.go b/pkg/parser/parser.go similarity index 99% rename from src/esbuild/parser/parser.go rename to pkg/parser/parser.go index d28d8aef5e9..b96efa6476d 100644 --- a/src/esbuild/parser/parser.go +++ b/pkg/parser/parser.go @@ -1,10 +1,10 @@ package parser import ( - "esbuild/ast" - "esbuild/lexer" - "esbuild/logging" "fmt" + "github.com/evanw/esbuild/pkg/ast" + "github.com/evanw/esbuild/pkg/lexer" + "github.com/evanw/esbuild/pkg/logging" "math" "reflect" "strings" diff --git a/src/esbuild/parser/parser_json.go b/pkg/parser/parser_json.go similarity index 94% rename from src/esbuild/parser/parser_json.go rename to pkg/parser/parser_json.go index 940141c2924..8dfd57bcd69 100644 --- a/src/esbuild/parser/parser_json.go +++ b/pkg/parser/parser_json.go @@ -1,9 +1,9 @@ package parser import ( - "esbuild/ast" - "esbuild/lexer" - "esbuild/logging" + "github.com/evanw/esbuild/pkg/ast" + "github.com/evanw/esbuild/pkg/lexer" + "github.com/evanw/esbuild/pkg/logging" ) type jsonParser struct { diff --git a/src/esbuild/parser/parser_test.go b/pkg/parser/parser_test.go similarity index 99% rename from src/esbuild/parser/parser_test.go rename to pkg/parser/parser_test.go index 30e67c15e06..2af36242ef1 100644 --- a/src/esbuild/parser/parser_test.go +++ b/pkg/parser/parser_test.go @@ -1,10 +1,10 @@ package parser import ( - "esbuild/ast" - "esbuild/logging" - "esbuild/printer" "fmt" + "github.com/evanw/esbuild/pkg/ast" + "github.com/evanw/esbuild/pkg/logging" + "github.com/evanw/esbuild/pkg/printer" "testing" ) diff --git a/src/esbuild/printer/printer.go b/pkg/printer/printer.go similarity index 99% rename from src/esbuild/printer/printer.go rename to pkg/printer/printer.go index f371d628da2..2b5bf338350 100644 --- a/src/esbuild/printer/printer.go +++ b/pkg/printer/printer.go @@ -2,9 +2,9 @@ package printer import ( "bytes" - "esbuild/ast" - "esbuild/lexer" "fmt" + "github.com/evanw/esbuild/pkg/ast" + "github.com/evanw/esbuild/pkg/lexer" "math" "strconv" "strings" diff --git a/src/esbuild/printer/printer_test.go b/pkg/printer/printer_test.go similarity index 99% rename from src/esbuild/printer/printer_test.go rename to pkg/printer/printer_test.go index 40356915718..145807b7f45 100644 --- a/src/esbuild/printer/printer_test.go +++ b/pkg/printer/printer_test.go @@ -1,8 +1,8 @@ package printer import ( - "esbuild/logging" - "esbuild/parser" + "github.com/evanw/esbuild/pkg/logging" + "github.com/evanw/esbuild/pkg/parser" "testing" ) diff --git a/src/esbuild/resolver/resolver.go b/pkg/resolver/resolver.go similarity index 98% rename from src/esbuild/resolver/resolver.go rename to pkg/resolver/resolver.go index 0928e2de2bf..fc2cd2883f8 100644 --- a/src/esbuild/resolver/resolver.go +++ b/pkg/resolver/resolver.go @@ -1,11 +1,11 @@ package resolver import ( - "esbuild/ast" - "esbuild/fs" - "esbuild/lexer" - "esbuild/logging" - "esbuild/parser" + "github.com/evanw/esbuild/pkg/ast" + "github.com/evanw/esbuild/pkg/fs" + "github.com/evanw/esbuild/pkg/lexer" + "github.com/evanw/esbuild/pkg/logging" + "github.com/evanw/esbuild/pkg/parser" "strings" "sync" ) diff --git a/src/esbuild/main/version.go b/src/esbuild/main/version.go deleted file mode 100644 index 57a8109693d..00000000000 --- a/src/esbuild/main/version.go +++ /dev/null @@ -1,3 +0,0 @@ -package main - -const esbuildVersion = "0.0.16" diff --git a/version.txt b/version.txt index e3b86dd9cc1..cd231804567 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.0.16 +0.0.17