From 3b489d2fc91a04b8b9a33010c2734d5bef375b02 Mon Sep 17 00:00:00 2001 From: Astrid Date: Sat, 14 Aug 2021 11:42:54 +0200 Subject: [PATCH] Typescript: merge from main (#243) * Highlight backport rules * Add backport rules * Add backport rules * Use organization secret NPM_ORG_TOKEN (#231) * Fix link in README and CONTRIBUTING. Fix typo in README. (#237) * one yarn forgotten (#242) Co-authored-by: Marcel Normann Co-authored-by: Oliver Wipfli Co-authored-by: tunnelpuzzle <79618312+tunnelpuzzle@users.noreply.github.com> --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/publish-style-spec.yml | 2 +- .github/workflows/release.yml | 2 +- .gitignore | 1 + CONTRIBUTING.md | 4 ++++ README.md | 6 +++-- RELEASE-PROCESS.md | 2 +- package.json | 2 +- rollup/copy-glsl-files.js | 2 +- src/data/array_types.ts | 30 ------------------------ 10 files changed, 15 insertions(+), 38 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ae01612c97..22a9e61a56 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ - - [ ] confirm your changes do not include backports from Mapbox projects (unless with compliant license) + - [ ] confirm **your changes do not include backports from Mapbox projects** (unless with compliant license) - if you are not sure about this, please ask! - [ ] briefly describe the changes in this PR - [ ] include before/after visuals or gifs if this PR includes visual changes - [ ] write tests for all new functionality diff --git a/.github/workflows/publish-style-spec.yml b/.github/workflows/publish-style-spec.yml index 3d9539b662..fd081feba7 100644 --- a/.github/workflows/publish-style-spec.yml +++ b/.github/workflows/publish-style-spec.yml @@ -39,4 +39,4 @@ jobs: node -e "if(require('./package').version.includes('dev')) { process.exit(1) }" npm publish --access=public env: - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_ORG_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e6ecd5178..a1dd11a599 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -171,4 +171,4 @@ jobs: run: | yarn publish --non-interactive env: - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_ORG_TOKEN }} diff --git a/.gitignore b/.gitignore index e7d4205011..715d1ee3fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /rollup/build/ /types/ /dist/ +/dist_type/ *.es.js *.js.map node_modules diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15d798de3d..21d8560532 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,9 @@ Hi, and thanks in advance for contributing to MapLibre GL. Here's how we work. Please follow these conventions when submitting an issue or pull request. +## Do not violate Mapbox copyright! +In December 2020 Mapbox decided to publish future versions of mapbox-gl-js under a proprietary license. **You are not allowed to backport code from Mapbox projects which has been contributed under this new license**. Unauthorized backports are the biggest threat to the MapLibre project. If you are unsure about this issue, [please ask](https://github.com/maplibre/maplibre-gl-js/discussions)! + + ## Preparing your Development Environment ### OSX diff --git a/README.md b/README.md index 996be44784..dbd094d6f4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you depend on mapbox-gl directly, simply replace `mapbox-gl` with `maplibre-g } ``` -And replace ```mapboxgl``` with ```maplibregl``` in your JavaScript and optionannly in your HTML/CSS code: +And replace ```mapboxgl``` with ```maplibregl``` in your JavaScript and optionally in your HTML/CSS code: ```diff - var map = new mapboxgl.Map({ + var map = new maplibregl.Map({ @@ -43,7 +43,9 @@ If you depend on a free software alternative to `mapbox-gl-js`, please consider ### Thank you Mapbox 🙏🏽 -We'd like to acknowledge the amazing work Mapbox has contributed to open source. The open source community is sad to part ways with them, but we simultaneously feel grateful for everything they already contributed. `mapbox-gl-js` 1.x is an open source achievment which now lives on as `maplibre-gl`. We're proud to develop on the shoulders of giants, thank you Mapbox 🙇🏽‍♀️ +We'd like to acknowledge the amazing work Mapbox has contributed to open source. The open source community is sad to part ways with them, but we simultaneously feel grateful for everything they already contributed. `mapbox-gl-js` 1.x is an open source achievment which now lives on as `maplibre-gl`. We're proud to develop on the shoulders of giants, thank you Mapbox 🙇🏽‍♀️. + +Please keep in mind: Unauthorized backports are the biggest threat to the MapLibre project. It is unacceptable to backport code from mapbox-gl-js, which is not covered by the former BSD-3 license. If you are unsure about this issue, [please ask](https://github.com/maplibre/maplibre-gl-js/discussions)! ## License diff --git a/RELEASE-PROCESS.md b/RELEASE-PROCESS.md index 194e1c587c..8a15da9d55 100644 --- a/RELEASE-PROCESS.md +++ b/RELEASE-PROCESS.md @@ -28,4 +28,4 @@ Release candidate versions do not generate release notes. The changelog should be updated on every PR - there is a placeholder at the top of the document - and heading should be renamed to the same version which is going to be set in the version tag during release. -The workflow expects `NODE_AUTH_TOKEN` repo secret in order to push to NPM registry. +The workflow expects `${{ secrets.NPM_ORG_TOKEN }}` organization secret in order to push to NPM registry. diff --git a/package.json b/package.json index 3a55f58b63..cc31c1548e 100644 --- a/package.json +++ b/package.json @@ -181,8 +181,8 @@ "start-bench": "run-p watch-benchmarks start-server", "start-release": "run-s build-prod-min build-css print-release-url start-server", "diff-tarball": "cross-env build/run-node build/diff-tarball", - "prepare-publish": "git clean -fdx && yarn install", "lint": "eslint --ext \".ts,.js,.html\" --ignore-path .gitignore src build debug/*.html", + "prepare-publish": "git clean -fdx & npm install", "lint-docs": "documentation lint src/index.js", "lint-css": "stylelint 'src/css/maplibre-gl.css'", "test": "run-s lint lint-css lint-docs test-unit", diff --git a/rollup/copy-glsl-files.js b/rollup/copy-glsl-files.js index 15b22cd574..181accb84a 100644 --- a/rollup/copy-glsl-files.js +++ b/rollup/copy-glsl-files.js @@ -32,4 +32,4 @@ glob("./src/**/*.glsl", null, (err, files) => { fs.writeFileSync(fileName, content); } console.log(`Finished converting ${files.length} glsl files`); -}); \ No newline at end of file +}); diff --git a/src/data/array_types.ts b/src/data/array_types.ts index 315fb8bc39..4b865aaa35 100644 --- a/src/data/array_types.ts +++ b/src/data/array_types.ts @@ -850,16 +850,6 @@ register('StructArrayLayout4f16', StructArrayLayout4f16); class CollisionBoxStruct extends Struct { _structArray: CollisionBoxArray; - // anchorPointX: number; - // anchorPointY: number; - // x1: number; - // y1: number; - // x2: number; - // y2: number; - // featureIndex: number; - // sourceLayerIndex: number; - // bucketIndex: number; - // anchorPoint: Point; get anchorPointX() { return this._structArray.int16[this._pos2 + 0]; } get anchorPointY() { return this._structArray.int16[this._pos2 + 1]; } get x1() { return this._structArray.int16[this._pos2 + 2]; } @@ -895,23 +885,6 @@ register('CollisionBoxArray', CollisionBoxArray); class PlacedSymbolStruct extends Struct { _structArray: PlacedSymbolArray; - // anchorX: number; - // anchorY: number; - // glyphStartIndex: number; - // numGlyphs: number; - // vertexStartIndex: number; - // lineStartIndex: number; - // lineLength: number; - // segment: number; - // lowerSize: number; - // upperSize: number; - // lineOffsetX: number; - // lineOffsetY: number; - // writingMode: number; - // placedOrientation: number; - // hidden: number; - // crossTileID: number; - // associatedIconIndex: number; get anchorX() { return this._structArray.int16[this._pos2 + 0]; } get anchorY() { return this._structArray.int16[this._pos2 + 1]; } get glyphStartIndex() { return this._structArray.uint16[this._pos2 + 2]; } @@ -1031,9 +1004,6 @@ register('SymbolLineVertexArray', SymbolLineVertexArray); class FeatureIndexStruct extends Struct { _structArray: FeatureIndexArray; - // featureIndex: number; - // sourceLayerIndex: number; - // bucketIndex: number; get featureIndex() { return this._structArray.uint32[this._pos4 + 0]; } get sourceLayerIndex() { return this._structArray.uint16[this._pos2 + 2]; } get bucketIndex() { return this._structArray.uint16[this._pos2 + 3]; }