Skip to content

Commit 90be78a

Browse files
committed
Merge branch 'main' into commerce-use-case
2 parents 46574d7 + 39a9389 commit 90be78a

File tree

162 files changed

+7710
-4508
lines changed

Some content is hidden

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

162 files changed

+7710
-4508
lines changed

.github/workflows/ci-host.yaml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI Host
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
checks: write
10+
contents: read
11+
id-token: write
12+
pull-requests: write
13+
14+
jobs:
15+
host-test:
16+
name: Host Tests
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
shardIndex: [1, 2, 3, 4, 5, 6]
22+
shardTotal: [6]
23+
concurrency:
24+
group: boxel-host-test${{ github.head_ref || github.run_id }}-shard${{ matrix.shardIndex }}
25+
cancel-in-progress: true
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: ./.github/actions/init
29+
- name: Build boxel-ui
30+
run: pnpm build
31+
working-directory: packages/boxel-ui/addon
32+
- name: Build host dist/ for fastboot
33+
run: pnpm build
34+
env:
35+
NODE_OPTIONS: --max_old_space_size=4096
36+
working-directory: packages/host
37+
- name: Start realm servers
38+
run: pnpm start:all &
39+
working-directory: packages/realm-server
40+
- name: create realm users
41+
run: pnpm register-realm-users
42+
working-directory: packages/matrix
43+
- name: host test suite (shard ${{ matrix.shardIndex }})
44+
run: pnpm test-with-percy
45+
env:
46+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_HOST }}
47+
PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_attempt }}
48+
HOST_TEST_PARTITION: ${{ matrix.shardIndex }}
49+
HOST_TEST_PARTITION_COUNT: ${{ matrix.shardTotal }}
50+
working-directory: packages/host
51+
- name: Upload junit report to GitHub Actions Artifacts
52+
uses: actions/upload-artifact@v4
53+
if: always()
54+
with:
55+
name: host-test-report-${{ matrix.shardIndex }}
56+
path: junit/host-${{ matrix.shardIndex }}.xml
57+
retention-days: 30
58+
59+
host-merge-reports-and-publish:
60+
name: Merge Host reports and publish
61+
if: always()
62+
needs: host-test
63+
runs-on: ubuntu-latest
64+
65+
steps:
66+
- uses: actions/checkout@v4
67+
- uses: ./.github/actions/init
68+
69+
- name: Finalise Percy
70+
run: npx percy build:finalize
71+
working-directory: packages/host
72+
env:
73+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_HOST }}
74+
PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_attempt }}
75+
76+
- name: Download JUnit reports from GitHub Actions Artifacts
77+
uses: actions/download-artifact@v4
78+
with:
79+
path: all-host-reports
80+
pattern: host-test-report-*
81+
merge-multiple: true
82+
83+
- run: ls
84+
- run: ls all-host-reports
85+
86+
- name: Merge reports
87+
run: npx junit-report-merger host.xml "./all-host-reports/*.xml"
88+
89+
- name: Upload merged report
90+
uses: actions/upload-artifact@v4
91+
if: always()
92+
with:
93+
name: host-test-report-merged
94+
path: host.xml
95+
retention-days: 30
96+
97+
- name: Publish test results
98+
uses: EnricoMi/publish-unit-test-result-action@v2.9.0
99+
if: always()
100+
with:
101+
junit_files: host.xml
102+
check_name: Host Test Results

