-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor, wip: try to register within the individual scripts
- Loading branch information
1 parent
de919cc
commit 5b08c65
Showing
12 changed files
with
146 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* The goal of this module is simply to streamline the creation of new scripts. | ||
* | ||
* @module | ||
*/ | ||
import { ScriptInformation, scripts } from './scripts-info' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* This file contains the references to all scripts, as well as their explanations and arguments. | ||
* | ||
* @module | ||
*/ | ||
import { MergeableRecord } from '../../util/objects' | ||
import { OptionDefinition } from 'command-line-usage' | ||
|
||
|
||
interface BaseScriptInformation extends MergeableRecord { | ||
toolName: string | ||
target: string | ||
description: string | ||
usageExample: string | ||
options: OptionDefinition[] | ||
} | ||
|
||
export interface MasterScriptInformation extends BaseScriptInformation { | ||
type: 'master script', | ||
} | ||
|
||
export interface HelperScriptInformation extends BaseScriptInformation { | ||
type: 'helper script', | ||
masterScripts: string[] | ||
} | ||
|
||
export type ScriptInformation = MasterScriptInformation | HelperScriptInformation | ||
|
||
|
||
export const scripts = new Map<string, ScriptInformation>() | ||
|
||
export function register(name: string, information: ScriptInformation) { | ||
scripts.set(name, information) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.