-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧🍃⚙️ Core hot reloading working, Prisma time
- Loading branch information
1 parent
bef1bb3
commit 7c7ee5c
Showing
13 changed files
with
227 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
# Keep environment variables out of version control | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "sqlite" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model Track { | ||
id Int @id @default(autoincrement()) | ||
title String | ||
duration BigInt | ||
artists Artist[] @relation(fields: [name], references: [id]) | ||
album Album @relation(fields: [title, art], references: [id]) | ||
track_number Int | ||
} | ||
|
||
model Artist { | ||
id Int @id @default(autoincrement()) | ||
profile_image String | ||
name String | ||
tracks Track[] @relation(fields: [title, duration, artists, album], references: [id]) | ||
} | ||
|
||
model Album { | ||
id Int @id @default(autoincrement()) | ||
title String | ||
art String | ||
artist Artist @relation(fields: [name], references: [id]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* @param message Must be valid JSON; '"Helooo"', JSON.stringify({blah: 'foo'}), etc. | ||
*/ | ||
declare function sendMessage(channel_name: string, message: string): any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class LoggerClass { | ||
protected provider: (message: string) => void; | ||
|
||
constructor() { | ||
if (console) { | ||
this.provider = (message) => console.log(message); | ||
} | ||
this.provider = (message) => sendMessage('print', `"${message}"`) | ||
} | ||
|
||
/** | ||
* Temporary debug logging; remove before release! | ||
*/ | ||
public debug(message: string) { | ||
this.provider(`[Music Core: DEBUG] ${message}`) | ||
} | ||
|
||
/** | ||
* Unable to operate; user should expect an unresponsive app. | ||
*/ | ||
public fatal(error: string) { | ||
this.provider(`[Music Core: FATAL] ${error}`) | ||
} | ||
|
||
/** | ||
* Failure of function; user should expect broken features. | ||
*/ | ||
public error(error: string) { | ||
this.provider(`[Music Core: ERROR] ${error}`) | ||
} | ||
|
||
/** | ||
* Unexpected/unideal result of function; this should usually not be used. | ||
*/ | ||
public warn(warning: string) { | ||
this.provider(`[Music Core: WARN] ${warning}`) | ||
} | ||
|
||
/** | ||
* Normal operation. | ||
*/ | ||
public info(info: string) { | ||
this.provider(`[Music Core: INFO] ${info}`) | ||
} | ||
} | ||
|
||
export const Logger = new LoggerClass() |
Oops, something went wrong.