diff --git a/build/cli.mjs b/build/cli.mjs new file mode 100644 index 0000000..8092413 --- /dev/null +++ b/build/cli.mjs @@ -0,0 +1,11 @@ +import * as esbuild from 'esbuild'; + +await esbuild.build({ + entryPoints: ['./src/**/*.mts'], + bundle: true, + outdir: 'dist', + platform: 'node', + legalComments: 'inline', + packages: 'external', + target: 'node16' +}); diff --git a/package.json b/package.json index 09e4152..fb9a832 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,27 @@ { - "name": "i18n-validator", - "version": "1.0.0", - "main": "dist/index.js", - "scripts": { - "build:prod": "rm -rf dist/* && tsc -noEmit && esbuild src/index.mts --legal-comments=external --platform=node --bundle --outdir=dist --packages=external --minify --sourcemap", - "build:dev": "rm -rf dist/* && npm run typecheck && esbuild src/index.mts --platform=node --bundle --outdir=dist --packages=external", - "start": "npm run build:dev -- --watch", - "test": "jest", - "typecheck": "tsc --noEmit" - }, - "bin": { - "i18n-validate": "dist/index.js" - }, - "type": "module", - "devDependencies": { - "@types/jest": "^29.5.12", - "@types/node": "^20.12.13", - "esbuild": "0.21.4", - "jest": "^29.7.0", - "ts-jest": "^29.1.4", - "ts-node": "^10.9.2", - "typescript": "^5.4.5" - }, - "dependencies": { - "chalk": "^4.0.0" - } + "name": "i18n-validator", + "version": "1.0.0", + "main": "dist/index.js", + "scripts": { + "build:prod": "rm -rf dist/* && node build/cli.mjs", + "build:dev": "rm -rf dist/* && npm run typecheck && tsc && node build/cli.mjs", + "start": "npm run build:dev -- --watch", + "test": "jest", + "typecheck": "tsc --noEmit" + }, + "bin": { + "i18n-validate": "dist/index.js" + }, + "devDependencies": { + "@types/jest": "^29.5.12", + "@types/node": "^20.12.13", + "esbuild": "0.21.4", + "jest": "^29.7.0", + "ts-jest": "^29.1.4", + "ts-node": "^10.9.2", + "typescript": "^5.4.5" + }, + "dependencies": { + "chalk": "^4.0.0" + } } diff --git a/tsconfig.json b/tsconfig.json index 5745c4d..46f7de7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,25 +1,25 @@ { - "compilerOptions": { - "target": "ESNext", - "module": "NodeNext", - "esModuleInterop": true, - "moduleResolution": "NodeNext", - "rootDir": "./src", - "outDir": "./dist", - "strict": true, - "noEmit": true, - "skipLibCheck": true, - "resolveJsonModule": true, - "allowImportingTsExtensions": true - }, - "include": [ - "src/**/*.ts", - "src/**/*.mts", - "src/rules/no-untranslated-messages/no-untranslated-messages.mts", - "src/rules/no-untranslated-messages/index.mts", - "src/index.mts", - "src/config/default-config.mts", - "src/types.mts" - ], - "exclude": ["node_modules", "dist"] + "compilerOptions": { + "target": "ESNext", + "module": "NodeNext", + "esModuleInterop": true, + "moduleResolution": "NodeNext", + "rootDir": "./src", + "outDir": "./dist", + "strict": true, + "noEmit": true, + "skipLibCheck": true, + "resolveJsonModule": true, + "allowImportingTsExtensions": true + }, + "include": [ + "src/**/*.ts", + "src/**/*.mts", + "src/rules/no-untranslated-messages/no-untranslated-messages.mts", + "src/rules/no-untranslated-messages/index.mts", + "src/index.mts", + "src/config/default-config.mts", + "src/types.mts" + ], + "exclude": ["node_modules", "dist"] }