Skip to content

Commit 0d214bd

Browse files
author
David Joy
committed
Copying boilerplate from template application.
1 parent 05c30f3 commit 0d214bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+18766
-0
lines changed

.dockerignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
npm-debug.log
3+
README.rst
4+
LICENSE
5+
.babelrc
6+
.eslintignore
7+
.eslintrc.json
8+
.gitignore
9+
.npmignore
10+
commitlint.config.js

.env

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
NODE_ENV='production'
2+
ACCESS_TOKEN_COOKIE_NAME=null
3+
BASE_URL=null
4+
CREDENTIALS_BASE_URL=null
5+
CSRF_TOKEN_API_PATH=null
6+
ECOMMERCE_BASE_URL=null
7+
LANGUAGE_PREFERENCE_COOKIE_NAME=null
8+
LMS_BASE_URL=null
9+
LOGIN_URL=null
10+
LOGOUT_URL=null
11+
MARKETING_SITE_BASE_URL=null
12+
ORDER_HISTORY_URL=null
13+
REFRESH_ACCESS_TOKEN_ENDPOINT=null
14+
SEGMENT_KEY=null
15+
SITE_NAME=null
16+
USER_INFO_COOKIE_NAME=null

.env.development

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
NODE_ENV='development'
2+
PORT=8080
3+
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
4+
BASE_URL='localhost:8080'
5+
CREDENTIALS_BASE_URL='http://localhost:18150'
6+
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
7+
ECOMMERCE_BASE_URL='http://localhost:18130'
8+
LANGUAGE_PREFERENCE_COOKIE_NAME='openedx-language-preference'
9+
LMS_BASE_URL='http://localhost:18000'
10+
LOGIN_URL='http://localhost:18000/login'
11+
LOGOUT_URL='http://localhost:18000/login'
12+
MARKETING_SITE_BASE_URL='http://localhost:18000'
13+
ORDER_HISTORY_URL='localhost:1996/orders'
14+
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
15+
SEGMENT_KEY=null
16+
SITE_NAME='edX'
17+
USER_INFO_COOKIE_NAME='edx-user-info'

