Skip to content

Commit

Permalink
3.0.0-beta.2 vite migration instead of create-react-app.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetemrekilinc committed Oct 30, 2023
1 parent c73ab26 commit a3a5c8a
Show file tree
Hide file tree
Showing 15 changed files with 3,385 additions and 10,914 deletions.
6 changes: 2 additions & 4 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
PORT=3183
REACT_APP_VERSION=$npm_package_version
REACT_APP_NAME=$npm_package_name
SKIP_PREFLIGHT_CHECK=true
VITE_REACT_APP_VERSION=$npm_package_version
VITE_REACT_APP_NAME=$npm_package_name
18 changes: 18 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
6 changes: 3 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node-version: [18.12.0]
node-version: [18.18.2]

steps:
- uses: actions/checkout@v3
Expand All @@ -30,10 +30,10 @@ jobs:
- name: Install dependencies
run: rm -rf node_modules && yarn install
- run: npm run build-storybook
- run: touch ./build/.nojekyll
- run: touch ./storybook-dist/.nojekyll

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
branch: gh-pages # The branch the action should deploy to.
folder: build # The folder the action should deploy.
folder: storybook-dist # The folder the action should deploy.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ react-curved-text.iml
stats.html
/node_modules
/build
/storybook-dist

npm-debug.log*
yarn-debug.log*
Expand Down
17 changes: 17 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="react-curved-text a library for creating circular / curved texts in React projects"
/>
<title>React Curved Text</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-curved-text",
"version": "3.0.0-beta.1",
"version": "3.0.0-beta.2",
"description": "A library for creating circular / curved texts in React projects",
"keywords": [
"react",
Expand All @@ -16,8 +16,10 @@
"build": "rimraf dist && rollup -c --environment NODE_ENV:production",
"start": "rimraf dist && rollup -c -w --environment NODE_ENV:development",
"prepublishOnly": "npm run build",
"start-storybook": "set PUBLIC_URL=. && react-scripts start",
"build-storybook": "react-scripts build"
"start-storybook": "vite --port 3183",
"preview-storybook": "vite preview",
"build-storybook": "vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
},
"repository": {
"type": "git",
Expand All @@ -43,6 +45,7 @@
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "14.0.1",
"@rollup/plugin-replace": "4.0.0",
"@vitejs/plugin-react": "^4.0.4",
"eslint": "8.23.1",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-prettier": "4.2.1",
Expand All @@ -52,13 +55,13 @@
"prettier": "2.7.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-scripts": "5.0.1",
"rollup": "2.79.0",
"rollup-plugin-node-builtins": "2.1.2",
"rollup-plugin-node-globals": "1.4.0",
"rollup-plugin-peer-deps-external": "2.2.4",
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-visualizer": "5.8.1"
"rollup-plugin-visualizer": "5.8.1",
"vite": "^4.4.5"
},
"dependencies": {
"svg-path-commander": "1.0.5"
Expand Down
44 changes: 0 additions & 44 deletions public/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default [

// search for files other than .js files (must already
// be transpiled by a previous plugin!)
extensions: [ '.js', '.coffee' ], // Default: [ '.js' ]
extensions: [ '.js', '.jsx', '.coffee' ], // Default: [ '.js' ]

// if true then uses of `global` won't be dealt with by this plugin
ignoreGlobal: false, // Default: false
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions src/HeaderInfo.js → src/HeaderInfo.jsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
const HeaderInfo = () => {
const versionInfo = `Version: ${process.env.REACT_APP_VERSION}`;
const versionInfo = `Version: ${import.meta.env.VITE_REACT_APP_VERSION}`;

return (
<>
<div className={'logo-div'}>
<a href={'https://www.npmjs.com/package/react-curved-text'} target="_blank" rel="noreferrer">
<img src={process.env.PUBLIC_URL + '/logo.png'} alt="logo" />
<img src={import.meta.env.BASE_URL + '/logo.png'} alt="logo" />
</a>
</div>
<div className={'header-div'}>
<span className={'githubIcon'} title="View on GitHub">
<a href={'https://github.com/obss/react-curved-text'} target="_blank" rel="noreferrer">
<img src={process.env.PUBLIC_URL + '/github.png'} alt="github_icon" />
<img src={import.meta.env.BASE_URL + '/github.png'} alt="github_icon" />
</a>
</span>
<span className={'npmIcon'} title="View on npmjs">
<a href={'https://www.npmjs.com/package/react-curved-text'} target="_blank" rel="noreferrer">
<img src={process.env.PUBLIC_URL + '/npm.png'} alt="npm_icon" />
<img src={import.meta.env.BASE_URL + '/npm.png'} alt="npm_icon" />
</a>
</span>
<span className={'versionInfo'} title="Current Version">
Expand All @@ -27,7 +27,7 @@ const HeaderInfo = () => {
</div>
<div className={'obssTriangle'}>
<a className={'triangleIcon'} href={'https://obss.tech/'} target={'_blank'} rel="noreferrer">
<img width={50} height={50} src={process.env.PUBLIC_URL + '/obss.png'} alt={'obss'} />
<img width={50} height={50} src={import.meta.env.BASE_URL + '/obss.png'} alt={'obss'} />
</a>
</div>
</>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
include: '**/*.{js,jsx,tsx}',
}),
],
base: '/react-curved-text/',
build: {
outDir: 'storybook-dist',
},
});
Loading

0 comments on commit a3a5c8a

Please sign in to comment.