Skip to content

Commit c61ee50

Browse files
authored
Merge pull request #4430 from easyops-cn/steve/next
Steve/next
2 parents 5fecff4 + 23f3144 commit c61ee50

File tree

137 files changed

+4490
-623
lines changed

Some content is hidden

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

137 files changed

+4490
-623
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,16 @@ jobs:
136136
env:
137137
NX_REJECT_UNKNOWN_LOCAL_CACHE: '0'
138138

139+
- name: Get coverage files
140+
run: |
141+
echo "COVERAGE_FILES=$(find ./packages -maxdepth 1 -mindepth 1 -type d -exec echo "{}/.coverage/cobertura-coverage.xml" \; | tr '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
142+
139143
- name: Codecov
140144
uses: codecov/codecov-action@v4
141145
with:
142146
token: ${{ secrets.CODECOV_TOKEN }}
143-
files: packages/*/.coverage/cobertura-coverage.xml,bricks/*/.coverage/cobertura-coverage.xml,!.cache/**/*
147+
files: ${{ env.COVERAGE_FILES }}
148+
disable_search: true
144149

145150
- run: yarn test:e2e:ci
146151
env:

.npmrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ registry=https://registry.npmjs.org
22
tag-version-prefix=
33
access=public
44
CYPRESS_INSTALL_BINARY=0
5-
CYPRESS_DOWNLOAD_MIRROR=http://192.168.110.32:3100

bricks/e2e/CHANGELOG.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,174 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.4.39](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-08-19)
7+
8+
**Note:** Version bump only for package @next-bricks/e2e
9+
10+
11+
12+
13+
14+
## [0.4.38](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-08-13)
15+
16+
**Note:** Version bump only for package @next-bricks/e2e
17+
18+
19+
20+
21+
22+
## [0.4.37](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-08-12)
23+
24+
**Note:** Version bump only for package @next-bricks/e2e
25+
26+
27+
28+
29+
30+
## [0.4.36](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-08-09)
31+
32+
**Note:** Version bump only for package @next-bricks/e2e
33+
34+
35+
36+
37+
38+
## [0.4.35](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-08-08)
39+
40+
**Note:** Version bump only for package @next-bricks/e2e
41+
42+
43+
44+
45+
46+
## [0.4.34](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-08-06)
47+
48+
**Note:** Version bump only for package @next-bricks/e2e
49+
50+
51+
52+
53+
54+
## [0.4.33](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-08-06)
55+
56+
**Note:** Version bump only for package @next-bricks/e2e
57+
58+
59+
60+
61+
62+
## [0.4.32](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-31)
63+
64+
**Note:** Version bump only for package @next-bricks/e2e
65+
66+
67+
68+
69+
70+
## [0.4.31](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-31)
71+
72+
**Note:** Version bump only for package @next-bricks/e2e
73+
74+
75+
76+
77+
78+
## [0.4.30](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-29)
79+
80+
**Note:** Version bump only for package @next-bricks/e2e
81+
82+
83+
84+
85+
86+
## [0.4.29](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-26)
87+
88+
**Note:** Version bump only for package @next-bricks/e2e
89+
90+
91+
92+
93+
94+
## [0.4.28](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-26)
95+
96+
**Note:** Version bump only for package @next-bricks/e2e
97+
98+
99+
100+
101+
102+
## [0.4.27](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-25)
103+
104+
**Note:** Version bump only for package @next-bricks/e2e
105+
106+
107+
108+
109+
110+
## [0.4.26](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-23)
111+
112+
**Note:** Version bump only for package @next-bricks/e2e
113+
114+
115+
116+
117+
118+
## [0.4.25](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-22)
119+
120+
**Note:** Version bump only for package @next-bricks/e2e
121+
122+
123+
124+
125+
126+
## [0.4.24](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-19)
127+
128+
**Note:** Version bump only for package @next-bricks/e2e
129+
130+
131+
132+
133+
134+
## [0.4.23](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-18)
135+
136+
**Note:** Version bump only for package @next-bricks/e2e
137+
138+
139+
140+
141+
142+
## [0.4.22](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-18)
143+
144+
**Note:** Version bump only for package @next-bricks/e2e
145+
146+
147+
148+
149+
150+
## [0.4.21](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-15)
151+
152+
**Note:** Version bump only for package @next-bricks/e2e
153+
154+
155+
156+
157+
158+
## [0.4.20](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-12)
159+
160+
**Note:** Version bump only for package @next-bricks/e2e
161+
162+
163+
164+
165+
166+
## [0.4.19](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-03)
167+
168+
**Note:** Version bump only for package @next-bricks/e2e
169+
170+
171+
172+
173+
6174
## [0.4.18](https://github.com/easyops-cn/next-core/compare/@next-bricks/[email protected]...@next-bricks/[email protected]) (2024-07-02)
7175

