-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(cli): organize files, simplify types, use @immich/sdk #6747
Conversation
jrasm91
commented
Jan 30, 2024
•
edited
Loading
edited
Before | After |
---|---|
Deploying with Cloudflare Pages
|
e767874
to
0330dba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome! thank you!!
@@ -1,31 +1,40 @@ | |||
import fs from 'node:fs'; | |||
import yaml from 'yaml'; | |||
import { existsSync } from 'fs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably wouldn't remove the node:
prefix here
import { existsSync } from 'fs'; | |
import { existsSync } from 'node:fs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, true. Do you know if there is a linting rule or some way to prefer the prefix? The code base is quite inconsistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, there's unicorn/prefer-node-protocol
: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created #6751 as a proof of concept for this (and most other unicorn rules)
loginCredentialDto: { email: 'cli@immich.app', password: 'password' }, | ||
}); | ||
const { data: apiKey } = await api.keyApi.createApiKey( | ||
{ aPIKeyCreateDto: { name: 'CLI Test' } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the capitalization looks off here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha yeah. This is the auto generated code from open API generator. I think if we changed the dto on the server from APIKey to ApiKey it would generate more how you would expect it to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on this SO post, it seems style guidelines for acronyms lean toward using the normal casing instead of all-caps. So XmlHttpRequest
, not XMLHTTPRequest
. Maybe we should adopt that for consistency.
if (!this.fileCreatedAt) throw new Error('File created at not set'); | ||
if (!this.fileModifiedAt) throw new Error('File modified at not set'); | ||
|
||
// TODO: doesn't xmp replace the file extension? Will need investigation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally you get a .xmp
after the original extension, so foo.jpg.xmp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually not standardized! I've used a bunch of photo tools in my workflow and some use foo.xmp and some use foo.jpg.xmp. This is something on my backlog to fix across all of Immich, currently we only support one format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh really? I hate this.