Skip to content

Commit 807686d

Browse files
committed
refactor: simplify TypeScript installation by using mise instead of npm global install
1 parent bceb72a commit 807686d

File tree

1 file changed

+3
-36
lines changed

1 file changed

+3
-36
lines changed

setup-node-env/action.yml

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ runs:
9797
mise use --global yarn@${{ inputs.yarn_version }}
9898
mise use --global pnpm@${{ inputs.pnpm_version }}
9999
mise use --global bun@${{ inputs.bun_version }}
100+
mise use --global npm:typescript@latest
100101
mise install
101102
102103
- name: Verify package manager installation
@@ -117,44 +118,10 @@ runs:
117118
npm --version || { echo "Error: NPM not found in PATH"; exit 1; }
118119
;;
119120
esac
120-
121-
- name: Install TypeScript globally with npm
122-
shell: bash
123-
run: |
124-
echo "Installing TypeScript globally with npm..."
125-
# Disable mise auto-install/reshim to avoid conflicts
126-
export MISE_AUTO_INSTALL=0
127-
export MISE_EXPERIMENTAL=0
128-
129-
# Install TypeScript globally
130-
npm install -g typescript || true
131-
132-
# Manually ensure mise shims are updated
133-
mise reshim || true
134121
135-
# Add npm global bin to PATH for subsequent steps
136-
NPM_GLOBAL_BIN="$(npm bin -g)"
137-
echo "$NPM_GLOBAL_BIN" >> $GITHUB_PATH
138-
139-
# Also add mise shims directory to PATH
140-
MISE_SHIMS="$HOME/.local/share/mise/shims"
141-
echo "$MISE_SHIMS" >> $GITHUB_PATH
142-
143-
# Verify TypeScript is accessible (try multiple locations)
122+
# Also verify TypeScript installation
144123
echo "Verifying TypeScript installation..."
145-
if command -v tsc &> /dev/null; then
146-
echo "Found tsc at: $(which tsc)"
147-
tsc --version
148-
elif [ -f "$NPM_GLOBAL_BIN/tsc" ]; then
149-
echo "Found tsc at: $NPM_GLOBAL_BIN/tsc"
150-
"$NPM_GLOBAL_BIN/tsc" --version
151-
elif [ -f "$MISE_SHIMS/tsc" ]; then
152-
echo "Found tsc at: $MISE_SHIMS/tsc"
153-
"$MISE_SHIMS/tsc" --version
154-
else
155-
echo "Error: TypeScript not found in PATH"
156-
exit 1
157-
fi
124+
tsc --version || { echo "Error: TypeScript not found in PATH"; exit 1; }
158125
159126
- name: Install dependencies
160127
if: inputs.install_deps == 'true'

0 commit comments

Comments
 (0)