-
Notifications
You must be signed in to change notification settings - Fork 618
📖 Documentation #753
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
base: master
Are you sure you want to change the base?
📖 Documentation #753
Changes from all commits
9a9a516
f5a7532
f95fac5
04f7828
2ec5498
3e20009
304509c
592ae80
88f966f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,4 @@ assets/ | |
| .github/ | ||
| /.eslintrc.js | ||
| /metro.config.js | ||
| **/node_modules | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| module.exports = { | ||
| root: true, | ||
| parser: '@typescript-eslint/parser', | ||
| extends: '@react-native', | ||
| plugins: ['import'], | ||
| plugins: ['import', 'tsdoc', '@typescript-eslint'], | ||
| reportUnusedDisableDirectives: true, | ||
| rules: { | ||
| // disabled rules | ||
| 'prettier/prettier': 'off', | ||
|
|
@@ -24,7 +26,8 @@ module.exports = { | |
| 'no-debugger': 'error', | ||
| 'prefer-const': 'error', | ||
| 'no-multiple-empty-lines': 'error', | ||
| 'no-unused-vars': 'error', | ||
| 'no-unused-vars': 'off', | ||
| '@typescript-eslint/no-unused-vars': ['error', { 'vars': 'all', 'args': 'after-used', 'ignoreRestSiblings': true }], | ||
| 'no-trailing-spaces': 'error', | ||
| 'brace-style': ['error', '1tbs', { allowSingleLine: true }], | ||
| 'react/jsx-boolean-value': 'error', | ||
|
|
@@ -34,6 +37,7 @@ module.exports = { | |
| 'error', | ||
| { | ||
| code: 120, | ||
| ignoreComments: true, // allow longer TSDoc/comment lines | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ignoreTemplateLiterals: true, | ||
| // FIXME: doesn't work :/ | ||
| ignorePattern: '^log\\(', // ignore "log('...')" | ||
|
|
@@ -45,6 +49,10 @@ module.exports = { | |
| 'import/namespace': 'error', | ||
| 'import/default': 'error', | ||
| 'import/export': 'error', | ||
| // typescript-eslint v8 removed extension rules. Map to base rules to preserve behavior | ||
| '@typescript-eslint/func-call-spacing': 'off', | ||
| 'func-call-spacing': ['error', 'never'], | ||
| // TSDoc is enforced via an override on TS/TSX files only (see overrides) | ||
| }, | ||
| settings: { | ||
| 'import/ignore': ['node_modules/react-native/index\\.js$'], // https://github.com/facebook/react-native/issues/28549 | ||
|
|
@@ -58,4 +66,48 @@ module.exports = { | |
| WebSocket: true, | ||
| URLSearchParams: true, | ||
| }, | ||
| // Targeted relief for specs: avoid import plugin traversing RN internals | ||
| overrides: [ | ||
| // Enforce TSDoc only for TypeScript sources in src/ | ||
| { | ||
| files: ['src/**/*.{ts,tsx}'], | ||
| rules: { | ||
| 'tsdoc/syntax': 'error', | ||
| }, | ||
| }, | ||
| { | ||
| files: ['src/specs/**/*.ts'], | ||
| rules: { | ||
| // Turn off import rules that resolve into RN internals and crash parsers | ||
| 'import/named': 'off', | ||
| 'import/no-unresolved': 'off', | ||
| }, | ||
| settings: { | ||
| // Treat RN internals as core so import plugin won't try to resolve/parse them | ||
| 'import/core-modules': [ | ||
| 'react-native/Libraries/Types/CodegenTypes', | ||
| 'react-native/Libraries/Utilities/codegenNativeComponent', | ||
| ], | ||
| }, | ||
| }, | ||
| // Node scripts: allow console and relax max-len for long regex/HTML strings | ||
| { | ||
| files: ['scripts/**/*.mjs'], | ||
| rules: { | ||
| 'no-console': 'off', | ||
| 'no-useless-escape': 'off', | ||
| quotes: 'off', | ||
| '@typescript-eslint/no-unused-vars': 'off', | ||
| 'max-len': [ | ||
| 'error', | ||
| { | ||
| code: 200, | ||
| ignoreStrings: true, | ||
| ignoreTemplateLiterals: true, | ||
| ignoreUrls: true, | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| ], | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| name: Docs (TypeDoc → GitHub Pages) | ||
|
|
||
| # References (official docs): | ||
| # - Pages deployment action: https://github.com/actions/deploy-pages | ||
| # - Upload Pages artifact: https://github.com/actions/upload-pages-artifact | ||
| # - Configure Pages: https://github.com/actions/configure-pages | ||
| # - Setup Node: https://github.com/actions/setup-node | ||
| # - Checkout: https://github.com/actions/checkout | ||
| # - TypeDoc options: https://typedoc.org/options/ | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| branches: [master] | ||
| workflow_dispatch: | ||
|
|
||
| # Required for Pages | ||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build TypeDoc site | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| # https://github.com/actions/checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup Node.js (LTS 22) | ||
| # https://github.com/actions/setup-node | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: '22' | ||
| cache: yarn | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn install --frozen-lockfile | ||
|
|
||
| - name: Configure GitHub Pages | ||
| # Provides the GitHub Pages URL and sets up permissions | ||
| # https://github.com/actions/configure-pages | ||
| uses: actions/configure-pages@v5 | ||
|
|
||
| - name: Build documentation (TypeDoc) | ||
| # typedoc.json sets: out=docs/site, githubPages=true (.nojekyll), customCss | ||
| run: | | ||
| yarn docs:clean | ||
| yarn docs:build | ||
|
|
||
| - name: Upload artifact | ||
| # Upload the static site for Pages to deploy | ||
| # https://github.com/actions/upload-pages-artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: docs/site | ||
|
|
||
| deploy-production: | ||
| name: Deploy (Production) | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| # Runs on push to master and manual dispatch. Manual runs should target the | ||
| # master branch via the UI (Run workflow → Branch: master). | ||
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | ||
| steps: | ||
| - name: Require master branch for manual runs | ||
| run: | | ||
| if [ "${GITHUB_REF_NAME}" != "master" ]; then | ||
| echo "Manual runs must target 'master'. Selected: ${GITHUB_REF_NAME}"; | ||
| exit 1; | ||
| fi | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
|
|
||
| deploy-preview: | ||
| name: Deploy (PR Preview) | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| # Skip preview deploys for forked PRs and Dependabot to avoid failures | ||
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' | ||
| steps: | ||
| - name: Deploy preview to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
| with: | ||
| preview: true | ||
|
|
||
| # Usage: | ||
| # 1. In GitHub → Settings → Pages, set "Source" to "GitHub Actions". | ||
| # 2. Push to master → builds and deploys to the production Pages site. | ||
| # 3. Open a PR targeting master → builds and deploys an ephemeral PR Preview URL. | ||
| # The preview URL is exposed as the environment URL of the "Deploy (PR Preview)" job | ||
| # and in the PR checks. It is automatically cleaned up when the PR closes. | ||
| # 4. Manual run: Actions → this workflow → Run workflow. Choose Branch: master. | ||
| # This performs a production deploy using the content of master. | ||
| # 5. The docs are NOT committed to the repo. They are built in CI and published | ||
| # from the uploaded Pages artifact. GitHub Pages hosts the result; no gh-pages branch | ||
| # is required when using the official Pages actions. | ||
| # 6. Customize TypeDoc via typedoc.json (`out`, `customCss`, validation filters, etc.). | ||
| # 7. Local preview: `yarn docs:build && yarn docs:serve` → http://localhost:8080 | ||
| # | ||
| # Notes: | ||
| # - The Pages environment requires the `pages:write` and `id-token:write` permissions. | ||
| # - `githubPages: true` in typedoc.json ensures `.nojekyll` is emitted for correct asset serving. | ||
| # - For monorepos or matrix builds, you can upload multiple artifacts and deploy from a single job. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ run-name: 🩺 Code checks on ${{ github.event_name == 'pull_request' && 'PR' || | |
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - master | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
|
|
@@ -14,15 +14,14 @@ jobs: | |
| runs-on: ubuntu-latest # using linux runner for speed | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| - name: Install modules | ||
| run: yarn | ||
| - name: Install Bundler | ||
| run: sudo gem install bundler | ||
| - name: Install gems | ||
| run: cd example && sudo bundle install | ||
| - name: Install example | ||
| run: yarn bootstrap-linux | ||
|
Comment on lines
-17
to
-25
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| uses: actions/checkout@v5 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: '22' | ||
| cache: yarn | ||
| - name: Install dependencies | ||
| run: yarn install --frozen-lockfile | ||
| - name: Lint | ||
| run: yarn lint | ||
|
|
||
|
|
@@ -32,7 +31,7 @@ jobs: | |
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Install dependencies | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| <h1 align="center"> | ||
| 🎈 React Native Camera Kit | ||
| </h1> | ||
| [](https://github.com/teslamotors/react-native-camera-kit) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Find a way to add an alt "React Native Camera Kit" |
||
|
|
||
|
|
||
| <p align="center"> | ||
| A <strong>high performance, easy to use, rock solid</strong><br> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.