Skip to content

Commit 8b61812

Browse files
committed
[v8] migrate to monorepo
1 parent 7eeac4b commit 8b61812

File tree

107 files changed

+5058
-7809
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+5058
-7809
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
dist/
22
node_modules/
3-
test/src/utils/mapbox-gl-mock/*.js
3+
test/
4+
modules/**/test/
45
**/vite.config.js
56
examples/vite.config.local.js

.eslintrc.cjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const {getESLintConfig} = require('ocular-dev-tools/configuration');
1+
const {getESLintConfig} = require('@vis.gl/dev-tools/configuration');
22

33
module.exports = getESLintConfig({
44
react: '16.8.2',
@@ -25,12 +25,14 @@ module.exports = getESLintConfig({
2525
'@typescript-eslint/no-unsafe-member-access': 0,
2626
'@typescript-eslint/no-unsafe-assignment': 0,
2727
'import/named': 0,
28-
'@typescript-eslint/no-empty-function': ['warn', {allow: ['arrowFunctions']}],
29-
'@typescript-eslint/restrict-template-expressions': 0,
3028
'@typescript-eslint/explicit-module-boundary-types': 0,
3129
'@typescript-eslint/no-unsafe-return': 0,
3230
'@typescript-eslint/no-unsafe-call': 0,
33-
'@typescript-eslint/restrict-plus-operands': 0
31+
'@typescript-eslint/restrict-plus-operands': 0,
32+
'@typescript-eslint/no-explicit-any': 0,
33+
'@typescript-eslint/no-unsafe-argument': 0,
34+
'@typescript-eslint/no-shadow': 1,
35+
'@typescript-eslint/no-redundant-type-constituents': 1
3436
}
3537
}
3638
]

.github/workflows/release.yml

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,58 @@ on:
66
- v*
77

88
jobs:
9-
release-notes:
10-
runs-on: ubuntu-22.04
9+
check_branch:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
should_build: ${{ steps.permitted.outputs.result }}
1113

12-
if: github.repository_owner == 'visgl'
14+
steps:
15+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
16+
17+
- name: Fetch remote branches
18+
run: |
19+
git fetch origin --depth=1
1320
21+
- name: Check if on permitted branch
22+
id: permitted
23+
run: |
24+
result=
25+
if git branch -a --contains $GITHUB_SHA | grep -q 'remotes/origin/master$'; then
26+
result=true
27+
elif git branch -a --contains $GITHUB_SHA | grep -q 'remotes/origin/.*-release$'; then
28+
result=true
29+
fi
30+
echo "result=${result}" >> "$GITHUB_OUTPUT"
31+
32+
release:
33+
runs-on: ubuntu-latest
34+
needs: check_branch
1435
permissions:
1536
contents: write
1637

38+
if: ${{ github.repository_owner == 'visgl' && needs.check_branch.outputs.should_build }}
39+
1740
env:
1841
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
1943

2044
steps:
2145
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
22-
23-
- name: Use Node.js
24-
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
46+
- uses: volta-cli/action@2d68418f32546fd191eb666e232b321d5726484d # v4.1.1
2547
with:
26-
node-version: '18.x'
48+
cache: 'yarn'
2749

28-
- name: Publish release
29-
run: |
30-
body=$(node scripts/github-release.js) &&
31-
curl \
32-
-X POST \
33-
-H "Accept: application/vnd.github.v3+json" \
34-
https://api.github.com/repos/visgl/react-map-gl/releases \
35-
-d "${body}" \
36-
-H "Authorization: token ${GITHUB_TOKEN}"
50+
- name: Install dependencies
51+
run: yarn
52+
53+
- name: Build packages
54+
run: npm run build
55+
56+
- name: Run tests from transpiled code
57+
run: npx ocular-test dist
58+
59+
- name: Login to NPM
60+
run: npm config set "//registry.npmjs.org/:_authToken=${NPM_ACCESS_TOKEN}"
61+
62+
- name: Publish to NPM
63+
run: npx ocular-publish from-git

.github/workflows/test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
16-
17-
- name: Use Node.js
18-
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
16+
- uses: volta-cli/action@2d68418f32546fd191eb666e232b321d5726484d # v4.1.1
1917
with:
20-
node-version: '18.x'
18+
cache: "yarn"
2119

2220
- name: Install dependencies
2321
run: |
@@ -27,6 +25,7 @@ jobs:
2725
env:
2826
VITE_MAPBOX_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN_CI }}
2927
run: |
28+
yarn lint
3029
yarn test ci
3130
3231
- name: Coveralls

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ npm-debug.log
99
package-lock.json
1010
examples/**/yarn.lock
1111
test/**/yarn.lock
12-
*/**/package-lock.json
12+
**/package-lock.json
13+
**/tsconfig.tsbuildinfo
1314
yarn-error.log
1415
.DS_Store
1516
.reify-cache
17+
tsconfig.tsbuildinfo
1618

1719
.idea

.ocularrc.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1+
/** @typedef {import('@vis.gl/dev-tools').OcularConfig} OcularConfig */
12
import {resolve} from 'path';
23

4+
/** @type {OcularConfig} */
35
export default {
46
lint: {
5-
paths: ['src', 'test', 'examples']
7+
paths: ['modules', 'test', 'examples']
68
},
79

8-
typescript: {
9-
project: 'tsconfig.build.json'
10+
coverage: {
11+
test: 'browser'
1012
},
1113

1214
aliases: {
13-
'react-map-gl/test': resolve('./test'),
14-
'react-map-gl': resolve('./src')
15-
},
16-
nodeAliases: {
17-
'react-dom': resolve('./test/src/utils/react-dom-mock.js')
1815
},
1916

2017
browserTest: {
@@ -24,6 +21,10 @@ export default {
2421
entry: {
2522
test: 'test/node.js',
2623
'test-browser': 'test/browser.js',
27-
size: ['test/size/all.js', 'test/size/map.js']
24+
size: [
25+
'test/size/mapbox-legacy.js',
26+
'test/size/maplibre.js',
27+
'test/size/mapbox.js'
28+
]
2829
}
2930
};

babel.config.cjs

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/deckgl-overlay/src/app.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import {createRoot} from 'react-dom/client';
33
import {ArcLayer} from '@deck.gl/layers/typed';
44
import {DeckProps, PickingInfo} from '@deck.gl/core/typed';
55
import {MapboxOverlay} from '@deck.gl/mapbox/typed';
6-
import {useControl} from 'react-map-gl';
7-
8-
import Map, {NavigationControl} from 'react-map-gl';
6+
import Map, {useControl, NavigationControl} from 'react-map-gl';
97

108
const TOKEN = ''; // Set your mapbox token here
119

examples/geocoder/src/control-panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22

3-
function ControlPanel(props) {
3+
function ControlPanel() {
44
return (
55
<div className="control-panel">
66
<h3>Geocoder</h3>

examples/terrain/src/control-panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22

3-
function ControlPanel(props) {
3+
function ControlPanel() {
44
return (
55
<div className="control-panel">
66
<h3>3D Terrain</h3>

0 commit comments

Comments
 (0)