Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into webgl2
Browse files Browse the repository at this point in the history
  • Loading branch information
rotu committed May 6, 2023
2 parents 58680d9 + 37b10a4 commit db8a10e
Show file tree
Hide file tree
Showing 120 changed files with 3,032 additions and 1,008 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"no-multiple-empty-lines": [ "error", {
"max": 1
}],
"import/no-anonymous-default-export": ["error", {"allowLiteral": true} ],
"import/no-relative-packages": ["error"],
"jsdoc/check-param-names": "warn",
"jsdoc/require-param": "warn",
"jsdoc/require-param-description": "warn",
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/dependabot-auto-merge.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Get version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.2.3
uses: martinbeentjes/npm-get-version-action@v1.3.1

- name: Check tag does not exist yet
run: if git rev-list v${{ steps.package-version.outputs.current-version }}; then echo "Tag already exists. Aborting the release process."; exit 1; fi
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ jobs:
path: ${{ github.workspace }}/coverage
- run: npm run build-dev
if: success() || failure()
- run: npm run test-render
- run: npm run test-render -- --report
if: success() || failure()
- name: Upload render test failure
if: failure()
uses: actions/upload-artifact@v3
with:
name: render-test-report-${{ matrix.os }}
path: ${{ github.workspace }}/test/integration/render/results.html
- run: npm run build-dist
if: success() || failure()
- run: npm run jest-ci -- --selectProjects integration
Expand Down
3 changes: 0 additions & 3 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"extends": "stylelint-config-standard",
"rules": {
"indentation": 4,
"declaration-block-semicolon-newline-after": "always-multi-line",
"block-opening-brace-space-before": "always-multi-line",
"declaration-block-single-line-max-declarations": 3,
"selector-class-pattern": "maplibregl-[a-z-]+",
"at-rule-no-unknown": [true, {
Expand Down
153 changes: 67 additions & 86 deletions CHANGELOG.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ Try
- Run `arch -arm64 brew install pkg-config cairo pango libpng jpeg giflib librsvg`
- delete `node_modules` folder and re-run `npm install`

### Linux
### Linux (and by extension Github codespaces)

Install [git](https://git-scm.com/), [GNU Make](http://www.gnu.org/software/make/), and libglew-dev
```bash
sudo apt-get update &&
sudo apt-get install build-essential git libglew-dev libxi-dev default-jre default-jdk
sudo apt-get install build-essential git libglew-dev libxi-dev default-jre default-jdk xvfb
```

If prebuilt binaries for canvas and gl aren’t available, you will also need:
Expand All @@ -106,9 +106,9 @@ Install [nvm](https://github.com/nvm-sh/nvm)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
```

Install [Node.js](https://nodejs.org/) ^18
Install [Node.js](https://nodejs.org/) from .nvmrc
```
nvm install 18
nvm install
```

Clone the repository
Expand Down
20 changes: 10 additions & 10 deletions build/generate-shaders.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from 'fs';
import glob from 'glob';
import {globSync} from 'glob';
import path from 'path';

console.log('Generating shaders');

Expand All @@ -11,15 +12,14 @@ console.log('Generating shaders');
* It will also create a simple package.json file to allow importing this package in webpack
*/

glob('./src/shaders/*.glsl', null, (_err, files) => {
for (const file of files) {
const code = fs.readFileSync(file, 'utf8');
const content = glslToTs(code);
const fileName = `./src/shaders/${file.split('/').splice(-1)}.g.ts`;
fs.writeFileSync(fileName, content);
}
console.log(`Finished converting ${files.length} glsl files`);
});
const files = globSync('./src/shaders/*.glsl');
for (const file of files) {
const code = fs.readFileSync(file, 'utf8');
const content = glslToTs(code);
const fileName = path.join('.', 'src', 'shaders', `${file.split(path.sep).splice(-1)}.g.ts`);
fs.writeFileSync(fileName, content);
}
console.log(`Finished converting ${files.length} glsl files`);

function glslToTs(code: string): string {
code = code
Expand Down
10 changes: 5 additions & 5 deletions build/generate-style-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ export type ${layerType}LayoutPropsPossiblyEvaluated = {`);
output.push(
`};
const layout: Properties<${layerType}LayoutProps> = new Properties({`);
let layout: Properties<${layerType}LayoutProps>;
const getLayout = () => layout = layout || new Properties({`);

for (const property of layoutProperties) {
output.push(
Expand Down Expand Up @@ -263,7 +264,8 @@ export type ${layerType}PaintPropsPossiblyEvaluated = {`);

output.push(
`
const paint: Properties<${layerType}PaintProps> = new Properties({`);
let paint: Properties<${layerType}PaintProps>;
const getPaint = () => paint = paint || new Properties({`);

for (const property of paintProperties) {
output.push(
Expand All @@ -273,9 +275,7 @@ const paint: Properties<${layerType}PaintProps> = new Properties({`);
output.push(
`});
export default ({ paint${layoutProperties.length ? ', layout' : ''} } as {
paint: Properties<${layerType}PaintProps>${layoutProperties.length ? `,\n layout: Properties<${layerType}LayoutProps>` : ''}
});`);
export default ({ get paint() { return getPaint() }${layoutProperties.length ? ', get layout() { return getLayout() }' : ''} });`);

return output.join('\n');
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.

0 comments on commit db8a10e

Please sign in to comment.