Skip to content

Commit

Permalink
poc done
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kusumgar committed Nov 17, 2024
1 parent 748c80f commit 6a4a090
Show file tree
Hide file tree
Showing 20 changed files with 439 additions and 47 deletions.
206 changes: 206 additions & 0 deletions app/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion app/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
"coverage": "vitest -c ./vitest/vitest.unit.config.mjs run --coverage",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"genversion": "genversion --es6 --semi --double src/version.ts"
"genversion": "genversion --es6 --semi --double src/version.ts",
"static-serve": "http-server ./public -p 3000",
"copy-static-files": "cp ../../config/index.html ./public && cp -r ../../config/files ./public && cp -r ../../config/help ./public",
"build-static-site": "ts-node --project tsconfig.node.json ./src/static-site-builder/wodinBuilder.ts ../../config ./public ./views && npm run copy-static-files"
},
"devDependencies": {
"@eslint/js": "^9.14.0",
Expand All @@ -28,6 +31,7 @@
"@vitest/coverage-istanbul": "^2.1.4",
"axios-mock-adapter": "^2.1.0",
"eslint": "^9.14.0",
"http-server": "^14.1.1",
"nodemon": "^3.1.7",
"supertest": "^7.0.0",
"ts-node": "^10.9.2",
Expand Down
4 changes: 2 additions & 2 deletions app/server/src/controllers/configController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const configDefaults = (appType: string) => {
};

export class ConfigController {
private static _readAppConfigFile = (
static readAppConfigFile = (
appName: string,
appsPath: string,
_baseUrl: string,
Expand Down Expand Up @@ -54,7 +54,7 @@ export class ConfigController {
configReader, appsPath, defaultCodeReader, appHelpReader, baseUrl
} = req.app.locals as AppLocals;

const config = this._readAppConfigFile(
const config = this.readAppConfigFile(
appName,
appsPath,
baseUrl,
Expand Down
15 changes: 15 additions & 0 deletions app/server/src/static-site-builder/args.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const doc = `
Usage:
builder <path-to-config> <dest-path> <path-to-mustache-views>
`;

import { docopt } from "docopt";
import { version } from "../version";

export const processArgs = (argv: string[] = process.argv) => {
const opts = docopt(doc, { argv: argv.slice(2), version, exit: false });
const configPath = opts["<path-to-config>"] as string;
const destPath = opts["<dest-path>"] as string;
const viewsPath = opts["<path-to-mustache-views>"] as string;
return { configPath, destPath, viewsPath };
};
Loading

0 comments on commit 6a4a090

Please sign in to comment.