From 0d4c9705da29859f7587ab9ce3c3314c8efaa978 Mon Sep 17 00:00:00 2001 From: Evan Wallace Date: Wed, 6 May 2020 23:44:03 -0700 Subject: [PATCH] rename imports for #66 --- cmd/esbuild/main.go | 15 ++++++++------- cmd/esbuild/service.go | 11 ++++++----- go.mod | 2 +- internal/ast/ast.go | 3 ++- internal/bundler/bundler.go | 17 +++++++++-------- internal/bundler/bundler_importstar_test.go | 3 ++- internal/bundler/bundler_importstar_ts_test.go | 3 ++- internal/bundler/bundler_test.go | 9 +++++---- internal/bundler/bundler_ts_test.go | 3 ++- internal/bundler/renamer.go | 5 +++-- internal/lexer/lexer.go | 5 +++-- internal/lexer/lexer_test.go | 3 ++- internal/logging/logging.go | 3 ++- internal/parser/parser.go | 9 +++++---- internal/parser/parser_json.go | 7 ++++--- internal/parser/parser_json_test.go | 5 +++-- internal/parser/parser_test.go | 7 ++++--- internal/parser/parser_ts_test.go | 5 +++-- internal/printer/printer.go | 7 ++++--- internal/printer/printer_test.go | 5 +++-- internal/resolver/resolver.go | 11 ++++++----- 21 files changed, 79 insertions(+), 59 deletions(-) diff --git a/cmd/esbuild/main.go b/cmd/esbuild/main.go index 4ec53acb41d..9e6b97a5a71 100644 --- a/cmd/esbuild/main.go +++ b/cmd/esbuild/main.go @@ -1,13 +1,6 @@ package main import ( - "esbuild/ast" - "esbuild/bundler" - "esbuild/fs" - "esbuild/lexer" - "esbuild/logging" - "esbuild/parser" - "esbuild/resolver" "fmt" "io/ioutil" "os" @@ -16,6 +9,14 @@ import ( "strconv" "strings" "time" + + "github.com/evanw/esbuild/internal/ast" + "github.com/evanw/esbuild/internal/bundler" + "github.com/evanw/esbuild/internal/fs" + "github.com/evanw/esbuild/internal/lexer" + "github.com/evanw/esbuild/internal/logging" + "github.com/evanw/esbuild/internal/parser" + "github.com/evanw/esbuild/internal/resolver" ) type argsObject struct { diff --git a/cmd/esbuild/service.go b/cmd/esbuild/service.go index 0ef2ec2f1ea..6b64c9d5537 100644 --- a/cmd/esbuild/service.go +++ b/cmd/esbuild/service.go @@ -7,15 +7,16 @@ package main import ( "encoding/binary" - "esbuild/bundler" - "esbuild/fs" - "esbuild/logging" - "esbuild/printer" - "esbuild/resolver" "fmt" "io" "os" "runtime/debug" + + "github.com/evanw/esbuild/internal/bundler" + "github.com/evanw/esbuild/internal/fs" + "github.com/evanw/esbuild/internal/logging" + "github.com/evanw/esbuild/internal/printer" + "github.com/evanw/esbuild/internal/resolver" ) type responseType = map[string][]byte diff --git a/go.mod b/go.mod index 880753f6410..a9fbb0c90bb 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module esbuild +module github.com/evanw/esbuild go 1.13 diff --git a/internal/ast/ast.go b/internal/ast/ast.go index e98f71c9971..0934862a01f 100644 --- a/internal/ast/ast.go +++ b/internal/ast/ast.go @@ -1,9 +1,10 @@ package ast import ( - "esbuild/runtime" "path" "strings" + + "github.com/evanw/esbuild/internal/runtime" ) // Every module (i.e. file) is parsed into a separate AST data structure. For diff --git a/internal/bundler/bundler.go b/internal/bundler/bundler.go index 05ce6712086..b6e070a0471 100644 --- a/internal/bundler/bundler.go +++ b/internal/bundler/bundler.go @@ -3,18 +3,19 @@ package bundler import ( "bytes" "encoding/base64" - "esbuild/ast" - "esbuild/fs" - "esbuild/lexer" - "esbuild/logging" - "esbuild/parser" - "esbuild/printer" - "esbuild/resolver" - "esbuild/runtime" "fmt" "sort" "strings" "sync" + + "github.com/evanw/esbuild/internal/ast" + "github.com/evanw/esbuild/internal/fs" + "github.com/evanw/esbuild/internal/lexer" + "github.com/evanw/esbuild/internal/logging" + "github.com/evanw/esbuild/internal/parser" + "github.com/evanw/esbuild/internal/printer" + "github.com/evanw/esbuild/internal/resolver" + "github.com/evanw/esbuild/internal/runtime" ) type file struct { diff --git a/internal/bundler/bundler_importstar_test.go b/internal/bundler/bundler_importstar_test.go index addcc3136e2..4ad67aa2f02 100644 --- a/internal/bundler/bundler_importstar_test.go +++ b/internal/bundler/bundler_importstar_test.go @@ -1,8 +1,9 @@ package bundler import ( - "esbuild/parser" "testing" + + "github.com/evanw/esbuild/internal/parser" ) func TestImportStarES6Unused(t *testing.T) { diff --git a/internal/bundler/bundler_importstar_ts_test.go b/internal/bundler/bundler_importstar_ts_test.go index 7fac2dbd359..64db7498b57 100644 --- a/internal/bundler/bundler_importstar_ts_test.go +++ b/internal/bundler/bundler_importstar_ts_test.go @@ -1,8 +1,9 @@ package bundler import ( - "esbuild/parser" "testing" + + "github.com/evanw/esbuild/internal/parser" ) func TestTSImportStarES6Unused(t *testing.T) { diff --git a/internal/bundler/bundler_test.go b/internal/bundler/bundler_test.go index 576b5936ecd..5b57c35f545 100644 --- a/internal/bundler/bundler_test.go +++ b/internal/bundler/bundler_test.go @@ -1,12 +1,13 @@ package bundler import ( - "esbuild/fs" - "esbuild/logging" - "esbuild/parser" - "esbuild/resolver" "path" "testing" + + "github.com/evanw/esbuild/internal/fs" + "github.com/evanw/esbuild/internal/logging" + "github.com/evanw/esbuild/internal/parser" + "github.com/evanw/esbuild/internal/resolver" ) func assertEqual(t *testing.T, a interface{}, b interface{}) { diff --git a/internal/bundler/bundler_ts_test.go b/internal/bundler/bundler_ts_test.go index c125520fae1..de0d4f43239 100644 --- a/internal/bundler/bundler_ts_test.go +++ b/internal/bundler/bundler_ts_test.go @@ -1,8 +1,9 @@ package bundler import ( - "esbuild/parser" "testing" + + "github.com/evanw/esbuild/internal/parser" ) func TestTSDeclareConst(t *testing.T) { diff --git a/internal/bundler/renamer.go b/internal/bundler/renamer.go index 2a052f27ac3..28e8bc704d0 100644 --- a/internal/bundler/renamer.go +++ b/internal/bundler/renamer.go @@ -1,10 +1,11 @@ package bundler import ( - "esbuild/ast" - "esbuild/lexer" "sort" "strconv" + + "github.com/evanw/esbuild/internal/ast" + "github.com/evanw/esbuild/internal/lexer" ) func computeReservedNames(moduleScopes []*ast.Scope, symbols *ast.SymbolMap) map[string]bool { diff --git a/internal/lexer/lexer.go b/internal/lexer/lexer.go index 9a8d8f69ffc..f74e8835935 100644 --- a/internal/lexer/lexer.go +++ b/internal/lexer/lexer.go @@ -14,14 +14,15 @@ package lexer // accurately. import ( - "esbuild/ast" - "esbuild/logging" "fmt" "strconv" "strings" "unicode" "unicode/utf16" "unicode/utf8" + + "github.com/evanw/esbuild/internal/ast" + "github.com/evanw/esbuild/internal/logging" ) type T uint diff --git a/internal/lexer/lexer_test.go b/internal/lexer/lexer_test.go index 1b17f079c5a..13a795f66fa 100644 --- a/internal/lexer/lexer_test.go +++ b/internal/lexer/lexer_test.go @@ -1,12 +1,13 @@ package lexer import ( - "esbuild/logging" "fmt" "math" "strings" "testing" "unicode/utf8" + + "github.com/evanw/esbuild/internal/logging" ) func assertEqual(t *testing.T, a interface{}, b interface{}) { diff --git a/internal/logging/logging.go b/internal/logging/logging.go index c86d738bb15..32b8e47ea89 100644 --- a/internal/logging/logging.go +++ b/internal/logging/logging.go @@ -6,10 +6,11 @@ package logging // default. import ( - "esbuild/ast" "fmt" "os" "strings" + + "github.com/evanw/esbuild/internal/ast" ) type Log struct { diff --git a/internal/parser/parser.go b/internal/parser/parser.go index 2c0a5b049ab..1b9ac5a4c4e 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -1,16 +1,17 @@ package parser import ( - "esbuild/ast" - "esbuild/lexer" - "esbuild/logging" - "esbuild/runtime" "fmt" "math" "reflect" "strconv" "strings" "unsafe" + + "github.com/evanw/esbuild/internal/ast" + "github.com/evanw/esbuild/internal/lexer" + "github.com/evanw/esbuild/internal/logging" + "github.com/evanw/esbuild/internal/runtime" ) // This parser does two passes: diff --git a/internal/parser/parser_json.go b/internal/parser/parser_json.go index 7da51a257ff..9736d60cf1e 100644 --- a/internal/parser/parser_json.go +++ b/internal/parser/parser_json.go @@ -1,10 +1,11 @@ package parser import ( - "esbuild/ast" - "esbuild/lexer" - "esbuild/logging" "fmt" + + "github.com/evanw/esbuild/internal/ast" + "github.com/evanw/esbuild/internal/lexer" + "github.com/evanw/esbuild/internal/logging" ) type jsonParser struct { diff --git a/internal/parser/parser_json_test.go b/internal/parser/parser_json_test.go index 08bfa6456d7..b772ceaa0d9 100644 --- a/internal/parser/parser_json_test.go +++ b/internal/parser/parser_json_test.go @@ -1,10 +1,11 @@ package parser import ( - "esbuild/logging" - "esbuild/printer" "fmt" "testing" + + "github.com/evanw/esbuild/internal/logging" + "github.com/evanw/esbuild/internal/printer" ) func expectParseErrorJSON(t *testing.T, contents string, expected string) { diff --git a/internal/parser/parser_test.go b/internal/parser/parser_test.go index 82257a27ad8..9e6ab896b30 100644 --- a/internal/parser/parser_test.go +++ b/internal/parser/parser_test.go @@ -1,11 +1,12 @@ package parser import ( - "esbuild/ast" - "esbuild/logging" - "esbuild/printer" "fmt" "testing" + + "github.com/evanw/esbuild/internal/ast" + "github.com/evanw/esbuild/internal/logging" + "github.com/evanw/esbuild/internal/printer" ) func assertEqual(t *testing.T, a interface{}, b interface{}) { diff --git a/internal/parser/parser_ts_test.go b/internal/parser/parser_ts_test.go index 9938ba900e8..d1012773d9d 100644 --- a/internal/parser/parser_ts_test.go +++ b/internal/parser/parser_ts_test.go @@ -1,9 +1,10 @@ package parser import ( - "esbuild/logging" - "esbuild/printer" "testing" + + "github.com/evanw/esbuild/internal/logging" + "github.com/evanw/esbuild/internal/printer" ) func expectParseErrorTS(t *testing.T, contents string, expected string) { diff --git a/internal/printer/printer.go b/internal/printer/printer.go index 9d96c87800c..92d46f0c690 100644 --- a/internal/printer/printer.go +++ b/internal/printer/printer.go @@ -2,14 +2,15 @@ package printer import ( "bytes" - "esbuild/ast" - "esbuild/lexer" - "esbuild/runtime" "fmt" "math" "strconv" "strings" "unicode/utf8" + + "github.com/evanw/esbuild/internal/ast" + "github.com/evanw/esbuild/internal/lexer" + "github.com/evanw/esbuild/internal/runtime" ) var base64 = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/") diff --git a/internal/printer/printer_test.go b/internal/printer/printer_test.go index 0a051571faa..cceb215e549 100644 --- a/internal/printer/printer_test.go +++ b/internal/printer/printer_test.go @@ -1,9 +1,10 @@ package printer import ( - "esbuild/logging" - "esbuild/parser" "testing" + + "github.com/evanw/esbuild/internal/logging" + "github.com/evanw/esbuild/internal/parser" ) func assertEqual(t *testing.T, a interface{}, b interface{}) { diff --git a/internal/resolver/resolver.go b/internal/resolver/resolver.go index 5ca3e88e34f..e174b799473 100644 --- a/internal/resolver/resolver.go +++ b/internal/resolver/resolver.go @@ -1,13 +1,14 @@ package resolver import ( - "esbuild/ast" - "esbuild/fs" - "esbuild/lexer" - "esbuild/logging" - "esbuild/parser" "strings" "sync" + + "github.com/evanw/esbuild/internal/ast" + "github.com/evanw/esbuild/internal/fs" + "github.com/evanw/esbuild/internal/lexer" + "github.com/evanw/esbuild/internal/logging" + "github.com/evanw/esbuild/internal/parser" ) type ResolveStatus uint8