{"id":20466906,"url":"https://github.com/fwh1990/public-refactor","last_synced_at":"2026-04-16T23:03:00.331Z","repository":{"id":143796440,"uuid":"257859095","full_name":"fwh1990/public-refactor","owner":"fwh1990","description":"Convert public modifier to protected or private in \"*.d.ts\" files after run tsc, useful for library creators.","archived":false,"fork":false,"pushed_at":"2021-05-26T06:25:40.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-27T12:36:42.422Z","etag":null,"topics":["protected-modifier","public-modifier","public-to-private","public-to-protected","public-transform"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fwh1990.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-22T09:50:40.000Z","updated_at":"2021-05-26T06:25:42.000Z","dependencies_parsed_at":"2023-10-12T04:51:53.305Z","dependency_job_id":null,"html_url":"https://github.com/fwh1990/public-refactor","commit_stats":{"total_commits":34,"total_committers":1,"mean_commits":34.0,"dds":0.0,"last_synced_commit":"646d7f96633700ed03526aeedc200b18416b2db7"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fwh1990/public-refactor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwh1990%2Fpublic-refactor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwh1990%2Fpublic-refactor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwh1990%2Fpublic-refactor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwh1990%2Fpublic-refactor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fwh1990","download_url":"https://codeload.github.com/fwh1990/public-refactor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwh1990%2Fpublic-refactor/sbom","scorecard":{"id":415244,"data":{"date":"2025-08-11","repo":{"name":"github.com/fwh1990/public-refactor","commit":"646d7f96633700ed03526aeedc200b18416b2db7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T23:39:49.254Z","repository_id":143796440,"created_at":"2025-08-18T23:39:49.254Z","updated_at":"2025-08-18T23:39:49.254Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31907728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["protected-modifier","public-modifier","public-to-private","public-to-protected","public-transform"],"created_at":"2024-11-15T13:26:21.763Z","updated_at":"2026-04-16T23:03:00.288Z","avatar_url":"https://github.com/fwh1990.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# public-refactor\n\nRefactor public modifier to protected or private in \"*.d.ts\" files after run tsc.\n\n# Installation\n\n```bash\nyarn add public-refactor --dev\n```\n\n# Usage\n\n### Create source file `src/index.ts`\n\n```typescript\nexport class Demo {\n  static readonly state: string;\n  public/*protected*/ static readonly state1: string;\n  public/*private*/ static readonly state2: string;\n  public/*protected*/ static hello: number = 1;\n  public/*private*/ static hello1(): void {};\n  public static hello23: number = 2;\n  public/*protected*/ static hello2: string = '2';\n  public static hello8 = 3;\n  public static hello9;\n\n  public props: number = 3;\n  public props12: number = 3;\n  public props345 = 3;\n  public/*protected*/ props1 = 3;\n  public/*protected*/ readonly props2: number = 3;\n  public/*private*/ props3 : string = '3';\n  public props123: number = 3;\n  public props3456: number = 3;\n  public/*private*/ props876!: number;\n\n  public demo() {}\n  public/*protected*/ demo1() {}\n  public/*protected*/ demo2() {}\n  public/*private*/ demo3() {}\n  public demo4() {}\n  public/*protected*/ abstract dem5(): void;\n}\n```\n\n### Compile to js\n```bash\nnpx tsc --rootDir ./src --outDir ./build\n```\n\nYou get 2 files in `./build` directory\n```\n- build\n    - index.js\n    - index.d.ts\n```\n\n### Transform\n```bash\nnpx public-refactor --src ./src --dist ./build\n```\n\n### Final output to file `./build/index.d.ts`\n```typescript\nexport declare class Demo {\n    static readonly state: string;\n    protected static readonly state1: string;\n    private static readonly state2: string;\n    protected static hello: number;\n    private static hello1(): void;\n    static hello23: number;\n    protected static hello2: string;\n    static hello8: number;\n    static hello9: any;\n\n    props: number;\n    props12: number;\n    props345: number;\n    protected props1: number;\n    protected readonly props2: number;\n    private props3: string;\n    props123: number;\n    props3456: number;\n    private props876: number;\n\n    demo(): void;\n    protected demo1(): void;\n    protected demo2(): void;\n    private demo3(): void;\n    demo4(): void;\n    protected abstract dem5(): void;\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwh1990%2Fpublic-refactor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffwh1990%2Fpublic-refactor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwh1990%2Fpublic-refactor/lists"}