@opentui/react 0.5.14 → 0.5.16
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/{chunk-pqj318y4.js → chunk-q2wps7a7.js} +2 -2
- package/index.js +1 -1
- package/package.json +2 -2
- package/scripts/runtime-plugin-support-configure.d.ts +2 -1
- package/scripts/runtime-plugin-support-configure.js +12 -0
- package/scripts/runtime-plugin-support-configure.js.map +1 -1
- package/test-utils.js +1 -1
|
@@ -164,7 +164,7 @@ import { ImageRenderable as ImageRenderable2, TextNodeRenderable as TextNodeRend
|
|
|
164
164
|
// package.json
|
|
165
165
|
var package_default = {
|
|
166
166
|
name: "@opentui/react",
|
|
167
|
-
version: "0.5.
|
|
167
|
+
version: "0.5.16",
|
|
168
168
|
description: "React renderer for building terminal user interfaces using OpenTUI core",
|
|
169
169
|
license: "MIT",
|
|
170
170
|
repository: {
|
|
@@ -206,7 +206,7 @@ var package_default = {
|
|
|
206
206
|
build: "bun run scripts/build.ts",
|
|
207
207
|
"build:examples": "bun examples/build.ts",
|
|
208
208
|
"build:dev": "bun run scripts/build.ts --dev",
|
|
209
|
-
publish: "bun
|
|
209
|
+
publish: "bun ../../scripts/npm-publish.ts publish @opentui/react",
|
|
210
210
|
test: "bun test"
|
|
211
211
|
},
|
|
212
212
|
devDependencies: {
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "0.5.
|
|
7
|
+
"version": "0.5.16",
|
|
8
8
|
"description": "React renderer for building terminal user interfaces using OpenTUI core",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@opentui/core": "0.5.
|
|
55
|
+
"@opentui/core": "0.5.16",
|
|
56
56
|
"react-reconciler": "^0.33.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type RuntimeModuleEntry, type RuntimePluginRewriteOptions } from "@opentui/core/runtime-plugin";
|
|
1
|
+
import { type RuntimeModuleEntry, type RuntimePluginRewriteOptions, type RuntimeSpecifierPreserve } from "@opentui/core/runtime-plugin";
|
|
2
2
|
export interface ReactRuntimePluginSupportOptions {
|
|
3
3
|
additional?: Record<string, RuntimeModuleEntry>;
|
|
4
4
|
core?: RuntimeModuleEntry;
|
|
5
|
+
preserve?: RuntimeSpecifierPreserve;
|
|
5
6
|
rewrite?: RuntimePluginRewriteOptions;
|
|
6
7
|
}
|
|
7
8
|
export declare function ensureRuntimePluginSupport(options?: ReactRuntimePluginSupportOptions): boolean;
|
|
@@ -17,6 +17,13 @@ const defaultRuntimeModules = {
|
|
|
17
17
|
function normalizeRewriteKey(rewrite) {
|
|
18
18
|
return `${rewrite?.nodeModulesRuntimeSpecifiers ?? true}:${rewrite?.nodeModulesBareSpecifiers ?? false}`;
|
|
19
19
|
}
|
|
20
|
+
function normalizePreserveKey(preserve) {
|
|
21
|
+
if (preserve === undefined || typeof preserve === "function") {
|
|
22
|
+
return preserve;
|
|
23
|
+
}
|
|
24
|
+
const specifiers = [...new Set(preserve)].sort();
|
|
25
|
+
return specifiers.length > 0 ? JSON.stringify(specifiers) : undefined;
|
|
26
|
+
}
|
|
20
27
|
function createRuntimeModules(options) {
|
|
21
28
|
return {
|
|
22
29
|
...defaultRuntimeModules,
|
|
@@ -32,6 +39,9 @@ function assertCompatibleInstall(install, modules, options) {
|
|
|
32
39
|
if (options?.core && options.core !== install.core) {
|
|
33
40
|
throw new Error("OpenTUI React runtime plugin support is already installed with a different core runtime module.");
|
|
34
41
|
}
|
|
42
|
+
if (options?.preserve && normalizePreserveKey(options.preserve) !== install.preserveKey) {
|
|
43
|
+
throw new Error("OpenTUI React runtime plugin support is already installed with different preserve options.");
|
|
44
|
+
}
|
|
35
45
|
if (options?.rewrite && normalizeRewriteKey(options.rewrite) !== install.rewriteKey) {
|
|
36
46
|
throw new Error("OpenTUI React runtime plugin support is already installed with different rewrite options.");
|
|
37
47
|
}
|
|
@@ -49,11 +59,13 @@ export function ensureRuntimePluginSupport(options = {}) {
|
|
|
49
59
|
registerBunPlugin(createRuntimePlugin({
|
|
50
60
|
core,
|
|
51
61
|
additional: modules,
|
|
62
|
+
preserve: options.preserve,
|
|
52
63
|
rewrite: options.rewrite,
|
|
53
64
|
}));
|
|
54
65
|
state[runtimePluginSupportInstalledKey] = {
|
|
55
66
|
specifiers: new Set(Object.keys(modules)),
|
|
56
67
|
core,
|
|
68
|
+
preserveKey: normalizePreserveKey(options.preserve),
|
|
57
69
|
rewriteKey,
|
|
58
70
|
};
|
|
59
71
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-plugin-support-configure.js","sourceRoot":"","sources":["runtime-plugin-support-configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,KAAK,CAAA;AACjD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA;AAC5C,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"runtime-plugin-support-configure.js","sourceRoot":"","sources":["runtime-plugin-support-configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,KAAK,CAAA;AACjD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA;AAC5C,OAAO,EACL,mBAAmB,GAIpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,YAAY,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,mBAAmB,MAAM,aAAa,CAAA;AAElD,MAAM,gCAAgC,GAAG,+C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