tripilot-react-native 0.0.0-stage → 0.2.0-alpha.10

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 TriPilot contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,21 @@
1
- # Temporary Holding Version
1
+ # TriPilot React Native helper
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [English](README.md) · [Português](README.pt-BR.md)
4
+
5
+ Optional helper for TriPilot E2E. It adds test/accessibility properties without AI models, ADB, OCR or Node dependencies in the mobile bundle. Android testing works without this helper. iOS E2E is under construction and unavailable.
6
+
7
+ ```sh
8
+ pnpm add tripilot-react-native@alpha
9
+ pnpm add -D tripilot-e2e@alpha
10
+ ```
11
+
12
+ ```tsx
13
+ import { e2e } from 'tripilot-react-native';
14
+ <Pressable {...e2e('save-profile', 'Save profile')} onPress={save} />
15
+ ```
16
+
17
+ `e2e(id, label?)` sets `testID`, `collapsable: false` and an optional accessibility label. Avoid grouping all children into one accessible element when tests need individual identities.
18
+
19
+ The optional Expo config plugin's `allowLocalHttp` enables Android HTTP only when explicitly true; default leaves the manifest unchanged. ADB E2E does not require it. Install the E2E executor separately on the development/CI host as a devDependency. [Natural-language quick start](https://www.npmjs.com/package/tripilot-e2e).
20
+
21
+ The private GitHub distribution is configured as `@sto11/tripilot-react-native`; public npm uses the name above. The GitHub repository remains private.
@@ -0,0 +1,21 @@
1
+ # Helper TriPilot React Native
2
+
3
+ [English](README.md) · [Português](README.pt-BR.md)
4
+
5
+ Helper opcional que adiciona propriedades de teste/acessibilidade, sem IA, ADB, OCR ou dependências Node no bundle do app. O E2E Android funciona sem esse helper. iOS E2E está em construção e indisponível.
6
+
7
+ ```sh
8
+ pnpm add tripilot-react-native@alpha
9
+ pnpm add -D tripilot-e2e@alpha
10
+ ```
11
+
12
+ ```tsx
13
+ import { e2e } from 'tripilot-react-native';
14
+ <Pressable {...e2e('save-profile', 'Salvar perfil')} onPress={save} />
15
+ ```
16
+
17
+ `e2e(id, label?)` define `testID`, `collapsable: false` e label acessível opcional. Evite agrupar todos os filhos em um único elemento acessível quando precisar testar suas identidades separadas.
18
+
19
+ O plugin Expo opcional tem `allowLocalHttp`, que habilita HTTP Android só quando explicitamente true; o padrão preserva o manifest. ADB E2E não exige essa opção. Instale o executor no computador/CI como devDependency. [Guia com linguagem natural](https://www.npmjs.com/package/tripilot-e2e).
20
+
21
+ A distribuição privada do GitHub está configurada como `@sto11/tripilot-react-native`; npm público usa o nome acima. O repositório GitHub continua privado.
package/app.plugin.js ADDED
@@ -0,0 +1,11 @@
1
+ const { withAndroidManifest } = require('expo/config-plugins');
2
+
3
+ /** Explicit opt-in for an HTTP mock API in a development app. Default is no change. */
4
+ module.exports = function withTriPilot(config, options = {}) {
5
+ if (!options.allowLocalHttp) return config;
6
+ return withAndroidManifest(config, (result) => {
7
+ const application = result.modResults.manifest.application?.[0];
8
+ if (application) application.$['android:usesCleartextTraffic'] = 'true';
9
+ return result;
10
+ });
11
+ };
@@ -0,0 +1,3 @@
1
+ import type { ViewProps } from 'react-native';
2
+ /** Stable test IDs; keep accessibility labels useful to people using screen readers. */
3
+ export declare function e2e(id: string, label?: string): Pick<ViewProps, 'testID' | 'accessibilityLabel' | 'collapsable'>;
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.e2e = e2e;
4
+ /** Stable test IDs; keep accessibility labels useful to people using screen readers. */
5
+ function e2e(id, label) {
6
+ if (!/^[a-zA-Z][a-zA-Z0-9._-]*$/.test(id))
7
+ throw new Error(`Invalid E2E ID: ${id}`);
8
+ return { testID: id, collapsable: false, ...(label ? { accessibilityLabel: label } : {}) };
9
+ }
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "tripilot-react-native",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0-alpha.10",
4
+ "description": "Small React Native helpers and opt-in Expo configuration for TriPilot E2E.",
5
+ "license": "MIT",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "react-native": "./src/index.ts",
9
+ "files": [
10
+ "dist",
11
+ "src",
12
+ "app.plugin.js",
13
+ "README.md",
14
+ "README.pt-BR.md"
15
+ ],
16
+ "scripts": {
17
+ "build": "tsc -p tsconfig.json",
18
+ "typecheck": "tsc -p tsconfig.json --noEmit",
19
+ "prepack": "npm run build"
20
+ },
21
+ "peerDependencies": {
22
+ "react-native": ">=0.76",
23
+ "expo": ">=54"
24
+ },
25
+ "peerDependenciesMeta": {
26
+ "expo": {
27
+ "optional": true
28
+ }
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/STO11/tripilot.git",
33
+ "directory": "packages/react-native"
34
+ },
35
+ "homepage": "https://www.npmjs.com/package/tripilot-react-native",
36
+ "publishConfig": {
37
+ "registry": "https://registry.npmjs.org",
38
+ "access": "public"
39
+ }
40
+ }
package/src/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ import type { ViewProps } from 'react-native';
2
+
3
+ /** Stable test IDs; keep accessibility labels useful to people using screen readers. */
4
+ export function e2e(id: string, label?: string): Pick<ViewProps, 'testID' | 'accessibilityLabel' | 'collapsable'> {
5
+ if (!/^[a-zA-Z][a-zA-Z0-9._-]*$/.test(id)) throw new Error(`Invalid E2E ID: ${id}`);
6
+ return { testID: id, collapsable: false, ...(label ? { accessibilityLabel: label } : {}) };
7
+ }