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
24 changes: 0 additions & 24 deletions .env

This file was deleted.

25 changes: 0 additions & 25 deletions .env.development

This file was deleted.

22 changes: 0 additions & 22 deletions .env.test

This file was deleted.

4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Default CI
on:
push:
branches:
- 'master'
- 'main'
pull_request:
branches:
- '**'
Expand All @@ -27,6 +27,8 @@ jobs:
run: npm run test
- name: Build
run: npm run build
- name: Build (CI)
run: npm run build:ci
- name: i18n_extract
run: npm run i18n_extract
- name: Coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lockfileversion-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Lockfile Version check
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release CI
on:
push:
branches:
- main
- stable
- '[0-9]+.x'
- '[0-9]+.[0-9]+.x'

permissions:
id-token: write # Required for OIDC
contents: write # For Semantic Release tagging

jobs:
release:
name: Release
# This template does not itself publish. Copies made from it do, as soon
# as they have credentials, with no change to this file.
if: github.repository != 'openedx/frontend-template-application'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: '.nvmrc'

- name: Install dependencies
run: npm ci

- name: Release to npm/Github
run: npx semantic-release@25
env:
GITHUB_TOKEN: ${{ secrets.OPENEDX_SEMANTIC_RELEASE_GITHUB_TOKEN }}
22 changes: 10 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
.DS_Store
.eslintcache
.idea
node_modules
npm-debug.log
coverage
module.config.js

dist/
src/i18n/transifex_input.json
temp/babel-plugin-react-intl
packages/
/.turbo
/turbo.json
/*.tgz

### pyenv ###
.python-version
### i18n ###
src/i18n/transifex_input.json
src/i18n/messages.ts
src/i18n/messages/

### Emacs ###
### Editors ###
.DS_Store
*~
/temp
/.vscode

webpack.dev-tutor.config.js
11 changes: 0 additions & 11 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
.eslintignore
.eslintrc.json
.gitignore
.travis.yml
docker-compose.yml
Dockerfile
Makefile
npm-debug.log

coverage
node_modules
public
14 changes: 14 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
{ "name": "stable", "channel": "latest" },
{ "name": "main", "prerelease": "alpha", "channel": "alpha" }
],
"tagFormat": "v${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
}
35 changes: 0 additions & 35 deletions .stylelintrc.json

This file was deleted.

70 changes: 44 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
intl_imports = ./node_modules/.bin/intl-imports.js
transifex_utils = ./node_modules/.bin/transifex-utils.js
TURBO = TURBO_TELEMETRY_DISABLED=1 turbo --dangerously-disable-package-manager-check
i18n = ./src/i18n
transifex_input = $(i18n)/transifex_input.json

# This directory must match .babelrc .
transifex_temp = ./temp/babel-plugin-formatjs

precommit:
npm run lint
Expand All @@ -13,32 +8,55 @@ precommit:
requirements:
npm ci

i18n.extract:
# Pulling display strings from .jsx files into .json files...
rm -rf $(transifex_temp)
npm run-script i18n_extract
# turbo.site.json is the standalone turbo config for this package. It is
# renamed to avoid conflicts with turbo v2's workspace validation, which
# rejects root task syntax (//#) and requires "extends" in package-level
# turbo.json files, such as when running in a site repository. The targets
# below copy it into place before running turbo and clean up after.
turbo.json: turbo.site.json
cp $< $@

# NPM doesn't bin-link workspace packages during install, so it must be done manually.
bin-link:
[ -f packages/frontend-base/package.json ] && npm rebuild --ignore-scripts @openedx/frontend-base || true

build-packages: turbo.json
$(TURBO) run build; rm -f turbo.json
$(MAKE) bin-link

i18n.concat:
# Gathering JSON messages into one file...
$(transifex_utils) $(transifex_temp) $(transifex_input)
clean-packages: turbo.json
$(TURBO) run clean; rm -f turbo.json

extract_translations: | requirements i18n.extract i18n.concat
dev-packages: build-packages turbo.json
$(TURBO) run watch:build dev:site; rm -f turbo.json

dev-site: bin-link
npm run dev

extract_translations: | requirements
npm run i18n_extract

# Despite the name, we actually need this target to detect changes in the incoming translated message files as well.
detect_changed_source_translations:
# Checking for changed translations...
git diff --exit-code $(i18n)

# Pulls translations using atlas.
pull_translations:
mkdir src/i18n/messages
cd src/i18n/messages \
&& atlas pull $(ATLAS_OPTIONS) \
translations/frontend-platform/src/i18n/messages:frontend-platform \
translations/paragon/src/i18n/messages:paragon \
translations/frontend-component-footer/src/i18n/messages:frontend-component-footer \
translations/frontend-component-header/src/i18n/messages:frontend-component-header \
translations/frontend-template-application/src/i18n/messages:frontend-template-application

$(intl_imports) frontend-platform paragon frontend-component-header frontend-component-footer frontend-template-application

pull_translations: | requirements
npm run translations:pull -- --atlas-options="$(ATLAS_OPTIONS)"

clean:
rm -rf dist

build:
tsc --project tsconfig.build.json
find src -type f \( -name '*.scss' -o -path '*/assets/*' \) -exec sh -c '\
for f in "$$@"; do \
d="dist/$${f#src/}"; \
mkdir -p "$$(dirname "$$d")"; \
cp "$$f" "$$d"; \
done' sh {} +
tsc-alias -p tsconfig.build.json

build-ci:
SITE_CONFIG_PATH=site.config.ci.tsx openedx build
Loading