Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .eslintrc.js

This file was deleted.

13 changes: 8 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'

- name: Enable Corepack
run: corepack enable

- name: Run linting and tests
run: |
yarn install --frozen-lockfile
yarn lint
yarn test
pnpm install --frozen-lockfile
pnpm lint
pnpm test
env:
CI: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ styleguide
coverage
doc/build
styleguide-build
pnpm-workspace.yaml
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

yarn commitlint --edit $1
pnpm commitlint --edit $1
2 changes: 1 addition & 1 deletion .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
[ -n "$CI" ] && exit 0

yarn install --frozen-lockfile
pnpm install --frozen-lockfile
2 changes: 1 addition & 1 deletion .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

yarn install --frozen-lockfile
pnpm install --frozen-lockfile
2 changes: 1 addition & 1 deletion .husky/post-rebase
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

yarn install --frozen-lockfile
pnpm install --frozen-lockfile
2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
"(src|__mocks__)/**/*.js": [
"eslint --fix",
"prettier --write",
"yarn test --bail --findRelatedTests --passWithNoTests",
"pnpm test --bail --findRelatedTests --passWithNoTests",
],
"package.json": ["fixpack"],
"src/**/*.{css,scss}": ["stylelint --fix"],
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22
24
29 changes: 10 additions & 19 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,49 @@ Documentation and examples are available [here](https://react-spatial.geops.de/)
Build the doc:

```bash
yarn doc
pnpm doc
```

Run the doc on [`locahost:6060`](http://locahost:6060/):

```bash
yarn start
pnpm start
```

## Tests

We are using [jest]([https://react-styleguidist.js.org/](https://jestjs.io/docs/en/getting-started.html)) and [enzyme]([https://github.com/airbnb/enzyme](https://airbnb.io/enzyme/)).

Run the tests in watch mode:

```bash
yarn test --watch
pnpm test --watch
```

## Coverage

Run coverage:

```bash
yarn coverage
pnpm coverage
```

Then open the file `coverage/lcov-report/index.html` in your browser.

## Publish on [npmjs.com](https://www.npmjs.com/package/react-spatial)
## Publish new version

We use `standard-version` to manage versioning and changelog generation.

Run publish:

```bash
publish:public
pnpm publish:public
```
You need to enter the new version number in the command line.
Then the new version must be published on [npmjs.com](https://www.npmjs.com/package/react-spatial).

## Publish a development version on [npmjs.com](https://www.npmjs.com/package/react-spatial)

This version WILL NOT be displayed to other in [npmjs.com](https://www.npmjs.com/package/react-spatial).

Run publish:
or for a beta version on beta channel:

```bash
publish:beta
pnpm publish:beta
```

You need to enter the new version number in the command line.
Append `-beta.0` to the current version or increase the beta number.
Then the new version must be published on [npmjs.com](https://www.npmjs.com/package/react-spatial) with the tag beta.

## How to use SVG

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Documentation and examples at https://react-spatial.geops.io.
Install the [react-spatial](https://www.npmjs.com/package/react-spatial) package:

```bash
yarn add maplibre-gl ol mobility-toolbox-js react-spatial
pnpm add maplibre-gl ol mobility-toolbox-js react-spatial
```

Your build pipeline needs to support ES6 modules and SASS.
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
module.exports = { extends: ["@commitlint/config-conventional"] };
2 changes: 1 addition & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ the folder published by netlify is doc/build (netlify.toml).
## Commands

Styleguidist documentation is visible (with hot reload) with the cmd:
'yarn start'
'pnpm start'

## Configuration

Expand Down
39 changes: 39 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import flat from "@geops/eslint-config-react/flat";

// tailwind@4 only supported in beta channel
// import tailwind from "eslint-plugin-tailwindcss";

export default [
...flat,
// tailwind@4 only supported in beta channel
// ...tailwind.configs["flat/recommended"],
// {
// settings: {
// react: {
// version: "18.3.1",
// },
// },
// },
{
rules: {
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"mocha/no-setup-in-describe": "off",
"mocha/consistent-spacing-between-blocks": "off",
"@typescript-eslint/no-redundant-type-constituents": "off",
"mocha/no-pending-tests": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"react-compiler/react-compiler": "off",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
},
},
];
4 changes: 1 addition & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module.exports = {
moduleNameMapper: {
"@geoblocks/ol-maplibre-layer":
"<rootDir>/node_modules/@geoblocks/ol-maplibre-layer/lib/index.js",
"\\.(jpg|jpeg|png|gif|webp|scss)$": "identity-obj-proxy",
},
setupFilesAfterEnv: ["<rootDir>/src/setupTests.js"],
Expand All @@ -10,8 +8,8 @@ module.exports = {
testMatch: ["<rootDir>/src/**/?(*.)+(spec|test).[jt]s?(x)"],
testPathIgnorePatterns: ["<rootDir>/(build|coverage|public|doc|packages)"],
transform: {
".+\\.js$": "babel-jest",
".+\\.svg$": "jest-transformer-svg",
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest",
},
transformIgnorePatterns: [],
};
Loading
Loading