Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
ci: add memory leaking detection e2e (#2039)
Wenzhao Hu6ac331c9998a
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.ymlindex 3d7efc0d76..78aece82a0 100644--- a/.github/workflows/playwright.yml+++ b/.github/workflows/playwright.yml@@ -2,17 +2,25 @@ name: 🎭 Playwright Testson:push:- branches: [main, master]+ branches: [main, dev]pull_request:- branches: [main, master]+ branches: [main, dev]jobs:test:timeout-minutes: 60runs-on: ubuntu-latest+ env:+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}+ TURBO_TEAM: ${{ vars.TURBO_TEAM }}+steps:- - uses: actions/checkout@v4+ - name: Checkout+ uses: actions/checkout@v4+ with:+ repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}+ ref: ${{ github.head_ref }}- name: Setup Node.jsuses: ./.github/actions/setup-node@@ -20,7 +28,11 @@ jobs:- name: Install Playwright Browsersrun: pnpm exec playwright install --with-deps- - name: Run Playwright tests+ # build the example locally and run from the built files+ - name: Build E2E Client+ run: pnpm run build:e2e++ - name: Run Playwright Testsrun: pnpm exec playwright test- uses: actions/upload-artifact@v3diff --git a/e2e/demo-todo-app.spec.ts b/e2e/demo-todo-app.spec.tsdeleted file mode 100644index 6bc2ad79f5..0000000000--- a/e2e/demo-todo-app.spec.ts+++ /dev/null@@ -1,452 +0,0 @@-/**- * Copyright 2023-present DreamNum Inc.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { expect, type Page, test } from '@playwright/test';--test.beforeEach(async ({ page }) => {- await page.goto('https://demo.playwright.dev/todomvc');-});--const TODO_ITEMS = [- 'buy some cheese',- 'feed the cat',- 'book a doctors appointment',-];--test.describe('New Todo', () => {- test('should allow me to add todo items', async ({ page }) => {- // create a new todo locator- const newTodo = page.getByPlaceholder('What needs to be done?');-- // Create 1st todo.- await newTodo.fill(TODO_ITEMS[0]);- await newTodo.press('Enter');-- // Make sure the list only has one todo item.- await expect(page.getByTestId('todo-title')).toHaveText([- TODO_ITEMS[0],- ]);-- // Create 2nd todo.- await newTodo.fill(TODO_ITEMS[1]);- await newTodo.press('Enter');-- // Make sure the list now has two todo items.- await expect(page.getByTestId('todo-title')).toHaveText([- TODO_ITEMS[0],- TODO_ITEMS[1],- ]);-- await checkNumberOfTodosInLocalStorage(page, 2);- });-- test('should clear text input field when an item is added', async ({ page }) => {- // create a new todo locator- const newTodo = page.getByPlaceholder('What needs to be done?');-- // Create one todo item.- await newTodo.fill(TODO_ITEMS[0]);- await newTodo.press('Enter');-- // Check that input is empty.- await expect(newTodo).toBeEmpty();- await checkNumberOfTodosInLocalStorage(page, 1);- });-- test('should append new items to the bottom of the list', async ({ page }) => {- // Create 3 items.- await createDefaultTodos(page);-- // create a todo count locator- const todoCount = page.getByTestId('todo-count');-- // Check test using different methods.- await expect(page.getByText('3 items left')).toBeVisible();- await expect(todoCount).toHaveText('3 items left');- await expect(todoCount).toContainText('3');- await expect(todoCount).toHaveText(/3/);-- // Check all items in one call.- await expect(page.getByTestId('todo-title')).toHaveText(TODO_ITEMS);- await checkNumberOfTodosInLocalStorage(page, 3);- });-});--test.describe('Mark all as completed', () => {- test.beforeEach(async ({ page }) => {- await createDefaultTodos(page);- await checkNumberOfTodosInLocalStorage(page, 3);- });-- test.afterEach(async ({ page }) => {- await checkNumberOfTodosInLocalStorage(page, 3);- });-- test('should allow me to mark all items as completed', async ({ page }) => {- // Complete all todos.- await page.getByLabel('Mark all as complete').check();-- // Ensure all todos have 'completed' class.- await expect(page.getByTestId('todo-item')).toHaveClass(['completed', 'completed', 'completed']);- await checkNumberOfCompletedTodosInLocalStorage(page, 3);- });-- test('should allow me to clear the complete state of all items', async ({ page }) => {- const toggleAll = page.getByLabel('Mark all as complete');- // Check and then immediately uncheck.- await toggleAll.check();- await toggleAll.uncheck();-- // Should be no completed classes.- await expect(page.getByTestId('todo-item')).toHaveClass(['', '', '']);- });-- test('complete all checkbox should update state when items are completed / cleared', async ({ page }) => {- const toggleAll = page.getByLabel('Mark all as complete');- await toggleAll.check();- await expect(toggleAll).toBeChecked();- await checkNumberOfCompletedTodosInLocalStorage(page, 3);-- // Uncheck first todo.- const firstTodo = page.getByTestId('todo-item').nth(0);- await firstTodo.getByRole('checkbox').uncheck();-- // Reuse toggleAll locator and make sure its not checked.- await expect(toggleAll).not.toBeChecked();-- await firstTodo.getByRole('checkbox').check();- await checkNumberOfCompletedTodosInLocalStorage(page, 3);-- // Assert the toggle all is checked again.- await expect(toggleAll).toBeChecked();- });-});--test.describe('Item', () => {- test('should allow me to mark items as complete', async ({ page }) => {- // create a new todo locator- const newTodo = page.getByPlaceholder('What needs to be done?');-- // Create two items.- for (const item of TODO_ITEMS.slice(0, 2)) {- await newTodo.fill(item);- await newTodo.press('Enter');- }-- // Check first item.- const firstTodo = page.getByTestId('todo-item').nth(0);- await firstTodo.getByRole('checkbox').check();- await expect(firstTodo).toHaveClass('completed');-- // Check second item.- const secondTodo = page.getByTestId('todo-item').nth(1);- await expect(secondTodo).not.toHaveClass('completed');- await secondTodo.getByRole('checkbox').check();-- // Assert completed class.- await expect(firstTodo).toHaveClass('completed');- await expect(secondTodo).toHaveClass('completed');- });-- test('should allow me to un-mark items as complete', async ({ page }) => {- // create a new todo locator- const newTodo = page.getByPlaceholder('What needs to be done?');-- // Create two items.- for (const item of TODO_ITEMS.slice(0, 2)) {- await newTodo.fill(item);- await newTodo.press('Enter');- }-- const firstTodo = page.getByTestId('todo-item').nth(0);- const secondTodo = page.getByTestId('todo-item').nth(1);- const firstTodoCheckbox = firstTodo.getByRole('checkbox');-- await firstTodoCheckbox.check();- await expect(firstTodo).toHaveClass('completed');- await expect(secondTodo).not.toHaveClass('completed');- await checkNumberOfCompletedTodosInLocalStorage(page, 1);-- await firstTodoCheckbox.uncheck();- await expect(firstTodo).not.toHaveClass('completed');- await expect(secondTodo).not.toHaveClass('completed');- await checkNumberOfCompletedTodosInLocalStorage(page, 0);- });-- test('should allow me to edit an item', async ({ page }) => {- await createDefaultTodos(page);-- const todoItems = page.getByTestId('todo-item');- const secondTodo = todoItems.nth(1);- await secondTodo.dblclick();- await expect(secondTodo.getByRole('textbox', { name: 'Edit' })).toHaveValue(TODO_ITEMS[1]);- await secondTodo.getByRole('textbox', { name: 'Edit' }).fill('buy some sausages');- await secondTodo.getByRole('textbox', { name: 'Edit' }).press('Enter');-- // Explicitly assert the new text value.- await expect(todoItems).toHaveText([- TODO_ITEMS[0],- 'buy some sausages',- TODO_ITEMS[2],- ]);- await checkTodosInLocalStorage(page, 'buy some sausages');- });-});--test.describe('Editing', () => {- test.beforeEach(async ({ page }) => {- await createDefaultTodos(page);- await checkNumberOfTodosInLocalStorage(page, 3);- });-- test('should hide other controls when editing', async ({ page }) => {- const todoItem = page.getByTestId('todo-item').nth(1);- await todoItem.dblclick();- await expect(todoItem.getByRole('checkbox')).not.toBeVisible();- await expect(todoItem.locator('label', {- hasText: TODO_ITEMS[1],- })).not.toBeVisible();- await checkNumberOfTodosInLocalStorage(page, 3);- });-- test('should save edits on blur', async ({ page }) => {- const todoItems = page.getByTestId('todo-item');- await todoItems.nth(1).dblclick();- await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill('buy some sausages');- await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).dispatchEvent('blur');-- await expect(todoItems).toHaveText([- TODO_ITEMS[0],- 'buy some sausages',- TODO_ITEMS[2],- ]);- await checkTodosInLocalStorage(page, 'buy some sausages');- });-- test('should trim entered text', async ({ page }) => {- const todoItems = page.getByTestId('todo-item');- await todoItems.nth(1).dblclick();- await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill(' buy some sausages ');- await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Enter');-- await expect(todoItems).toHaveText([- TODO_ITEMS[0],- 'buy some sausages',- TODO_ITEMS[2],- ]);- await checkTodosInLocalStorage(page, 'buy some sausages');- });-- test('should remove the item if an empty text string was entered', async ({ page }) => {- const todoItems = page.getByTestId('todo-item');- await todoItems.nth(1).dblclick();- await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill('');- await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Enter');-- await expect(todoItems).toHaveText([- TODO_ITEMS[0],- TODO_ITEMS[2],- ]);- });-- test('should cancel edits on escape', async ({ page }) => {- const todoItems = page.getByTestId('todo-item');- await todoItems.nth(1).dblclick();- await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill('buy some sausages');- await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Escape');- await expect(todoItems).toHaveText(TODO_ITEMS);- });-});--test.describe('Counter', () => {- test('should display the current number of todo items', async ({ page }) => {- // create a new todo locator- const newTodo = page.getByPlaceholder('What needs to be done?');-- // create a todo count locator- const todoCount = page.getByTestId('todo-count');-- await newTodo.fill(TODO_ITEMS[0]);- await newTodo.press('Enter');-- await expect(todoCount).toContainText('1');-- await newTodo.fill(TODO_ITEMS[1]);- await newTodo.press('Enter');- await expect(todoCount).toContainText('2');-- await checkNumberOfTodosInLocalStorage(page, 2);- });-});--test.describe('Clear completed button', () => {- test.beforeEach(async ({ page }) => {- await createDefaultTodos(page);- });-- test('should display the correct text', async ({ page }) => {- await page.locator('.todo-list li .toggle').first().check();- await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();- });-- test('should remove completed items when clicked', async ({ page }) => {- const todoItems = page.getByTestId('todo-item');- await todoItems.nth(1).getByRole('checkbox').check();- await page.getByRole('button', { name: 'Clear completed' }).click();- await expect(todoItems).toHaveCount(2);- await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[2]]);- });-- test('should be hidden when there are no items that are completed', async ({ page }) => {- await page.locator('.todo-list li .toggle').first().check();- await page.getByRole('button', { name: 'Clear completed' }).click();- await expect(page.getByRole('button', { name: 'Clear completed' })).toBeHidden();- });-});--test.describe('Persistence', () => {- test('should persist its data', async ({ page }) => {- // create a new todo locator- const newTodo = page.getByPlaceholder('What needs to be done?');-- for (const item of TODO_ITEMS.slice(0, 2)) {- await newTodo.fill(item);- await newTodo.press('Enter');- }-- const todoItems = page.getByTestId('todo-item');- const firstTodoCheck = todoItems.nth(0).getByRole('checkbox');- await firstTodoCheck.check();- await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[1]]);- await expect(firstTodoCheck).toBeChecked();- await expect(todoItems).toHaveClass(['completed', '']);-- // Ensure there is 1 completed item.- await checkNumberOfCompletedTodosInLocalStorage(page, 1);-- // Now reload.- await page.reload();- await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[1]]);- await expect(firstTodoCheck).toBeChecked();- await expect(todoItems).toHaveClass(['completed', '']);- });-});--test.describe('Routing', () => {- test.beforeEach(async ({ page }) => {- await createDefaultTodos(page);- // make sure the app had a chance to save updated todos in storage- // before navigating to a new view, otherwise the items can get lost :(- // in some frameworks like Durandal- await checkTodosInLocalStorage(page, TODO_ITEMS[0]);- });-- test('should allow me to display active items', async ({ page }) => {- const todoItem = page.getByTestId('todo-item');- await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check();-- await checkNumberOfCompletedTodosInLocalStorage(page, 1);- await page.getByRole('link', { name: 'Active' }).click();- await expect(todoItem).toHaveCount(2);- await expect(todoItem).toHaveText([TODO_ITEMS[0], TODO_ITEMS[2]]);- });-- test('should respect the back button', async ({ page }) => {- const todoItem = page.getByTestId('todo-item');- await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check();-- await checkNumberOfCompletedTodosInLocalStorage(page, 1);-- await test.step('Showing all items', async () => {- await page.getByRole('link', { name: 'All' }).click();- await expect(todoItem).toHaveCount(3);- });-- await test.step('Showing active items', async () => {- await page.getByRole('link', { name: 'Active' }).click();- });-- await test.step('Showing completed items', async () => {- await page.getByRole('link', { name: 'Completed' }).click();- });-- await expect(todoItem).toHaveCount(1);- await page.goBack();- await expect(todoItem).toHaveCount(2);- await page.goBack();- await expect(todoItem).toHaveCount(3);- });-- test('should allow me to display completed items', async ({ page }) => {- await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check();- await checkNumberOfCompletedTodosInLocalStorage(page, 1);- await page.getByRole('link', { name: 'Completed' }).click();- await expect(page.getByTestId('todo-item')).toHaveCount(1);- });-- test('should allow me to display all items', async ({ page }) => {- await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check();- await checkNumberOfCompletedTodosInLocalStorage(page, 1);- await page.getByRole('link', { name: 'Active' }).click();- await page.getByRole('link', { name: 'Completed' }).click();- await page.getByRole('link', { name: 'All' }).click();- await expect(page.getByTestId('todo-item')).toHaveCount(3);- });-- test('should highlight the currently applied filter', async ({ page }) => {- await expect(page.getByRole('link', { name: 'All' })).toHaveClass('selected');-- //create locators for active and completed links- const activeLink = page.getByRole('link', { name: 'Active' });- const completedLink = page.getByRole('link', { name: 'Completed' });- await activeLink.click();-- // Page change - active items.- await expect(activeLink).toHaveClass('selected');- await completedLink.click();-- // Page change - completed items.- await expect(completedLink).toHaveClass('selected');- });-});--async function createDefaultTodos(page: Page) {- // create a new todo locator- const newTodo = page.getByPlaceholder('What needs to be done?');-- for (const item of TODO_ITEMS) {- await newTodo.fill(item);- await newTodo.press('Enter');- }-}--async function checkNumberOfTodosInLocalStorage(page: Page, expected: number) {- return await page.waitForFunction((e) => {- return JSON.parse(localStorage['react-todos']).length === e;- }, expected);-}--async function checkNumberOfCompletedTodosInLocalStorage(page: Page, expected: number) {- return await page.waitForFunction((e) => {- return JSON.parse(localStorage['react-todos']).filter((todo: any) => todo.completed).length === e;- }, expected);-}--async function checkTodosInLocalStorage(page: Page, title: string) {- return await page.waitForFunction((t) => {- return JSON.parse(localStorage['react-todos']).map((todo: any) => todo.title).includes(t);- }, title);-}diff --git a/e2e/example.spec.ts b/e2e/example.spec.tsdeleted file mode 100644index 86fa86d7a7..0000000000--- a/e2e/example.spec.ts+++ /dev/null@@ -1,34 +0,0 @@-/**- * Copyright 2023-present DreamNum Inc.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { expect, test } from '@playwright/test';--test('has title', async ({ page }) => {- await page.goto('https://playwright.dev/');-- // Expect a title "to contain" a substring.- await expect(page).toHaveTitle(/Playwright/);-});--test('get started link', async ({ page }) => {- await page.goto('https://playwright.dev/');-- // Click the get started link.- await page.getByRole('link', { name: 'Get started' }).click();-- // Expects page to have a heading with the name of Installation.- await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();-});diff --git a/e2e/memory/memory.spec.ts b/e2e/memory/memory.spec.tsnew file mode 100644index 0000000000..29f53d6317--- /dev/null+++ b/e2e/memory/memory.spec.ts@@ -0,0 +1,80 @@+/**+ * Copyright 2023-present DreamNum Inc.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++/* eslint-disable no-console */++import type { Page } from '@playwright/test';+import { expect, test } from '@playwright/test';++// The type definition is copied from:+// examples/src/plugins/debugger/controllers/e2e/e2e-memory.controller.ts+export interface IE2EMemoryControllerAPI {+ loadAndRelease(id: number): Promise<void>;+ getHeapMemoryUsage(): number;+}+declare global {+ // eslint-disable-next-line ts/naming-convention+ interface Window {+ E2EMemoryAPI: IE2EMemoryControllerAPI;+ }+}++test('memory', async ({ page }) => {+ await page.goto('http://localhost:3000/sheets/');+ await page.waitForTimeout(2000);++ const memoryBeforeLoad = (await getMetrics(page)).JSHeapUsedSize;+ console.log('Memory before load:', memoryBeforeLoad);++ await page.evaluate(() => window.E2EMemoryAPI.loadAndRelease(1));+ await page.waitForTimeout(5000); // wait for long enough to let the GC do its job+ const memoryAfterFirstLoad = (await getMetrics(page)).JSHeapUsedSize;+ console.log('Memory after first load:', memoryAfterFirstLoad);++ await page.evaluate(() => window.E2EMemoryAPI.loadAndRelease(2));+ const memoryAfterSecondLoad = (await getMetrics(page)).JSHeapUsedSize;+ console.log('Memory after second load:', memoryAfterSecondLoad);++ // max overflow for 3MB+ const notLeaking = (memoryAfterSecondLoad <= memoryAfterFirstLoad)+ || (memoryAfterSecondLoad - memoryAfterFirstLoad <= 2_500_000);+ expect(notLeaking).toBeTruthy();+});++interface IMetrics {+ JSHeapUsedSize: number;+}++/**+ * Return a performance metric from the chrome cdp session.+ * Note: Chrome-only+ * @param {Page} page page to attach cdpClient+ * @return {IMetrics}+ * @see {@link https://github.com/microsoft/playwright/issues/18071 Github RFE}+ */+async function getMetrics(page: Page): Promise<IMetrics> {+ const client = await page.context().newCDPSession(page);+ await client.send('Performance.enable');+ const perfMetricObject = await client.send('Performance.getMetrics');+ const extractedMetric = perfMetricObject?.metrics;+ const metricObject = extractedMetric.reduce((acc, { name, value }) => {+ acc[name] = value;+ return acc;+ }, {});++ return metricObject as unknown as IMetrics;+}+diff --git a/examples/esbuild.config.mjs b/examples/esbuild.config.mjsindex 31bb5a7c00..d666324785 100644--- a/examples/esbuild.config.mjs+++ b/examples/esbuild.config.mjs@@ -96,6 +96,7 @@ const ctx = await esbuild[args.watch ? 'context' : 'build']({'process.env.GIT_COMMIT_HASH': `"${gitCommitHash}"`,'process.env.GIT_REF_NAME': `"${gitRefName}"`,'process.env.BUILD_TIME': `"${new Date().toISOString()}"`,+ 'process.env.IS_E2E': args.e2e ? 'true' : 'false',},});diff --git a/examples/package.json b/examples/package.jsonindex ee52b0f348..1bd8735fe7 100644--- a/examples/package.json+++ b/examples/package.json@@ -7,6 +7,8 @@"scripts": {"build:demo": "node ./esbuild.config.mjs","dev:demo": "node ./esbuild.config.mjs --watch",+ "dev:e2e": "node ./esbuild.config.mjs --watch --e2e",+ "build:e2e": "node ./esbuild.config.mjs --e2e","lint:types": "tsc --noEmit"},"dependencies": {diff --git a/examples/src/plugins/debugger/controllers/e2e/e2e-memory.controller.ts b/examples/src/plugins/debugger/controllers/e2e/e2e-memory.controller.tsnew file mode 100644index 0000000000..d8b5915799--- /dev/null+++ b/examples/src/plugins/debugger/controllers/e2e/e2e-memory.controller.ts@@ -0,0 +1,65 @@+/**+ * Copyright 2023-present DreamNum Inc.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++import { IUniverInstanceService, LifecycleStages, OnLifecycle, UniverInstanceType } from '@univerjs/core';++import { DEFAULT_WORKBOOK_DATA_DEMO } from '../../../../data/sheets/demo/default-workbook-data-demo';++const AWAIT_LOADING_TIMEOUT = 2000;+const AWAIT_DISPOSING_TIMEOUT = 2000;++export interface IE2EMemoryControllerAPI {+ loadAndRelease(id: number): Promise<void>;+}++declare global {+ // eslint-disable-next-line ts/naming-convention+ interface Window {+ E2EMemoryAPI: IE2EMemoryControllerAPI;+ }+}++/**+ * This controller expose a API on `Window` for the E2E memory test.+ */+@OnLifecycle(LifecycleStages.Starting, E2EMemoryController)+export class E2EMemoryController {+ constructor(+ @IUniverInstanceService private readonly _univerInstanceService: IUniverInstanceService+ ) {+ this._initPlugin();+ }++ private _initPlugin(): void {+ window.E2EMemoryAPI = {+ loadAndRelease: (id) => this._loadAndRelease(id),+ };+ }++ private async _loadAndRelease(id: number): Promise<void> {+ const unitId = `e2e${id}`;+ this._univerInstanceService.createUnit(UniverInstanceType.SHEET, { ...DEFAULT_WORKBOOK_DATA_DEMO, id: unitId });+ await timer(AWAIT_LOADING_TIMEOUT);+ this._univerInstanceService.disposeUnit(unitId);+ await timer(AWAIT_DISPOSING_TIMEOUT);+ }+}++function timer(timeout: number): Promise<void> {+ return new Promise((resolve) => {+ setTimeout(resolve, timeout);+ });+}diff --git a/examples/src/plugins/debugger/debugger-plugin.ts b/examples/src/plugins/debugger/debugger-plugin.tsindex d5d1352bc2..d8f3a04545 100644--- a/examples/src/plugins/debugger/debugger-plugin.ts+++ b/examples/src/plugins/debugger/debugger-plugin.ts@@ -20,12 +20,13 @@ import { Inject, Injector } from '@wendellhu/redi';import { DebuggerController } from './controllers/debugger.controller';import { PerformanceMonitorController } from './controllers/performance-monitor.controller';+import { E2EMemoryController } from './controllers/e2e/e2e-memory.controller';-export interface IDebuggerPluginConfig {}+export interface IDebuggerPluginConfig { }export class DebuggerPlugin extends Plugin {static override pluginName = 'debugger';- static override type = UniverInstanceType.DOC;+ static override type = UniverInstanceType.UNIVER;private _debuggerController!: DebuggerController;@@ -34,24 +35,18 @@ export class DebuggerPlugin extends Plugin {@Inject(Injector) override readonly _injector: Injector) {super();- this._initializeDependencies(_injector);}- initialize(): void {- this._debuggerController = this._injector.createInstance(DebuggerController);- this._injector.add([DebuggerController, { useValue: this._debuggerController }]);-- this.registerExtension();- }-- registerExtension() {}-- private _initializeDependencies(injector: Injector) {- ([[PerformanceMonitorController]] as Dependency[]).forEach((d) => injector.add(d));+ override onStarting(injector: Injector): void {+ ([+ [PerformanceMonitorController],+ [E2EMemoryController],+ ] as Dependency[]).forEach((d) => injector.add(d));}override onRendered(): void {- this.initialize();+ this._injector.add([DebuggerController]);+ this._debuggerController = this._injector.get(DebuggerController);}getDebuggerController() {diff --git a/examples/src/sheets/main.ts b/examples/src/sheets/main.tsindex a43d2c3588..4e5436cd9c 100644--- a/examples/src/sheets/main.ts+++ b/examples/src/sheets/main.ts@@ -14,7 +14,7 @@* limitations under the License.*/-import { LocaleType, LogLevel, Univer } from '@univerjs/core';+import { LocaleType, LogLevel, Univer, UniverInstanceType } from '@univerjs/core';import { defaultTheme } from '@univerjs/design';import { UniverDocsPlugin } from '@univerjs/docs';import { UniverDocsUIPlugin } from '@univerjs/docs-ui';@@ -37,10 +37,11 @@ import { DebuggerPlugin } from '../plugins/debugger';import { DEFAULT_WORKBOOK_DATA_DEMO } from '../data/sheets/demo/default-workbook-data-demo';import { locales } from './locales';-// const app = document.getElementById('app')!;-// app.style.marginLeft = '100px';+/* eslint-disable-next-line node/prefer-global/process */+const IS_E2E: boolean = !!process.env.IS_E2E;const LOAD_LAZY_PLUGINS_TIMEOUT = 1_000;+// univerconst univer = new Univer({theme: defaultTheme,@@ -87,12 +88,17 @@ univer.registerPlugin(UniverSheetsFindReplacePlugin);univer.registerPlugin(UniverSheetsConditionalFormattingUIPlugin);// create univer sheet instance-univer.createUniverSheet(DEFAULT_WORKBOOK_DATA_DEMO);+if (!IS_E2E) {+ univer.createUnit(UniverInstanceType.SHEET, DEFAULT_WORKBOOK_DATA_DEMO);+}// Uncomment the following lines to test if the document is disposed correctly without memory leaks.// setTimeout(() => {// univer.__getInjector().get(IUniverInstanceService).disposeUnit(DEFAULT_WORKBOOK_DATA_DEMO.id);// }, 5000);+// setTimeout(() => {+// univer.createUnit(UniverInstanceType.SHEET, DEFAULT_WORKBOOK_DATA_DEMO);+// }, 7000);declare global {interface Window {diff --git a/package.json b/package.jsonindex ee1ad90639..d14b0e8b11 100644--- a/package.json+++ b/package.json@@ -31,6 +31,9 @@"coverage": "turbo coverage -- --passWithNoTests","build": "turbo build","build:demo": "turbo build:demo",+ "build:e2e": "pnpm --filter univer-examples build:e2e",+ "serve:e2e": "serve ./examples/local",+ "test:e2e": "playwright test","lint": "eslint .","lint:fix": "eslint . --fix","storybook:dev": "pnpm --filter @univerjs/storybook dev",@@ -65,6 +68,7 @@"react": "^18.2.0","react-dom": "^18.2.0","release-it": "^17.1.1",+ "serve": "^14.2.2","turbo": "^1.13.2","typescript": "^5.4.5"},diff --git a/packages/core/src/services/instance/instance.service.ts b/packages/core/src/services/instance/instance.service.tsindex c07f148a9a..66bbd73b94 100644--- a/packages/core/src/services/instance/instance.service.ts+++ b/packages/core/src/services/instance/instance.service.ts@@ -69,7 +69,7 @@ export interface IUniverInstanceService {/** @deprecated */changeDoc(unitId: string, doc: DocumentDataModel): void;- getUnit<T extends UnitModel>(id: string, type: UnitType): Nullable<T>;+ getUnit<T extends UnitModel>(id: string, type?: UnitType): Nullable<T>;getAllUnitsForType<T>(type: UnitType): T[];getUnitType(unitId: string): UnitType;@@ -119,7 +119,7 @@ export class UniverInstanceService extends Disposable implements IUniverInstance};}- private readonly _currentUnits$ = new BehaviorSubject<{ [type: UnitType]: UnitModel }>({});+ private readonly _currentUnits$ = new BehaviorSubject<{ [type: UnitType]: Nullable<UnitModel> }>({});readonly currentUnits$ = this._currentUnits$.asObservable();getCurrentTypeOfUnit$<T>(type: number): Observable<Nullable<T>> {return this.currentUnits$.pipe(map((units) => units[type] ?? null), distinctUntilChanged()) as Observable<Nullable<T>>;@@ -160,8 +160,10 @@ export class UniverInstanceService extends Disposable implements IUniverInstancereturn this.unitDisposed$.pipe(filter((unit) => unit.type === type)) as Observable<T>;}- getUnit<T>(id: string, _type: UnitType): Nullable<T> {- return this._getUnitById(id)?.[0] as Nullable<T>;+ getUnit<T extends UnitModel = UnitModel>(id: string, type?: UnitType): Nullable<T> {+ const unit = this._getUnitById(id)?.[0] as Nullable<T>;+ if (type && unit?.type !== type) return null;+ return unit;}getCurrentUniverSheetInstance<Workbook>(): Nullable<Workbook> {@@ -244,6 +246,9 @@ export class UniverInstanceService extends Disposable implements IUniverInstanceunits.splice(index, 1);this._unitDisposed$.next(unit);+ this._currentUnits$.next({ ...this._currentUnits$.getValue(), [type]: null });+ this._focused$.next(null);+return true;}diff --git a/packages/docs-ui/src/controllers/page-render.controller.ts b/packages/docs-ui/src/controllers/page-render.controller.tsindex 9893f09517..701604cee5 100644--- a/packages/docs-ui/src/controllers/page-render.controller.ts+++ b/packages/docs-ui/src/controllers/page-render.controller.ts@@ -54,7 +54,6 @@ export class PageRenderController extends Disposable {}const currentRender = this._renderManagerService.getRenderById(unitId);-if (this._editorService.isEditor(unitId) || this._univerInstanceService.getUniverDocInstance(unitId) == null) {return;}@@ -99,5 +98,5 @@ export class PageRenderController extends Disposable {});}- private _commandExecutedListener() {}+ private _commandExecutedListener() { }}diff --git a/packages/engine-render/src/engine.ts b/packages/engine-render/src/engine.tsindex 3877afa985..032ec848aa 100644--- a/packages/engine-render/src/engine.ts+++ b/packages/engine-render/src/engine.ts@@ -675,7 +675,7 @@ export class Engine extends ThinEngine<Scene> {// IE11 only supports captureEvent:boolean, not options:object, and it defaults to false.// Feature detection technique copied from: https://github.com/github/eventlistener-polyfill (MIT license)let passiveSupported = false;- const noop = () => {};+ const noop = () => { };try {const options: object = {diff --git a/packages/ui/src/controllers/ui/ui-desktop.controller.tsx b/packages/ui/src/controllers/ui/ui-desktop.controller.tsxindex 9c218b7803..5fc28974d2 100644--- a/packages/ui/src/controllers/ui/ui-desktop.controller.tsx+++ b/packages/ui/src/controllers/ui/ui-desktop.controller.tsx@@ -71,6 +71,14 @@ export class DesktopUIController extends Disposable implements IDesktopUIControlthis.disposeWithMe(this._layoutService.registerCanvasElement(canvasElement as HTMLCanvasElement));}+ // TODO: this is subject to change in the future+ this._renderManagerService.currentRender$.subscribe((renderId) => {+ if (renderId) {+ const render = this._renderManagerService.getRenderById(renderId)!;+ render.engine.setContainer(canvasElement);+ }+ });+this._lifecycleService.lifecycle$.pipe(filter((lifecycle) => lifecycle === LifecycleStages.Ready), delay(300), take(1)).subscribe(() => {const engine = this._renderManagerService.getFirst()?.engine;engine?.setContainer(canvasElement);diff --git a/playwright.config.ts b/playwright.config.tsindex 5885fae82e..2d53890b26 100644--- a/playwright.config.ts+++ b/playwright.config.ts@@ -24,8 +24,8 @@ export default defineConfig({reporter: 'html',/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */use: {- /* Base URL to use in actions like `await page.goto('/')`. */- // baseURL: 'http://127.0.0.1:3000',+ /* Base URL to use in actions like `await page.goto('/')`. */+ baseURL: 'http://127.0.0.1:3000',/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */trace: 'on-first-retry',@@ -35,7 +35,7 @@ export default defineConfig({projects: [{name: 'chromium',- use: { ...devices['Desktop Chrome'] },+ use: { ...devices['Desktop Chrome'], headless: true },},// {@@ -58,17 +58,26 @@ export default defineConfig({// use: { ...devices['iPhone 12'] },// },- /* Test against branded browsers. */- // {- // name: 'Microsoft Edge',- // use: { ...devices['Desktop Edge'], channel: 'msedge' },- // },- // {- // name: 'Google Chrome',- // use: { ...devices['Desktop Chrome'], channel: 'chrome' },- // },+ /* Test against branded browsers. */+ // {+ // name: 'Microsoft Edge',+ // use: { ...devices['Desktop Edge'], channel: 'msedge' },+ // },+ // {+ // name: 'Google Chrome',+ // use: { ...devices['Desktop Chrome'], channel: 'chrome' },+ // },],+ webServer: {+ command: 'pnpm serve:e2e',+ url: 'http://localhost:3000/sheets',+ reuseExistingServer: !process.env.CI,+ timeout: 10000,+ stdout: 'pipe',+ stderr: 'pipe',+ },+/* Run your local dev server before starting the tests */// webServer: {// command: 'npm run start',diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 511b8efba0..5acf1d0176 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -80,6 +80,9 @@ importers:release-it:specifier: ^17.1.1version: 17.1.1([email protected])+ serve:+ specifier: ^14.2.2+ version: 14.2.2turbo:specifier: ^1.13.2version: 1.13.2@@ -6343,6 +6346,10 @@ packages:'@types/emscripten': 1.39.10tslib: 1.14.1+ /@zeit/[email protected]:+ resolution: {integrity: sha512-g5QiLIfbg3pLuYUJPlisNKY+epQJTcMDsOnVNkscrDP1oi7vmJnzOANYJI/1pZcVJ6umUkBv3aFtlg1UvUHGzA==}+ dev: true+resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==}hasBin: true@@ -6357,7 +6364,6 @@ packages:dependencies:mime-types: 2.1.35negotiator: 0.6.3- dev: falseresolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==}@@ -6530,11 +6536,19 @@ packages:resolution: {integrity: sha512-jlpIfsOoNoafl92Sz//64uQHGSyMrD2vYG5d8o2a4qGvyNCvXur7bzIsWtAC/6flI2RYAp3kv8rsfBtaLm7w0g==}+ resolution: {integrity: sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==}+ dev: true+resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==}engines: {node: '>=14'}dev: true+ resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}+ dev: true+resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}@@ -6811,6 +6825,20 @@ packages:resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}+ resolution: {integrity: sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==}+ engines: {node: '>=14.16'}+ dependencies:+ ansi-align: 3.0.1+ camelcase: 7.0.1+ chalk: 5.3.0+ cli-boxes: 3.0.0+ string-width: 5.1.2+ type-fest: 2.19.0+ widest-line: 4.0.1+ wrap-ansi: 8.1.0+ dev: true+resolution: {integrity: sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==}engines: {node: '>=14.16'}@@ -6893,7 +6921,6 @@ packages:resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==}engines: {node: '>= 0.8'}- dev: falseresolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==}@@ -6968,6 +6995,13 @@ packages:pathval: 1.1.1type-detect: 4.0.8+ resolution: {integrity: sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==}+ engines: {node: '>=12'}+ dependencies:+ chalk: 4.1.2+ dev: true+resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}engines: {node: '>=4'}@@ -6991,6 +7025,11 @@ packages:ansi-styles: 4.3.0supports-color: 7.2.0+ resolution: {integrity: sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==}+ engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}+ dev: true+resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==}engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}@@ -7152,6 +7191,15 @@ packages:engines: {node: '>= 12'}dev: true+ resolution: {integrity: sha512-Su+uU5sr1jkUy1sGRpLKjKrvEOVXgSgiSInwa/qeID6aJ07yh+5NWc3h2QfjHjBnfX4LhtFcuAWKUsJ3r+fjbg==}+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}+ dependencies:+ arch: 2.2.0+ execa: 5.1.1+ is-wsl: 2.2.0+ dev: true+resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}engines: {node: '>=12'}@@ -7270,7 +7318,6 @@ packages:engines: {node: '>= 0.6'}dependencies:mime-db: 1.52.0- dev: falseresolution: {integrity: sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==}@@ -7285,7 +7332,6 @@ packages:vary: 1.1.2transitivePeerDependencies:- supports-color- dev: falseresolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==}@@ -7331,6 +7377,11 @@ packages:resolution: {integrity: sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==}dev: false+ resolution: {integrity: sha512-kRGRZw3bLlFISDBgwTSA1TMBFN6J6GWDeubmDE3AF+3+yXL8hTWv8r5rkLbqYXY4RjPk/EzHnClI3zQf1cFmHA==}+ engines: {node: '>= 0.6'}+ dev: true+resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==}engines: {node: '>= 0.6'}@@ -7688,7 +7739,6 @@ packages:optional: truedependencies:ms: 2.0.0- dev: falseresolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}@@ -9236,6 +9286,12 @@ packages:resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}+ resolution: {integrity: sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==}+ dependencies:+ punycode: 1.4.1+ dev: true+resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==}dependencies:@@ -10267,7 +10323,6 @@ packages:resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==}engines: {node: '>=8'}hasBin: true- dev: falseresolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==}@@ -10408,6 +10463,11 @@ packages:resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==}engines: {node: '>=0.10.0'}+ resolution: {integrity: sha512-9UoipoxYmSk6Xy7QFgRv2HDyaysmgSG75TFQs6S+3pDM7ZhKTF/bskZV+0UlABHzKjNVhPjYCLfeZUEg1wXxig==}+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}+ dev: true+resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==}dev: true@@ -10511,7 +10571,6 @@ packages:engines: {node: '>=8'}dependencies:is-docker: 2.2.1- dev: falseresolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==}@@ -11271,10 +11330,22 @@ packages:braces: 3.0.2picomatch: 2.3.1+ resolution: {integrity: sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==}+ engines: {node: '>= 0.6'}+ dev: true+resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}engines: {node: '>= 0.6'}+ resolution: {integrity: sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==}+ engines: {node: '>= 0.6'}+ dependencies:+ mime-db: 1.33.0+ dev: true+resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}engines: {node: '>= 0.6'}@@ -11401,7 +11472,6 @@ packages:resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}- dev: falseresolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}@@ -11449,7 +11519,6 @@ packages:resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==}engines: {node: '>= 0.6'}- dev: falseresolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}@@ -11666,7 +11735,6 @@ packages:resolution: {integrity: sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==}engines: {node: '>= 0.8'}- dev: falseresolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}@@ -11975,6 +12043,10 @@ packages:resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}engines: {node: '>=0.10.0'}+ resolution: {integrity: sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==}+ dev: true+resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}engines: {node: '>=8'}@@ -12009,6 +12081,10 @@ packages:resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==}dev: false+ resolution: {integrity: sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==}+ dev: true+resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}engines: {node: '>=8'}@@ -12356,7 +12432,6 @@ packages:resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==}- dev: falseresolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}@@ -12403,6 +12478,11 @@ packages:safe-buffer: 5.2.1dev: false+ resolution: {integrity: sha512-kA5WQoNVo4t9lNx2kQNFCxKeBl5IbbSNBl1M/tLkw9WCn+hxNBAW5Qh8gdhs63CJnhjJ2zQWFoqPJP2sK1AV5A==}+ engines: {node: '>= 0.6'}+ dev: true+resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==}engines: {node: '>= 0.6'}@@ -13085,6 +13165,13 @@ packages:unicode-match-property-value-ecmascript: 2.1.0dev: false+ resolution: {integrity: sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==}+ dependencies:+ rc: 1.2.8+ safe-buffer: 5.2.1+ dev: true+resolution: {integrity: sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==}engines: {node: '>=14'}@@ -13092,6 +13179,13 @@ packages:'@pnpm/npm-conf': 2.2.2dev: true+ resolution: {integrity: sha512-ZbgR5aZEdf4UKZVBPYIgaglBmSF2Hi94s2PcIHhRGFjKYu+chjJdYfHn4rt3hB6eCKLJ8giVIIfgMa1ehDfZKA==}+ engines: {node: '>=0.10.0'}+ dependencies:+ rc: 1.2.8+ dev: true+resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==}engines: {node: '>=12'}@@ -13356,7 +13450,6 @@ packages:resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}- dev: falseresolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}@@ -13476,6 +13569,19 @@ packages:randombytes: 2.1.0dev: false+ resolution: {integrity: sha512-ijPFle6Hwe8zfmBxJdE+5fta53fdIY0lHISJvuikXB3VYFafRjMRpOffSPvCYsbKyBA7pvy9oYr/BT1O3EArlg==}+ dependencies:+ bytes: 3.0.0+ content-disposition: 0.5.2+ fast-url-parser: 1.1.3+ mime-types: 2.1.18+ minimatch: 3.1.2+ path-is-inside: 1.0.2+ path-to-regexp: 2.2.1+ range-parser: 1.2.0+ dev: true+resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==}engines: {node: '>= 0.8.0'}@@ -13488,6 +13594,26 @@ packages:- supports-colordev: false+ resolution: {integrity: sha512-MktTGv3ooijGxd67iQVocNdiHaOdNnEApGj7At4qHUN44XDaLFfrqbEtj5mXf+QNqyig/VdHYMRTXWRQj6TEbw==}+ engines: {node: '>= 14'}+ hasBin: true+ dependencies:+ '@zeit/schemas': 2.29.0+ ajv: 8.12.0+ arg: 5.0.2+ boxen: 7.0.0+ chalk: 5.0.1+ chalk-template: 0.4.0+ clipboardy: 3.0.0+ compression: 1.7.4+ is-port-reachable: 4.0.0+ serve-handler: 6.1.5+ update-check: 1.5.4+ transitivePeerDependencies:+ - supports-color+ dev: true+resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}engines: {node: '>= 0.4'}@@ -14548,6 +14674,13 @@ packages:escalade: 3.1.2picocolors: 1.0.0+ resolution: {integrity: sha512-5YHsflzHP4t1G+8WGPlvKbJEbAJGCgw+Em+dGR1KmBUbr1J36SJBqlHLjR7oob7sco5hWHGQVcr9B2poIVDDTQ==}+ dependencies:+ registry-auth-token: 3.3.2+ registry-url: 3.1.0+ dev: true+resolution: {integrity: sha512-Hv25Bh+eAbOLlsjJreVPOs4vd51rrtCrmhyOJtbpAojro34jS4KQaEp4/EvlHJX7jSO42VvEFpkastVyXyIsdQ==}engines: {node: '>=18'}@@ -14641,7 +14774,6 @@ packages:resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}engines: {node: '>= 0.8'}- dev: falseresolution: {integrity: sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==}@@ -15490,13 +15622,6 @@ packages:name: picocolorsversion: 1.0.0- r2.cnpmjs.org/[email protected]:- resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==, registry: https://registry.npmjs.org/, tarball: https://r2.cnpmjs.org/prr/-/prr-1.0.1.tgz}- name: prr- version: 1.0.1- requiresBuild: true- optional: true-r2.cnpmjs.org/[email protected]:resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==, registry: https://registry.npmjs.org/, tarball: https://r2.cnpmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz}name: resize-observer-polyfilldiff --git a/turbo.json b/turbo.jsonindex 741b5fb060..cf875f34ea 100644--- a/turbo.json+++ b/turbo.json@@ -1,6 +1,8 @@{"$schema": "https://turbo.build/schema.json",- "extends": ["//"],+ "extends": [+ "//"+ ],"pipeline": {"test": {"cache": false@@ -10,6 +12,7 @@},"build": {},"build:demo": {},+ "build:e2e": {},"dev:demo": {"cache": false},