Skip to content

Commit

Permalink
chore: tweak response types generation script (#1825)
Browse files Browse the repository at this point in the history
  • Loading branch information
filmaj authored Jun 19, 2024
1 parent fc87d51 commit 27535f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/code_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TsWriter


def write(root_class_name, json_path, typedef_filepath, input_json)
cmd = "npx quicktype --just-types --alphabetize-properties --all-properties-optional --acronym-style original -t #{root_class_name} -l ts"
cmd = "npx quicktype --just-types --prefer-const-values --alphabetize-properties --all-properties-optional --acronym-style original -t #{root_class_name} -l ts"
puts "Generating #{root_class_name} from #{json_path}"
Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
stdin.write(input_json)
Expand Down
16 changes: 9 additions & 7 deletions scripts/generate-web-api-types.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
script_dir=`dirname $0`
tmp_dir=${script_dir}/../tmp

rm -rf ${tmp_dir}
mkdir ${tmp_dir}
cd ${tmp_dir}
mkdir -p ${tmp_dir}
pushd ${tmp_dir}

# Use the latest revision of the java-slack-sdk git repo
git clone https://github.com/slackapi/java-slack-sdk.git

cd -
cd ${script_dir}
test -d java-slack-sdk || git clone https://github.com/slackapi/java-slack-sdk.git
pushd java-slack-sdk
git pull origin main
popd
popd
pushd ${script_dir}

# Download quicktype for generating code
npm i

# This Ruby script runs quicktype internally and do some additional modification to the generated files
ruby ./code_generator.rb
popd

0 comments on commit 27535f1

Please sign in to comment.