8176
**Note:** Version bump only for package @next-bricks/e2e

bricks/e2e/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next-bricks/e2e",
3-
"version": "0.4.18",
3+
"version": "0.4.39",
44
"private": true,
55
"homepage": "https://github.com/easyops-cn/next-core/tree/v3/bricks/e2e",
66
"repository": {
@@ -36,17 +36,17 @@
3636
"build": "cross-env NODE_ENV=production build-next-bricks"
3737
},
3838
"dependencies": {
39-
"@next-core/element": "^1.2.10",
40-
"@next-core/i18n": "^1.0.57",
41-
"@next-core/react-element": "^1.0.29",
42-
"@next-core/react-runtime": "^1.6.16",
43-
"@next-core/runtime": "^1.49.12",
44-
"@next-core/types": "^1.11.2",
45-
"@next-core/utils": "^1.7.15",
39+
"@next-core/element": "^1.2.11",
40+
"@next-core/i18n": "^1.0.63",
41+
"@next-core/react-element": "^1.0.30",
42+
"@next-core/react-runtime": "^1.6.36",
43+
"@next-core/runtime": "^1.54.13",
44+
"@next-core/types": "^1.12.2",
45+
"@next-core/utils": "^1.7.21",
4646
"react": "0.0.0-experimental-ee8509801-20230117"
4747
},
4848
"devDependencies": {
49-
"@next-core/build-next-bricks": "^1.22.3",
50-
"@next-core/test-next": "^1.1.4"
49+
"@next-core/build-next-bricks": "^1.23.0",
50+
"@next-core/test-next": "^1.1.5"
5151
}
5252
}

cypress/e2e/sub-routes.spec.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ for (const port of Cypress.env("ports")) {
5656
cy.contains("SyntaxError");
5757
cy.expectMainContents([
5858
...fixedContents,
59-
'SyntaxError: Unexpected token (1:4), in "<% CTX. %>"',
59+
'Oops! Something went wrong: SyntaxError: Unexpected token (1:4), in "<% CTX. %>"',
6060
]);
6161

6262
cy.get("@console.error").should("be.called");
@@ -213,5 +213,31 @@ for (const port of Cypress.env("ports")) {
213213
expect(call6.args[0]).to.equal("Mounted App");
214214
});
215215
});
216+
217+
it("should handle multiple clicks with sub-routes", () => {
218+
cy.visit(`${origin}/e2e/sub-routes-multi-click-entry`, {
219+
onBeforeLoad(win) {
220+
cy.spy(win.console, "error").as("console.error");
221+
cy.spy(win.console, "info").as("console.info");
222+
},
223+
});
224+
225+
// Click twice
226+
cy.contains("Go App").click();
227+
cy.contains("Go App").click();
228+
cy.contains("This is App");
229+
cy.expectMainContents(["Sub-Routes Multi Click", "This is App"]);
230+
231+
cy.get("@console.info").should("have.callCount", 3);
232+
cy.get("@console.info").should((spy) => {
233+
const calledWith = [0, 1, 2].map((index) => {
234+
const call = spy.getCall(index);
235+
return call.args[0];
236+
});
237+
expect(calledWith).to.deep.eq(["Mounted", "Unmounted", "Mounted"]);
238+
});
239+
240+
cy.get("@console.error").should("not.be.called");
241+
});
216242
});
217243
}

