Skip to content

Commit e31fc94

Browse files
committed
update *ignores
1 parent ad47ef1 commit e31fc94

File tree

8 files changed

+73
-1
lines changed

8 files changed

+73
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ site/e2e/test-results/*
2929
site/e2e/states/*.json
3030
site/e2e/.auth.json
3131
site/playwright-report/*
32+
site/static/icons.json
3233
site/.swc
3334

3435
# Make target for updating golden files (any dir).

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ site/e2e/test-results/*
3232
site/e2e/states/*.json
3333
site/e2e/.auth.json
3434
site/playwright-report/*
35+
site/static/icons.json
3536
site/.swc
3637

3738
# Make target for updating golden files (any dir).

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ gen: \
472472
site/.prettierignore \
473473
site/.eslintignore \
474474
site/e2e/provisionerGenerated.ts \
475+
site/static/icons.json \
475476
examples/examples.gen.json
476477
.PHONY: gen
477478

@@ -495,6 +496,7 @@ gen/mark-fresh:
495496
site/.prettierignore \
496497
site/.eslintignore \
497498
site/e2e/provisionerGenerated.ts \
499+
site/static/icons.json \
498500
examples/examples.gen.json \
499501
"
500502
for file in $$files; do
@@ -538,7 +540,7 @@ provisionerd/proto/provisionerd.pb.go: provisionerd/proto/provisionerd.proto
538540
./provisionerd/proto/provisionerd.proto
539541

540542
site/src/api/typesGenerated.ts: scripts/apitypings/main.go $(shell find ./codersdk $(FIND_EXCLUSIONS) -type f -name '*.go')
541-
go run scripts/apitypings/main.go > site/src/api/typesGenerated.ts
543+
go run ./scripts/apitypings/ > site/src/api/typesGenerated.ts
542544
cd site
543545
pnpm run format:types ./src/api/typesGenerated.ts
544546

@@ -547,6 +549,9 @@ site/e2e/provisionerGenerated.ts: provisionerd/proto/provisionerd.pb.go provisio
547549
../scripts/pnpm_install.sh
548550
pnpm run gen:provisioner
549551

552+
site/static/icons.json: $(wildcard site/static/icon/*)
553+
go run ./scripts/sitestatic/
554+
550555
examples/examples.gen.json: scripts/examplegen/main.go examples/examples.go $(shell find ./examples/templates)
551556
go run ./scripts/examplegen/main.go > examples/examples.gen.json
552557

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package main
2+
3+
import (
4+
"encoding/json"
5+
"fmt"
6+
"os"
7+
)
8+
9+
func generateIconList() int {
10+
files, err := os.ReadDir("site/static/icon")
11+
if err != nil {
12+
_, _ = fmt.Println("failed to read icon/ directory")
13+
_, _ = fmt.Println("err:", err.Error())
14+
return 71 // OSERR
15+
}
16+
17+
icons := make([]string, len(files))
18+
i := 0
19+
for _, file := range files {
20+
if !file.Type().IsRegular() {
21+
continue
22+
}
23+
24+
icons[i] = file.Name()
25+
i++
26+
}
27+
icons = icons[:i]
28+
29+
outputFile, err := os.Create("./site/static/icons.json")
30+
if err != nil {
31+
_, _ = fmt.Println("failed to create file")
32+
_, _ = fmt.Println("err:", err.Error())
33+
return 73 // CANTCREAT
34+
}
35+
defer outputFile.Close()
36+
37+
iconsJSON, err := json.Marshal(icons)
38+
if err != nil {
39+
_, _ = fmt.Println("failed to serialize JSON")
40+
_, _ = fmt.Println("err:", err.Error())
41+
return 70 // SOFTWARE
42+
}
43+
44+
written, err := outputFile.Write(iconsJSON)
45+
if err != nil || written != len(iconsJSON) {
46+
_, _ = fmt.Println("failed to write JSON")
47+
if err != nil {
48+
_, _ = fmt.Println("err:", err.Error())
49+
}
50+
return 74 // IOERR
51+
}
52+
53+
return 0
54+
}

scripts/sitestatic/main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package main
2+
3+
import "os"
4+
5+
func main() {
6+
status := generateIconList()
7+
os.Exit(status)
8+
}

site/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ e2e/test-results/*
3232
e2e/states/*.json
3333
e2e/.auth.json
3434
playwright-report/*
35+
static/icons.json
3536
.swc
3637

3738
# Make target for updating golden files (any dir).

site/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ e2e/test-results/*
3232
e2e/states/*.json
3333
e2e/.auth.json
3434
playwright-report/*
35+
static/icons.json
3536
.swc
3637

3738
# Make target for updating golden files (any dir).

site/static/icons.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["android-studio.svg","apache-guacamole.svg","aws.png","azure-devops.svg","azure.png","bitbucket.svg","centos.svg","clion.svg","code.svg","coder.svg","conda.svg","database.svg","datagrip.svg","dataspell.svg","debian.svg","do.png","docker.png","dotfiles.svg","fedora.svg","fly.io.svg","folder.svg","gateway.svg","gcp.png","git.svg","github.svg","gitlab.svg","goland.svg","image.svg","intellij.svg","java.svg","jax.svg","jfrog.svg","jupyter.svg","k8s.png","kasmvnc.svg","matlab.svg","memory.svg","node.svg","nomad.svg","novnc.svg","personalize.svg","phpstorm.svg","projector.svg","pycharm.svg","pytorch.svg","rider.svg","rockylinux.svg","rstudio.svg","rubymine.svg","tensorflow.svg","terminal.svg","theia.svg","ubuntu.svg","webstorm.svg","widgets.svg"]

0 commit comments

Comments
 (0)