Skip to content

Commit

Permalink
feat(upgrade react 18)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbericoD committed May 3, 2022
1 parent a59eb3e commit 116f59d
Show file tree
Hide file tree
Showing 14 changed files with 165 additions and 189 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/Report-remaining-open-issues.yml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cra-template-overwolf-typescript-redux",
"version": "2.2.11",
"version": "3.0.0",
"description": "This is the official [Overwolf TypeScript Redux](https://github.com/AlbericoD/overwolf-modern-react-boilerplate) template for [Create React App](https://github.com/facebook/create-react-app).",
"main": "template.json",
"scripts": {
Expand Down
80 changes: 40 additions & 40 deletions template.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{
"package": {
"dependencies": {
"@reduxjs/toolkit": "^1.2.5",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/jest": "^27.0.1",
"@types/node": "^16.7.11",
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.9",
"@types/react-redux": "^7.1.9",
"i18next": "^20.6.0",
"overwolf-hooks": "^2.0.0",
"react-i18next": "^11.7.3",
"react-redux": "^7.2.1",
"typescript": "^4.0.3",
"web-vitals": "^2.1.0"
},
"devDependencies": {
"@types/remote-redux-devtools": "^0.5.4",
"remote-redux-devtools": "^0.5.16",
"remotedev-server": "^0.3.1",
"@overwolf/types": "^3.12.0"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"scripts": {
"pack-overwolf": "node create-production-overwolf-build",
"dist-overwolf": "tar -a -c -f dist.zip -C build *",
"start-remote-devtools": "node remote-dev-redux-devtools",
"build:overwolf": "npm run build && npm run pack-overwolf && npm run dist-overwolf",
"create-opk": "tar -a -c -f dist-opk.zip -C build/app * && node create-opk"
},
"homepage": "."
}
}
"package": {
"dependencies": {
"@reduxjs/toolkit": "^1.2.5",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.1.1",
"@testing-library/user-event": "^14.1.1",
"@types/jest": "^27.0.1",
"@types/node": "^17.0.31",
"@types/react": "^18.0.8",
"@types/react-dom": "^18.0.3",
"@types/react-redux": "^7.1.9",
"i18next": "^21.6.16",
"overwolf-hooks": "^3.0.1",
"react-i18next": "^11.7.3",
"react-redux": "^8.0.1",
"typescript": "^4.0.3",
"web-vitals": "^2.1.0",
"prettier": "^2.5.1"
},
"devDependencies": {
"@types/remote-redux-devtools": "^0.5.4",
"remote-redux-devtools": "^0.5.16",
"remotedev-server": "^0.3.1",
"@overwolf/types": "^3.12.0"
},
"eslintConfig": {
"extends": ["react-app", "react-app/jest"]
},
"scripts": {
"start-remote-server": "node remotedev-server",
"format": "prettier --write src/**/*.ts{,x}",
"lint": "tsc --noEmit && eslint src/**/*.ts{,x}",
"pack-overwolf": "node create-production-overwolf-build",
"dist-overwolf": "cd build && tar -acf ../dist.v$npm_package_version.zip * && cd -",
"create-opk": "cd build/app && tar -acf ../../dist-opk.v$npm_package_version.zip * && cd - && node create-opk",
"build:overwolf": "npm run build && npm run pack-overwolf && npm run dist-overwolf && npm run create-opk"
},
"homepage": "."
}
}
24 changes: 12 additions & 12 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ you need to create an optimized version of your code and the correct structure b
- just send your .zip code to the overwolf test team.

4. **Edit Changelog**
> To make it easier for users, contributors and overwolf team to see precisely what notable changes have been made between each release (or version) of the project.
> To make it easier for users, contributors and overwolf team to see precisely what notable changes have been made between each release (or version) of the project.
```shell
$ vi project-root/CHANGELOG.md
Expand All @@ -233,16 +233,16 @@ About [ CI/CD File.yml](https://raw.githubusercontent.com/AlbericoD/overwolf-mod

check out some screenshots of what github actions looks like:

![Overview](https://raw.githubusercontent.com/AlbericoD/overwolf-modern-react-boilerplate/master/doc/ci-overview.png)
--
![Overview Details-1](https://raw.githubusercontent.com/AlbericoD/overwolf-modern-react-boilerplate/master/doc/ci-overview-details-1.png)
--
![Overview Details-2](https://raw.githubusercontent.com/AlbericoD/overwolf-modern-react-boilerplate/master/doc/ci-overview-details-2.png)
--
![Overview Release-1](https://raw.githubusercontent.com/AlbericoD/overwolf-modern-react-boilerplate/master/doc/ci-overview-release-1.png)
--
![Overview Release-2](https://raw.githubusercontent.com/AlbericoD/overwolf-modern-react-boilerplate/master/doc/ci-overview-release-2.png)
--
## ![Overview](https://raw.githubusercontent.com/AlbericoD/overwolf-modern-react-boilerplate/master/doc/ci-overview.png)

## ![Overview Details-1](https://raw.githubusercontent.com/AlbericoD/overwolf-modern-react-boilerplate/master/doc/ci-overview-details-1.png)

## ![Overview Details-2](https://raw.githubusercontent.com/AlbericoD/overwolf-modern-react-boilerplate/master/doc/ci-overview-details-2.png)

## ![Overview Release-1](https://raw.githubusercontent.com/AlbericoD/overwolf-modern-react-boilerplate/master/doc/ci-overview-release-1.png)

## ![Overview Release-2](https://raw.githubusercontent.com/AlbericoD/overwolf-modern-react-boilerplate/master/doc/ci-overview-release-2.png)

![Overview Release-3](https://raw.githubusercontent.com/AlbericoD/overwolf-modern-react-boilerplate/master/doc/ci-overview-release-3.png)

**in the near future the overwolf team will make available an API to publish an application, so just add a few lines of code at the end of the github actions and the build will be complete
\*\*in the near future the overwolf team will make available an API to publish an application, so just add a few lines of code at the end of the github actions and the build will be complete
17 changes: 9 additions & 8 deletions template/create-opk.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
const fs = require('fs');
const path = require('path');
const fs = require("fs");
const path = require("path");
//import metadata from './package.json';
const { version } = require("./package.json");

console.log("Init overwolf opk packaging")
console.log("Init overwolf opk packaging");

const currentDir = __dirname;
const distFile = path.join(currentDir, 'dist-opk.zip')
const opkFile = path.join(currentDir, 'dist-opk.opk')
const distFile = path.join(currentDir, `dist-opk.v${version}.zip`);
const opkFile = path.join(currentDir, `dist-opk.v${version}.opk`);

fs.copyFileSync(distFile, opkFile)
fs.copyFileSync(distFile, opkFile);


console.log("opk created successfully!")
console.log("opk created successfully!");
28 changes: 14 additions & 14 deletions template/create-production-overwolf-build.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
const fs = require('fs');
const path = require('path');
const fs = require("fs");
const path = require("path");
const { existsSync, mkdirSync, renameSync } = fs;

console.log("Init overwolf build")
console.log("Init overwolf build");

const currentDir = __dirname;

const fileDir = path.join(currentDir, 'build')
const buildDir = path.join(fileDir, 'app', 'Files');
const fileDir = path.join(currentDir, "build");
const buildDir = path.join(fileDir, "app", "Files");

// Creating Files directory if doesn't exists
if (!existsSync(buildDir)){
mkdirSync(buildDir);
if (!existsSync(buildDir)) {
mkdirSync(buildDir);
}

// Moving index.html and static folder
const index = 'index.html'
const static = 'static'
const index = "index.html";
const static = "static";

const customRename = (name) => {
const oldPath = path.join(fileDir, name)
const newPath = path.join(buildDir, name)
renameSync(oldPath, newPath)
}
const oldPath = path.join(fileDir, name);
const newPath = path.join(buildDir, name);
renameSync(oldPath, newPath);
};

customRename(index);
customRename(static);

console.log("Compiled successfully!");
console.log("Compiled successfully!");
10 changes: 5 additions & 5 deletions template/public/app/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"manifest_version": 1,
"type": "WebApp",
"meta": {
"name": "Overwolf Modern React Boilerplate-v2",
"version": "2.0.0",
"name": "Overwolf Modern React Boilerplate-v3",
"version": "3.0.0",
"minimum-overwolf-version": "0.120.0",
"author": "Albérico Dias Barreto Filho",
"icon": "IconMouseOver.png",
Expand Down Expand Up @@ -39,7 +39,7 @@
"file": "Files/index.html",
"native_window": true,
"transparent": true,
"resizable": false,
"resizable": true,
"size": {
"width": 1212,
"height": 699
Expand All @@ -49,8 +49,8 @@
"height": 699
},
"max_size": {
"width": 1212,
"height": 699
"width": 1920,
"height": 1080
},
"desktop_only": true
},
Expand Down
8 changes: 4 additions & 4 deletions template/src/components/Feed/Feed.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { FeedItem } from './FeedItem'
import './Feed.css'
import { FeedItem } from "./FeedItem";
import "./Feed.css";

export function Feed({ title, data }: IFeedProps) {
export function Feed({ title, data }: FeedProps) {
return (
<div className="feed-container">
<p>{title}</p>
<ul>
<FeedItem content={JSON.stringify(data, null, 2)} />
</ul>
</div>
)
);
}
4 changes: 2 additions & 2 deletions template/src/components/Feed/FeedItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function FeedItem({ content }: IFeedItemProps) {
return <li data-icon="🐺">{content}</li>
export function FeedItem({ content }: FeedItemProps) {
return <li data-icon="🐺">{content}</li>;
}
10 changes: 5 additions & 5 deletions template/src/components/Feed/feedInterface.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
interface IFeedProps {
title: string
data: Record<string, string>
interface FeedProps {
title: string;
data: Record<string, string>;
}

interface IFeedItemProps {
content: string
interface FeedItemProps {
content: string;
}
10 changes: 7 additions & 3 deletions template/src/components/Title/Title.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { FC } from 'react'
import { ReactNode } from "react";

export const Title: FC<ITitle> = ({ color, children }) => {
return <h3 style={{ color }}>{children}</h3>
interface Props extends TitleProps {
children: ReactNode;
}

export const Title = ({ color, children }: Props) => {
return <h3 style={{ color }}>{children}</h3>;
};
4 changes: 2 additions & 2 deletions template/src/components/Title/titleInterface.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
interface ITitle {
color: 'red' | 'blue' | 'green' | 'white'
interface TitleProps {
color: "red" | "blue" | "green" | "white";
}
Loading

0 comments on commit 116f59d

Please sign in to comment.