Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Vue3 #145

Merged
merged 26 commits into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f70af25
initial vue3 conversion. Site is very broken.
Morgul Jan 16, 2023
dcd5d74
Less broken; vuelidate is hosed, though.
Morgul Jan 16, 2023
0a85793
Upgraded vuelidate and vue-color to vue 3 versions.
Morgul Jan 16, 2023
af430ce
Moved account to a pinia store.
Morgul Jan 17, 2023
781a00b
Converted to a store for notes, and converted to composition api for …
Morgul Jan 19, 2023
b0d928b
Converted systems to use a store.
Morgul Jan 19, 2023
b861b2b
Fix toasts. (With super hacky work around)
Morgul Jan 20, 2023
2af60aa
better toast fix.
Morgul Jan 20, 2023
8664ca2
Converted character to store. (Only Risus system converted.)
Morgul Jan 24, 2023
b21a46a
Upgrade rpgdice, minor fixes to types.
Morgul Jan 25, 2023
e30f871
Forgot one last upgrade.
Morgul Jan 25, 2023
c605aa2
Finished WFRP.
Morgul Jan 26, 2023
1193d75
Converted core UI components to compose API.
Morgul Jan 28, 2023
9dd81dc
Got Fate converted.
Morgul Feb 1, 2023
9cd18e3
updated dependencies.
Morgul Feb 1, 2023
6b3f9ac
upgraded to codemirror 6.
Morgul Feb 1, 2023
9c4c9f4
Upgraded permissions and added them to the UI for the first time. Con…
Morgul Feb 26, 2023
c46612c
Added missing readonly computed property.
Morgul Feb 26, 2023
6b4dacd
Fixed char portrait to correctly zoom or scale the image to the right…
Morgul Feb 26, 2023
6d454ff
implemented EotE system.
Morgul Mar 20, 2023
7b6dc40
Fixed mode to be reactive correctly.
Morgul Mar 22, 2023
336e6c4
minor fix.
Morgul Jun 18, 2023
c71440b
Clean up some todo lists.
Morgul Aug 19, 2023
a6ae31f
upgrade node version on linting.
Morgul Aug 19, 2023
33b1ece
switch to npm.
Morgul Aug 19, 2023
8871b5e
massive refactor to use yaml config, and a lot of TS fixes.
Morgul Aug 20, 2023
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
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
Loading