Skip to content

Commit

Permalink
Merge pull request #145 from SkewedAspect/vue3
Browse files Browse the repository at this point in the history
Migrate to Vue3
  • Loading branch information
Morgul authored Aug 20, 2023
2 parents e69ae9c + 8871b5e commit 4bde767
Show file tree
Hide file tree
Showing 241 changed files with 17,578 additions and 20,988 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
// Bad Practices
'@typescript-eslint/camelcase': 'off', // TODO: Maybe turn this on in the future?
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-shadow': 'error',
'curly': 'error',
'no-await-in-loop': 'error',
'no-eval': 'error',
Expand Down Expand Up @@ -48,7 +49,7 @@ module.exports = {
'no-useless-return': 'warn',
'require-await': 'off',
'no-mixed-operators': 'warn',
'no-shadow': 'warn',
'no-shadow': 'off',

// Style
'@typescript-eslint/type-annotation-spacing': [ 'warn', { before: true, after: true } ],
Expand Down Expand Up @@ -172,7 +173,7 @@ module.exports = {
rules: {
'no-dupe-class-members': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-returns-type': 'off'
'jsdoc/require-returns-type': 'off',
}
},
{
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v1
Expand All @@ -19,7 +19,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
yarn
yarn lint:fix
npm install
npm run lint
env:
CI: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# IntelliJ artifacts
.idea

# Local artifacts
.env
.env.*

# Build artifacts
.cache
dist
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Bundle Stage - Do all our bundling of assets
#-----------------------------------------------------------------------------------------------------------------------

FROM node:16 as bundle-builder
FROM node:18 as bundle-builder

RUN mkdir -p /app
WORKDIR /app
Expand All @@ -16,7 +16,7 @@ RUN npm run build
# NPM Stage - Install production packages and clean cache
#-----------------------------------------------------------------------------------------------------------------------

FROM node:16-alpine as npm-builder
FROM node:18-alpine as npm-builder

COPY --from=bundle-builder /app /app

Expand All @@ -28,7 +28,7 @@ RUN npm ci --no-fund --production
# Final Docker
#-----------------------------------------------------------------------------------------------------------------------

FROM node:16-alpine
FROM node:18-alpine
EXPOSE 5678

MAINTAINER Christopher S. Case <chris.case@g33xnexus.com>
Expand Down
16 changes: 15 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,21 @@ RPGKeeper is, and always will be an open source project. We want to encourage de

Before getting started you will need the following installed:

* NodeJS >= v14
* NodeJS >= v16

You will also need to add a .env file to the root of the project. This file should contain the following:

```dotenv
# Defaults for local development
SESSION_SECRET='etched municipality unconscionably fribble *&^%$## 88'
CLIENT_ID='712153107187-8e00g8d18nbk5esiffhkrbtr12vktlvq.apps.googleusercontent.com'
CLIENT_SECRET='hOsFjUL-f_yky8djy1OSuvmp'
SERVER_PORT=5678
```

You will want to replace these with your own values (especially `SECRET_SESSION` and `MAILGUN_KEY`). You can get a
`CLIENT_ID` and `CLIENT_SECRET` by creating a new project in the
[Google Developer Console](https://console.developers.google.com/).

### Running

Expand Down
37 changes: 0 additions & 37 deletions config.ts

This file was deleted.

21 changes: 21 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#-----------------------------------------------------------------------------------------------------------------------
# Configuration for RPGKeeper
#-----------------------------------------------------------------------------------------------------------------------

overrideAuth: false
secret: $SESSION_SECRET
key: 'rpgk_session'
auth:
google:
clientID: $CLIENT_ID
clientSecret: $CLIENT_SECRET
http:
secure: false,
port: $SERVER_PORT
database:
client: 'better-sqlite3'
connection:
filename: './db/rpgk.db'
useNullAsDefault: true

#-----------------------------------------------------------------------------------------------------------------------
9 changes: 4 additions & 5 deletions docs/revamp.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@ I want to rework a lot of the infrastructure so that it's easier to add things t
* [X] Switch to Bootstrap v4 (and Bootstrap-Vue)
* [X] Add a base model class that knows if it's dirty ~~(Proxy-based)~~
* [X] Use RxJS to manage state; the current character becomes an observable
* [ ] Evaluate using `vuex` instead of RxJS, and the special models.
* [X] ~~Evaluate using `vuex` instead of RxJS, and the special models.~~
* [X] Move all resource access (like loading characters, systems, etc) into 'resource-access'
* [X] Move all state holding and application logic to 'managers'
* [X] Make components very, very dumb. They only have their own state, and logic relevant to their display.
* [X] Move to ~~webpack~~ parcel.
* [ ] Implement `socket.io` so open pages stay in sync as changes are made. (Think, GM opening character pages.)
* [X] Implement `socket.io` so open pages stay in sync as changes are made. (Think, GM opening character pages.)
* [X] Move to `knex` and sqlite (with the option for `postgres` for deployment)
* [X] Move away from one table per system character to a single character record.
* [X] ~~The system specific data would be a `any()` blob of JSON.~~
* [X] Each system would define an [ajv][] schema for it's specific data.
* [X] ~~Evaluate and possibly implement [Joi][joi] instead of [AJV][ajv].~~
* [X] Any additional data (classes, spells, etc) needed should be treated as static data, and loaded as seeds into the database.
* [X] Move and refactor systems; they should no longer be their own thing, they should be integrated as just run of the
mill routes/components, as part of the application. No need for shared units like current.
* [ ] Convert to typescript
* [X] Move and refactor systems; they should no longer be their own thing, they should be integrated as just run-of-the-mill routes/components, as part of the application. No need for shared units like current.
* [X] Convert to typescript
* [ ] Convert to better validation/data model (See #52)
* [ ] Setup a reasonable ~~docker build~~/deploy pipeline in GitHub. (PARTIAL)
* [X] Setup eslint MR checking in GitHub.
Expand Down
9 changes: 0 additions & 9 deletions docs/vite-todo.md

This file was deleted.

20 changes: 12 additions & 8 deletions knexfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@ require('ts-node/register');

//----------------------------------------------------------------------------------------------------------------------

import knex from 'knex';

// Config
import configMan from './src/server/managers/config';
// This has to be first, for reasons
import dotenv from 'dotenv';

// Logging
import logging from 'trivial-logging';
logging.setRootLogger('rpgkeeper');
logging.init(configMan.config);
import knex from 'knex';
import configUtil from '@strata-js/util-config';

// Managers
import { getConfig } from './src/server/managers/database';

// ---------------------------------------------------------------------------------------------------------------------
// Configuration
// ---------------------------------------------------------------------------------------------------------------------

dotenv.config();
const env = (process.env.ENVIRONMENT ?? 'local').toLowerCase();
configUtil.load(`./config/${ env }.yml`);

//----------------------------------------------------------------------------------------------------------------------

module.exports = async() =>
Expand Down
Loading

0 comments on commit 4bde767

Please sign in to comment.