Skip to content

Commit 88c2049

Browse files
committed
ci: add formatting job
1 parent 14489a7 commit 88c2049

File tree

11 files changed

+110
-79
lines changed

11 files changed

+110
-79
lines changed

.config/tsconfig.base.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"exclude": [
3-
"../node_modules"
4-
],
2+
"exclude": ["../node_modules"],
53
"compilerOptions": {
64
"noFallthroughCasesInSwitch": true,
75
"noImplicitOverride": true,

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ body:
2121
attributes:
2222
label: Version
2323
description: What version of `@react-native-async-storage/async-storage` are you using?
24-
placeholder: 'Example: 1.15.9'
24+
placeholder: "Example: 1.15.9"
2525
validations:
2626
required: true
2727
- type: checkboxes
2828
id: platforms
2929
attributes:
3030
label: What platforms are you seeing this issue on?
31-
description: 'Select all that apply:'
31+
description: "Select all that apply:"
3232
options:
3333
- label: Android
3434
- label: iOS

.github/workflows/ci.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ on:
55
- main
66
pull_request:
77
jobs:
8+
format:
9+
name: Format
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v3.6.0
16+
with:
17+
node-version: 18.16.1
18+
cache: yarn
19+
- name: Install JS dependencies
20+
run: yarn
21+
- name: Format
22+
run: |
23+
yarn format
24+
git diff --exit-code
825
review:
926
name: Review
1027
runs-on: ubuntu-latest
@@ -170,7 +187,7 @@ jobs:
170187
env:
171188
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
172189
GIT_AUTHOR_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
173-
GIT_AUTHOR_NAME : ${{ secrets.GH_BOT_NAME }}
190+
GIT_AUTHOR_NAME: ${{ secrets.GH_BOT_NAME }}
174191
GIT_COMMITTER_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
175192
GIT_COMMITTER_NAME: ${{ secrets.GH_BOT_NAME }}
176193
NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}

.github/workflows/stale.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Mark stale issues and pull requests
22
on:
33
schedule:
4-
- cron: '30 1 * * *'
4+
- cron: "30 1 * * *"
55
jobs:
66
stale:
77
runs-on: ubuntu-latest
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/stale@v7
1313
with:
1414
repo-token: ${{ secrets.GITHUB_TOKEN }}
15-
stale-issue-message: 'This issue has been marked as stale due to inactivity. Please respond or otherwise resolve the issue within 7 days or it will be closed.'
16-
stale-pr-message: 'This PR has been marked as stale due to inactivity. Please address any comments within 7 days or it will be closed.'
17-
exempt-issue-labels: 'help wanted :octocat:'
18-
exempt-pr-labels: 'WIP'
15+
stale-issue-message: "This issue has been marked as stale due to inactivity. Please respond or otherwise resolve the issue within 7 days or it will be closed."
16+
stale-pr-message: "This PR has been marked as stale due to inactivity. Please address any comments within 7 days or it will be closed."
17+
exempt-issue-labels: "help wanted :octocat:"
18+
exempt-pr-labels: "WIP"

.github/workflows/website-deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
branches:
55
- main
66
paths:
7-
- 'packages/website/**'
7+
- "packages/website/**"
88

99
jobs:
1010
deploy:

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"packages/*"
66
],
77
"packageManager": "yarn@3.4.1",
8+
"scripts": {
9+
"format": "prettier --write $(git ls-files '*.js' '*.json' '*.ts' '*.tsx' '*.yml' 'README.md')"
10+
},
811
"devDependencies": {
912
"@rnx-kit/eslint-plugin": "^0.5.0",
1013
"eslint": "^8.54.0",

packages/api/jest.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
3-
preset: 'ts-jest',
4-
testEnvironment: 'node',
3+
preset: "ts-jest",
4+
testEnvironment: "node",
55
};

