Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): export cli types and runTask, move checkVersion to sys, add…
… tests
- Loading branch information
1 parent
4964ecf
commit 02c62b5
Showing
23 changed files
with
375 additions
and
212 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
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,18 @@ | ||
import type { Config } from '../declarations'; | ||
import { isFunction } from '@utils'; | ||
|
||
export const startCheckVersion = async (config: Config, currentVersion: string) => { | ||
if (config.devMode && !config.flags.ci && isFunction(config.sys.checkVersion)) { | ||
return config.sys.checkVersion(config.logger, currentVersion); | ||
} | ||
return null; | ||
}; | ||
|
||
export const printCheckVersionResults = async (versionChecker: Promise<() => void>) => { | ||
if (versionChecker) { | ||
const checkVersionResults = await versionChecker; | ||
if (isFunction(checkVersionResults)) { | ||
checkVersionResults(); | ||
} | ||
} | ||
}; |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export { run } from './run'; | ||
export { run, runTask } from './run'; |
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,17 @@ | ||
import { CliInitOptions, CompilerSystem, Config, ConfigFlags, Logger, TaskCommand } from '@stencil/core/internal'; | ||
|
||
/** | ||
* Runs the CLI with the given options. This is used by Stencil's default `bin/stencil` file, | ||
* but can be used externally too. | ||
*/ | ||
export declare function run(init: CliInitOptions): Promise<void>; | ||
|
||
/** | ||
* Run individual CLI tasks. | ||
* @param coreCompiler The core Stencil compiler to be used. The `run()` method handles loading the core compiler, however, `runTask()` must be passed it. | ||
* @param config Assumes the config has already been validated and has the "sys" and "logger" properties. | ||
* @param task The task command to run, such as `build`. | ||
*/ | ||
export declare function runTask(coreCompiler: any, config: Config, task: TaskCommand): Promise<void>; | ||
|
||
export { CompilerSystem, Config, ConfigFlags, Logger, TaskCommand }; |
Oops, something went wrong.