Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
quirinpa committed Oct 29, 2024
2 parents ef21bc1 + 36e5808 commit 11212df
Show file tree
Hide file tree
Showing 116 changed files with 1,713 additions and 1,117 deletions.
6 changes: 2 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
},
"postCreateCommand": "bash -i -c 'nvm install $(cat .nvmrc) -y && nvm use && corepack enable && pnpm clean && pnpm install'",
"remoteUser": "node",
"runArgs": [
"--network=host"
],
"runArgs": ["--network=host"],
"mounts": [
"type=bind,src=${localEnv:HOME}/.npmrc,dst=/home/node/.npmrc",
"type=bind,src=${localEnv:HOME}/.ssh,dst=/home/node/.ssh",
"type=bind,src=${localEnv:HOME}/movai/src/feapps,dst=/workspaces/"
]
}
}
48 changes: 22 additions & 26 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
module.exports = {
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended"
],
"overrides": [
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint"
],
"rules": {
"react/prop-types": 0,
"react/display-name": 0
}
}
env: {
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
overrides: [],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["react", "@typescript-eslint"],
rules: {
"react/prop-types": 0,
"react/display-name": 0,
},
};
2 changes: 1 addition & 1 deletion .github/workflows/DeployOnMergeMain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
run_tests: "true"
use_nvmrc: "true"
pm: "pnpm"
pnpm_version: "9.4.0"
pnpm_version: "9.11.0"
secrets:
auto_commit_user: ${{ secrets.RAISE_BOT_COMMIT_USER }}
auto_commit_mail: ${{ secrets.RAISE_BOT_COMMIT_MAIL }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/TestOnPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ jobs:
uses: MOV-AI/.github/.github/workflows/[email protected]
with:
deploy: "false"
run_lint_staged: "true"
run_tests: "true"
use_nvmrc: "true"
pm: "pnpm"
pnpm_version: "9.4.0"
pnpm_version: "9.11.0"
secrets:
auto_commit_user: ${{ secrets.RAISE_BOT_COMMIT_USER }}
auto_commit_mail: ${{ secrets.RAISE_BOT_COMMIT_MAIL }}
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec lint-staged
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.15.0
20.17.0
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package.json
pnpm-lock.yaml
6 changes: 1 addition & 5 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{
"trailingComma": "none",
"arrowParens": "avoid",
"tabWidth": 2
}
{}
6 changes: 3 additions & 3 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module.exports = {
stories: ["../stories/**/*.stories.@(js|mdx)"],
addons: ["@storybook/addon-docs", "@storybook/addon-controls"],
core: {
builder: "webpack5"
}
};
builder: "webpack5",
},
};
8 changes: 4 additions & 4 deletions .storybook/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ module.exports = function (app) {
"/logout/**",
"/static/maps/**",
"/static/meshes/**",
"/static/point_clouds/**"
"/static/point_clouds/**",
],
{
target: "https://localhost",
ws: true,
logLevel: "debug",
secure: false
}
)
secure: false,
},
),
);
};
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import withTheme from "../src/Components/HOCs/withTheme";
import ApplicationTheme from "../src/styles/Themes";

