Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ jobs:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Reconfigure git to use HTTP authentication (npm ci bug workaround)
- name: Reconfigure git to use HTTP authentication
run: git config --global url."https://github.com/".insteadOf ssh://git@github.com/
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: run tests
run: npm run test run
run: pnpm run test run
- name: build
run: npm run build
run: pnpm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Auto generated files
src/versionInfo.ts
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
minimum-release-age=7200
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ The current CI pipeline uses Node 19.x and 20.x. These versions are guaranteed t

You need [the server-side program](https://github.com/yncat/dfg-server) .

First, clone the server-side program. Run `npm ci` to install dependencies, then run `npm start` to start serving. It starts waiting for connections at `localhost:2567` .
First, clone the server-side program. Run `pnpm install --frozen-lockfile` to install dependencies, then run `pnpm start` to start serving. It starts waiting for connections at `localhost:2567` .

Next, clone this repository, run `npm run ci` then `npm start` . While the development server is running, the game can be accessed by requesting to `http://localhost:5173/softs/dfg/game/` .
Next, clone this repository, run `pnpm install` then `pnpm start` . While the development server is running, the game can be accessed by requesting to `http://localhost:5173/softs/dfg/game/` .

The development server supports hot-reloading. When you make changes to the source, it will be automatically applied. When you have compilation errors, your browser window will display it for you.

## Testing

Run `npm run test` to run tests.
Run `pnpm test` to run tests.

## Building

Run `npm run build` to make an optimized production build. If you're trying to host the game somewhere, you need to modify package.json since the homepage field now points to my website domain.
Run `pnpm build` to make an optimized production build. If you're trying to host the game somewhere, you need to modify package.json since the homepage field now points to my website domain.

If you build the app with default setting, it will try to connect to localhost. In order to change endpoint for production, create `.env.production.local` inside the project root directory, and specify like this.

Expand All @@ -36,7 +36,7 @@ VITE_SERVER_ADDRESS=wss://example.com:portnum

## Adding sounds

If you want to add sounds, you first need to place it as a wave format in dev/sounds_wave directory. Then, run `npm run sounds:build` to convert them into supported formats. For file conversion, you must have ffmpeg installed in your system.
If you want to add sounds, you first need to place it as a wave format in dev/sounds_wave directory. Then, run `pnpm sounds:build` to convert them into supported formats. For file conversion, you must have ffmpeg installed in your system.

In order to use the added sounds inside the game, you must define sound events in `src/logic/sound.ts` . The definition is very straitforward.

Expand Down
Loading