Skip to content

Commit

Permalink
feat(@cubejs-backend/server): Introduce external commands for CLI (demo)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Oct 20, 2020
1 parent 06b5f01 commit fed9285
Show file tree
Hide file tree
Showing 7 changed files with 696 additions and 135 deletions.
1 change: 1 addition & 0 deletions packages/cubejs-server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
8 changes: 7 additions & 1 deletion packages/cubejs-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"main": "index.js",
"files": [
"dist",
"index.js",
"index.d.ts",
"WebSocketServer.js",
Expand All @@ -23,6 +24,9 @@
"cubejs-dev-server": "./bin/dev-server.js"
},
"scripts": {
"tsc": "tsc",
"watch": "tsc -w",
"build": "tsc",
"test": "npm run unit",
"lint": "eslint *.js __mocks__/*.js",
"lint:fix": "eslint --fix *.js __mocks__/*.js",
Expand All @@ -31,6 +35,7 @@
},
"dependencies": {
"@cubejs-backend/server-core": "^0.21.1",
"@oclif/command": "^1.8.0",
"body-parser": "^1.19.0",
"codesandbox-import-utils": "^2.1.12",
"cors": "^2.8.4",
Expand All @@ -45,7 +50,8 @@
"eslint-plugin-node": "^5.2.1",
"jest": "^24.9.0",
"mocha": "^8.0.1",
"should": "^13.2.3"
"should": "^13.2.3",
"typescript": "^4.0.3"
},
"license": "Apache-2.0"
}
15 changes: 15 additions & 0 deletions packages/cubejs-server/src/command/dev-server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {Command, flags} from '@oclif/command';

export default class DevServer extends Command {
static description = 'Run server in Development mode';

static flags = {}

static args = [];

async run() {
this.parse(DevServer);

console.log('Demo, source code will be in next PR');
}
}
15 changes: 15 additions & 0 deletions packages/cubejs-server/src/command/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {Command, flags} from '@oclif/command';

export default class Server extends Command {
static description = 'Run server in Production mode';

static flags = {}

static args = [];

async run() {
this.parse(Server);

console.log('Demo, source code will be in next PR');
}
}
Empty file.
23 changes: 23 additions & 0 deletions packages/cubejs-server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"lib": ["es2017"],
"target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"declaration": true,
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
"sourceMap": true, /* Generates corresponding '.map' file. */
"outDir": "./dist", /* Redirect output structure to the directory. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* Enable strict null checks. */
"strictFunctionTypes": true, /* Enable strict checking of function types. */
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"allowSyntheticDefaultImports": true,
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
}

0 comments on commit fed9285

Please sign in to comment.