Skip to content

Commit

Permalink
refactor: extract bubble-game engine as independent package
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Jan 20, 2024
1 parent a637b4e commit 952386b
Show file tree
Hide file tree
Showing 16 changed files with 718 additions and 547 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
"mfm-js": "0.24.0",
"misskey-js": "workspace:*",
"misskey-reversi": "workspace:*",
"misskey-bubble-game": "workspace:*",
"photoswipe": "5.4.3",
"punycode": "2.3.1",
"rollup": "4.9.1",
"sanitize-html": "2.11.0",
"sass": "1.69.5",
"seedrandom": "^3.0.5",
"shiki": "0.14.7",
"strict-event-emitter-types": "2.0.0",
"textarea-caret": "3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/drop-and-fusion.game.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ SPDX-License-Identifier: AGPL-3.0-only
import { computed, onDeactivated, onMounted, onUnmounted, ref, shallowRef, watch } from 'vue';
import * as Matter from 'matter-js';
import * as Misskey from 'misskey-js';
import { DropAndFusionGame, Mono } from 'misskey-bubble-game';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import MkRippleEffect from '@/components/MkRippleEffect.vue';
import * as os from '@/os.js';
Expand All @@ -193,7 +194,6 @@ import { i18n } from '@/i18n.js';
import { useInterval } from '@/scripts/use-interval.js';
import { apiUrl } from '@/config.js';
import { $i } from '@/account.js';
import { DropAndFusionGame, Mono } from '@/scripts/drop-and-fusion-engine.js';
import * as sound from '@/scripts/sound.js';
import MkRange from '@/components/MkRange.vue';
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function getConfig(): UserConfig {

// https://vitejs.dev/guide/dep-pre-bundling.html#monorepos-and-linked-dependencies
optimizeDeps: {
include: ['misskey-js', 'misskey-reversi'],
include: ['misskey-js', 'misskey-reversi', 'misskey-bubble-game'],
},

build: {
Expand Down Expand Up @@ -135,7 +135,7 @@ export function getConfig(): UserConfig {

// https://vitejs.dev/guide/dep-pre-bundling.html#monorepos-and-linked-dependencies
commonjsOptions: {
include: [/misskey-js/, /misskey-reversi/, /node_modules/],
include: [/misskey-js/, /misskey-reversi/, /misskey-bubble-game/, /node_modules/],
},
},

Expand Down
7 changes: 7 additions & 0 deletions packages/misskey-bubble-game/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
/built
/coverage
/.eslintrc.js
/jest.config.ts
/test
/test-d
9 changes: 9 additions & 0 deletions packages/misskey-bubble-game/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
extends: [
'../shared/.eslintrc.js',
],
};
31 changes: 31 additions & 0 deletions packages/misskey-bubble-game/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "misskey-bubble-game",
"version": "0.0.1",
"main": "./built/index.js",
"types": "./built/index.d.ts",
"scripts": {
"build": "tsc",
"watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run build\"",
"eslint": "eslint . --ext .js,.jsx,.ts,.tsx",
"typecheck": "tsc --noEmit",
"lint": "pnpm typecheck && pnpm eslint"
},
"devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0",
"@types/matter-js": "0.19.6",
"@types/node": "20.11.5",
"@types/seedrandom": "3.0.8",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"eslint": "8.56.0",
"typescript": "5.3.3"
},
"files": [
"built"
],
"dependencies": {
"eventemitter3": "5.0.1",
"matter-js": "0.19.0",
"seedrandom": "3.0.5"
}
}
Loading

0 comments on commit 952386b

Please sign in to comment.