.github/workflows/ci-lint.yaml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: CI Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
checks: write
10+
contents: read
11+
id-token: write
12+
pull-requests: write
13+
14+
jobs:
15+
lint:
16+
name: Lint
17+
runs-on: ubuntu-latest
18+
concurrency:
19+
group: lint-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: ./.github/actions/init
24+
- name: Lint AI Bot
25+
if: always()
26+
run: pnpm run lint
27+
working-directory: packages/ai-bot
28+
- name: Lint Boxel Motion
29+
# This addition to each step causes the job to proceed even if one lint job fails so we can see all errors
30+
if: always()
31+
run: pnpm run lint
32+
working-directory: packages/boxel-motion/addon
33+
- name: Build Boxel Motion
34+
# To faciliate linting of projects that depend on Boxel Motion
35+
if: always()
36+
run: pnpm run build
37+
working-directory: packages/boxel-motion/addon
38+
- name: Lint Boxel Motion Test App
39+
if: always()
40+
run: pnpm run lint
41+
working-directory: packages/boxel-motion/test-app
42+
- name: Lint Boxel UI
43+
if: always()
44+
run: pnpm run lint
45+
working-directory: packages/boxel-ui/addon
46+
- name: Build Boxel UI
47+
# To faciliate linting of projects that depend on Boxel UI
48+
if: always()
49+
run: pnpm run build
50+
working-directory: packages/boxel-ui/addon
51+
- name: Lint Boxel UI Test App
52+
if: always()
53+
run: pnpm run lint
54+
working-directory: packages/boxel-ui/test-app
55+
- name: Lint Boxel Motion
56+
if: always()
57+
run: pnpm run lint
58+
working-directory: packages/boxel-motion/addon
59+
- name: Build Boxel Motion
60+
# To faciliate linting of projects that depend on Boxel Motion
61+
if: always()
62+
run: pnpm run build
63+
working-directory: packages/boxel-motion/addon
64+
- name: Lint Boxel Motion Test App
65+
if: always()
66+
run: pnpm run lint
67+
working-directory: packages/boxel-motion/test-app
68+
- name: Lint Host
69+
if: always()
70+
run: pnpm run lint
71+
working-directory: packages/host
72+
- name: Lint Matrix
73+
if: always()
74+
run: pnpm run lint
75+
working-directory: packages/matrix
76+
- name: Lint Realm Server
77+
if: always()
78+
run: pnpm run lint
79+
working-directory: packages/realm-server
80+
- name: Lint Runtime Common
81+
if: always()
82+
run: pnpm run lint
83+
working-directory: packages/runtime-common

.github/workflows/ci.yaml

-106
Original file line numberDiff line numberDiff line change
@@ -12,76 +12,6 @@ permissions:
1212
pull-requests: write
1313

1414
jobs:
15-
lint:
16-
name: Lint
17-
runs-on: ubuntu-latest
18-
concurrency:
19-
group: lint-${{ github.head_ref || github.run_id }}
20-
cancel-in-progress: true
21-
steps:
22-
- uses: actions/checkout@v4
23-
- uses: ./.github/actions/init
24-
- name: Lint AI Bot
25-
if: always()
26-
run: pnpm run lint
27-
working-directory: packages/ai-bot
28-
- name: Lint Boxel Motion
29-
# This addition to each step causes the job to proceed even if one lint job fails so we can see all errors
30-
if: always()
31-
run: pnpm run lint
32-
working-directory: packages/boxel-motion/addon
33-
- name: Build Boxel Motion
34-
# To faciliate linting of projects that depend on Boxel Motion
35-
if: always()
36-
run: pnpm run build
37-
working-directory: packages/boxel-motion/addon
38-
- name: Lint Boxel Motion Test App
39-
if: always()
40-
run: pnpm run lint
41-
working-directory: packages/boxel-motion/test-app
42-
- name: Lint Boxel UI
43-
if: always()
44-
run: pnpm run lint
45-
working-directory: packages/boxel-ui/addon
46-
- name: Build Boxel UI
47-
# To faciliate linting of projects that depend on Boxel UI
48-
if: always()
49-
run: pnpm run build
50-
working-directory: packages/boxel-ui/addon
51-
- name: Lint Boxel UI Test App
52-
if: always()
53-
run: pnpm run lint
54-
working-directory: packages/boxel-ui/test-app
55-
- name: Lint Boxel Motion
56-
if: always()
57-
run: pnpm run lint
58-
working-directory: packages/boxel-motion/addon
59-
- name: Build Boxel Motion
60-
# To faciliate linting of projects that depend on Boxel Motion
61-
if: always()
62-
run: pnpm run build
63-
working-directory: packages/boxel-motion/addon
64-
- name: Lint Boxel Motion Test App
65-
if: always()
66-
run: pnpm run lint
67-
working-directory: packages/boxel-motion/test-app
68-
- name: Lint Host
69-
if: always()
70-
run: pnpm run lint
71-
working-directory: packages/host
72-
- name: Lint Matrix
73-
if: always()
74-
run: pnpm run lint
75-
working-directory: packages/matrix
76-
- name: Lint Realm Server
77-
if: always()
78-
run: pnpm run lint
79-
working-directory: packages/realm-server
80-
- name: Lint Runtime Common
81-
if: always()
82-
run: pnpm run lint
83-
working-directory: packages/runtime-common
84-
8515
ai-bot-test:
8616
name: AI bot Tests
8717
runs-on: ubuntu-latest
@@ -142,41 +72,6 @@ jobs:
14272
- name: Fail if generated icons have been changed without underlying raw icon changing
14373
run: git diff --exit-code
14474

