Skip to content

Commit

Permalink
Merge branch 'development' into nanguan-fix-report-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lng2020 committed Feb 2, 2025
2 parents d2bba6f + 703f568 commit 4be9f9a
Show file tree
Hide file tree
Showing 357 changed files with 40,103 additions and 13,918 deletions.
Binary file removed ..env.un~
Binary file not shown.
17 changes: 10 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
command: 'sudo npm install'
- run:
name: Run react build
command: 'sudo REACT_APP_APIENDPOINT=$APIENDPOINT_PROD REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD REACT_APP_SENTRY_URL=$SENTRY_URL_PROD SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS=$NODE_OPTIONS npm run build && sudo mv build/index.html build/200.html'
command: 'sudo REACT_APP_APIENDPOINT=$APIENDPOINT_PROD REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD REACT_APP_SENTRY_URL=$SENTRY_URL_PROD SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS="$NODE_OPTIONS --max_old_space_size=4096" npm run build --prod && sudo mv build/index.html build/200.html'
- run:
name: Export error log if 'Build the React client' failed
command: |
Expand All @@ -35,6 +35,9 @@ jobs:
- run:
name: Deploy app
command: ./node_modules/.bin/surge --domain $SURGE_DOMAIN_PROD --project ./build
- run:
name: Deploy app
command: ./node_modules/.bin/surge --domain $SURGE_DOMAIN_PROD1 --project ./build
- save_cache:
key: v1-prod-dependencies-{{ checksum "package-lock.json" }}
paths:
Expand All @@ -59,7 +62,7 @@ jobs:
command: npm install
- run:
name: Build the React client
command: export REACT_APP_APIENDPOINT=$APIENDPOINT_DEV REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD REACT_APP_SENTRY_URL=$SENTRY_URL_DEV SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS=$NODE_OPTIONS && npm run build
command: export REACT_APP_APIENDPOINT=$APIENDPOINT_DEV REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD REACT_APP_SENTRY_URL=$SENTRY_URL_DEV SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS="$NODE_OPTIONS --max_old_space_size=4096" && npm run build --prod
- run:
name: Export error log if 'Build the React client' failed
command: |
Expand All @@ -80,6 +83,9 @@ jobs:
- run:
name: Deploy compiled app to surge.sh on $SURGE_DOMAIN_DEV
command: ./node_modules/.bin/surge --domain $SURGE_DOMAIN_DEV --project ./build
- run:
name: Deploy compiled app to surge.sh on $SURGE_DOMAIN_DEV1
command: ./node_modules/.bin/surge --domain $SURGE_DOMAIN_DEV1 --project ./build
- save_cache:
key: v1.1-dependencies-{{ checksum "package-lock.json" }}
paths:
Expand All @@ -100,7 +106,7 @@ jobs:
command: npm install
- run:
name: Build the React client
command: export REACT_APP_APIENDPOINT=$APIENDPOINT_BETA REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS=$NODE_OPTIONS && npm run build
command: export REACT_APP_APIENDPOINT=$APIENDPOINT_BETA REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS="$NODE_OPTIONS --max_old_space_size=4096" && npm run build --prod
- run:
name: Export error log if 'Build the React client' failed
command: |
Expand All @@ -120,10 +126,7 @@ jobs:
command: cp build/index.html build/200.html
- run:
name: Deploy compiled app to surge.sh on $SURGE_DOMAIN_BETA
command: ./node_modules/.bin/surge --domain $SURGE_DOMAIN_BETA --project ./build
- run:
name: Deploy compiled app to surge.sh on highestgood.com
command: ./node_modules/.bin/surge --domain highestgood.com --project ./build
command: ./node_modules/.bin/surge --domain $SURGE_DOMAIN_BETA --project ./build
- save_cache:
key: v1-beta-dependencies-{{ checksum "package-lock.json" }}
paths:
Expand Down
Empty file removed .env~
Empty file.
5 changes: 0 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ src/config.json
src/index.js
src/reducers/**
src/styles.js
src/utils/**
src/__tests__/**

/public/
Expand All @@ -19,17 +18,13 @@ src/components/App.jsx
src/components/AutoReload/**
src/components/Badge/**
src/components/common/**
src/components/Header/**
src/components/ProfileLinks/**
src/components/Projects/**
src/components/SetupProfile/**
src/components/SummaryBar/**
src/components/SummaryManagement/**
src/components/TaskEditSuggestions/**
src/components/TeamMemberTasks/**
src/components/Teams/**
src/components/TeamLocations/**
src/components/Timelog/**
src/components/UserManagement/**
src/components/UserProfile/**
src/components/Announcements/**
Expand Down
24 changes: 24 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": [
"airbnb",
"prettier"
],
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": "error",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
},
"env": {
"browser": true,
"es2021": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
}
}
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# File: .github/workflows/lint.yml
name: Lint React App

on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Run linter
run: npm run lint
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test React App

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: test-results # Adjust the path to your test results if necessary
6 changes: 0 additions & 6 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,21 @@ src/routes.js
src/setupTests.js
src/store.js
src/styles.js
src/utils/**
src/__tests__/**


src/components/App.jsx
src/components/AutoReload/**
src/components/Header/**
src/components/Inventory/**
src/components/Memberships/**
src/components/NewProfileLink/**
src/components/ProfileLinks/**
src/components/Projects/**
src/components/Reports/**
src/components/SetupProfile/**
src/components/SummaryBar/**
src/components/SummaryManagement/**
src/components/TaskEditSuggestions/**
src/components/TeamLocations/**
src/components/TeamMemberTasks/**
src/components/Teams/**
src/components/Timelog/**
src/components/UserManagement/**
src/components/UserProfile/**
src/components/Announcements/**
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ module.exports = {
// An array of file extensions your modules use
moduleFileExtensions: ['js', 'json', 'jsx'],

// Bundle mapper for d3 import
// Bundle mapper for d3 import and other custom mocks
moduleNameMapper: {
d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
'react-leaflet': '<rootDir>/src/_tests_/__mocks__/react-leaflet.js',
'marker-cluster-group': '<rootDir>/src/_tests_/__mocks__/react-leaflet-cluster.js',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy', // <-- Added to mock CSS/SCSS files
},

// The paths to modules that run some code to configure or set up the testing environment before each test
Expand All @@ -38,6 +39,8 @@ module.exports = {

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
transformIgnorePatterns: ['/node_modules/(?!d3|d3-array|internmap|delaunator|robust-predicates)'],

// Include snapshot serializers
snapshotSerializers: ['enzyme-to-json/serializer'],

// Indicates whether each individual test should be reported during the run
Expand Down
Loading

0 comments on commit 4be9f9a

Please sign in to comment.