1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-01 11:35:24 +02:00

change default config name && some fixes

This commit is contained in:
Nikita Melnikov 2022-10-08 21:26:51 +08:00
parent 2663931f2a
commit ecb27e7e45
8 changed files with 21 additions and 12 deletions

View file

@ -18,7 +18,7 @@ yarn install
### 3. Create separate config file for local overrides ### 3. Create separate config file for local overrides
```shell ```shell
touch app-config.local.yaml touch docs-config.local.yaml
``` ```
### 4. Run the application ### 4. Run the application
@ -39,7 +39,7 @@ In order to use MongoDB, follow these steps:
docker-compose up mongodb docker-compose up mongodb
``` ```
### 2. Setup MongoDB driver in app-config.local.yaml ### 2. Setup MongoDB driver in docs-config.local.yaml
```yaml ```yaml
database: database:
@ -73,7 +73,7 @@ By default, the application uses local filesystem to store files, but S3 driver
### 1. Get credentials for S3 bucket ### 1. Get credentials for S3 bucket
Create a S3 bucket and get access key and secret key (or use existing ones) Create a S3 bucket and get access key and secret key (or use existing ones)
### 2. Setup S3 driver in app-config.local.yaml ### 2. Setup S3 driver in docs-config.local.yaml
```yaml ```yaml
uploads: uploads:

View file

@ -9,8 +9,8 @@ services:
volumes: volumes:
- ./public/uploads:/uploads - ./public/uploads:/uploads
- ./db:/usr/src/app/db - ./db:/usr/src/app/db
- ./app-config.yaml:/usr/src/app/app-config.yaml - ./docs-config.yaml:/usr/src/app/docs-config.yaml
- ./app-config.local.yaml:/usr/src/app/app-config.local.yaml - ./docs-config.local.yaml:/usr/src/app/docs-config.local.yaml
mongodb: mongodb:
image: mongo:6.0.1 image: mongo:6.0.1
ports: ports:

View file

@ -32,4 +32,4 @@ COPY --from=build /usr/src/app/public ./public
ENV NODE_ENV=production ENV NODE_ENV=production
CMD ["node", "dist/bin/server.js"] CMD ["node", "dist/backend/server.js"]

View file

@ -1,7 +1,11 @@
{ {
"name": "codex.docs", "name": "codex.docs",
"license": "Apache-2.0", "license": "Apache-2.0",
"version": "0.0.1-alpha.5",
"type": "module", "type": "module",
"bin": {
"codex.docs": "dist/backend/server.js"
},
"browserslist": [ "browserslist": [
"last 2 versions", "last 2 versions",
"> 1%" "> 1%"
@ -9,9 +13,10 @@
"scripts": { "scripts": {
"start": "concurrently \"yarn start-backend\" \"yarn build-frontend\"", "start": "concurrently \"yarn start-backend\" \"yarn build-frontend\"",
"dev": "concurrently \"yarn start-backend\" \"yarn build-frontend:dev\"", "dev": "concurrently \"yarn start-backend\" \"yarn build-frontend:dev\"",
"build-all": "yarn build-frontend && yarn build-backend",
"build-static": "ts-node src/backend/build-static.ts", "build-static": "ts-node src/backend/build-static.ts",
"start-backend": "cross-env NODE_ENV=development npx nodemon --config nodemon.json src/backend/server.ts -c app-config.yaml -c app-config.local.yaml", "start-backend": "cross-env NODE_ENV=development npx nodemon --config nodemon.json src/backend/server.ts -c docs-config.yaml -c docs-config.local.yaml",
"compile": "tsc && copyfiles -u 3 ./src/**/*.twig ./dist/backend/views && copyfiles -u 1 ./src/**/*.svg ./dist/", "build-backend": "tsc && copyfiles -u 3 ./src/**/*.twig ./dist/backend/views && copyfiles -u 1 ./src/**/*.svg ./dist/",
"build-frontend": "webpack --mode=production", "build-frontend": "webpack --mode=production",
"build-frontend:dev": "webpack --mode=development --watch", "build-frontend:dev": "webpack --mode=development --watch",
"test:js": "cross-env NODE_ENV=testing mocha --recursive ./dist/test --exit", "test:js": "cross-env NODE_ENV=testing mocha --recursive ./dist/test --exit",

View file

@ -1,3 +1,4 @@
#!/usr/bin/env node
/** /**
* Module dependencies. * Module dependencies.
*/ */

View file

@ -107,7 +107,7 @@ const args = arg({ /* eslint-disable @typescript-eslint/naming-convention */
}); });
const cwd = process.cwd(); const cwd = process.cwd();
const paths = (args['--config'] || [ './app-config.yaml' ]).map((configPath) => { const paths = (args['--config'] || [ './docs-config.yaml' ]).map((configPath) => {
if (path.isAbsolute(configPath)) { if (path.isAbsolute(configPath)) {
return configPath; return configPath;
} }

View file

@ -16,7 +16,7 @@
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */ // "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./dist/", /* Redirect output structure to the directory. */ "outDir": "./dist/backend", /* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */ // "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
@ -74,12 +74,15 @@
"skipLibCheck": true, /* Skip type checking of declaration files. */ "skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}, },
"include": ["src/**/*"], "include": ["src/backend/**/*"],
"ts-node": { "ts-node": {
/** /**
* Tell ts-node CLI to install the --loader automatically, explained below * Tell ts-node CLI to install the --loader automatically, explained below
* https://typestrong.org/ts-node/docs/imports/ * https://typestrong.org/ts-node/docs/imports/
*/ */
"esm": true "esm": true
} },
"exclude": [
"src/test/**/*"
]
} }