Eliminating getters from yargs Options
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- cli
調査の方向性
Start with the getters for openReport, dryRun, interactive, verbose, and rcPath, and review the earlier changes in pull request #270. Trace how each option is read and identify the code changes needed to preserve behavior when removing the getters. Done means all five getters are removed without behavior changes; the issue does not name specific tests to run.
索引モデルが issue の本文から書いたものです。
説明
TL;DR
Some Parameter have a get function which will cause issues when migrating to ESM and require using incorrect typing.
These need to be removed.
Description
Using the getter for a parameter is requiring use to use Type Assertions.
This is an issue because it will not work property in some cases and typescript will ignore the error.
As an example we can look at the verbose param:
// packages/cli/src/lib/global/options/verbose.ts
import { argv } from 'yargs';
import { Param } from './verbose.model';
import { ArgvOption } from '../../core/yargs/types';
import { GlobalOptionsArgv } from './types';
import { getEnvPreset } from '../../pre-set';
export const param: Param = {
verbose: {
alias: 'v',
type: 'boolean',
description: 'Run with verbose logging',
default: getEnvPreset().verbose
}
};
// We don't rely on yargs option normalization features as this can happen before cli bootstrap
export function get(): boolean {
const {verbose} = argv as unknown as GlobalOptionsArgv;
return verbose;
}
Going around the yargs parser is problematic as it means we cannot simply expect it to work in the same way it yargs is suppose to.
Many of the getters for the options are being removed in this MR: https://github.com/push-based/user-flow/pull/270
However some require making further modifications to the code base to not have any behaviour changes.
In particular I am referring to the the following yargs options:
- openReport
- dryRun
- interactive
- verbose
- rcPath
Issue with getters in ESM
I believe the issue is related to live bindings. Or more broadly the way ES6 Modules export works.
More resources on the topic:
What do ES6 modules export? by Axel Rauschmayer
ES modules: A cartoon deep-dive by Lin Clark
Chapter on Modules in Exploring JS by Axel Rauschmayer
- 主要言語
- HTML
- スター
- 131
- フォーク
- 7
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 10
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
push-based/user-flow のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 24/100
push-based/user-flow#285 ·
メンテナーはふだん 1 日以内に返信
-
nx-plugin - init command adds `"PLUGIN_NAME": "^0.0.0"` to `package.json`再び着手できるかも @ChristopherPHolder が 1209 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug DX
push-based/user-flow#248 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
push-based/user-flow#247 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
push-based/user-flow#246 ·
メンテナーはふだん 1 日以内に返信
-
good first issue refactoring
難易度 2/5 1〜3時間 初心者へのやさしさ 47/100
push-based/user-flow#239 ·
メンテナーはふだん 1 日以内に返信
push-based/user-flow の issue をすべて見る
似ている issue
-
nb stats: the high-error-rate anomaly and the error-causes line give different cause splits for the same errors対応中かも @jeanibarz が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 89/100
jeanibarz/agent-notebook#418 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: graphify query loads every language extractor just for _file_stem (about 34 ms per call)対応中かも @rohit-jsfreaky が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Graphify-Labs/graphify#5160 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
WenyuChiou/agent-board#1345 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
bug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
wavetermdev/waveterm#3587 ·
メンテナーはふだん 1 日以内に返信