@maptiler/client 2.6.0-rc.2 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,51 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ pull_request:
8
+ types: [opened]
9
+
10
+ jobs:
11
+ build-and-publish:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Checkout repo
15
+ uses: actions/checkout@v4
16
+ with:
17
+ ref: ${{ github.event.release.target_commitish }}
18
+
19
+ - uses: actions/setup-node@v4
20
+ with:
21
+ node-version: 18
22
+ registry-url: https://registry.npmjs.org/
23
+
24
+ - name: Clear NPM cache
25
+ run: npm cache clean --force
26
+
27
+ - name: Install dependencies and build
28
+ run: npm ci
29
+
30
+ - name: Make release
31
+ run: npm run build
32
+ id: makeRelease
33
+
34
+ - name: Fail job if makeRelease failed
35
+ if: steps.makeRelease.outcome == 'failure'
36
+ run: exit 1
37
+
38
+ id: check-build-status
39
+ - name: Publish NPM package (regular)
40
+ if: "!github.event.release.prerelease"
41
+ run: |
42
+ npm publish --dry-run
43
+ env:
44
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}
45
+
46
+ - name: Publish NPM package (pre-release)
47
+ if: "github.event.release.prerelease"
48
+ run: |
49
+ npm publish --tag next --dry-run
50
+ env:
51
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}
@@ -11,13 +11,53 @@ jobs:
11
11
  build-and-publish:
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@v3
15
- - uses: actions/setup-node@v3
14
+ - name: Checkout repo
15
+ uses: actions/checkout@v4
16
+ with:
17
+ ref: ${{ github.event.release.target_commitish }}
18
+
19
+ - uses: actions/setup-node@v4
16
20
  with:
17
21
  node-version: 18
18
22
  registry-url: https://registry.npmjs.org/
19
- - run: npm ci
20
- - run: npm test
21
- - run: npm publish
23
+
24
+ - name: Clear NPM cache
25
+ run: npm cache clean --force
26
+
27
+ - name: Install dependencies and build
28
+ run: npm ci
29
+
30
+ - name: Make release
31
+ run: npm run build
32
+ id: makeRelease
33
+
34
+ - name: Fail job if makeRelease failed
35
+ if: steps.makeRelease.outcome == 'failure'
36
+ run: exit 1
37
+
38
+ id: check-build-status
39
+ - name: Publish NPM package (regular)
40
+ if: "!github.event.release.prerelease"
41
+ run: |
42
+ npm publish
22
43
  env:
23
44
  NODE_AUTH_TOKEN: ${{secrets.npm_token}}
45
+
46
+ - name: Publish NPM package (pre-release)
47
+ if: "github.event.release.prerelease"
48
+ run: |
49
+ npm publish --tag next
50
+ env:
51
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}
52
+ - name: Get Package version
53
+ id: version
54
+ run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
55
+ - name: Publish to CDN Cloudflar R2
56
+ uses: ryand56/r2-upload-action@v1.4
57
+ with:
58
+ r2-account-id: ${{ secrets.CDN_MAPTILER_ACCOUNT_ID }}
59
+ r2-access-key-id: ${{ secrets.CDN_MAPTILER_ACCESS_KEY_ID }}
60
+ r2-secret-access-key: ${{ secrets.CDN_MAPTILER_SECRET_ACCESS_KEY }}
61
+ r2-bucket: cdn-storage
62
+ source-dir: dist
63
+ destination-dir: client-js/v${{ env.PACKAGE_VERSION }}/
package/CHANGELOG.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # MapTiler Client Changelog
2
2
 
3
- ## NEXT
3
+ ## 2.6.0
4
4
  ### New Features
5
5
  - Bumps 'Streets' & 'Landscape' styles (and their variants) to new v4 styles.
6
6
  - Adds the new 'Base' style and its variants.
7
+ - Namespaces V4 and V2 Styles and adds mechanism for switching to defaults.
7
8
 
8
9
  ### Bug Fixes
9
10
  None
@@ -1381,8 +1381,7 @@ class MapStyleVariant {
1381
1381
  return expandMapStyle(this.getId());
1382
1382
  }
1383
1383
  warnIfDeprecated(variant = this) {
1384
- if (!variant.deprecated)
1385
- return variant;
1384
+ if (!variant.deprecated) return variant;
1386
1385
  if (variant.deprecationMessage) {
1387
1386
  console.warn(variant.deprecationMessage);
1388
1387
  } else {
@@ -2943,8 +2942,7 @@ async function at(position, options = {}) {
2943
2942
  return elevatedPositions[0];
2944
2943
  }
2945
2944
  async function batch(positions, options = {}) {
2946
- if (positions.length === 0)
2947
- return [];
2945
+ if (positions.length === 0) return [];
2948
2946
  const apiKey = options.apiKey ?? config.apiKey;
2949
2947
  const elevatedPositions = options.computeOn === "client" ? await computeOnClient(positions, apiKey, options.zoom) : await computeOnServer(positions, apiKey);
2950
2948
  if (options.smoothingKernelSize) {