@@ -391,7 +391,7 @@ BOLD := $(shell tput bold 2>/dev/null)
391391GREEN :=$(shell tput setaf 2 2>/dev/null)
392392RESET :=$(shell tput sgr0 2>/dev/null)
393393
394- fmt : fmt/eslint fmt/prettier fmt/terraform fmt/shfmt fmt/go
394+ fmt : fmt/ts fmt/go fmt/terraform fmt/shfmt fmt/prettier
395395.PHONY : fmt
396396
397397fmt/go :
@@ -401,15 +401,19 @@ fmt/go:
401401go run mvdan.cc/gofumpt@v0.4.0 -w -l.
402402.PHONY : fmt/go
403403
404- fmt/eslint :
405- echo " $( GREEN) ==>$( RESET) $( BOLD) fmt/eslint $( RESET) "
404+ fmt/ts :
405+ echo " $( GREEN) ==>$( RESET) $( BOLD) fmt/ts $( RESET) "
406406cd site
407- pnpm run lint:fix
408- .PHONY : fmt/eslint
407+ # Avoid writing files in CI to reduce file write activity
408+ ifdef CI
409+ pnpm run check --linter-enabled=false
410+ else
411+ pnpm run check:fix
412+ endif
413+ .PHONY : fmt/ts
409414
410- fmt/prettier :
415+ fmt/prettier : .prettierignore
411416echo " $( GREEN) ==>$( RESET) $( BOLD) fmt/prettier$( RESET) "
412- cd site
413417# Avoid writing files in CI to reduce file write activity
414418ifdef CI
415419pnpm run format:check
@@ -442,7 +446,7 @@ lint/site-icons:
442446
443447lint/ts :
444448cd site
445- pnpmi && pnpm lint
449+ pnpm lint
446450.PHONY : lint/ts
447451
448452lint/go :
@@ -495,9 +499,6 @@ gen: \
495499.prettierignore.include\
496500.prettierignore\
497501provisioner/terraform/testdata/version\
498- site/.prettierrc.yaml\
499- site/.prettierignore\
500- site/.eslintignore\
501502site/e2e/provisionerGenerated.ts\
502503site/src/theme/icons.json\
503504examples/examples.gen.json\
@@ -526,9 +527,6 @@ gen/mark-fresh:
526527coderd/apidoc/swagger.json\
527528.prettierignore.include\
528529.prettierignore\
529- site/.prettierrc.yaml\
530- site/.prettierignore\
531- site/.eslintignore\
532530site/e2e/provisionerGenerated.ts\
533531site/src/theme/icons.json\
534532examples/examples.gen.json\
@@ -603,7 +601,6 @@ provisionerd/proto/provisionerd.pb.go: provisionerd/proto/provisionerd.proto
603601site/src/api/typesGenerated.ts :$(wildcard scripts/apitypings/* ) $(shell find ./codersdk$(FIND_EXCLUSIONS ) -type f -name '* .go')
604602go run ./scripts/apitypings/> $@
605603./scripts/pnpm_install.sh
606- pnpmexec prettier --write" $@ "
607604
608605site/e2e/provisionerGenerated.ts : provisionerd/proto/provisionerd.pb.go provisionersdk/proto/provisioner.pb.go
609606cd site
@@ -613,7 +610,7 @@ site/e2e/provisionerGenerated.ts: provisionerd/proto/provisionerd.pb.go provisio
613610site/src/theme/icons.json :$(wildcard scripts/gensite/* ) $(wildcard site/static/icon/* )
614611go run ./scripts/gensite/ -icons" $@ "
615612./scripts/pnpm_install.sh
616- pnpmexec prettier --write" $@ "
613+ pnpm-C site/ exec biome format --writesrc/theme/icons.json
617614
618615examples/examples.gen.json : scripts/examplegen/main.go examples/examples.go$(shell find ./examples/templates)
619616go run ./scripts/examplegen/main.go> examples/examples.gen.json
@@ -702,23 +699,6 @@ scripts/ci-report/testdata/.gen-golden: $(wildcard scripts/ci-report/testdata/*)
702699gotest ./scripts/ci-report -run=TestOutputMatchesGoldenFile -update
703700touch" $@ "
704701
705- # Generate a prettierrc for the site package that uses relative paths for
706- # overrides. This allows us to share the same prettier config between the
707- # site and the root of the repo.
708- site/.prettierrc.yaml : .prettierrc.yaml
709- . ./scripts/lib.sh
710- dependencies yq
711-
712- echo "# Code generated by Makefile (../$<). DO NOT EDIT." > "$@"
713- echo "" >> "$@"
714-
715- # Replace all listed override files with relative paths inside site/.
716- # - ./ -> ../
717- # - ./site -> ./
718- yq \
719- '.overrides[].files |= map(. | sub("^./"; "") | sub("^"; "../") | sub("../site/"; "./") | sub("../!"; "!../"))' \
720- "$<" >> "$@"
721-
722702# Combine .gitignore with .prettierignore.include to generate .prettierignore.
723703.prettierignore : .gitignore .prettierignore.include
724704echo " # Code generated by Makefile ($^). DO NOT EDIT." > " $@ "
@@ -728,40 +708,6 @@ site/.prettierrc.yaml: .prettierrc.yaml
728708cat" $$ f" >> " $@ "
729709done
730710
731- # Generate ignore files based on gitignore into the site directory. We turn all
732- # rules into relative paths for the `site/` directory (where applicable),
733- # following the pattern format defined by git:
734- # https://git-scm.com/docs/gitignore#_pattern_format
735- #
736- # This is done for compatibility reasons, see:
737- # https://github.com/prettier/prettier/issues/8048
738- # https://github.com/prettier/prettier/issues/8506
739- # https://github.com/prettier/prettier/issues/8679
740- site/.eslintignore site/.prettierignore : .prettierignore Makefile
741- rm -f" $@ "
742- touch" $@ "
743- # Skip generated by header, inherit `.prettierignore` header as-is.
744- while read -r rule; do
745- # Remove leading ! if present to simplify rule, added back at the end.
746- tmp=" $$ {rule#!}"
747- ignore=" $$ {rule%" $$ tmp" }"
748- rule=" $$ tmp"
749- case " $$ rule" in
750- # Comments or empty lines (include).
751- \# * | ' ' );;
752- # Generic rules (include).
753- \*\* * );;
754- # Site prefixed rules (include).
755- site/* ) rule=" $$ {rule#site/}" ;;
756- ./site/* ) rule=" $$ {rule#./site/}" ;;
757- # Rules that are non-generic and don't start with site (rewrite).
758- /* ) rule=.." $$ rule" ;;
759- * /?* ) rule=../" $$ rule" ;;
760- * );;
761- esac
762- echo " $$ {ignore}$$ {rule}" >> " $@ "
763- done < " $<"
764-
765711test :
766712$(GIT_FLAGS ) gotestsum --format standard-quiet -- -v -short -count=1 ./...
767713.PHONY : test