From 80d0dc4a48895c9a37f34f975561c292e8d1b072 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Tue, 5 May 2020 11:56:36 +0200 Subject: [PATCH] init --- .eslintignore | 2 + .eslintrc.js | 17 + .gitignore | 4 + .npmrc | 1 + lib/.eslintrc.js | 17 + lib/InteractiveOptions.ts | 28 + package.json | 29 + tsconfig.json | 12 + yarn.lock | 3351 +++++++++++++++++++++++++++++++++++++ 9 files changed, 3461 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .gitignore create mode 100644 .npmrc create mode 100644 lib/.eslintrc.js create mode 100644 lib/InteractiveOptions.ts create mode 100644 package.json create mode 100644 tsconfig.json create mode 100644 yarn.lock 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