Skip to content

Commit 91a1c7e

Browse files
authored
Merge pull request #200 from oracle/bump-react-19.0
fix(deps): bump node-react template to react v19.0 and eslint v9
2 parents 18ec4ef + 1a13837 commit 91a1c7e

File tree

6 files changed

+87
-63
lines changed

6 files changed

+87
-63
lines changed

templates/app/index.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const app = express();
1111
const cors = require('cors')
1212
const port = 3000;
1313

14-
app.use(cors())
14+
app.use(cors());
1515

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

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

26-
app.use((err, req, res, next) => {
26+
app.use((err, req, res) => {
2727
console.log(err.message);
2828
res.status(500).send({
2929
errorCode: err.code,

templates/app/utils/rest-services/connection.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const db = require('../db/index.cjs');
99

1010
exports.getStatus = async function () {
1111
const connection = await db.getConnection();
12-
const result = await connection.execute('select 1 from dual');
12+
await connection.execute('select 1 from dual');
1313
await connection.close();
1414

1515
return {

templates/node-react/.eslintrc.cjs

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
**
3+
** Copyright (c) 2024, Oracle and/or its affiliates.
4+
** All rights reserved
5+
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6+
*/
7+
import globals from "globals";
8+
import js from "@eslint/js";
9+
import nodePlugin from "eslint-plugin-n";
10+
import reactPlugin from "eslint-plugin-react";
11+
import reactHooksPlugin from "eslint-plugin-react-hooks";
12+
import reactRefreshPlugin from "eslint-plugin-react-refresh";
13+
14+
export default [
15+
{
16+
files: ["src/**/*.js","src/**/*.jsx"],
17+
languageOptions: {
18+
ecmaVersion: 2022,
19+
sourceType: "module",
20+
parserOptions: {
21+
ecmaFeatures: {
22+
jsx: true
23+
}
24+
},
25+
globals: {
26+
...globals.browser,
27+
}
28+
},
29+
plugins: {
30+
react: reactPlugin,
31+
"react-hooks": reactHooksPlugin,
32+
"react-refresh": reactRefreshPlugin
33+
},
34+
settings: {
35+
react: { version: 'detect' }
36+
},
37+
rules: {
38+
...js.configs.recommended.rules,
39+
...reactPlugin.configs.flat.recommended.rules,
40+
...reactPlugin.configs.flat["jsx-runtime"].rules,
41+
...reactHooksPlugin.configs.recommended.rules,
42+
...reactRefreshPlugin.configs.vite.rules
43+
}
44+
},
45+
{
46+
files: ["server/**/*.js", "server/**/*.cjs"],
47+
languageOptions: {
48+
ecmaVersion: 2022,
49+
sourceType: "module",
50+
globals: {
51+
...globals.node,
52+
}
53+
},
54+
plugins: {
55+
n: nodePlugin
56+
},
57+
rules: {
58+
...js.configs.recommended.rules,
59+
...nodePlugin.configs["flat/recommended-script"].rules
60+
}
61+
}
62+
];

templates/node-react/package.json

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,31 @@
66
"scripts": {
77
"dev": "concurrently --names server,client --prefix-colors blue,yellow --success all --kill-others 'node ./server/index.cjs' 'vite'",
88
"build": "vite build",
9-
"lint": "eslint . --ext js,jsx --report-unused-disable-directives",
9+
"lint": "eslint --report-unused-disable-directives",
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"body-parser": "^1.20.2",
13+
"body-parser": "^1.20.3",
1414
"cors": "^2.8.5",
15-
"dotenv": "^16.3.1",
16-
"express": "^4.18.2",
15+
"dotenv": "^16.4.7",
16+
"express": "^4.21.2",
1717
"morgan": "^1.10.0",
18-
"oracledb": "^6.2.0",
19-
"react": "^18.2.0",
20-
"react-dom": "^18.2.0"
18+
"oracledb": "^6.7.1",
19+
"react": "^19.0.0",
20+
"react-dom": "^19.0.0"
2121
},
2222
"devDependencies": {
23-
"@types/react": "^18.2.43",
24-
"@types/react-dom": "^18.2.17",
25-
"@vitejs/plugin-react": "^4.2.1",
26-
"concurrently": "^8.2.2",
27-
"eslint": "^8.55.0",
28-
"eslint-plugin-node": "^11.1.0",
29-
"eslint-plugin-react": "^7.34.0",
30-
"eslint-plugin-react-hooks": "^4.6.0",
31-
"eslint-plugin-react-refresh": "^0.4.5",
32-
"vite": "^5.0.8"
23+
"@types/react": "^19.0.7",
24+
"@types/react-dom": "^19.0.3",
25+
"@vitejs/plugin-react": "^4.3.4",
26+
"concurrently": "^9.1.2",
27+
"eslint": "^9.18.0",
28+
"@eslint/js": "^9.18.0",
29+
"eslint-plugin-n": "^17.15.1",
30+
"eslint-plugin-react": "^7.37.4",
31+
"eslint-plugin-react-hooks": "^5.1.0",
32+
"eslint-plugin-react-refresh": "^0.4.18",
33+
"globals": "15.14.0",
34+
"vite": "^6.0.7"
3335
}
3436
}

templates/node-react/src/App.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ function App() {
4747
return (
4848
<>
4949
<div>
50-
<a href="https://www.oracle.com/uk/database/" target="_blank">
51-
<img src={OracleLogo} className="logo" alt="Vite logo" />
50+
<a href="https://www.oracle.com/database/" target="_blank" rel="noreferrer">
51+
<img src={OracleLogo} className="logo" alt="Oracle logo" />
5252
</a>
53-
<a href="https://react.dev" target="_blank">
53+
<a href="https://react.dev" target="_blank" rel="noreferrer">
5454
<img src={reactLogo} className="logo react" alt="React logo" />
5555
</a>
5656
</div>

0 commit comments

Comments
 (0)