Skip to content

Commit

Permalink
Add Node 22+ support
Browse files Browse the repository at this point in the history
  • Loading branch information
bokub committed Dec 5, 2024
1 parent 4ab2e61 commit 649b5fe
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import chalk from 'chalk';
import ora from 'ora';
import updateNotifier from 'update-notifier';
import dayjs from 'dayjs';
import pkg from '../package.json' assert { type: 'json' };
import { pkg } from './pkg.js';

function exit(e: any) {

Check warning on line 10 in bin/cli.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type

Check warning on line 10 in bin/cli.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
if (e.message) {
Expand Down
2 changes: 1 addition & 1 deletion bin/metering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { mkdirp } from 'mkdirp';
import fs from 'fs';
import path from 'path';
import { type APIResponse, Session } from '../lib/index.js';
import pkg from '../package.json' assert { type: 'json' };
import { pkg } from './pkg.js';

export type Format = 'pretty' | 'json' | 'csv';

Expand Down
7 changes: 7 additions & 0 deletions bin/pkg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import fs from 'node:fs';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';

export const pkg = JSON.parse(
fs.readFileSync(join(dirname(fileURLToPath(import.meta.url)), '../../package.json'), 'utf8')

Check failure on line 6 in bin/pkg.ts

View workflow job for this annotation

GitHub Actions / Test (Node v16)

test/cli.test.ts

Error: ENOENT: no such file or directory, open '/home/runner/work/linky/package.json' ❯ bin/pkg.ts:6:6 ❯ bin/store.ts:2:31 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { errno: -2, syscall: 'open', code: 'ENOENT', path: '/home/runner/work/linky/package.json' }

Check failure on line 6 in bin/pkg.ts

View workflow job for this annotation

GitHub Actions / Test (Node v18)

test/cli.test.ts

Error: ENOENT: no such file or directory, open '/home/runner/work/linky/package.json' ❯ bin/pkg.ts:6:6 ❯ bin/store.ts:2:31 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { errno: -2, syscall: 'open', code: 'ENOENT', path: '/home/runner/work/linky/package.json' }

Check failure on line 6 in bin/pkg.ts

View workflow job for this annotation

GitHub Actions / Test (Node v16)

test/cli.test.ts

Error: ENOENT: no such file or directory, open '/home/runner/work/linky/package.json' ❯ bin/pkg.ts:6:6 ❯ bin/store.ts:2:31 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { errno: -2, syscall: 'open', code: 'ENOENT', path: '/home/runner/work/linky/package.json' }

Check failure on line 6 in bin/pkg.ts

View workflow job for this annotation

GitHub Actions / Test (Node v18)

test/cli.test.ts

Error: ENOENT: no such file or directory, open '/home/runner/work/linky/package.json' ❯ bin/pkg.ts:6:6 ❯ bin/store.ts:2:31 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { errno: -2, syscall: 'open', code: 'ENOENT', path: '/home/runner/work/linky/package.json' }
);
2 changes: 1 addition & 1 deletion bin/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Conf from 'conf';
import pkg from '../package.json' assert { type: 'json' };
import { pkg } from './pkg.js';

const TOKEN = 'token';

Expand Down

0 comments on commit 649b5fe

Please sign in to comment.