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

This file was deleted.

27 changes: 0 additions & 27 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.

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

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,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
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release CI
on:
push:
branches:
- master
- 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
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 }}
19 changes: 10 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
.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
13 changes: 1 addition & 12 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
node_modules
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": "master", "prerelease": "alpha", "channel": "alpha" }
],
"tagFormat": "v${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
}
96 changes: 63 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,44 +1,74 @@
intl_imports = ./node_modules/.bin/intl-imports.js
transifex_utils = ./node_modules/.bin/transifex-utils.js
i18n = ./src/i18n
transifex_input = $(i18n)/transifex_input.json
npm-install-%: ## install specified % npm package
npm install $* --save-dev
git add package.json

# This directory must match .babelrc .
transifex_temp = ./temp/babel-plugin-formatjs
TURBO = TURBO_TELEMETRY_DISABLED=1 turbo

precommit:
npm run lint
npm audit
NPM_TESTS=build i18n_extract lint test

requirements:
.PHONY: test
test: $(addprefix test.npm.,$(NPM_TESTS)) ## validate ci suite

.PHONY: test.npm.*
test.npm.%: validate-no-uncommitted-package-lock-changes
test -d node_modules || $(MAKE) requirements
npm run $(*)

.PHONY: requirements
requirements: ## install ci 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

# 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)
dev-site: bin-link
npm run dev

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

i18n.extract:
# Pulling display strings from .jsx files into .json files...
npm run-script i18n_extract

# 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-app-admin-console/src/i18n/messages:frontend-app-admin-console
extract_translations: | requirements i18n.extract

$(intl_imports) frontend-platform paragon frontend-component-header frontend-component-footer frontend-app-admin-console
pull_translations: | requirements
npm run translations:pull -- --atlas-options="$(ATLAS_OPTIONS)"

# This target is used by CI.
validate-no-uncommitted-package-lock-changes:
# Checking for package-lock.json changes...
git diff --exit-code package-lock.json
Loading
Loading