Use biome instead of eslint/prettier

This commit is contained in:
2026-04-07 19:29:54 +02:00
parent b5a15a41e9
commit 56194f6f58
24 changed files with 425 additions and 492 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
}
presets: ["module:@react-native/babel-preset"],
};
+34
View File
@@ -0,0 +1,34 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.9/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
+21
View File
@@ -5,6 +5,7 @@
"": {
"name": "react-native-omni",
"devDependencies": {
"@biomejs/biome": "2.4.10",
"@jamesacarr/eslint-formatter-github-actions": "^0.2.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
@@ -310,6 +311,24 @@
"@babel/types": ["@babel/types@7.29.0", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A=="],
"@biomejs/biome": ["@biomejs/biome@2.4.10", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.4.10", "@biomejs/cli-darwin-x64": "2.4.10", "@biomejs/cli-linux-arm64": "2.4.10", "@biomejs/cli-linux-arm64-musl": "2.4.10", "@biomejs/cli-linux-x64": "2.4.10", "@biomejs/cli-linux-x64-musl": "2.4.10", "@biomejs/cli-win32-arm64": "2.4.10", "@biomejs/cli-win32-x64": "2.4.10" }, "bin": { "biome": "bin/biome" } }, "sha512-xxA3AphFQ1geij4JTHXv4EeSTda1IFn22ye9LdyVPoJU19fNVl0uzfEuhsfQ4Yue/0FaLs2/ccVi4UDiE7R30w=="],
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.4.10", "", { "os": "darwin", "cpu": "arm64" }, "sha512-vuzzI1cWqDVzOMIkYyHbKqp+AkQq4K7k+UCXWpkYcY/HDn1UxdsbsfgtVpa40shem8Kax4TLDLlx8kMAecgqiw=="],
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.4.10", "", { "os": "darwin", "cpu": "x64" }, "sha512-14fzASRo+BPotwp7nWULy2W5xeUyFnTaq1V13Etrrxkrih+ez/2QfgFm5Ehtf5vSjtgx/IJycMMpn5kPd5ZNaA=="],
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.4.10", "", { "os": "linux", "cpu": "arm64" }, "sha512-7MH1CMW5uuxQ/s7FLST63qF8B3Hgu2HRdZ7tA1X1+mk+St4JOuIrqdhIBnnyqeyWJNI+Bww7Es5QZ0wIc1Cmkw=="],
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.4.10", "", { "os": "linux", "cpu": "arm64" }, "sha512-WrJY6UuiSD/Dh+nwK2qOTu8kdMDlLV3dLMmychIghHPAysWFq1/DGC1pVZx8POE3ZkzKR3PUUnVrtZfMfaJjyQ=="],
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.4.10", "", { "os": "linux", "cpu": "x64" }, "sha512-tZLvEEi2u9Xu1zAqRjTcpIDGVtldigVvzug2fTuPG0ME/g8/mXpRPcNgLB22bGn6FvLJpHHnqLnwliOu8xjYrg=="],
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.4.10", "", { "os": "linux", "cpu": "x64" }, "sha512-kDTi3pI6PBN6CiczsWYOyP2zk0IJI08EWEQyDMQWW221rPaaEz6FvjLhnU07KMzLv8q3qSuoB93ua6inSQ55Tw=="],
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.4.10", "", { "os": "win32", "cpu": "arm64" }, "sha512-umwQU6qPzH+ISTf/eHyJ/QoQnJs3V9Vpjz2OjZXe9MVBZ7prgGafMy7yYeRGnlmDAn87AKTF3Q6weLoMGpeqdQ=="],
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.4.10", "", { "os": "win32", "cpu": "x64" }, "sha512-aW/JU5GuyH4uxMrNYpoC2kjaHlyJGLgIa3XkhPEZI0uKhZhJZU8BuEyJmvgzSPQNGozBwWjC972RaNdcJ9KyJg=="],
"@colors/colors": ["@colors/colors@1.5.0", "", {}, "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ=="],
"@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.9.1", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ=="],
@@ -1992,6 +2011,8 @@
"fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
"fdir/picomatch": ["picomatch@4.0.4", "", {}, "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A=="],
"finalhandler/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
"finalhandler/encodeurl": ["encodeurl@1.0.2", "", {}, "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="],
-4
View File
@@ -1,4 +0,0 @@
module.exports = {
root: true,
extends: '@react-native',
};
-5
View File
@@ -1,5 +0,0 @@
module.exports = {
arrowParens: 'avoid',
singleQuote: true,
trailingComma: 'all',
};
+19 -18
View File
@@ -1,24 +1,25 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import { Omni } from 'react-native-omni';
import type React from "react";
import { StyleSheet, View } from "react-native";
import { Omni } from "react-native-omni";
function App(): React.JSX.Element {
return (
<View style={styles.container}>
<Omni isRed={true} style={styles.view} testID="omni" />
</View>
);
return (
<View style={styles.container}>
<Omni isRed={true} style={styles.view} testID="omni" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
view: {
width: 200,
height: 200
}});
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
},
view: {
width: 200,
height: 200,
},
});
export default App;
export default App;
+2 -2
View File
@@ -1,4 +1,4 @@
{
"name": "OmniExample",
"displayName": "OmniExample"
"name": "OmniExample",
"displayName": "OmniExample"
}
+19 -19
View File
@@ -1,20 +1,20 @@
const path = require('path');
const pak = require('../package.json');
const path = require("node:path");
const pak = require("../package.json");
module.exports = api => {
api.cache(true);
return {
presets: ['module:@react-native/babel-preset'],
plugins: [
[
'module-resolver',
{
extensions: ['.js', '.ts', '.json', '.jsx', '.tsx'],
alias: {
[pak.name]: path.join(__dirname, '../', pak.source),
},
},
],
],
};
};
module.exports = (api) => {
api.cache(true);
return {
presets: ["module:@react-native/babel-preset"],
plugins: [
[
"module-resolver",
{
extensions: [".js", ".ts", ".json", ".jsx", ".tsx"],
alias: {
[pak.name]: path.join(__dirname, "../", pak.source),
},
},
],
],
};
};
+3 -3
View File
@@ -2,8 +2,8 @@
* @format
*/
import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
import { AppRegistry } from "react-native";
import App from "./App";
import { name as appName } from "./app.json";
AppRegistry.registerComponent(appName, () => App);
@@ -1,53 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
"images": [
{
"idiom": "iphone",
"scale": "2x",
"size": "20x20"
},
{
"idiom": "iphone",
"scale": "3x",
"size": "20x20"
},
{
"idiom": "iphone",
"scale": "2x",
"size": "29x29"
},
{
"idiom": "iphone",
"scale": "3x",
"size": "29x29"
},
{
"idiom": "iphone",
"scale": "2x",
"size": "40x40"
},
{
"idiom": "iphone",
"scale": "3x",
"size": "40x40"
},
{
"idiom": "iphone",
"scale": "2x",
"size": "60x60"
},
{
"idiom": "iphone",
"scale": "3x",
"size": "60x60"
},
{
"idiom": "ios-marketing",
"scale": "1x",
"size": "1024x1024"
}
],
"info": {
"author": "xcode",
"version": 1
}
}
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
"info": {
"version": 1,
"author": "xcode"
}
}
+1 -1
View File
@@ -1,3 +1,3 @@
module.exports = {
preset: 'react-native',
preset: "react-native",
};
+5 -5
View File
@@ -1,6 +1,6 @@
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const path = require('path');
const root = path.resolve(__dirname, '..');
const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
const path = require("node:path");
const root = path.resolve(__dirname, "..");
/**
* Metro configuration
@@ -9,7 +9,7 @@ const root = path.resolve(__dirname, '..');
* @type {import('metro-config').MetroConfig}
*/
const config = {
watchFolders: [root],
watchFolders: [root],
};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
+36 -36
View File
@@ -1,37 +1,37 @@
{
"name": "react-native-omni-example",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios --simulator='iPhone 16'",
"lint": "eslint .",
"start": "react-native start --reset-cache",
"test": "jest",
"pod": "bundle install && bundle exec pod install --project-directory=ios"
},
"dependencies": {
"react": "19.2.3",
"react-native": "0.84.1",
"@react-native/new-app-screen": "0.84.1",
"react-native-safe-area-context": "^5.5.2",
"react-native-nitro-modules": "0.35.3"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "20.1.0",
"@react-native-community/cli-platform-android": "20.1.0",
"@react-native-community/cli-platform-ios": "20.1.0",
"@react-native/babel-preset": "0.84.1",
"@react-native/eslint-config": "0.84.1",
"@react-native/metro-config": "0.84.1",
"@react-native/typescript-config": "0.84.1",
"@types/jest": "^29.5.13",
"babel-plugin-module-resolver": "^5.0.2"
},
"engines": {
"node": ">= 22.11.0"
}
}
"name": "react-native-omni-example",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios --simulator='iPhone 16'",
"lint": "eslint .",
"start": "react-native start --reset-cache",
"test": "jest",
"pod": "bundle install && bundle exec pod install --project-directory=ios"
},
"dependencies": {
"react": "19.2.3",
"react-native": "0.84.1",
"@react-native/new-app-screen": "0.84.1",
"react-native-safe-area-context": "^5.5.2",
"react-native-nitro-modules": "0.35.3"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "20.1.0",
"@react-native-community/cli-platform-android": "20.1.0",
"@react-native-community/cli-platform-ios": "20.1.0",
"@react-native/babel-preset": "0.84.1",
"@react-native/eslint-config": "0.84.1",
"@react-native/metro-config": "0.84.1",
"@react-native/typescript-config": "0.84.1",
"@types/jest": "^29.5.13",
"babel-plugin-module-resolver": "^5.0.2"
},
"engines": {
"node": ">= 22.11.0"
}
}
+13 -13
View File
@@ -1,18 +1,18 @@
const path = require('path')
const pkg = require('../package.json')
const path = require("node:path");
const pkg = require("../package.json");
/**
* @type {import('@react-native-community/cli-types').Config}
*/
module.exports = {
project: {
ios: {
automaticPodsInstallation: true,
},
},
dependencies: {
[pkg.name]: {
root: path.join(__dirname, '..'),
},
},
}
project: {
ios: {
automaticPodsInstallation: true,
},
},
dependencies: {
[pkg.name]: {
root: path.join(__dirname, ".."),
},
},
};
+11 -11
View File
@@ -1,12 +1,12 @@
{
"extends": "@react-native/typescript-config",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["**/node_modules", "**/Pods"],
"compilerOptions": {
"strict": true,
"baseUrl": ".",
"paths": {
"react-native-omni": ["../src"]
}
}
}
"extends": "@react-native/typescript-config",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["**/node_modules", "**/Pods"],
"compilerOptions": {
"strict": true,
"baseUrl": ".",
"paths": {
"react-native-omni": ["../src"]
}
}
}
+19 -25
View File
@@ -1,26 +1,20 @@
{
"$schema": "https://nitro.margelo.com/nitro.schema.json",
"cxxNamespace": [
"omni"
],
"ios": {
"iosModuleName": "Omni"
},
"android": {
"androidNamespace": [
"omni"
],
"androidCxxLibName": "Omni"
},
"autolinking": {
"Omni": {
"android": {
"language": "kotlin",
"implementationClassName": "HybridOmni"
}
}
},
"ignorePaths": [
"**/node_modules"
]
}
"$schema": "https://nitro.margelo.com/nitro.schema.json",
"cxxNamespace": ["omni"],
"ios": {
"iosModuleName": "Omni"
},
"android": {
"androidNamespace": ["omni"],
"androidCxxLibName": "Omni"
},
"autolinking": {
"Omni": {
"android": {
"language": "kotlin",
"implementationClassName": "HybridOmni"
}
}
},
"ignorePaths": ["**/node_modules"]
}
+8 -8
View File
@@ -1,10 +1,10 @@
{
"uiViewClassName": "Omni",
"supportsRawText": false,
"bubblingEventTypes": {},
"directEventTypes": {},
"validAttributes": {
"isRed": true,
"hybridRef": true
}
"uiViewClassName": "Omni",
"supportsRawText": false,
"bubblingEventTypes": {},
"directEventTypes": {},
"validAttributes": {
"isRed": true,
"hybridRef": true
}
}
+83 -121
View File
@@ -1,122 +1,84 @@
{
"name": "react-native-omni",
"version": "0.1.0",
"description": "video player using vlc and videojs",
"main": "./lib/commonjs/index.js",
"module": "./lib/module/index.js",
"types": "./lib/typescript/src/index.d.ts",
"react-native": "src/index",
"source": "src/index",
"scripts": {
"typecheck": "tsc --noEmit",
"clean": "git clean -dfX",
"release": "semantic-release",
"build": "bun run typecheck && bob build",
"codegen": "nitrogen --logLevel=\"debug\" && bun run build && node post-script.js"
},
"keywords": [
"react-native",
"react-native-omni"
],
"files": [
"src",
"react-native.config.js",
"lib",
"nitrogen",
"cpp",
"nitro.json",
"android/build.gradle",
"android/fix-prefab.gradle",
"android/gradle.properties",
"android/CMakeLists.txt",
"android/src",
"ios/**/*.h",
"ios/**/*.m",
"ios/**/*.mm",
"ios/**/*.cpp",
"ios/**/*.swift",
"app.plugin.js",
"*.podspec",
"README.md"
],
"workspaces": [
"example"
],
"repository": "https://github.com/zoeroux/react-native-omni.git",
"author": "Zoe Roux",
"license": "MIT",
"bugs": "https://github.com/zoeroux/react-native-omni/issues",
"homepage": "https://github.com/zoeroux/react-native-omni#readme",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@jamesacarr/eslint-formatter-github-actions": "^0.2.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/jest": "^29.5.12",
"@types/react": "19.2.0",
"nitrogen": "0.35.3",
"react": "19.2.3",
"react-native": "0.84.1",
"react-native-builder-bob": "^0.40.18",
"react-native-nitro-modules": "0.35.3",
"conventional-changelog-conventionalcommits": "^9.1.0",
"semantic-release": "^25.0.3",
"typescript": "^5.8.3"
},
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-nitro-modules": "*"
},
"eslintConfig": {
"root": true,
"extends": [
"@react-native",
"prettier"
],
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": [
"warn",
{
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
]
}
},
"eslintIgnore": [
"node_modules/",
"lib/"
],
"prettier": {
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"semi": false
},
"react-native-builder-bob": {
"source": "src",
"output": "lib",
"targets": [
"commonjs",
"module",
[
"typescript",
{
"project": "tsconfig.json"
}
]
]
}
}
"name": "react-native-omni",
"version": "0.1.0",
"description": "video player using vlc and videojs",
"main": "./lib/commonjs/index.js",
"module": "./lib/module/index.js",
"types": "./lib/typescript/src/index.d.ts",
"react-native": "src/index",
"source": "src/index",
"scripts": {
"typecheck": "tsc --noEmit",
"build": "bun run typecheck && bob build",
"codegen": "nitrogen --logLevel=\"debug\" && bun run build && node post-script.js"
},
"keywords": [
"react-native",
"react-native-omni",
"vlc",
"videojs"
],
"files": [
"src",
"react-native.config.js",
"lib",
"nitrogen",
"cpp",
"nitro.json",
"android/build.gradle",
"android/fix-prefab.gradle",
"android/gradle.properties",
"android/CMakeLists.txt",
"android/src",
"ios/**/*.h",
"ios/**/*.m",
"ios/**/*.mm",
"ios/**/*.cpp",
"ios/**/*.swift",
"app.plugin.js",
"*.podspec",
"README.md"
],
"workspaces": [
"example"
],
"repository": "https://github.com/zoeroux/react-native-omni.git",
"author": "Zoe Roux",
"license": "MIT",
"bugs": "https://github.com/zoeroux/react-native-omni/issues",
"homepage": "https://github.com/zoeroux/react-native-omni#readme",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@biomejs/biome": "2.4.10",
"@types/jest": "^29.5.12",
"@types/react": "19.2.0",
"nitrogen": "0.35.3",
"react": "19.2.3",
"react-native": "0.84.1",
"react-native-builder-bob": "^0.40.18",
"react-native-nitro-modules": "0.35.3",
"typescript": "^5.8.3"
},
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-nitro-modules": "*"
},
"react-native-builder-bob": {
"source": "src",
"output": "lib",
"targets": [
"commonjs",
"module",
[
"typescript",
{
"project": "tsconfig.json"
}
]
]
}
}
+46 -52
View File
@@ -1,60 +1,54 @@
/**
* @file This script is auto-generated by create-nitro-module and should not be edited.
*
* @description This script applies a workaround for Android by modifying the '<ModuleName>OnLoad.cpp' file.
* It reads the file content and removes the 'margelo/nitro/' string from it. This enables support for custom package names.
*
* @module create-nitro-module
*/
const path = require('node:path')
const { writeFile, readFile } = require('node:fs/promises')
const { readdir } = require('node:fs/promises')
* @file This script is auto-generated by create-nitro-module and should not be edited.
*
* @description This script applies a workaround for Android by modifying the '<ModuleName>OnLoad.cpp' file.
* It reads the file content and removes the 'margelo/nitro/' string from it. This enables support for custom package names.
*
* @module create-nitro-module
*/
const path = require("node:path");
const { writeFile, readFile } = require("node:fs/promises");
const { readdir } = require("node:fs/promises");
const updateViewManagerFiles = async (file) => {
const viewManagerFile = path.join(
process.cwd(),
'nitrogen/generated/android/kotlin/com/margelo/nitro/omni/views',
file
)
const viewManagerStr = await readFile(viewManagerFile, { encoding: 'utf8' })
await writeFile(
viewManagerFile,
viewManagerStr.replace(
/com\.margelo\.nitro\.omni\.\*/g,
'com.omni.*'
)
)
}
const viewManagerFile = path.join(
process.cwd(),
"nitrogen/generated/android/kotlin/com/margelo/nitro/omni/views",
file,
);
const viewManagerStr = await readFile(viewManagerFile, { encoding: "utf8" });
await writeFile(
viewManagerFile,
viewManagerStr.replace(/com\.margelo\.nitro\.omni\.\*/g, "com.omni.*"),
);
};
const androidWorkaround = async () => {
const androidOnLoadFile = path.join(
process.cwd(),
'nitrogen/generated/android',
'OmniOnLoad.cpp'
)
const viewManagerDir = await readdir(
path.join(
process.cwd(),
'nitrogen/generated/android/kotlin/com/margelo/nitro/omni/views'
)
)
const viewManagerFiles = viewManagerDir.filter((file) =>
file.endsWith('Manager.kt')
)
const res = await Promise.allSettled(
viewManagerFiles.map(updateViewManagerFiles)
)
const androidOnLoadFile = path.join(
process.cwd(),
"nitrogen/generated/android",
"OmniOnLoad.cpp",
);
if (res.some((r) => r.status === 'rejected')) {
throw new Error(`Error updating view manager files: ${res}`)
}
const viewManagerDir = await readdir(
path.join(
process.cwd(),
"nitrogen/generated/android/kotlin/com/margelo/nitro/omni/views",
),
);
const viewManagerFiles = viewManagerDir.filter((file) =>
file.endsWith("Manager.kt"),
);
const res = await Promise.allSettled(
viewManagerFiles.map(updateViewManagerFiles),
);
const str = await readFile(androidOnLoadFile, { encoding: 'utf8' })
await writeFile(androidOnLoadFile, str.replace(/margelo\/nitro\//g, ''))
}
androidWorkaround()
if (res.some((r) => r.status === "rejected")) {
throw new Error(`Error updating view manager files: ${res}`);
}
const str = await readFile(androidOnLoadFile, { encoding: "utf8" });
await writeFile(androidOnLoadFile, str.replace(/margelo\/nitro\//g, ""));
};
androidWorkaround();
-60
View File
@@ -1,60 +0,0 @@
const rules = [
{ type: 'feat', release: 'minor', title: '✨ Features' },
{ type: 'fix', release: 'patch', title: '🐛 Bug Fixes' },
{ type: 'perf', release: 'patch', title: '💨 Performance Improvements' },
{ type: 'refactor', release: 'patch', title: '🔄 Code Refactors' },
{ type: 'docs', release: 'patch', title: '📚 Documentation' },
{ type: 'chore', release: 'patch', title: '🛠️ Other changes' },
]
const sortMap = Object.fromEntries(
rules.map((rule, index) => [rule.title, index])
)
/**
* @type {import('semantic-release').GlobalConfig}
*/
module.exports = {
branches: ['main', { name: 'next', prerelease: 'next' }],
plugins: [
[
'@semantic-release/commit-analyzer',
{
preset: 'conventionalcommits',
releaseRules: [
{ breaking: true, release: 'major' },
{ revert: true, release: 'patch' },
].concat(rules.map(({ type, release }) => ({ type, release }))),
},
],
[
'@semantic-release/release-notes-generator',
{
preset: 'conventionalcommits',
presetConfig: {
types: rules.map(({ type, title }) => ({
type,
section: title,
})),
},
writerOpts: {
commitGroupsSort: (a, z) => sortMap[a.title] - sortMap[z.title],
},
},
],
[
'@semantic-release/changelog',
{
changelogFile: 'CHANGELOG.md',
},
],
'@semantic-release/npm',
'@semantic-release/github',
[
'@semantic-release/git',
{
assets: ['package.json', 'CHANGELOG.md', 'example/package.json'],
},
],
],
}
+7 -11
View File
@@ -1,14 +1,10 @@
import { getHostComponent, type HybridRef } from 'react-native-nitro-modules'
import OmniConfig from '../nitrogen/generated/shared/json/OmniConfig.json'
import type {
OmniProps,
OmniMethods,
} from './specs/omni.nitro'
import { getHostComponent, type HybridRef } from "react-native-nitro-modules";
import OmniConfig from "../nitrogen/generated/shared/json/OmniConfig.json";
import type { OmniMethods, OmniProps } from "./specs/omni.nitro";
export const Omni = getHostComponent<OmniProps, OmniMethods>(
'Omni',
() => OmniConfig
)
"Omni",
() => OmniConfig,
);
export type OmniRef = HybridRef<OmniProps, OmniMethods>
export type OmniRef = HybridRef<OmniProps, OmniMethods>;
+6 -6
View File
@@ -1,13 +1,13 @@
import type {
HybridView,
HybridViewProps,
HybridViewMethods,
} from 'react-native-nitro-modules'
HybridView,
HybridViewMethods,
HybridViewProps,
} from "react-native-nitro-modules";
export interface OmniProps extends HybridViewProps {
isRed: boolean
isRed: boolean;
}
export interface OmniMethods extends HybridViewMethods {}
export type Omni = HybridView<OmniProps, OmniMethods, { android: 'kotlin' }>
export type Omni = HybridView<OmniProps, OmniMethods, { android: "kotlin" }>;
+35 -35
View File
@@ -1,37 +1,37 @@
{
"compilerOptions": {
"composite": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"lib": ["esnext"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": false,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
"noStrictGenericChecks": false,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "esnext",
"verbatimModuleSyntax": true
},
"exclude": [
"**/node_modules",
"**/lib",
"**/.eslintrc.js",
"**/.prettierrc.js",
"**/jest.config.js",
"**/babel.config.js",
"**/metro.config.js",
"**/tsconfig.json"
],
"include": ["src/**/*", "nitrogen/**/*.json"]
"compilerOptions": {
"composite": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"lib": ["esnext"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": false,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
"noStrictGenericChecks": false,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "esnext",
"verbatimModuleSyntax": true
},
"exclude": [
"**/node_modules",
"**/lib",
"**/.eslintrc.js",
"**/.prettierrc.js",
"**/jest.config.js",
"**/babel.config.js",
"**/metro.config.js",
"**/tsconfig.json"
],
"include": ["src/**/*", "nitrogen/**/*.json"]
}