Skip to content

Commit

Permalink
Merge pull request #43 from fum4/refactor/149
Browse files Browse the repository at this point in the history
♻ Refactor #149
  • Loading branch information
fum4 authored Apr 11, 2023
2 parents d584c17 + 25cd84a commit 9c3945a
Show file tree
Hide file tree
Showing 53 changed files with 820 additions and 339 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
root: true,
extends: ["@nomadware-oss/eslint-config"],
extends: ["@nw/eslint-config"],
settings: {
next: {
rootDir: ["examples/*/"],
rootDir: ["examples/react-redux-history-next/"],
},
},
};
34 changes: 20 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,32 @@
*coverage

# misc
*.DS_Store
*.vscode
*.idea
*.pem
*.local

# debug
*npm-debug.log*
*yarn-debug.log*
*yarn-error.log*
*.pnpm-debug.log*

# env
.env.local
.env.development.local
.env.test.local
.env.production.local
# logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# next.js
*.tsbuildinfo
*.vercel
*.next
*next-env.d.ts
*out

# editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ️ Nomadware OSS
# ⚛ OSS

Monorepo containing open source packages under [Nomadware.io](https://nomadware.io) scope:

Expand All @@ -7,4 +7,6 @@ Monorepo containing open source packages under [Nomadware.io](https://nomadware.

<hr>

### 🔗 https://nomadware.io
## 🏅 Sponsors

<img alt="Sponsor - JetBrains" width="250px" height="250px" src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png?_ga=2.63300143.1068496944.1680591996-1938842262.1680591996" />
5 changes: 5 additions & 0 deletions examples/react-redux-history-next/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
// root: true,
// TODO: add to package.json and fix vercel deploy
// extends: ["@nw/eslint-config"],
};
4 changes: 4 additions & 0 deletions examples/react-redux-history-next/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"typescript.tsdk": "../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
{
"name": "react-redux-history-demo",
"version": "0.1.10",
"name": "react-redux-history-next",
"version": "0.0.1",
"private": true,
"license": "MIT",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"next": "13.3.0",
"react": "18.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
// "extends": "@nomadware-oss/tsconfig/nextjs.json",
// TODO: uncomment line above and remove everything below
// "extends": "@nw/tsconfig/next.json",
// TODO: add to package.json and fix vercel deploy
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Next.js",
"display": "Next",
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
Expand Down
4 changes: 4 additions & 0 deletions examples/react-redux-history-vanilla/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ["@nw/eslint-config"],
};
13 changes: 13 additions & 0 deletions examples/react-redux-history-vanilla/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
25 changes: 25 additions & 0 deletions examples/react-redux-history-vanilla/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "react-redux-history-vanilla",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@nw/eslint-config": "workspace:*",
"@nw/tsconfig": "workspace:*",
"@types/node": "^18.0.27",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^3.1.0",
"typescript": "^4.9.3",
"vite": "^4.2.0"
}
}
1 change: 1 addition & 0 deletions examples/react-redux-history-vanilla/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions examples/react-redux-history-vanilla/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}
35 changes: 35 additions & 0 deletions examples/react-redux-history-vanilla/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css'

function App() {
const [count, setCount] = useState(0)

return (
<div className="App">
<div>
<a href="https://vitejs.dev" target="_blank">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://reactjs.org" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
</div>
)
}

export default App
1 change: 1 addition & 0 deletions examples/react-redux-history-vanilla/src/assets/react.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions examples/react-redux-history-vanilla/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
10 changes: 10 additions & 0 deletions examples/react-redux-history-vanilla/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import './index.css'

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
1 change: 1 addition & 0 deletions examples/react-redux-history-vanilla/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
33 changes: 33 additions & 0 deletions examples/react-redux-history-vanilla/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
// "extends": "@nw/tsconfig/vite.json",
"display": "Vite",
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
"module": "esnext",
"moduleResolution": "node",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"outDir": "dist",
"composite": false,
"declaration": true,
"declarationMap": true,
"inlineSources": false,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"useDefineForClassFields": true,
"allowJs": false,
"esModuleInterop": false,
"resolveJsonModule": true,
"isolatedModules": true,
"allowSyntheticDefaultImports": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["src"],
"types": ["vite/client"]
}
6 changes: 6 additions & 0 deletions examples/react-redux-history-vanilla/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
})
Loading

1 comment on commit 9c3945a

@vercel
Copy link

@vercel vercel bot commented on 9c3945a Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

react-redux-history – ./

react-redux-history-git-master-fum4.vercel.app
react-redux-history.vercel.app
react-redux-history-fum4.vercel.app

Please sign in to comment.