Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge alpha to master #897

Merged
merged 71 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
3dd0e59
feat: replace CRA with Vite [LIBS-598] (#847)
KaiVandivier Jun 6, 2024
c01de62
chore(release): cut 12.0.0-alpha.1 [skip release]
dhis2-bot Jun 6, 2024
59bae7e
Merge branch 'master' into catch-up-alpha-12-with-master
KaiVandivier Jun 17, 2024
5789973
Merge branch 'master' into catch-up-alpha-12-with-master
KaiVandivier Jun 20, 2024
430debe
Merge pull request #853 from dhis2/catch-up-alpha-12-with-master
KaiVandivier Jun 20, 2024
9cf797c
chore(release): cut 12.0.0-alpha.2 [skip release]
dhis2-bot Jun 20, 2024
c8331ac
Merge branch 'master' into alpha
KaiVandivier Jul 8, 2024
95129e9
chore(release): cut 12.0.0-alpha.3 [skip release]
dhis2-bot Jul 8, 2024
411afc7
Merge branch 'master' into alpha
KaiVandivier Jul 23, 2024
197f58a
chore(release): cut 12.0.0-alpha.4 [skip release]
dhis2-bot Jul 23, 2024
ca5be0d
feat: handle plugins with Vite [LIBS-610] (#863)
KaiVandivier Jul 25, 2024
7cc9afb
chore(release): cut 12.0.0-alpha.5 [skip release]
dhis2-bot Jul 25, 2024
4eda4a9
feat(init): set direction: 'auto' and import locales for new apps [LI…
KaiVandivier Aug 12, 2024
71d1f67
chore(release): cut 12.0.0-alpha.6 [skip release]
dhis2-bot Aug 12, 2024
0233949
fix: allow serving files from cwd node_modules
KaiVandivier Aug 15, 2024
5f4683c
feat: enable HMR for .js files
KaiVandivier Aug 15, 2024
3e39373
Merge pull request #870 from dhis2/libs-635-initial-fixes
KaiVandivier Aug 16, 2024
b5bdfe6
chore(release): cut 12.0.0-alpha.7 [skip release]
dhis2-bot Aug 16, 2024
7f19259
fix: base url env & refactor [LIBS-635] (#872)
KaiVandivier Aug 27, 2024
4f88ba2
chore(release): cut 12.0.0-alpha.8 [skip release]
dhis2-bot Aug 27, 2024
a0d266e
fix: injectPrecacheManifest warning logging
KaiVandivier Aug 27, 2024
dc5efa6
chore(release): cut 12.0.0-alpha.9 [skip release]
dhis2-bot Aug 27, 2024
eaf5e66
fix: use strings for 'boolean' env vars
KaiVandivier Aug 28, 2024
b4dc694
chore(release): cut 12.0.0-alpha.10 [skip release]
dhis2-bot Aug 28, 2024
7764f49
feat: jsx migration script (#869)
KaiVandivier Aug 29, 2024
05c7fd2
chore(release): cut 12.0.0-alpha.11 [skip release]
dhis2-bot Aug 29, 2024
9a81c4a
fix: update workbox deps to avoid deprecation warnings
KaiVandivier Aug 30, 2024
feee056
chore(release): cut 12.0.0-alpha.12 [skip release]
dhis2-bot Aug 30, 2024
b20ed22
fix: increase precache max file size to 3 MB
KaiVandivier Sep 2, 2024
1e2caa1
chore(release): cut 12.0.0-alpha.13 [skip release]
dhis2-bot Sep 2, 2024
f300c12
docs: typos and emphasis
KaiVandivier Sep 6, 2024
77ecf10
feat: upgrade react to v18 (#876)
kabaros Sep 12, 2024
313daae
chore(release): cut 12.0.0-alpha.14 [skip release]
dhis2-bot Sep 12, 2024
595a35d
fix: handle jsx in js support [LIBS-633] (#871)
KaiVandivier Oct 1, 2024
1e7ce93
fix: update deps
KaiVandivier Oct 1, 2024
282147b
chore(release): cut 12.0.0-alpha.15 [skip release]
dhis2-bot Oct 1, 2024
521f483
feat: migrate snap files too (#878)
KaiVandivier Oct 8, 2024
2795f79
feat: create initial TS template (#868)
kabaros Oct 8, 2024
cc19467
chore(release): cut 12.0.0-alpha.16 [skip release]
dhis2-bot Oct 8, 2024
1ae9569
fix: bump ui library (#882)
kabaros Oct 8, 2024
8209788
chore(release): cut 12.0.0-alpha.17 [skip release]
dhis2-bot Oct 8, 2024
21be0d2
fix: alerts from plugins [LIBS-695] (#881)
KaiVandivier Oct 9, 2024
cd61ea9
chore(release): cut 12.0.0-alpha.18 [skip release]
dhis2-bot Oct 9, 2024
a1af71c
fix: correct app shell paths (#883)
KaiVandivier Oct 10, 2024
a4b7b40
chore(release): cut 12.0.0-alpha.19 [skip release]
dhis2-bot Oct 10, 2024
71cef4b
fix: remove custom eslint from TS template
kabaros Oct 25, 2024
0d757db
chore(release): cut 12.0.0-alpha.20 [skip release]
dhis2-bot Oct 28, 2024
84da4e6
fix: env refactor for Vite wrap-up [LIBS-690] (#889)
KaiVandivier Oct 30, 2024
64d7ce9
chore(release): cut 12.0.0-alpha.21 [skip release]
dhis2-bot Oct 30, 2024
56bbfd4
docs: v12 migration guide [LIBS-689] (#884)
KaiVandivier Nov 5, 2024
54c1aae
Merge branch 'master' into alpha
KaiVandivier Nov 6, 2024
4543f45
chore(release): cut 12.0.0-alpha.22 [skip release]
dhis2-bot Nov 6, 2024
e123d22
chore: remove todos (#891)
kabaros Nov 7, 2024
a90a4e0
fix(service-worker): handle undefined config vars in injectPrecacheMa…
KaiVandivier Nov 8, 2024
93d6815
chore: format
KaiVandivier Nov 8, 2024
6e90419
chore(release): cut 12.0.0-alpha.23 [skip release]
dhis2-bot Nov 8, 2024
58b33a8
fix: normalize to .js extensions when compiling libraries (#893)
amcgee Nov 21, 2024
d7a5007
chore(release): cut 12.0.0-alpha.24 [skip release]
dhis2-bot Nov 21, 2024
179305f
fix: clear only required build dirs (#894)
amcgee Nov 21, 2024
0794a4d
chore(release): cut 12.0.0-alpha.25 [skip release]
dhis2-bot Nov 21, 2024
8ed0ec3
fix(deps): upgrade app-runtime and ui (#895)
KaiVandivier Dec 6, 2024
3980f6a
chore(release): cut 12.0.0-alpha.26 [skip release]
dhis2-bot Dec 6, 2024
5b92212
chore: yarn to fix deps
KaiVandivier Dec 9, 2024
f113dd5
fix(plugin): clean up resize observer and handle sonarqube warnings (…
KaiVandivier Dec 10, 2024
33c261a
fix(init): update bootstrap script branch (#896)
KaiVandivier Dec 10, 2024
39cead3
chore(release): cut 12.0.0-alpha.27 [skip release]
dhis2-bot Dec 10, 2024
e5366bd
chore(deps): fix yarn again
KaiVandivier Dec 10, 2024
7fd16d7
fix(deps): upgrade react to 18 in example apps (#900)
KaiVandivier Dec 11, 2024
c3ba963
chore(release): cut 12.0.0-alpha.28 [skip release]
dhis2-bot Dec 11, 2024
01ad502
fix(deps): use npm v6 before publishing
KaiVandivier Dec 11, 2024
17c8240
chore(release): cut 12.0.0-alpha.29 [skip release]
dhis2-bot Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/cli/assets
**/locales/index.js
cli/config/init.entrypoint.js
cli/config/init.App.test.js
# These are to avoid lint errors like 'cannot find module App.jsx'
cli/config/templates/init/entrypoint.jsx
cli/config/templates/init/App.test.jsx
cli/config/templates/init-typescript/entrypoint.tsx
cli/config/templates/init-typescript/App.test.tsx
cli/config/templates/init-typescript/global.d.ts
cli/config/templates/init-typescript/modules.d.ts
2 changes: 1 addition & 1 deletion .github/workflows/dhis2-deploy-netlify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x

- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dhis2-verify-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x

- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
Expand All @@ -43,7 +43,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x

- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
Expand All @@ -59,7 +59,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x

- uses: actions/download-artifact@v4
with:
Expand All @@ -81,7 +81,7 @@ jobs:
token: ${{env.GH_TOKEN}}
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x

- uses: actions/download-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ cli/assets

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
67 changes: 40 additions & 27 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,100 +1,113 @@
## [11.7.5](https://github.com/dhis2/app-platform/compare/v11.7.4...v11.7.5) (2024-11-04)
# [12.0.0-alpha.26](https://github.com/dhis2/app-platform/compare/v12.0.0-alpha.25...v12.0.0-alpha.26) (2024-12-06)


### Bug Fixes

* **publishVersion:** fix maxBodyLength when uploading to appHub ([c5abfd1](https://github.com/dhis2/app-platform/commit/c5abfd10d2ad04c09797cec2c2abb1a823d93dd9))
* **deps:** upgrade app-runtime and ui ([#895](https://github.com/dhis2/app-platform/issues/895)) ([8ed0ec3](https://github.com/dhis2/app-platform/commit/8ed0ec3b2e3468d256c7ca5f335c43fcfd040ef6))

## [11.7.4](https://github.com/dhis2/app-platform/compare/v11.7.3...v11.7.4) (2024-10-22)
# [12.0.0-alpha.25](https://github.com/dhis2/app-platform/compare/v12.0.0-alpha.24...v12.0.0-alpha.25) (2024-11-21)


### Bug Fixes

* bump typescript version used in app shell ([8ebb2e8](https://github.com/dhis2/app-platform/commit/8ebb2e8dc46e2747b71226906bf0565eb041bb66))
* clear only required build dirs ([#894](https://github.com/dhis2/app-platform/issues/894)) ([179305f](https://github.com/dhis2/app-platform/commit/179305ff268a215f0bd0ea1f8edd39f3e3ecbba3))

## [11.7.3](https://github.com/dhis2/app-platform/compare/v11.7.2...v11.7.3) (2024-10-21)
# [12.0.0-alpha.24](https://github.com/dhis2/app-platform/compare/v12.0.0-alpha.23...v12.0.0-alpha.24) (2024-11-21)


### Bug Fixes

* add @babel/plugin-syntax-dynamic-import as a direct dependency ([#886](https://github.com/dhis2/app-platform/issues/886)) ([8c5ef0c](https://github.com/dhis2/app-platform/commit/8c5ef0c394a6cd639daefaae44c786f4919ebd62))
* normalize to .js extensions when compiling libraries ([#893](https://github.com/dhis2/app-platform/issues/893)) ([58b33a8](https://github.com/dhis2/app-platform/commit/58b33a812ba22e58a966a535c432dafea4cb8880))

## [11.7.2](https://github.com/dhis2/app-platform/compare/v11.7.1...v11.7.2) (2024-09-26)
# [12.0.0-alpha.23](https://github.com/dhis2/app-platform/compare/v12.0.0-alpha.22...v12.0.0-alpha.23) (2024-11-08)


### Bug Fixes

* provide fallback api version [LIBS-683] ([#877](https://github.com/dhis2/app-platform/issues/877)) ([dc7bdfa](https://github.com/dhis2/app-platform/commit/dc7bdfab893bdf44ad439e49b25ad3611191ad7a))
* **service-worker:** handle undefined config vars in injectPrecacheManifest ([a90a4e0](https://github.com/dhis2/app-platform/commit/a90a4e06b25cdecfaf31f24dc51f28c98f20d122))

## [11.7.1](https://github.com/dhis2/app-platform/compare/v11.7.0...v11.7.1) (2024-08-27)
# [12.0.0-alpha.22](https://github.com/dhis2/app-platform/compare/v12.0.0-alpha.21...v12.0.0-alpha.22) (2024-11-06)


### Bug Fixes

* **publishVersion:** fix maxBodyLength when uploading to appHub ([c5abfd1](https://github.com/dhis2/app-platform/commit/c5abfd10d2ad04c09797cec2c2abb1a823d93dd9))
* add @babel/plugin-syntax-dynamic-import as a direct dependency ([#886](https://github.com/dhis2/app-platform/issues/886)) ([8c5ef0c](https://github.com/dhis2/app-platform/commit/8c5ef0c394a6cd639daefaae44c786f4919ebd62))
* bump typescript version used in app shell ([8ebb2e8](https://github.com/dhis2/app-platform/commit/8ebb2e8dc46e2747b71226906bf0565eb041bb66))
* provide fallback api version [LIBS-683] ([#877](https://github.com/dhis2/app-platform/issues/877)) ([dc7bdfa](https://github.com/dhis2/app-platform/commit/dc7bdfab893bdf44ad439e49b25ad3611191ad7a))
* update app-runtime dependency ([74a2165](https://github.com/dhis2/app-platform/commit/74a21655bee64c9ca4e6285486b4fabb8bc76959))

# [11.7.0](https://github.com/dhis2/app-platform/compare/v11.6.4...v11.7.0) (2024-07-23)
## [11.7.5](https://github.com/dhis2/app-platform/compare/v11.7.4...v11.7.5) (2024-11-04)


### Features
### Bug Fixes

* update boilerplate app code for init command [LIBS-644] ([#866](https://github.com/dhis2/app-platform/issues/866)) ([bd6cfc0](https://github.com/dhis2/app-platform/commit/bd6cfc0d132b40c91b44fcdc715befabf2d7e4cf))
* **publishVersion:** fix maxBodyLength when uploading to appHub ([c5abfd1](https://github.com/dhis2/app-platform/commit/c5abfd10d2ad04c09797cec2c2abb1a823d93dd9))

## [11.6.4](https://github.com/dhis2/app-platform/compare/v11.6.3...v11.6.4) (2024-07-19)
## [11.7.4](https://github.com/dhis2/app-platform/compare/v11.7.3...v11.7.4) (2024-10-22)


### Bug Fixes

* use i18next-scanner v3 for better i18next compatibility ([#864](https://github.com/dhis2/app-platform/issues/864)) ([84a5a59](https://github.com/dhis2/app-platform/commit/84a5a59747eef82ec85eb602cfef9040efc8fd8a))
* bump typescript version used in app shell ([8ebb2e8](https://github.com/dhis2/app-platform/commit/8ebb2e8dc46e2747b71226906bf0565eb041bb66))

## [11.6.3](https://github.com/dhis2/app-platform/compare/v11.6.2...v11.6.3) (2024-07-16)
## [11.7.3](https://github.com/dhis2/app-platform/compare/v11.7.2...v11.7.3) (2024-10-21)


### Bug Fixes

* **deps:** update i18next-scanner version to support old plurals format again ([#861](https://github.com/dhis2/app-platform/issues/861)) ([d0e433b](https://github.com/dhis2/app-platform/commit/d0e433bf0ca213641770e68cf8beb0780570e5c3))
* add @babel/plugin-syntax-dynamic-import as a direct dependency ([#886](https://github.com/dhis2/app-platform/issues/886)) ([8c5ef0c](https://github.com/dhis2/app-platform/commit/8c5ef0c394a6cd639daefaae44c786f4919ebd62))

## [11.6.2](https://github.com/dhis2/app-platform/compare/v11.6.1...v11.6.2) (2024-07-10)
## [11.7.2](https://github.com/dhis2/app-platform/compare/v11.7.1...v11.7.2) (2024-09-26)


### Bug Fixes

* plugin boundary retry if plugin logic is skipped ([#862](https://github.com/dhis2/app-platform/issues/862)) ([01a3160](https://github.com/dhis2/app-platform/commit/01a3160242a8352f0bcde229b3e860e396ff5be5))
* provide fallback api version [LIBS-683] ([#877](https://github.com/dhis2/app-platform/issues/877)) ([dc7bdfa](https://github.com/dhis2/app-platform/commit/dc7bdfab893bdf44ad439e49b25ad3611191ad7a))

## [11.6.1](https://github.com/dhis2/app-platform/compare/v11.6.0...v11.6.1) (2024-07-05)
## [11.7.1](https://github.com/dhis2/app-platform/compare/v11.7.0...v11.7.1) (2024-08-27)


### Bug Fixes

* **alerts:** ensure hiding works correctly and alerts are not re-added [DHIS2-15438] ([#859](https://github.com/dhis2/app-platform/issues/859)) ([6b11fff](https://github.com/dhis2/app-platform/commit/6b11fff033cc16ed4d2f11caf74e8c18307abc3c))
* update app-runtime dependency ([74a2165](https://github.com/dhis2/app-platform/commit/74a21655bee64c9ca4e6285486b4fabb8bc76959))

# [11.6.0](https://github.com/dhis2/app-platform/compare/v11.5.1...v11.6.0) (2024-07-03)
# [11.7.0](https://github.com/dhis2/app-platform/compare/v11.6.4...v11.7.0) (2024-07-23)


### Features

* parse additional namespaces from `d2.config.js` and add to `manifest.webapp` [LIBS-638] ([#860](https://github.com/dhis2/app-platform/issues/860)) ([62782fe](https://github.com/dhis2/app-platform/commit/62782fed6f59a439ab2ef7f00c7e7d88110a78bf))
* update boilerplate app code for init command [LIBS-644] ([#866](https://github.com/dhis2/app-platform/issues/866)) ([bd6cfc0](https://github.com/dhis2/app-platform/commit/bd6cfc0d132b40c91b44fcdc715befabf2d7e4cf))

## [11.5.1](https://github.com/dhis2/app-platform/compare/v11.5.0...v11.5.1) (2024-07-01)
# [12.0.0-alpha.3](https://github.com/dhis2/app-platform/compare/v12.0.0-alpha.2...v12.0.0-alpha.3) (2024-07-08)


### Bug Fixes

* **alerts:** ensure hiding works correctly and alerts are not re-added [DHIS2-15438] ([#859](https://github.com/dhis2/app-platform/issues/859)) ([6b11fff](https://github.com/dhis2/app-platform/commit/6b11fff033cc16ed4d2f11caf74e8c18307abc3c))
* fixed dimensions plugins [LIBS-634] ([#858](https://github.com/dhis2/app-platform/issues/858)) ([1f717f3](https://github.com/dhis2/app-platform/commit/1f717f391b96a88186c897b9b886e11d6168c87c))

# [11.5.0](https://github.com/dhis2/app-platform/compare/v11.4.3...v11.5.0) (2024-06-24)
* small text change in changelog ([824dd2f](https://github.com/dhis2/app-platform/commit/824dd2f877d03a7c4d492dff8999e72421297165))


### Features

* cleanup plugin error boundary [UX-136] ([#856](https://github.com/dhis2/app-platform/issues/856)) ([de252fe](https://github.com/dhis2/app-platform/commit/de252fef91c5037b8b1c238ce25c7e3b90f7c20e))
* parse additional namespaces from `d2.config.js` and add to `manifest.webapp` [LIBS-638] ([#860](https://github.com/dhis2/app-platform/issues/860)) ([62782fe](https://github.com/dhis2/app-platform/commit/62782fed6f59a439ab2ef7f00c7e7d88110a78bf))

## [11.4.3](https://github.com/dhis2/app-platform/compare/v11.4.2...v11.4.3) (2024-06-24)
# [12.0.0-alpha.2](https://github.com/dhis2/app-platform/compare/v12.0.0-alpha.1...v12.0.0-alpha.2) (2024-06-20)


### Bug Fixes

* small text change in changelog ([824dd2f](https://github.com/dhis2/app-platform/commit/824dd2f877d03a7c4d492dff8999e72421297165))
* clean up for plugins [LIBS-620] ([#851](https://github.com/dhis2/app-platform/issues/851)) ([13af3b5](https://github.com/dhis2/app-platform/commit/13af3b5ee862ea4b7952c6a9199505cfe6a1bdaa))
* do not encode username, password ([#852](https://github.com/dhis2/app-platform/issues/852)) ([2fb4272](https://github.com/dhis2/app-platform/commit/2fb4272130000b383c91d46ba1b3dac44bb13ebf))
* don't start plugins for apps without a plugin entrypoint ([#850](https://github.com/dhis2/app-platform/issues/850)) ([a89d4cf](https://github.com/dhis2/app-platform/commit/a89d4cf348f7edc0a52b8ab9aacf96f2de939de4))


### Features

* parse pluginType from d2 config to add to manifest.webapp ([#849](https://github.com/dhis2/app-platform/issues/849)) ([c1dae23](https://github.com/dhis2/app-platform/commit/c1dae238b92183922962811a52ab50d1b73e7995))
* start plugin and app separately [LIBS-391] [LIBS-392] ([#848](https://github.com/dhis2/app-platform/issues/848)) ([82003e7](https://github.com/dhis2/app-platform/commit/82003e73fce995a83318c623da6028d9975e6686))

## [11.4.2](https://github.com/dhis2/app-platform/compare/v11.4.1...v11.4.2) (2024-06-18)

Expand Down
22 changes: 11 additions & 11 deletions adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/app-adapter",
"version": "11.7.5",
"version": "12.0.0-alpha.26",
"repository": {
"type": "git",
"url": "https://github.com/amcgee/dhis2-app-platform",
Expand All @@ -21,31 +21,31 @@
"build"
],
"dependencies": {
"@dhis2/pwa": "11.7.5",
"@dhis2/pwa": "12.0.0-alpha.26",
"moment": "^2.24.0"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "11.7.5",
"@testing-library/react": "^12.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@dhis2/cli-app-scripts": "12.0.0-alpha.26",
"@testing-library/react": "^16.0.1",
"@testing-library/dom": "^10.4.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"react": "^16.8",
"react-dom": "^16.8"
"react": "^18",
"react-dom": "^18"
},
"scripts": {
"build": "d2-app-scripts build",
"test": "d2-app-scripts test"
},
"peerDependencies": {
"@dhis2/app-runtime": "^3.10.4",
"@dhis2/app-runtime": "^3.11.1",
"@dhis2/d2-i18n": "^1",
"@dhis2/ui": ">=9.8.9",
"@dhis2/ui": ">=10.1.7",
"classnames": "^2",
"moment": "^2",
"prop-types": "^15",
"react": "^16.8",
"react-dom": "^16.8",
"react": "^18",
"react-dom": "^18",
"styled-jsx": "^4"
},
"jest": {
Expand Down
7 changes: 4 additions & 3 deletions adapter/src/utils/localeUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ export const setMomentLocale = async (locale) => {

for (const localeName of localeNameOptions) {
try {
await import(
/* webpackChunkName: "moment-locales/[request]" */ `moment/locale/${localeName}`
)
// Since Vite prefers importing the ESM form of moment, we need
// to import the ESM form of the locales here to use the same
// moment instance
await import(`moment/dist/locale/${localeName}`)
moment.locale(localeName)
break
} catch {
Expand Down
16 changes: 8 additions & 8 deletions adapter/src/utils/useLocale.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useDataQuery } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import { renderHook } from '@testing-library/react-hooks'
import { renderHook, waitFor } from '@testing-library/react'
import moment from 'moment'
import { useCurrentUserLocale } from './useLocale.js'

Expand Down Expand Up @@ -84,7 +84,7 @@ describe('formerly problematic locales', () => {
useDataQuery.mockReturnValue({
data: { userSettings: { keyUiLocale: 'pt_BR' } },
})
const { result, waitFor } = renderHook(() => useCurrentUserLocale())
const { result } = renderHook(() => useCurrentUserLocale())

expect(result.current.direction).toBe('ltr')
// Notice different locale formats
Expand All @@ -109,7 +109,7 @@ describe('formerly problematic locales', () => {
useDataQuery.mockReturnValue({
data: { userSettings: { keyUiLocale: 'ar_EG' } },
})
const { result, waitFor } = renderHook(() => useCurrentUserLocale())
const { result } = renderHook(() => useCurrentUserLocale())

expect(result.current.direction).toBe('rtl')
expect(result.current.locale.baseName).toBe('ar-EG')
Expand All @@ -127,7 +127,7 @@ describe('formerly problematic locales', () => {
useDataQuery.mockReturnValue({
data: { userSettings: { keyUiLocale: 'uz_UZ_Cyrl' } },
})
const { result, waitFor } = renderHook(() => useCurrentUserLocale())
const { result } = renderHook(() => useCurrentUserLocale())

expect(result.current.direction).toBe('ltr')
expect(result.current.locale.baseName).toBe('uz-Cyrl-UZ')
Expand All @@ -141,7 +141,7 @@ describe('formerly problematic locales', () => {
useDataQuery.mockReturnValue({
data: { userSettings: { keyUiLocale: 'uz_UZ_Latn' } },
})
const { result, waitFor } = renderHook(() => useCurrentUserLocale())
const { result } = renderHook(() => useCurrentUserLocale())

expect(result.current.direction).toBe('ltr')
expect(result.current.locale.baseName).toBe('uz-Latn-UZ')
Expand All @@ -166,7 +166,7 @@ describe('other userSettings cases', () => {
userSettings: { keyUiLocale: 'en', keyUiLanguageTag: 'pt-BR' },
},
})
const { result, waitFor } = renderHook(() => useCurrentUserLocale())
const { result } = renderHook(() => useCurrentUserLocale())

expect(result.current.direction).toBe('ltr')
expect(result.current.locale.baseName).toBe('pt-BR')
Expand All @@ -180,7 +180,7 @@ describe('other userSettings cases', () => {
useDataQuery.mockReturnValue({
data: { userSettings: {} },
})
const { result, waitFor } = renderHook(() => useCurrentUserLocale())
const { result } = renderHook(() => useCurrentUserLocale())

expect(result.current.direction).toBe('rtl')
expect(result.current.locale.baseName).toBe('ar-EG')
Expand All @@ -194,7 +194,7 @@ describe('other userSettings cases', () => {
useDataQuery.mockReturnValue({
data: { userSettings: { keyUiLocale: 'shouldCauseError' } },
})
const { result, waitFor } = renderHook(() => useCurrentUserLocale())
const { result } = renderHook(() => useCurrentUserLocale())

expect(result.current.direction).toBe('rtl')
expect(result.current.locale.baseName).toBe('ar-EG')
Expand Down
55 changes: 0 additions & 55 deletions cli/config/d2.pwa.config.js

This file was deleted.

Loading
Loading