From 85a440017c6f42a2d6f83007a38223de9d2db334 Mon Sep 17 00:00:00 2001 From: Lang <7system7@gmail.com> Date: Sat, 11 Apr 2026 15:50:53 +0200 Subject: [PATCH] chg: pkg: update the vite related stuff because CORS and React errors - reinit the miration #4 --- .../2026/04/Version20260409194708.php | 42 ------------------- ...09175831.php => Version20260411133016.php} | 24 +++++------ templates/Game/play.html.twig | 2 +- vite.config.js | 5 +++ 4 files changed, 16 insertions(+), 57 deletions(-) delete mode 100644 src/Migrations/2026/04/Version20260409194708.php rename src/Migrations/2026/04/{Version20260409175831.php => Version20260411133016.php} (90%) diff --git a/src/Migrations/2026/04/Version20260409194708.php b/src/Migrations/2026/04/Version20260409194708.php deleted file mode 100644 index 2afca42..0000000 --- a/src/Migrations/2026/04/Version20260409194708.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @category Class - * @license https://www.gnu.org/licenses/lgpl-3.0.en.html GNU Lesser General Public License - * @link www.splendidbear.org - * @since 2026. 04. 09. - */ -final class Version20260409194708 extends AbstractMigration -{ - public function getDescription(): string - { - return 'Refactor entities'; - } - - public function up(Schema $schema): void - { - $this->addSql('ALTER TABLE step RENAME COLUMN wbomb TO w_bomb'); - } - - public function down(Schema $schema): void - { - $this->addSql('ALTER TABLE step RENAME COLUMN w_bomb TO wbomb'); - } -} diff --git a/src/Migrations/2026/04/Version20260409175831.php b/src/Migrations/2026/04/Version20260411133016.php similarity index 90% rename from src/Migrations/2026/04/Version20260409175831.php rename to src/Migrations/2026/04/Version20260411133016.php index 5603c99..48f6e18 100644 --- a/src/Migrations/2026/04/Version20260409175831.php +++ b/src/Migrations/2026/04/Version20260411133016.php @@ -1,12 +1,6 @@ - * @category Class * @license https://www.gnu.org/licenses/lgpl-3.0.en.html GNU Lesser General Public License * @link www.splendidbear.org - * @since 2026. 04. 09. + * @since 2026. 04. 11. */ -final class Version20260409175831 extends AbstractMigration +final class Version20260411133016 extends AbstractMigration { public function getDescription(): string { - return 'Initialize the database for 2026'; + return ''; } public function up(Schema $schema): void { + // this up() migration is auto-generated, please modify it to your needs $this->addSql('CREATE SEQUENCE gamer_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE grid_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE grid_row_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); @@ -48,7 +43,7 @@ final class Version20260409175831 extends AbstractMigration $this->addSql('CREATE INDEX IDX_54BE8039F24372EB ON played_game (red_anon)'); $this->addSql('CREATE INDEX IDX_54BE80395AB9393F ON played_game (blue_id)'); $this->addSql('CREATE INDEX IDX_54BE8039C64E7C7C ON played_game (blue_anon)'); - $this->addSql('CREATE TABLE step (id INT NOT NULL, played_game_id INT DEFAULT NULL, row INT NOT NULL, col INT NOT NULL, w_bomb BOOLEAN DEFAULT NULL, created TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE step (id INT NOT NULL, played_game_id INT DEFAULT NULL, row INT NOT NULL, col INT NOT NULL, w_bomb BOOLEAN DEFAULT NULL, player VARCHAR(10) DEFAULT NULL, revealed_cells JSON DEFAULT NULL, created TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE INDEX IDX_43B9FE3C5AA11DBB ON step (played_game_id)'); $this->addSql('CREATE TABLE "user" (id INT NOT NULL, username VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649F85E0677 ON "user" (username)'); @@ -63,6 +58,7 @@ final class Version20260409175831 extends AbstractMigration public function down(Schema $schema): void { + // this down() migration is auto-generated, please modify it to your needs $this->addSql('DROP SEQUENCE gamer_id_seq CASCADE'); $this->addSql('DROP SEQUENCE grid_id_seq CASCADE'); $this->addSql('DROP SEQUENCE grid_row_id_seq CASCADE'); diff --git a/templates/Game/play.html.twig b/templates/Game/play.html.twig index a8a9b1a..fcae2ff 100644 --- a/templates/Game/play.html.twig +++ b/templates/Game/play.html.twig @@ -37,5 +37,5 @@ {% block javascripts %} {{ parent() }} - {{ vite_entry_script_tags('mineseeker') }} + {{ vite_entry_script_tags('mineseeker', { dependency: 'react' }) }} {% endblock %} diff --git a/vite.config.js b/vite.config.js index fe3697e..67a6886 100644 --- a/vite.config.js +++ b/vite.config.js @@ -28,6 +28,11 @@ export default defineConfig({ }, }, }, + server: { + cors: { + origin: ['https://mine.local', 'http://mine.local'], + }, + }, css: { preprocessorOptions: { scss: {