Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve Go version handling #660

Merged
merged 4 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- chore: lint example test [#656](https://github.com/hypermodeinc/modus/pull/656)
- fix: unused imports should not be included in metadata [#657](https://github.com/hypermodeinc/modus/pull/657)
- fix: improve Go version handling [#660](https://github.com/hypermodeinc/modus/pull/660)

## 2024-12-13 - Runtime 0.15.0

Expand Down
9 changes: 7 additions & 2 deletions cli/src/commands/new/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,19 @@ export default class NewCommand extends BaseCommand {
// Apply SDK-specific modifications
const execOpts = { env: process.env, cwd: dir, shell: true };
switch (sdk) {
case SDK.AssemblyScript:
case SDK.AssemblyScript: {
await execFile("npm", ["pkg", "set", `name=${name}`], execOpts);
await execFile("npm", ["install"], execOpts);
break;
case SDK.Go:
}
case SDK.Go: {
const goVersion = await getGoVersion();
await execFile("go", ["mod", "edit", "-go", goVersion!], execOpts);
await execFile("go", ["mod", "edit", "-module", name], execOpts);
await execFile("go", ["mod", "download"], execOpts);
await execFile("go", ["mod", "tidy"], execOpts);
break;
}
}

if (createGitRepo) {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/custom/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import process from "node:process";
export const ModusHomeDir = process.env.MODUS_HOME || path.join(os.homedir(), ".modus");

export const MinNodeVersion = "22.0.0";
export const MinGoVersion = "1.23.0";
export const MinGoVersion = "1.23.1";
export const MinTinyGoVersion = "0.33.0";

export const GitHubOwner = "hypermodeinc";
Expand Down
2 changes: 1 addition & 1 deletion runtime/languages/golang/testdata/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module testdata

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0
2 changes: 1 addition & 1 deletion sdk/go/examples/anthropic-functions/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module anthropic-functions-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0

Expand Down
2 changes: 1 addition & 1 deletion sdk/go/examples/auth/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module auth-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0
2 changes: 1 addition & 1 deletion sdk/go/examples/classification/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module classification-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0
2 changes: 1 addition & 1 deletion sdk/go/examples/collections/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module collection-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0
2 changes: 1 addition & 1 deletion sdk/go/examples/dgraph/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module dgraph-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0
2 changes: 1 addition & 1 deletion sdk/go/examples/embedding/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module embedding-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0

Expand Down
2 changes: 1 addition & 1 deletion sdk/go/examples/graphql/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module graphql-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0
2 changes: 1 addition & 1 deletion sdk/go/examples/http/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module http-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0
2 changes: 1 addition & 1 deletion sdk/go/examples/neo4j/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module neo4j-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0
2 changes: 1 addition & 1 deletion sdk/go/examples/postgresql/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module postgresql-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0
2 changes: 1 addition & 1 deletion sdk/go/examples/simple/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module simple-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0
2 changes: 1 addition & 1 deletion sdk/go/examples/textgeneration/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module text-generation-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0

Expand Down
2 changes: 1 addition & 1 deletion sdk/go/examples/vectors/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module vectors-example

go 1.23.0
go 1.23.4

require github.com/hypermodeinc/modus/sdk/go v0.15.0

Expand Down
2 changes: 1 addition & 1 deletion sdk/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hypermodeinc/modus/sdk/go

go 1.23.0
go 1.23.1

require (
github.com/hypermodeinc/modus/lib/manifest v0.15.0
Expand Down
2 changes: 1 addition & 1 deletion sdk/go/templates/default/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module my-modus-app

go 1.23.0
go 1.23.1

require github.com/hypermodeinc/modus/sdk/go v0.15.0
Loading