Skip to content

Commit 9aeb90a

Browse files
committed
wording and ph
1 parent 675c118 commit 9aeb90a

File tree

6 files changed

+47
-23
lines changed

6 files changed

+47
-23
lines changed

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
BINARY_NAME=restack-get-started
2-
VERSION=0.6.16
2+
VERSION=0.6.17
33
BUILD_DIR=build
44

55
.PHONY: all linux macos clean

npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@restackio/get-started",
3-
"version": "0.6.16",
3+
"version": "0.6.17",
44
"description": "A getting started command which will help with a first application using Restack framework",
55
"bin": {
66
"get-started": "get-started.sh"

pypi/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "restackio.get-started"
3-
version = "0.6.16"
3+
version = "0.6.17"
44
readme = "README.md"
55
description = "A package to get started with Restack"
66
authors = ["Your Name <[email protected]>"]

src/cloneBoilerplates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var repositoryUrls = map[string]string{
1818
}
1919

2020
func (m model) cloneBoilerplates() error {
21-
targetDir := filepath.Join(m.currentDir, m.projectName)
21+
targetDir := filepath.Join(m.currentDir, m.applicationName)
2222
tempDir := filepath.Join(m.currentDir, "temp")
2323

2424
repoName := repositoryUrls[m.language]

src/main.go

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,27 @@ import (
55
"os"
66

77
"github.com/charmbracelet/huh"
8+
"github.com/posthog/posthog-go"
89
)
910

1011
type model struct {
11-
language string
12-
projectName string
13-
currentDir string
14-
installDeps bool
15-
startRestack bool
16-
openUI bool
12+
language string
13+
applicationName string
14+
currentDir string
15+
installDeps bool
16+
startRestack bool
17+
openUI bool
1718
}
1819

1920
func main() {
21+
// Initialize PostHog client
22+
client := posthog.NewWithConfig(
23+
"phc_QAChHsfb5cq65wolzsxiJ6cZk1V9IcfGqCidBWhaLgK",
24+
posthog.Config{
25+
Endpoint: "https://us.i.posthog.com",
26+
},
27+
)
28+
defer client.Close()
2029

2130
language := validateLanguage()
2231
currentDir, err := os.Getwd()
@@ -25,31 +34,39 @@ func main() {
2534
}
2635

2736
m := model{
28-
currentDir: currentDir,
29-
language: language,
30-
projectName: "restack-your-project",
31-
startRestack: true,
32-
openUI: true,
37+
currentDir: currentDir,
38+
language: language,
39+
applicationName: "restack-app",
40+
startRestack: true,
41+
openUI: true,
3342
}
3443

3544
questions := []huh.Field{
3645
huh.NewInput().
3746
Title("Welcome to Restack. Let's get you started.").
38-
Description("Enter project name:").
39-
Placeholder("restack-your-project").
47+
Description("Enter application name:").
48+
Placeholder("restack-app").
4049
CharLimit(50).
41-
Value(&m.projectName),
50+
Value(&m.applicationName),
4251
huh.NewConfirm().
43-
Title("Start Restack Developer UI? (recommended)").
52+
Title("Start Restack in Docker? (recommended)").
4453
Value(&m.startRestack),
4554
}
4655

47-
// Ask the first question (project name)
56+
// Ask the first question (application name)
4857
err = huh.NewForm(huh.NewGroup(questions[0])).Run()
4958
if err != nil {
5059
log.Fatal(err)
5160
}
5261

62+
// Trigger an event after getting the project name
63+
client.Enqueue(posthog.Capture{
64+
Event: "get_started",
65+
Properties: posthog.NewProperties().
66+
Set("application_name", m.applicationName).
67+
Set("language", m.language),
68+
})
69+
5370
// Copy files immediately after getting the project name
5471
if err := m.cloneBoilerplates(); err != nil {
5572
log.Fatal(err)

src/printSuccess.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "fmt"
44

55
var depsCmds = map[string]string{
66
"typescript": "npm install",
7-
"python": "poetry env use 3.10 && poetry shell then poetry install",
7+
"python": "poetry install",
88
}
99

1010
var serviceCmds = map[string]string{
@@ -20,21 +20,28 @@ func (m model) printSuccess() {
2020
reset = "\033[0m"
2121
)
2222

23-
cdCmd := blue + "cd " + m.projectName + reset
23+
cdCmd := blue + "cd " + m.applicationName + reset
2424
depsStr := blue + depsCmd + reset
2525
serviceStr := blue + serviceCmd + reset
2626

27+
pythonCmd := ""
28+
if m.language == "python" {
29+
pythonCmd = blue + "Start Python shell, run: poetry env use 3.10 && poetry shell" + reset
30+
}
31+
2732
fmt.Printf(`
2833
Project created successfully!
2934
3035
We suggest that you begin with following commands:
3136
3237
Navigate to the project, run: %s
3338
39+
%s
40+
3441
Install dependencies, run: %s
3542
3643
Start the services, run: %s
3744
3845
And run workflows using the UI
39-
`, cdCmd, depsStr, serviceStr)
46+
`, cdCmd, pythonCmd, depsStr, serviceStr)
4047
}

0 commit comments

Comments
 (0)