BeyondCodeBootcamp / BeyondCodeBootcamp/jswithtypes.com

feature: /json-to-jsdoc

Offen
#1 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
good first issue hacktoberfest
Vorherrschende Sprache
JavaScript
Sterne
0
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

# The Big Idea

I'd like to host a standalone online tool like https://transform.tools/json-to-jsdoc, but that will break down intermediary types, and also handle enums.

- [ ] JavaScript conversion function (no frameworks or libraries)
- `JSON.stringify(input, null, 2)` to prettify JSON
- Traverses JSON to produce JSDoc
- Checkbox for "treat arrays as enums"
- Order types alphabetically
- "" is type `String`
- "a|b|c" creates a typedef `MyTypeStatusEnum` ?
- [ ] HTML Textareas
- CSS with variables (see MVP.css)

## Example Output: JSON

```js
/** @typedef {object} json
* @property {object} about
* @property {string} about.legalBusinessName
* @property {string} about.website
* @property {string} about.industry
* @property {string} about.countryOfOperation
* @property {string} about.description
* @property {string} about.operations
*/
```

should instead be

```js
/**
* @typedef MyType
* @prop {MyTypeAbout} about
*/

/**
* @typedef MyTypeAbout
* @prop {String} legalBusinessName
* @prop {String} website
* @prop {String} industry
* @prop {String} countryOfOperation
* @prop {String} description
* @prop {String} operations
*/
```

## Example Output: Enums

Maybe any props that are all caps and assigned an array could be considered enums?

```js
/**
* @typedef {"IsPep"|"IsNotPep"} PepOption
*/
Mercury.POLITICALLY_EXPOSED_OPTIONS = ["IsPep", "IsNotPep"];
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Es werden keine Dateien, Tests oder Einstiegspunkte genannt. Beginne damit, den JavaScript-Konvertierungscode und die HTML-Textarea-UI des eigenständigen Tools zu finden, und vergleiche dann die Implementierung mit den angeforderten Zwischentypen, der enum-Behandlung, der alphabetischen Sortierung und den CSS-Variablen; abgeschlossen ist die Aufgabe, wenn die aufgeführten JSON- und enum-Beispiele die beabsichtigte JSDoc-Ausgabe erzeugen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
css, html, javascript
Bereich
frontend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.