Skip to content

Commit 0238110

Browse files
authored
Merge pull request #362 from zimmerman-team/develop
Develop
2 parents 7f49112 + d898b68 commit 0238110

File tree

571 files changed

+45046
-19082
lines changed

Some content is hidden

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

571 files changed

+45046
-19082
lines changed

.eslintrc.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ module.exports = {
1515
extends: [
1616
"eslint-config-react-app",
1717
"react-app",
18-
"airbnb-typescript-prettier",
1918
"plugin:sonarjs/recommended",
2019
],
21-
plugins: ["sonarjs"],
20+
plugins: ["sonarjs", "no-relative-import-paths"],
2221
rules: {
2322
"@typescript-eslint/explicit-function-return-type": "off",
2423
"react/no-array-index-key": 0,
@@ -33,17 +32,23 @@ module.exports = {
3332
"@typescript-eslint/ban-ts-ignore ": 0,
3433
"@typescript-eslint/no-unused-vars": 0,
3534
"react-hooks/exhaustive-deps": 0,
36-
"no-restricted-imports": [
35+
"sonarjs/cognitive-complexity": ["error", 20],
36+
// "no-restricted-imports": [
37+
// "error",
38+
// {
39+
// paths: [
40+
// {
41+
// name: "styled-components",
42+
// message: "Please import from styled-components/macro.",
43+
// },
44+
// ],
45+
// patterns: ["!styled-components/macro"],
46+
// },
47+
// ],
48+
49+
"no-relative-import-paths/no-relative-import-paths": [
3750
"error",
38-
{
39-
paths: [
40-
{
41-
name: "styled-components",
42-
message: "Please import from styled-components/macro.",
43-
},
44-
],
45-
patterns: ["!styled-components/macro"],
46-
},
51+
{ allowSameFolder: true, rootDir: "src", prefix: "" },
4752
],
4853
},
4954
/*overrides: [

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- name: Setup Node.js
1616
uses: actions/setup-node@v4
1717
with:
18-
node-version: '16.19.1'
18+
node-version: "16.19.1"
1919

2020
- name: Install Dependencies
2121
run: yarn install
22-
22+
2323
- name: Prettier Lint
24-
run: yarn prettier src/app --check
24+
run: yarn prettier src/app --check

.github/workflows/tests.yml

Lines changed: 61 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -5,109 +5,75 @@ on:
55
pull_request:
66
branches: ["main", "develop"]
77

8-
9-
env:
10-
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
11-
# in GitHub repo → Settings → Secrets → Actions
12-
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
13-
# Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
14-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
# Custom environment variables
16-
17-
18-
# AUTH0
19-
AUTH0_USERNAME: ${{ secrets.AUTH0_USERNAME }}
20-
AUTH0_PASSWORD: ${{ secrets.AUTH0_PASSWORD }}
21-
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }}
22-
23-
REACT_APP_AUTH0_DOMAIN: ${{ secrets.REACT_APP_AUTH0_DOMAIN }}
24-
REACT_APP_AUTH0_AUDIENCE: ${{ secrets.REACT_APP_AUTH0_AUDIENCE }}
25-
REACT_APP_AUTH0_CLIENT: ${{ secrets.REACT_APP_AUTH0_CLIENT }}
26-
27-
# API
28-
REACT_APP_API: ${{ secrets.REACT_APP_API }}
29-
REACT_APP_BASE_URL: ${{ secrets.REACT_APP_BASE_URL }}
30-
REACT_APP_MAPBOX_TOKEN: ${{ secrets.REACT_APP_MAPBOX_TOKEN }}
31-
REACT_APP_GOOGLE_ANALYTICS_ID: ${{ secrets.REACT_APP_GOOGLE_ANALYTICS_ID }}
32-
REACT_APP_CMS_API: ${{ secrets.REACT_APP_CMS_API }}
33-
REACT_APP_CMS_TOKEN: ${{ secrets.REACT_APP_CMS_TOKEN }}
34-
REACT_APP_GOOGLE_API_CLIENT_ID: ${{ secrets.REACT_APP_GOOGLE_API_CLIENT_ID }}
35-
REACT_APP_GOOGLE_API_DEV_KEY: ${{ secrets.REACT_APP_GOOGLE_API_DEV_KEY }}
36-
REACT_APP_CYPRESS_TEST: "true"
37-
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
38-
GENERATE_SOURCEMAP: false
39-
40-
# GOOGLE CYPRESS
41-
GOOGLE_CLIENT_ID_TEST: ${{ secrets.GOOGLE_CLIENT_ID_TEST }}
42-
GOOGLE_CLIENT_SECRET_TEST: ${{ secrets.GOOGLE_CLIENT_SECRET_TEST }}
43-
GOOGLE_REFRESH_TOKEN_TEST: ${{ secrets.GOOGLE_REFRESH_TOKEN_TEST }}
44-
458
jobs:
46-
jest-run:
47-
runs-on: ubuntu-latest
48-
steps:
49-
- name: Checkout
50-
uses: actions/checkout@v4
51-
52-
- name: Set up Node.js
53-
uses: actions/setup-node@v4
54-
with:
55-
node-version: '16'
56-
cache: 'yarn'
57-
58-
- name: Install packages
59-
run: yarn install && yarn add "https://github.com/zimmerman-team/rawgraphs-charts.git#b86c928"
60-
61-
- name: Build rawgraphs package
62-
run: |
63-
if [ -d "node_modules/@rawgraphs/rawgraphs-charts" ]; then
64-
cd node_modules/@rawgraphs/rawgraphs-charts
65-
yarn
66-
yarn build
67-
else
68-
echo "Package directory not found"
69-
fi
70-
71-
- name: Jest run
72-
run: yarn test
9+
# jest-run:
10+
# runs-on: ubuntu-latest
11+
# steps:
12+
# - name: Checkout
13+
# uses: actions/checkout@v4
14+
15+
# - name: Set up Node.js
16+
# uses: actions/setup-node@v4
17+
# with:
18+
# node-version: "16"
19+
# cache: "yarn"
20+
21+
# - name: Install packages
22+
# run: yarn install --frozen-lockfile && yarn add "https://github.com/zimmerman-team/rawgraphs-charts.git#0fc0c9d"
23+
24+
# - name: Build rawgraphs package
25+
# run: |
26+
# if [ -d "node_modules/@rawgraphs/rawgraphs-charts" ]; then
27+
# cd node_modules/@rawgraphs/rawgraphs-charts
28+
# yarn
29+
# yarn build
30+
# else
31+
# echo "Package directory not found"
32+
# fi
33+
34+
# - name: Jest run
35+
# run: yarn test
7336

7437
cypress-run:
75-
runs-on: ubuntu-latest
38+
runs-on: [self-hosted, cypress]
7639
steps:
77-
- name: Checkout
78-
uses: actions/checkout@v4
40+
- name: Checkout to current branch
41+
run: |
42+
cd ~/DX
43+
cd dx.client
44+
git fetch origin
45+
git checkout ${{ github.head_ref || github.ref_name }}
46+
git pull origin ${{ github.head_ref || github.ref_name }}
7947
80-
- name: Set up Node.js
81-
uses: actions/setup-node@v4
82-
with:
83-
node-version: '16'
84-
cache: 'yarn'
48+
- name: Build yarn
49+
run: |
50+
cd ~/DX
51+
cd dx.client
52+
yarn install
8553
86-
- name: Install packages
87-
run: yarn install && yarn add "https://github.com/zimmerman-team/rawgraphs-charts.git#b86c928"
54+
- name: Run app with pm2
55+
run: |
56+
cd ~/DX
57+
cd dx.client
58+
pm2 start yarn --name "dx.client" -- start
8859
89-
- name: Build rawgraphs package
60+
- name: Wait for app to be ready
9061
run: |
91-
if [ -d "node_modules/@rawgraphs/rawgraphs-charts" ]; then
92-
cd node_modules/@rawgraphs/rawgraphs-charts
93-
yarn
94-
yarn build
95-
else
96-
echo "Package directory not found"
97-
fi
98-
62+
cd ~/DX
63+
cd dx.client
64+
while ! curl -s -f -o /dev/null http://localhost:3000; do sleep 5; done
65+
echo "App is ready"
66+
9967
- name: Cypress run
10068
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
101-
uses: cypress-io/github-action@v6
102-
with:
103-
# Starts web server for E2E tests - replace with your own server invocation
104-
# https://docs.cypress.io/guides/continuous-integration/introduction#Boot-your-server
105-
start: yarn start
106-
wait-on: "http://127.0.0.1:3000" # Waits for above
107-
wait-on-timeout: 180
108-
# Records to Cypress Cloud
109-
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
110-
record: true
111-
# parallel: true # Runs test in parallel using settings above
112-
69+
run: |
70+
cd ~/DX
71+
cd dx.client
72+
npx cypress run --record --key ${{ secrets.CYPRESS_RECORD_KEY }}
11373
74+
- name: Stop pm2
75+
run: |
76+
cd ~/DX
77+
cd dx.client
78+
pm2 stop dx.client
79+
pm2 delete dx.client

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,8 @@ cypress.env.json
7575
cypress/fixtures/localStorage.json
7676
cypress/e2e/3-getting-started
7777
cypress/e2e/2-advanced-examples
78+
cypress/downloads/
7879

7980
rawgraphs-charts
81+
82+
.vscode

.husky/pre-commit

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
yarn prettier src/app --check
4+
# Get staged files in src/app directory to check with prettier.
5+
files=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^src/app/.*\.(js|jsx|ts|tsx|json)$' || true)
56

7+
# Check if there are any files to format
8+
if [ -n "$files" ]; then
9+
echo "Checking formatting for: $files"
10+
yarn prettier --check $files
11+
npx eslint $files
12+
else
13+
echo "No matching files to check."
14+
fi

.stylelintrc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
2-
"processors": [
3-
"stylelint-processor-styled-components"
4-
],
2+
"processors": ["stylelint-processor-styled-components"],
53
"extends": [
64
"stylelint-config-recommended",
75
"stylelint-config-styled-components"
86
]
9-
}
7+
}

.vscode/settings.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

GruntFile.js

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1-
module.exports = function(grunt) {
1+
module.exports = function (grunt) {
2+
// Project configuration.
3+
grunt.initConfig({
4+
pkg: grunt.file.readJSON("package.json"),
25

3-
// Project configuration.
4-
grunt.initConfig({
5-
pkg: grunt.file.readJSON('package.json'),
6-
7-
svgstore: {
8-
options: {
9-
prefix : 'plyr-', // This will prefix each ID
10-
svg: { // will add and overide the the default xmlns="http://www.w3.org/2000/svg" attribute to the resulting SVG
11-
viewBox : '0 0 100 100',
12-
xmlns: 'http://www.w3.org/2000/svg'
13-
}
6+
svgstore: {
7+
options: {
8+
prefix: "plyr-", // This will prefix each ID
9+
svg: {
10+
// will add and overide the the default xmlns="http://www.w3.org/2000/svg" attribute to the resulting SVG
11+
viewBox: "0 0 100 100",
12+
xmlns: "http://www.w3.org/2000/svg",
1413
},
15-
default : {
16-
files: {
17-
'dest/svg-defs.svg': ['plyr-svgs/*.svg'],
18-
}
19-
},
20-
14+
},
15+
default: {
16+
files: {
17+
"dest/svg-defs.svg": ["plyr-svgs/*.svg"],
2118
},
22-
});
23-
24-
// Load the plugin that provides the "uglify" task.
25-
// grunt.loadNpmTasks('grunt-contrib-uglify');
26-
grunt.loadNpmTasks('grunt-svgstore');
27-
28-
// Default task(s).
29-
grunt.registerTask('default', ['svgstore']);
19+
},
20+
},
21+
});
22+
23+
// Load the plugin that provides the "uglify" task.
24+
// grunt.loadNpmTasks('grunt-contrib-uglify');
25+
grunt.loadNpmTasks("grunt-svgstore");
3026

31-
32-
};
27+
// Default task(s).
28+
grunt.registerTask("default", ["svgstore"]);
29+
};

craco.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = () => {
3030
loaders: [
3131
{
3232
test: /plugin\.css$/,
33-
loaders: ['style-loader', 'css'],
33+
loaders: ["style-loader", "css"],
3434
},
3535
],
3636
},

cypress.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ export default defineConfig({
2424
},
2525
baseUrl: process.env.REACT_APP_BASE_URL,
2626
},
27-
experimentalMemoryManagement: true,
2827
});

0 commit comments

Comments
 (0)