Files
actual/packages/crdt/bin/generate-proto
Matiss Janis Aboltins 879fd1b054 chore: replace Prettier with oxfmt and add oxlint (#6259)
* chore: replace Prettier with oxfmt and add oxlint

- Replace Prettier with oxfmt (Prettier-compatible formatter from OXC project)
- Add oxlint for fast linting alongside ESLint
- Add eslint-plugin-oxlint to disable ESLint rules covered by oxlint
- Update lint scripts to run oxfmt, oxlint, then eslint
- Update lint-staged configuration for pre-commit hooks
- Create .oxfmtrc.json and .oxlintrc.json configuration files
- Remove .prettierrc.json and .prettierignore
- Reformat codebase with oxfmt

* chore: update dependencies in yarn.lock

* chore: update oxlint configuration to disable additional rules

* chore: update oxfmt and oxlint configurations, enhance test readability
2025-12-04 19:55:10 +00:00

27 lines
818 B
Bash
Executable File

#!/bin/bash
cd "$(dirname "$(dirname "$0")")"
if ! [ -x "$(command -v protoc)" ]; then
echo 'Error: protoc is not installed. See the readme for installation instructions.' >&2
exit 1
fi
export PATH="$PWD/bin:$PATH"
protoc --plugin="protoc-gen-ts=../../node_modules/.bin/protoc-gen-ts" \
--ts_opt=esModuleInterop=true \
--ts_out="src/proto" \
--js_out=import_style=commonjs,binary:src/proto \
--proto_path=src/proto \
sync.proto
../../node_modules/.bin/oxfmt src/proto/*.d.ts
for file in src/proto/*.d.ts; do
{ echo "/* eslint-disable @typescript-eslint/no-namespace */"; sed 's/export class/export declare class/g' "$file"; } > "${file%.d.ts}.ts"
rm "$file"
done
echo 'One more step! Find the `var global = ...` declaration in src/proto/sync_pb.js and change it to `var global = globalThis;`'