Skip to content

Commit 5b6b1b2

Browse files
authored
Merge pull request #423 from trnkv/issue_412
fix: issue #412
2 parents 7eb3fd4 + be75e8f commit 5b6b1b2

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

docs/dev/setup_environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ cd diracx-web
113113
npm ci
114114

115115
# Set the DiracX backend URL you are targeting
116-
export NEXT_PUBLIC_DIRACX_URL=<backend url>
116+
export DIRACX_URL=<backend url>
117117

118118
# Run it
119119
npm run dev

packages/diracx-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"dev": "next dev",
7+
"dev": "export NEXT_PUBLIC_DIRACX_URL=$DIRACX_URL; next dev",
88
"build": "next build",
99
"test": "cypress open --config baseUrl=$DIRACX_URL",
1010
"start": "next start",

packages/extensions/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ You can either create a new repository or start from this one to build your Dira
102102

103103
See the [OIDC library documentation](https://github.com/AxaFrance/oidc-client/tree/main/packages/react-oidc#getting-started) for more information.
104104

105+
Note: for backendless local development, replace the `dev` command by:
106+
107+
```json
108+
"scripts": {
109+
"dev": "export NEXT_PUBLIC_DIRACX_URL=$DIRACX_URL; next dev",
110+
...
111+
}
112+
```
113+
114+
This avoids having to set 2 environment variables with the same value: NextJS can only read from variables prefixed with `NEXT_PUBLIC`.
115+
105116
4. **Edit the Next.js config** with these options:
106117

107118
```js
@@ -214,15 +225,13 @@ It can be automatically deployed using CI/CD tools like GitHub Actions, GitLab C
214225
- **Code Quality**: Ensure your code is clean, well-documented, and follows best practices. Use tools like [ESLint](https://eslint.org/) and [Prettier](https://prettier.io/) to maintain code quality.
215226

216227
- **Testing**:
217-
218228
- **Component Testing**: Write tests for your components to ensure they work as expected. Use [Jest](https://jestjs.io/) for unit testing and snapshot testing of your React components.
219229
- **Application Testing**: Use [Cypress](https://www.cypress.io/) for end-to-end testing to simulate real user interactions and ensure your application behaves correctly.
220230
- **Test Coverage**: Maintain good test coverage to ensure that your critical features are well-protected during updates. Tools like Jest provide [coverage reports](https://jestjs.io/docs/code-coverage) that help you identify untested parts of your code.
221231

222232
- **Accessibility**: Make your extension accessible to all users. Use semantic HTML, ARIA attributes, and test your extension with different screen sizes and assistive technologies.
223233

224234
- **Security**:
225-
226235
- **Dependency Management**: Keeping dependencies up to date is crucial for security and performance. Using deprecated packages can expose your application to known vulnerabilities.
227236
- **Identifying Vulnerabilities**: Regularly check for known vulnerabilities in your dependencies. Tools like [`npm audit`](https://docs.npmjs.com/cli/v7/commands/npm-audit) can help spot these issues.
228237
- **Automating Updates**: Use tools like [Dependabot](https://github.com/dependabot) or [Renovate](https://www.whitesourcesoftware.com/free-developer-tools/renovate/) to automate dependency updates. These tools can automatically create pull requests to update dependencies, making it easier to stay current and see if updates are compatible with tests used in CI. Keeping dependencies up to date is crucial for security as deprecated packages can expose your application to known vulnerabilities.

packages/extensions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"license": "GPL-3.0-only",
77
"scripts": {
8-
"dev": "next dev",
8+
"dev": "export NEXT_PUBLIC_DIRACX_URL=$DIRACX_URL; next dev",
99
"build": "next build",
1010
"test": "cypress open --config baseUrl=$DIRACX_URL",
1111
"start": "next start",

0 commit comments

Comments
 (0)