This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from openedx/hajorg/nova-77-react-setup
chore: Initial setup
- Loading branch information
Showing
18 changed files
with
38,820 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
NODE_ENV='production' | ||
ACCESS_TOKEN_COOKIE_NAME='' | ||
BASE_URL='' | ||
CSRF_TOKEN_API_PATH='' | ||
LMS_BASE_URL='' | ||
LOGIN_URL='' | ||
LOGOUT_URL='' | ||
REFRESH_ACCESS_TOKEN_ENDPOINT='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
NODE_ENV='development' | ||
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload' | ||
BASE_URL='http://localhost:8080' | ||
CSRF_TOKEN_API_PATH='/csrf/api/v1/token' | ||
LMS_BASE_URL='http://localhost:18000' | ||
LOGIN_URL='http://localhost:18000/login' | ||
LOGOUT_URL='http://localhost:18000/logout' | ||
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
coverage/* | ||
dist/ | ||
node_modules/ | ||
jest.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
const { createConfig } = require('@edx/frontend-build'); | ||
|
||
module.exports = createConfig( | ||
'eslint', | ||
{ | ||
rules: { | ||
'jsx-a11y/label-has-associated-control': [2, { | ||
controlComponents: ['Input'], | ||
}], | ||
'template-curly-spacing': 'off', | ||
'react-hooks/exhaustive-deps': 'off', | ||
indent: ['error', 2], | ||
'no-restricted-exports': 'off', | ||
}, | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.cache | ||
.DS_Store | ||
coverage | ||
dist | ||
node_modules | ||
temp | ||
src/i18n/transifex_input.json | ||
.vscode/ | ||
*~ | ||
module.config.js | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
export TRANSIFEX_RESOURCE = frontend-component-header-edx | ||
transifex_resource = frontend-component-header-edx | ||
transifex_langs = "ar,fr,es_419,zh_CN,pt,it,de,uk,ru,hi,fr_CA" | ||
|
||
transifex_utils = ./node_modules/.bin/transifex-utils.js | ||
i18n = ./src/i18n | ||
transifex_input = $(i18n)/transifex_input.json | ||
|
||
# This directory must match .babelrc . | ||
transifex_temp = ./temp/babel-plugin-formatjs | ||
|
||
build: | ||
rm -rf ./dist | ||
./node_modules/.bin/fedx-scripts babel src --out-dir dist --source-maps --ignore **/*.test.jsx,**/__mocks__,**/__snapshots__,**/setupTest.js --copy-files | ||
@# --copy-files will bring in everything else that wasn't processed by babel. Remove what we don't want. | ||
@rm -rf dist/*.test.jsx | ||
@rm -rf dist/**/*.test.jsx | ||
@rm -rf dist/**/__snapshots__ | ||
@rm -rf dist/__mocks__ | ||
|
||
requirements: | ||
npm install | ||
|
||
test: | ||
npm run test | ||
|
||
i18n.extract: | ||
# Pulling display strings from .jsx files into .json files... | ||
rm -rf $(transifex_temp) | ||
npm run-script i18n_extract | ||
|
||
i18n.concat: | ||
# Gathering JSON messages into one file... | ||
$(transifex_utils) $(transifex_temp) $(transifex_input) | ||
|
||
extract_translations: | requirements i18n.extract i18n.concat | ||
|
||
# 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) | ||
|
||
# Pushes translations to Transifex. You must run make extract_translations first. | ||
push_translations: | ||
# Pushing strings to Transifex... | ||
tx push -s | ||
# Fetching hashes from Transifex... | ||
./node_modules/@edx/reactifex/bash_scripts/get_hashed_strings_v3.sh | ||
# Writing out comments to file... | ||
$(transifex_utils) $(transifex_temp) --comments --v3-scripts-path | ||
# Pushing comments to Transifex... | ||
./node_modules/@edx/reactifex/bash_scripts/put_comments_v3.sh | ||
|
||
# Pulls translations from Transifex. | ||
pull_translations: | ||
tx pull -t -f --mode reviewed --languages=$(transifex_langs) | ||
|
||
# This target is used by Travis. | ||
validate-no-uncommitted-package-lock-changes: | ||
# Checking for package-lock.json changes... | ||
git diff --exit-code package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
target: auto | ||
threshold: 0% | ||
patch: | ||
default: | ||
target: auto | ||
threshold: 0% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const { createConfig } = require('@edx/frontend-build'); | ||
|
||
module.exports = createConfig('jest', { | ||
setupFilesAfterEnv: [ | ||
'<rootDir>/src/setupTest.js', | ||
], | ||
}); |
Oops, something went wrong.