Skip to content

Commit da72efc

Browse files
harounstuartromanekmyovchev
authored
add support for ESM (#4590)
* add support for ESM * switch promise timeout for nexttick * focus considerations for media uploader * remove logs * restore focus to last selected item after prop change * add import fresh * use frontend as esm in test * add missing await on moog define * add buildRoot method and test both root in cjs and esm mode * type module is required to be able to start esm mode * remove unused variables * expose buildRoot & getNpmPath methods test esm project * test esm using npm test * "fix" aws4 missing dependency * make sure we have modal * split button focus, widget priority button * use async import * fix sass warnings * async getSessionOptions * add fallback to require * update workflow dependencies * update dev dependencies * remove object.values around bundle * remove conditional rendering * flex media manager containers * Fix media manager not handling search results properly (sometimes) * async getSessionOptions and failsafe getNpmPath * fix lint issues * match when using coverage from nyc * sequential getMeta * allow build with esm support * clean changelog * remove unrelated change data * remove EOL mongo versions * remove package type * remove comment * getLocales and verifyLocales are now longer async * avoid adding .js at the end to support npm packages --------- Co-authored-by: Harouna Traoré <[email protected]> Co-authored-by: Stuart Romanek <[email protected]> Co-authored-by: Miro Yovchev <[email protected]>
1 parent 8204b67 commit da72efc

File tree

25 files changed

+524
-296
lines changed

25 files changed

+524
-296
lines changed

.github/workflows/main.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
node-version: [18, 20]
22-
mongodb-version: [4.4, 5.0, 6.0, 7.0]
21+
node-version: [18, 20, 22]
22+
mongodb-version: [6.0, 7.0, 8.0]
2323

2424
# Steps represent a sequence of tasks that will be executed as part of the job
2525
steps:
2626
- name: Git checkout
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v4
2828

2929
- name: Use Node.js ${{ matrix.node-version }}
30-
uses: actions/setup-node@v1
30+
uses: actions/setup-node@v4
3131
with:
3232
node-version: ${{ matrix.node-version }}
3333

3434
- name: Start MongoDB
35-
uses: supercharge/mongodb-github-action@1.3.0
35+
uses: supercharge/mongodb-github-action@1.11.0
3636
with:
3737
mongodb-version: ${{ matrix.mongodb-version }}
3838

.gitignore

+12-9
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
# Ignore unison sync files
44
.unison*
55
package-lock.json
6-
test/public/modules/*
7-
test/public/css/master-*
8-
test/locales
96
npm-debug.log
107
*.DS_Store
118
*.npmignore
@@ -14,12 +11,6 @@ npm-debug.log
1411
.out
1512
coverage
1613
/node_modules
17-
/test/node_modules
18-
/test/workspaces-project/node_modules
19-
test/package.json
20-
test/public
21-
test/apos-build
22-
test/workspaces-project/node_modules
2314

2415
# We do not commit CSS, only LESS, with the exception of a few vendor CSS files we don't have LESS for
2516
*/public/css/*.css
@@ -29,6 +20,18 @@ modules/*/public/css/*.css
2920
# Never commit a CSS map file, anywhere
3021
*.css.map
3122

23+
test/public/modules/*
24+
test/public/css/master-*
25+
test/locales
26+
/test/node_modules
27+
/test/workspaces-project/node_modules
28+
/test/esm-project/node_modules
29+
test/package.json
30+
test/public
31+
test/apos-build
32+
test/workspaces-project/node_modules
33+
test/esm-project/node_modules
34+
3235
# Dont commit test generated css
3336
test/public/css/*.css
3437
test/public/css/master-*.less

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Elements inside modals can have a `data-apos-focus-priority` attribute that prioritizes them inside the focusable elements list.
88
* Modals will continute trying to find focusable elements until an element marked `data-apos-focus-priority` appears or the max retry threshold is reached.
99
* Takes care of an edge case where Media Manager would duplicate search results.
10+
* Add support for ESM projects.
1011
* Modules can now have a `before: "module-name"` property in their configuration to initialize them before another module, bypassing the normal
1112
order implied by `defaults.js` and `app.js`.
1213
* `select` and `checkboxes` fields that implement dynamic choices can now take into account the value of other fields on the fly, by specifying
@@ -23,6 +24,8 @@ with dynamic choices in this way.
2324
### Changes
2425

2526
* Silence deprecation warnings from Sass 1.80+ regarding the use of `@import`. The Sass team [has stated there will be a two-year transition period](https://sass-lang.com/documentation/breaking-changes/import/#transition-period) before the feature is actually removed. The use of `@import` is common practice in the Apostrophe codebase and in many project codebases. We will arrange for an orderly migration to the new `@use` directive before Sass 3.x appears.
27+
* Internal methods `mergeConfiguration`, `autodetectBundles`, `lintModules`, `nestedModuleSubdirs` and `testDir` are now async.
28+
* `express.getSessionOptions` is now async.
2629

2730
### Fixes
2831

0 commit comments

Comments
 (0)