Skip to content

Commit

Permalink
chore(cli): remove sys param from parseFlags (#3489)
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 authored and rwaskiewicz committed Jan 25, 2023
1 parent be94ac6 commit 674bf51
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,6 +1,6 @@
import { readOnlyArrayHasStringMember, toCamelCase } from '@utils';

import { CompilerSystem, LOG_LEVELS, LogLevel, TaskCommand } from '../declarations';
import { LOG_LEVELS, LogLevel, TaskCommand } from '../declarations';
import {
BOOLEAN_CLI_FLAGS,
CLI_FLAG_ALIASES,
Expand All @@ -18,11 +18,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 @@ -19,7 +19,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 674bf51

Please sign in to comment.