Rush
Node.js
# Node.js 버전 확인
➜ node -v
v20.9.0
# v20.9.0 가 설치되어 있지 않다면
➜ nvm install 20.9.0
# v20.9.0 를 사용하고 있지 않다면
➜ nvm use 20.9.0
# Node.js 버전 다시 확인
➜ node -v
v20.9.0
npm
# npm 버전 확인
➜ npm -v
10.2.1
# 최신 버전 npm 으로 업그레이드
➜ npm i [email protected] -g
# npm 버전 다시 확인
➜ npm -v
10.2.1
pnpm
# pnpm 설치 확인 및 버전 확인
➜ pnpm -v
8.10.0
# 최신 버전 pnpm 으로 업그레이드
➜ npm i [email protected] -g
# pnpm 설치 다시 확인 및 버전 다시 확인
➜ pnpm -v
8.10.0
repo 생성
➜ mkdir rush-example
➜ cd rush-example
➜ pnpm i @microsoft/rush -g
➜ rush init
➜ code .
{
"pnpmVersion": "8.10.0",
"nodeSupportedVersionRange": ">=20.9.0",
}
➜ rush-pnpm -v
패키지 프로젝트 생성
{
"projects": [
{
"packageName": "my-utils",
"projectFolder": "projects/my-utils"
}
]
}
➜ mkdir projects projects/my-utils
➜ cd projects/my-utils
➜ pnpm init
➜ rush update
➜ rush add -p typescript --dev
➜ rush-pnpm exec tsc --init
// rush-example/projects/my-utils/src/
export function plusOne(num: number): number {
return num + 1;
}
{
"compilerOptions": {
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"module": "commonjs" /* Specify what module code is generated. */,
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
"strict": true /* Enable all strict type-checking options. */,
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["src/**/*"]
}
{
"name": "my-utils",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"test": "echo \\"Error: no test specified\\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"typescript": "^5"
},
}
➜ rushx build
애플리케이션 프로젝트 생성