145-
host-test:
146-
name: Host Tests
147-
runs-on: ubuntu-latest
148-
concurrency:
149-
group: boxel-host-test${{ github.head_ref || github.run_id }}
150-
cancel-in-progress: true
151-
steps:
152-
- uses: actions/checkout@v4
153-
- uses: ./.github/actions/init
154-
- name: Build boxel-ui
155-
run: pnpm build
156-
working-directory: packages/boxel-ui/addon
157-
- name: Build host dist/ for fastboot
158-
run: pnpm build
159-
env:
160-
NODE_OPTIONS: --max_old_space_size=4096
161-
working-directory: packages/host
162-
- name: Start realm servers
163-
run: pnpm start:all &
164-
working-directory: packages/realm-server
165-
- name: create realm users
166-
run: pnpm register-realm-users
167-
working-directory: packages/matrix
168-
- name: host test suite
169-
run: pnpm test-with-percy
170-
env:
171-
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_HOST }}
172-
working-directory: packages/host
173-
- name: Publish test results
174-
uses: EnricoMi/publish-unit-test-result-action@v2.9.0
175-
if: always()
176-
with:
177-
junit_files: junit/host.xml
178-
check_name: Host Tests Test Results
179-
18075
matrix-client-test:
18176
name: Matrix Client Tests
18277
runs-on: ubuntu-latest
@@ -358,7 +253,6 @@ jobs:
358253
needs:
359254
- change-check
360255
- boxel-ui-test
361-
- host-test
362256
- realm-server-test
363257
uses: ./.github/workflows/manual-deploy.yml
364258
secrets: inherit

docs/computed-fields.md

-10
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ export class Person extends CardDef {
1515
1616
```
1717
18-
You can also specify the name of the computation function on the class as a string instead of inlining it:
19-
20-
```typescript
21-
@field fullName = contains(StringCard, { computeVia: 'getFullName' });
22-
23-
getFullName() {
24-
return `${this.firstName} ${this.lastName}`;
25-
}
26-
```
27-
2818
The field can be used in a template like any other:
2919
3020
```handlebars

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"ember-cli-htmlbars": "^6.3.0",
5858
"ember-resources": "^6.3.1",
5959
"ember-source": "~5.4.0",
60-
"ember-template-imports": "^3.0.1",
60+
"ember-template-imports": "^4.1.1",
6161
"eslint": "^7.32.0",
6262
"eslint-config-prettier": "^8.4.0",
6363
"eslint-plugin-import": "^2.26.0",

packages/ai-bot/lib/debug.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { Room, MatrixClient } from 'matrix-js-sdk';
21
import { setTitle } from './set-title';
3-
import { sendError, sendOption, sendMessage } from './matrix';
2+
import { sendError, sendOption, sendMessage, MatrixClient } from './matrix';
43
import OpenAI from 'openai';
54

65
import * as Sentry from '@sentry/node';
@@ -9,27 +8,27 @@ export async function handleDebugCommands(
98
openai: OpenAI,
109
eventBody: string,
1110
client: MatrixClient,
12-
room: Room,
11+
roomId: string,
1312
userId: string,
1413
) {
1514
// Explicitly set the room name
1615
if (eventBody.startsWith('debug:title:set:')) {
1716
return await client.setRoomName(
18-
room.roomId,
17+
roomId,
1918
eventBody.split('debug:title:set:')[1],
2019
);
2120
} else if (eventBody.startsWith('debug:boom')) {
2221
await sendError(
2322
client,
24-
room,
23+
roomId,
2524
`Boom! Throwing an unhandled error`,
2625
undefined,
2726
);
2827
throw new Error('Boom!');
2928
}
3029
// Use GPT to set the room title
3130
else if (eventBody.startsWith('debug:title:create')) {
32-
return await setTitle(openai, client, room, [], userId);
31+
return await setTitle(openai, client, roomId, [], userId);
3332
} else if (eventBody.startsWith('debug:patch:')) {
3433
let patchMessage = eventBody.split('debug:patch:')[1];
3534
// If there's a card attached, we need to split it off to parse the json
@@ -50,12 +49,12 @@ export async function handleDebugCommands(
5049
Sentry.captureException(error);
5150
return await sendMessage(
5251
client,
53-
room,
52+
roomId,
5453
`Error parsing your debug patch, ${error} ${patchMessage}`,
5554
undefined,
5655
);
5756
}
58-
return await sendOption(client, room, command, undefined);
57+
return await sendOption(client, roomId, command, undefined);
5958
}
6059
return;
6160
}

0 commit comments

Comments
 (0)