Skip to content

Commit

Permalink
chore: add update notifier
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed May 27, 2024
1 parent 6097606 commit 34c19f5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cortex-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"typeorm": "^0.3.20",
"ulid": "^2.3.0",
"yaml": "^2.4.2",
"uuid": "^9.0.1"
"uuid": "^9.0.1",
"update-notifier": "^5.0.0"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
Expand All @@ -62,7 +63,8 @@
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",
"@types/node": "^20.12.9",
"@types/supertest": "^6.0.0",
"@types/supertest": "^6.0.2",
"@types/update-notifier": "^5.0.8",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
Expand Down
10 changes: 10 additions & 0 deletions cortex-js/src/command.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
#!/usr/bin/env node --no-warnings
import { CommandFactory } from 'nest-commander';
import { CommandModule } from './command.module';
import updateNotifier from 'update-notifier';
import packageJson from './../package.json';

async function bootstrap() {
await CommandFactory.run(CommandModule, ['warn', 'error']);
const notifier = updateNotifier({
pkg: packageJson,
updateCheckInterval: 1000 * 60 * 60, // 1 hour
shouldNotifyInNpmScript: true,
});
notifier.notify({
isGlobal: true,
});
}

bootstrap();
5 changes: 3 additions & 2 deletions cortex-js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "Node",
"moduleResolution": "node",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "ES2021",
"target": "es2018",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
Expand All @@ -19,6 +19,7 @@
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"paths": {
"@/*": ["src/*"]
}
Expand Down

0 comments on commit 34c19f5

Please sign in to comment.