@@ -386,7 +386,7 @@ BOLD := $(shell tput bold 2>/dev/null)
386
386
GREEN := $(shell tput setaf 2 2>/dev/null)
387
387
RESET := $(shell tput sgr0 2>/dev/null)
388
388
389
- fmt : fmt/eslint fmt/prettier fmt/terraform fmt/shfmt fmt/go
389
+ fmt : fmt/eslint fmt/biome fmt/terraform fmt/shfmt fmt/go
390
390
.PHONY : fmt
391
391
392
392
fmt/go :
@@ -402,16 +402,16 @@ fmt/eslint:
402
402
pnpm run lint:fix
403
403
.PHONY : fmt/eslint
404
404
405
- fmt/prettier :
406
- echo " $( GREEN) ==>$( RESET) $( BOLD) fmt/prettier $( RESET) "
405
+ fmt/biome :
406
+ echo " $( GREEN) ==>$( RESET) $( BOLD) fmt/biome $( RESET) "
407
407
cd site
408
408
# Avoid writing files in CI to reduce file write activity
409
409
ifdef CI
410
410
pnpm run format:check
411
411
else
412
412
pnpm run format
413
413
endif
414
- .PHONY : fmt/prettier
414
+ .PHONY : fmt/biome
415
415
416
416
fmt/terraform : $(wildcard * .tf)
417
417
echo " $( GREEN) ==>$( RESET) $( BOLD) fmt/terraform$( RESET) "
@@ -486,10 +486,6 @@ gen: \
486
486
docs/cli.md \
487
487
docs/admin/audit-logs.md \
488
488
coderd/apidoc/swagger.json \
489
- .prettierignore.include \
490
- .prettierignore \
491
- site/.prettierrc.yaml \
492
- site/.prettierignore \
493
489
site/.eslintignore \
494
490
site/e2e/provisionerGenerated.ts \
495
491
site/src/theme/icons.json \
@@ -515,10 +511,6 @@ gen/mark-fresh:
515
511
docs/cli.md \
516
512
docs/admin/audit-logs.md \
517
513
coderd/apidoc/swagger.json \
518
- .prettierignore.include \
519
- .prettierignore \
520
- site/.prettierrc.yaml \
521
- site/.prettierignore \
522
514
site/.eslintignore \
523
515
site/e2e/provisionerGenerated.ts \
524
516
site/src/theme/icons.json \
@@ -591,7 +583,7 @@ provisionerd/proto/provisionerd.pb.go: provisionerd/proto/provisionerd.proto
591
583
site/src/api/typesGenerated.ts : $(wildcard scripts/apitypings/* ) $(shell find ./codersdk $(FIND_EXCLUSIONS ) -type f -name '* .go')
592
584
go run ./scripts/apitypings/ > $@
593
585
./scripts/pnpm_install.sh
594
- pnpm exec prettier --write " $@ "
586
+ pnpm exec biome format --write " $@ "
595
587
596
588
site/e2e/provisionerGenerated.ts : provisionerd/proto/provisionerd.pb.go provisionersdk/proto/provisioner.pb.go
597
589
cd site
@@ -601,7 +593,7 @@ site/e2e/provisionerGenerated.ts: provisionerd/proto/provisionerd.pb.go provisio
601
593
site/src/theme/icons.json : $(wildcard scripts/gensite/* ) $(wildcard site/static/icon/* )
602
594
go run ./scripts/gensite/ -icons " $@ "
603
595
./scripts/pnpm_install.sh
604
- pnpm exec prettier --write " $@ "
596
+ pnpm exec biome format --write " $@ "
605
597
606
598
examples/examples.gen.json : scripts/examplegen/main.go examples/examples.go $(shell find ./examples/templates)
607
599
go run ./scripts/examplegen/main.go > examples/examples.gen.json
@@ -612,22 +604,22 @@ coderd/rbac/object_gen.go: scripts/rbacgen/main.go coderd/rbac/object.go
612
604
docs/admin/prometheus.md : scripts/metricsdocgen/main.go scripts/metricsdocgen/metrics
613
605
go run scripts/metricsdocgen/main.go
614
606
./scripts/pnpm_install.sh
615
- pnpm exec prettier --write ./docs/admin/prometheus.md
607
+ pnpm exec biome format --write ./docs/admin/prometheus.md
616
608
617
609
docs/cli.md : scripts/clidocgen/main.go examples/examples.gen.json $(GO_SRC_FILES )
618
610
CI=true BASE_PATH=" ." go run ./scripts/clidocgen
619
611
./scripts/pnpm_install.sh
620
- pnpm exec prettier --write ./docs/cli.md ./docs/cli/* .md ./docs/manifest.json
612
+ pnpm exec biome format --write ./docs/cli.md ./docs/cli/* .md ./docs/manifest.json
621
613
622
614
docs/admin/audit-logs.md : coderd/database/querier.go scripts/auditdocgen/main.go enterprise/audit/table.go coderd/rbac/object_gen.go
623
615
go run scripts/auditdocgen/main.go
624
616
./scripts/pnpm_install.sh
625
- pnpm exec prettier --write ./docs/admin/audit-logs.md
617
+ pnpm exec biome format --write ./docs/admin/audit-logs.md
626
618
627
619
coderd/apidoc/swagger.json : $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS ) -type f) $(wildcard coderd/* .go) $(wildcard enterprise/coderd/* .go) $(wildcard codersdk/* .go) $(wildcard enterprise/wsproxy/wsproxysdk/* .go) $(DB_GEN_FILES ) .swaggo docs/manifest.json coderd/rbac/object_gen.go
628
620
./scripts/apidocgen/generate.sh
629
621
./scripts/pnpm_install.sh
630
- pnpm exec prettier --write ./docs/api ./docs/manifest.json ./coderd/apidoc/swagger.json
622
+ pnpm exec biome format --write ./docs/api ./docs/manifest.json ./coderd/apidoc/swagger.json
631
623
632
624
update-golden-files : \
633
625
cli/testdata/.gen-golden \
@@ -677,66 +669,6 @@ scripts/ci-report/testdata/.gen-golden: $(wildcard scripts/ci-report/testdata/*)
677
669
go test ./scripts/ci-report -run=TestOutputMatchesGoldenFile -update
678
670
touch " $@ "
679
671
680
- # Generate a prettierrc for the site package that uses relative paths for
681
- # overrides. This allows us to share the same prettier config between the
682
- # site and the root of the repo.
683
- site/.prettierrc.yaml : .prettierrc.yaml
684
- . ./scripts/lib.sh
685
- dependencies yq
686
-
687
- echo "# Code generated by Makefile (../$<). DO NOT EDIT." > "$@"
688
- echo "" >> "$@"
689
-
690
- # Replace all listed override files with relative paths inside site/.
691
- # - ./ -> ../
692
- # - ./site -> ./
693
- yq \
694
- '.overrides[].files |= map(. | sub("^./"; "") | sub("^"; "../") | sub("../site/"; "./") | sub("../!"; "!../"))' \
695
- "$<" >> "$@"
696
-
697
- # Combine .gitignore with .prettierignore.include to generate .prettierignore.
698
- .prettierignore : .gitignore .prettierignore.include
699
- echo " # Code generated by Makefile ($^). DO NOT EDIT." > " $@ "
700
- echo " " >> " $@ "
701
- for f in $^; do
702
- echo " # $$ {f}:" >> " $@ "
703
- cat " $$ f" >> " $@ "
704
- done
705
-
706
- # Generate ignore files based on gitignore into the site directory. We turn all
707
- # rules into relative paths for the `site/` directory (where applicable),
708
- # following the pattern format defined by git:
709
- # https://git-scm.com/docs/gitignore#_pattern_format
710
- #
711
- # This is done for compatibility reasons, see:
712
- # https://github.com/prettier/prettier/issues/8048
713
- # https://github.com/prettier/prettier/issues/8506
714
- # https://github.com/prettier/prettier/issues/8679
715
- site/.eslintignore site/.prettierignore : .prettierignore Makefile
716
- rm -f " $@ "
717
- touch " $@ "
718
- # Skip generated by header, inherit `.prettierignore` header as-is.
719
- while read -r rule; do
720
- # Remove leading ! if present to simplify rule, added back at the end.
721
- tmp=" $$ {rule#!}"
722
- ignore=" $$ {rule%" $$ tmp" }"
723
- rule=" $$ tmp"
724
- case " $$ rule" in
725
- # Comments or empty lines (include).
726
- \# * | ' ' ) ;;
727
- # Generic rules (include).
728
- \*\* * ) ;;
729
- # Site prefixed rules (include).
730
- site/* ) rule=" $$ {rule#site/}" ;;
731
- ./site/* ) rule=" $$ {rule#./site/}" ;;
732
- # Rules that are non-generic and don't start with site (rewrite).
733
- /* ) rule=.." $$ rule" ;;
734
- * /?* ) rule=../" $$ rule" ;;
735
- * ) ;;
736
- esac
737
- echo " $$ {ignore}$$ {rule}" >> " $@ "
738
- done < " $<"
739
-
740
672
test :
741
673
gotestsum --format standard-quiet -- -v -short -count=1 ./...
742
674
.PHONY : test
0 commit comments