26 lines
726 B
Bash
26 lines
726 B
Bash
#!/bin/bash
|
|
|
|
# Script to install Node.js type definitions for TypeScript
|
|
echo "๐ Installing @types/node for TypeScript support..."
|
|
|
|
# Install types for Node.js
|
|
npm install --save-dev @types/node
|
|
|
|
# Update tsconfig.json to include node types
|
|
cat > tsconfig.node.json << EOL
|
|
{
|
|
"extends": "./tsconfig.json",
|
|
"compilerOptions": {
|
|
"module": "ESNext",
|
|
"moduleResolution": "Node",
|
|
"allowSyntheticDefaultImports": true,
|
|
"isolatedModules": true,
|
|
"types": ["node"]
|
|
},
|
|
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.js"]
|
|
}
|
|
EOL
|
|
|
|
echo "โ
Node.js types installed!"
|
|
echo "To use Node.js types, extend your tsconfig.json with tsconfig.node.json"
|
|
echo "or run your TypeScript compiler with --types node" |