From 0b396844138db38aa8269b362f9473dcc67b4c05 Mon Sep 17 00:00:00 2001 From: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> Date: Mon, 16 Dec 2024 22:59:17 +0100 Subject: [PATCH] fixup!: add bundle generation --- .github/workflows/publish.yml | 12 +++++++----- package.json | 4 ++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b1d2a7d..a971847 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,9 +5,9 @@ on: branches: ["main"] paths: ["recipes/**"] pull_request: - types: [closed] - paths: ["recipes/**"] branches: ["main"] + paths: ["recipes/**"] + types: [closed] jobs: publish: @@ -39,10 +39,11 @@ jobs: with: node-version: node cache: 'npm' - - name: Install "codemod" binary - run: npm install codemod - - name: Run publish codemod + - name: Install dependencies + run: npm ci --include="optional" + + - name: Generate bundle & publish to codemod registry run: | if [ -n "$CODEMOD_STATUS" ]; then echo "Modified files: $CODEMOD_FILES" @@ -51,6 +52,7 @@ jobs: DIR=$(dirname "$FILE") echo "Checking codemod: $DIR" cd "$ROOT_DIR/$DIR" + npx esbuild --bundle --platform=node --outfile=bundle.js npx codemod publish echo "Codemod published" done diff --git a/package.json b/package.json index 3f65281..4eadd58 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,10 @@ "@types/node": "^22.10.1", "typescript": "^5.7.2" }, + "optionalDependencies": { + "codemod": "~0.14.0", + "esbuild": "~0.24.0" + }, "workspaces": [ "./recipes/*" ]