From c78298345c5d871b636ea5eb313f2f64d7ea35ef Mon Sep 17 00:00:00 2001 From: Elijah R Date: Wed, 10 Apr 2024 16:33:54 -0400 Subject: [PATCH] Switch to using parcel json imports instead of Config.ts --- .gitignore | 3 ++- README.md | 2 +- Config.ts => config.example.json | 16 ++++++++-------- src/ts/main.ts | 2 +- tsconfig.json | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) rename Config.ts => config.example.json (62%) diff --git a/.gitignore b/.gitignore index 9287d0d..4a1c024 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ dist/ -.parcel-cache/ \ No newline at end of file +.parcel-cache/ +config.json \ No newline at end of file diff --git a/README.md b/README.md index 2f14cb3..ef92973 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The CollabVM Web App is the viewer for the CollabVM Server. ## Building -Edit Config.ts to your needs, then: +Copy config.example.json to config.json and edit to your needs, then: ## yarn - `yarn` diff --git a/Config.ts b/config.example.json similarity index 62% rename from Config.ts rename to config.example.json index 867d94c..e30c258 100644 --- a/Config.ts +++ b/config.example.json @@ -1,6 +1,6 @@ -export const Config = { - ChatSound: "//computernewb.com/collab-vm/notify.ogg", - ServerAddresses: [ +{ + "ChatSound": "//computernewb.com/collab-vm/notify.ogg", + "ServerAddresses": [ "wss://computernewb.com/collab-vm/vm0", "wss://computernewb.com/collab-vm/vm1", "wss://computernewb.com/collab-vm/vm2", @@ -9,10 +9,10 @@ export const Config = { "wss://computernewb.com/collab-vm/vm5", "wss://computernewb.com/collab-vm/vm6", "wss://computernewb.com/collab-vm/vm7", - "wss://computernewb.com/collab-vm/vm8", + "wss://computernewb.com/collab-vm/vm8" ], - Auth: { - Enabled: false, - APIEndpoint: "http://127.0.0.1:5858" + "Auth": { + "Enabled": false, + "APIEndpoint": "http://127.0.0.1:5858" } -} +} \ No newline at end of file diff --git a/src/ts/main.ts b/src/ts/main.ts index 9c37935..d2bb5be 100644 --- a/src/ts/main.ts +++ b/src/ts/main.ts @@ -1,6 +1,6 @@ import CollabVMClient from './protocol/CollabVMClient.js'; import VM from './protocol/VM.js'; -import { Config } from '../../Config.js'; +import Config from '../../config.json'; import { Permissions, Rank } from './protocol/Permissions.js'; import { User } from './protocol/User.js'; import TurnStatus from './protocol/TurnStatus.js'; diff --git a/tsconfig.json b/tsconfig.json index c407b1b..d8e2dae 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -41,7 +41,7 @@ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ + "resolveJsonModule": true, /* Enable importing .json files. */ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */