Skip to content

Commit

Permalink
1.2.0 release merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ArgentumHeart authored Dec 17, 2024
2 parents 12aaba0 + 64a5ebe commit 3ad73d2
Show file tree
Hide file tree
Showing 33 changed files with 2,158 additions and 275 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": true
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"main": "./src/main/main.ts",
"license": "MIT",
"prisma": {
"seed": "ts-node -T --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts",
"schema": "./prisma/schema.prisma"
},
"scripts": {
Expand All @@ -12,7 +11,7 @@
"build:main": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.main.prod.ts",
"build:renderer": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.prod.ts",
"postinstall": "ts-node .erb/scripts/check-native-dep.js && electron-builder install-app-deps && npm run build:dll",
"lint": "cross-env NODE_ENV=development eslint . --ext .js,.jsx,.ts,.tsx",
"prettier": "cross-env NODE_ENV=development prettier 'src/**/*.{ts,tsx}' --write",
"package": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never && npm run build:dll",
"rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir release/app",
"start": "ts-node ./.erb/scripts/check-port-in-use.js && npm run start:renderer",
Expand Down Expand Up @@ -70,13 +69,13 @@
}
},
"dependencies": {
"@prisma/client": "^6.0.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fontsource/roboto": "^5.0.8",
"@mui/icons-material": "^5.14.13",
"@mui/material": "^5.14.13",
"@mui/x-tree-view": "^6.0.0-beta.0",
"@prisma/client": "^6.0.1",
"electron-debug": "^3.2.0",
"electron-log": "^4.4.8",
"electron-updater": "^6.1.4",
Expand Down Expand Up @@ -118,7 +117,7 @@
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"mini-css-extract-plugin": "2.7.6",
"prettier": "3.0.3",
"prettier": "^3.4.2",
"prisma": "^6.0.1",
"react-refresh": "0.14.0",
"react-test-renderer": "18.2.0",
Expand Down
Binary file modified prisma/dev.db
Binary file not shown.
55 changes: 0 additions & 55 deletions prisma/migrations/20241208012214_init_items/migration.sql

This file was deleted.

80 changes: 80 additions & 0 deletions prisma/migrations/20241217080125_init/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
-- CreateTable
CREATE TABLE "Class" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"tier" INTEGER NOT NULL,
"parentId" INTEGER,
CONSTRAINT "Class_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "Class" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);

-- CreateTable
CREATE TABLE "Item" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"displayName" TEXT NOT NULL,
"icon" TEXT NOT NULL,
"legacyItem" BOOLEAN NOT NULL DEFAULT false,
"description" TEXT,
"effects" TEXT,
"rarityId" INTEGER NOT NULL,
"restrictionId" INTEGER NOT NULL,
"source" TEXT,
"sourceShort" TEXT,
CONSTRAINT "Item_rarityId_fkey" FOREIGN KEY ("rarityId") REFERENCES "ItemRarity" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Item_restrictionId_fkey" FOREIGN KEY ("restrictionId") REFERENCES "ItemRestriction" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);

-- CreateTable
CREATE TABLE "ItemRecipes" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"outputId" INTEGER NOT NULL,
"inputId" INTEGER NOT NULL,
"quantity" INTEGER NOT NULL DEFAULT 1,
CONSTRAINT "ItemRecipes_inputId_fkey" FOREIGN KEY ("inputId") REFERENCES "Item" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "ItemRecipes_outputId_fkey" FOREIGN KEY ("outputId") REFERENCES "Item" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);

-- CreateTable
CREATE TABLE "ItemRestriction" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL
);

-- CreateTable
CREATE TABLE "ItemRarity" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"color" TEXT NOT NULL
);

-- CreateTable
CREATE TABLE "_RestrictionClass" (
"A" INTEGER NOT NULL,
"B" INTEGER NOT NULL,
CONSTRAINT "_RestrictionClass_A_fkey" FOREIGN KEY ("A") REFERENCES "Class" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "_RestrictionClass_B_fkey" FOREIGN KEY ("B") REFERENCES "ItemRestriction" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);

-- CreateIndex
CREATE UNIQUE INDEX "Class_id_key" ON "Class"("id");

-- CreateIndex
CREATE UNIQUE INDEX "Class_name_key" ON "Class"("name");

-- CreateIndex
CREATE UNIQUE INDEX "Item_id_key" ON "Item"("id");

-- CreateIndex
CREATE UNIQUE INDEX "Item_name_key" ON "Item"("name");

-- CreateIndex
CREATE INDEX "ItemRecipes_inputId_outputId_idx" ON "ItemRecipes"("inputId", "outputId");

-- CreateIndex
CREATE UNIQUE INDEX "ItemRarity_id_key" ON "ItemRarity"("id");

-- CreateIndex
CREATE UNIQUE INDEX "_RestrictionClass_AB_unique" ON "_RestrictionClass"("A", "B");

-- CreateIndex
CREATE INDEX "_RestrictionClass_B_index" ON "_RestrictionClass"("B");
36 changes: 25 additions & 11 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// 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"
}
Expand All @@ -11,20 +8,25 @@ datasource db {
}

model Class {
id Int @id @default(autoincrement())
name String
tier Int
id Int @id @unique @default(autoincrement())
name String @unique
tier Int
ascendancy Class[] @relation("ClassAdvancements")
parentId Int?
parent Class? @relation("ClassAdvancements", fields: [parentId], references: [id])
allowedRestrictions ItemRestriction[] @relation("RestrictionClass")
}

model Item {
id String @id @unique
name String
id Int @id @unique @default(autoincrement())
name String @unique
displayName String
icon String
legacyItem Boolean @default(false)
description String?
effects String?
recipe Item[] @relation("ItemRecipes")
partOf Item[] @relation("ItemRecipes")
recipe ItemRecipes[] @relation("recipe")
partOf ItemRecipes[] @relation("partOf")
rarity ItemRarity @relation(fields: [rarityId], references: [id])
rarityId Int
restriction ItemRestriction @relation(fields: [restrictionId], references: [id])
Expand All @@ -33,10 +35,22 @@ model Item {
sourceShort String?
}

model ItemRecipes {
id Int @id @default(autoincrement())
outputId Int
inputId Int
input Item @relation("partOf", fields: [inputId], references: [id])
output Item @relation("recipe", fields: [outputId], references: [id])
quantity Int @default(1)
@@index([inputId, outputId])
}

model ItemRestriction {
id Int @id @default(autoincrement())
id Int @id @default(autoincrement())
name String
items Item[]
class Class[] @relation("RestrictionClass")
}

model ItemRarity {
Expand Down
Loading

0 comments on commit 3ad73d2

Please sign in to comment.