Compare commits

..

4 Commits

Author SHA1 Message Date
Javier Ontiveros
d63d9b7b4f chore: update base route path to match old paths (#797) 2026-03-11 12:29:45 -03:00
Adolfo R. Brandes
0632525600 1.0.0-alpha.6 2026-03-04 11:01:27 -03:00
Adolfo R. Brandes
70576cf373 feat!: compile to JS before publishing
Configure the package to compile TypeScript and copy SCSS and image
assets (PNG, SVG) 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>
2026-02-13 17:29:46 -03:00
javier ontiveros
35283dfdd3 feat: added code spliting on main module 2026-02-11 09:58:55 -03:00
12 changed files with 1802 additions and 2016 deletions

View File

@@ -33,6 +33,9 @@ jobs:
- name: Test
run: npm run test
- name: Build
run: npm run build
- name: Run Coverage
uses: codecov/codecov-action@v5
with:

View File

@@ -24,6 +24,19 @@ test.npm.%: validate-no-uncommitted-package-lock-changes
requirements: ## install ci requirements
npm ci
clean:
rm -rf dist
build: clean
tsc --project tsconfig.build.json
tsc-alias -p tsconfig.build.json
find src -type f \( -name '*.scss' -o -name '*.png' -o -name '*.svg' \) -exec sh -c '\
for f in "$$@"; do \
d="dist/$${f#src/}"; \
mkdir -p "$$(dirname "$$d")"; \
cp "$$f" "$$d"; \
done' sh {} +
i18n.extract:
# Pulling display strings from .jsx files into .json files...
rm -rf $(transifex_temp)

View File

@@ -1,3 +1,3 @@
const { createConfig } = require('@openedx/frontend-base/config');
const { createConfig } = require('@openedx/frontend-base/tools');
module.exports = createConfig('babel');

View File

@@ -1,6 +1,6 @@
// @ts-check
const { createLintConfig } = require('@openedx/frontend-base/config');
const { createLintConfig } = require('@openedx/frontend-base/tools');
module.exports = createLintConfig(
{

View File

@@ -1,4 +1,4 @@
const { createConfig } = require('@openedx/frontend-base/config');
const { createConfig } = require('@openedx/frontend-base/tools');
module.exports = createConfig('test', {
setupFilesAfterEnv: [

3743
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,17 @@
{
"name": "@openedx/frontend-app-learner-dashboard",
"version": "1.0.0-alpha.5",
"version": "1.0.0-alpha.6",
"description": "",
"repository": {
"type": "git",
"url": "git+https://github.com/edx/frontend-app-learner-dashboard.git"
},
"main": "src/index.ts",
"exports": {
".": "./dist/index.js",
"./app.scss": "./dist/app.scss"
},
"files": [
"/src"
"/dist"
],
"browserslist": [
"extends @edx/browserslist-config"
@@ -18,10 +21,13 @@
"*.scss"
],
"scripts": {
"build": "make build",
"clean": "make clean",
"dev": "PORT=1996 PUBLIC_PATH=/learner-dashboard openedx dev",
"i18n_extract": "openedx formatjs extract",
"lint": "openedx lint .",
"lint:fix": "openedx lint --fix .",
"prepack": "npm run build",
"test": "openedx test --coverage --passWithNoTests"
},
"author": "Open edX",
@@ -65,10 +71,11 @@
"jest-when": "^3.6.0",
"react-dev-utils": "^12.0.0",
"react-test-renderer": "^18.3.1",
"redux-mock-store": "^1.5.4"
"redux-mock-store": "^1.5.4",
"tsc-alias": "^1.8.16"
},
"peerDependencies": {
"@openedx/frontend-base": "^1.0.0-alpha.11",
"@openedx/frontend-base": "^1.0.0-alpha.13",
"@openedx/paragon": "^23",
"@tanstack/react-query": "^5",
"@types/react": "^18",

View File

@@ -13,7 +13,6 @@ const siteConfig: SiteConfig = {
logoutUrl: 'http://local.openedx.io:8000/logout',
environment: EnvironmentTypes.DEVELOPMENT,
basename: '/learner-dashboard',
apps: [
shellApp,
headerApp,

View File

@@ -11,7 +11,6 @@ const siteConfig: SiteConfig = {
logoutUrl: 'http://localhost:8000/logout',
environment: EnvironmentTypes.TEST,
basename: '/learner-dashboard',
apps: [{
appId,
config: {

View File

@@ -1,13 +1,14 @@
import Main from './Main';
const routes = [
{
id: 'org.openedx.frontend.route.learnerDashboard.main',
path: '/',
path: '/learner-dashboard',
handle: {
role: 'org.openedx.frontend.role.dashboard'
},
Component: Main
async lazy () {
const module = await import('./Main');
return { Component: module.default };
},
}
];

18
tsconfig.build.json Normal file
View File

@@ -0,0 +1,18 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"noEmit": false
},
"include": [
"src/**/*"
],
"exclude": [
"src/**/*.test.*",
"src/**/*.spec.*",
"src/**/tests/**/*",
"src/__mocks__/**/*",
"src/setupTest.*"
]
}

View File

@@ -1,8 +1,11 @@
{
"extends": "@openedx/frontend-base/config/tsconfig.json",
"extends": "@openedx/frontend-base/tools/tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "dist"
"outDir": "dist",
"paths": {
"@src/*": ["./src/*"]
},
},
"include": [
"src/**/*",