Skip to content

Commit 0c5e4d1

Browse files
authored
feat: open source the premium modules (#741)
* feat: open source the premium modules * docs: update docs * chore: update ci files * chore: add changeset * chore: fix licenses * chore: fix publishConfig
1 parent 649fa35 commit 0c5e4d1

File tree

220 files changed

+46050
-14432
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+46050
-14432
lines changed

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/gorgeous-kiwis-obey.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@react-native-documents/picker': major
3+
'@react-native-documents/viewer': major
4+
---
5+
6+
publish the new modules

.eslintrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@react-native', 'plugin:prettier/recommended', 'plugin:jest/recommended'],
4+
rules: {
5+
// flags jest.config.ts as a problem
6+
'jest/no-jest-import': 'off',
7+
},
8+
ignorePatterns: ['**/lib/*', 'node_modules/*', '**/build/*'],
9+
}

.gitattributes

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
*.pbxproj -text
22
# specific for windows script files
3-
*.bat text eol=crlf
3+
*.bat text eol=crlf
4+
5+
# https://stackoverflow.com/a/51564689/2070942 to avoid git grep result
6+
.yarn/**/*.* binary

.github/workflows/android.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Android build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/workflows/android.yml'
9+
- 'packages/**/android**'
10+
pull_request:
11+
paths:
12+
- '.github/workflows/android.yml'
13+
- 'packages/**/android/**'
14+
15+
jobs:
16+
android-build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Use Node.js lts
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: lts/*
24+
- uses: actions/setup-java@v4
25+
with:
26+
distribution: 'temurin'
27+
java-version: '17'
28+
- name: Install dependencies
29+
run: yarn install
30+
- name: Build android example app on old architecture
31+
run: ./gradlew app:assembleDebug -PnewArchEnabled=false
32+
working-directory: packages/example/android
33+
android-build-new-arch:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v3
37+
- name: Use Node.js lts
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: lts/*
41+
- uses: actions/setup-java@v4
42+
with:
43+
distribution: 'temurin'
44+
java-version: '17'
45+
- name: Install dependencies
46+
run: yarn install
47+
- name: Build android example app on new architecture
48+
run: ./gradlew app:assembleDebug -PnewArchEnabled=true
49+
working-directory: packages/example/android

.github/workflows/deploy-docs.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
permissions:
10+
contents: write
11+
12+
defaults:
13+
run:
14+
working-directory: ./docs
15+
16+
jobs:
17+
test-docusaurus-build:
18+
if: github.event_name != 'push'
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: lts/*
27+
cache: yarn
28+
- name: Install dependencies and build website
29+
run: |
30+
yarn install
31+
yarn build
32+
deploy:
33+
if: github.event_name != 'pull_request'
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: lts/*
42+
cache: yarn
43+
- uses: webfactory/[email protected]
44+
with:
45+
ssh-private-key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
46+
- name: Deploy to GitHub Pages
47+
env:
48+
USE_SSH: true
49+
run: |
50+
git config --global user.email "[email protected]"
51+
git config --global user.name "Vojtech Novak"
52+
yarn install
53+
yarn deploy

.github/workflows/ios.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: iOS build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/workflows/ios.yml'
9+
- 'packages/**/ios**'
10+
pull_request:
11+
paths:
12+
- '.github/workflows/ios.yml'
13+
- 'packages/**/ios**'
14+
15+
jobs:
16+
ios-build:
17+
runs-on: macos-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Use Node.js lts
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: lts/*
24+
- uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: 2.7
27+
working-directory: packages/example/ios
28+
bundler-cache: true
29+
- name: Install dependencies
30+
run: yarn install
31+
- name: Install pods
32+
run: RCT_NEW_ARCH_ENABLED=0 npx pod-install
33+
working-directory: packages/example/ios
34+
- name: Build ios example app on old architecture
35+
run: xcodebuild -scheme ReactTestApp -workspace document-picker-example.xcworkspace ONLY_ACTIVE_ARCH=NO -sdk iphonesimulator -configuration Debug
36+
working-directory: packages/example/ios
37+
ios-build-new-arch:
38+
runs-on: macos-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Use Node.js lts
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: lts/*
45+
- uses: ruby/setup-ruby@v1
46+
with:
47+
ruby-version: 2.7
48+
working-directory: packages/example/ios
49+
bundler-cache: true
50+
- name: Install dependencies
51+
run: yarn install
52+
- name: Install pods for new arch
53+
run: RCT_NEW_ARCH_ENABLED=1 npx pod-install
54+
working-directory: packages/example/ios
55+
- name: Build ios example app on new architecture
56+
run: xcodebuild -scheme ReactTestApp -workspace document-picker-example.xcworkspace ONLY_ACTIVE_ARCH=NO -sdk iphonesimulator -configuration Debug
57+
working-directory: packages/example/ios

.github/workflows/nodejs.yml

+25-36
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,41 @@
1-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
33

4-
name: Node.js CI
4+
name: test and publish
55

66
on:
77
push:
8-
branches: [master]
8+
branches: [master, main]
99
pull_request:
10-
branches: [master]
1110

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

1514
jobs:
1615
build:
1716
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: lts/*
22+
- run: yarn install
23+
- run: yarn typescript
24+
- run: yarn prettier:check
25+
- run: yarn lint
26+
- run: yarn test
27+
- run: yarn build
1828

19-
strategy:
20-
matrix:
21-
node-version: [18.x]
22-
29+
publish-npm:
30+
needs: build
31+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
32+
runs-on: ubuntu-latest
2333
steps:
24-
- uses: actions/checkout@v2
25-
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v1
34+
- name: Create Release Pull Request or Publish
35+
id: changesets
36+
uses: changesets/action@v1
2737
with:
28-
node-version: ${{ matrix.node-version }}
29-
- run: yarn install --frozen-lockfile
30-
- run: yarn lint && yarn typescript
38+
publish: yarn run release-packages
3139
env:
32-
CI: true
33-
# release:
34-
# runs-on: ubuntu-latest
35-
# if: github.ref == 'refs/heads/master'
36-
# steps:
37-
# - uses: actions/checkout@v2
38-
# with:
39-
# fetch-depth: 0
40-
# - name: git config
41-
# run: |
42-
# git config user.name "${GITHUB_ACTOR}"
43-
# git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
44-
# - run: |
45-
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
46-
# npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
47-
# env:
48-
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
49-
# - run: yarn install --frozen-lockfile
50-
# - run: yarn prepare && yarn release
51-
# env:
52-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN_NEW }}

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ android/keystores/debug.keystore
5959
# generated by bob
6060
lib/
6161

62+
# https://github.com/yarnpkg/berry/issues/454#issuecomment-530312089
63+
.yarn/*
64+
!.yarn/releases
65+
!.yarn/plugins
6266

63-
# gh-md-toc
64-
docs/gh-md-toc

.prettierignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Ignore artifacts:
2+
**/build
3+
**/dist
4+
**/coverage
5+
**/.next
6+
**/.vscode
7+
**/.expo
8+
**/ios
9+
**/android
10+
docs/.docusaurus
11+
12+
# these are auto-generated
13+
docs/docs/doc-picker-api/index.md
14+
docs/docs/doc-viewer-api/index.md

0 commit comments

Comments
 (0)