From cb3779c9afd5f59281cd0893266cbc9f14d0c30e Mon Sep 17 00:00:00 2001 From: edvinstava Date: Wed, 21 Feb 2024 16:18:54 +0100 Subject: [PATCH 1/7] feat: added dependabot.yml and verify-app.yml --- .github/dependabot.yml | 9 +++++ .github/workflows/verify-app.yml | 62 ++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/verify-app.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1a01fa0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 5 + target-branch: master + versioning-strategy: increase diff --git a/.github/workflows/verify-app.yml b/.github/workflows/verify-app.yml new file mode 100644 index 0000000..b738889 --- /dev/null +++ b/.github/workflows/verify-app.yml @@ -0,0 +1,62 @@ +name: 'Capture Growth Chart: verify app' + +on: + push: + branches: + +jobs: + install: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[skip ci]')" + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: '**/node_modules' + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + + - name: Install + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install --frozen-lockfile + lint: + runs-on: ubuntu-latest + needs: install + if: "!contains(github.event.head_commit.message, '[skip ci]')" + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: '**/node_modules' + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + + - name: Lint + run: yarn lint + + typescript: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[skip ci]')" + needs: install + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: '**/node_modules' + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + + - name: Typescript + run: yarn tsc:check \ No newline at end of file From cabeb7067db37bc73559475a29de4fb05c8efbc8 Mon Sep 17 00:00:00 2001 From: edvinstava Date: Wed, 21 Feb 2024 19:57:03 +0100 Subject: [PATCH 2/7] fix: fixed warnings for incorrect peer dependency by downgrading react --- package.json | 8 +++----- yarn.lock | 28 +++++++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index dae1755..dfc2a06 100644 --- a/package.json +++ b/package.json @@ -33,13 +33,11 @@ "chart.js": "^3.0.0", "classnames": "^2.5.1", "react-chartjs-2": "^5.2.0", - "react-dom": "^17.0.0", - "react": "^17.0.0" + "react-dom": "^16.8.0", + "react": "^16.8.0" }, "resolutions": { "@dhis2/ui": "^9.0.1", - "@dhis2/app-runtime": "^3.10.2", - "react-dom": "^17.0.0", - "react": "^17.0.0" + "@dhis2/app-runtime": "^3.10.2" } } diff --git a/yarn.lock b/yarn.lock index c5678b7..0d09f03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10447,14 +10447,15 @@ react-dev-utils@^12.0.0, react-dev-utils@^12.0.1: strip-ansi "^6.0.1" text-table "^0.2.0" -react-dom@^16.8.6, react-dom@^17.0.0: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" - integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== +react-dom@^16.8.0, react-dom@^16.8.6: + version "16.14.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.14.0.tgz#7ad838ec29a777fb3c75c3a190f661cf92ab8b89" + integrity sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" - scheduler "^0.20.2" + prop-types "^15.6.2" + scheduler "^0.19.1" react-error-overlay@6.1.0-next.14+9802941f: version "6.1.0-next.14" @@ -10649,13 +10650,14 @@ react-transition-group@^2.2.1: prop-types "^15.6.2" react-lifecycles-compat "^3.0.4" -react@^16.8.6, react@^17.0.0: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" - integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== +react@^16.8.0, react@^16.8.6: + version "16.14.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d" + integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" + prop-types "^15.6.2" read-cache@^1.0.0: version "1.0.0" @@ -11093,10 +11095,10 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -scheduler@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" - integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== +scheduler@^0.19.1: + version "0.19.1" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" + integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" From c8dfbae734adeafbe31ff89b4c9fb44467f0a0c4 Mon Sep 17 00:00:00 2001 From: edvinstava Date: Wed, 21 Feb 2024 20:10:18 +0100 Subject: [PATCH 3/7] fix: fixed install warnings for dhis2/prop-types --- package.json | 9 ++++++--- yarn.lock | 19 ++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index dfc2a06..5ecd8cd 100644 --- a/package.json +++ b/package.json @@ -20,21 +20,24 @@ "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-react": "^7.33.2", "react-scripts": "5.1.0-next.14", - "typescript": "^4.8.3", - "tailwindcss": "^3.4.1" + "tailwindcss": "^3.4.1", + "typescript": "^4.8.3" }, "dependencies": { "@dhis2/app-runtime": "^3.10.2", "@dhis2/d2-i18n": "^1.1.3", + "@dhis2/prop-types": "^3.1.2", "@dhis2/ui": "^9.0.1", "@material-ui/core": "3.9.4", "@tanstack/react-query": "^4", "@types/chart.js": "^2.9.41", "chart.js": "^3.0.0", "classnames": "^2.5.1", + "prop-types": "15.7.2", + "react": "^16.8.0", "react-chartjs-2": "^5.2.0", "react-dom": "^16.8.0", - "react": "^16.8.0" + "styled-jsx": "^4" }, "resolutions": { "@dhis2/ui": "^9.0.1", diff --git a/yarn.lock b/yarn.lock index 0d09f03..ec4c4c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5556,9 +5556,9 @@ ejs@^3.1.5, ejs@^3.1.6: jake "^10.8.5" electron-to-chromium@^1.4.668: - version "1.4.677" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.677.tgz#49ee77713516740bdde32ac2d1443c444f0dafe7" - integrity sha512-erDa3CaDzwJOpyvfKhOiJjBVNnMM0qxHq47RheVVwsSQrgBA9ZSGV9kdaOfZDPXcHzhG7lBxhj6A7KvfLJBd6Q== + version "1.4.678" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.678.tgz#80d43226a793cf4a689722f9cbdf5d69da32beb0" + integrity sha512-NbdGC2p0O5Q5iVhLEsNBSfytaw7wbEFJlIvaF71wi6QDtLAph5/rVogjyOpf/QggJIt8hNK3KdwNJnc2bzckbw== emittery@^0.10.2: version "0.10.2" @@ -10235,6 +10235,15 @@ prompts@^2.0.1, prompts@^2.4.2: kleur "^3.0.3" sisteransi "^1.0.5" +prop-types@15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" @@ -10488,7 +10497,7 @@ react-final-form@^6.5.3: dependencies: "@babel/runtime" "^7.15.4" -react-is@^16.13.1, react-is@^16.6.3, react-is@^16.7.0: +react-is@^16.13.1, react-is@^16.6.3, react-is@^16.7.0, react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -11717,7 +11726,7 @@ style-loader@^3.3.1: resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.4.tgz#f30f786c36db03a45cbd55b6a70d930c479090e7" integrity sha512-0WqXzrsMTyb8yjZJHDqwmnwRJvhALK9LfRtRc6B4UTWe8AijYLZYZ9thuJTZc2VfQWINADW/j+LiJnfy2RoC1w== -styled-jsx@^4.0.1: +styled-jsx@^4, styled-jsx@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-4.0.1.tgz#ae3f716eacc0792f7050389de88add6d5245b9e9" integrity sha512-Gcb49/dRB1k8B4hdK8vhW27Rlb2zujCk1fISrizCcToIs+55B4vmUM0N9Gi4nnVfFZWe55jRdWpAqH1ldAKWvQ== From 1192abf0668df21e0d06ba0041c66c313915c14d Mon Sep 17 00:00:00 2001 From: edvinstava Date: Thu, 22 Feb 2024 10:56:53 +0100 Subject: [PATCH 4/7] feat: added newline check to verify.app.yml and alterations after review --- .eslintrc.json | 1 + .github/workflows/verify-app.yml | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index e185715..7ffe698 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -133,6 +133,7 @@ } } ], + "eol-last": ["error", "always"], "react-hooks/exhaustive-deps": "error", "object-curly-newline": [ "error", diff --git a/.github/workflows/verify-app.yml b/.github/workflows/verify-app.yml index b738889..f954fc5 100644 --- a/.github/workflows/verify-app.yml +++ b/.github/workflows/verify-app.yml @@ -5,14 +5,14 @@ on: branches: jobs: - install: + install_dependencies: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[skip ci]')" steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: ${{ matrix.node-version }} - uses: actions/cache@v2 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) @@ -20,10 +20,10 @@ jobs: path: '**/node_modules' key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - - name: Install + - name: Install Dependencies if: steps.yarn-cache.outputs.cache-hit != 'true' run: yarn install --frozen-lockfile - lint: + lint_code: runs-on: ubuntu-latest needs: install if: "!contains(github.event.head_commit.message, '[skip ci]')" @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: ${{ matrix.node-version }} - uses: actions/cache@v2 id: yarn-cache @@ -39,10 +39,10 @@ jobs: path: '**/node_modules' key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - - name: Lint + - name: Lint Code run: yarn lint - typescript: + typescript_check: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[skip ci]')" needs: install @@ -50,7 +50,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: ${{ matrix.node-version }} - uses: actions/cache@v2 id: yarn-cache @@ -58,5 +58,8 @@ jobs: path: '**/node_modules' key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - - name: Typescript - run: yarn tsc:check \ No newline at end of file + - name: Typescript Check + run: yarn tsc:check +strategy: + matrix: + node-version: [18.x] \ No newline at end of file From f821ed2bce1fbd5ede34cab5cf69f698c15d1c68 Mon Sep 17 00:00:00 2001 From: edvinstava Date: Thu, 22 Feb 2024 11:07:17 +0100 Subject: [PATCH 5/7] fix: fixed workflow run --- .github/workflows/verify-app.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/verify-app.yml b/.github/workflows/verify-app.yml index f954fc5..bfba9b0 100644 --- a/.github/workflows/verify-app.yml +++ b/.github/workflows/verify-app.yml @@ -4,6 +4,9 @@ on: push: branches: +env: + NODE_VERSION: 18.x + jobs: install_dependencies: runs-on: ubuntu-latest @@ -12,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} - uses: actions/cache@v2 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) @@ -31,7 +34,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} - uses: actions/cache@v2 id: yarn-cache @@ -50,7 +53,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} - uses: actions/cache@v2 id: yarn-cache @@ -60,6 +63,3 @@ jobs: - name: Typescript Check run: yarn tsc:check -strategy: - matrix: - node-version: [18.x] \ No newline at end of file From 4433619e8bb42475e7820299f7a9258e0fe15ddb Mon Sep 17 00:00:00 2001 From: edvinstava Date: Thu, 22 Feb 2024 11:08:34 +0100 Subject: [PATCH 6/7] fix: Alter needs to install_dependencies --- .github/workflows/verify-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-app.yml b/.github/workflows/verify-app.yml index bfba9b0..beb41d7 100644 --- a/.github/workflows/verify-app.yml +++ b/.github/workflows/verify-app.yml @@ -28,7 +28,7 @@ jobs: run: yarn install --frozen-lockfile lint_code: runs-on: ubuntu-latest - needs: install + needs: install_dependencies if: "!contains(github.event.head_commit.message, '[skip ci]')" steps: - uses: actions/checkout@v3 @@ -48,7 +48,7 @@ jobs: typescript_check: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[skip ci]')" - needs: install + needs: install_dependencies steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 From bdecd4926487cdf4aef71918e8973048feddda7e Mon Sep 17 00:00:00 2001 From: edvinstava Date: Thu, 22 Feb 2024 11:13:07 +0100 Subject: [PATCH 7/7] fix: added newline between jobs --- .github/workflows/verify-app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-app.yml b/.github/workflows/verify-app.yml index beb41d7..5e18cc2 100644 --- a/.github/workflows/verify-app.yml +++ b/.github/workflows/verify-app.yml @@ -18,7 +18,7 @@ jobs: node-version: ${{ env.NODE_VERSION }} - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + id: yarn-cache with: path: '**/node_modules' key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} @@ -26,6 +26,7 @@ jobs: - name: Install Dependencies if: steps.yarn-cache.outputs.cache-hit != 'true' run: yarn install --frozen-lockfile + lint_code: runs-on: ubuntu-latest needs: install_dependencies