From dae6aad02a1f7ac07ffd65f311c62a1cc644b2cb Mon Sep 17 00:00:00 2001 From: BastLast Date: Mon, 4 Nov 2024 00:16:49 +0100 Subject: [PATCH 1/4] migrate to new yarn #2640 --- .gitignore | 4 +- Core/.yarnrc.yml | 3 ++ Core/package.json | 3 ++ Core/yarn.lock | 75 +++++++++++++++++++--------------- Discord/.yarnrc.yml | 1 + Discord/package.json | 3 ++ Discord/yarn.lock | 97 ++++++++++++++++++++++++-------------------- Lib/.yarnrc.yml | 3 ++ Lib/package.json | 1 + Lib/yarn.lock | 28 ++++++------- 10 files changed, 126 insertions(+), 92 deletions(-) create mode 100644 Core/.yarnrc.yml create mode 100644 Discord/.yarnrc.yml create mode 100644 Lib/.yarnrc.yml diff --git a/.gitignore b/.gitignore index a12985e31..33f2a2d7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .idea .run mqtt5 -**/.yarn \ No newline at end of file +**/.yarn +/*/.pnp.cjs +/*/.pnp.loader.mjs \ No newline at end of file diff --git a/Core/.yarnrc.yml b/Core/.yarnrc.yml new file mode 100644 index 000000000..5f683b5ea --- /dev/null +++ b/Core/.yarnrc.yml @@ -0,0 +1,3 @@ +enableGlobalCache: false + +nodeLinker: pnp diff --git a/Core/package.json b/Core/package.json index 0a5755d60..68e440832 100644 --- a/Core/package.json +++ b/Core/package.json @@ -3,6 +3,7 @@ "version": "5.0.0", "description": "Core package of DraftBot which manages the game mechanics", "main": "src/index.js", + "packageManager": "yarn@4.5.1", "engines": { "node": ">=18.19.0" }, @@ -19,6 +20,7 @@ "dependencies": { "@types/node": "20.4.8", "mariadb": "3.0.2", + "moment": "^2.30.1", "mqtt": "^5.10.1", "random-js": "^2.1.0", "sequelize": "6.32.1", @@ -27,6 +29,7 @@ "umzug": "3.2.1" }, "devDependencies": { + "@types/moment": "^2.13.0", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", "eslint": "^8.56.0", diff --git a/Core/yarn.lock b/Core/yarn.lock index 3c5d70c2c..39e932d04 100644 --- a/Core/yarn.lock +++ b/Core/yarn.lock @@ -6,29 +6,29 @@ __metadata: cacheKey: 10c0 "@babel/runtime@npm:^7.23.8, @babel/runtime@npm:^7.24.5": - version: 7.25.7 - resolution: "@babel/runtime@npm:7.25.7" + version: 7.26.0 + resolution: "@babel/runtime@npm:7.26.0" dependencies: regenerator-runtime: "npm:^0.14.0" - checksum: 10c0/86b7829d2fc9343714a9afe92757cf96c4dc799006ca61d73cda62f4b9e29bfa1ce36794955bc6cb4c188f5b10db832c949339895e1bbe81a69022d9d578ce29 + checksum: 10c0/12c01357e0345f89f4f7e8c0e81921f2a3e3e101f06e8eaa18a382b517376520cd2fa8c237726eb094dab25532855df28a7baaf1c26342b52782f6936b07c287 languageName: node linkType: hard "@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": - version: 4.4.0 - resolution: "@eslint-community/eslint-utils@npm:4.4.0" + version: 4.4.1 + resolution: "@eslint-community/eslint-utils@npm:4.4.1" dependencies: - eslint-visitor-keys: "npm:^3.3.0" + eslint-visitor-keys: "npm:^3.4.3" peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - checksum: 10c0/7e559c4ce59cd3a06b1b5a517b593912e680a7f981ae7affab0d01d709e99cd5647019be8fafa38c350305bc32f1f7d42c7073edde2ab536c745e365f37b607e + checksum: 10c0/2aa0ac2fc50ff3f234408b10900ed4f1a0b19352f21346ad4cc3d83a1271481bdda11097baa45d484dd564c895e0762a27a8240be7a256b3ad47129e96528252 languageName: node linkType: hard "@eslint-community/regexpp@npm:^4.5.1, @eslint-community/regexpp@npm:^4.6.1": - version: 4.11.1 - resolution: "@eslint-community/regexpp@npm:4.11.1" - checksum: 10c0/fbcc1cb65ef5ed5b92faa8dc542e035269065e7ebcc0b39c81a4fe98ad35cfff20b3c8df048641de15a7757e07d69f85e2579c1a5055f993413ba18c055654f8 + version: 4.12.1 + resolution: "@eslint-community/regexpp@npm:4.12.1" + checksum: 10c0/a03d98c246bcb9109aec2c08e4d10c8d010256538dcb3f56610191607214523d4fb1b00aa81df830b6dffb74c5fa0be03642513a289c567949d3e550ca11cdf6 languageName: node linkType: hard @@ -186,6 +186,15 @@ __metadata: languageName: node linkType: hard +"@types/moment@npm:^2.13.0": + version: 2.13.0 + resolution: "@types/moment@npm:2.13.0" + dependencies: + moment: "npm:*" + checksum: 10c0/b9b668ca4b2584daaa03523a28dd26d542fa4da3de3e976242bbd1568dfc01736142118143a69ed26f62de1b49936ab346579a2ce3979410a1bab229d644cccb + languageName: node + linkType: hard + "@types/ms@npm:*": version: 0.7.34 resolution: "@types/ms@npm:0.7.34" @@ -194,11 +203,11 @@ __metadata: linkType: hard "@types/node@npm:*": - version: 22.7.6 - resolution: "@types/node@npm:22.7.6" + version: 22.8.7 + resolution: "@types/node@npm:22.8.7" dependencies: - undici-types: "npm:~6.19.2" - checksum: 10c0/d4406a63afce981c363fb1d1954aaf1759ad2d487c0833ebf667565ea4e45ff217d6fab4b5343badbdeccdf9d2e4a0841d633e0c929ceabcb33c288663dd0c73 + undici-types: "npm:~6.19.8" + checksum: 10c0/14372885db80059ed6e92c320b2bcd8f7dc271698adce11f51aa0f424a3f82aa1749a4f66321b87043791b894346b2458d514cbb65ce70167c2fd8a78a124947 languageName: node linkType: hard @@ -217,12 +226,12 @@ __metadata: linkType: hard "@types/readable-stream@npm:^4.0.0, @types/readable-stream@npm:^4.0.5": - version: 4.0.15 - resolution: "@types/readable-stream@npm:4.0.15" + version: 4.0.18 + resolution: "@types/readable-stream@npm:4.0.18" dependencies: "@types/node": "npm:*" safe-buffer: "npm:~5.1.1" - checksum: 10c0/7424f747dd62e5c0f686a447e891064b1efdce44a7d55304ac4690b4d240ad194481083f0b07419d5e0295c79d81f0db2a677482c50954c1bbc948cbd40d8725 + checksum: 10c0/641e0e91b9ecfeed72f7509089f25923e06e19e79ed36f962785c41c07b0c9ecb2ecfdf6d290a101b9b5a669a3b89ee3aff0cad57b66a05e2a30cd199052e3e1 languageName: node linkType: hard @@ -241,11 +250,11 @@ __metadata: linkType: hard "@types/ws@npm:^8.5.9": - version: 8.5.12 - resolution: "@types/ws@npm:8.5.12" + version: 8.5.13 + resolution: "@types/ws@npm:8.5.13" dependencies: "@types/node": "npm:*" - checksum: 10c0/3fd77c9e4e05c24ce42bfc7647f7506b08c40a40fe2aea236ef6d4e96fc7cb4006a81ed1b28ec9c457e177a74a72924f4768b7b4652680b42dfd52bc380e15f9 + checksum: 10c0/a5430aa479bde588e69cb9175518d72f9338b6999e3b2ae16fc03d3bdcff8347e486dc031e4ed14601260463c07e1f9a0d7511dfc653712b047c439c680b0b34 languageName: node linkType: hard @@ -398,11 +407,11 @@ __metadata: linkType: hard "acorn@npm:^8.9.0": - version: 8.13.0 - resolution: "acorn@npm:8.13.0" + version: 8.14.0 + resolution: "acorn@npm:8.14.0" bin: acorn: bin/acorn - checksum: 10c0/f35dd53d68177c90699f4c37d0bb205b8abe036d955d0eb011ddb7f14a81e6fd0f18893731c457c1b5bd96754683f4c3d80d9a5585ddecaa53cdf84e0b3d68f7 + checksum: 10c0/6d4ee461a7734b2f48836ee0fbb752903606e576cc100eb49340295129ca0b452f3ba91ddd4424a1d4406a98adfb2ebb6bd0ff4c49d7a0930c10e462719bbfd7 languageName: node linkType: hard @@ -703,12 +712,14 @@ __metadata: version: 0.0.0-use.local resolution: "draftbot_core@workspace:." dependencies: + "@types/moment": "npm:^2.13.0" "@types/node": "npm:20.4.8" "@typescript-eslint/eslint-plugin": "npm:^6.21.0" "@typescript-eslint/parser": "npm:^6.21.0" eslint: "npm:^8.56.0" eslint-config-google: "npm:0.14.0" mariadb: "npm:3.0.2" + moment: "npm:^2.30.1" mqtt: "npm:^5.10.1" random-js: "npm:^2.1.0" sequelize: "npm:6.32.1" @@ -753,7 +764,7 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": +"eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" checksum: 10c0/92708e882c0a5ffd88c23c0b404ac1628cf20104a108c745f240a13c332a11aac54f49a22d5762efbffc18ecbc9a580d1b7ad034bf5f3cc3307e5cbff2ec9820 @@ -1432,7 +1443,7 @@ __metadata: languageName: node linkType: hard -"moment@npm:^2.29.4": +"moment@npm:*, moment@npm:^2.29.4, moment@npm:^2.30.1": version: 2.30.1 resolution: "moment@npm:2.30.1" checksum: 10c0/865e4279418c6de666fca7786607705fd0189d8a7b7624e2e56be99290ac846f90878a6f602e34b4e0455c549b85385b1baf9966845962b313699e7cb847543a @@ -2013,18 +2024,18 @@ __metadata: linkType: hard "ts-api-utils@npm:^1.0.1": - version: 1.3.0 - resolution: "ts-api-utils@npm:1.3.0" + version: 1.4.0 + resolution: "ts-api-utils@npm:1.4.0" peerDependencies: typescript: ">=4.2.0" - checksum: 10c0/f54a0ba9ed56ce66baea90a3fa087a484002e807f28a8ccb2d070c75e76bde64bd0f6dce98b3802834156306050871b67eec325cb4e918015a360a3f0868c77c + checksum: 10c0/1b2bfa50ea52771d564bb143bb69010d25cda03ed573095fbac9b86f717012426443af6647e00e3db70fca60360482a30c1be7cf73c3521c321f6bf5e3594ea0 languageName: node linkType: hard "tslib@npm:^2.6.2": - version: 2.8.0 - resolution: "tslib@npm:2.8.0" - checksum: 10c0/31e4d14dc1355e9b89e4d3c893a18abb7f90b6886b089c2da91224d0a7752c79f3ddc41bc1aa0a588ac895bd97bb99c5bc2bfdb2f86de849f31caeb3ba79bbe5 + version: 2.8.1 + resolution: "tslib@npm:2.8.1" + checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62 languageName: node linkType: hard @@ -2099,7 +2110,7 @@ __metadata: languageName: node linkType: hard -"undici-types@npm:~6.19.2": +"undici-types@npm:~6.19.8": version: 6.19.8 resolution: "undici-types@npm:6.19.8" checksum: 10c0/078afa5990fba110f6824823ace86073b4638f1d5112ee26e790155f481f2a868cc3e0615505b6f4282bdf74a3d8caad715fd809e870c2bb0704e3ea6082f344 diff --git a/Discord/.yarnrc.yml b/Discord/.yarnrc.yml new file mode 100644 index 000000000..09b10123b --- /dev/null +++ b/Discord/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: pnp diff --git a/Discord/package.json b/Discord/package.json index 800110baf..92a2602a5 100644 --- a/Discord/package.json +++ b/Discord/package.json @@ -3,6 +3,7 @@ "version": "5.0.0", "description": "Discord middleware package of DraftBot", "main": "src/index.js", + "packageManager": "yarn@4.5.1", "engines": { "node": ">=18.19.0" }, @@ -18,8 +19,10 @@ "interface": "i18next-resources-for-ts interface -i ../Lang/en -o ./src/@types/resources.d.ts" }, "dependencies": { + "@discordjs/builders": "^1.9.0", "@types/i18next": "^13.0.0", "@types/node": "20.4.8", + "discord-api-types": "^0.37.103", "discord.js": "14.16.3", "i18next": "^23.16.4", "i18next-resources-for-ts": "^1.4.0", diff --git a/Discord/yarn.lock b/Discord/yarn.lock index 0a86af088..c64ef5139 100644 --- a/Discord/yarn.lock +++ b/Discord/yarn.lock @@ -6,11 +6,11 @@ __metadata: cacheKey: 10c0 "@babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.23.7, @babel/runtime@npm:^7.23.8, @babel/runtime@npm:^7.24.5": - version: 7.25.7 - resolution: "@babel/runtime@npm:7.25.7" + version: 7.26.0 + resolution: "@babel/runtime@npm:7.26.0" dependencies: regenerator-runtime: "npm:^0.14.0" - checksum: 10c0/86b7829d2fc9343714a9afe92757cf96c4dc799006ca61d73cda62f4b9e29bfa1ce36794955bc6cb4c188f5b10db832c949339895e1bbe81a69022d9d578ce29 + checksum: 10c0/12c01357e0345f89f4f7e8c0e81921f2a3e3e101f06e8eaa18a382b517376520cd2fa8c237726eb094dab25532855df28a7baaf1c26342b52782f6936b07c287 languageName: node linkType: hard @@ -94,20 +94,20 @@ __metadata: linkType: hard "@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": - version: 4.4.0 - resolution: "@eslint-community/eslint-utils@npm:4.4.0" + version: 4.4.1 + resolution: "@eslint-community/eslint-utils@npm:4.4.1" dependencies: - eslint-visitor-keys: "npm:^3.3.0" + eslint-visitor-keys: "npm:^3.4.3" peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - checksum: 10c0/7e559c4ce59cd3a06b1b5a517b593912e680a7f981ae7affab0d01d709e99cd5647019be8fafa38c350305bc32f1f7d42c7073edde2ab536c745e365f37b607e + checksum: 10c0/2aa0ac2fc50ff3f234408b10900ed4f1a0b19352f21346ad4cc3d83a1271481bdda11097baa45d484dd564c895e0762a27a8240be7a256b3ad47129e96528252 languageName: node linkType: hard "@eslint-community/regexpp@npm:^4.5.1, @eslint-community/regexpp@npm:^4.6.1": - version: 4.11.1 - resolution: "@eslint-community/regexpp@npm:4.11.1" - checksum: 10c0/fbcc1cb65ef5ed5b92faa8dc542e035269065e7ebcc0b39c81a4fe98ad35cfff20b3c8df048641de15a7757e07d69f85e2579c1a5055f993413ba18c055654f8 + version: 4.12.1 + resolution: "@eslint-community/regexpp@npm:4.12.1" + checksum: 10c0/a03d98c246bcb9109aec2c08e4d10c8d010256538dcb3f56610191607214523d4fb1b00aa81df830b6dffb74c5fa0be03642513a289c567949d3e550ca11cdf6 languageName: node linkType: hard @@ -188,9 +188,9 @@ __metadata: linkType: hard "@sapphire/async-queue@npm:^1.5.2, @sapphire/async-queue@npm:^1.5.3": - version: 1.5.3 - resolution: "@sapphire/async-queue@npm:1.5.3" - checksum: 10c0/fcf860cdde9bfbc1625dab5e11924caa871c9e741a8fb836193a519267179a4a1979604f88f8a40855c6b931bc82d489dcd11d034fea38bb8a4d9816ab821ed1 + version: 1.5.4 + resolution: "@sapphire/async-queue@npm:1.5.4" + checksum: 10c0/f63b9ed41a7209b927de707ae2a4ab66efdb938fdc1983f79c8b2deb7d65ef4d4be271fb695a33920a092236e2c19982af78e030697fc2b54bf3b110b43d76e7 languageName: node linkType: hard @@ -204,13 +204,20 @@ __metadata: languageName: node linkType: hard -"@sapphire/snowflake@npm:3.5.3, @sapphire/snowflake@npm:^3.5.3": +"@sapphire/snowflake@npm:3.5.3": version: 3.5.3 resolution: "@sapphire/snowflake@npm:3.5.3" checksum: 10c0/361b6a3e16eea4eb48b2608005ce397d4163065ccd84077059a0f609b97fb9cc52a173d7a64bbfce6f5d1e77be0f9704fd72ef64683a3dc7e455e9b4a1c90db1 languageName: node linkType: hard +"@sapphire/snowflake@npm:^3.5.3": + version: 3.5.4 + resolution: "@sapphire/snowflake@npm:3.5.4" + checksum: 10c0/1ca5d8036b5e3e441510d1645a3147b7114232c9c25072a8347e83ec937a0cab4e167a066503e31c37fdb19e6cf90e48be5e92aa327653f4c8c39c32876cfa9a + languageName: node + linkType: hard + "@types/i18next@npm:^13.0.0": version: 13.0.0 resolution: "@types/i18next@npm:13.0.0" @@ -228,11 +235,11 @@ __metadata: linkType: hard "@types/node@npm:*": - version: 22.7.6 - resolution: "@types/node@npm:22.7.6" + version: 22.8.7 + resolution: "@types/node@npm:22.8.7" dependencies: - undici-types: "npm:~6.19.2" - checksum: 10c0/d4406a63afce981c363fb1d1954aaf1759ad2d487c0833ebf667565ea4e45ff217d6fab4b5343badbdeccdf9d2e4a0841d633e0c929ceabcb33c288663dd0c73 + undici-types: "npm:~6.19.8" + checksum: 10c0/14372885db80059ed6e92c320b2bcd8f7dc271698adce11f51aa0f424a3f82aa1749a4f66321b87043791b894346b2458d514cbb65ce70167c2fd8a78a124947 languageName: node linkType: hard @@ -244,12 +251,12 @@ __metadata: linkType: hard "@types/readable-stream@npm:^4.0.0, @types/readable-stream@npm:^4.0.5": - version: 4.0.15 - resolution: "@types/readable-stream@npm:4.0.15" + version: 4.0.18 + resolution: "@types/readable-stream@npm:4.0.18" dependencies: "@types/node": "npm:*" safe-buffer: "npm:~5.1.1" - checksum: 10c0/7424f747dd62e5c0f686a447e891064b1efdce44a7d55304ac4690b4d240ad194481083f0b07419d5e0295c79d81f0db2a677482c50954c1bbc948cbd40d8725 + checksum: 10c0/641e0e91b9ecfeed72f7509089f25923e06e19e79ed36f962785c41c07b0c9ecb2ecfdf6d290a101b9b5a669a3b89ee3aff0cad57b66a05e2a30cd199052e3e1 languageName: node linkType: hard @@ -261,11 +268,11 @@ __metadata: linkType: hard "@types/ws@npm:^8.5.10, @types/ws@npm:^8.5.9": - version: 8.5.12 - resolution: "@types/ws@npm:8.5.12" + version: 8.5.13 + resolution: "@types/ws@npm:8.5.13" dependencies: "@types/node": "npm:*" - checksum: 10c0/3fd77c9e4e05c24ce42bfc7647f7506b08c40a40fe2aea236ef6d4e96fc7cb4006a81ed1b28ec9c457e177a74a72924f4768b7b4652680b42dfd52bc380e15f9 + checksum: 10c0/a5430aa479bde588e69cb9175518d72f9338b6999e3b2ae16fc03d3bdcff8347e486dc031e4ed14601260463c07e1f9a0d7511dfc653712b047c439c680b0b34 languageName: node linkType: hard @@ -425,11 +432,11 @@ __metadata: linkType: hard "acorn@npm:^8.9.0": - version: 8.13.0 - resolution: "acorn@npm:8.13.0" + version: 8.14.0 + resolution: "acorn@npm:8.14.0" bin: acorn: bin/acorn - checksum: 10c0/f35dd53d68177c90699f4c37d0bb205b8abe036d955d0eb011ddb7f14a81e6fd0f18893731c457c1b5bd96754683f4c3d80d9a5585ddecaa53cdf84e0b3d68f7 + checksum: 10c0/6d4ee461a7734b2f48836ee0fbb752903606e576cc100eb49340295129ca0b452f3ba91ddd4424a1d4406a98adfb2ebb6bd0ff4c49d7a0930c10e462719bbfd7 languageName: node linkType: hard @@ -665,6 +672,13 @@ __metadata: languageName: node linkType: hard +"discord-api-types@npm:^0.37.103": + version: 0.37.103 + resolution: "discord-api-types@npm:0.37.103" + checksum: 10c0/c64858138f5a700c2b9205f44b0d5b0f02d437c6eeb9699e3565133a5e08a0ff80b17df4e4740e7883b556955789953cd4b1456316931f4e8f87888efcfb5884 + languageName: node + linkType: hard + "discord.js@npm:14.16.3": version: 14.16.3 resolution: "discord.js@npm:14.16.3" @@ -698,10 +712,12 @@ __metadata: version: 0.0.0-use.local resolution: "draftbot_discord_middleware@workspace:." dependencies: + "@discordjs/builders": "npm:^1.9.0" "@types/i18next": "npm:^13.0.0" "@types/node": "npm:20.4.8" "@typescript-eslint/eslint-plugin": "npm:^6.21.0" "@typescript-eslint/parser": "npm:^6.21.0" + discord-api-types: "npm:^0.37.103" discord.js: "npm:14.16.3" eslint: "npm:^8.56.0" eslint-config-google: "npm:0.14.0" @@ -742,7 +758,7 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": +"eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" checksum: 10c0/92708e882c0a5ffd88c23c0b404ac1628cf20104a108c745f240a13c332a11aac54f49a22d5762efbffc18ecbc9a580d1b7ad034bf5f3cc3307e5cbff2ec9820 @@ -1048,16 +1064,7 @@ __metadata: languageName: node linkType: hard -"i18next@npm:*": - version: 23.16.0 - resolution: "i18next@npm:23.16.0" - dependencies: - "@babel/runtime": "npm:^7.23.2" - checksum: 10c0/17b40d125befec02e2c8069e658ea54d36ee46fab9e05bbeed93bb5ec75fab8bd334139372652d5df491147a124447a8ee1b78ccba726b7d61b1c03e84c7b6c5 - languageName: node - linkType: hard - -"i18next@npm:^23.16.4": +"i18next@npm:*, i18next@npm:^23.16.4": version: 23.16.4 resolution: "i18next@npm:23.16.4" dependencies: @@ -1692,11 +1699,11 @@ __metadata: linkType: hard "ts-api-utils@npm:^1.0.1": - version: 1.3.0 - resolution: "ts-api-utils@npm:1.3.0" + version: 1.4.0 + resolution: "ts-api-utils@npm:1.4.0" peerDependencies: typescript: ">=4.2.0" - checksum: 10c0/f54a0ba9ed56ce66baea90a3fa087a484002e807f28a8ccb2d070c75e76bde64bd0f6dce98b3802834156306050871b67eec325cb4e918015a360a3f0868c77c + checksum: 10c0/1b2bfa50ea52771d564bb143bb69010d25cda03ed573095fbac9b86f717012426443af6647e00e3db70fca60360482a30c1be7cf73c3521c321f6bf5e3594ea0 languageName: node linkType: hard @@ -1708,9 +1715,9 @@ __metadata: linkType: hard "tslib@npm:^2.6.2, tslib@npm:^2.6.3": - version: 2.8.0 - resolution: "tslib@npm:2.8.0" - checksum: 10c0/31e4d14dc1355e9b89e4d3c893a18abb7f90b6886b089c2da91224d0a7752c79f3ddc41bc1aa0a588ac895bd97bb99c5bc2bfdb2f86de849f31caeb3ba79bbe5 + version: 2.8.1 + resolution: "tslib@npm:2.8.1" + checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62 languageName: node linkType: hard @@ -1764,7 +1771,7 @@ __metadata: languageName: node linkType: hard -"undici-types@npm:~6.19.2": +"undici-types@npm:~6.19.8": version: 6.19.8 resolution: "undici-types@npm:6.19.8" checksum: 10c0/078afa5990fba110f6824823ace86073b4638f1d5112ee26e790155f481f2a868cc3e0615505b6f4282bdf74a3d8caad715fd809e870c2bb0704e3ea6082f344 diff --git a/Lib/.yarnrc.yml b/Lib/.yarnrc.yml new file mode 100644 index 000000000..5f683b5ea --- /dev/null +++ b/Lib/.yarnrc.yml @@ -0,0 +1,3 @@ +enableGlobalCache: false + +nodeLinker: pnp diff --git a/Lib/package.json b/Lib/package.json index 838b30ca3..a692dfdef 100644 --- a/Lib/package.json +++ b/Lib/package.json @@ -2,6 +2,7 @@ "name": "draftbot_lib", "version": "5.0.0", "description": "Lib package of DaftBot, used my multiple module", + "packageManager": "yarn@4.5.1", "scripts": { "start": "tsc && node dist/index.js", "test": "tsc && jest dist/test", diff --git a/Lib/yarn.lock b/Lib/yarn.lock index deb8dc575..71ae816e7 100644 --- a/Lib/yarn.lock +++ b/Lib/yarn.lock @@ -6,20 +6,20 @@ __metadata: cacheKey: 10c0 "@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": - version: 4.4.0 - resolution: "@eslint-community/eslint-utils@npm:4.4.0" + version: 4.4.1 + resolution: "@eslint-community/eslint-utils@npm:4.4.1" dependencies: - eslint-visitor-keys: "npm:^3.3.0" + eslint-visitor-keys: "npm:^3.4.3" peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - checksum: 10c0/7e559c4ce59cd3a06b1b5a517b593912e680a7f981ae7affab0d01d709e99cd5647019be8fafa38c350305bc32f1f7d42c7073edde2ab536c745e365f37b607e + checksum: 10c0/2aa0ac2fc50ff3f234408b10900ed4f1a0b19352f21346ad4cc3d83a1271481bdda11097baa45d484dd564c895e0762a27a8240be7a256b3ad47129e96528252 languageName: node linkType: hard "@eslint-community/regexpp@npm:^4.5.1, @eslint-community/regexpp@npm:^4.6.1": - version: 4.11.1 - resolution: "@eslint-community/regexpp@npm:4.11.1" - checksum: 10c0/fbcc1cb65ef5ed5b92faa8dc542e035269065e7ebcc0b39c81a4fe98ad35cfff20b3c8df048641de15a7757e07d69f85e2579c1a5055f993413ba18c055654f8 + version: 4.12.1 + resolution: "@eslint-community/regexpp@npm:4.12.1" + checksum: 10c0/a03d98c246bcb9109aec2c08e4d10c8d010256538dcb3f56610191607214523d4fb1b00aa81df830b6dffb74c5fa0be03642513a289c567949d3e550ca11cdf6 languageName: node linkType: hard @@ -260,11 +260,11 @@ __metadata: linkType: hard "acorn@npm:^8.9.0": - version: 8.13.0 - resolution: "acorn@npm:8.13.0" + version: 8.14.0 + resolution: "acorn@npm:8.14.0" bin: acorn: bin/acorn - checksum: 10c0/f35dd53d68177c90699f4c37d0bb205b8abe036d955d0eb011ddb7f14a81e6fd0f18893731c457c1b5bd96754683f4c3d80d9a5585ddecaa53cdf84e0b3d68f7 + checksum: 10c0/6d4ee461a7734b2f48836ee0fbb752903606e576cc100eb49340295129ca0b452f3ba91ddd4424a1d4406a98adfb2ebb6bd0ff4c49d7a0930c10e462719bbfd7 languageName: node linkType: hard @@ -474,7 +474,7 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": +"eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" checksum: 10c0/92708e882c0a5ffd88c23c0b404ac1628cf20104a108c745f240a13c332a11aac54f49a22d5762efbffc18ecbc9a580d1b7ad034bf5f3cc3307e5cbff2ec9820 @@ -1152,11 +1152,11 @@ __metadata: linkType: hard "ts-api-utils@npm:^1.0.1": - version: 1.3.0 - resolution: "ts-api-utils@npm:1.3.0" + version: 1.4.0 + resolution: "ts-api-utils@npm:1.4.0" peerDependencies: typescript: ">=4.2.0" - checksum: 10c0/f54a0ba9ed56ce66baea90a3fa087a484002e807f28a8ccb2d070c75e76bde64bd0f6dce98b3802834156306050871b67eec325cb4e918015a360a3f0868c77c + checksum: 10c0/1b2bfa50ea52771d564bb143bb69010d25cda03ed573095fbac9b86f717012426443af6647e00e3db70fca60360482a30c1be7cf73c3521c321f6bf5e3594ea0 languageName: node linkType: hard From b094c25c75f42a283f9d4de129cdb1fb67b21b9a Mon Sep 17 00:00:00 2001 From: BastLast Date: Mon, 4 Nov 2024 00:17:29 +0100 Subject: [PATCH 2/4] gitignore fix ? --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 33f2a2d7b..9701249eb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ .run mqtt5 **/.yarn -/*/.pnp.cjs -/*/.pnp.loader.mjs \ No newline at end of file +*/.pnp.cjs +*/.pnp.loader.mjs \ No newline at end of file From af1486f5ba35e622acaa7754b726333189510146 Mon Sep 17 00:00:00 2001 From: BastLast Date: Mon, 4 Nov 2024 00:46:51 +0100 Subject: [PATCH 3/4] updated doc --- README.md | 84 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 460c0dd70..b015f60fd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,13 @@
Couronne DraftBot -DraftBot is a text adventure game. The story takes place in a medieval world, and the player embodies an adventurer who wants to win a competition launched by the king, to win the princess' hand. To achieve this, he must travel and earn points by going through a lot of danger, including thieves, wilderness, and scary children. Every few hours, the player can follow their adventure through "reports" and interact with a multiple choice system, using reactions below the report. Each choice has multiple issues, which could hurt the character, heal them, or even give them some stuff. During the journey, they earn money, equipments, and points, and can use them to buy potions, items or effects in the shop, fight other players, and ascend the leaderboard. +DraftBot is a text adventure game. The story takes place in a medieval world, and the player embodies an adventurer who +wants to win a competition launched by the king, to win the princess' hand. To achieve this, he must travel and earn +points by going through a lot of danger, including thieves, wilderness, and scary children. Every few hours, the player +can follow their adventure through "reports" and interact with a multiple choice system, using reactions below the +report. Each choice has multiple issues, which could hurt the character, heal them, or even give them some stuff. During +the journey, they earn money, equipments, and points, and can use them to buy potions, items, or effects in the shop, +fight other players, and ascend the leaderboard. [![](https://img.shields.io/discord/429765017332613120.svg)](https://discord.gg/5JqrMtZ) [![](https://img.shields.io/github/stars/BastLast/DraftBot-A-Discord-Adventure.svg?label=Stars&style=social)](https://github.com/BastLast/DraftBot-A-Discord-Adventure) @@ -10,9 +16,10 @@ DraftBot is a text adventure game. The story takes place in a medieval world, an
-# How to play the game ? +# How to play the game? -DraftBot is originally a discord bot and has evolved to become a fully fledged game that you can play either through discord or through other clients. +DraftBot is originally a discord bot and has evolved to become a fully fledged game that you can play either through +discord or through other clients. You can start playing by visiting our website: https://draftbot.com @@ -26,6 +33,7 @@ skills. Bot support team will prioritize players of the main instance and will o will fix bugs you report, but we will not teach you how to code a discord bot.** Please do not copy and paste the commands we provide in this readme without : + - Understanding the command - Replacing the relevant parts with your data - Having read the whole document @@ -34,7 +42,8 @@ Please do not copy and paste the commands we provide in this readme without : ## BETA BRANCH WARNING -You are here in the not yet released v5 of DraftBot. Compared to previous versions of the game, we migrated to microservices. Cloning this repository will allow you to get all the services necessary to run draftbot v5. +You are here in the not yet released v5 of DraftBot. Compared to previous versions of the game, we migrated to +microservices. Cloning this repository will allow you to get all the services necessary to run draftbot v5. This work is still in progress, please do not open issues about bugs faced in this version of the software. @@ -42,44 +51,39 @@ This work is still in progress, please do not open issues about bugs faced in th ### Requirements -This list contains all the software programs necessary to run DraftBot. Our start guide will walk you through the installation process +This list contains all the software programs necessary to run DraftBot. Our start guide will walk you through the +installation process -- Docker -- Any IDE -- git -- node (see package.json of any service for the relevant version) +- Docker desktop + - 🐧: https://docs.docker.com/engine/install/ + - 🪟: https://docs.docker.com/docker-for-windows/install/ +- Webstorm + - (or any other IDE, but we recommend Webstorm since our team uses it and we provide configurations for it) +- Git - nvm (not mandatory but highly recommended) -- yarn + - 🪟: https://github.com/coreybutler/nvm-windows + - 🐧: https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating +- Node + - (see package.json of any service for the relevant version) +- Yarn + - (see package.json of any service for the relevant version) + - https://yarnpkg.com/getting-started/install ### Start guide -This guide will help you run DraftBot on your computer. We provide instructions for Linux, MacOS (🐧) and Windows (🪟). If not specified, the command is the same for all OS. -Please do not skip any step of this guide, otherwise, the following commands will not work. - -1. Install tools - -```sh -# Install git -apt-get install git # 🐧 -winget install git # 🪟 -# Install yarn with npm -npm install --global yarn -``` +This guide will help you run DraftBot on your computer. We provide instructions for Linux, MacOS (🐧) and Windows (🪟). If +not specified, the command is the same for all OS. +Please do not skip any step of this guide; otherwise, the following commands will not work. 2. Setup projects +Open the project in webstorm and use our "yarn install all" configuration to install all the dependencies. +Alternatively, you can run the following commands in the terminal (starting from the root of the project): + ```sh -# Clone the repository -git clone https://github.com/BastLast/DraftBot-A-Discord-Adventure Draftbot -cd Draftbot -export DRAFTBOT_ROOT=$PWD # 🐧 -Set-Variable DRAFTBOT_ROOT $PWD # 🪟 -# Switch to the DraftBot v5 branch -git checkout draftbot-v5 -# Install dependencies in projects -cd $DRAFTBOT_ROOT/Core && yarn install -cd $DRAFTBOT_ROOT/Discord && yarn install -cd $DRAFTBOT_ROOT/Lib && yarn install +cd Lib && yarn install +cd ../Discord && yarn install +cd ../Core && yarn install ``` 3. Setup database, Keycloak and an MQTT broker @@ -91,6 +95,7 @@ For Keycloak, follow instructions in [README.md](./keycloak/README.md) in the ke #### Database For the database, you can use a mariadb container with the following command: + ```sh # Run mariadb database with docker docker run -d --name mariadb -e MARIADB_USER=draftbot -e MARIADB_PASSWORD=secret_password -e MARIADB_ROOT_PASSWORD=super_secret_password -v /path/to/volumes/mariadb:/var/lib/mysql -p 3306:3306 mariadb:latest @@ -100,7 +105,8 @@ docker run -d --name mariadb -e MARIADB_USER=draftbot -e MARIADB_PASSWORD=secret You can use any MQTT broker, but we recommend using Mosquitto. -You can use [this guide](https://github.com/sukesh-ak/setup-mosquitto-with-docker) to install it with docker. Step 1, 2, 3 and 5 are enough to have a working MQTT broker. +You can use [this guide](https://github.com/sukesh-ak/setup-mosquitto-with-docker) to install it with docker. Step 1, 2, +3, and 5 are enough to have a working MQTT broker. The following config file can be used: @@ -124,7 +130,9 @@ cp $DRAFTBOT_ROOT/Discord/config/config.default.toml $DRAFTBOT_ROOT/Discord/conf touch $DRAFTBOT_ROOT/Core/config/keycloak.toml # 🐧 New-Item $DRAFTBOT_ROOT/Core/config/keycloak.toml # 🪟 ``` -You can copy and paste the content of the keycloak section from the config.toml file in the Discord folder in the keycloak.toml file. + +You can copy and paste the content of the keycloak section from the config.toml file in the Discord folder in the +keycloak.toml file. 5. Run projects @@ -136,8 +144,10 @@ cd $DRAFTBOT_ROOT/Discord && yarn start ``` You can set up npm launch scripts to make the start easier. -From now on you should be able to start the bot by running `yarn start` in the Core and Discord folders while having the database and keycloak running. -Starting order is important, start with the database container and keycloak, then the Core and finally the Discord module. +From now on you should be able to start the bot by running `yarn start` in the Core and Discord folders while having the +database and keycloak running. +Starting order is important, start with the database container and keycloak, then the Core and finally the Discord +module. # Screenshots From 12871e1a2cd8a5478e8d4262d30ea4444c9d5736 Mon Sep 17 00:00:00 2001 From: BastLast Date: Mon, 4 Nov 2024 01:21:15 +0100 Subject: [PATCH 4/4] test fix github actions #2640 fix github flow #2640 fix github flow #2640 improved readme #2640 --- .github/workflows/core-module.yml | 16 +++++++++++----- .github/workflows/discord-module.yml | 16 ++++++++++++---- .github/workflows/lib-module.yml | 23 +++++++++++++++-------- README.md | 4 ++-- 4 files changed, 40 insertions(+), 19 deletions(-) diff --git a/.github/workflows/core-module.yml b/.github/workflows/core-module.yml index 611cc4b76..08b15b5e5 100644 --- a/.github/workflows/core-module.yml +++ b/.github/workflows/core-module.yml @@ -1,8 +1,7 @@ name: Core module - on: pull_request: - branches: + branches: - draftbot-v5 paths: - Core/** @@ -20,15 +19,22 @@ jobs: with: node-version: '18' - # Repeat the caching step and ESLint check for the Core subproject + - name: Setup Yarn + run: | + corepack enable + yarn set version stable + + # Cache Yarn dependencies for Core module - name: Cache Core dependencies uses: actions/cache@v3 with: - path: ./Core/node_modules + path: | + ./Core/.yarn/cache + ./Core/.pnp.cjs key: ${{ runner.os }}-core-dependencies-${{ hashFiles('./Core/yarn.lock') }} - name: Install dependencies and Run ESLint in Core folder working-directory: ./Core run: | - yarn install + yarn install yarn eslint diff --git a/.github/workflows/discord-module.yml b/.github/workflows/discord-module.yml index 9285cf00a..3f27c4fd6 100644 --- a/.github/workflows/discord-module.yml +++ b/.github/workflows/discord-module.yml @@ -1,7 +1,7 @@ name: Discord module on: pull_request: - branches: + branches: - draftbot-v5 paths: - Discord/** @@ -19,15 +19,23 @@ jobs: with: node-version: '18' - # Install and cache dependencies for the Discord subproject + # Setup Yarn + - name: Setup Yarn + run: | + corepack enable + yarn set version stable + + # Cache Yarn dependencies for Discord module - name: Cache Discord dependencies uses: actions/cache@v3 with: - path: ./Discord/node_modules + path: | + ./Discord/.yarn/cache + ./Discord/.pnp.cjs key: ${{ runner.os }}-discord-dependencies-${{ hashFiles('./Discord/yarn.lock') }} - name: Install dependencies and Run ESLint in Discord folder working-directory: ./Discord run: | - yarn install + yarn install yarn eslint diff --git a/.github/workflows/lib-module.yml b/.github/workflows/lib-module.yml index 07721dce5..871480228 100644 --- a/.github/workflows/lib-module.yml +++ b/.github/workflows/lib-module.yml @@ -1,10 +1,9 @@ name: Lib module - on: pull_request: - branches: + branches: - draftbot-v5 - paths: + paths: - Lib/** jobs: @@ -20,15 +19,23 @@ jobs: with: node-version: '18' - # Repeat the caching step and ESLint check for the Lib subproject - - name: Cache Lib dependencies + # Setup Yarn stable + - name: Setup Yarn + run: | + corepack enable + yarn set version stable + + # Cache Yarn dependencies + - name: Cache Yarn dependencies uses: actions/cache@v3 with: - path: ./Lib/node_modules - key: ${{ runner.os }}-lib-dependencies-${{ hashFiles('./Lib/yarn.lock') }} + path: | + ./Lib/.yarn/cache + ./Lib/.pnp.cjs + key: ${{ runner.os }}-yarn-${{ hashFiles('./Lib/yarn.lock') }} - name: Install dependencies and Run ESLint in Lib folder working-directory: ./Lib run: | - yarn install + yarn install yarn eslint diff --git a/README.md b/README.md index b015f60fd..5625f9439 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ installation process - Yarn - (see package.json of any service for the relevant version) - https://yarnpkg.com/getting-started/install + - (Beware, if you do this at the root of the project, this will create a new package.json file, you can delete this file) ### Start guide @@ -77,8 +78,7 @@ Please do not skip any step of this guide; otherwise, the following commands wil 2. Setup projects -Open the project in webstorm and use our "yarn install all" configuration to install all the dependencies. -Alternatively, you can run the following commands in the terminal (starting from the root of the project): +Run yarn install in each project folder: ```sh cd Lib && yarn install