This commit is contained in:
Timo Hocker 2020-05-05 11:56:36 +02:00
commit 80d0dc4a48
9 changed files with 3461 additions and 0 deletions

2
.eslintignore Normal file
View File

@ -0,0 +1,2 @@
/dist/
*.d.ts

17
.eslintrc.js Normal file
View File

@ -0,0 +1,17 @@
module.exports = {
env: {
commonjs: true,
es6: true,
node: true
},
extends: [
'@scode'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 2018
}
}

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
/node_modules/
/dist/
/.nyc_output/
/coverage/

1
.npmrc Normal file
View File

@ -0,0 +1 @@
@scode:registry=https://npm.scode.ovh

17
lib/.eslintrc.js Normal file
View File

@ -0,0 +1,17 @@
module.exports = {
env: {
commonjs: true,
es6: true,
node: true
},
extends: [
'@scode/eslint-config-ts'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 2018
}
}

28
lib/InteractiveOptions.ts Normal file
View File

@ -0,0 +1,28 @@
import { Persistent } from '@scode/modelling';
enum OptionType {
string = 'string',
number = 'number',
boolean = 'boolean'
}
interface Option {
name: string;
type: OptionType;
required?: boolean;
default: unknown;
}
export class InteractiveOptions extends Persistent {
public constructor (options: Array<Option>) {
super ();
for (const option of options) {
if (typeof option.default !== option.type) {
throw new Error (
`default does not match option type on ${option.name}`
);
}
this.properties[option.name] = option.type;
}
}
}

29
package.json Normal file
View File

@ -0,0 +1,29 @@
{
"name": "@scode/console-app",
"version": "1.0.0",
"main": "index.js",
"author": "Timo Hocker <thocker@oas.de>",
"license": "MIT",
"devDependencies": {
"@ava/typescript": "^1.1.1",
"@scode/eslint-config-ts": "^1.0.31",
"ava": "^3.8.1",
"eslint": "^6.8.0",
"nyc": "^15.0.1",
"typescript": "^3.8.3"
},
"scripts": {
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.vue,.mjs",
"test": "echo \"no test\"",
"compile": "tsc"
},
"files": [
"LICENSE",
"/dist/"
],
"dependencies": {
"@scode/modelling": "^1.0.24",
"enquirer": "^2.3.5",
"yargs": "^15.3.1"
}
}

12
tsconfig.json Normal file
View File

@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"outDir": "./dist",
"rootDir": "./lib",
"strict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"declaration": true
}
}

3351
yarn.lock Normal file

File diff suppressed because it is too large Load Diff