Skip to content

Commit

Permalink
Doc upgrades (#175)
Browse files Browse the repository at this point in the history
* upgrade to docusaurus to 3.1.1, ts to 5.2.2, and react to 18.0.0. plus required adjustments.

* upgrade docusaurus to 3.2.1

* fix features background in dark mode

* fix broken link

* Nuke lockfile

* Trigger CI

* Remove vercel specific configs

---------

Co-authored-by: Christy Presler <[email protected]>
Co-authored-by: Charlie Brown <[email protected]>
  • Loading branch information
3 people committed May 8, 2024
1 parent 1f14d46 commit eb595a4
Show file tree
Hide file tree
Showing 16 changed files with 8,512 additions and 9,548 deletions.
2 changes: 1 addition & 1 deletion docs/api/matchers.md → docs/api/matchers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 3

# Matchers

### toMatchBaseline(options: {threshold?: number} = {threshold: 0.1})
### toMatchBaseline(options: \{threshold?: number\} = \{threshold: 0.1\})

This custom Jest matcher will try to find and compare the baseline screenshot by using the path of the latest screenshot (returned by `takeScreenshot()`). You will have to take a screenshot before using, and pass the path of that screenshot to the expect method.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/methods.md → docs/api/methods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('App.tsx', () => {
});
```

### scrollTo(testID: string, position: {x?: number, y?: number})
### scrollTo(testID: string, position: \{x?: number, y?: number\})

Calls the `scrollTo` method of the element where its `testID` prop matches the methods `testID` argument.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Getting Started

### React Native Version Support
Expand Down Expand Up @@ -58,7 +61,7 @@ or

### Add tests

Use the [takeScreenshot](/docs/api/methods#takescreenshotname-string) and [.toMatchBaseline](/docs/api/matchers#tomatchbaselinename-string) apis to implement screenshot tests. File names must end in `.owl.ts`, `.owl.tsx`, `.owl.js` or `.owl.jsx`. [See the example app](https://github.com/FormidableLabs/react-native-owl/tree/main/example) for a more complete example.
Use the [takeScreenshot](/docs/api/methods#takescreenshotname-string) and [.toMatchBaseline](/docs/api/matchers) apis to implement screenshot tests. File names must end in `.owl.ts`, `.owl.tsx`, `.owl.js` or `.owl.jsx`. [See the example app](https://github.com/FormidableLabs/react-native-owl/tree/main/example) for a more complete example.

#### Example

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion website/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator.

### Installation

Expand Down
119 changes: 0 additions & 119 deletions website/docusaurus.config.js

This file was deleted.

120 changes: 120 additions & 0 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import { themes as prismThemes } from "prism-react-renderer" ;
import type { Config } from "@docusaurus/types";
import type * as Preset from "@docusaurus/preset-classic";

const config: Config = {
title: 'React Native Owl',
tagline: 'Visual Regression Testing for React Native',
url: 'https://commerce.nearform.com/',
baseUrl: '/open-source/react-native-owl/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'images/favicon.ico',
organizationName: 'Nearform Commerce',
projectName: 'react-native-owl',
i18n: {
defaultLocale: "en",
locales: ["en"],
},
presets: [
[
"classic",
{
docs: {
path: '../docs',
sidebarPath: './sidebars.js',
editUrl:
'https://github.com/FormidableLabs/react-native-owl/edit/main/website/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
...(process.env.VERCEL_ENV === 'production' && {
gtag: {
trackingID: process.env.GTAG_TRACKING_ID,
anonymizeIP: true,
},
googleTagManager: {
containerId: process.env.GTM_CONTAINER_ID,
},
}),
},
],
],

themeConfig: {
metadata: [
{
name: "viewport",
content: "width=device-width, initial-scale=1, maximum-scale=1",
image: '/images/social.png',
},
],
navbar: {
style: 'dark',
title: 'React Native Owl',
logo: {
alt: 'React Native Owl Logo',
src: 'images/logo-eyes.svg',
},
items: [
{
label: 'Documentation',
position: 'left',
items: [
{
label: 'Getting Started',
to: '/docs/introduction/getting-started/',
},
{
label: 'Config File',
to: '/docs/introduction/config-file/',
},
{
label: 'CLI',
to: '/docs/cli/building-the-app/',
},
{
label: 'Methods',
to: '/docs/api/methods/',
},
{
label: 'Matchers',
to: '/docs/api/matchers/',
},
],
},
{
href: 'https://github.com/FormidableLabs/react-native-owl',
className: 'header-github-link',
'aria-label': 'GitHub Repository',
position: 'right',
},
{
href: 'https://commerce.nearform.com/',
className: 'header-nearform-link',
'aria-label': 'Nearform Commerce Website',
position: 'right',
},
],
},
footer: {
style: 'dark',
logo: {
alt: "Nearform logo",
src: "images/nearform-logo-white.svg",
href: "https://commerce.nearform.com",
width: 100,
height: 100,
},
copyright: `Copyright © ${new Date().getFullYear()} Nearform`,
},
prism: {
defaultLanguage: 'javascript',
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,
};

export default config;
24 changes: 12 additions & 12 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build --out-dir build/open-source/react-native-owl",
"build:vercel": "docusaurus build",
"swizzle": "docusaurus swizzle",
"clear": "docusaurus clear",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.21",
"@docusaurus/preset-classic": "2.0.0-beta.21",
"@docusaurus/remark-plugin-npm2yarn": "^2.0.0-beta.21",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"prism-react-renderer": "^1.3.1",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@docusaurus/core": "^3.2.1",
"@docusaurus/preset-classic": "^3.2.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.2.1",
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.0.0-beta.21",
"@tsconfig/docusaurus": "^1.0.5",
"typescript": "^4.6.3"
"@docusaurus/module-type-aliases": "^3.2.1",
"@docusaurus/theme-classic": "^3.2.1",
"@docusaurus/tsconfig": "^3.2.1",
"@docusaurus/types": "^3.2.1",
"typescript": "~5.2.2"
},
"browserslist": {
"production": [
Expand Down
4 changes: 4 additions & 0 deletions website/src/components/HomepageFeatures/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@
max-width: 40rem;
width: 100%;
}

[data-theme="dark"] .feature {
background-color: var(--ifm-color-gray-800);
}
50 changes: 0 additions & 50 deletions website/src/theme/AnnouncementBar/index.tsx

This file was deleted.

Loading

0 comments on commit eb595a4

Please sign in to comment.