tauri-plugin-live-activity 0.10.1 → 0.10.3

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/cli/xcodegen.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  // Reads the few things setup needs from Tauri's XcodeGen spec (gen/apple/project.yml) and writes the
2
2
  // spec file it includes. This is not a YAML parser: it reads top-level blocks and their child keys.
3
3
  import { createHash } from 'node:crypto';
4
-
4
+ import { parseJson } from './steps.mjs';
5
5
  export const SPEC_FILE = 'live-activity.yml';
6
6
  export const WIDGET = 'LiveActivityWidget';
7
7
  /** The extension's entitlements, next to its folder so that XcodeGen does not take them for a source. */
@@ -17,114 +17,115 @@ export const SMALL_FAMILY_KEY = 'ActivityKitSmallFamily';
17
17
  * compiles Swift, which Xcode needs to take the App Intents metadata of the linked ActivityKitIntent product.
18
18
  */
19
19
  export const APP_SOURCES = ['LiveActivityCustomViews.swift'];
20
-
21
20
  const DIGEST_LINE = /^# setup-digest: ([0-9a-f]{16})\n/m;
22
-
23
21
  function unquote(value) {
24
- const text = value?.trim();
25
- return text && /^(["']).*\1$/.test(text) ? text.slice(1, -1) : text || undefined;
22
+ const text = value?.trim();
23
+ return text && /^(["']).*\1$/.test(text) ? text.slice(1, -1) : text || undefined;
26
24
  }
27
-
28
- const isContent = line => line.trim() !== '' && !line.trim().startsWith('#');
29
-
25
+ const isContent = (line) => line.trim() !== '' && !line.trim().startsWith('#');
26
+ /** The white space that a line begins with. */
27
+ const indentOf = (line) => line.slice(0, line.length - line.trimStart().length);
30
28
  /** The line of a top-level key and the lines under it, up to the next top-level key. */
31
29
  function topLevel(lines, key) {
32
- const start = lines.findIndex(line => line === `${key}:` || line.startsWith(`${key}:`) && /\s/.test(line[key.length + 1]));
33
- if (start === -1) return undefined;
34
- let end = start + 1;
35
- while (end < lines.length && (!isContent(lines[end]) || /^\s/.test(lines[end]))) end += 1;
36
- return { start, end, head: lines[start], body: lines.slice(start + 1, end) };
30
+ const start = lines.findIndex(line => line === `${key}:` || line.startsWith(`${key}:`) && /^\s/.test(line.slice(key.length + 1)));
31
+ const head = lines[start];
32
+ if (head === undefined)
33
+ return undefined;
34
+ const next = lines.findIndex((line, index) => index > start && isContent(line) && !/^\s/.test(line));
35
+ const end = next === -1 ? lines.length : next;
36
+ return { start, end, head, body: lines.slice(start + 1, end) };
37
37
  }
38
-
39
38
  /** The keys one level under a block, each with its own lines. */
40
39
  function children(body) {
41
- const indent = body.find(isContent)?.match(/^\s*/)[0];
42
- if (!indent) return [];
43
- const result = [];
44
- for (const line of body) {
45
- const key = line.startsWith(indent) && /^[^\s#-]/.test(line.slice(indent.length))
46
- ? /^\s*("[^"]*"|'[^']*'|[^:#]+?)\s*:(\s|$)/.exec(line)?.[1] : undefined;
47
- if (key) result.push({ name: unquote(key), lines: [] });
48
- else result.at(-1)?.lines.push(line);
49
- }
50
- return result;
40
+ const first = body.find(isContent);
41
+ const indent = first === undefined ? '' : indentOf(first);
42
+ if (!indent)
43
+ return [];
44
+ const result = [];
45
+ for (const line of body) {
46
+ const key = line.startsWith(indent) && /^[^\s#-]/.test(line.slice(indent.length))
47
+ ? /^\s*("[^"]*"|'[^']*'|[^:#]+?)\s*:(\s|$)/.exec(line)?.[1] : undefined;
48
+ if (key)
49
+ result.push({ name: unquote(key), lines: [] });
50
+ else
51
+ result.at(-1)?.lines.push(line);
52
+ }
53
+ return result;
51
54
  }
52
-
53
55
  /** The `path` under the `entitlements` key of a target's lines. */
54
56
  function entitlementsPath(lines) {
55
- const at = lines.findIndex(line => /^\s+entitlements:\s*$/.test(line));
56
- if (at === -1) return undefined;
57
- const indent = /^\s*/.exec(lines[at])[0].length;
58
- for (const line of lines.slice(at + 1)) {
59
- if (isContent(line) && /^\s*/.exec(line)[0].length <= indent) break;
60
- const path = /^\s+path:\s*(.+?)\s*$/.exec(line)?.[1];
61
- if (path) return unquote(path);
62
- }
63
- return undefined;
57
+ const at = lines.findIndex(line => /^\s+entitlements:\s*$/.test(line));
58
+ const head = lines[at];
59
+ if (head === undefined)
60
+ return undefined;
61
+ const indent = indentOf(head).length;
62
+ for (const line of lines.slice(at + 1)) {
63
+ if (isContent(line) && indentOf(line).length <= indent)
64
+ break;
65
+ const path = /^\s+path:\s*(.+?)\s*$/.exec(line)?.[1];
66
+ if (path)
67
+ return unquote(path);
68
+ }
69
+ return undefined;
64
70
  }
65
-
66
71
  /**
67
72
  * The project name, Tauri's app target (`<name>_iOS`) when it exists, the path of its entitlements, the
68
73
  * setting groups, the first bundle identifier and a target that already is a widget extension.
69
74
  */
70
75
  export function readProject(text) {
71
- const lines = text.split('\n');
72
- const name = unquote(/^name:\s*(.+?)\s*$/m.exec(text)?.[1]);
73
- const targets = children(topLevel(lines, 'targets')?.body ?? []);
74
- const isWidget = target => target.name === WIDGET || target.lines.some(line => line.includes('com.apple.widgetkit-extension'));
75
- const app = targets.find(target => name && target.name === `${name}_iOS`);
76
- return {
77
- name,
78
- appTarget: app?.name,
79
- entitlements: app && entitlementsPath(app.lines),
80
- settingGroups: children(topLevel(lines, 'settingGroups')?.body ?? []).map(group => group.name),
81
- bundleId: unquote(/^\s*PRODUCT_BUNDLE_IDENTIFIER:\s*(\S+)\s*$/m.exec(text)?.[1]),
82
- widget: targets.find(isWidget)?.name,
83
- };
76
+ const lines = text.split('\n');
77
+ const name = unquote(/^name:\s*(.+?)\s*$/m.exec(text)?.[1]);
78
+ const targets = children(topLevel(lines, 'targets')?.body ?? []);
79
+ const isWidget = (target) => target.name === WIDGET || target.lines.some(line => line.includes('com.apple.widgetkit-extension'));
80
+ const app = targets.find(target => name && target.name === `${name}_iOS`);
81
+ return {
82
+ name,
83
+ appTarget: app?.name,
84
+ entitlements: app && entitlementsPath(app.lines),
85
+ settingGroups: children(topLevel(lines, 'settingGroups')?.body ?? []).map(group => group.name),
86
+ bundleId: unquote(/^\s*PRODUCT_BUNDLE_IDENTIFIER:\s*(\S+)\s*$/m.exec(text)?.[1]),
87
+ widget: targets.find(isWidget)?.name,
88
+ };
84
89
  }
85
-
86
90
  /** The App Group of a spec that setup wrote, this version or 0.2 and 0.3, so that a later run keeps it. */
87
91
  export function appGroupOf(spec = '') {
88
- const value = new RegExp(`^\\s+(?:${APP_GROUP_KEY}|${OLD_APP_GROUP_KEY}): ("[^"\\n]*")$`, 'm').exec(spec)?.[1];
89
- return value && JSON.parse(value);
92
+ const value = new RegExp(`^\\s+(?:${APP_GROUP_KEY}|${OLD_APP_GROUP_KEY}): ("[^"\\n]*")$`, 'm').exec(spec)?.[1];
93
+ const group = value === undefined ? undefined : parseJson(value);
94
+ return typeof group === 'string' ? group : undefined;
90
95
  }
91
-
92
96
  /** Whether a spec that setup wrote has the widget draw the small family, so that a later run keeps that. */
93
97
  export function drawsSmallFamily(spec = '') {
94
- return new RegExp(`^\\s+${SMALL_FAMILY_KEY}: true$`, 'm').test(spec);
98
+ return new RegExp(`^\\s+${SMALL_FAMILY_KEY}: true$`, 'm').test(spec);
95
99
  }
96
-
97
100
  /**
98
101
  * Adds `file` to the spec's `include` list. Status: `added` (with the new `text`), `present`, or
99
102
  * `unsupported` when the list has a form this does not edit.
100
103
  */
101
104
  export function addInclude(text, file) {
102
- const lines = text.split('\n');
103
- const block = topLevel(lines, 'include');
104
- if (!block) return { status: 'added', text: `${text.endsWith('\n') ? text : `${text}\n`}\ninclude:\n - ${file}\n` };
105
- if ([block.head, ...block.body].some(line => line.includes(file))) return { status: 'present', text };
106
- const inline = /^include:\s*\[(.*)\]\s*$/.exec(block.head);
107
- if (inline) {
108
- const items = inline[1].trim();
109
- return { status: 'added', text: lines.with(block.start, `include: [${items ? `${items}, ` : ''}${file}]`).join('\n') };
110
- }
111
- const item = block.body.find(line => /^\s+-\s/.test(line));
112
- if (!/^include:\s*$/.test(block.head) || !item) return { status: 'unsupported', text };
113
- const last = block.start + 1 + block.body.findLastIndex(isContent);
114
- const entry = `${item.match(/^\s*/)[0]}- ${file}`;
115
- return { status: 'added', text: [...lines.slice(0, last + 1), entry, ...lines.slice(last + 1)].join('\n') };
105
+ const lines = text.split('\n');
106
+ const block = topLevel(lines, 'include');
107
+ if (!block)
108
+ return { status: 'added', text: `${text.endsWith('\n') ? text : `${text}\n`}\ninclude:\n - ${file}\n` };
109
+ if ([block.head, ...block.body].some(line => line.includes(file)))
110
+ return { status: 'present', text };
111
+ if (/^include:\s*\[.*\]\s*$/.test(block.head)) {
112
+ const items = block.head.slice(block.head.indexOf('[') + 1, block.head.lastIndexOf(']')).trim();
113
+ return { status: 'added', text: lines.with(block.start, `include: [${items ? `${items}, ` : ''}${file}]`).join('\n') };
114
+ }
115
+ const item = block.body.find(line => /^\s+-\s/.test(line));
116
+ if (!/^include:\s*$/.test(block.head) || !item)
117
+ return { status: 'unsupported', text };
118
+ const last = block.start + 1 + block.body.findLastIndex(isContent);
119
+ const entry = `${indentOf(item)}- ${file}`;
120
+ return { status: 'added', text: [...lines.slice(0, last + 1), entry, ...lines.slice(last + 1)].join('\n') };
116
121
  }
117
-
118
- const digest = text => createHash('sha256').update(text).digest('hex').slice(0, 16);
119
-
122
+ const digest = (text) => createHash('sha256').update(text).digest('hex').slice(0, 16);
120
123
  /** True when the spec is as setup wrote it: its digest line matches the rest of the file. */
121
124
  export function writtenBySetup(text) {
122
- const match = DIGEST_LINE.exec(text);
123
- return Boolean(match) && digest(text.slice(match.index + match[0].length)) === match[1];
125
+ const match = DIGEST_LINE.exec(text);
126
+ return match !== null && digest(text.slice(match.index + match[0].length)) === match[1];
124
127
  }
125
-
126
- const quoted = value => JSON.stringify(String(value));
127
-
128
+ const quoted = (value) => JSON.stringify(value);
128
129
  /**
129
130
  * The included spec: activitykit's Swift package, the widget extension target, and in the app target the extension,
130
131
  * the button intent and the custom views. `fonts` go to the extension's UIAppFonts. An `appGroup` goes to the
@@ -132,74 +133,71 @@ const quoted = value => JSON.stringify(String(value));
132
133
  * and the widget read it. With `smallFamily` the extension's Info.plist says that the widget draws the small family,
133
134
  * for a paired Apple Watch and CarPlay. XcodeGen merges the app target's part into the target of project.yml.
134
135
  */
135
- export function widgetSpec({
136
- pluginVersion, packagePath, appTarget, bundleId, appVersion, buildVersion, teamGroup, fonts = [], appGroup, appEntitlements,
137
- smallFamily = false,
138
- }) {
139
- const versions = appVersion === undefined ? [] : [
140
- ` CFBundleShortVersionString: ${quoted(appVersion)}`,
141
- ` CFBundleVersion: ${quoted(buildVersion ?? appVersion)}`,
142
- ];
143
- const fontList = fonts.length === 0 ? [] : [' UIAppFonts:', ...fonts.map(font => ` - ${quoted(font)}`)];
144
- const group = appGroup === undefined ? [] : [` ${APP_GROUP_KEY}: ${quoted(appGroup)}`];
145
- const entitlements = path => (appGroup === undefined ? [] : [
146
- ' entitlements:',
147
- ` path: ${path}`,
148
- ' properties:',
149
- ` com.apple.security.application-groups: [${quoted(appGroup)}]`,
150
- ]);
151
- const product = name => [' - package: ActivityKit', ` product: ${name}`];
152
- const body = [
153
- 'packages:',
154
- ' ActivityKit:',
155
- ` path: ${quoted(packagePath)}`,
156
- 'targets:',
157
- ` ${quoted(appTarget)}:`,
158
- ` sources: [${APP_SOURCES.map(file => `${WIDGET}/${file}`).join(', ')}]`,
159
- ' dependencies:',
160
- ` - target: ${WIDGET}`,
161
- // The system runs a button's intent in the app. The bridge itself is in the Rust library already.
162
- ...product('ActivityKitIntent'),
163
- ...product('ActivityKitViews'),
164
- ...entitlements(quoted(appEntitlements)),
165
- ' settings:',
166
- ' base:',
167
- ' SWIFT_VERSION: "5.0"',
168
- ` ${WIDGET}:`,
169
- ' type: app-extension',
170
- ' platform: iOS',
171
- ' deploymentTarget: "16.2"',
172
- ` sources: [${WIDGET}]`,
173
- ' dependencies:',
174
- ...product('ActivityKitWidget'),
175
- ...product('ActivityKitViews'),
176
- ' info:',
177
- ` path: ${WIDGET}/Info.plist`,
178
- ' properties:',
179
- ...versions,
180
- ' NSExtension:',
181
- ' NSExtensionPointIdentifier: com.apple.widgetkit-extension',
182
- ' # A start answers CONFIGURATION_REQUIRED without an extension that declares this.',
183
- ' ActivityKitLayout: 2',
184
- ...(smallFamily ? [` ${SMALL_FAMILY_KEY}: true`] : []),
185
- ...fontList,
186
- ...group,
187
- ...entitlements(WIDGET_ENTITLEMENTS),
188
- ' settings:',
189
- ...(teamGroup ? [' groups: [app]'] : []),
190
- ' base:',
191
- ` PRODUCT_NAME: ${WIDGET}`,
192
- ` PRODUCT_BUNDLE_IDENTIFIER: ${quoted(bundleId)}`,
193
- ' SWIFT_VERSION: "5.0"',
194
- ' APPLICATION_EXTENSION_API_ONLY: YES',
195
- ' SKIP_INSTALL: YES',
196
- '',
197
- ].join('\n');
198
- return [
199
- `# Written by \`npx tauri-plugin-live-activity setup\` for tauri-plugin-live-activity ${pluginVersion}.`,
200
- '# project.yml includes it. Setup writes it again for a new plugin or activitykit version or app version, unless',
201
- '# the lines below were changed by hand.',
202
- `# setup-digest: ${digest(body)}`,
203
- body,
204
- ].join('\n');
136
+ export function widgetSpec({ pluginVersion, packagePath, appTarget, bundleId, appVersion, buildVersion, teamGroup, fonts = [], appGroup, appEntitlements, smallFamily = false, }) {
137
+ const versions = appVersion === undefined ? [] : [
138
+ ` CFBundleShortVersionString: ${quoted(appVersion)}`,
139
+ ` CFBundleVersion: ${quoted(buildVersion ?? appVersion)}`,
140
+ ];
141
+ const fontList = fonts.length === 0 ? [] : [' UIAppFonts:', ...fonts.map(font => ` - ${quoted(font)}`)];
142
+ const group = appGroup === undefined ? [] : [` ${APP_GROUP_KEY}: ${quoted(appGroup)}`];
143
+ const entitlements = (path) => (appGroup === undefined ? [] : [
144
+ ' entitlements:',
145
+ ` path: ${path}`,
146
+ ' properties:',
147
+ ` com.apple.security.application-groups: [${quoted(appGroup)}]`,
148
+ ]);
149
+ const product = (name) => [' - package: ActivityKit', ` product: ${name}`];
150
+ const body = [
151
+ 'packages:',
152
+ ' ActivityKit:',
153
+ ` path: ${quoted(packagePath)}`,
154
+ 'targets:',
155
+ ` ${quoted(appTarget)}:`,
156
+ ` sources: [${APP_SOURCES.map(file => `${WIDGET}/${file}`).join(', ')}]`,
157
+ ' dependencies:',
158
+ ` - target: ${WIDGET}`,
159
+ // The system runs a button's intent in the app. The bridge itself is in the Rust library already.
160
+ ...product('ActivityKitIntent'),
161
+ ...product('ActivityKitViews'),
162
+ ...entitlements(quoted(appEntitlements)),
163
+ ' settings:',
164
+ ' base:',
165
+ ' SWIFT_VERSION: "5.0"',
166
+ ` ${WIDGET}:`,
167
+ ' type: app-extension',
168
+ ' platform: iOS',
169
+ ' deploymentTarget: "16.2"',
170
+ ` sources: [${WIDGET}]`,
171
+ ' dependencies:',
172
+ ...product('ActivityKitWidget'),
173
+ ...product('ActivityKitViews'),
174
+ ' info:',
175
+ ` path: ${WIDGET}/Info.plist`,
176
+ ' properties:',
177
+ ...versions,
178
+ ' NSExtension:',
179
+ ' NSExtensionPointIdentifier: com.apple.widgetkit-extension',
180
+ ' # A start answers CONFIGURATION_REQUIRED without an extension that declares this.',
181
+ ' ActivityKitLayout: 2',
182
+ ...(smallFamily ? [` ${SMALL_FAMILY_KEY}: true`] : []),
183
+ ...fontList,
184
+ ...group,
185
+ ...entitlements(WIDGET_ENTITLEMENTS),
186
+ ' settings:',
187
+ ...(teamGroup ? [' groups: [app]'] : []),
188
+ ' base:',
189
+ ` PRODUCT_NAME: ${WIDGET}`,
190
+ ` PRODUCT_BUNDLE_IDENTIFIER: ${quoted(bundleId)}`,
191
+ ' SWIFT_VERSION: "5.0"',
192
+ ' APPLICATION_EXTENSION_API_ONLY: YES',
193
+ ' SKIP_INSTALL: YES',
194
+ '',
195
+ ].join('\n');
196
+ return [
197
+ `# Written by \`npx tauri-plugin-live-activity setup\` for tauri-plugin-live-activity ${pluginVersion}.`,
198
+ '# project.yml includes it. Setup writes it again for a new plugin or activitykit version or app version, unless',
199
+ '# the lines below were changed by hand.',
200
+ `# setup-digest: ${digest(body)}`,
201
+ body,
202
+ ].join('\n');
205
203
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tauri-plugin-live-activity",
3
- "version": "0.10.1",
3
+ "version": "0.10.3",
4
4
  "description": "Tauri 2 plugin for iOS Live Activities (ActivityKit and Dynamic Island) and Android Live Updates with ongoing notification fallback",
5
5
  "author": "1eedaegon",
6
6
  "type": "module",
@@ -24,23 +24,23 @@
24
24
  "./package.json": "./package.json"
25
25
  },
26
26
  "bin": { "tauri-plugin-live-activity": "cli/bin.mjs" },
27
- "files": ["dist-js", "cli", "README.md", "README.ko.md", "LICENSE", "LICENSE-APACHE", "LICENSE-MIT"],
27
+ "files": ["dist-js", "cli/*.mjs", "cli/templates", "README.md", "README.ko.md", "LICENSE", "LICENSE-APACHE", "LICENSE-MIT"],
28
28
  "publishConfig": { "access": "public", "tag": "next" },
29
29
  "engines": {
30
30
  "node": ">=22.12.0"
31
31
  },
32
32
  "scripts": {
33
- "build": "tsc -p tsconfig.json",
34
- "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p examples/demo/tsconfig.json",
33
+ "build": "tsc -p tsconfig.json && tsc -p cli && node -e \"require('node:fs').chmodSync('cli/bin.mjs', 0o755)\"",
34
+ "typecheck": "npm run build && tsc -p tools && tsc -p tests && tsc -p examples/demo/tsconfig.json && tsc -p examples/demo/tsconfig.node.json",
35
35
  "test": "npm run build && npm run test:contracts && npm run test:api && npm run test:jsx && npm run test:react && npm run test:demo && npm run test:setup",
36
- "test:contracts": "node --test --experimental-test-coverage \"--test-coverage-include=tools/activitykit.mjs\" \"--test-coverage-include=tools/sync-liveupdate.mjs\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 tests/contract-files.test.mjs tests/typescript-requests.test.mjs tests/android-liveupdate.test.mjs tests/android-contents.test.mjs tests/ci.test.mjs tests/ci-cache.test.mjs tests/ios-run.test.mjs tests/spec-coverage.test.mjs",
37
- "test:api": "node --test --experimental-test-coverage \"--test-coverage-include=dist-js/*.js\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 tests/api.test.mjs tests/api-reload.test.mjs",
38
- "test:jsx": "node --experimental-strip-types --test --experimental-test-coverage \"--test-coverage-include=dist-js/jsx/*.js\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 tests/jsx.test.mjs",
39
- "test:react": "node --test --experimental-test-coverage \"--test-coverage-include=dist-js/react/*.js\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 tests/react.test.mjs",
40
- "test:demo": "node --experimental-strip-types --test --experimental-test-coverage \"--test-coverage-include=examples/demo/src/*.ts\" \"--test-coverage-exclude=examples/demo/tests/**\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 examples/demo/tests/self-test.test.mjs examples/demo/tests/ui-state.test.mjs examples/demo/tests/layouts.test.mjs examples/demo/tests/setup.test.mjs",
41
- "test:setup": "node --test --experimental-test-coverage \"--test-coverage-include=cli/*.mjs\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 tests/setup.test.mjs",
42
- "write:requests": "npm run build && node --experimental-strip-types --test --test-update-snapshots tests/jsx.test.mjs tests/react.test.mjs examples/demo/tests/layouts.test.mjs examples/demo/tests/self-test.test.mjs examples/demo/tests/ui-state.test.mjs",
43
- "build:demo": "npm run build && node examples/demo/build.mjs",
36
+ "test:contracts": "node --experimental-strip-types --test --experimental-test-coverage \"--test-coverage-include=tools/activitykit.ts\" \"--test-coverage-include=tools/sync-liveupdate.ts\" \"--test-coverage-include=tools/cargo.ts\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 tests/contract-files.test.ts tests/typescript-requests.test.ts tests/android-liveupdate.test.ts tests/android-contents.test.ts tests/ci.test.ts tests/ci-cache.test.ts tests/ios-run.test.ts tests/spec-coverage.test.ts tests/docs.test.ts",
37
+ "test:api": "node --experimental-strip-types --test --experimental-test-coverage \"--test-coverage-include=dist-js/*.js\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 tests/api.test.ts tests/api-reload.test.ts",
38
+ "test:jsx": "node --experimental-strip-types --test --experimental-test-coverage \"--test-coverage-include=dist-js/jsx/*.js\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 tests/jsx.test.ts",
39
+ "test:react": "node --experimental-strip-types --test --experimental-test-coverage \"--test-coverage-include=dist-js/react/*.js\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 tests/react.test.ts",
40
+ "test:demo": "node --experimental-strip-types --test --experimental-test-coverage \"--test-coverage-include=examples/demo/src/*.ts\" \"--test-coverage-exclude=examples/demo/tests/**\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 examples/demo/tests/self-test.test.ts examples/demo/tests/ui-state.test.ts examples/demo/tests/layouts.test.ts examples/demo/tests/setup.test.ts",
41
+ "test:setup": "node --experimental-strip-types --test --experimental-test-coverage \"--test-coverage-include=cli/*.mjs\" --test-coverage-lines=80 --test-coverage-branches=80 --test-coverage-functions=80 tests/setup.test.ts",
42
+ "write:requests": "npm run build && node --experimental-strip-types --test --test-update-snapshots tests/jsx.test.ts tests/react.test.ts examples/demo/tests/layouts.test.ts examples/demo/tests/self-test.test.ts examples/demo/tests/ui-state.test.ts",
43
+ "build:demo": "npm run build && node --experimental-strip-types examples/demo/build.ts",
44
44
  "prepack": "npm run build",
45
45
  "pack:check": "npm pack --dry-run"
46
46
  },
@@ -54,7 +54,9 @@
54
54
  "devDependencies": {
55
55
  "@tauri-apps/cli": "2.12.4",
56
56
  "@tauri-apps/api": "2.12.4",
57
+ "@types/node": "22.20.5",
57
58
  "@types/react": "19.3.0",
59
+ "@types/react-test-renderer": "19.3.1",
58
60
  "esbuild": "0.28.2",
59
61
  "react": "19.3.1",
60
62
  "react-test-renderer": "19.3.1",