Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit d55aca8

Browse files
committed
chore: add update notifier
1 parent cd63b89 commit d55aca8

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

cortex-js/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
"sqlite3": "^5.1.7",
5454
"typeorm": "^0.3.20",
5555
"ulid": "^2.3.0",
56-
"uuid": "^9.0.1"
56+
"yaml": "^2.4.2",
57+
"uuid": "^9.0.1",
58+
"update-notifier": "^5.0.0"
5759
},
5860
"devDependencies": {
5961
"cpx": "^1.5.0",
@@ -67,7 +69,8 @@
6769
"@types/jest": "^29.5.2",
6870
"@types/js-yaml": "^4.0.9",
6971
"@types/node": "^20.12.9",
70-
"@types/supertest": "^6.0.0",
72+
"@types/supertest": "^6.0.2",
73+
"@types/update-notifier": "^5.0.8",
7174
"@types/uuid": "^9.0.8",
7275
"@typescript-eslint/eslint-plugin": "^6.0.0",
7376
"@typescript-eslint/parser": "^6.0.0",

cortex-js/src/command.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
#!/usr/bin/env node --no-warnings
22
import { CommandFactory } from 'nest-commander';
33
import { CommandModule } from './command.module';
4+
import updateNotifier from 'update-notifier';
5+
import packageJson from './../package.json';
46

57
async function bootstrap() {
68
await CommandFactory.run(CommandModule, ['warn', 'error']);
9+
const notifier = updateNotifier({
10+
pkg: packageJson,
11+
updateCheckInterval: 1000 * 60 * 60, // 1 hour
12+
shouldNotifyInNpmScript: true,
13+
});
14+
notifier.notify({
15+
isGlobal: true,
16+
});
717
}
818

919
bootstrap();

cortex-js/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"compilerOptions": {
33
"module": "commonjs",
4-
"moduleResolution": "Node",
4+
"moduleResolution": "node",
55
"declaration": true,
66
"removeComments": true,
77
"emitDecoratorMetadata": true,
88
"experimentalDecorators": true,
99
"allowSyntheticDefaultImports": true,
10-
"target": "ES2021",
10+
"target": "es2018",
1111
"sourceMap": true,
1212
"outDir": "./dist",
1313
"baseUrl": "./",
@@ -19,6 +19,7 @@
1919
"forceConsistentCasingInFileNames": true,
2020
"noFallthroughCasesInSwitch": true,
2121
"esModuleInterop": true,
22+
"resolveJsonModule": true,
2223
"paths": {
2324
"@/*": ["src/*"]
2425
}

0 commit comments

Comments
 (0)