From 1e560b8717bb55358c74dbd0c66b8c349909781d Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 28 May 2019 09:45:46 -0400 Subject: [PATCH 1/5] Move OptionDescription to utils/options so types agree --- cli/asc.d.ts | 13 +++---------- cli/util/options.d.ts | 23 +++++++++++++---------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/cli/asc.d.ts b/cli/asc.d.ts index 8c745f9743..830efd065c 100644 --- a/cli/asc.d.ts +++ b/cli/asc.d.ts @@ -1,3 +1,6 @@ +import {OptionDescription}from "./util/options"; +export {OptionDescription}; + /** Whether this is a webpack bundle or not. */ export const isBundle: boolean; @@ -7,16 +10,6 @@ export const isDev: boolean; /** AssemblyScript version. */ export const version: string; -/** Command line option description. */ -export interface OptionDescription { - /** Textual description. */ - description: string | string[]; - /** Option type, e.g. `string`. */ - type: string; - /** Option aliases, if any. */ - aliases?: string[]; -} - /** Available CLI options. */ export const options: { [key: string]: OptionDescription }; diff --git a/cli/util/options.d.ts b/cli/util/options.d.ts index 688b20bc71..44dffffe8f 100644 --- a/cli/util/options.d.ts +++ b/cli/util/options.d.ts @@ -1,15 +1,18 @@ +/** Command line option description. */ +export interface OptionDescription { + /** Textual description. */ + description?: string | string[], + /** Data type. One of (b)oolean [default], (i)nteger, (f)loat or (s)tring. Uppercase means multiple values. */ + type?: "b" | "i" | "f" | "s", "I", "F", "S", + /** Substituted options, if any. */ + value?: { [key: string]: number | string }, + /** Short alias, if any. */ + alias?: string +} + /** Configuration object. */ interface Config { - [key: string]: { - /** Textual description. */ - description?: string | string[], - /** Data type. One of (b)oolean [default], (i)nteger, (f)loat or (s)tring. Uppercase means multiple values. */ - type?: "b" | "i" | "f" | "s", "I", "F", "S", - /** Substituted options, if any. */ - value?: { [key: string]: number | string }, - /** Short alias, if any. */ - alias?: string - }; + [key: string]: OptionDescription; } /** Parsing result. */ From f15699e573640f0d0d66645edcd1289204df4ac1 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 28 May 2019 09:54:18 -0400 Subject: [PATCH 2/5] Add name to NOTICE --- NOTICE | 1 + 1 file changed, 1 insertion(+) diff --git a/NOTICE b/NOTICE index c37e7d814a..c99b6077b7 100644 --- a/NOTICE +++ b/NOTICE @@ -13,6 +13,7 @@ under the licensing terms detailed in LICENSE: * Joshua Tenner * Nidin Vinayakan <01@01alchemist.com> * Aaron Turner +* Willem Wyndham Portions of this software are derived from third-party works licensed under the following terms: From e26ae4d2bfe0e2a029e48352ce2ee366dac4a9a3 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 28 May 2019 10:17:14 -0400 Subject: [PATCH 3/5] Replace commas with "|"'s in type definition --- cli/util/options.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/util/options.d.ts b/cli/util/options.d.ts index 44dffffe8f..1126f392f0 100644 --- a/cli/util/options.d.ts +++ b/cli/util/options.d.ts @@ -3,7 +3,7 @@ export interface OptionDescription { /** Textual description. */ description?: string | string[], /** Data type. One of (b)oolean [default], (i)nteger, (f)loat or (s)tring. Uppercase means multiple values. */ - type?: "b" | "i" | "f" | "s", "I", "F", "S", + type?: "b" | "i" | "f" | "s" | "I" | "F" | "S", /** Substituted options, if any. */ value?: { [key: string]: number | string }, /** Short alias, if any. */ From fd7674b82d1577822bee492107bb2bf85befdd5f Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 28 May 2019 10:52:57 -0400 Subject: [PATCH 4/5] Fix formatting --- cli/asc.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/asc.d.ts b/cli/asc.d.ts index 830efd065c..596e481421 100644 --- a/cli/asc.d.ts +++ b/cli/asc.d.ts @@ -1,5 +1,5 @@ -import {OptionDescription}from "./util/options"; -export {OptionDescription}; +import { OptionDescription }from "./util/options"; +export { OptionDescription }; /** Whether this is a webpack bundle or not. */ export const isBundle: boolean; From 03f99977a1e23f7c99d85f5d3a2d5d2e7768a38c Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Thu, 30 May 2019 10:20:36 -0400 Subject: [PATCH 5/5] fix white space --- cli/asc.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/asc.d.ts b/cli/asc.d.ts index 596e481421..c1e04fa1eb 100644 --- a/cli/asc.d.ts +++ b/cli/asc.d.ts @@ -1,4 +1,4 @@ -import { OptionDescription }from "./util/options"; +import { OptionDescription } from "./util/options"; export { OptionDescription }; /** Whether this is a webpack bundle or not. */