@lvce-editor/main-area-worker 9.72.1 → 9.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,71 @@
1
1
  # Main Area Worker
2
2
 
3
- WebWorker for the main area functionality in Lvce Editor.
3
+ The Main Area Worker manages the editor's open tabs and editor groups in Lvce Editor. It handles opening and saving editors, tab and group layout changes, and the worker side of main-area RPC. Its command handlers are collected in [`CommandMap.ts`](packages/main-area-worker/src/parts/CommandMap/CommandMap.ts).
4
4
 
5
- <!-- -->
5
+ ## Repository layout
6
+
7
+ ```text
8
+ .
9
+ ├── packages/main-area-worker # Worker source and unit tests
10
+ ├── packages/build # Build, development, static export, and measurement scripts
11
+ ├── packages/e2e # Browser end-to-end tests
12
+ └── packages/e2e-integration # Scenarios and scripts for application integration tests
13
+ ```
14
+
15
+ The worker starts at [`mainAreaWorkerMain.ts`](packages/main-area-worker/src/mainAreaWorkerMain.ts), which invokes [`MainAreaMain.ts`](packages/main-area-worker/src/parts/MainAreaMain/MainAreaMain.ts). Unit tests are in `packages/main-area-worker/test`.
16
+
17
+ ## Requirements
18
+
19
+ - Node.js `24.13.0` or a compatible version, as specified in [`.nvmrc`](.nvmrc)
20
+ - npm
21
+ - Playwright browser binaries for the browser end-to-end tests
22
+
23
+ Install dependencies from the repository root:
24
+
25
+ ```sh
26
+ npm ci
27
+ ```
28
+
29
+ ## Development commands
30
+
31
+ Run these commands from the repository root:
32
+
33
+ | Command | Description |
34
+ | ---------------------- | ----------------------------------------------------------------------------------------- |
35
+ | `npm run build` | Builds the worker and writes its package output to `.tmp/dist`. |
36
+ | `npm run build:watch` | Rebuilds the worker when source files change. |
37
+ | `npm run dev` | Runs the watch build and the local test server for `packages/e2e`. |
38
+ | `npm run build:static` | Exports a static test build to `.tmp/static`; run `npm run build` first. |
39
+ | `npm test` | Runs available test scripts in npm workspaces, including the main-area worker unit tests. |
40
+ | `npm run type-check` | Type-checks the TypeScript project references. |
41
+ | `npm run lint` | Runs ESLint, Prettier checks, and Knip. |
42
+ | `npm run measure` | Runs the worker's memory measurement suite. |
43
+
44
+ Build output includes `.tmp/dist/dist/mainAreaWorkerMain.js` and a generated package manifest. A build also uses the repository's `README.md` and `LICENSE` in that package output.
45
+
46
+ ## Browser tests
47
+
48
+ The browser suites live in `packages/e2e`. Build first so the local server can load the generated worker:
49
+
50
+ ```sh
51
+ npm run build
52
+ cd packages/e2e
53
+ npx playwright install chromium firefox webkit
54
+ npm run e2e:headless
55
+ npm run e2e:firefox:headless
56
+ npm run e2e:webkit:headless
57
+ ```
58
+
59
+ The repository also provides `npm run e2e`, `npm run e2e:firefox`, and `npm run e2e:webkit` for headed runs. In CI, the WebKit suite is excluded on Windows.
60
+
61
+ Application integration scenarios use a disposable Lvce Editor checkout. See the [`packages/e2e-integration` guide](packages/e2e-integration/README.md) for preparation and execution instructions.
62
+
63
+ ## CI and releases
64
+
65
+ Pull requests run build, static build, unit tests, type checking, lint, Chromium and Firefox browser suites, WebKit where supported, memory measurement, and Electron tab-move integration tests on Ubuntu, macOS, and Windows. Pushes to `main` run the build, test, browser, and measurement matrix and deploy the static test build to GitHub Pages.
66
+
67
+ Pushing a version tag matching `v*.*.*` starts the release workflow. It builds the publishable package, publishes it to npm, and publishes the GitHub release after a draft is created.
68
+
69
+ ## License
70
+
71
+ MIT
@@ -1560,7 +1560,7 @@ const invoke$2 = async (command, ...args) => {
1560
1560
  return state$2.rpc.invoke(command, ...args);
1561
1561
  };
1562
1562
 
1563
- const cacheName = 'lvce0main-area-tabs';
1563
+ const cacheName = 'lvce-main-area-tabs';
1564
1564
  const cacheDuration = 90 * 24 * 60 * 60 * 1000;
1565
1565
  const maxClosedTabs = 20;
1566
1566
  const pendingOperations = new Map();
@@ -7129,7 +7129,7 @@ const newFile = async state => {
7129
7129
  newState: latestState
7130
7130
  } = get$1(uid);
7131
7131
  const readyState = handleViewletReady(latestState, actualEditorUid, title);
7132
- return readyState;
7132
+ return focus(readyState);
7133
7133
  };
7134
7134
 
7135
7135
  const handleHeaderDoubleClick = async (state, className, groupIndexRaw) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-area-worker",
3
- "version": "9.72.1",
3
+ "version": "9.73.0",
4
4
  "description": "Main Area Worker",
5
5
  "repository": {
6
6
  "type": "git",