Skip to content

Commit a7e94de

Browse files
committed
Enable JS/TS module
1 parent 6f51de3 commit a7e94de

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

cmd/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var buildCmd = &cobra.Command{
3535
Output: output,
3636
}
3737
switch data.Lang {
38-
case "go":
38+
case "go", "js", "ts":
3939
err = modules.ExecuteBuild(buildData, data)
4040
abort(err)
4141
default:

cmd/new.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func newServer(projectName string) error {
105105
}
106106

107107
switch language {
108-
case "go", "js", "ts":
108+
case "go":
109109
err = modules.ExecuteNewServer(newData)
110110
default:
111111
err = fmt.Errorf("'new server' is not supported for '%s'", language)

cmd/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var runCmd = &cobra.Command{
3333
}
3434

3535
switch data.Lang {
36-
case "go":
36+
case "go", "js", "ts":
3737
err = modules.ExecuteRun(runData, data)
3838
abort(err)
3939
default:

cmd/update.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ func updateClient(config *cgfile.CodeGameFileData) error {
8585

8686
switch config.Lang {
8787
case "go":
88-
updateData.Lang = external.LibraryVersionFromCGVersion("code-game-project", "go-client", info.CGVersion)
88+
updateData.LibraryVersion = external.LibraryVersionFromCGVersion("code-game-project", "go-client", info.CGVersion)
89+
err = modules.ExecuteUpdate(updateData, config)
90+
case "js", "ts":
91+
updateData.LibraryVersion = external.LibraryVersionFromCGVersion("code-game-project", "javascript-client", info.CGVersion)
8992
err = modules.ExecuteUpdate(updateData, config)
9093
default:
9194
err = fmt.Errorf("'update' is not supported for '%s'", config.Lang)

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.18
55
require (
66
github.com/Bananenpro/cli v0.3.0
77
github.com/adrg/xdg v0.4.0
8-
github.com/code-game-project/go-utils v0.2.9
8+
github.com/code-game-project/go-utils v0.2.11
99
github.com/gomarkdown/markdown v0.0.0-20220731190611-dcdaee8e7a53
1010
github.com/google/uuid v1.3.0
1111
github.com/mattn/go-colorable v0.1.12
@@ -14,12 +14,12 @@ require (
1414

1515
require (
1616
github.com/AlecAivazis/survey/v2 v2.3.5 // indirect
17-
github.com/inconshreveable/mousetrap v1.0.0 // indirect
17+
github.com/inconshreveable/mousetrap v1.0.1 // indirect
1818
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
1919
github.com/mattn/go-isatty v0.0.14 // indirect
2020
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
2121
github.com/spf13/pflag v1.0.5 // indirect
22-
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 // indirect
22+
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 // indirect
2323
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
2424
golang.org/x/text v0.3.7 // indirect
2525
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect

go.sum

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
github.com/AlecAivazis/survey/v2 v2.3.5 h1:A8cYupsAZkjaUmhtTYv3sSqc7LO5mp1XDfqe5E/9wRQ=
22
github.com/AlecAivazis/survey/v2 v2.3.5/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI=
3-
github.com/Bananenpro/cli v0.2.2 h1:7nMlgMGMT1rxkuqCiJuo/Jd89HTnw9psE3h/vQW57nk=
4-
github.com/Bananenpro/cli v0.2.2/go.mod h1:JBXpIAXo/D0rlsfgCViQBicjcJY6UWUldmxvKM+ijRc=
53
github.com/Bananenpro/cli v0.3.0 h1:gQOzc22yv+rePT0nRYva1ccdva3hTGyUwrGdcnXqchU=
64
github.com/Bananenpro/cli v0.3.0/go.mod h1:JBXpIAXo/D0rlsfgCViQBicjcJY6UWUldmxvKM+ijRc=
75
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
86
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
97
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
108
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
11-
github.com/code-game-project/go-utils v0.2.8 h1:f6ZvORWmlf8uZnCSAhLJ23MdA5dGvcAPkijTLfbv+B4=
12-
github.com/code-game-project/go-utils v0.2.8/go.mod h1:kQ6kH9XDzdM2pnJUI1lw61Gp8XOams/E2dKABa1mBI8=
13-
github.com/code-game-project/go-utils v0.2.9 h1:ezaxxLBAQRwFnIXso+zKPL7AJnuAMIcMwrhLruoyOa8=
14-
github.com/code-game-project/go-utils v0.2.9/go.mod h1:kQ6kH9XDzdM2pnJUI1lw61Gp8XOams/E2dKABa1mBI8=
9+
github.com/code-game-project/go-utils v0.2.11 h1:PhAD+6cPacBuAFcfBEV5oHhzo0R9/N48ZGSpziKOKCE=
10+
github.com/code-game-project/go-utils v0.2.11/go.mod h1:/ws9iYkZCnZvS9g2aqdxKwSnU5AEeI7SE1mbB+x4ggg=
1511
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
1612
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
1713
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
@@ -24,8 +20,9 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
2420
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
2521
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog=
2622
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68=
27-
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
2823
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
24+
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
25+
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
2926
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
3027
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
3128
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
@@ -54,8 +51,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
5451
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5552
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5653
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
57-
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 h1:9vYwv7OjYaky/tlAeD7C4oC9EsPTlaFl1H2jS++V+ME=
58-
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
54+
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 h1:v1W7bwXHsnLLloWYTVEdvGvA7BHMeBYsPcF0GLDxIRs=
55+
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5956
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
6057
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc=
6158
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=

0 commit comments

Comments
 (0)