From 54c82daf39d77caf8d591de4076a4158921ecf92 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sun, 5 Jan 2025 15:01:45 -0500 Subject: [PATCH] chore: add prettier version to release notes automatically (#93) --- .github/workflows/ci.yml | 3 +++ dprint.json | 12 ++++++------ scripts/output_prettier_version.ts | 5 +++++ 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 scripts/output_prettier_version.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6949f4c..c2144d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,6 +186,9 @@ jobs: - name: Get tag version id: get_tag_version run: 'echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT' + - name: Get prettier version + id: get_prettier_version + run: "echo PRETTIER_VERSION=$(deno run --allow-read scripts/output_prettier_version.ts) >> $GITHUB_OUTPUT" - name: Get plugin file checksum id: get_plugin_file_checksum run: 'echo "CHECKSUM=$(shasum -a 256 plugin.json | awk ''{print $1}'')" >> $GITHUB_OUTPUT' diff --git a/dprint.json b/dprint.json index 1edf7dc..45bb2ca 100644 --- a/dprint.json +++ b/dprint.json @@ -14,11 +14,11 @@ "**/target" ], "plugins": [ - "https://plugins.dprint.dev/typescript-0.91.4.wasm", - "https://plugins.dprint.dev/json-0.19.3.wasm", - "https://plugins.dprint.dev/markdown-0.17.2.wasm", - "https://plugins.dprint.dev/exec-0.5.0.json@8d9972eee71fa1590e04873540421f3eda7674d0f1aae3d7c788615e7b7413d0", - "https://plugins.dprint.dev/prettier-0.46.1.json@e5bd083088a8dfc6e5ce2d3c9bee81489b065bd5345ef55b59f5d96627928b7a", - "https://plugins.dprint.dev/toml-0.6.2.wasm" + "https://plugins.dprint.dev/typescript-0.93.3.wasm", + "https://plugins.dprint.dev/json-0.19.4.wasm", + "https://plugins.dprint.dev/markdown-0.17.8.wasm", + "https://plugins.dprint.dev/exec-0.5.1.json@492414e39dea4dccc07b4af796d2f4efdb89e84bae2bd4e1e924c0cc050855bf", + "https://plugins.dprint.dev/prettier-0.52.1.json@53aeb0ec21d868dd53dcd081b5ea9e9c0dd02ffbc2d1a35c8e66b854d826b4e4", + "https://plugins.dprint.dev/toml-0.6.4.wasm" ] } diff --git a/scripts/output_prettier_version.ts b/scripts/output_prettier_version.ts new file mode 100644 index 0000000..238d161 --- /dev/null +++ b/scripts/output_prettier_version.ts @@ -0,0 +1,5 @@ +import $ from "dax"; + +const rootDir = $.path(import.meta.dirname!).parentOrThrow(); +const packageJson = rootDir.join("js/node/package.json").readJsonSync<{ dependencies: Record }>(); +console.log(packageJson.dependencies["prettier"].replace("^", ""));