-
Notifications
You must be signed in to change notification settings - Fork 1
WIP- [POC] File structure proposition #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
bac38d6
4b75099
d8c9b85
cb1acd3
dca6dea
4dfc2c3
ee05335
c9fa520
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,4 @@ | ||
| REACT_APP_USE_AUTHENTICATION=true | ||
| VITE_USE_AUTHENTICATION=true | ||
|
|
||
| REACT_APP_API_GATEWAY=api/gateway | ||
| REACT_APP_WS_GATEWAY=ws/gateway | ||
|
|
||
| EXTEND_ESLINT=true | ||
| VITE_API_GATEWAY=api/gateway | ||
| VITE_WS_GATEWAY=ws/gateway |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| REACT_APP_USE_AUTHENTICATION=false | ||
| VITE_USE_AUTHENTICATION=false | ||
|
|
||
| REACT_APP_SRV_STUDY_URI=study-server | ||
| VITE_SRV_STUDY_URI=study-server |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /** | ||
| * Copyright (c) 2024, RTE (http://www.rte-france.com) | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| */ | ||
|
|
||
| import type { Config } from 'jest'; | ||
|
|
||
| const config: Config = { | ||
| testEnvironment: 'jsdom', | ||
| moduleNameMapper: { | ||
| '^.+\\.svg\\?react$|@powsybl/network-viewer': '<rootDir>/src/_mocks_/svg.tsx', | ||
| '^.+\\.(css|less|scss)$': 'identity-obj-proxy', | ||
| }, | ||
| transformIgnorePatterns: [ | ||
| 'node_modules/(?!@gridsuite/commons-ui|react-dnd|uuid|dnd-core|react-resizable-panels|@react-dnd)', | ||
| ], // transform from ESM | ||
| moduleDirectories: ['node_modules', 'src'], // to allow absolute path from ./src | ||
| setupFiles: ['<rootDir>/jest.setup.ts'], | ||
| }; | ||
|
|
||
| export default config; |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| "name": "gridXXX-app", | ||
| "version": "0.1.0", | ||
| "license": "MPL-2.0", | ||
| "homepage": ".", | ||
| "private": true, | ||
| "engines": { | ||
| "node": ">=18", | ||
|
|
@@ -20,54 +19,42 @@ | |
| "@reduxjs/toolkit": "^2.2.3", | ||
| "core-js": "^3.36.1", | ||
| "notistack": "^3.0.1", | ||
| "oidc-client": "^1.11.5", | ||
| "prop-types": "^15.8.1", | ||
| "react": "^18.2.0", | ||
| "react-dom": "^18.2.0", | ||
| "react-hook-form": "^7.51.2", | ||
| "react-intl": "^6.6.4", | ||
| "react-redux": "^9.1.0", | ||
| "react-router-dom": "^6.22.3", | ||
| "react-scripts": "^5.0.1", | ||
| "react-window": "^1.8.10", | ||
| "reconnecting-websocket": "^4.4.0", | ||
| "redux": "^5.0.1", | ||
| "typeface-roboto": "^1.1.13", | ||
| "yup": "^1.4.0" | ||
| }, | ||
| "overrides": { | ||
| "react-scripts": { | ||
| "typescript": "$typescript" | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "start": "react-scripts start", | ||
| "build": "react-scripts build", | ||
| "test": "react-scripts test --watchAll=false", | ||
| "test:watch": "react-scripts test", | ||
| "test:coverage": "react-scripts test --coverage", | ||
| "eject": "react-scripts eject", | ||
| "lint": "eslint . --ext js,mjs,jsx,ts,mts,tsx --max-warnings 0", | ||
| "start": "vite", | ||
| "start:open": "vite --open", | ||
| "build": "vite build", | ||
| "serve": "vite preview", | ||
| "test": "jest", | ||
| "test:coverage": "jest --coverage", | ||
| "type-check": "tsc", | ||
| "prebuild": "npm run lint && npm run type-check", | ||
| "lint": "eslint . --max-warnings 0", | ||
| "lint:fix": "eslint . --fix", | ||
| "lint:format": "prettier --check --cache .", | ||
| "licenses-check": "license-checker --summary --excludePrivatePackages --production --onlyAllow \"$( jq -r .onlyAllow[] license-checker-config.json | tr '\n' ';')\" --excludePackages \"$( jq -r .excludePackages[] license-checker-config.json | tr '\n' ';')\"" | ||
| }, | ||
| "jest": { | ||
| "moduleNameMapper": { | ||
| "\\.svg": "<rootDir>/src/__mocks__/svgrMock.js", | ||
| "^.+\\.(css|less|scss)$": "identity-obj-proxy" | ||
| }, | ||
| "transformIgnorePatterns": [ | ||
| "node_modules/(?!@gridsuite/commons-ui|react-dnd|dnd-core|@react-dnd)" | ||
| ] | ||
| }, | ||
| "eslintConfig": { | ||
| "extends": [ | ||
| "react-app", | ||
| "plugin:prettier/recommended" | ||
| ], | ||
| "rules": { | ||
| "prettier/prettier": "warn", | ||
| "curly": "error" | ||
| } | ||
| }, | ||
| "browserslist": { | ||
| "production": [ | ||
| ">0.2%", | ||
|
|
@@ -81,21 +68,24 @@ | |
| ] | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/plugin-proposal-private-property-in-object": "^7.21.11", | ||
| "@vitejs/plugin-react": "^5.0.0", | ||
| "@types/core-js": "^2.5.8", | ||
| "@types/eslint-config-prettier": "^6.11.3", | ||
| "@types/jest": "^27.5.2", | ||
| "@types/license-checker": "^25.0.6", | ||
| "@types/node": "^18.19.31", | ||
| "@types/node": "^20.19.0", | ||
| "@types/prop-types": "^15.7.12", | ||
| "@types/react": "^18.2.75", | ||
| "@types/react-dom": "^18.2.24", | ||
| "@types/react-window": "^1.8.8", | ||
| "eslint-config-prettier": "^9.1.0", | ||
| "eslint-plugin-prettier": "^4.2.1", | ||
| "http-proxy-middleware": "^2.0.6", | ||
| "jest": "^30.1.3", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -e
jq -r '.devDependencies.jest, .devDependencies["@types/jest"]' package.jsonRepository: gridsuite/gridapp-template Length of output: 85 Align Jest and Jest is at Upgrade 🤖 Prompt for AI Agents |
||
| "license-checker": "^25.0.1", | ||
| "prettier": "^2.8.8", | ||
| "typescript": "5.1.6" | ||
| "typescript": "5.1.6", | ||
| "vite": "^7.1.7", | ||
| "vite-tsconfig-paths": "^5.1.4", | ||
| "vite-plugin-svgr": "^4.3.0" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /** | ||
| * Copyright (c) 2020, RTE (http://www.rte-france.com) | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| */ | ||
|
|
||
| import React, { FunctionComponent, PropsWithChildren, ReactNode } from 'react'; | ||
|
|
||
| export type AppLayoutProps = PropsWithChildren<{ | ||
| topBar: ReactNode; | ||
| }>; | ||
|
|
||
| const AppLayout: FunctionComponent<AppLayoutProps> = ({ topBar, children }) => { | ||
| return ( | ||
| <> | ||
| {topBar} | ||
| {children} | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default AppLayout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: gridsuite/gridapp-template
Length of output: 278
Consolidate Jest configuration to a single source.
The repository has both a
"jest"block inpackage.jsonand a standalonejest.config.tsfile. Runningjestwith two config sources will cause it to fail or behave unpredictably. Remove the"jest"block frompackage.jsonand keep onlyjest.config.ts, or if usingpackage.jsonas the source, removejest.config.tsand invoke Jest with--configif needed.🤖 Prompt for AI Agents