From 1da336ff2eb00059bb1bb47515191b52776da6c8 Mon Sep 17 00:00:00 2001 From: M-i-k-e-l Date: Sun, 29 Jun 2025 11:34:27 +0300 Subject: [PATCH 1/4] Another try --- .../HighlighterOverlayView/index.tsx | 2 +- .../KeyboardTrackingView.ios.tsx | 2 +- lib/package.json | 14 ++++++++++++++ .../HighlighterViewNativeComponent.ts | 18 +++++++----------- .../KeyboardTrackingViewNativeComponent.ts | 12 ++++++------ tsconfig.json | 2 +- 6 files changed, 30 insertions(+), 20 deletions(-) rename lib/{components/HighlighterOverlayView => specs}/HighlighterViewNativeComponent.ts (72%) rename lib/{components/Keyboard/KeyboardTrackingView => specs}/KeyboardTrackingViewNativeComponent.ts (77%) diff --git a/lib/components/HighlighterOverlayView/index.tsx b/lib/components/HighlighterOverlayView/index.tsx index 8d2dd2495b..b656fd9be4 100644 --- a/lib/components/HighlighterOverlayView/index.tsx +++ b/lib/components/HighlighterOverlayView/index.tsx @@ -3,7 +3,7 @@ import {processColor, StyleSheet, Modal, ViewStyle} from 'react-native'; // Import the Codegen specification for New Architecture import HighlighterViewNativeComponent, { HighlightViewTagParams as NativeHighlightViewTagParams -} from './HighlighterViewNativeComponent'; +} from '../../specs/HighlighterViewNativeComponent'; const DefaultOverlayColor = 'rgba(0, 0, 0, 0.5)'; diff --git a/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.tsx b/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.tsx index e32b3275ae..e58c520505 100644 --- a/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.tsx +++ b/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.tsx @@ -1,7 +1,7 @@ import React, {PureComponent} from 'react'; import ReactNative, {NativeModules} from 'react-native'; // Import the Codegen specification for New Architecture -import KeyboardTrackingViewNativeComponent from './KeyboardTrackingViewNativeComponent'; +import KeyboardTrackingViewNativeComponent from '../../../specs/KeyboardTrackingViewNativeComponent'; import {KeyboardTrackingViewProps} from './index'; const KeyboardTrackingViewTempManager = NativeModules.KeyboardTrackingViewTempManager; diff --git a/lib/package.json b/lib/package.json index ee0b1823fc..a5319eb9ff 100644 --- a/lib/package.json +++ b/lib/package.json @@ -19,5 +19,19 @@ "peerDependencies": { "react": ">=17.0.1", "react-native": ">=0.64.1" + }, + "codegenConfig": { + "name": "ReactNativeUiLibSpec", + "type": "modules", + "jsSrcsDir": "specs", + "android": { + "javaPackageName": "com.wix.reactnativeuilib" + }, + "ios": { + "componentProvider": { + "HighlighterView": "HighlighterView", + "KeyboardTrackingViewTemp": "KeyboardTrackingViewTemp" + } + } } } diff --git a/lib/components/HighlighterOverlayView/HighlighterViewNativeComponent.ts b/lib/specs/HighlighterViewNativeComponent.ts similarity index 72% rename from lib/components/HighlighterOverlayView/HighlighterViewNativeComponent.ts rename to lib/specs/HighlighterViewNativeComponent.ts index b0951ef38d..d790279c3b 100644 --- a/lib/components/HighlighterOverlayView/HighlighterViewNativeComponent.ts +++ b/lib/specs/HighlighterViewNativeComponent.ts @@ -1,11 +1,7 @@ -// import type {ViewProps} from 'react-native'; -import {requireNativeComponent, type ViewProps} from 'react-native'; -import type { - Float, - Int32, - WithDefault -} from 'react-native/Libraries/Types/CodegenTypes'; -// import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import type {ViewProps} from 'react-native'; +// import {requireNativeComponent, type ViewProps} from 'react-native'; +import type {Float, Int32, WithDefault} from 'react-native/Libraries/Types/CodegenTypes'; +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; export interface HighlightFrame { x: Float; @@ -75,8 +71,8 @@ export interface NativeProps extends ViewProps { innerPadding?: WithDefault; } -// export default codegenNativeComponent('HighlighterView'); +export default codegenNativeComponent('HighlighterView'); -const HighlighterViewNativeComponent = requireNativeComponent('HighlighterView'); +// const HighlighterViewNativeComponent = requireNativeComponent('HighlighterView'); -export default HighlighterViewNativeComponent; +// export default HighlighterViewNativeComponent; diff --git a/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingViewNativeComponent.ts b/lib/specs/KeyboardTrackingViewNativeComponent.ts similarity index 77% rename from lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingViewNativeComponent.ts rename to lib/specs/KeyboardTrackingViewNativeComponent.ts index 9e78056c1d..b5d4b988db 100644 --- a/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingViewNativeComponent.ts +++ b/lib/specs/KeyboardTrackingViewNativeComponent.ts @@ -1,7 +1,7 @@ -// import type {ViewProps} from 'react-native'; -import {requireNativeComponent, type ViewProps} from 'react-native'; +import type {ViewProps} from 'react-native'; +// import {requireNativeComponent, type ViewProps} from 'react-native'; import type {Int32, WithDefault} from 'react-native/Libraries/Types/CodegenTypes'; -// import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; export interface NativeProps extends ViewProps { /** @@ -67,8 +67,8 @@ export interface NativeProps extends ViewProps { usesBottomTabs?: WithDefault; } -// export default codegenNativeComponent('KeyboardTrackingViewTemp'); +export default codegenNativeComponent('KeyboardTrackingViewTemp'); -const KeyboardTrackingViewNativeComponent = requireNativeComponent('KeyboardTrackingViewTemp'); +// const KeyboardTrackingViewNativeComponent = requireNativeComponent('KeyboardTrackingViewTemp'); -export default KeyboardTrackingViewNativeComponent; +// export default KeyboardTrackingViewNativeComponent; diff --git a/tsconfig.json b/tsconfig.json index 55cfbe7ece..085de3e643 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,6 +30,6 @@ "style": ["./src/style"] } }, - "include": ["src/**/*", "typings/**/*", "demo/**/*", "lib/components/**/*"] , + "include": ["src/**/*", "typings/**/*", "demo/**/*", "lib/components/**/*", "lib/specs/**/*"] , "exclude": ["node_modules"] } From d04c6bbbe95f872774ae9c6ebd54e7bdc5c90c93 Mon Sep 17 00:00:00 2001 From: M-i-k-e-l Date: Sun, 29 Jun 2025 12:14:28 +0300 Subject: [PATCH 2/4] Do not transpile specs --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 085de3e643..55cfbe7ece 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,6 +30,6 @@ "style": ["./src/style"] } }, - "include": ["src/**/*", "typings/**/*", "demo/**/*", "lib/components/**/*", "lib/specs/**/*"] , + "include": ["src/**/*", "typings/**/*", "demo/**/*", "lib/components/**/*"] , "exclude": ["node_modules"] } From 6ee47604502bf09e1aec758cec7e197d886b975d Mon Sep 17 00:00:00 2001 From: M-i-k-e-l Date: Sun, 29 Jun 2025 13:42:33 +0300 Subject: [PATCH 3/4] Another one --- lib/.npmignore | 3 +++ lib/package.json | 14 -------------- package.json | 2 +- yarn.lock | 10 +++++----- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/lib/.npmignore b/lib/.npmignore index b839865a69..edbbb01dff 100644 --- a/lib/.npmignore +++ b/lib/.npmignore @@ -5,3 +5,6 @@ *.d.js # include the .d.ts files !*.d.ts +# ignore the .js files in the specs folder and include the .ts files and include the .ts files +specs/**/*.js +!specs/**/*.ts diff --git a/lib/package.json b/lib/package.json index a5319eb9ff..ee0b1823fc 100644 --- a/lib/package.json +++ b/lib/package.json @@ -19,19 +19,5 @@ "peerDependencies": { "react": ">=17.0.1", "react-native": ">=0.64.1" - }, - "codegenConfig": { - "name": "ReactNativeUiLibSpec", - "type": "modules", - "jsSrcsDir": "specs", - "android": { - "javaPackageName": "com.wix.reactnativeuilib" - }, - "ios": { - "componentProvider": { - "HighlighterView": "HighlighterView", - "KeyboardTrackingViewTemp": "KeyboardTrackingViewTemp" - } - } } } diff --git a/package.json b/package.json index a11abd7925..a122211d7b 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "react-native-redash": "^12.0.3", "semver": "^5.5.0", "tinycolor2": "^1.4.2", - "uilib-native": "5.0.0-snapshot.7207", + "uilib-native": "5.0.0-snapshot.7211", "url-parse": "^1.2.0", "wix-react-native-text-size": "1.0.9" }, diff --git a/yarn.lock b/yarn.lock index d7188591c0..7f00e16fd3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10928,7 +10928,7 @@ __metadata: shell-utils: ^1.0.10 tinycolor2: ^1.4.2 typescript: 5.0.4 - uilib-native: 5.0.0-snapshot.7207 + uilib-native: 5.0.0-snapshot.7211 url-parse: ^1.2.0 wix-react-native-text-size: 1.0.9 peerDependencies: @@ -12560,16 +12560,16 @@ __metadata: languageName: node linkType: hard -"uilib-native@npm:5.0.0-snapshot.7207": - version: 5.0.0-snapshot.7207 - resolution: "uilib-native@npm:5.0.0-snapshot.7207" +"uilib-native@npm:5.0.0-snapshot.7211": + version: 5.0.0-snapshot.7211 + resolution: "uilib-native@npm:5.0.0-snapshot.7211" dependencies: lodash: ^4.17.21 prop-types: ^15.5.10 peerDependencies: react: ">=17.0.1" react-native: ">=0.64.1" - checksum: 3246a839f411acc4b05507eb3f1c1eea350b38268c8167e68fe6ca123985a53b848578df33bf738aee230cd2ef535bc41bd975d1e1f848e7263ff59ee7ae04e9 + checksum: 14e3c04eac408f93114bf6460047e6b522e9b79a4334489ce337607eac83c822f0c5a91e8fbd2b4060796a01187dd4571d9e6dba18bbf8fdcda5c0c0d27f4402 languageName: node linkType: hard From 699b11e64f47dfe584e7a59f98bfba6e42ca5566 Mon Sep 17 00:00:00 2001 From: M-i-k-e-l Date: Sun, 29 Jun 2025 14:03:27 +0300 Subject: [PATCH 4/4] Update snapshot --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index a122211d7b..ebc0feef81 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "react-native-redash": "^12.0.3", "semver": "^5.5.0", "tinycolor2": "^1.4.2", - "uilib-native": "5.0.0-snapshot.7211", + "uilib-native": "5.0.0-snapshot.7212", "url-parse": "^1.2.0", "wix-react-native-text-size": "1.0.9" }, diff --git a/yarn.lock b/yarn.lock index 7f00e16fd3..bd4ce760d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10928,7 +10928,7 @@ __metadata: shell-utils: ^1.0.10 tinycolor2: ^1.4.2 typescript: 5.0.4 - uilib-native: 5.0.0-snapshot.7211 + uilib-native: 5.0.0-snapshot.7212 url-parse: ^1.2.0 wix-react-native-text-size: 1.0.9 peerDependencies: @@ -12560,16 +12560,16 @@ __metadata: languageName: node linkType: hard -"uilib-native@npm:5.0.0-snapshot.7211": - version: 5.0.0-snapshot.7211 - resolution: "uilib-native@npm:5.0.0-snapshot.7211" +"uilib-native@npm:5.0.0-snapshot.7212": + version: 5.0.0-snapshot.7212 + resolution: "uilib-native@npm:5.0.0-snapshot.7212" dependencies: lodash: ^4.17.21 prop-types: ^15.5.10 peerDependencies: react: ">=17.0.1" react-native: ">=0.64.1" - checksum: 14e3c04eac408f93114bf6460047e6b522e9b79a4334489ce337607eac83c822f0c5a91e8fbd2b4060796a01187dd4571d9e6dba18bbf8fdcda5c0c0d27f4402 + checksum: f293839cebb6b8dca255de9b02dcf27f36892aa8d2c97ae1445c4e8506d43db03cd95758ae7685f642fce051bff016667a91632083d48ac6581dc101691f3365 languageName: node linkType: hard