fix: add check step to cli

This commit is contained in:
Jonathan Jogenfors 2023-11-11 00:49:55 +01:00
parent d68a9d2c5e
commit b8c5744e0f
8 changed files with 9 additions and 27 deletions

View file

@ -97,6 +97,10 @@ jobs:
run: npm run format
if: ${{ !cancelled() }}
- name: Run tsc
run: npm run check
if: ${{ !cancelled() }}
- name: Run unit tests & coverage
run: npm run test:cov
if: ${{ !cancelled() }}

View file

@ -50,7 +50,8 @@
"test": "jest",
"test:cov": "jest --coverage",
"format": "prettier --check .",
"format:fix": "prettier --write ."
"format:fix": "prettier --write .",
"check": "tsc --noEmit"
},
"jest": {
"clearMocks": true,

View file

@ -1,11 +0,0 @@
import axios from 'axios';
import { AlbumResponseDto, CreateAlbumDto } from './open-api';
import { auth } from './auth';
export const albumApi = {
createAlbum: async (server: any, accessToken: string, dto: CreateAlbumDto) => {
const res = await axios.post(`${server}/album`, dto, auth(accessToken));
return res.data as AlbumResponseDto;
},
};

View file

@ -1,3 +0,0 @@
export const auth = (accessToken: string) => ({
headers: { Authorization: `Bearer ${accessToken}` },
});

View file

@ -1,7 +0,0 @@
import { albumApi } from './album-api';
import { auth } from './auth';
export const api = {
albumApi,
auth,
};

View file

@ -8,12 +8,10 @@ import { CrawlOptionsDto } from '../cores/dto/crawl-options-dto';
import cliProgress from 'cli-progress';
import byteSize from 'byte-size';
import { BaseCommand } from '../cli/base-command';
import { api } from 'src/api';
export default class Upload extends BaseCommand {
private crawlService = new CrawlService();
private uploadService!: UploadService;
deviceId!: string;
uploadLength!: number;
public async run(paths: string[], options: UploadOptionsDto): Promise<void> {

View file

@ -52,7 +52,7 @@ program
program
.command('logout')
.description('Remove stored credentials')
.action(async (paths, options) => {
.action(async () => {
await new Logout().run();
});

View file

@ -1,6 +1,6 @@
{
"compilerOptions": {
"module": "commonjs",
"module": "Node16",
"strict": true,
"declaration": true,
"removeComments": true,
@ -8,7 +8,7 @@
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"target": "es2017",
"target": "es2022",
"moduleResolution": "node16",
"sourceMap": true,
"outDir": "./dist",