Skip to content

Commit

Permalink
chore(cli): remove sys param from parseFlags
Browse files Browse the repository at this point in the history
This removes the `sys` parameter from the `parseFlags` function in
`src/cli/parse-flags.ts`. This parameter was more or less deprecated
in #3486 but was not removed at the time because `parseFlags` is part of
Stencil's public API, so we need to wait for a major version change to
change the type signature of the function.

STENCIL-509: remove _sys param from cli/parse_flags.ts::parseFlags
  • Loading branch information
alicewriteswrongs committed Jul 26, 2022
1 parent 6c44aa2 commit e35c19a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/cli/parse-flags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CompilerSystem, LogLevel, LOG_LEVELS, TaskCommand } from '../declarations';
import { LogLevel, LOG_LEVELS, TaskCommand } from '../declarations';
import { dashToPascalCase, toDashCase } from '@utils';
import {
BOOLEAN_CLI_ARGS,
Expand All @@ -20,11 +20,9 @@ import {
* Parse command line arguments into a structured `ConfigFlags` object
*
* @param args an array of CLI flags
* @param _sys an optional compiler system
* @returns a structured ConfigFlags object
*/
export const parseFlags = (args: string[], _sys?: CompilerSystem): ConfigFlags => {
// TODO(STENCIL-509): remove the _sys parameter here ^^ (for v3)
export const parseFlags = (args: string[]): ConfigFlags => {
const flags: ConfigFlags = createConfigFlags();

// cmd line has more priority over npm scripts cmd
Expand Down
7 changes: 3 additions & 4 deletions src/cli/public.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CliInitOptions, CompilerSystem, Config, Logger, TaskCommand } from '@stencil/core/internal';
import type { CliInitOptions, Config, Logger, TaskCommand } from '@stencil/core/internal';
import type { ConfigFlags } from './config-flags';

/**
Expand All @@ -15,7 +15,6 @@ export declare function run(init: CliInitOptions): Promise<void>;
*/
export declare function runTask(coreCompiler: any, config: Config, task: TaskCommand): Promise<void>;

// TODO(STENCIL-509): remove the _sys parameter here (for v3)
export declare function parseFlags(args: string[], _sys?: CompilerSystem): ConfigFlags;
export declare function parseFlags(args: string[]): ConfigFlags;

export { CompilerSystem, Config, ConfigFlags, Logger, TaskCommand };
export { Config, ConfigFlags, Logger, TaskCommand };

0 comments on commit e35c19a

Please sign in to comment.