etc/runtime.api.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ function loadEditors(editors: string[] | Set<string>, brickPackages?: BrickPacka
262262
// @public @deprecated (undocumented)
263263
export function logout(): unknown;
264264

265+
// @public (undocumented)
266+
export interface MatchOptions {
267+
// (undocumented)
268+
exact?: boolean;
269+
// (undocumented)
270+
path: string | string[];
271+
}
272+
265273
// Warning: (ae-forgotten-export) The symbol "MatchPathOptions" needs to be exported by the entry point index.d.ts
266274
// Warning: (ae-forgotten-export) The symbol "MatchResult" needs to be exported by the entry point index.d.ts
267275
//
@@ -346,6 +354,8 @@ export interface RenderOptions {
346354
// (undocumented)
347355
i18n?: MetaI18n;
348356
// (undocumented)
357+
language?: string;
358+
// (undocumented)
349359
templates?: CustomTemplate[];
350360
// (undocumented)
351361
theme?: SiteTheme;
@@ -387,6 +397,8 @@ interface RuntimeContext extends LegacyCompatibleRuntimeContext {
387397
// (undocumented)
388398
forEachItem?: unknown;
389399
// (undocumented)
400+
forEachSize?: number;
401+
// (undocumented)
390402
formStateStoreId?: string;
391403
// (undocumented)
392404
formStateStoreMap: Map<string, DataStore<"FORM_STATE">>;
@@ -521,7 +533,7 @@ function unmountUseBrick({ rendererContext }: RenderUseBrickResult, mountResult:
521533

522534
// @public (undocumented)
523535
export function unstable_createRoot(container: HTMLElement | DocumentFragment, { portal: _portal, scope, unknownBricks }?: CreateRootOptions): {
524-
render(brick: BrickConf | BrickConf[], { theme, uiVersion, context, functions, templates, i18n: i18nData, url, app, }?: RenderOptions): Promise<void>;
536+
render(brick: BrickConf | BrickConf[], { theme, uiVersion, language, context, functions, templates, i18n: i18nData, url, app, }?: RenderOptions): Promise<void>;
525537
unmount(): void;
526538
};
527539

mock-micro-apps/e2e/storyboard.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,55 @@ routes:
842842
properties:
843843
textContent: Real Other Route
844844

845+
- path: '${APP.homepage}/sub-routes-multi-click-entry'
846+
bricks:
847+
- brick: button
848+
properties:
849+
textContent: Go App
850+
events:
851+
click:
852+
action: history.push
853+
args:
854+
- ${APP.homepage}/sub-routes-multi-click/app
855+
856+
- path: '${APP.homepage}/sub-routes-multi-click'
857+
incrementalSubRoutes: true
858+
bricks:
859+
- brick: h1
860+
properties:
861+
textContent: Sub-Routes Multi Click
862+
- brick: div
863+
slots:
864+
'':
865+
type: routes
866+
routes:
867+
- path: '${APP.homepage}/sub-routes-multi-click/app'
868+
context:
869+
- name: myApp
870+
resolve:
871+
useProvider: e2e.return-by-timeout
872+
args:
873+
- 500
874+
- App
875+
bricks:
876+
- brick: h2
877+
properties:
878+
textContent: <% `This is ${CTX.myApp}` %>
879+
lifeCycle:
880+
onMount:
881+
action: console.info
882+
args:
883+
- Mounted
884+
onUnmount:
885+
action: console.info
886+
args:
887+
- Unmounted
888+
- path: '${APP.homepage}/sub-routes-multi-click/host'
889+
bricks:
890+
- brick: h2
891+
properties:
892+
textContent: This is Host
893+
845894
- path: '${APP.homepage}/async-wrap-brick'
846895
bricks:
847896
- brick: e2e.async-wrap

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"cypress:open": "cypress open",
2121
"cypress:run": "cypress run --record",
2222
"cypress:run:no-record": "cypress run",
23-
"test:e2e:ci": "npx start-server-and-test serve:e2e http://localhost:8081/ cypress:run",
24-
"test:e2e:no-record": "npx wait-on -r http://localhost:8081/ && npx start-server-and-test serve:e2e http://localhost:8081/ cypress:run:no-record",
23+
"test:e2e:ci": "npx start-server-and-test serve:e2e http-get://localhost:8081/ cypress:run",
24+
"test:e2e:no-record": "npx wait-on -r http-get://localhost:8081/ && npx start-server-and-test serve:e2e http-get://localhost:8081/ cypress:run:no-record",
2525
"test:e2e:docker": "docker-compose run --user $(id -u):$(id -g) e2e",
2626
"lint-staged": "lint-staged"
2727
},

0 commit comments

Comments
 (0)