Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Include replacement text or code examples if applicable.
- [ ] CHANGELOG.md
- [ ] API Reference / Configuration Parameters
- [ ] Lifecycle Events Reference
- [ ] Example app (`test-example/`)
- [ ] Example app (`example/`)
- [ ] Code examples
- [ ] Other (describe):

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ If relevant, paste your current upload configuration.
- [ ] API Reference / Configuration Parameters
- [ ] Lifecycle Events Reference
- [ ] Troubleshooting section
- [ ] Example app (`test-example/`)
- [ ] Example app (`example/`)
- [ ] GitHub Issues
- [ ] Other (describe):

Expand Down
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ project.xcworkspace
**/.xcode.env.local

# Example App
test-example/.env
example/.env

# Android/IJ
#
Expand All @@ -55,15 +55,15 @@ android.iml

# Cocoapods
#
test-example/ios/Pods
example/ios/Pods

# Ruby
test-example/vendor/
example/vendor/

# node.js
#
node_modules/
test-example/node_modules/
example/node_modules/
npm-debug.log

# BUCK
Expand All @@ -88,12 +88,12 @@ android/keystores/debug.keystore
# generated by bob , Compilation Outputs
lib/
dist/
test-example/ios/build/
example/ios/build/

# test coverage reports (generated by jest --coverage)
coverage/
test-example/android/build/
test-example/android/app/build/
example/android/build/
example/android/app/build/

# --- Diagnostic and Log Files ---
npm-debug.log*
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ chunked uploads for large files on Android and iOS.
`on()`/`off()` subscription and `state`, `progress`, and `stateHistory`
getters.
- **`enableLogs`** option for SDK-internal debug logging (with URL/path masking).
- Example React Native app under `test-example/` demonstrating picking, upload,
- Example React Native app under `example/` demonstrating picking, upload,
progress, pause/resume/abort, retries, and network recovery.
- Jest test suite covering the core engine, chunking, network monitor, event
emitter, and validation, with coverage measured in CI.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ A signed URL is a pre-authenticated URL that allows secure, direct uploads to Fa

### Sample Code: Generating a Signed URL

Here is a self-contained service that calls the FastPix Direct Upload API and returns a signed URL. It uses `axios` and `base-64` for the Basic Auth header (the same approach used by the bundled example app in [`test-example/src/Services/ApiService.ts`](test-example/src/Services/ApiService.ts)):
Here is a self-contained service that calls the FastPix Direct Upload API and returns a signed URL. It uses `axios` and `base-64` for the Basic Auth header (the same approach used by the bundled example app in [`example/src/Services/ApiService.ts`](example/src/Services/ApiService.ts)):

> This is **your** backend/service code, not part of the SDK. Install its helpers with `npm install axios base-64`. On a Node backend you can drop `base-64` and use `Buffer.from(...).toString("base64")` instead.

Expand Down Expand Up @@ -218,7 +218,7 @@ await upload.resume(); // re-syncs the server offset, then continues

### Full React component: progress bar with pause / resume / abort

A complete, copy-paste example wiring the resumable lifecycle to UI controls. The same flow is implemented end-to-end in the bundled [`test-example/`](test-example/) app.
A complete, copy-paste example wiring the resumable lifecycle to UI controls. The same flow is implemented end-to-end in the bundled [`example/`](example/) app.

```jsx
import React, { useEffect, useRef, useState } from "react";
Expand Down Expand Up @@ -551,7 +551,7 @@ The example demonstrates:
* Network recovery
* Error handling

Refer to the **`test-example/`** directory for the complete implementation.
Refer to the **`example/`** directory for the complete implementation.

## Troubleshooting

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test-example/README.md → example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cd .. # repository root
npm install # installs the SDK + this example, and builds the SDK
```

After this, most packages live in `<repo-root>/node_modules`, and `test-example/node_modules`
After this, most packages live in `<repo-root>/node_modules`, and `example/node_modules`
will look almost empty. That is expected — the Android and Metro configs resolve packages
through Node, so they find them wherever npm hoisted them.

Expand Down Expand Up @@ -112,7 +112,7 @@ npm run ios

| Symptom | Cause | Fix |
| ------- | ----- | --- |
| `Included build '.../node_modules/@react-native/gradle-plugin' does not exist` | Ran `npm install` inside `test-example/` only, or `node` is not on the `PATH` of the process running Gradle (typical for Android Studio + `nvm`). | Run `npm install` from the repo root; launch Android Studio from a terminal or symlink node. |
| `Included build '.../node_modules/@react-native/gradle-plugin' does not exist` | Ran `npm install` inside `example/` only, or `node` is not on the `PATH` of the process running Gradle (typical for Android Studio + `nvm`). | Run `npm install` from the repo root; launch Android Studio from a terminal or symlink node. |
| `CreateUploadError` / network error while online | No `.env` file, or Metro cached the old (empty) values. | `cp .env.example .env`, fill all three values, then `npm start -- --reset-cache`. |
| `HTTP 401` from the upload API | Wrong `Access_Token_Id` / `Secret_Key`. | Regenerate credentials in the FastPix Dashboard. |
| `HTTP 404` from the upload API | `Base_Api_Url` includes a path such as `/upload`. | Set the base URL only: `https://api.fastpix.io/v1/on-demand`. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencyLocking {
react {
/* Folders */
// Resolved through node so this works with npm workspaces, where the
// dependencies are hoisted to the monorepo root instead of test-example/node_modules.
// dependencies are hoisted to the monorepo root instead of example/node_modules.
root = file("../../")
reactNativeDir = file(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile()
codegenDir = file(["node", "--print", "require.resolve('@react-native/codegen/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
196 changes: 98 additions & 98 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
"!android/gradlew",
"!android/gradlew.bat",
"!android/local.properties",
"!**/__tests__",
"!**/tests",
"!**/__fixtures__",
"!**/__mocks__",
"!**/.*"
],
"scripts": {
"example": "npm run --workspace react-native-uploads-example",
"clean": "del-cli android/build test-example/android/build test-example/android/app/build test-example/ios/build lib",
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
"build": "bob build && tsc --project tsconfig.build.json",
"prepare": "npm run build",
"typecheck": "tsc --noEmit",
Expand Down Expand Up @@ -107,7 +107,7 @@
"react-native": "*"
},
"workspaces": [
"test-example"
"example"
],
"react-native-builder-bob": {
"source": "src",
Expand Down Expand Up @@ -155,8 +155,8 @@
"<rootDir>/dist/"
],
"testMatch": [
"**/__tests__/**/*.test.ts",
"**/__tests__/**/*.test.tsx"
"**/tests/**/*.test.ts",
"**/tests/**/*.test.tsx"
]
},
"create-react-native-library": {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* FastPixUpload.test.ts
* Lives in __tests__/ at the project root.
* All paths are relative to __tests__/, i.e. src is at ../src/
* Lives in tests/ at the project root.
* All paths are relative to tests/, i.e. src is at ../src/
*/

import { FastPixUpload } from '../src/core/FastPixUpload';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading