Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build React Native Package and Playground
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
merge_group:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js 20.x
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: 20.x

- name: Install pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

- name: Install dependencies
run: pnpm install

Comment thread
pandeymangg marked this conversation as resolved.
- name: Build
run: pnpm build
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run unit tests for react-native package
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
merge_group:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js 20.x
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: 20.x
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

- name: Install pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

- name: Install dependencies
run: pnpm install

- name: Test
run: pnpm test
3 changes: 2 additions & 1 deletion apps/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "expo start --reset-cache",
"android": "expo start --android",
"ios": "expo start --ios",
"clean": "rimraf .turbo node_modules .expo"
"clean": "rimraf .turbo node_modules .expo",
"build": "expo export"
},
"dependencies": {
"@formbricks/react-native": "workspace:*",
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"dev": "turbo run dev",
"lint": "turbo run lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"check-types": "turbo run check-types"
"check-types": "turbo run check-types",
"test": "turbo run test --no-cache",
"test:coverage": "turbo run test:coverage --no-cache"
},
"devDependencies": {
"prettier": "^3.5.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"dev": "vite build --watch --mode dev",
"clean": "rimraf .turbo node_modules dist .turbo",
"test": "vitest",
"coverage": "vitest run --coverage"
"test:coverage": "vitest run --coverage"
},
"dependencies": {
"@react-native-community/netinfo": "11.4.1",
Expand Down
7 changes: 5 additions & 2 deletions packages/react-native/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ const config = (): UserConfig => {
fileName: "index",
},
},
plugins: [dts({ rollupTypes: true, bundledPackages: ["@formbricks/types"] })],
plugins: [
dts({ rollupTypes: true, bundledPackages: ["@formbricks/types"] }),
],
test: {
setupFiles: ["./vitest.setup.ts"],
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
include: ["src/lib/**/*.ts"],
include: ["src/**/*.ts"],
exclude: ["src/types/**/*.ts"],
},
},
});
Expand Down
15 changes: 15 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@
"dev": {
"cache": false,
"persistent": true
},
"@formbricks/react-native:build": {
"dependsOn": ["^build"],
"cache": false
},
"playground:build": {
"dependsOn": ["@formbricks/react-native:build"],
"outputs": ["apps/playground/out/**"],
"cache": false
},
"test": {
"outputs": []
},
"test:coverage": {
"outputs": []
}
}
}