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 Oct 3, 2022
1 parent bab1a86 commit b5db83c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
9 changes: 3 additions & 6 deletions src/cli/parse-flags.ts
@@ -1,6 +1,5 @@
import { dashToPascalCase, readOnlyArrayHasStringMember, toDashCase } from '@utils';

import { CompilerSystem, LOG_LEVELS, LogLevel, TaskCommand } from '../declarations';
import { LogLevel, LOG_LEVELS, TaskCommand } from '../declarations';
import { dashToPascalCase, toDashCase } from '@utils';
import {
BOOLEAN_CLI_ARGS,
BooleanCLIArg,
Expand All @@ -21,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
8 changes: 3 additions & 5 deletions src/cli/public.ts
@@ -1,5 +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 @@ -17,7 +16,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 b5db83c

Please sign in to comment.