mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2025-01-26 11:45:50 +00:00
c1545659b2
* Upgrading to use ts-ns 10.0.0 * Adding no_comments_only
39 lines
956 B
Bash
Executable file
39 lines
956 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Remove the old types
|
|
rm -rf src/types/*
|
|
|
|
# Remove the old bindings
|
|
pushd ../lemmy/crates
|
|
rm -rf **/bindings
|
|
popd
|
|
|
|
# First re-generate the types by running cargo test on lemmy
|
|
pushd ../lemmy
|
|
cargo test --workspace export_bindings
|
|
|
|
cd crates
|
|
|
|
# Copy them over to the types folder
|
|
cp api_common/bindings/* ../../lemmy-js-client/src/types/
|
|
cp db_schema/bindings/* ../../lemmy-js-client/src/types/
|
|
cp db_views/bindings/* ../../lemmy-js-client/src/types/
|
|
cp db_views_actor/bindings/* ../../lemmy-js-client/src/types/
|
|
cp db_views_moderator/bindings/* ../../lemmy-js-client/src/types/
|
|
cp utils/bindings/* ../../lemmy-js-client/src/types/
|
|
|
|
popd
|
|
|
|
# Remove the Sensitive type
|
|
rm src/types/Sensitive.ts
|
|
|
|
# Change all the bigints to numbers
|
|
find src/types -type f -name '*.ts' -exec sed -i 's/bigint/number/g' {} +
|
|
|
|
# on MacOS:
|
|
# find src/types -type f -name '*.ts' -exec sed -i '' -e 's/bigint/number/g' {} \;
|
|
|
|
node putTypesInIndex.js
|
|
|
|
prettier -w src
|
|
|