diff --git a/cmd/config/example.go b/cmd/config/example.go index 16a4c13e8..68cc384de 100644 --- a/cmd/config/example.go +++ b/cmd/config/example.go @@ -72,7 +72,7 @@ func commandExample(cCtx *cli.Context) error { //nolint:funlen,maintidx }, Functions: &model.ConfigFunctions{ Node: &model.ConfigFunctionsNode{ - Version: ptr(int(16)), + Version: ptr(int(18)), }, }, Auth: &model.ConfigAuth{ diff --git a/cmd/config/testdata/validate/success/nhost/nhost.toml b/cmd/config/testdata/validate/success/nhost/nhost.toml index 499ee4833..a5ef4ea2d 100644 --- a/cmd/config/testdata/validate/success/nhost/nhost.toml +++ b/cmd/config/testdata/validate/success/nhost/nhost.toml @@ -28,7 +28,7 @@ httpPoolSize = 100 [functions] [functions.node] -version = 16 +version = 18 [auth] version = '0.20.0' diff --git a/cmd/config/validate_test.go b/cmd/config/validate_test.go index f0d073b7c..d45029ab9 100644 --- a/cmd/config/validate_test.go +++ b/cmd/config/validate_test.go @@ -51,7 +51,7 @@ func expectedConfig() *model.ConfigConfig { Logs: &model.ConfigHasuraLogs{Level: ptr("warn")}, Events: &model.ConfigHasuraEvents{HttpPoolSize: ptr(uint32(100))}, }, - Functions: &model.ConfigFunctions{Node: &model.ConfigFunctionsNode{Version: ptr(16)}}, + Functions: &model.ConfigFunctions{Node: &model.ConfigFunctionsNode{Version: ptr(18)}}, Auth: &model.ConfigAuth{ Version: ptr("0.20.0"), Redirections: &model.ConfigAuthRedirections{ diff --git a/cmd/dev/up.go b/cmd/dev/up.go index 79376b07b..547a6f460 100644 --- a/cmd/dev/up.go +++ b/cmd/dev/up.go @@ -25,7 +25,6 @@ const ( flagsFunctionsPort = "functions-port" flagsHasuraPort = "hasura-port" flagsHasuraConsolePort = "hasura-console-port" - flagsNode18 = "node18" ) const ( @@ -33,7 +32,7 @@ const ( defaultPostgresPort = 5432 ) -func CommandUp() *cli.Command { //nolint:funlen +func CommandUp() *cli.Command { return &cli.Command{ //nolint:exhaustruct Name: "up", Aliases: []string{}, @@ -89,11 +88,6 @@ func CommandUp() *cli.Command { //nolint:funlen Usage: "If specified, expose hasura console on this port. Not recommended", Value: 0, }, - &cli.BoolFlag{ //nolint:exhaustruct - Name: flagsNode18, - Usage: "Use node 18. Defaults to node 16", - Value: false, - }, }, } } @@ -129,7 +123,6 @@ func commandUp(cCtx *cli.Context) error { Console: cCtx.Uint(flagsHasuraConsolePort), Functions: cCtx.Uint(flagsFunctionsPort), }, - cCtx.Bool(flagsNode18), ) } @@ -187,7 +180,6 @@ func up( //nolint:funlen postgresPort uint, applySeeds bool, ports dockercompose.ExposePorts, - useNode18 bool, ) error { ctx, cancel := context.WithCancel(ctx) @@ -215,7 +207,6 @@ func up( //nolint:funlen ce.Path.DotNhostFolder(), ce.Path.Root(), ports, - useNode18, ) if err != nil { return fmt.Errorf("failed to generate docker-compose.yaml: %w", err) @@ -287,12 +278,11 @@ func Up( postgresPort uint, applySeeds bool, ports dockercompose.ExposePorts, - useNode18 bool, ) error { dc := dockercompose.New(ce.Path.WorkingDir(), ce.Path.DockerCompose(), ce.ProjectName()) if err := up( - ctx, ce, dc, httpPort, useTLS, postgresPort, applySeeds, ports, useNode18, + ctx, ce, dc, httpPort, useTLS, postgresPort, applySeeds, ports, ); err != nil { ce.Warnln(err.Error()) diff --git a/dockercompose/compose.go b/dockercompose/compose.go index 4faa2fadc..c33036e23 100644 --- a/dockercompose/compose.go +++ b/dockercompose/compose.go @@ -297,7 +297,6 @@ func functions( //nolint:funlen rootFolder string, jwtSecret string, port uint, - useNode18 bool, ) *Service { envVars := map[string]string{ "HASURA_GRAPHQL_ADMIN_SECRET": cfg.Hasura.AdminSecret, @@ -319,13 +318,8 @@ func functions( //nolint:funlen envVars[envVar.GetName()] = envVar.GetValue() } - image := "nhost/functions:0.1.9" - if useNode18 { - image = "nhost/functions:1.0.0" - } - return &Service{ - Image: image, + Image: "nhost/functions:1.0.0", DependsOn: nil, EntryPoint: nil, Command: nil, @@ -434,7 +428,6 @@ func ComposeFileFromConfig( //nolint:funlen dotNhostFolder string, rootFolder string, ports ExposePorts, - useNode18 bool, ) (*ComposeFile, error) { minio, err := minio(dataFolder) if err != nil { @@ -490,7 +483,6 @@ func ComposeFileFromConfig( //nolint:funlen rootFolder, jwtSecret, ports.Functions, - useNode18, ), "graphql": graphql, "minio": minio, diff --git a/dockercompose/main_test.go b/dockercompose/main_test.go index b97d0e3ad..ae1b66bf2 100644 --- a/dockercompose/main_test.go +++ b/dockercompose/main_test.go @@ -197,7 +197,7 @@ func getConfig() *model.ConfigConfig { //nolint:maintidx }, Functions: &model.ConfigFunctions{ Node: &model.ConfigFunctionsNode{ - Version: ptr(16), + Version: ptr(18), }, }, Hasura: &model.ConfigHasura{ diff --git a/examples/myproject/nhost/nhost.toml b/examples/myproject/nhost/nhost.toml index 396045e54..abf07a0a8 100644 --- a/examples/myproject/nhost/nhost.toml +++ b/examples/myproject/nhost/nhost.toml @@ -23,7 +23,7 @@ liveQueriesMultiplexedRefetchInterval = 3000 [functions] [functions.node] -version = 16 +version = 18 [auth] version = '0.21.2' diff --git a/go.mod b/go.mod index 907f170f8..b4d9f36e9 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-git/go-git/v5 v5.9.0 github.com/google/go-cmp v0.5.9 github.com/hashicorp/go-getter v1.7.2 - github.com/nhost/be v0.0.0-20230926093342-5b218de2929f + github.com/nhost/be v0.0.0-20230926115940-c3b7d3961fd7 github.com/pelletier/go-toml/v2 v2.0.8 github.com/urfave/cli/v2 v2.25.7 github.com/wI2L/jsondiff v0.4.0 diff --git a/go.sum b/go.sum index ebddcf6ed..c6d98bb7e 100644 --- a/go.sum +++ b/go.sum @@ -443,6 +443,8 @@ github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/nhost/be v0.0.0-20230926093342-5b218de2929f h1:Ws9TS33VKX3w+36k18utttmAeiwFQQBNwEpTz7vLJYU= github.com/nhost/be v0.0.0-20230926093342-5b218de2929f/go.mod h1:TX+opGjg0+Q7LflEByl4E8B8hlu1huf4t2TY3YzUA9c= +github.com/nhost/be v0.0.0-20230926115940-c3b7d3961fd7 h1:6J7Oh+/KLtLNg6wt8LDMqP+WNBDZsC+dDsIVT3O7W2Q= +github.com/nhost/be v0.0.0-20230926115940-c3b7d3961fd7/go.mod h1:TX+opGjg0+Q7LflEByl4E8B8hlu1huf4t2TY3YzUA9c= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= diff --git a/vendor/github.com/nhost/be/services/mimir/schema/schema.cue b/vendor/github.com/nhost/be/services/mimir/schema/schema.cue index ecfe36486..ec652b103 100644 --- a/vendor/github.com/nhost/be/services/mimir/schema/schema.cue +++ b/vendor/github.com/nhost/be/services/mimir/schema/schema.cue @@ -170,7 +170,7 @@ import ( // Configuration for functions service #Functions: { node: { - version: 16 + version: 18 } } diff --git a/vendor/modules.txt b/vendor/modules.txt index c6aa29e78..9f752996f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -399,7 +399,7 @@ github.com/muesli/reflow/wrap # github.com/muesli/termenv v0.15.2 ## explicit; go 1.17 github.com/muesli/termenv -# github.com/nhost/be v0.0.0-20230926093342-5b218de2929f +# github.com/nhost/be v0.0.0-20230926115940-c3b7d3961fd7 ## explicit; go 1.21 github.com/nhost/be/services/mimir/model github.com/nhost/be/services/mimir/schema