rokucommunity / rokucommunity/brighterscript

Integrate api-extractor and leverage @internal to protect certain functions

Open
#1,686 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Breaking Change
Dominant language
TypeScript
Stars
208
Forks
68
Avg merge
8h 39m
Merged PRs (30d)
39

Description

There are many functions in our typescript source code that are used "internally" in the project, so they are marked as public. However, we don't intend for public consumers to leverage these. Our current options are just public or private. and if we use private but still want to call them then we need to use the indexing pattern myClass['somePrivateFunction'].

Microsoft provides a tool called api-extractor that supports the @internal jsdoc annotation to strip those from our exported type definitions.

Integrate that tool, and do a pass to hide certain functions that we don't intend for public consumption.

This is not technically a breaking change because the functions themselves are still present, so existing code will still work. But their typescript builds will start failing at compile time. Need to think on that, but I think we should do it in v0 anyway.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TypeScript source and the api-extractor setup documentation linked in the issue, then identify how exported type definitions are currently produced. Integrate api-extractor and mark functions intended only for internal use with @internal; done means those functions remain available at runtime but are omitted from exported type definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.