Initial commit
Generated by create-expo-module 56.0.3.
This commit is contained in:
+57
@@ -0,0 +1,57 @@
|
|||||||
|
# OSX
|
||||||
|
#
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# VSCode
|
||||||
|
.vscode/
|
||||||
|
jsconfig.json
|
||||||
|
|
||||||
|
# Xcode
|
||||||
|
#
|
||||||
|
build/
|
||||||
|
*.pbxuser
|
||||||
|
!default.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
!default.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
!default.mode2v3
|
||||||
|
*.perspectivev3
|
||||||
|
!default.perspectivev3
|
||||||
|
xcuserdata
|
||||||
|
*.xccheckout
|
||||||
|
*.moved-aside
|
||||||
|
DerivedData
|
||||||
|
*.hmap
|
||||||
|
*.ipa
|
||||||
|
*.xcuserstate
|
||||||
|
project.xcworkspace
|
||||||
|
|
||||||
|
# Android/IJ
|
||||||
|
#
|
||||||
|
.classpath
|
||||||
|
.cxx
|
||||||
|
.gradle
|
||||||
|
.idea
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
local.properties
|
||||||
|
android.iml
|
||||||
|
android/app/libs
|
||||||
|
android/keystores/debug.keystore
|
||||||
|
|
||||||
|
# Cocoapods
|
||||||
|
#
|
||||||
|
example/ios/Pods
|
||||||
|
|
||||||
|
# Ruby
|
||||||
|
example/vendor/
|
||||||
|
|
||||||
|
# node.js
|
||||||
|
#
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
|
# Expo
|
||||||
|
.expo/*
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
# Exclude all top-level hidden directories by convention
|
||||||
|
/.*/
|
||||||
|
|
||||||
|
# Exclude tarballs generated by `npm pack`
|
||||||
|
/*.tgz
|
||||||
|
|
||||||
|
__mocks__
|
||||||
|
__tests__
|
||||||
|
|
||||||
|
/babel.config.js
|
||||||
|
/internal/module_scripts/
|
||||||
|
/android/src/androidTest/
|
||||||
|
/android/src/test/
|
||||||
|
/android/build/
|
||||||
|
/example/
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 100,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"singleQuote": true,
|
||||||
|
"bracketSameLine": true,
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"jsxSingleQuote": false,
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'expo-module-gradle-plugin'
|
||||||
|
}
|
||||||
|
|
||||||
|
group = 'cz.jzitnik.jecnaapireactnative'
|
||||||
|
version = '0.1.0'
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace "cz.jzitnik.jecnaapireactnative"
|
||||||
|
defaultConfig {
|
||||||
|
versionCode 1
|
||||||
|
versionName "0.1.0"
|
||||||
|
}
|
||||||
|
lintOptions {
|
||||||
|
abortOnError false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<manifest>
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package cz.jzitnik.jecnaapireactnative
|
||||||
|
|
||||||
|
import expo.modules.kotlin.modules.Module
|
||||||
|
import expo.modules.kotlin.modules.ModuleDefinition
|
||||||
|
|
||||||
|
class JecnaapiReactNativeModule : Module() {
|
||||||
|
override fun definition() = ModuleDefinition {
|
||||||
|
Name("JecnaapiReactNative")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
const { defineConfig } = require('eslint/config');
|
||||||
|
const universe = require('eslint-config-universe/flat/native');
|
||||||
|
const universeWeb = require('eslint-config-universe/flat/web');
|
||||||
|
|
||||||
|
module.exports = defineConfig([{ ignores: ['build'] }, ...universe, ...universeWeb]);
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"enabledPlugins": {
|
||||||
|
"expo@claude-plugins-official": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Expo
|
||||||
|
.expo/
|
||||||
|
dist/
|
||||||
|
web-build/
|
||||||
|
expo-env.d.ts
|
||||||
|
|
||||||
|
# Native
|
||||||
|
.kotlin/
|
||||||
|
*.orig.*
|
||||||
|
*.jks
|
||||||
|
*.p8
|
||||||
|
*.p12
|
||||||
|
*.key
|
||||||
|
*.mobileprovision
|
||||||
|
|
||||||
|
# Metro
|
||||||
|
.metro-health-check*
|
||||||
|
|
||||||
|
# debug
|
||||||
|
npm-debug.*
|
||||||
|
yarn-debug.*
|
||||||
|
yarn-error.*
|
||||||
|
|
||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env*.local
|
||||||
|
|
||||||
|
# typescript
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# generated native folders
|
||||||
|
/ios
|
||||||
|
/android
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Expo HAS CHANGED
|
||||||
|
|
||||||
|
Read the exact versioned docs at https://docs.expo.dev/versions/v56.0.0/ before writing any code.
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { Button, SafeAreaView, ScrollView, Text, View } from 'react-native';
|
||||||
|
|
||||||
|
export default function App() {
|
||||||
|
return (
|
||||||
|
<SafeAreaView style={styles.container}>
|
||||||
|
<ScrollView style={styles.container}>
|
||||||
|
<Text style={styles.header}>Module API Example</Text>
|
||||||
|
</ScrollView>
|
||||||
|
</SafeAreaView>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Group(props: { name: string; children: React.ReactNode }) {
|
||||||
|
return (
|
||||||
|
<View style={styles.group}>
|
||||||
|
<Text style={styles.groupHeader}>{props.name}</Text>
|
||||||
|
{props.children}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = {
|
||||||
|
header: { fontSize: 30, margin: 20 },
|
||||||
|
groupHeader: { fontSize: 20, marginBottom: 20 },
|
||||||
|
group: { margin: 20, backgroundColor: '#fff', borderRadius: 10, padding: 20 },
|
||||||
|
container: { flex: 1, backgroundColor: '#eee' },
|
||||||
|
view: { flex: 1, height: 200 },
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@AGENTS.md
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"expo": {
|
||||||
|
"name": "jecnaapi-react-native-example",
|
||||||
|
"slug": "jecnaapi-react-native-example",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"orientation": "portrait",
|
||||||
|
"icon": "./assets/icon.png",
|
||||||
|
"userInterfaceStyle": "light",
|
||||||
|
"ios": {
|
||||||
|
"supportsTablet": true,
|
||||||
|
"bundleIdentifier": "cz.jzitnik.jecnaapireactnative.example"
|
||||||
|
},
|
||||||
|
"android": {
|
||||||
|
"adaptiveIcon": {
|
||||||
|
"backgroundColor": "#E6F4FE",
|
||||||
|
"foregroundImage": "./assets/android-icon-foreground.png",
|
||||||
|
"backgroundImage": "./assets/android-icon-background.png",
|
||||||
|
"monochromeImage": "./assets/android-icon-monochrome.png"
|
||||||
|
},
|
||||||
|
"predictiveBackGestureEnabled": false,
|
||||||
|
"package": "cz.jzitnik.jecnaapireactnative.example"
|
||||||
|
},
|
||||||
|
"web": {
|
||||||
|
"favicon": "./assets/favicon.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 384 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,6 @@
|
|||||||
|
module.exports = function (api) {
|
||||||
|
api.cache(true);
|
||||||
|
return {
|
||||||
|
presets: ['babel-preset-expo'],
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { registerRootComponent } from 'expo';
|
||||||
|
|
||||||
|
import App from './App';
|
||||||
|
|
||||||
|
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
|
||||||
|
// It also ensures that whether you load the app in Expo Go or in a native build,
|
||||||
|
// the environment is set up appropriately
|
||||||
|
registerRootComponent(App);
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
// Learn more https://docs.expo.io/guides/customizing-metro
|
||||||
|
const { getDefaultConfig } = require('expo/metro-config');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const config = getDefaultConfig(__dirname);
|
||||||
|
|
||||||
|
// npm v7+ will install ../node_modules/react and ../node_modules/react-native because of peerDependencies.
|
||||||
|
// To prevent the incompatible react-native between ./node_modules/react-native and ../node_modules/react-native,
|
||||||
|
// excludes the one from the parent folder when bundling.
|
||||||
|
config.resolver.blockList = [
|
||||||
|
...Array.from(config.resolver.blockList ?? []),
|
||||||
|
// On windows the path will resolve with `\`. We need to escape it with `\\` for the RegExp.
|
||||||
|
new RegExp(path.resolve('..', 'node_modules', 'react').replace(/\\/g, '\\\\')),
|
||||||
|
new RegExp(path.resolve('..', 'node_modules', 'react-native').replace(/\\/g, '\\\\')),
|
||||||
|
];
|
||||||
|
|
||||||
|
config.resolver.nodeModulesPaths = [
|
||||||
|
path.resolve(__dirname, './node_modules'),
|
||||||
|
path.resolve(__dirname, '../node_modules'),
|
||||||
|
];
|
||||||
|
|
||||||
|
config.resolver.extraNodeModules = {
|
||||||
|
'jecnaapi-react-native': '..',
|
||||||
|
};
|
||||||
|
|
||||||
|
config.watchFolders = [path.resolve(__dirname, '..')];
|
||||||
|
|
||||||
|
config.transformer.getTransformOptions = async () => ({
|
||||||
|
transform: {
|
||||||
|
experimentalImportSupport: false,
|
||||||
|
inlineRequires: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = config;
|
||||||
Generated
+5971
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "jecnaapi-react-native-example",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": "index.ts",
|
||||||
|
"dependencies": {
|
||||||
|
"expo": "~56.0.12",
|
||||||
|
"react": "19.2.3",
|
||||||
|
"react-native": "0.85.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/react": "~19.2.2",
|
||||||
|
"typescript": "~6.0.3"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "expo start",
|
||||||
|
"android": "expo run:android",
|
||||||
|
"ios": "expo run:ios",
|
||||||
|
"web": "expo start --web"
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
|
"expo": {
|
||||||
|
"autolinking": {
|
||||||
|
"nativeModulesDir": ".."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"extends": "expo/tsconfig.base",
|
||||||
|
"compilerOptions": {
|
||||||
|
"strict": true,
|
||||||
|
"paths": {
|
||||||
|
"jecnaapi-react-native": ["../src/index"],
|
||||||
|
"jecnaapi-react-native/*": ["../src/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
const createConfigAsync = require('@expo/webpack-config');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = async (env, argv) => {
|
||||||
|
const config = await createConfigAsync(
|
||||||
|
{
|
||||||
|
...env,
|
||||||
|
babel: {
|
||||||
|
dangerouslyAddModulePathsToTranspile: ['jecnaapi-react-native'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
argv
|
||||||
|
);
|
||||||
|
config.resolve.modules = [
|
||||||
|
path.resolve(__dirname, './node_modules'),
|
||||||
|
path.resolve(__dirname, '../node_modules'),
|
||||||
|
];
|
||||||
|
|
||||||
|
return config;
|
||||||
|
};
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"platforms": ["apple", "android", "web"],
|
||||||
|
"apple": {
|
||||||
|
"modules": ["JecnaapiReactNativeModule"]
|
||||||
|
},
|
||||||
|
"android": {
|
||||||
|
"modules": ["cz.jzitnik.jecnaapireactnative.JecnaapiReactNativeModule"]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
const { spawnSyncWithAutoShell } = require('./util');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const SUBTARGETS = ['plugin', 'cli', 'utils', 'scripts'];
|
||||||
|
const args = process.argv.slice(2);
|
||||||
|
const target = args[0];
|
||||||
|
|
||||||
|
let tscArgs;
|
||||||
|
if (SUBTARGETS.includes(target)) {
|
||||||
|
const targetDir = path.join(process.cwd(), target);
|
||||||
|
if (!fs.existsSync(path.join(targetDir, 'tsconfig.json'))) {
|
||||||
|
console.log(`tsconfig.json not found in ${target}, skipping build for ${target}`);
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
tscArgs = ['--build', targetDir, ...args.slice(1)];
|
||||||
|
} else {
|
||||||
|
tscArgs = [...args];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
process.stdout.isTTY &&
|
||||||
|
!process.env.CI &&
|
||||||
|
!process.env.EXPO_NONINTERACTIVE &&
|
||||||
|
!tscArgs.includes('--watch')
|
||||||
|
) {
|
||||||
|
tscArgs.push('--watch');
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = spawnSyncWithAutoShell('tsc', tscArgs, { stdio: 'inherit' });
|
||||||
|
process.exit(result.status ?? 0);
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const SUBTARGETS = ['plugin', 'cli', 'utils', 'scripts'];
|
||||||
|
const target = process.argv[2];
|
||||||
|
|
||||||
|
if (target && SUBTARGETS.includes(target)) {
|
||||||
|
fs.rmSync(path.join(process.cwd(), target, 'build'), { recursive: true, force: true });
|
||||||
|
} else {
|
||||||
|
fs.rmSync(path.join(process.cwd(), 'build'), { recursive: true, force: true });
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
const { spawn, spawnSync } = require('child_process');
|
||||||
|
const path = require('path');
|
||||||
|
const fs = require('fs');
|
||||||
|
const os = require('os');
|
||||||
|
|
||||||
|
const projectPath = path.join(process.cwd(), 'example', 'android');
|
||||||
|
|
||||||
|
function openApp(command, args, options = {}) {
|
||||||
|
const detached = options.detached ?? true;
|
||||||
|
const child = spawn(command, args, {
|
||||||
|
detached,
|
||||||
|
stdio: options.stdio ?? 'ignore',
|
||||||
|
});
|
||||||
|
|
||||||
|
child.once('error', (error) => {
|
||||||
|
console.error(`Error: Failed to open Android Studio: ${error.message}`);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
child.once('spawn', () => {
|
||||||
|
if (detached) {
|
||||||
|
child.unref();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (process.platform) {
|
||||||
|
case 'darwin':
|
||||||
|
// Open command sends an AppleEvent to launch the app and then exits immediately, so we can inherit the stdio.
|
||||||
|
openApp('open', ['-a', 'Android Studio', projectPath], {
|
||||||
|
detached: false,
|
||||||
|
stdio: 'inherit',
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'linux': {
|
||||||
|
const home = os.homedir();
|
||||||
|
|
||||||
|
let studioSh;
|
||||||
|
|
||||||
|
if (process.env.ANDROID_STUDIO) {
|
||||||
|
studioSh = path.join(process.env.ANDROID_STUDIO, 'bin', 'studio.sh');
|
||||||
|
if (!fs.existsSync(studioSh)) {
|
||||||
|
console.error(
|
||||||
|
`Error: Android Studio not found at ${studioSh}.\n` +
|
||||||
|
`Check that the ANDROID_STUDIO environment variable points to your Android Studio installation directory, ` +
|
||||||
|
`or open the project manually in Android Studio: ${projectPath}`
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const possiblePaths = [
|
||||||
|
// Tarball install in home directory
|
||||||
|
`${home}/android-studio/bin/studio.sh`,
|
||||||
|
// Common system-wide installs
|
||||||
|
'/opt/android-studio/bin/studio.sh',
|
||||||
|
'/usr/local/android-studio/bin/studio.sh',
|
||||||
|
// snap
|
||||||
|
'/snap/android-studio/current/bin/studio.sh',
|
||||||
|
// TODO @behenate Install toolbox on Linux and check which is the correct path
|
||||||
|
// JetBrains Toolbox 2.x (flat layout)
|
||||||
|
`${home}/.local/share/JetBrains/Toolbox/apps/android-studio/bin/studio.sh`,
|
||||||
|
// JetBrains Toolbox 2.x (with channel subdirectory still present)
|
||||||
|
`${home}/.local/share/JetBrains/Toolbox/apps/android-studio/ch-0/bin/studio.sh`,
|
||||||
|
// Flatpak (user install)
|
||||||
|
`${home}/.local/share/flatpak/app/com.google.AndroidStudio/current/active/files/extra/android-studio/bin/studio.sh`,
|
||||||
|
// Flatpak (system install)
|
||||||
|
'/var/lib/flatpak/app/com.google.AndroidStudio/current/active/files/extra/android-studio/bin/studio.sh',
|
||||||
|
];
|
||||||
|
|
||||||
|
studioSh = possiblePaths.find((p) => fs.existsSync(p));
|
||||||
|
|
||||||
|
if (!studioSh) {
|
||||||
|
for (const bin of ['studio.sh', 'android-studio', 'studio']) {
|
||||||
|
for (const lookup of [
|
||||||
|
['which', bin],
|
||||||
|
['sh', '-c', `command -v ${bin}`],
|
||||||
|
]) {
|
||||||
|
const r = spawnSync(lookup[0], lookup.slice(1), { encoding: 'utf8' });
|
||||||
|
if (r.status === 0 && r.stdout.trim()) {
|
||||||
|
studioSh = r.stdout.trim();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (studioSh) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!studioSh) {
|
||||||
|
console.error(
|
||||||
|
`Error: Android Studio not found.\n` +
|
||||||
|
`Set the ANDROID_STUDIO environment variable to your Android Studio installation directory, ` +
|
||||||
|
`or open the project manually in Android Studio: ${projectPath}`
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// On Linux we launch Android Studio directly (long-running process), so don't inherit stdio
|
||||||
|
openApp(studioSh, [projectPath]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'win32': {
|
||||||
|
const studioExe = process.env.ANDROID_STUDIO
|
||||||
|
? path.join(process.env.ANDROID_STUDIO, 'bin', 'studio64.exe')
|
||||||
|
: path.join('C:', 'Program Files', 'Android', 'Android Studio', 'bin', 'studio64.exe');
|
||||||
|
if (!require('fs').existsSync(studioExe)) {
|
||||||
|
console.error(
|
||||||
|
`Error: Android Studio not found at ${studioExe}.\n` +
|
||||||
|
`Set the ANDROID_STUDIO environment variable to your Android Studio installation directory, ` +
|
||||||
|
`or open the project manually in Android Studio: ${projectPath}`
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
// On Windows we launch Android Studio directly (long-running process), so don't inherit stdio
|
||||||
|
openApp(studioExe, [projectPath]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
console.error(`Error: Unsupported platform: ${process.platform}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
const { spawn } = require('child_process');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
console.error(
|
||||||
|
`Error: Xcode is only available on macOS. Cannot open the iOS project on ${process.platform}.`
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const projectPath = path.join(process.cwd(), 'example', 'ios');
|
||||||
|
const child = spawn('xed', [projectPath], { stdio: 'inherit' });
|
||||||
|
|
||||||
|
child.once('error', (error) => {
|
||||||
|
console.error(`Error: Failed to open Xcode: ${error.message}`);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
const { spawnSyncWithAutoShell } = require('./util');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const SUBTARGETS = ['plugin', 'cli', 'utils', 'scripts'];
|
||||||
|
|
||||||
|
function run(cmd, args = []) {
|
||||||
|
const result = spawnSyncWithAutoShell(cmd, args, { stdio: 'inherit' });
|
||||||
|
if (result.status !== 0) process.exit(result.status ?? 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clean and build main
|
||||||
|
fs.rmSync(path.join(process.cwd(), 'build'), { recursive: true, force: true });
|
||||||
|
run('tsc');
|
||||||
|
|
||||||
|
// Clean and build any existing subtargets
|
||||||
|
for (const target of SUBTARGETS) {
|
||||||
|
const targetDir = path.join(process.cwd(), target);
|
||||||
|
if (fs.existsSync(targetDir) && fs.existsSync(path.join(targetDir, 'tsconfig.json'))) {
|
||||||
|
console.log(`Building ${target}`);
|
||||||
|
fs.rmSync(path.join(targetDir, 'build'), { recursive: true, force: true });
|
||||||
|
run('tsc', ['--build', targetDir]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
const { spawnSyncWithAutoShell } = require('./util');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const SUBTARGETS = ['plugin', 'cli', 'utils', 'scripts'];
|
||||||
|
let args = process.argv.slice(2);
|
||||||
|
|
||||||
|
// If the command is used like `yarn test plugin`, set the --rootDir option to the `plugin` directory
|
||||||
|
if (SUBTARGETS.includes(args[0])) {
|
||||||
|
const target = args[0];
|
||||||
|
const targetDir = path.join(process.cwd(), target);
|
||||||
|
const restArgs = args.slice(1);
|
||||||
|
args = ['--rootDir', target];
|
||||||
|
|
||||||
|
if (fs.existsSync(path.join(targetDir, 'jest.config.js'))) {
|
||||||
|
args.push('--config', `${target}/jest.config.js`);
|
||||||
|
}
|
||||||
|
args.push(...restArgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
process.stdout.isTTY &&
|
||||||
|
!process.env.CI &&
|
||||||
|
!process.env.EXPO_NONINTERACTIVE &&
|
||||||
|
!args.includes('--watch')
|
||||||
|
) {
|
||||||
|
args.push('--watch');
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = spawnSyncWithAutoShell('jest', args, { stdio: 'inherit' });
|
||||||
|
process.exit(result.status ?? 0);
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
const { spawnSync } = require('child_process');
|
||||||
|
|
||||||
|
// On Windows, executables like `tsc` and `jest` are `.cmd` batch files and cannot be
|
||||||
|
// spawned directly — they require shell: true to resolve. On Unix, shell: true is
|
||||||
|
// unnecessary.
|
||||||
|
function spawnSyncWithAutoShell(command, args, options) {
|
||||||
|
return spawnSync(command, args, { ...options, shell: process.platform === 'win32' });
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { spawnSyncWithAutoShell };
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
Pod::Spec.new do |s|
|
||||||
|
s.name = 'JecnaapiReactNative'
|
||||||
|
s.version = '1.0.0'
|
||||||
|
s.summary = 'A sample project summary'
|
||||||
|
s.description = 'A sample project description'
|
||||||
|
s.author = ''
|
||||||
|
s.homepage = 'https://docs.expo.dev/modules/'
|
||||||
|
s.platforms = {
|
||||||
|
:ios => '16.4',
|
||||||
|
:tvos => '16.4'
|
||||||
|
}
|
||||||
|
s.source = { git: '' }
|
||||||
|
s.static_framework = true
|
||||||
|
|
||||||
|
s.dependency 'ExpoModulesCore'
|
||||||
|
|
||||||
|
# Swift/Objective-C compatibility
|
||||||
|
s.pod_target_xcconfig = {
|
||||||
|
'DEFINES_MODULE' => 'YES',
|
||||||
|
}
|
||||||
|
|
||||||
|
s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}"
|
||||||
|
end
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import ExpoModulesCore
|
||||||
|
|
||||||
|
public class JecnaapiReactNativeModule: Module {
|
||||||
|
public func definition() -> ModuleDefinition {
|
||||||
|
Name("JecnaapiReactNative")
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+14836
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
"name": "jecnaapi-react-native",
|
||||||
|
"version": "10.3.5",
|
||||||
|
"description": "JecnaAPI je Kotlin/Java knihovna, díky které lze přistupovat k datům webu spsejecna.cz. JecnaapiReactNative je port JecnaAPI pro Expo",
|
||||||
|
"main": "build/index.js",
|
||||||
|
"types": "build/index.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
"build": "node internal/module_scripts/build.js",
|
||||||
|
"clean": "node internal/module_scripts/clean.js",
|
||||||
|
"lint": "eslint src/",
|
||||||
|
"test": "node internal/module_scripts/test.js",
|
||||||
|
"prepare": "node internal/module_scripts/prepare.js",
|
||||||
|
"open:ios": "node internal/module_scripts/open-ios.js",
|
||||||
|
"open:android": "node internal/module_scripts/open-android.js"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"react-native",
|
||||||
|
"expo",
|
||||||
|
"jecnaapi-react-native",
|
||||||
|
"JecnaapiReactNative"
|
||||||
|
],
|
||||||
|
"repository": "https://github.com/jzitnik-dev/jecnaapi-react-native",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/jzitnik-dev/jecnaapi-react-native/issues"
|
||||||
|
},
|
||||||
|
"author": "jzitnik <email@jzitnik.dev> (jzitnik-dev)",
|
||||||
|
"license": "GPL-3.0",
|
||||||
|
"homepage": "https://github.com/jzitnik-dev/jecnaapi-react-native#readme",
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.26.0",
|
||||||
|
"@types/jest": "^29.2.1",
|
||||||
|
"@types/react": "~19.1.1",
|
||||||
|
"babel-preset-expo": "~55.0.8",
|
||||||
|
"eslint": "~9.39.4",
|
||||||
|
"eslint-config-universe": "^15.0.3",
|
||||||
|
"expo": "^56.0.11",
|
||||||
|
"jest": "^29.7.0",
|
||||||
|
"jest-expo": "~55.0.9",
|
||||||
|
"prettier": "^3.0.0",
|
||||||
|
"react-native": "0.82.1",
|
||||||
|
"typescript": "^5.9.2"
|
||||||
|
},
|
||||||
|
"jest": {
|
||||||
|
"preset": "jest-expo",
|
||||||
|
"roots": [
|
||||||
|
"<rootDir>/src"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"expo": "*",
|
||||||
|
"react": "*",
|
||||||
|
"react-native": "*"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
// Define your exported module types here.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { NativeModule, requireNativeModule } from 'expo';
|
||||||
|
|
||||||
|
declare class JecnaapiReactNativeModule extends NativeModule<{}> {}
|
||||||
|
|
||||||
|
export default requireNativeModule<JecnaapiReactNativeModule>('JecnaapiReactNative');
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { registerWebModule, NativeModule } from 'expo';
|
||||||
|
|
||||||
|
class JecnaapiReactNativeModule extends NativeModule<{}> {}
|
||||||
|
|
||||||
|
export default registerWebModule(JecnaapiReactNativeModule, 'JecnaapiReactNativeModule');
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// Reexport the native module. On web, it will be resolved to JecnaapiReactNativeModule.web.ts
|
||||||
|
// and on native platforms to JecnaapiReactNativeModule.ts
|
||||||
|
export { default } from './JecnaapiReactNativeModule';
|
||||||
|
export * from './JecnaapiReactNative.types';
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"lib": ["dom", "DOM.Iterable", "esnext"],
|
||||||
|
"types": ["jest"],
|
||||||
|
"typeRoots": ["./ts-declarations", "./node_modules/@types"],
|
||||||
|
"jsx": "react-native",
|
||||||
|
"target": "esnext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleDetection": "force",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
|
"inlineSources": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": false,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
"rootDir": "./src",
|
||||||
|
"outDir": "./build"
|
||||||
|
},
|
||||||
|
"include": ["./src"],
|
||||||
|
"exclude": ["**/__mocks__/*", "**/__tests__/*"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user