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
3 changes: 0 additions & 3 deletions .browserslistrc

This file was deleted.

31 changes: 0 additions & 31 deletions .eslintrc.js

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22, 24]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm test
- run: npx eslint .
- run: npx prettier --check .
- run: npm run build
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
.DS_Store
node_modules
/dist

/tests/e2e/videos/
/tests/e2e/screenshots/

/dev-dist
/coverage
.eslintcache

# local env files
.env.local
Expand All @@ -24,3 +23,6 @@ pnpm-debug.log*
*.njsproj
*.sln
*.sw?

# Claude
.claude/plans*
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit "$1"
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run prettier:staged && npm run test:release
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.yml
.claude
.idea
node_modules
coverage
dist
dev-dist
public
package-lock.json
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"singleQuote": true,
"bracketSpacing": true,
"arrowParens": "always",
"trailingComma": "all",
"tabWidth": 2,
"printWidth": 120,
"endOfLine": "lf"
}
49 changes: 32 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,50 @@ This is a demo how to use the [quaire-library](https://github.com/devCrossNet/qu

**_Fell free to create pull-requests with your very own Game story!_**

## Requirements

- Node.js >= 22.12
- npm 11

## Project setup
```

```shell
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```
### Start the development server

### Compiles and minifies for production
```shell
npm run dev
```

### Build for production

```shell
npm run build
npm run preview
```

### Run your unit tests
```
npm run test:unit
```
### Run the tests

### Run your end-to-end tests
```
npm run test:e2e
```shell
npm test
```

### Lints and fixes files
```
### Type check, lint, and format

```shell
npm run typecheck
npm run lint
npm run prettier
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
`npm run test:release` runs all checks. The pre-commit hook runs it, too.
Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/).

## Create your own game

A game is a list of [quaire](https://github.com/devCrossNet/quaire) question definitions in `src/games/<game-id>/index.ts`.
Besides the built-in types (e.g. `SINGLE_SELECT` and `INPUT`), games can use the `DIALOG` type from `src/quaire.ts`.
A dialog prints its `lines`, and `<%= key %>` inserts a former answer.
Add a test with `validateDefinition()` to find mistakes in your data, see `tests/unit/games`.
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

1 change: 1 addition & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] };
3 changes: 0 additions & 3 deletions cypress.json

This file was deleted.

49 changes: 49 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import eslint from '@eslint/js';
import { defineConfig } from 'eslint/config';
import prettier from 'eslint-config-prettier';
import vue from 'eslint-plugin-vue';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default defineConfig(
{
ignores: [
'**/.claude/**',
'**/.github/**',
'**/coverage/**',
'**/dist/**',
'**/dev-dist/**',
'**/node_modules/**',
'commitlint.config.mjs',
],
},
eslint.configs.recommended,
tseslint.configs.recommended,
vue.configs['flat/essential'],
prettier,
{
files: ['**/*.vue'],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
},
},
},
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.vitest,
},
},
rules: {
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/naming-convention': [
'error',
{ selector: 'typeLike', format: ['PascalCase'], custom: { regex: '^I[A-Z]', match: false } },
],
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true, argsIgnorePattern: '^_' }],
},
},
);
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta name="theme-color" content="#000000" />
<link rel="icon" href="/favicon.ico" />
<link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png" />
<link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png" />
<link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#000000" />
<meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png" />
<meta name="msapplication-TileColor" content="#000000" />
<title>Text Adventures</title>
</head>
<body>
<noscript>
<strong>
We're sorry but Text Adventures doesn't work properly without JavaScript enabled. Please enable it to continue.
</strong>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
6 changes: 0 additions & 6 deletions jest.config.js

This file was deleted.

12 changes: 12 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[build]
command = "npm run build"
publish = "dist"

[build.environment]
NODE_VERSION = "22"

# single page app: vue-router handles all routes, e.g. /game/:id
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
Loading
Loading