1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-22 01:47:08 +02:00

chore(cli): auto-sort imports (#7116)

This commit is contained in:
Jason Rasmussen 2024-02-14 09:55:40 -05:00 committed by GitHub
parent 87ae0be081
commit 69166fa520
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 61 additions and 30 deletions

View File

@ -2,5 +2,7 @@
"singleQuote": true, "singleQuote": true,
"trailingComma": "all", "trailingComma": "all",
"printWidth": 120, "printWidth": 120,
"semi": true "semi": true,
"plugins": ["prettier-plugin-organize-imports"],
"organizeImportsSkipDestructiveCodeActions": true
} }

45
cli/package-lock.json generated
View File

@ -31,6 +31,8 @@
"glob": "^10.3.1", "glob": "^10.3.1",
"immich": "file:../server", "immich": "file:../server",
"mock-fs": "^5.2.0", "mock-fs": "^5.2.0",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
"typescript": "^5.3.3", "typescript": "^5.3.3",
"vite": "^5.0.12", "vite": "^5.0.12",
"vitest": "^1.2.2", "vitest": "^1.2.2",
@ -4068,11 +4070,10 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "3.0.3", "version": "3.2.5",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz",
"integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==",
"dev": true, "dev": true,
"peer": true,
"bin": { "bin": {
"prettier": "bin/prettier.cjs" "prettier": "bin/prettier.cjs"
}, },
@ -4095,6 +4096,26 @@
"node": ">=6.0.0" "node": ">=6.0.0"
} }
}, },
"node_modules/prettier-plugin-organize-imports": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-3.2.4.tgz",
"integrity": "sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog==",
"dev": true,
"peerDependencies": {
"@volar/vue-language-plugin-pug": "^1.0.4",
"@volar/vue-typescript": "^1.0.4",
"prettier": ">=2.0",
"typescript": ">=2.9"
},
"peerDependenciesMeta": {
"@volar/vue-language-plugin-pug": {
"optional": true
},
"@volar/vue-typescript": {
"optional": true
}
}
},
"node_modules/pretty-format": { "node_modules/pretty-format": {
"version": "29.7.0", "version": "29.7.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz",
@ -8543,11 +8564,10 @@
"dev": true "dev": true
}, },
"prettier": { "prettier": {
"version": "3.0.3", "version": "3.2.5",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz",
"integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==",
"dev": true, "dev": true
"peer": true
}, },
"prettier-linter-helpers": { "prettier-linter-helpers": {
"version": "1.0.0", "version": "1.0.0",
@ -8558,6 +8578,13 @@
"fast-diff": "^1.1.2" "fast-diff": "^1.1.2"
} }
}, },
"prettier-plugin-organize-imports": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-3.2.4.tgz",
"integrity": "sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog==",
"dev": true,
"requires": {}
},
"pretty-format": { "pretty-format": {
"version": "29.7.0", "version": "29.7.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz",

View File

@ -32,6 +32,8 @@
"glob": "^10.3.1", "glob": "^10.3.1",
"immich": "file:../server", "immich": "file:../server",
"mock-fs": "^5.2.0", "mock-fs": "^5.2.0",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
"typescript": "^5.3.3", "typescript": "^5.3.3",
"vite": "^5.0.12", "vite": "^5.0.12",
"vitest": "^1.2.2", "vitest": "^1.2.2",

View File

@ -1,6 +1,6 @@
import { ServerVersionResponseDto, UserResponseDto } from '@immich/sdk'; import { ServerVersionResponseDto, UserResponseDto } from '@immich/sdk';
import { SessionService } from '../services/session.service';
import { ImmichApi } from 'src/services/api.service'; import { ImmichApi } from 'src/services/api.service';
import { SessionService } from '../services/session.service';
export abstract class BaseCommand { export abstract class BaseCommand {
protected sessionService!: SessionService; protected sessionService!: SessionService;

View File

@ -1,13 +1,13 @@
import byteSize from 'byte-size'; import byteSize from 'byte-size';
import cliProgress from 'cli-progress'; import cliProgress from 'cli-progress';
import { createHash } from 'node:crypto';
import fs, { createReadStream } from 'node:fs'; import fs, { createReadStream } from 'node:fs';
import { access, constants, stat, unlink } from 'node:fs/promises';
import os from 'node:os';
import { basename } from 'node:path';
import { ImmichApi } from 'src/services/api.service';
import { CrawlService } from '../services/crawl.service'; import { CrawlService } from '../services/crawl.service';
import { BaseCommand } from './base-command'; import { BaseCommand } from './base-command';
import { basename } from 'node:path';
import { access, constants, stat, unlink } from 'node:fs/promises';
import { createHash } from 'node:crypto';
import os from 'node:os';
import { ImmichApi } from 'src/services/api.service';
class Asset { class Asset {
readonly path: string; readonly path: string;

View File

@ -1,7 +1,7 @@
#! /usr/bin/env node #! /usr/bin/env node
import { Command, Option } from 'commander'; import { Command, Option } from 'commander';
import path from 'node:path';
import os from 'node:os'; import os from 'node:os';
import path from 'node:path';
import { version } from '../package.json'; import { version } from '../package.json';
import { LoginCommand } from './commands/login.command'; import { LoginCommand } from './commands/login.command';
import { LogoutCommand } from './commands/logout.command'; import { LogoutCommand } from './commands/logout.command';

View File

@ -1,4 +1,11 @@
import { import {
ApiKeyCreateDto,
AssetBulkUploadCheckDto,
BulkIdsDto,
CreateAlbumDto,
CreateAssetDto,
LoginCredentialDto,
SignUpDto,
addAssetsToAlbum, addAssetsToAlbum,
checkBulkUpload, checkBulkUpload,
createAlbum, createAlbum,
@ -13,13 +20,6 @@ import {
pingServer, pingServer,
signUpAdmin, signUpAdmin,
uploadFile, uploadFile,
ApiKeyCreateDto,
AssetBulkUploadCheckDto,
BulkIdsDto,
CreateAlbumDto,
CreateAssetDto,
LoginCredentialDto,
SignUpDto,
} from '@immich/sdk'; } from '@immich/sdk';
/** /**

View File

@ -1,5 +1,5 @@
import mockfs from 'mock-fs'; import mockfs from 'mock-fs';
import { CrawlService, CrawlOptions } from './crawl.service'; import { CrawlOptions, CrawlService } from './crawl.service';
interface Test { interface Test {
test: string; test: string;

View File

@ -1,4 +1,3 @@
import { SessionService } from './session.service';
import fs from 'node:fs'; import fs from 'node:fs';
import yaml from 'yaml'; import yaml from 'yaml';
import { import {
@ -11,6 +10,7 @@ import {
readTestAuthFile, readTestAuthFile,
spyOnConsole, spyOnConsole,
} from '../../test/cli-test-utils'; } from '../../test/cli-test-utils';
import { SessionService } from './session.service';
const mocks = vi.hoisted(() => { const mocks = vi.hoisted(() => {
return { return {

View File

@ -1,8 +1,8 @@
import { restoreTempFolder, testApp } from '@test-utils'; import { restoreTempFolder, testApp } from '@test-utils';
import { CLI_BASE_OPTIONS, TEST_AUTH_FILE, deleteAuthFile, setup, spyOnConsole } from 'test/cli-test-utils';
import { readFile, stat } from 'node:fs/promises'; import { readFile, stat } from 'node:fs/promises';
import { LoginCommand } from '../../src/commands/login.command'; import { CLI_BASE_OPTIONS, TEST_AUTH_FILE, deleteAuthFile, setup, spyOnConsole } from 'test/cli-test-utils';
import yaml from 'yaml'; import yaml from 'yaml';
import { LoginCommand } from '../../src/commands/login.command';
describe(`login-key (e2e)`, () => { describe(`login-key (e2e)`, () => {
let apiKey: string; let apiKey: string;

View File

@ -1,6 +1,6 @@
import path from 'node:path';
import { PostgreSqlContainer } from '@testcontainers/postgresql'; import { PostgreSqlContainer } from '@testcontainers/postgresql';
import { access } from 'node:fs/promises'; import { access } from 'node:fs/promises';
import path from 'node:path';
export const directoryExists = (directory: string) => export const directoryExists = (directory: string) =>
access(directory) access(directory)

View File

@ -1,7 +1,7 @@
import { IMMICH_TEST_ASSET_PATH, restoreTempFolder, testApp } from '@test-utils'; import { IMMICH_TEST_ASSET_PATH, restoreTempFolder, testApp } from '@test-utils';
import { ImmichApi } from 'src/services/api.service';
import { CLI_BASE_OPTIONS, setup, spyOnConsole } from 'test/cli-test-utils'; import { CLI_BASE_OPTIONS, setup, spyOnConsole } from 'test/cli-test-utils';
import { UploadCommand } from '../../src/commands/upload.command'; import { UploadCommand } from '../../src/commands/upload.command';
import { ImmichApi } from 'src/services/api.service';
describe(`upload (e2e)`, () => { describe(`upload (e2e)`, () => {
let api: ImmichApi; let api: ImmichApi;