Skip to content

Commit a6720b4

Browse files
arbrandesclaude
andcommitted
feat!: compile to JS before publishing
Configure the package to compile TypeScript and copy SCSS files to dist/ before publishing, rather than publishing raw source files. This allows us to use tsc-alias for @src imports. Also use a more modern export map to decouple the internal file structure from the package's API, and add a build step to CI. BREAKING CHANGE: Consuming projects may need to update their imports or SASS @use lines. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 45535ee commit a6720b4

10 files changed

Lines changed: 284 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
- name: Test
3636
run: npm run test
3737

38+
- name: Build
39+
run: npm run build
40+
3841
- name: Run Code Coverage
3942
uses: codecov/codecov-action@v5
4043
with:

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ precommit:
1313
requirements:
1414
npm ci
1515

16+
clean:
17+
rm -rf dist
18+
19+
build: clean
20+
tsc --project tsconfig.build.json
21+
tsc-alias -p tsconfig.build.json
22+
find src -type f -name '*.scss' -exec sh -c '\
23+
for f in "$$@"; do \
24+
d="dist/$${f#src/}"; \
25+
mkdir -p "$$(dirname "$$d")"; \
26+
cp "$$f" "$$d"; \
27+
done' sh {} +
28+
1629
i18n.extract:
1730
# Pulling display strings from .jsx files into .json files...
1831
rm -rf $(transifex_temp)

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const { createConfig } = require('@openedx/frontend-base/config');
1+
const { createConfig } = require('@openedx/frontend-base/tools');
22

33
module.exports = createConfig('babel');

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
const { createLintConfig } = require('@openedx/frontend-base/config');
3+
const { createLintConfig } = require('@openedx/frontend-base/tools');
44

55
module.exports = createLintConfig(
66
{

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { createConfig } = require('@openedx/frontend-base/config');
1+
const { createConfig } = require('@openedx/frontend-base/tools');
22

33
module.exports = createConfig('test', {
44
setupFilesAfterEnv: [

package-lock.json

Lines changed: 225 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)