commit 80d0dc4a48895c9a37f34f975561c292e8d1b072 Author: Timo Hocker Date: Tue May 5 11:56:36 2020 +0200 init diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..d3004b7 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +/dist/ +*.d.ts diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..6710f8a --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,17 @@ +module.exports = { + env: { + commonjs: true, + es6: true, + node: true + }, + extends: [ + '@scode' + ], + globals: { + Atomics: 'readonly', + SharedArrayBuffer: 'readonly' + }, + parserOptions: { + ecmaVersion: 2018 + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e5c296b --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/node_modules/ +/dist/ +/.nyc_output/ +/coverage/ diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..037041f --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@scode:registry=https://npm.scode.ovh diff --git a/lib/.eslintrc.js b/lib/.eslintrc.js new file mode 100644 index 0000000..7a9c97b --- /dev/null +++ b/lib/.eslintrc.js @@ -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 + } +} diff --git a/lib/InteractiveOptions.ts b/lib/InteractiveOptions.ts new file mode 100644 index 0000000..e1d7f53 --- /dev/null +++ b/lib/InteractiveOptions.ts @@ -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