Eliminating getters from yargs Options
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Refactoring
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- typescript
- Bereich
- cli
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- HTML
- Sterne
- 131
- Forks
- 7
- Ø Merge
- 1 T. 1 Std.
- Gemergte PRs (30 T.)
- 10
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus push-based/user-flow
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 24/100
push-based/user-flow#285 ·
Maintainer antworten meist innerhalb von 1 Tag
-
nx-plugin - init command adds `"PLUGIN_NAME": "^0.0.0"` to `package.json`Evtl. wieder frei @ChristopherPHolder hat das vor 1209 Tagen übernommen, und es ist kein Pull Request offen. Offenbug DX
push-based/user-flow#248 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
push-based/user-flow#247 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 20/100
push-based/user-flow#246 ·
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue refactoring
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 47/100
push-based/user-flow#239 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in push-based/user-flow
Ähnliche Issues
-
nb stats: the high-error-rate anomaly and the error-causes line give different cause splits for the same errorsEvtl. vergeben @jeanibarz hat das heute übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 89/100
jeanibarz/agent-notebook#418 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: graphify query loads every language extractor just for _file_stem (about 34 ms per call)Evtl. vergeben @rohit-jsfreaky hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Graphify-Labs/graphify#5160 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
WenyuChiou/agent-board#1345 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
bug triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
wavetermdev/waveterm#3587 ·
Maintainer antworten meist innerhalb von 1 Tag