Skip to content

Commit c047968

Browse files
committed
chore: use eslint, yarn, update typedoc
1 parent 3b33087 commit c047968

27 files changed

+9408
-9422
lines changed

.github/actions/setup/action.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Node.js
8+
uses: actions/setup-node@v4
9+
with:
10+
node-version-file: .node-version
11+
12+
- run: corepack enable
13+
shell: bash
14+
15+
- name: Restore dependencies
16+
id: yarn-cache
17+
uses: actions/cache/restore@v4
18+
with:
19+
path: |
20+
**/node_modules
21+
.yarn/install-state.gz
22+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
23+
restore-keys: |
24+
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
25+
${{ runner.os }}-yarn-
26+
27+
- name: Install dependencies
28+
if: steps.yarn-cache.outputs.cache-hit != 'true'
29+
run: yarn install --immutable
30+
shell: bash
31+
32+
- name: Run postinstall
33+
if: steps.yarn-cache.outputs.cache-hit == 'true'
34+
run: yarn postinstall
35+
shell: bash
36+
37+
- name: Cache dependencies
38+
if: steps.yarn-cache.outputs.cache-hit != 'true'
39+
uses: actions/cache/save@v4
40+
with:
41+
path: |
42+
**/node_modules
43+
.yarn/install-state.gz
44+
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}

.github/workflows/tests.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- 'v[0-9]+'
9+
- 'v[0-9]+.[0-9]+'
10+
pull_request:
11+
branches:
12+
- main
13+
- 'v[0-9]+'
14+
- 'v[0-9]+.[0-9]+'
15+
merge_group:
16+
types:
17+
- checks_requested
18+
19+
jobs:
20+
lint:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup
27+
uses: ./.github/actions/setup
28+
29+
- run: yarn test:lint
30+
31+
types:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Setup
38+
uses: ./.github/actions/setup
39+
40+
- run: yarn test:types
41+
42+
build-library:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
48+
- name: Setup
49+
uses: ./.github/actions/setup
50+
51+
- name: Build package
52+
run: yarn prepare

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ Examples/testapp_rn
196196
# Android debug build files (conflict ignoring #Visual Studio files)
197197
!android/app/src/debug/
198198

199+
# Yarn
200+
.yarn/*
201+
!.yarn/patches
202+
!.yarn/plugins
203+
!.yarn/releases
204+
!.yarn/sdks
205+
!.yarn/versions
206+
199207
# generated by bob
200208
lib/
201209

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

.npmignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,18 @@ packages/
103103

104104
.watchmanconfig
105105

106-
tslint.json
107106
.prettierrc.json
107+
.node-version
108+
109+
docs
110+
111+
.yarn
112+
.yarnrc.yml
113+
yarn.lock
114+
115+
typedoc.json
116+
babel.config.js
117+
eslint.config.mjs
108118

109119
CONTRIBUTING.md
110120

.yarnrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nodeLinker: node-modules
2+
nmHoistingLimits: workspaces

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['module:react-native-builder-bob/babel-preset'],
3+
};

docs/api-js/functions/allowRestart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
# Function: allowRestart()
88

9-
> **allowRestart**(): `void`
9+
> **allowRestart**(): `Promise`\<`void`\>
1010
1111
Allow CodePush to restart the app.
1212

1313
This is an advanced API and is only necessary if your app explicitly disallowed restarts via the `disallowRestart` method.
1414

1515
## Returns
1616

17-
`void`
17+
`Promise`\<`void`\>

docs/api-js/functions/disallowRestart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
# Function: disallowRestart()
88

9-
> **disallowRestart**(): `void`
9+
> **disallowRestart**(): `Promise`\<`void`\>
1010
1111
Forbid CodePush to restart the app.
1212

1313
This is an advanced API, and is useful when a component within your app (for example an onboarding process) needs to ensure that no end-user interruptions can occur during its lifetime.
1414

1515
## Returns
1616

17-
`void`
17+
`Promise`\<`void`\>

docs/api-js/functions/withCodePush.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ Internally, the higher-order component calls `sync` inside its `componentDidMoun
1616

1717
### Type Parameters
1818

19-
**P** _extends_ `object`
19+
#### P
20+
21+
`P` _extends_ `object`
2022

2123
### Parameters
2224

@@ -40,7 +42,9 @@ Internally, the higher-order component calls `sync` inside its `componentDidMoun
4042

4143
### Type Parameters
4244

43-
**P** _extends_ `object`
45+
#### P
46+
47+
`P` _extends_ `object`
4448

4549
### Parameters
4650

docs/api-js/type-aliases/DownloadProgressCallback.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Type Alias: DownloadProgressCallback()
88

9-
> **DownloadProgressCallback**: (`progress`) => `void`
9+
> **DownloadProgressCallback** = (`progress`) => `void`
1010
1111
Called periodically when an available update is being downloaded from the CodePush server.
1212

docs/api-js/type-aliases/HandleBinaryVersionMismatchCallback.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Type Alias: HandleBinaryVersionMismatchCallback()
88

9-
> **HandleBinaryVersionMismatchCallback**: (`update`) => `void`
9+
> **HandleBinaryVersionMismatchCallback** = (`update`) => `void`
1010
1111
Called when there are any binary update available.
1212

docs/api-js/type-aliases/LoggerFunction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Type Alias: LoggerFunction()
88

9-
> **LoggerFunction**: (`level`, `message`) => `void`
9+
> **LoggerFunction** = (`level`, `message`) => `void`
1010
1111
## Parameters
1212

docs/api-js/type-aliases/SyncStatusChangedCallback.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Type Alias: SyncStatusChangedCallback()
88

9-
> **SyncStatusChangedCallback**: (`status`) => `void`
9+
> **SyncStatusChangedCallback** = (`status`) => `void`
1010
1111
Called when the sync process moves from one stage to another in the overall update process.
1212

eslint.config.mjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { fixupConfigRules } from '@eslint/compat';
2+
import { FlatCompat } from '@eslint/eslintrc';
3+
import js from '@eslint/js';
4+
import prettier from 'eslint-plugin-prettier';
5+
import { defineConfig } from 'eslint/config';
6+
import path from 'node:path';
7+
import { fileURLToPath } from 'node:url';
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
allConfig: js.configs.all,
15+
});
16+
17+
export default defineConfig([
18+
{
19+
extends: fixupConfigRules(compat.extends('@react-native', 'prettier')),
20+
plugins: { prettier },
21+
rules: {
22+
'react/react-in-jsx-scope': 'off',
23+
'prettier/prettier': 'error',
24+
},
25+
},
26+
{
27+
ignores: ['node_modules/', 'lib/', 'test', 'Examples', 'code-push-plugin-testing-framework'],
28+
},
29+
]);

0 commit comments

Comments
 (0)