Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: open source the premium modules #741

Merged
merged 6 commits into from
Jan 21, 2025
Merged
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
6 changes: 6 additions & 0 deletions .changeset/gorgeous-kiwis-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@react-native-documents/picker': major
'@react-native-documents/viewer': major
---

publish the new modules
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
root: true,
extends: ['@react-native', 'plugin:prettier/recommended', 'plugin:jest/recommended'],
rules: {
// flags jest.config.ts as a problem
'jest/no-jest-import': 'off',
},
ignorePatterns: ['**/lib/*', 'node_modules/*', '**/build/*'],
}
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.pbxproj -text
# specific for windows script files
*.bat text eol=crlf
*.bat text eol=crlf

# https://stackoverflow.com/a/51564689/2070942 to avoid git grep result
.yarn/**/*.* binary
49 changes: 49 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Android build

on:
push:
branches:
- main
paths:
- '.github/workflows/android.yml'
- 'packages/**/android**'
pull_request:
paths:
- '.github/workflows/android.yml'
- 'packages/**/android/**'

jobs:
android-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js lts
uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Install dependencies
run: yarn install
- name: Build android example app on old architecture
run: ./gradlew app:assembleDebug -PnewArchEnabled=false
working-directory: packages/example/android
android-build-new-arch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js lts
uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Install dependencies
run: yarn install
- name: Build android example app on new architecture
run: ./gradlew app:assembleDebug -PnewArchEnabled=true
working-directory: packages/example/android
53 changes: 53 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy to GitHub Pages

on:
pull_request:
branches: [main]
push:
branches: [main]

permissions:
contents: write

defaults:
run:
working-directory: ./docs

jobs:
test-docusaurus-build:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: yarn
- name: Install dependencies and build website
run: |
yarn install
yarn build
deploy:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: yarn
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
- name: Deploy to GitHub Pages
env:
USE_SSH: true
run: |
git config --global user.email "[email protected]"
git config --global user.name "Vojtech Novak"
yarn install
yarn deploy
57 changes: 57 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: iOS build

on:
push:
branches:
- main
paths:
- '.github/workflows/ios.yml'
- 'packages/**/ios**'
pull_request:
paths:
- '.github/workflows/ios.yml'
- 'packages/**/ios**'

jobs:
ios-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js lts
uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
working-directory: packages/example/ios
bundler-cache: true
- name: Install dependencies
run: yarn install
- name: Install pods
run: RCT_NEW_ARCH_ENABLED=0 npx pod-install
working-directory: packages/example/ios
- name: Build ios example app on old architecture
run: xcodebuild -scheme ReactTestApp -workspace document-picker-example.xcworkspace ONLY_ACTIVE_ARCH=NO -sdk iphonesimulator -configuration Debug
working-directory: packages/example/ios
ios-build-new-arch:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js lts
uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
working-directory: packages/example/ios
bundler-cache: true
- name: Install dependencies
run: yarn install
- name: Install pods for new arch
run: RCT_NEW_ARCH_ENABLED=1 npx pod-install
working-directory: packages/example/ios
- name: Build ios example app on new architecture
run: xcodebuild -scheme ReactTestApp -workspace document-picker-example.xcworkspace ONLY_ACTIVE_ARCH=NO -sdk iphonesimulator -configuration Debug
working-directory: packages/example/ios
61 changes: 25 additions & 36 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,41 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js CI
name: test and publish

on:
push:
branches: [master]
branches: [master, main]
pull_request:
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: yarn install
- run: yarn typescript
- run: yarn prettier:check
- run: yarn lint
- run: yarn test
- run: yarn build

strategy:
matrix:
node-version: [18.x]

publish-npm:
needs: build
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile
- run: yarn lint && yarn typescript
publish: yarn run release-packages
env:
CI: true
# release:
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: git config
# run: |
# git config user.name "${GITHUB_ACTOR}"
# git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
# - run: |
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
# npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# - run: yarn install --frozen-lockfile
# - run: yarn prepare && yarn release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_NEW }}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ android/keystores/debug.keystore
# generated by bob
lib/

# https://github.com/yarnpkg/berry/issues/454#issuecomment-530312089
.yarn/*
!.yarn/releases
!.yarn/plugins

# gh-md-toc
docs/gh-md-toc
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Ignore artifacts:
**/build
**/dist
**/coverage
**/.next
**/.vscode
**/.expo
**/ios
**/android
docs/.docusaurus

# these are auto-generated
docs/docs/doc-picker-api/index.md
docs/docs/doc-viewer-api/index.md
Loading
Loading