Skip to content

Commit

Permalink
fix: add preview as a start script for node runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredLunde committed May 18, 2024
1 parent 1266db7 commit 667beee
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Detected in order of precedence:
#### Start Command

Detected in order of precedence:
- `package.json` scripts: `"serve", "start:prod", "start:production", "start-prod", "start-production", "start"`
- `package.json` scripts: `"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"`
- `package.json` main/module file: `bun run ${mainFile}`

---
Expand Down Expand Up @@ -179,7 +179,7 @@ Detected in order of precedence:
#### Start Command

Detected in order of precedence:
- `deno.jsonc` tasks: `"serve", "start:prod", "start:production", "start-prod", "start-production", "start"`
- `deno.jsonc` tasks: `"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"`
- Main/module file: `deno run ["mod.ts", "src/mod.ts", "main.ts", "src/main.ts", "index.ts", "src/index.ts]"`

---
Expand Down Expand Up @@ -361,7 +361,7 @@ In order of precedence:

#### Start Command
In order of precedence:
- `package.json` scripts: `"serve", "start:prod", "start:production", "start-prod", "start-production", "start"`
- `package.json` scripts: `"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"`
- `package.json` scripts search for regex matching: `^.*?\b(ts-)?node(mon)?\b.*?(index|main|server|client)\.([cm]?[tj]s)\b`
- `package.json` main/module file: `node ${mainFile}`

Expand Down
2 changes: 1 addition & 1 deletion runtime/bun.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (d *Bun) GenerateDockerfile(path string) ([]byte, error) {
if ok {
d.Log.Info("Detected scripts in package.json")

startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "start"}
startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"}
for _, cmd := range startCommands {
if _, ok := scripts[cmd].(string); ok {
d.Log.Info("Detected start command in package.json: " + cmd)
Expand Down
2 changes: 1 addition & 1 deletion runtime/deno.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (d *Deno) GenerateDockerfile(path string) ([]byte, error) {

scripts, ok := denoJSON["tasks"].(map[string]interface{})
if ok {
startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "start"}
startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"}
for _, cmd := range startCommands {
if _, ok := scripts[cmd].(string); ok {
d.Log.Info("Detected start command in deno.json: " + cmd)
Expand Down
2 changes: 1 addition & 1 deletion runtime/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (d *Node) GenerateDockerfile(path string) ([]byte, error) {

if ok {
d.Log.Info("Detected scripts in package.json")
startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "start"}
startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"}
for _, cmd := range startCommands {
if _, ok := scripts[cmd].(string); ok {
startCMD = fmt.Sprintf("%s run %s", packageManager, cmd)
Expand Down

0 comments on commit 667beee

Please sign in to comment.