Skip to content

Commit

Permalink
improve npm compatibility (see wq/wq#59)
Browse files Browse the repository at this point in the history
 - separate packages for web/native bindings
 - update node & python versions
 - replace lerna with npm workspaces
  • Loading branch information
sheppard committed Aug 30, 2022
1 parent 984d97a commit b21881a
Show file tree
Hide file tree
Showing 241 changed files with 61,967 additions and 32,157 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
PACKAGE: ${{ matrix.package }}
strategy:
matrix:
python-version: [3.9]
node-version: [14]
python-version: ["3.10"]
node-version: [18]
package:
- app
- model
Expand All @@ -20,8 +20,12 @@ jobs:
- store
- react
- material
- material-web
- material-native
- map
- map-gl
- map-gl-web
- map-gl-native
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -35,11 +39,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
npm ci
npm run lerna exec npm ci
npm run bootstrap
npm run build
run: npm ci && npm run build
- name: Install native dependencies
if: matrix.package == 'material-native' || matrix.package == 'map-gl-native'
run: cd packages/$PACKAGE && npm ci
- name: Lint with ESLint
run: npm run lint
- name: Start test server
Expand All @@ -57,17 +60,18 @@ jobs:
if: github.event_name == 'push'
run: |
./set_dev_version.sh
cd packages/$PACKAGE
echo "registry=https://npm.pkg.github.com/wq" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
cp .npmrc packages/$PACKAGE/.npmrc # for native builds
cd packages/$PACKAGE
npm publish
pip:
name: Python Package
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.9]
node-version: [14]
python-version: ["3.10"]
node-version: [18]
steps:
- uses: actions/checkout@v2
with:
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ all: wq.js

init:
npm i
npm run bootstrap
mkdir -p static/app/js
mkdir -p static/app/css

wq.js: init
cd packages/material && npm run rollup
cd packages/material-web && npm run rollup
cd ../../
npm run rollup -- -c
cp -p packages/app/css/wq.css static/app/css/wq.css
cp -p packages/map-gl/node_modules/mapbox-gl/dist/mapbox-gl.css static/app/css/mapbox-gl.css
cp -p packages/map-gl/node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css static/app/css/mapbox-gl-draw.css
cp -p node_modules/mapbox-gl/dist/mapbox-gl.css static/app/css/mapbox-gl.css
cp -p node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css static/app/css/mapbox-gl-draw.css

clean:
rm -rf static
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ module.exports = {
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-react'
]
},
test_native: {
presets: ['module:metro-react-native-babel-preset']
}
}
};
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
testMatch: ['**/__tests__/**/*.js?(x)'],
transformIgnorePatterns: ['/node_modules/(?!redux-orm)']
testPathIgnorePatterns: ['/node_modules/', '.mock.js'],
transformIgnorePatterns: [
'/node_modules/(?!(redux-orm|@mapbox/mapbox-gl-draw|@wq))'
]
};
Loading

0 comments on commit b21881a

Please sign in to comment.