Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const { createConfig } = require('@openedx/frontend-base/config');
const { createConfig } = require('@openedx/frontend-base/tools');

module.exports = createConfig('babel');
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-check

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

module.exports = createLintConfig(
{
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { createConfig } = require('@openedx/frontend-base/config');
const { createConfig } = require('@openedx/frontend-base/tools');

module.exports = createConfig('test', {
setupFilesAfterEnv: [
Expand Down
3,741 changes: 1,742 additions & 1,999 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"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"
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
18 changes: 18 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -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.*"
]
}
7 changes: 5 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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/**/*",
Expand Down