Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[terrain3d] Merge main #1021

Merged
merged 33 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
151bc9d
Migrate expression tests to jest (#965)
birkskyum Feb 8, 2022
2ef1e22
Revert "Move benchmarks to ES modules (#964)" (#969)
birkskyum Feb 8, 2022
c4fba70
Migrate query tests from puppeteer to playwright (#966)
birkskyum Feb 9, 2022
bf3c21d
Fix web worker in watch mode (#968)
birkskyum Feb 9, 2022
c54f76a
Simplify build pipeline (#961)
birkskyum Feb 9, 2022
e8503e1
Create codeql-analysis.yml
nyurik Feb 9, 2022
a18dbbf
Bump simple-get from 3.1.0 to 3.1.1 (#971)
dependabot[bot] Feb 9, 2022
ecea004
Bump nanoid from 3.1.30 to 3.2.0 (#973)
dependabot[bot] Feb 9, 2022
a820420
Bump cached-path-relative from 1.0.2 to 1.1.0 (#972)
dependabot[bot] Feb 9, 2022
34163b9
Move browser test to playwright (#974)
birkskyum Feb 10, 2022
9c2bb48
Bump ts-node for 3x faster postinstall (#975)
birkskyum Feb 10, 2022
0263cc0
Remove web worker replacement (#976)
HarelM Feb 10, 2022
b3213ee
Attribution default open for osm (#795)
acalcutt Feb 10, 2022
25a2794
Fix benchmarks (#984)
vanilla-lake Feb 11, 2022
8ff0907
Move bench under `test` folder (#979)
HarelM Feb 11, 2022
9d600e6
Add typeof guard to performance variable (#986)
HarelM Feb 11, 2022
b13bfd7
Release 2.1.2 Version (#987)
HarelM Feb 11, 2022
670aa35
Fix release.yml due to bench folder move (#988)
HarelM Feb 11, 2022
0b6f7ad
lint function-url-quotes/ (#983)
astridx Feb 12, 2022
b65fbdd
Bump to v2.1.3 - Fix postinstall error `ts-node` not found in non-dev…
wipfli Feb 12, 2022
ba44cbc
Bump to v2.1.4 - Fix missing `postinstall.js` file in npm publish (#992)
wipfli Feb 12, 2022
bb21d11
Bump to v2.1.5-pre.1 - Publish empty `postinstall.js` file (#994)
wipfli Feb 12, 2022
b279bdd
Bump to v2.1.5 (#996)
wipfli Feb 12, 2022
a1b5839
Bump to v2.1.6-pre.1 - Fix `dist/package.json` (#998)
wipfli Feb 12, 2022
925b85e
Bump to v2.1.6 (#999)
wipfli Feb 12, 2022
c2afc9c
prefix (#1004)
astridx Feb 16, 2022
0eed85d
correct done (#1006)
astridx Feb 16, 2022
964bbef
Add adjustment to rendering glyphs (#1005)
Kanahiro Feb 17, 2022
4212f89
Simplify render tests (#1003)
HarelM Feb 19, 2022
a076a01
Husky pre-commit do not fix lint (#1019)
wipfli Feb 24, 2022
5f536aa
Merge main
wipfli Feb 24, 2022
1c49e1f
Fix css
wipfli Feb 24, 2022
ad78d53
Use main package-lock.json
wipfli Feb 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"ignorePatterns": ["build/*.js", "*.json"],
"overrides": [
{
"files": ["debug/**", "bench/**", "test/**", "src/style-spec/**"],
"files": ["debug/**", "test/**", "src/style-spec/**"],
"rules": {
"jsdoc/check-param-names": "off",
"jsdoc/require-param": "off",
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '17 0 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ jobs:
npm run build-benchmarks
npm run generate-typings

- name: Empty postinstall.js
run: |
echo "// empty in published package" > postinstall.js

- name: Write dist/package.json
run: |
echo "{ \"type\": \"commonjs\" }" > dist/package.json

- name: Create Archive
run: |
zip -r dist dist
Expand Down Expand Up @@ -115,8 +123,8 @@ jobs:
- name: Copy benchmarks_generated.js
run: |
mkdir tmp
cp bench/versions/benchmarks_generated.js tmp
cp bench/versions/benchmarks_generated.js.map tmp
cp test/bench/versions/benchmarks_generated.js tmp
cp test/bench/versions/benchmarks_generated.js.map tmp

- name: Upload Benchmarks to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/test-browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,4 @@ jobs:
architecture: x64
- run: npm ci
- run: npm run build-dev
- run: DETECT_CHROMEDRIVER_VERSION=true npm install -g chromedriver
- run: npm install -g geckodriver@2.0.4
- name: Test Chrome
env:
SELENIUM_BROWSER: chrome
TAP_COLORS: 1
run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-browser
- name: Test Firefox
env:
SELENIUM_BROWSER: firefox
TAP_COLORS: 1
run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-browser
- run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-browser
1 change: 0 additions & 1 deletion .github/workflows/test-expression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ jobs:
node-version: 16
architecture: x64
- run: npm ci
- run: npm run build-dev
- run: npm run test-expression
9 changes: 2 additions & 7 deletions .github/workflows/test-render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,11 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16 x64
- name: Use Node.js 16.13 x64
uses: actions/setup-node@v2
with:
node-version: 16
node-version: 16.13
architecture: x64
- run: npm ci
- run: npm run build-dev
- run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-render
- uses: actions/upload-artifact@v2
if: always()
with:
name: index.html
path: test/integration/render-tests/index.html
4 changes: 2 additions & 2 deletions .github/workflows/upload-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- name: Copy benchmarks_generated.js
run: |
mkdir tmp
cp bench/versions/benchmarks_generated.js tmp
cp bench/versions/benchmarks_generated.js.map tmp
cp test/bench/versions/benchmarks_generated.js tmp
cp test/bench/versions/benchmarks_generated.js.map tmp

- name: Upload to GitHub Pages (main)
if: startsWith(github.ref, 'refs/heads/main')
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/types/
/dist/
/dist_type/
/bench/results/
/test/bench/results/
*.es.js
*.js.map
node_modules
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

9 changes: 3 additions & 6 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
"at-rule-no-unknown": [true, {
"ignoreAtRules": ["svg-load"]
}],

"at-rule-no-vendor-prefix": null,
"function-url-quotes": null,
"property-no-vendor-prefix": null,
"selector-no-vendor-prefix": null,
"value-no-vendor-prefix": null
"property-no-vendor-prefix": [true, {
"ignoreProperties": ["/user-select/"]
}]
},
"ignoreFiles": [
"dist/**/*.css"
Expand Down
54 changes: 51 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,63 @@

### Features and improvements

- Export `Source` classes (`GeoJSONSource` etc.) declarations. ([#801](https://github.com/maplibre/maplibre-gl-js/issues/801))
- Make `AJAXError` public so error HTTP responses can be handled differently from other errors.
- *...Add new stuff here...*

### 🐞 Bug fixes

- Add adjustment for glyph rendering, CJK fonts are mainly affected (#1002).
- *...Add new stuff here...*

## 2.1.6

### 🐞 Bug fixes

- Publish `dist/package.json` (#998).

## 2.1.6-pre.1

### 🐞 Bug fixes

- Publish `dist/package.json` (#998).

## 2.1.5

### 🐞 Bug fixes

- Publish empty `postinstall.js` file. Follow-up on (#990), (#991), (#992).

## 2.1.5-pre.1

### 🐞 Bug fixes

- Publish empty `postinstall.js` file. Follow-up on (#990), (#991), (#992).

## 2.1.4

### 🐞 Bug fixes

- Fix missing `postinstall.js` file in npm publish. Follow-up on (#990), (#991).

## 2.1.3

### 🐞 Bug fixes

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

## 2.1.2

### Features and improvements

- Default compact attribution to be open by default to comply with OpenSteetMap Attribution Guidelines (#795)
- Export `Source` classes (`GeoJSONSource` etc.) declarations. (#801)
- Make `AJAXError` public so error HTTP responses can be handled differently from other errors.

### 🐞 Bug fixes

- Fix compact attribution button showing when attribution is blank (#795)
- Fix error mismatched image size for CJK characters (#718)
- Fire `dataabort` and `sourcedataabort` events when a tile request is aborted (#794)
- *...Add new stuff here...*
- Fix NextJs `performance` undefined (#768)

## 2.1.1

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ See [`test/README.md`](./test/README.md).

## Writing & Running Benchmarks

See [`bench/README.md`](./bench/README.md).
See [`test/bench/README.md`](./test/bench/README.md).

## Code Conventions

Expand Down
24 changes: 0 additions & 24 deletions bench/styles/index.html

This file was deleted.

12 changes: 7 additions & 5 deletions build/generate-query-test-fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import path from 'path';
import path, {dirname} from 'path';
import fs from 'fs';
import glob from 'glob';
import localizeURLs from '../test/integration/lib/localize-urls';
import {fileURLToPath} from 'url';
import {createRequire} from 'module';

const __dirname = dirname(fileURLToPath(import.meta.url));
const requireFn = createRequire(import.meta.url);
const OUTPUT_FILE = 'fixtures.json';
const rootFixturePath = 'test/integration/query/';
const suitePath = 'tests';
Expand Down Expand Up @@ -50,7 +54,7 @@ function generateFixtureJson(rootDirectory: string, suiteDirectory: string, outp
throw new Error(`${extension} is incompatible , file path ${fixturePath}`);
}
} catch (e) {
console.log(`Error parsing file: ${fixturePath}`);
console.log(`Error parsing file: ${fixturePath} ${e.message}`);
malformedTests[testName] = true;
}
}
Expand Down Expand Up @@ -101,8 +105,7 @@ function pngToBase64Str(filePath) {

function processStyle(testName, style) {
const clone = JSON.parse(JSON.stringify(style));

localizeURLs(clone, 7357);
localizeURLs(clone, 7357, path.join(__dirname, '../test/integration'), requireFn);

clone.metadata = clone.metadata || {};

Expand All @@ -118,6 +121,5 @@ function processStyle(testName, style) {

return clone;
}

// @ts-ignore
await generateFixtureJson(rootFixturePath, suitePath);
26 changes: 8 additions & 18 deletions build/readme.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,31 @@
# Build Scripts
This folder holds common build scripts accessed via the various `npm run` commands.

Codegen is executed when calling `npm install` in order to generate all artifacts needed for the build to pass
## Bundeling all the code

The bundeling process can be split into several steps:

`npx run tsc`
This command will transpile all the typescript files into javascript files and place them in the `rollup/build` folder.

`npm run build-glsl`
This command will copy all the shader files to the build output and convert the shaders into strings that can be imported to javascript.

`npm run build-css`
This command will compile the css code and create the css file.

`npm run build-prod` or `npm run build-prod-min` or `npm run build-dev`
These commands will use rollup to bundle the code. This is where the magic happens and uses some files in this folder.

`banner.js` is used to create a banner at the beginning of the output file
`banner.ts` is used to create a banner at the beginning of the output file

`rollup_plugins.js` is used to define common plugins for rollup configurations
`rollup_plugins.ts` is used to define common plugins for rollup configurations

`rollup_plugin_minify_style_spec.js` is used to specify the plugin used in style spec bundeling
`rollup_plugin_minify_style_spec.ts` is used to specify the plugin used in style spec bundeling

In the `rollup` folder there are some files that are used as linking files as they link to other files for rollup to pick when bundling.
Rollup also has a configuration in the `package.json` file to signal which files it needs to replace when bundling for the browser, this is where `web_worker_replacement.js` is used - as it replaces the node mocking of web worker that is present in the source code.

Rollup is generating 3 files throughout the process of bundling:

`index.js` a file containing all the code that will run in the main thread.
`index.ts` a file containing all the code that will run in the main thread.

`shared.js` a file containing all the code shared between the main and worker code.
`shared.ts` a file containing all the code shared between the main and worker code.

`worker.js` a file containing all the code the will run in the worker threads.
`worker.ts` a file containing all the code the will run in the worker threads.

These 3 files are then referenced and used by the `bundle_prelude.js` file. It allows loading the web wroker code automatically in web workers without any extra effort from someone who would like to use the library, i.e. it simply works.

Expand All @@ -55,8 +48,5 @@ Generates `style-spec/types.ts` based on the content of `v8.json`. This provides
<hr>

### Generate Release Nodes
The following files are being used to generate release notes:

`release-notes.js` Used to generate release notes when releasing a new version

`release-notes.md.ejs` Used for the generation as a template file
`release-notes.js` Used to generate release notes when releasing a new version