Skip to main content

Development Environment

The code is built by Webpack using Babel to transpile the code back to Vanilla JavaScript. Additionally, the standard npm scripts work so the developer does not have to deal with any of that for starting the project.

IDE

The suggested IDE is either IntelliJ IDEA or WebStorm which is a subset of IntelliJ but able to deal with React projects. Both of them have great code completion, static code analysis and code formatting features.

Setting up the IDE

In order to be able to run and debug the project from inside the IDE follow Jetbrains's guide on how to set up and NPM configuration.

To install npm dependencies some preparation is needed because @bassboost/frontend-core is stored in Google Cloud Artifact Registry

Create a .npmrc file in the root of the project and insert the following content:

@bassboost:registry=https://europe-west1-npm.pkg.dev/bassboost/frontend-core/
//europe-west1-npm.pkg.dev/bassboost/frontend-core/:always-auth=true

Before executing the npm install also execute npm run artifactregistry-login. This needs the gcloud CLI to be installed and authenticated.

note

This authentication needs to be done periodically.

Once it's done, the project can be run using the start icon in the toolbar or with the npm start command.

Code analysis

For static code analysis the project uses ESLint. Both Jetbrains IDE automatically detects the configuration and helps to make the code better in real time. There is an npm script to detect all the errors: npm run lint. If you want to fix all the auto correctable errors the --fix option need to be passed to the underlying eslint command like this: npm run lint -- --fix