Erasable syntax only, update pnpm
This commit is contained in:
@@ -18,7 +18,7 @@ RUN pnpm exec tsc --build
|
||||
#RUN pnpm exec eslint .
|
||||
RUN pnpm --filter frontend exec vite build
|
||||
|
||||
FROM oven/bun:1
|
||||
FROM oven/bun:1.3.14
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY --from=build /app .
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"scripts": {
|
||||
"backend:dev": "bun run --watch packages/backend/src/app.ts",
|
||||
"docker:build": "docker build -t music-repo .",
|
||||
"docker:run": "docker run --init --publish 3000:3000 --rm music-repo",
|
||||
"docker:run": "docker run --env-file .env --init --publish 3000:3000 --rm music-repo",
|
||||
"frontend:build": "pnpm --filter frontend exec vite build",
|
||||
"frontend:dev": "pnpm --filter frontend exec vite --open"
|
||||
},
|
||||
|
||||
@@ -5,11 +5,13 @@ import * as Api from "./Api";
|
||||
|
||||
// --- MARK: COMMON TYPES ------------------------------------------------------
|
||||
|
||||
export enum Role {
|
||||
Viewer = "Viewer",
|
||||
Editor = "Editor",
|
||||
Admin = "Admin",
|
||||
}
|
||||
export const Role = Object.freeze({
|
||||
Viewer: "Viewer",
|
||||
Editor: "Editor",
|
||||
Admin: "Admin",
|
||||
});
|
||||
|
||||
export type Role = (typeof Role)[keyof (typeof Role)];
|
||||
|
||||
export const SystemInformation = Schema.Struct({
|
||||
createdBy: pipe(UserId, Schema.optionalWith({ as: "Option", exact: true })),
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
import { mapProp } from "@/hooks/useStore";
|
||||
import { Update } from "common";
|
||||
import { getMediaTypeForFile } from "common/MediaType";
|
||||
|
||||
export function FileReducer(prev: FileReducer.State, action: FileReducer.Action): FileReducer.State {
|
||||
switch (action.type) {
|
||||
case "reset":
|
||||
return FileReducer.initial;
|
||||
case "file":
|
||||
if (prev.file !== null) {
|
||||
if (action.file !== null) {
|
||||
if (prev.file.name === prev.filename && getMediaTypeForFile(prev.file) === prev.mediaType) {
|
||||
return Object.freeze<FileReducer.State>({
|
||||
filename: action.file.name,
|
||||
mediaType: getMediaTypeForFile(action.file),
|
||||
file: action.file,
|
||||
});
|
||||
} else {
|
||||
return mapProp("file", action.file as File | null)(prev);
|
||||
}
|
||||
} else {
|
||||
if (prev.file.name === prev.filename && prev.file.type === prev.mediaType) {
|
||||
return FileReducer.initial;
|
||||
} else {
|
||||
return mapProp("file", action.file as File | null)(prev);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (action.file !== null) {
|
||||
if (prev.filename === "" && prev.mediaType === "") {
|
||||
return Object.freeze<FileReducer.State>({
|
||||
filename: action.file.name,
|
||||
mediaType: getMediaTypeForFile(action.file),
|
||||
file: action.file,
|
||||
});
|
||||
} else {
|
||||
return mapProp("file", action.file as File | null)(prev);
|
||||
}
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}
|
||||
case "filename":
|
||||
return mapProp("filename", action.filename)(prev);
|
||||
case "mediaType":
|
||||
return mapProp("mediaType", action.mediaType)(prev);
|
||||
}
|
||||
}
|
||||
|
||||
export namespace FileReducer {
|
||||
|
||||
export interface ResetAction {
|
||||
readonly type: "reset";
|
||||
}
|
||||
|
||||
export const reset: ResetAction = Object.freeze<ResetAction>({
|
||||
type: "reset",
|
||||
});
|
||||
|
||||
export interface SetFileAction {
|
||||
readonly type: "file";
|
||||
readonly file: File | null;
|
||||
}
|
||||
|
||||
export function setFile(file: File | null): SetFileAction {
|
||||
return Object.freeze<SetFileAction>({
|
||||
type: "file",
|
||||
file,
|
||||
});
|
||||
}
|
||||
|
||||
export interface SetFilenameAction {
|
||||
readonly type: "filename";
|
||||
readonly filename: Update<string>;
|
||||
}
|
||||
|
||||
export function setFilename(filename: Update<string>): SetFilenameAction {
|
||||
return Object.freeze<SetFilenameAction>({
|
||||
type: "filename",
|
||||
filename,
|
||||
});
|
||||
}
|
||||
|
||||
export interface SetMediaTypeAction {
|
||||
readonly type: "mediaType";
|
||||
readonly mediaType: Update<string>;
|
||||
}
|
||||
|
||||
export function setMediaType(mediaType: Update<string>): SetMediaTypeAction {
|
||||
return Object.freeze<SetMediaTypeAction>({
|
||||
type: "mediaType",
|
||||
mediaType,
|
||||
});
|
||||
}
|
||||
|
||||
export type Action = ResetAction |
|
||||
SetFileAction |
|
||||
SetFilenameAction |
|
||||
SetMediaTypeAction;
|
||||
|
||||
export interface State {
|
||||
readonly filename: string;
|
||||
readonly mediaType: string;
|
||||
readonly file: File | null;
|
||||
}
|
||||
|
||||
export const initial: State = Object.freeze<State>({
|
||||
filename: "",
|
||||
mediaType: "",
|
||||
file: null,
|
||||
});
|
||||
}
|
||||
@@ -37,11 +37,17 @@ class Listener<T> {
|
||||
|
||||
private lastState: T;
|
||||
|
||||
private readonly selector: Selector<T>;
|
||||
private readonly setState: (state: T) => void;
|
||||
|
||||
constructor(
|
||||
readonly selector: Selector<T>,
|
||||
readonly setState: (state: T) => void,
|
||||
selector: Selector<T>,
|
||||
setState: (state: T) => void,
|
||||
) {
|
||||
this.lastState = selector(store);
|
||||
|
||||
this.selector = selector;
|
||||
this.setState = setState;
|
||||
}
|
||||
|
||||
react() {
|
||||
|
||||
@@ -210,18 +210,20 @@ namespace AttachmentRow {
|
||||
}
|
||||
}
|
||||
|
||||
enum LocalCopyState {
|
||||
Uninitialized = "uninitialized",
|
||||
Online = "online",
|
||||
Offline = "offline",
|
||||
Loading = "loading",
|
||||
Error = "error",
|
||||
}
|
||||
const LocalCopyState = Object.freeze({
|
||||
Uninitialized: "uninitialized",
|
||||
Online: "online",
|
||||
Offline: "offline",
|
||||
Loading: "loading",
|
||||
Error: "error",
|
||||
});
|
||||
|
||||
type LocalCopyState = (typeof LocalCopyState)[keyof (typeof LocalCopyState)];
|
||||
|
||||
function AttachmentRow(props: AttachmentRow.Props) {
|
||||
|
||||
const [cloneDialogOpen, setCloneDialogOpen] = useState(false);
|
||||
const [localCopyState, setLocalCopyState] = useState(LocalCopyState.Uninitialized);
|
||||
const [localCopyState, setLocalCopyState] = useState<LocalCopyState>(LocalCopyState.Uninitialized);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (localCopyState !== LocalCopyState.Uninitialized) return;
|
||||
|
||||
@@ -2,12 +2,10 @@ packages:
|
||||
- '.'
|
||||
- 'packages/*'
|
||||
|
||||
ignoredBuiltDependencies:
|
||||
- 'gl'
|
||||
|
||||
onlyBuiltDependencies:
|
||||
- '@tailwindcss/oxide'
|
||||
- 'esbuild'
|
||||
allowBuilds:
|
||||
'@tailwindcss/oxide': true
|
||||
'esbuild': true
|
||||
'gl': false
|
||||
|
||||
catalog:
|
||||
'@effect/language-service': '^0.21.8'
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true,
|
||||
"allowImportingTsExtensions": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
|
||||
"skipLibCheck": true,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user