Skip to content

Commit

Permalink
build: re-organize exports of common and config
Browse files Browse the repository at this point in the history
- add typings for config
- update example config
  • Loading branch information
neopostmodern committed Dec 8, 2024
1 parent e3f1559 commit 57b4a6e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
7 changes: 6 additions & 1 deletion common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
"author": "neopostmodern <[email protected]>",
"homepage": "",
"license": "ISC",
"exports": "./dist/index.js",
"exports": {
".": {
"node": "./dist/index.js",
"default": "./index.ts"
}
},
"type": "module",
"directories": {
"lib": "lib",
Expand Down
3 changes: 2 additions & 1 deletion config/config-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"PORT": 3030,
"GRAPHIQL": false,
"MONGO_URL": "mongodb://localhost/structureApp",
"MONGOOSE_DEBUG": true,
"MIGRATIONS_DIRECTORY": "/home/structure/backend/migrations",
"CHANNEL": "dev",
"GITHUB_CLIENT_ID": "YOUR_CLIENT_ID_HERE",
"GITHUB_CLIENT_SECRET": "YOUR_CLIENT_SECRET_HERE",
"BACKEND_URL": "https://backend.structure.neopostmodern.com",
"WEB_FRONTEND_HOST": "https://structure.neopostmodern.com",
"ADDITIONAL_FRONTEND_HOSTS": ["file://"],
"ADDITIONAL_FRONTEND_HOSTS": ["file://", "http://localhost:5173"],
"SESSION_SECRET": "YOUR_SESSION_SECRET_HERE",
"USER": "YOU_SERVER_USERNAME_HERE",
"SERVER": "YOUR_SERVER_URL_HERE",
Expand Down
25 changes: 25 additions & 0 deletions config/config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
declare module '@structure/config' {
const config: {
PORT: number
GRAPHIQL: boolean
MONGO_URL: string
MONGOOSE_DEBUG: boolean
MIGRATIONS_DIRECTORY: string
CHANNEL: 'dev' | 'master' | string
GITHUB_CLIENT_ID: string
GITHUB_CLIENT_SECRET: string
BACKEND_URL: string
WEB_FRONTEND_HOST: string
ADDITIONAL_FRONTEND_HOSTS: Array<string>
SESSION_SECRET: string
USER: string
SERVER: string
SERVER_FOLDER_BACKEND: string
SERVER_FOLDER_FRONTEND: string
PROCESS_NAME: string
NODE_ARGS: string
RUN_PREFLIGHT: string
BACKUP_DIR: string
}
export default config
}
3 changes: 2 additions & 1 deletion config/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@structure/config",
"main": "index.js",
"main": "./config.json",
"types": "./config.d.ts",
"version": "0.23.1"
}

0 comments on commit 57b4a6e

Please sign in to comment.