export const decorators = [
(Story) => {
const ThemedStory = withTheme(Story, ApplicationTheme);
Expand Down
4 changes: 2 additions & 2 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ module.exports = {
module: {
rules: [
// add your custom rules.
]
}
],
},
};
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode"]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"prettier.configPath": ".prettierrc.json",
"editor.formatOnSave": true
}
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@
- [FP-2857](https://movai.atlassian.net/browse/FP-2857): Merge fix for FP-2810 into 2.4.1
- [FP-2858](https://movai.atlassian.net/browse/FP-2858): Removelog duplication for the second overlapping in requests
- [FP-2741](https://movai.atlassian.net/browse/FP-2741): Odd message when trying to start another flow when one is running
- [FP-2917](https://movai.atlassian.net/browse/FP-2917): Configure husky, lint-staged and prettier for lib-react

# 1.3.7

- [FP-2959](https://movai.atlassian.net/browse/FP-2959): Toggle button is missaligned

# 1.3.6

- [QAP-4053](https://movai.atlassian.net/browse/QAP-4053): Forward test coverage for lib-react
- [FP-2926](https://movai.atlassian.net/browse/FP-2926): Clear console and app errors
- [FP-2930](https://movai.atlassian.net/browse/FP-2930): Update node and pnpm versions

# 1.3.5

- [FP-2848](https://movai.atlassian.net/browse/FP-2848): Review and enable lib-react unit tests
- [FP-2848](https://movai.atlassian.net/browse/FP-2848): Review and enable lib-react unit tests
- [QAP-3962](https://movai.atlassian.net/browse/QAP-3962): Review devcontainer configuration for lib-react
- [FP-2840](https://movai.atlassian.net/browse/FP-2840): Update ReadMe's on all apps
- [FP-2741](https://movai.atlassian.net/browse/FP-2741): Odd message when trying to start another flow when one is running
Expand Down
117 changes: 65 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,28 @@ Its main use will be to build Mov.AI applications.
# Table of Content

<!-- TOC -->
* [MOVAI-Lib-React](#movai-lib-react)
* [Table of Content](#table-of-content)
* [Setting Up Your Development Environment](#setting-up-your-development-environment)
* [Common Configuration](#common-configuration)
* [Configure ~/.npmrc](#configure-npmrc)
* [Using a DevContainer (recommended)](#using-a-devcontainer-recommended)
* [Using a Local Setup](#using-a-local-setup)
* [Tools Required](#tools-required)
* [Install Node with NVM](#install-node-with-nvm)
* [Install PNPM](#install-pnpm)
* [Using a DevContainer Setup](#using-a-devcontainer-setup)
* [Tools Required](#tools-required-1)
* [Development](#development)
* [How to install this library to an app](#how-to-install-this-library-to-an-app)
* [How to Link this library locally to an App](#how-to-link-this-library-locally-to-an-app)
<!-- TOC -->

- [MOVAI-Lib-React](#movai-lib-react)
- [Table of Content](#table-of-content)
- [Setting Up Your Development Environment](#setting-up-your-development-environment)
- [Common Configuration](#common-configuration)
- [Configure ~/.npmrc](#configure-npmrc)
- [Using a DevContainer (recommended)](#using-a-devcontainer-recommended)
- [Using a Local Setup](#using-a-local-setup)
- [Tools Required](#tools-required)
- [Install Node with NVM](#install-node-with-nvm)
- [Install PNPM](#install-pnpm)
- [Using a DevContainer Setup](#using-a-devcontainer-setup)
- [Tools Required](#tools-required-1)
- [Development](#development)
- [How to install this library to an app](#how-to-install-this-library-to-an-app)
- [How to Link this library locally to an App](#how-to-link-this-library-locally-to-an-app)
<!-- TOC -->

# Setting Up Your Development Environment

You can set up your development environment in two ways:

- In a DevContainer (recommended)
- Locally

Expand Down Expand Up @@ -73,58 +75,61 @@ To install Node.js using `nvm` (Node Version Manager), follow these steps:

Open your terminal and run the following command to install `nvm`:

```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
```
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
```

2. **Load `nvm`:**

After installing `nvm`, you need to load it. Close and reopen your terminal, or run:

```bash
source ~/.nvm/nvm.sh
```
```bash
source ~/.nvm/nvm.sh
```

3. **Install the required Node.js version:**

With `nvm` installed and loaded, run the following command to use the required Node.js version:

```bash
nvm install && nvm use # uses the node version specify in the .nvmrc file
```
```bash
nvm install && nvm use # uses the node version specify in the .nvmrc file
```

4. **Set the used Node.js as the default version:**

```bash
nvm current # prints the node.js version being used
nvm alias default xx.xx.x # sets xx.xx.x as default
```
```bash
nvm current # prints the node.js version being used
nvm alias default xx.xx.x # sets xx.xx.x as default
```

5. **Verify the installation:**

```bash
node -v
```
```bash
node -v
```

This should output the node version specified in `.nvmrc` file.


#### Install PNPM

To install `pnpm`, follow these steps:

1. Using the required pnpm version:

The pnpm version required is specify in the `package.json` file as:
```json
{
"packageManager": "[email protected]"
}
```

```json
{
"packageManager": "[email protected]"
}
```

In order to have Node.js use the specified version, run:
```bash

```bash
corepack enable
```
```

Upon first use, Corepack downloads the latest version from the network and uses it when running pnpm commands.

### Using a DevContainer Setup
Expand All @@ -140,9 +145,10 @@ To install `pnpm`, follow these steps:
## How to install this library to an app

1. - Install package:
```bash
"pnpm install @mov-ai/mov-fe-lib-react"
```

```bash
"pnpm install @mov-ai/mov-fe-lib-react"
```

## How to Link this library locally to an App

Expand All @@ -151,26 +157,33 @@ Here's how it can be done:

1. In the app, identify this library in the `package.json`:

```
"@mov-ai/mov-fe-lib-react": "^x.x.x-X",
```
```
"@mov-ai/mov-fe-lib-react": "^x.x.x-X",
```

2. Replace the library version with the path of this local library:

```
```
"@mov-ai/mov-fe-lib-react": "file:/home/username/path/to/library/frontend-npm-lib-react"
```
```

3. Build this local library:

```bash
```bash
pnpm install # installs dependencies
pnpm buildDev # builds the app and watches for changes
```
```

4. Install and build the app:

```bash
```bash
pnpm install # installs dependencies including the local library
pnpm start # runs the app
```
```

## How to setup linting git hook

1. Install husky git hook:
```bash
"pnpm prepare"
```
8 changes: 4 additions & 4 deletions __mocks__/@mov-ai/mov-fe-lib-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ const Authentication = {
refreshTokens: jest.fn().mockResolvedValue(true),
getToken: jest.fn().mockReturnValue("token"),
getProviders: jest.fn().mockResolvedValue({ domains: ["internal", "ldap"] }),
DEFAULT_PROVIDER: "internal"
DEFAULT_PROVIDER: "internal",
};

const User = function () {
return {
getCurrentUserWithPermissions: jest.fn().mockResolvedValue({
Resources: {
Applications: []
Applications: [],
},
Superuser: true
})
Superuser: true,
}),
};
};

Expand Down
2 changes: 1 addition & 1 deletion __mocks__/roslib.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const RosLib = {
REVISION: "1.3.0"
REVISION: "1.3.0",
};
Loading

0 comments on commit 11212df

Please sign in to comment.