Skip to content

Commit

Permalink
Check for 'development' env var in postinstall script
Browse files Browse the repository at this point in the history
  • Loading branch information
wipfli committed Feb 12, 2022
1 parent 45ea581 commit 5eb6793
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
node-version: 16
architecture: x64
- run: npm ci
- run: npm run dev-postinstall
- name: Download branch artifact
uses: dawidd6/action-download-artifact@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
node-version: 16
architecture: x64
- run: npm ci
- run: npm run dev-postinstall
- run: npm run generate-typings
- run: npm run build-prod-min
- run: npm run build-prod
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
- run: npm ci
- run: npm run dev-postinstall
- run: npm run lint
- run: npm run lint-docs
- run: npm run lint-css
2 changes: 2 additions & 0 deletions .github/workflows/publish-style-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:

- name: Install GL JS
run: npm ci

- run: npm run dev-postinstall

- name: Build GL JS
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
- name: Install
run: npm ci

- run: npm run dev-postinstall

- name: Prepare release
id: prepare_release
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ jobs:
node-version: 16
architecture: x64
- run: npm ci
- run: npm run dev-postinstall
- run: npm run build-dev
- run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-browser
1 change: 1 addition & 0 deletions .github/workflows/test-expression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
node-version: 16
architecture: x64
- run: npm ci
- run: npm run dev-postinstall
- run: npm run test-expression
1 change: 1 addition & 0 deletions .github/workflows/test-query.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ jobs:
node-version: 16
architecture: x64
- run: npm ci
- run: npm run dev-postinstall
- run: npm run build-dev
- run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-query
1 change: 1 addition & 0 deletions .github/workflows/test-render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
node-version: 16
architecture: x64
- run: npm ci
- run: npm run dev-postinstall
- run: npm run build-dev
- run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-render
- uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-style-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ jobs:
node-version: 16
architecture: x64
- run: npm ci
- run: npm run dev-postinstall
- run: npm run build-dev
- run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-style-spec
1 change: 1 addition & 0 deletions .github/workflows/test-symbol-shaping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ jobs:
node-version: 16
architecture: x64
- run: npm ci
- run: npm run dev-postinstall
- run: npm run build-dev
- run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-symbol-shaping
2 changes: 2 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
- run: npm ci
- run: npm run dev-postinstall
- run: npm run test-unit

test_unit_ubuntu:
Expand All @@ -49,4 +50,5 @@ jobs:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
- run: npm ci
- run: npm run dev-postinstall
- run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-unit
2 changes: 2 additions & 0 deletions .github/workflows/upload-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- name: Install
run: npm ci

- run: npm run dev-postinstall

- name: Build benchmarks
run: npm run build-benchmarks

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
### 🐞 Bug fixes

- *...Add new stuff here...*

## 2.1.3

### 🐞 Bug fixes

- Fix postinstall `ts-node` error on non-dev installs (#900)

## 2.1.2

### Features and improvements
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Install node module dependencies
```bash
cd maplibre-gl-js &&
npm install
npm run dev-postinstall
```

### Linux
Expand Down Expand Up @@ -56,6 +57,7 @@ Install node module dependencies
```bash
cd maplibre-gl-js &&
npm install
npm run dev-postinstall
```

### Windows
Expand All @@ -72,6 +74,7 @@ Install node module dependencies
```bash
cd maplibre-gl-js
npm install
npm run dev-postinstall
```

Install headless-gl dependencies https://github.com/stackgl/headless-gl#windows
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "maplibre-gl",
"description": "BSD licensed community fork of mapbox-gl, a WebGL interactive maps library",
"version": "2.1.3-pre.1",
"version": "2.1.3",
"main": "dist/maplibre-gl.js",
"style": "dist/maplibre-gl.css",
"license": "BSD-3-Clause",
Expand Down Expand Up @@ -171,7 +171,8 @@
"codegen": "npm run generate-style-code && npm run generate-struct-arrays && npm run generate-style-spec && npm run generate-shaders",
"benchmark": "node --loader ts-node/esm --experimental-specifier-resolution=node test/bench/run-benchmarks.ts",
"gl-stats": "node --loader ts-node/esm --experimental-specifier-resolution=node test/bench/gl-stats.ts",
"prepare": "husky install && npm run codegen && npm run generate-query-test-fixtures"
"postinstall": "node ./postinstall.js",
"prepare": "husky install"
},
"files": [
"build/",
Expand Down
5 changes: 5 additions & 0 deletions postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {execSync} from 'child_process';

if (process.env.NODE_ENV === 'development') {
execSync('npm run codegen && npm run generate-query-test-fixtures');
}

0 comments on commit 5eb6793

Please sign in to comment.