packages/website/docusaurus.config.js

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
11
module.exports = {
2-
title: 'Async Storage',
3-
tagline: 'Data storage system for React Native.',
4-
url: 'https://react-native-async-storage.github.io',
5-
baseUrl: '/async-storage/',
6-
favicon: 'img/favicon.ico',
7-
organizationName: 'react-native-async-storage',
8-
projectName: 'async-storage',
2+
title: "Async Storage",
3+
tagline: "Data storage system for React Native.",
4+
url: "https://react-native-async-storage.github.io",
5+
baseUrl: "/async-storage/",
6+
favicon: "img/favicon.ico",
7+
organizationName: "react-native-async-storage",
8+
projectName: "async-storage",
99
themeConfig: {
1010
prism: {
11-
theme: require('prism-react-renderer/themes/vsDark'),
12-
darkTheme: require('prism-react-renderer/themes/vsDark'),
13-
lightTheme: require('prism-react-renderer/themes/vsLight'),
11+
theme: require("prism-react-renderer/themes/vsDark"),
12+
darkTheme: require("prism-react-renderer/themes/vsDark"),
13+
lightTheme: require("prism-react-renderer/themes/vsLight"),
1414
},
1515
navbar: {
16-
title: 'Async Storage',
16+
title: "Async Storage",
1717
logo: {
18-
alt: 'Async Storage Logo',
19-
src: 'img/logo.svg',
18+
alt: "Async Storage Logo",
19+
src: "img/logo.svg",
2020
},
2121
items: [
2222
{
23-
label: 'Docs',
24-
to: 'docs/install',
25-
activeBasePath: '/docs',
26-
position: 'right',
23+
label: "Docs",
24+
to: "docs/install",
25+
activeBasePath: "/docs",
26+
position: "right",
2727
},
2828
{
29-
href: 'https://github.com/react-native-async-storage/async-storage',
30-
label: 'GitHub',
31-
position: 'right',
29+
href: "https://github.com/react-native-async-storage/async-storage",
30+
label: "GitHub",
31+
position: "right",
3232
},
3333
],
3434
},
3535
footer: {
36-
style: 'dark',
36+
style: "dark",
3737
links: [
3838
{
39-
title: 'Documentation',
39+
title: "Documentation",
4040
items: [
4141
{
42-
label: 'Installation',
43-
to: 'docs/install',
42+
label: "Installation",
43+
to: "docs/install",
4444
},
4545
{
46-
label: 'API reference',
47-
to: 'docs/api',
46+
label: "API reference",
47+
to: "docs/api",
4848
},
4949
],
5050
},
5151
{
52-
title: 'Community',
52+
title: "Community",
5353
items: [
5454
{
55-
label: 'Discord',
56-
href: 'https://discord.gg/PycDts2',
55+
label: "Discord",
56+
href: "https://discord.gg/PycDts2",
5757
},
5858
],
5959
},
6060
{
61-
title: 'More',
61+
title: "More",
6262
items: [
6363
{
64-
label: 'GitHub',
65-
href: 'https://github.com/react-native-async-storage/async-storage',
64+
label: "GitHub",
65+
href: "https://github.com/react-native-async-storage/async-storage",
6666
},
6767
],
6868
},
@@ -72,15 +72,15 @@ module.exports = {
7272
},
7373
presets: [
7474
[
75-
'@docusaurus/preset-classic',
75+
"@docusaurus/preset-classic",
7676
{
7777
docs: {
78-
sidebarPath: require.resolve('./sidebars.js'),
78+
sidebarPath: require.resolve("./sidebars.js"),
7979
editUrl:
80-
'https://github.com/react-native-async-storage/async-storage/edit/main/website/',
80+
"https://github.com/react-native-async-storage/async-storage/edit/main/website/",
8181
},
8282
theme: {
83-
customCss: require.resolve('./src/css/custom.css'),
83+
customCss: require.resolve("./src/css/custom.css"),
8484
},
8585
},
8686
],

packages/website/sidebars.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
module.exports = {
22
docs: {
3-
'Getting started': ['install', 'usage', 'api', 'limits'],
4-
Advanced: ['advanced/next', 'advanced/jest', 'advanced/brownfield', 'advanced/backup', 'advanced/executor', 'advanced/db_size','advanced/where_data_stored'],
5-
Debugging: ['debugging/communityPackages'],
6-
Help: ['help/troubleshooting'],
3+
"Getting started": ["install", "usage", "api", "limits"],
4+
Advanced: [
5+
"advanced/next",
6+
"advanced/jest",
7+
"advanced/brownfield",
8+
"advanced/backup",
9+
"advanced/executor",
10+
"advanced/db_size",
11+
"advanced/where_data_stored",
12+
],
13+
Debugging: ["debugging/communityPackages"],
14+
Help: ["help/troubleshooting"],
715
},
816
};

packages/website/src/components/Platform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const PlatformSupport = ({ platformIcon, title }) => (
66
display: "flex",
77
margin: "10px 20px",
88
alignItems: "center",
9-
flexDirection: "row"
9+
flexDirection: "row",
1010
}}
1111
>
1212
<img

packages/website/src/pages/index.js

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,49 @@
1-
import React from 'react';
2-
import classnames from 'classnames';
3-
import Layout from '@theme/Layout';
4-
import Link from '@docusaurus/Link';
5-
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
6-
import useBaseUrl from '@docusaurus/useBaseUrl';
7-
import styles from './styles.module.css';
1+
import React from "react";
2+
import classnames from "classnames";
3+
import Layout from "@theme/Layout";
4+
import Link from "@docusaurus/Link";
5+
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
6+
import useBaseUrl from "@docusaurus/useBaseUrl";
7+
import styles from "./styles.module.css";
88

99
const features = [
1010
{
11-
title: 'Persistent storage',
12-
imageUrl: 'img/hero_db.svg',
11+
title: "Persistent storage",
12+
imageUrl: "img/hero_db.svg",
1313
description: (
1414
<>
15-
Async Storage is asynchronous, unencrypted, persistent, key-value storage solution for your React Native application.
15+
Async Storage is asynchronous, unencrypted, persistent, key-value
16+
storage solution for your React Native application.
1617
</>
1718
),
1819
},
1920
{
20-
title: 'Multi-platform support',
21-
imageUrl: 'img/hero_box.svg',
21+
title: "Multi-platform support",
22+
imageUrl: "img/hero_box.svg",
2223
description: (
2324
<>
24-
Data storage solution for <strong>Android</strong>, <strong>iOS</strong>, <strong>Web</strong>, <strong>MacOS</strong> and <strong>Windows</strong>.
25+
Data storage solution for <strong>Android</strong>, <strong>iOS</strong>
26+
, <strong>Web</strong>, <strong>MacOS</strong> and{" "}
27+
<strong>Windows</strong>.
2528
</>
2629
),
2730
},
2831
{
29-
title: 'Simple API',
30-
imageUrl: 'img/hero_tools.svg',
32+
title: "Simple API",
33+
imageUrl: "img/hero_tools.svg",
3134
description: (
3235
<>
33-
A handful of tools to simplify your storage flow. Easily save, read, merge and delete data at will!
36+
A handful of tools to simplify your storage flow. Easily save, read,
37+
merge and delete data at will!
3438
</>
3539
),
3640
},
3741
];
3842

39-
function Feature({imageUrl, title, description}) {
43+
function Feature({ imageUrl, title, description }) {
4044
const imgUrl = useBaseUrl(imageUrl);
4145
return (
42-
<div className={classnames('col col--4', styles.feature)}>
46+
<div className={classnames("col col--4", styles.feature)}>
4347
{imgUrl && (
4448
<div className="text--center">
4549
<div className={styles.featureImageContainer}>
@@ -53,24 +57,25 @@ function Feature({imageUrl, title, description}) {
5357
);
5458
}
5559

56-
5760
function Home() {
5861
const context = useDocusaurusContext();
59-
const {siteConfig = {}} = context;
62+
const { siteConfig = {} } = context;
6063
return (
6164
<Layout
6265
title={`${siteConfig.title}`}
63-
description="Homepage for React Native Async Storage project">
64-
<header className={classnames('hero', styles.heroBanner)}>
66+
description="Homepage for React Native Async Storage project"
67+
>
68+
<header className={classnames("hero", styles.heroBanner)}>
6569
<div className="container">
6670
<h1 className="hero__title">{siteConfig.title}</h1>
6771
<p className="hero__subtitle">{siteConfig.tagline}</p>
6872
<div className={styles.buttons}>
6973
<Link
7074
className={classnames(
71-
'button button--outline button--secondary button--lg'
75+
"button button--outline button--secondary button--lg"
7276
)}
73-
to={useBaseUrl('docs/install')}>
77+
to={useBaseUrl("docs/install")}
78+
>
7479
Get Started
7580
</Link>
7681
</div>

0 commit comments

Comments
 (0)