Eliminating getters from yargs Options
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- cli
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- HTML
- Stelle
- 131
- Fork
- 7
- Merge medio
- 1g 1h
- PR unite (30g)
- 10
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di push-based/user-flow
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 24/100
push-based/user-flow#285 ·
I maintainer di solito rispondono entro 1 giorno
-
nx-plugin - init command adds `"PLUGIN_NAME": "^0.0.0"` to `package.json`Forse di nuovo libera @ChristopherPHolder l’ha presa 1209 giorni fa e non c’è nessuna pull request aperta. Apertabug DX
push-based/user-flow#248 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
push-based/user-flow#247 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
push-based/user-flow#246 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue refactoring
Difficoltà 2/5 1-3 ore Idoneità per principianti 47/100
push-based/user-flow#239 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di push-based/user-flow
Issue simili
-
nb stats: the high-error-rate anomaly and the error-causes line give different cause splits for the same errorsForse già presa @jeanibarz l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 89/100
jeanibarz/agent-notebook#418 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: graphify query loads every language extractor just for _file_stem (about 34 ms per call)Forse già presa @rohit-jsfreaky l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Graphify-Labs/graphify#5160 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
WenyuChiou/agent-board#1345 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
bug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
wavetermdev/waveterm#3587 ·
I maintainer di solito rispondono entro 1 giorno