Skip to content

Commit

Permalink
[terrain3d] Merge main (#1021)
Browse files Browse the repository at this point in the history
* Migrate expression tests to jest (#965)

* Revert "Move benchmarks to ES modules (#964)" (#969)

This reverts commit aa8ed9d.

* Migrate query tests from puppeteer to playwright (#966)

* Fix web worker in watch mode (#968)

* Fix web worker in watch mode

* Add webworker support throughout

* Don't change rollup for style-spec and benchmarks

* Revert "Don't change rollup for style-spec and benchmarks"

This reverts commit 62a7e14.

* Remove duplicate node-resolve configuration

* Simplify build pipeline (#961)

* Remove build-tsc compile step

* re-enable failing style-spec test

* cleanup

* cleanup

* fix style-spec-test

* Create codeql-analysis.yml

* Bump simple-get from 3.1.0 to 3.1.1 (#971)

Bumps [simple-get](https://github.com/feross/simple-get) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/feross/simple-get/releases)
- [Commits](feross/simple-get@v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: simple-get
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump nanoid from 3.1.30 to 3.2.0 (#973)

Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](ai/nanoid@3.1.30...3.2.0)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump cached-path-relative from 1.0.2 to 1.1.0 (#972)

Bumps [cached-path-relative](https://github.com/ashaffer/cached-path-relative) from 1.0.2 to 1.1.0.
- [Release notes](https://github.com/ashaffer/cached-path-relative/releases)
- [Commits](https://github.com/ashaffer/cached-path-relative/commits)

---
updated-dependencies:
- dependency-name: cached-path-relative
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Move browser test to playwright (#974)

* Bump ts-node for 3x faster postinstall (#975)

* Remove web worker replacement (#976)

* Attribution default open for osm (#795)

* Update CHANGELOG.md

* Revert "Update CHANGELOG.md"

This reverts commit 0b81a41.

* attribution fixes (from astridx)

a1272d9

b9b0370

* Update .gitignore

* fix missing new line lint complained about

* Revert "attribution fixes (from astridx)"

This reverts commit 2031d8e.

* Default compact to be open by default

Default compact button to be open by default, to make OpenStreetMap attibutions to show by default like mentioned in ( #205 )

This uses an idea from ( #205 (comment) ) to show compact open by default, but close it when dragged.

* remove test string I forgot to remove

* fix compact button showing when there are no attributions

* update whitespace trim to es6 syntax

* fixes after testing various states of compact

* revert back so it is open when starting in fullscreen

* revert .gitignore

* fix lint errors

* fix tests

Most of these fails because I made the compact button not show if attributes are empty.

The other test fail because when switching between >640 and <=640 the open attribute is now added

* lint

* Update package-lock.json

* Update package-lock.json

* Update CHANGELOG.md

* delete problematic files

* put back deleted files

* test/integration/assets/sprites/[email protected]

* restore files

Co-authored-by: acalcutt <[email protected]>

* Fix benchmarks (#984)

* Move bench under `test` folder (#979)

* Add typeof guard to performance variable (#986)

* Fixes #768

* Fix comment and add changelog

* Release 2.1.2 Version (#987)

* Release 2.1.2 Version

* Fix changelog according to comments

* Fix release.yml due to bench folder move (#988)

* lint function-url-quotes/ (#983)

* Bump to v2.1.3 - Fix postinstall error `ts-node` not found in non-dev installs (#991)

* Bump to v2.1.4 - Fix missing `postinstall.js` file in npm publish (#992)

* Bump to v2.1.5-pre.1 - Publish empty `postinstall.js` file (#994)

* Bump to v2.1.5 (#996)

* Bump to v2.1.6-pre.1 - Fix `dist/package.json` (#998)

* Bump to v2.1.6 (#999)

* prefix (#1004)

* correct done (#1006)

* Add adjustment to rendering glyphs (#1005)

* add topAdjustment for glyph

* add topAdjustment for glyph

* update changelog

* add issue number

* add alphabet and cjk text test #1002

* fix lint error

* Simplify render tests (#1003)

Fixes #1008 

* Initial commit - half of the tests are failing

* Missing file

* Remove template rendering

* Fix usage of localizeUrls

* Move harness and server to render folder, simplify render code to be sepcific.

* Move function outside and add some typings

* lint

* Add typings, move compare results outside

* Remove server usage and replace it by file system reading.

* Move xhr mocking to main flow

* Move functions outside the render function

* Move creation of tests to render.ts, added more typings

* Move suite implementation into main flow file, add some typings.

* lint

* Moved all logic to a single file that runs the render tests

* remove color from harness

* Remove jest run command

* Small fixes

* lint

* Cleanup

* More cleanup

* Remove harness and move it to a single file. Remove the jest version.

* Remove ignore related code and tests

* Remove ignore, add types

* Add more types

* lint

* Migrate actual image generation to not use Buffer

* lint

* Fix CI run

* Fix CI properly this time...

* Revert png change

* Revert only buffer usage

* Revert png and buffer

* Simplify png in mock file

* Move to use uint8array and change throshold

* Added diff info

* remove specific threshold from test as it fails

* Fix typo

* Fix according to code review

* Husky pre-commit do not fix lint (#1019)

* Fix css

* Use main package-lock.json

Co-authored-by: Birk Skyum <[email protected]>
Co-authored-by: Yuri Astrakhan <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Harel M <[email protected]>
Co-authored-by: Andrew Calcutt <[email protected]>
Co-authored-by: acalcutt <[email protected]>
Co-authored-by: vanilla-lake <[email protected]>
Co-authored-by: Astrid <[email protected]>
Co-authored-by: Kanahiro Iguchi <[email protected]>
  • Loading branch information
10 people authored Feb 24, 2022
1 parent 0aea4c6 commit 16bbd6d
Show file tree
Hide file tree
Showing 170 changed files with 10,852 additions and 11,648 deletions.
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 [email protected]
- 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
Loading

0 comments on commit 16bbd6d

Please sign in to comment.