Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

When converting from typescript to a target language, how can I declare a class as public?

オープン
#2,012 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
swift, typescript
領域
tooling

調査の方向性

まず、コマンド quicktype ESLModels.ts -o CodeGenOutput.swift を再現し、issue に示されている生成された Swift の宣言とヘルパー関数を調べます。Swift の出力オプションがどのように処理されるかを確認し、要求されたアクセス修飾子が生成されたファイル内で一貫して現れることを検証します。

索引モデルが issue の本文から書いたものです。

説明

When running this command quicktype ESLModels.ts -o CodeGenOutput.swift, I want the outputted file to contain public access modifiers. The output is technically correct, but if a project uses multiple packages, then we need these classes to have a public designation. In other words, enum ProcedureStateEnum needs to be public enum ProcedureStateEnum

ESLModels.ts

export enum ProcedureStateEnum {
    draft = 'draft',
    review = 'review',
    pending_approval = 'pending_approval',
    effective = 'effective',
    inactive = 'inactive',
    approved = 'approved',
    retired = 'retired',

    archived = 'archived',
}

outputs:

enum ProcedureStateEnum: String, Codable {
    case approved = "approved"
    case archived = "archived"
    case draft = "draft"
    case effective = "effective"
    case inactive = "inactive"
    case pendingApproval = "pending_approval"
    case retired = "retired"
    case review = "review"
}

// MARK: - Helper functions for creating encoders and decoders

func newJSONDecoder() -> JSONDecoder {
    let decoder = JSONDecoder()
    if #available(iOS 10.0, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
        decoder.dateDecodingStrategy = .iso8601
    }
    return decoder
}

func newJSONEncoder() -> JSONEncoder {
    let encoder = JSONEncoder()
    if #available(iOS 10.0, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
        encoder.dateEncodingStrategy = .iso8601
    }
    return encoder
}
主要言語
TypeScript
スター
13.9k
フォーク
1.2k
平均マージ
8時間 14分
マージ済み PR(30日)
368

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

glideapps/quicktype のほかの issue

glideapps/quicktype の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。