Skip to content

Commit

Permalink
rename imports for #66
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed May 7, 2020
1 parent a94685d commit 0d4c970
Show file tree
Hide file tree
Showing 21 changed files with 79 additions and 59 deletions.
15 changes: 8 additions & 7 deletions cmd/esbuild/main.go
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 {
Expand Down
11 changes: 6 additions & 5 deletions cmd/esbuild/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module esbuild
module github.com/evanw/esbuild

go 1.13

Expand Down
3 changes: 2 additions & 1 deletion internal/ast/ast.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 9 additions & 8 deletions internal/bundler/bundler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion internal/bundler/bundler_importstar_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package bundler

import (
"esbuild/parser"
"testing"

"github.com/evanw/esbuild/internal/parser"
)

func TestImportStarES6Unused(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion internal/bundler/bundler_importstar_ts_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package bundler

import (
"esbuild/parser"
"testing"

"github.com/evanw/esbuild/internal/parser"
)

func TestTSImportStarES6Unused(t *testing.T) {
Expand Down
9 changes: 5 additions & 4 deletions internal/bundler/bundler_test.go
Original file line number Diff line number Diff line change
@@ -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{}) {
Expand Down
3 changes: 2 additions & 1 deletion internal/bundler/bundler_ts_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package bundler

import (
"esbuild/parser"
"testing"

"github.com/evanw/esbuild/internal/parser"
)

func TestTSDeclareConst(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions internal/bundler/renamer.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions internal/lexer/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion internal/lexer/lexer_test.go
Original file line number Diff line number Diff line change
@@ -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{}) {
Expand Down
3 changes: 2 additions & 1 deletion internal/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ package logging
// default.

import (
"esbuild/ast"
"fmt"
"os"
"strings"

"github.com/evanw/esbuild/internal/ast"
)

type Log struct {
Expand Down
9 changes: 5 additions & 4 deletions internal/parser/parser.go
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
7 changes: 4 additions & 3 deletions internal/parser/parser_json.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions internal/parser/parser_json_test.go
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
7 changes: 4 additions & 3 deletions internal/parser/parser_test.go
Original file line number Diff line number Diff line change
@@ -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{}) {
Expand Down
5 changes: 3 additions & 2 deletions internal/parser/parser_ts_test.go
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
7 changes: 4 additions & 3 deletions internal/printer/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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+/")
Expand Down
5 changes: 3 additions & 2 deletions internal/printer/printer_test.go
Original file line number Diff line number Diff line change
@@ -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{}) {
Expand Down
11 changes: 6 additions & 5 deletions internal/resolver/resolver.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 0d4c970

Please sign in to comment.