.env.test

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
2+
BASE_URL='localhost:1995'
3+
CREDENTIALS_BASE_URL='http://localhost:18150'
4+
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
5+
ECOMMERCE_BASE_URL='http://localhost:18130'
6+
LANGUAGE_PREFERENCE_COOKIE_NAME='openedx-language-preference'
7+
LMS_BASE_URL='http://localhost:18000'
8+
LOGIN_URL='http://localhost:18000/login'
9+
LOGOUT_URL='http://localhost:18000/login'
10+
MARKETING_SITE_BASE_URL='http://localhost:18000'
11+
ORDER_HISTORY_URL='localhost:1996/orders'
12+
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
13+
SEGMENT_KEY=null
14+
SITE_NAME='edX'
15+
USER_INFO_COOKIE_NAME='edx-user-info'

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage/*
2+
dist/
3+
node_modules/
4+
jest.config.js

.eslintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const { createConfig } = require('@edx/frontend-build');
2+
3+
module.exports = createConfig('eslint');

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.DS_Store
2+
.eslintcache
3+
.idea
4+
node_modules
5+
npm-debug.log
6+
coverage
7+
8+
dist/
9+
src/i18n/transifex_input.json
10+
temp/babel-plugin-react-intl
11+
12+
### pyenv ###
13+
.python-version
14+
15+
### Emacs ###
16+
*~
17+
/temp
18+
/.vscode

.npmignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.eslintignore
2+
.eslintrc.json
3+
.gitignore
4+
.travis.yml
5+
docker-compose.yml
6+
Dockerfile
7+
Makefile
8+
npm-debug.log
9+
10+
coverage
11+
node_modules
12+
public

.travis.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: node_js
2+
node_js: 12
3+
before_install:
4+
- npm install -g npm@6
5+
install:
6+
- npm ci
7+
script:
8+
- make validate-no-uncommitted-package-lock-changes
9+
- npm run i18n_extract
10+
- npm run lint
11+
- npm run test
12+
- npm run build
13+
- npm run is-es5
14+
after_success:
15+
- codecov

Makefile

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
transifex_resource = frontend-template-application
2+
transifex_langs = "ar,fr,es_419,zh_CN"
3+
4+
transifex_utils = ./node_modules/.bin/transifex-utils.js
5+
i18n = ./src/i18n
6+
transifex_input = $(i18n)/transifex_input.json
7+
tx_url1 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/translation/en/strings/
8+
tx_url2 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/source/
9+
10+
# This directory must match .babelrc .
11+
transifex_temp = ./temp/babel-plugin-react-intl
12+
13+
precommit:
14+
npm run lint
15+
npm audit
16+
17+
requirements:
18+
npm install
19+
20+
i18n.extract:
21+
# Pulling display strings from .jsx files into .json files...
22+
rm -rf $(transifex_temp)
23+
npm run-script i18n_extract
24+
25+
i18n.concat:
26+
# Gathering JSON messages into one file...
27+
$(transifex_utils) $(transifex_temp) $(transifex_input)
28+
29+
extract_translations: | requirements i18n.extract i18n.concat
30+
31+
# Despite the name, we actually need this target to detect changes in the incoming translated message files as well.
32+
detect_changed_source_translations:
33+
# Checking for changed translations...
34+
git diff --exit-code $(i18n)
35+
36+
# Pushes translations to Transifex. You must run make extract_translations first.
37+
push_translations:
38+
# Pushing strings to Transifex...
39+
tx push -s
40+
# Fetching hashes from Transifex...
41+
./node_modules/reactifex/bash_scripts/get_hashed_strings.sh $(tx_url1)
42+
# Writing out comments to file...
43+
$(transifex_utils) $(transifex_temp) --comments
44+
# Pushing comments to Transifex...
45+
./node_modules/reactifex/bash_scripts/put_comments.sh $(tx_url2)
46+
47+
# Pulls translations from Transifex.
48+
pull_translations:
49+
tx pull -f --mode reviewed --language=$(transifex_langs)
50+
51+
# This target is used by Travis.
52+
validate-no-uncommitted-package-lock-changes:
53+
# Checking for package-lock.json changes...
54+
git diff --exit-code package-lock.json

codecov.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: auto
6+
threshold: 0%
7+
patch:
8+
default:
9+
target: auto
10+
threshold: 0%
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
1. Record Architecture Decisions
2+
--------------------------------
3+
4+
Status
5+
------
6+
7+
Accepted
8+
9+
Context
10+
-------
11+
12+
We would like to keep a historical record on the architectural
13+
decisions we make with this app as it evolves over time.
14+
15+
Decision
16+
--------
17+
18+
We will use Architecture Decision Records, as described by
19+
Michael Nygard in `Documenting Architecture Decisions`_
20+
21+
.. _Documenting Architecture Decisions: http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions
22+
23+
Consequences
24+
------------
25+
26+
See Michael Nygard's article, linked above.
27+
28+
References
29+
----------
30+
31+
* https://resources.sei.cmu.edu/asset_files/Presentation/2017_017_001_497746.pdf
32+
* https://github.com/npryce/adr-tools/tree/master/doc/adr

jest.config.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const { createConfig } = require('@edx/frontend-build');
2+
3+
module.exports = createConfig('jest', {
4+
setupFiles: [
5+
'<rootDir>/src/setupTest.js',
6+
],
7+
coveragePathIgnorePatterns: [
8+
'src/setupTest.js',
9+
'src/i18n',
10+
],
11+
});

openedx.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file describes this Open edX repo, as described in OEP-2:
2+
# https://open-edx-proposals.readthedocs.io/en/latest/oep-0002-bp-repo-metadata.html#specification
3+
4+
oeps: {}
5+
owner: edx/platform-core-tnl

0 commit comments

Comments
 (0)