Skip to content

feat!: compile to JS before publishing#164

Draft
arbrandes wants to merge 1 commit intoopenedx:mainfrom
arbrandes:compile-before-publishing
Draft

feat!: compile to JS before publishing#164
arbrandes wants to merge 1 commit intoopenedx:mainfrom
arbrandes:compile-before-publishing

Conversation

@arbrandes
Copy link
Contributor

@arbrandes arbrandes commented Feb 6, 2026

Description

Ship compiled JavaScript + .d.ts declarations instead of raw TypeScript source. This allows consuming apps to also pre-compile their TypeScript and use tsc-alias to resolve arbitrary paths (such as @src).

At the bundler level, we add tsconfig-paths-webpack-plugin to Webpack configuration so that the Typescript aliases can also be used by Webpack builds without duplicating their definition.

As part of this, unify the tsc builds so that everything ends up in /dist, and then use more modern export maps to decouple the internal file structure from the package's API.

Of note, the default tsconfig (not the one used by tools) now uses moduleResolution: bundler to allow for more modern entrypoint definition.

BREAKING CHANGE

Consuming apps need to modify their imports and configuration accordingly. See the changes in the migration howto for details.

Downstream PRs

LLM Usage Notice

Built with assistance from Claude Opus 4.6.

@arbrandes arbrandes marked this pull request as draft February 6, 2026 02:10
@arbrandes arbrandes force-pushed the compile-before-publishing branch 2 times, most recently from ba98344 to 1a10c88 Compare February 6, 2026 02:30
@arbrandes arbrandes changed the title compile before publishing feat!: compile before publishing Feb 6, 2026
@arbrandes arbrandes changed the title feat!: compile before publishing feat!: compile to JS before publishing Feb 6, 2026
@arbrandes arbrandes force-pushed the compile-before-publishing branch 3 times, most recently from 7f44c4e to a008b3b Compare February 6, 2026 14:36
@arbrandes arbrandes force-pushed the compile-before-publishing branch 2 times, most recently from 6bcc955 to c5c8f1c Compare February 6, 2026 21:29
Ship compiled JavaScript + .d.ts declarations instead of raw TypeScript
source. This allows consuming apps to also pre-compile their TypeScript
and use tsc-alias to resolve arbitrary paths (such as @src).

At the bundler level, we add tsconfig-paths-webpack-plugin to Webpack
configuration so that the Typescript aliases can also be used by Webpack
builds without duplicating their definition.

As part of this, unify the tsc builds so that everything ends up in
/dist, and then use more modern export maps to decouple the internal
file structure from the package's API.

Of note, the default tsconfig (not the one used by tools) now uses
`moduleResolution: bundler` to allow for more modern entrypoint
definition.

BREAKING CHANGE: consuming apps need to modify their imports and
configuration accordingly.  See the changes in the migration howto for
details.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@arbrandes arbrandes force-pushed the compile-before-publishing branch from c5c8f1c to eace906 Compare February 6, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant