Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
3dde93b
Initial runtime Modules work
t3chguy Jan 27, 2025
5bc85e8
Iterate
t3chguy Jan 28, 2025
e71f9e3
Iterate
t3chguy Jan 28, 2025
0e83154
Iterate
t3chguy Jan 28, 2025
35b33ac
Iterate
t3chguy Jan 28, 2025
505533a
Iterate
t3chguy Jan 28, 2025
b0c81d5
Iterate
t3chguy Jan 29, 2025
3d94420
Iterate
t3chguy Jan 29, 2025
3a5baec
Iterate
t3chguy Jan 29, 2025
2edfce5
Iterate
t3chguy Jan 29, 2025
776d077
Prettier -_-
t3chguy Jan 29, 2025
06fcf78
Fix isModule check not working for new class modules
t3chguy Jan 30, 2025
0a2f311
Wire up tests & sonarcloud
t3chguy Jan 30, 2025
8d05c53
Iterate
t3chguy Jan 30, 2025
af435b4
Delint
t3chguy Jan 30, 2025
b863347
Merge pull request #2 from element-hq/t3chguy/123
t3chguy Jan 31, 2025
dd521f5
v0.1.1
t3chguy Jan 31, 2025
47be004
Fix sonar-project.properties and be consistent with test naming
t3chguy Jan 31, 2025
e1c29f6
Bump vitest in the npm_and_yarn group across 1 directory
dependabot[bot] Feb 12, 2025
30ac522
Merge pull request #4 from element-hq/dependabot/npm_and_yarn/npm_and…
t3chguy Feb 12, 2025
1744b18
Make "yarn test" always enable coverage
AndrewFerr Feb 13, 2025
96893e8
Merge branch 'main' into af/nordeck-synapse-guest-module
t3chguy Feb 13, 2025
3253b73
Merge pull request #3 from element-hq/af/nordeck-synapse-guest-module
AndrewFerr Feb 13, 2025
d45edc8
Include Python in static analysis job
AndrewFerr Feb 13, 2025
0d32376
Add docker bake environment
t3chguy Feb 17, 2025
418598c
Merge branch 'main' of github.com:/element-hq/element-web-modules int…
t3chguy Feb 18, 2025
3ecce9e
Merge pull request #5 from element-hq/af/workflow-fixes
AndrewFerr Feb 18, 2025
3a729d0
Stash docker & bake
t3chguy Feb 25, 2025
f004a93
Iterate
t3chguy Mar 3, 2025
ea906ed
Iterate
t3chguy Mar 3, 2025
ca0b82d
Merge pull request #6 from element-hq/t3chguy/docker-bake
t3chguy Mar 4, 2025
2f1bc2a
Fix package.json bin & repository fields
t3chguy Mar 13, 2025
a9b1311
Who'd have thunk provenance doesn't behave as the docs describe
t3chguy Mar 13, 2025
8cfa277
Specify node version
t3chguy Mar 13, 2025
3825bd8
Fix repository URLs
t3chguy Mar 13, 2025
2954e39
Bump versions
t3chguy Mar 13, 2025
6837bba
Update EW modules docker path
t3chguy Mar 13, 2025
46a5a59
Update Dockerfile to consider all package.json files for frozen lockfile
t3chguy Mar 13, 2025
f137274
Merge pull request #13 from element-hq/dependabot/npm_and_yarn/npm_an…
t3chguy Mar 13, 2025
1246336
Merge branch 'main' into t3chguy/docker-avoid-tmp
t3chguy Mar 27, 2025
8ddc802
Merge pull request #16 from element-hq/t3chguy/docker-avoid-tmp
t3chguy Mar 27, 2025
f0686ce
Update testcontainers, tar-fs and remove duplicate script and stray l…
t3chguy Apr 11, 2025
737d306
Iterate
t3chguy Apr 28, 2025
afcf459
Merge pull request #19 from element-hq/t3chguy/tar-fs
t3chguy May 7, 2025
03e04de
Create module element-web-module-banner
t3chguy May 8, 2025
2b1fb75
Standardise lint/type scripts between modules/packages
t3chguy May 8, 2025
4b56b98
Merge branch 't3chguy/standard-scripts' of github.com:/element-hq/ele…
t3chguy May 8, 2025
d7736db
Initial stable release of the Module API
t3chguy May 13, 2025
5927495
Remove stray files
t3chguy May 13, 2025
d2c2437
Remove stray files
t3chguy May 13, 2025
eda3545
Merge branch 'main' into t3chguy/module-api-v1
t3chguy May 13, 2025
079f339
Merge pull request #24 from element-hq/t3chguy/module-api-v1
t3chguy May 13, 2025
c94eb98
Merge branch 'main' of github.com:/element-hq/element-web-modules int…
t3chguy May 14, 2025
c9ea5f8
Custom component concept piece
Half-Shot May 16, 2025
b5a7bd9
Document and types'
Half-Shot May 19, 2025
50fc7be
lint
Half-Shot May 19, 2025
e972c05
Remove context menu
Half-Shot May 20, 2025
9087712
Tidyup
Half-Shot May 20, 2025
ba5ce17
docs fix
Half-Shot May 20, 2025
b75c7ee
Merge pull request #22 from element-hq/t3chguy/banner
t3chguy May 22, 2025
b480633
Bump vite in the npm_and_yarn group across 1 directory
dependabot[bot] May 28, 2025
627355e
Merge pull request #28 from element-hq/dependabot/npm_and_yarn/npm_an…
t3chguy May 28, 2025
930a5eb
Update module API
Half-Shot May 30, 2025
0a9dffb
Merge branch 'main' into hs/custom-component-api
Half-Shot May 30, 2025
5468618
fixup
Half-Shot Jun 3, 2025
e2ae6f2
Specify options for the original component.
Half-Shot Jun 5, 2025
c6a6123
Remove unused props
Half-Shot Jun 5, 2025
60687b2
Add an example
Half-Shot Jun 5, 2025
8cf426f
tighten example
Half-Shot Jun 5, 2025
240045f
Add filter function / hints
Half-Shot Jun 9, 2025
cea6abf
Update API docs
Half-Shot Jun 12, 2025
e5bbf7b
Merge pull request #32 from element-hq/hs/custom-component-api
Half-Shot Jun 12, 2025
4e8c99d
1.1.0
Half-Shot Jun 16, 2025
66f83a9
Merge pull request #33 from element-hq/hs/module-api-v1.1.0
Half-Shot Jun 16, 2025
ead847e
Use MatrixEvent provided by us.
Half-Shot Jun 17, 2025
89102aa
fixup types
Half-Shot Jun 17, 2025
56d0c56
API update\
Half-Shot Jun 17, 2025
b38f0f2
Drop js-sdk
Half-Shot Jun 17, 2025
c49ac26
copyright
Half-Shot Jun 17, 2025
e2a8988
Mark MatrixEvent as @alpha and document.
Half-Shot Jun 17, 2025
0d4a45d
Update custom components API to have @alpha stability.
Half-Shot Jun 17, 2025
433e886
Merge pull request #34 from element-hq/hs/modules-matrix-event
Half-Shot Jun 17, 2025
fbd7c21
element-web-module-api 1.2.0
Half-Shot Jun 17, 2025
e481865
Merge pull request #35 from element-hq/element-web-module-api-1.2.0
Half-Shot Jun 17, 2025
9763807
Extend the Module API in prep of restricted-guests module
t3chguy Jun 23, 2025
20098f1
Iterate
t3chguy Jun 24, 2025
24cc245
Add message hint to prevent media from being downloaded.
Half-Shot Jul 3, 2025
cfb8c68
update sig
Half-Shot Jul 3, 2025
0b5681b
Update custom-components.ts
Half-Shot Jul 3, 2025
65ced81
Merge pull request #41 from element-hq/hs/add-allow-download
Half-Shot Jul 4, 2025
0b82316
element-web-module-api 1.3.0
Half-Shot Jul 4, 2025
6752197
Merge pull request #42 from element-hq/hs/module-api-v1.3.0
Half-Shot Jul 7, 2025
9f14297
Merge branch 'main' of github.com:/element-hq/element-web-modules int…
t3chguy Jul 16, 2025
9c2ca14
Iterate
t3chguy Jul 24, 2025
a3c31d8
Bump module-api to v1.4.0
t3chguy Jul 28, 2025
f397f0b
Fix cjs export
t3chguy Jul 29, 2025
ac81502
Bump the npm_and_yarn group across 1 directory with 2 updates
dependabot[bot] Sep 10, 2025
85ae19a
Update dependency vite to v7
renovate[bot] Sep 21, 2025
2cd86f7
Add some experimental module interfaces
dbkr Sep 24, 2025
9685775
Maybe make api-extractor happy
dbkr Sep 24, 2025
4468307
New interface for adding space panel items
dbkr Sep 25, 2025
cf869c9
Tweak api so it can be called multiple times
dbkr Sep 25, 2025
6d0a715
Tweak doc
dbkr Oct 17, 2025
b83b5f4
Add more docs
dbkr Oct 17, 2025
e1f7a79
More doc
dbkr Oct 17, 2025
b5639c2
Fix public/alpha statuses
dbkr Oct 17, 2025
c938dbe
Rename contextMenuTooltip to just tooltip
dbkr Oct 20, 2025
79344ff
Update docs
dbkr Oct 20, 2025
a41a7fa
docs
dbkr Oct 20, 2025
824f262
Make onSelected non-optional
dbkr Oct 20, 2025
214f3e2
Merge pull request #79 from element-hq/dbkr/module_experiments
dbkr Oct 21, 2025
c24cfb6
Introduce an abstraction for Room
MidhunSureshR Oct 23, 2025
949e64c
Make field protected so that Watchable can be extended
MidhunSureshR Oct 23, 2025
00f9283
Add client API
MidhunSureshR Oct 23, 2025
d0923c7
Update api doc
MidhunSureshR Oct 23, 2025
b9a90b2
Render RoomView instead of simply returning it
MidhunSureshR Oct 23, 2025
051fd6e
Add method to render room avatar
MidhunSureshR Oct 23, 2025
4930da1
Update api doc
MidhunSureshR Oct 23, 2025
7c40be9
Change method to property
MidhunSureshR Oct 23, 2025
17f1a54
Fix comment
MidhunSureshR Oct 23, 2025
cd9a21a
Add onFirstWatch and onLastWatch to watchable
MidhunSureshR Oct 23, 2025
04379cc
Return watchable in account data api
MidhunSureshR Oct 23, 2025
6b4f33b
Update API doc
MidhunSureshR Oct 23, 2025
200d52a
Add Stores API
MidhunSureshR Oct 23, 2025
97e1462
Updat api doc
MidhunSureshR Oct 23, 2025
af3d476
Convert to property
MidhunSureshR Oct 23, 2025
4ee9b05
Return a watchable
MidhunSureshR Oct 23, 2025
4381032
Update API doc
MidhunSureshR Oct 23, 2025
0f6ac0a
Merge pull request #111 from element-hq/midhun/multiroom/builtins-api
MidhunSureshR Oct 27, 2025
0c0fc60
Merge pull request #110 from element-hq/midhun/multiroom/stores-api
MidhunSureshR Oct 27, 2025
4698f68
Merge pull request #109 from element-hq/midhun/multiroom/client-api
MidhunSureshR Oct 27, 2025
10d73fa
Bump vite in the npm_and_yarn group across 1 directory
dependabot[bot] Oct 20, 2025
74acfb8
Add openRoom to Navigation
MidhunSureshR Oct 28, 2025
879c5c4
Update doc
MidhunSureshR Oct 28, 2025
81212a3
feat(builtins): add `hideHeader` and `hideComposer` props to `RoomVie…
florianduros Oct 28, 2025
ca6443e
chore: update api.md
florianduros Oct 28, 2025
ef9732c
Merge pull request #113 from element-hq/midhun/multiroom/navigation
MidhunSureshR Oct 28, 2025
afa2984
refactor(builtins): remove `roomId` from `RoomViewProps`
florianduros Oct 29, 2025
07ab08a
Merge pull request #114 from element-hq/florianduros/ew-api-room-view…
florianduros Oct 29, 2025
b7385d8
Update package.json
MidhunSureshR Oct 29, 2025
3d4b42c
Merge pull request #115 from element-hq/midhun/bump/module-api
MidhunSureshR Oct 29, 2025
a1cd212
Reset patch version as well
MidhunSureshR Oct 29, 2025
815b80e
Merge pull request #116 from element-hq/midhun/bump/module-api-1.5.0
MidhunSureshR Oct 29, 2025
9b8c26f
Merge pull request #106 from element-hq/dependabot/npm_and_yarn/npm_a…
florianduros Oct 30, 2025
4125ebe
Update dependency vitest-sonar-reporter to v3
renovate[bot] Nov 12, 2025
e197f0e
Update vitest monorepo to v4 (#128)
renovate[bot] Nov 12, 2025
2612dcd
Merge branch 'main' into renovate/vitest-sonar-reporter-3.x
t3chguy Nov 12, 2025
6a4c529
Delint
t3chguy Nov 12, 2025
44c3d76
Merge pull request #126 from element-hq/renovate/major-eslint-plugins
t3chguy Nov 12, 2025
a66fd6e
feat: add option to add the right panel of a room view
florianduros Nov 17, 2025
17066c0
chore: update element-web-module-api.api.md
florianduros Nov 17, 2025
99ee1f9
Pin dependencies (#63)
renovate[bot] Nov 19, 2025
7518d1c
Add `ExtraApi#getVisibleRoomBySpaceKey` (#134)
florianduros Nov 21, 2025
c570936
Merge pull request #135 from element-hq/florianduros/rooms-hide-pinne…
florianduros Nov 21, 2025
ef180bf
chore(EW module): bump to v1.6.0
florianduros Nov 21, 2025
8019035
Merge pull request #136 from element-hq/florianduros/release-ew-1.6.0
florianduros Nov 21, 2025
56662c5
Add humanizeTime to the module i18n API
dbkr Nov 26, 2025
65edff0
Better doc
dbkr Nov 28, 2025
0d69056
Merge pull request #137 from element-hq/dbkr/human_eyes
dbkr Dec 1, 2025
3d0ad97
module API 1.7.0
dbkr Dec 1, 2025
8f40ea5
Add API to render notification decoration
MidhunSureshR Dec 2, 2025
64a63bd
Update docs
MidhunSureshR Dec 2, 2025
44d8f89
Merge pull request #146 from element-hq/midhun/multiroom/render-notif…
MidhunSureshR Dec 2, 2025
2d3b554
Increment package version
MidhunSureshR Dec 2, 2025
f35357d
Add api to hide widgets
langleyd Dec 3, 2025
8412306
Merge pull request #148 from element-hq/langleyd/hideWidgets
david-langley Dec 4, 2025
94aba63
feat(ew-api): add `builtins#RoomViewProps#enableReadReceiptsAndMarker…
florianduros Nov 27, 2025
0126cde
doc: update api md doc
florianduros Dec 4, 2025
40f7bf2
Merge pull request #144 from element-hq/florianduros/ew-api/read-receipt
florianduros Dec 4, 2025
7b4894d
build(ew-api): update to 1.9.0
florianduros Dec 5, 2025
ac12b9a
Merge pull request #149 from element-hq/florianduros/ew-api/release-1…
florianduros Dec 5, 2025
9ea40d1
Update Node.js to 682368d
renovate[bot] Dec 9, 2025
02e36fd
Merge pull request #151 from element-hq/renovate/node-lts-alpine
t3chguy Dec 9, 2025
9b570e5
Update ghcr.io/element-hq/element-web:latest Docker digest to a84f294
renovate[bot] Dec 11, 2025
1b28a82
Merge pull request #160 from element-hq/renovate/ghcr.io-element-hq-e…
t3chguy Dec 11, 2025
174c35b
Iterate
t3chguy Dec 11, 2025
5bb1d3d
Add widget permissions module api
david-langley Feb 18, 2026
a5ec21b
Update element-web-module-api.api.md
david-langley Feb 18, 2026
4614d2f
Remove WidgetKind and fix header
david-langley Feb 18, 2026
d51eb5d
Specify ThisType on i18nApi
t3chguy Feb 20, 2026
30c27af
Update API report for @element-hq/element-web-module-api
t3chguy Feb 20, 2026
5a3559a
Bump version from 1.9.0 to 1.9.1
t3chguy Feb 20, 2026
e98b997
Merge pull request #201 from element-hq/t3chguy-patch-2
t3chguy Feb 20, 2026
83d752c
Add MaybePromise
david-langley Feb 25, 2026
2268248
Merge pull request #198 from element-hq/langleyd/widget-lifecycle-mod…
david-langley Feb 25, 2026
3ac2b36
bump to 1.10.0
david-langley Feb 25, 2026
c9d7142
Merge pull request #204 from element-hq/langleyd/module-api-release-1…
david-langley Feb 25, 2026
7206db8
Update Node.js to 7fddd9d
renovate[bot] Mar 1, 2026
1a9ce45
Adopt shouldShowComponent customisations from legacy Module API
t3chguy Mar 2, 2026
ccf3fcf
Add API to replace Login component renderer
t3chguy Mar 2, 2026
4af0608
Merge branch 't3chguy/wat/382.2' of github.com:/element-hq/element-we…
t3chguy Mar 2, 2026
bf69ddf
Add module APIs to enable widget toggle buttons
dbkr Mar 6, 2026
267b63a
Merge branches 't3chguy/wat/382.1' and 'main' of github.com:/element-…
t3chguy Mar 6, 2026
9ad27f6
Merge pull request #210 from element-hq/t3chguy/wat/382.1
t3chguy Mar 6, 2026
e322627
Bump Module API to 1.11.0
t3chguy Mar 6, 2026
28e5008
Merge pull request #221 from element-hq/t3chguy-patch-2
t3chguy Mar 9, 2026
a96327b
Make matrix-widget-api a devDependency
dbkr Mar 9, 2026
4591a72
Change to add callback
dbkr Mar 9, 2026
3a21741
Merge remote-tracking branch 'origin/main' into dbkr/widget-toggles-api
dbkr Mar 9, 2026
90ab153
change back to unix line endings
dbkr Mar 9, 2026
82398f7
Merge pull request #219 from element-hq/dbkr/widget-toggles-api
dbkr Mar 9, 2026
196c8a0
Add default output for vitest
dbkr Mar 11, 2026
7fc83fa
Merge pull request #222 from element-hq/dbkr/vitest_default_output
dbkr Mar 12, 2026
a2ca504
Bump module API to 1.12.0
dbkr Mar 13, 2026
f3aef2f
Merge branch 'main' of github.com:/element-hq/element-web-modules int…
t3chguy Mar 20, 2026
520dfff
feat: add tags support to i18n api
florianduros Mar 26, 2026
91d153a
doc: add for `sub` in `SubstitutionValue`
florianduros Mar 27, 2026
4e72eb6
Merge pull request #227 from element-hq/florianduros/i18n-tags
florianduros Mar 30, 2026
00a2e70
chore: bump ew module api to 1.13.0
florianduros Mar 30, 2026
27f6129
Merge branch 'main' of github.com:/element-hq/element-web-modules int…
t3chguy Mar 31, 2026
86d9e32
Update Node.js to 0174333 (#235)
renovate[bot] Mar 31, 2026
6d1cd51
build(deps-dev): bump vite in the npm_and_yarn group across 1 directory
dependabot[bot] Apr 6, 2026
e0deef5
Merge pull request #245 from element-hq/dependabot/npm_and_yarn/npm_a…
t3chguy Apr 7, 2026
ec8b7bf
Merge pull request #212 from element-hq/t3chguy/wat/382
t3chguy Apr 9, 2026
ad2e6d3
mv element-web-module-api module-api
t3chguy Apr 13, 2026
7010f20
Absorb element-modules/packages/element-web-module-api into monorepo
t3chguy Apr 13, 2026
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
1 change: 1 addition & 0 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
options:
- playwright-common
- shared-components
- module-api

concurrency: release
jobs:
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:

complete:
name: jest-tests
needs: [jest_ew, vitest_sc]
needs: [jest_ew, vitest]
if: always()
runs-on: ubuntu-24.04
permissions:
Expand All @@ -120,8 +120,13 @@ jobs:
sha: ${{ github.sha }}
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

vitest_sc:
name: Vitest (Shared Components)
vitest:
name: Vitest
strategy:
matrix:
package:
- shared-components
- module-api
runs-on: ubuntu-24.04
steps:
- name: Checkout code
Expand All @@ -137,32 +142,32 @@ jobs:
node-version: "lts/*"
cache: "pnpm"

- name: Install Shared Component Deps
working-directory: "packages/shared-components"
- name: Install Deps
run: "pnpm install"

- name: Cache storybook & vitest
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: |
packages/shared-components/node_modules/.cache
packages/shared-components/node_modules/.vite/vitest
packages/${{ matrix.package }}/node_modules/.cache
packages/${{ matrix.package }}/node_modules/.vite/vitest
key: ${{ hashFiles('pnpm-lock.yaml') }}

- name: Setup playwright
uses: ./.github/actions/setup-playwright
if: matrix.package == 'shared-components'
with:
write-cache: ${{ github.event_name != 'merge_group' }}

- name: Run tests
working-directory: "packages/shared-components"
working-directory: "packages/${{ matrix.package }}"
run: pnpm test:unit --coverage=$ENABLE_COVERAGE

- name: Upload Artifact
if: env.ENABLE_COVERAGE == 'true'
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
with:
name: coverage-sharedcomponents
name: coverage-${{ matrix.package }}
path: |
packages/shared-components/coverage
!packages/shared-components/coverage/lcov-report
packages/${{ matrix.package }}/coverage
!packages/${{ matrix.package }}/coverage/lcov-report
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ webpack-stats.json
.vscode/
.env
coverage
# Auto-generated file
# Auto-generated files
*.api.md
/apps/web/src/modules.ts
/apps/web/src/modules.js
src/i18n/strings
Expand Down
1 change: 1 addition & 0 deletions apps/web/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
**/.pnpm-store
**/tsconfig.node.tsbuildinfo
**/*.md
!**/*.api.md
**/*.rst

.idea/
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"@babel/runtime": "^7.12.5",
"@element-hq/element-web-module-api": "catalog:",
"@element-hq/element-web-module-api": "workspace:*",
"@element-hq/web-shared-components": "workspace:*",
"@fontsource/fira-code": "^5",
"@fontsource/inter": "catalog:",
Expand Down
1 change: 1 addition & 0 deletions knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default {
],
ignoreBinaries: ["awk"],
},
"packages/module-api": {},
"apps/web": {
entry: [
"src/serviceworker/index.ts",
Expand Down
2 changes: 2 additions & 0 deletions packages/module-api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib/
temp/
24 changes: 24 additions & 0 deletions packages/module-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG ELEMENT_VERSION=latest@sha256:a84f294ce46e4327ebacecb78bfc94cf6a45c7ffa5104a28f06b5ac69d0b2548

FROM --platform=$BUILDPLATFORM node:lts-alpine@sha256:01743339035a5c3c11a373cd7c83aeab6ed1457b55da6a69e014a95ac4e4700b AS builder

ARG BUILD_CONTEXT

RUN apk add --no-cache jq

WORKDIR /app
COPY package.json yarn.lock ./
# Copy the package.json files of all modules & packages to ensure the frozen workspace lockfile holds up
RUN --mount=type=bind,target=/docker-context \
cd /docker-context/; \
find . -path ./node_modules -prune -o -name "package.json" -mindepth 0 -maxdepth 4 -exec cp --parents "{}" /app/ \;
RUN yarn install --frozen-lockfile --ignore-scripts
COPY tsconfig.json ./
COPY ./$BUILD_CONTEXT ./$BUILD_CONTEXT
RUN cd $BUILD_CONTEXT && yarn vite build

Check warning on line 18 in packages/module-api/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Surround this variable with double quotes; otherwise, it can lead to unexpected behavior.

See more on https://sonarcloud.io/project/issues?id=element-web&issues=AZ2GGTMMdcfJ1VAmw4df&open=AZ2GGTMMdcfJ1VAmw4df&pullRequest=33112
RUN mkdir /modules
RUN cp -r ./$BUILD_CONTEXT/lib/ /modules/$(jq -r '"\(.name)-v\(.version)"' ./$BUILD_CONTEXT/package.json)

Check warning on line 20 in packages/module-api/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Surround this variable with double quotes; otherwise, it can lead to unexpected behavior.

See more on https://sonarcloud.io/project/issues?id=element-web&issues=AZ2GGTMMdcfJ1VAmw4dh&open=AZ2GGTMMdcfJ1VAmw4dh&pullRequest=33112

Check warning on line 20 in packages/module-api/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Surround this variable with double quotes; otherwise, it can lead to unexpected behavior.

See more on https://sonarcloud.io/project/issues?id=element-web&issues=AZ2GGTMMdcfJ1VAmw4dg&open=AZ2GGTMMdcfJ1VAmw4dg&pullRequest=33112

FROM ghcr.io/element-hq/element-web:${ELEMENT_VERSION}

COPY --from=builder /modules /modules/
68 changes: 68 additions & 0 deletions packages/module-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# @element-hq/element-web-module-api

API surface for extending Element Web in a safe & predictable way.

This project is still in early development but aims to replace matrix-react-sdk-module-api and Element Web deprecated customisations.

## Using the API

Modules are loaded by Element Web at runtime via a dynamic ecmascript import, but can be bundled into a webapp for deployment convenience.

The module's default export MUST be a class which accepts a single argument, an instance of `ModuleApi`.
This class must also bear a static property `moduleApiVersion` which is a semver range string
and a `load` method which is called when the module is to be loaded.

```typescript
import type { Module, Api, ModuleFactory } from "@element-hq/element-web-module-api";

class ExampleModule implements Module {
public static readonly moduleApiVersion = "^0.1.0";

public constructor(private api: Api) {}

public async load(): Promise<void> {
// Your extension code goes here
}
}

export default ExampleModule satisfies ModuleFactory;
```

### Accessing application configuration

The `api` object passed to the module constructor provides access to the application configuration.
You can extend the Config types using declaration merging, though please ensure that you do not trust the types you specify,
and opt for runtime validation due to the dynamic nature of the configuration.

```typescript
// ...
declare module "@element-hq/element-web-module-api" {
interface Config {
"this.is.my.config.key": string;
}
}

class ExampleModule implements Module {
// ...
public async load(): Promise<void> {
const configValue = this.api.config.get("this.is.my.config.key");
// Your extension code goes here
}
}
// ...
```

## Releases

The API is versioned using semver, with the major version incremented for breaking changes.

## Copyright & License

Copyright (c) 2025 New Vector Ltd

This software is multi licensed by New Vector Ltd (Element). It can be used either:

(1) for free under the terms of the GNU Affero General Public License (as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version); OR

(2) under the terms of a paid-for Element Commercial License agreement between you and Element (the terms of which may vary depending on what you and Element have agreed to).
Unless required by applicable law or agreed to in writing, software distributed under the Licenses is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses.
Loading
Loading