Skip to content

Commit

Permalink
Merge pull request #200 from oracle/bump-react-19.0
Browse files Browse the repository at this point in the history
fix(deps): bump node-react template to react v19.0 and eslint v9
  • Loading branch information
LeonSilva15 authored Jan 17, 2025
2 parents 18ec4ef + 1a13837 commit 91a1c7e
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 63 deletions.
4 changes: 2 additions & 2 deletions templates/app/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const app = express();
const cors = require('cors')
const port = 3000;

app.use(cors())
app.use(cors());

app.use(morgan('tiny'))
app.use(bodyParser.json());
Expand All @@ -23,7 +23,7 @@ app.use( '/api/<%= apiConfiguration %>', routes );

app.use(express.static('public'));

app.use((err, req, res, next) => {
app.use((err, req, res) => {
console.log(err.message);
res.status(500).send({
errorCode: err.code,
Expand Down
2 changes: 1 addition & 1 deletion templates/app/utils/rest-services/connection.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const db = require('../db/index.cjs');

exports.getStatus = async function () {
const connection = await db.getConnection();
const result = await connection.execute('select 1 from dual');
await connection.execute('select 1 from dual');
await connection.close();

return {
Expand Down
40 changes: 0 additions & 40 deletions templates/node-react/.eslintrc.cjs

This file was deleted.

62 changes: 62 additions & 0 deletions templates/node-react/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
**
** Copyright (c) 2024, Oracle and/or its affiliates.
** All rights reserved
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
*/
import globals from "globals";
import js from "@eslint/js";
import nodePlugin from "eslint-plugin-n";
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
import reactRefreshPlugin from "eslint-plugin-react-refresh";

export default [
{
files: ["src/**/*.js","src/**/*.jsx"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
parserOptions: {
ecmaFeatures: {
jsx: true
}
},
globals: {
...globals.browser,
}
},
plugins: {
react: reactPlugin,
"react-hooks": reactHooksPlugin,
"react-refresh": reactRefreshPlugin
},
settings: {
react: { version: 'detect' }
},
rules: {
...js.configs.recommended.rules,
...reactPlugin.configs.flat.recommended.rules,
...reactPlugin.configs.flat["jsx-runtime"].rules,
...reactHooksPlugin.configs.recommended.rules,
...reactRefreshPlugin.configs.vite.rules
}
},
{
files: ["server/**/*.js", "server/**/*.cjs"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.node,
}
},
plugins: {
n: nodePlugin
},
rules: {
...js.configs.recommended.rules,
...nodePlugin.configs["flat/recommended-script"].rules
}
}
];
36 changes: 19 additions & 17 deletions templates/node-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,31 @@
"scripts": {
"dev": "concurrently --names server,client --prefix-colors blue,yellow --success all --kill-others 'node ./server/index.cjs' 'vite'",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives",
"lint": "eslint --report-unused-disable-directives",
"preview": "vite preview"
},
"dependencies": {
"body-parser": "^1.20.2",
"body-parser": "^1.20.3",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"dotenv": "^16.4.7",
"express": "^4.21.2",
"morgan": "^1.10.0",
"oracledb": "^6.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"oracledb": "^6.7.1",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@vitejs/plugin-react": "^4.2.1",
"concurrently": "^8.2.2",
"eslint": "^8.55.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-react": "^7.34.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"vite": "^5.0.8"
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"concurrently": "^9.1.2",
"eslint": "^9.18.0",
"@eslint/js": "^9.18.0",
"eslint-plugin-n": "^17.15.1",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.18",
"globals": "15.14.0",
"vite": "^6.0.7"
}
}
6 changes: 3 additions & 3 deletions templates/node-react/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ function App() {
return (
<>
<div>
<a href="https://www.oracle.com/uk/database/" target="_blank">
<img src={OracleLogo} className="logo" alt="Vite logo" />
<a href="https://www.oracle.com/database/" target="_blank" rel="noreferrer">
<img src={OracleLogo} className="logo" alt="Oracle logo" />
</a>
<a href="https://react.dev" target="_blank">
<a href="https://react.dev" target="_blank" rel="noreferrer">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
Expand Down

0 comments on commit 91a1c7e

Please sign in to comment.