diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c851e09e4..cb2871db6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,12 +7,12 @@ on: jobs: check_branch: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest outputs: should_build: ${{ steps.permitted.outputs.result }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Fetch remote branches run: | @@ -42,16 +42,22 @@ jobs: NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: volta-cli/action@2d68418f32546fd191eb666e232b321d5726484d # v4.1.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Node.js + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 with: + node-version-file: '.nvmrc' cache: 'yarn' + - name: Enable Corepack + run: corepack enable yarn + - name: Install dependencies run: yarn - name: Build packages - run: npm run build + run: yarn build - name: Run tests from transpiled code run: npx ocular-test dist diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b888a496..b608d4fce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,19 +7,30 @@ on: - master pull_request: +permissions: + contents: read + jobs: test-node: runs-on: ubuntu-22.04 + permissions: + checks: write + contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: volta-cli/action@2d68418f32546fd191eb666e232b321d5726484d # v4.1.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Node.js + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 with: - cache: "yarn" + node-version-file: '.nvmrc' + cache: 'yarn' + + - name: Enable Corepack + run: corepack enable yarn - name: Install dependencies - run: | - yarn bootstrap + run: yarn bootstrap - name: Run tests env: @@ -29,6 +40,6 @@ jobs: yarn test ci - name: Coveralls - uses: coverallsapp/github-action@09b709cf6a16e30b0808ba050c7a6e8a5ef13f8d # v1.2.5 + uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index b4bd4c01c..23d3366ae 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -12,7 +12,7 @@ jobs: should_deploy: ${{ endsWith(github.ref, steps.get_version.outputs.latest) }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Get version id: get_version @@ -30,14 +30,18 @@ jobs: if: ${{ github.repository_owner == 'visgl' && needs.check_branch.outputs.should_deploy }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }} - - name: Use Node.js - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 + - name: Setup Node.js + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 with: - node-version: '18.x' + node-version-file: '.nvmrc' + cache: 'yarn' + + - name: Enable Corepack + run: corepack enable yarn - name: Install dependencies run: | diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..a9d087399 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +18.19.0 diff --git a/modules/react-maplibre/src/components/globe-control.ts b/modules/react-maplibre/src/components/globe-control.ts index 419c2592e..86e507307 100644 --- a/modules/react-maplibre/src/components/globe-control.ts +++ b/modules/react-maplibre/src/components/globe-control.ts @@ -1,8 +1,8 @@ -import * as React from "react"; -import { useEffect, memo } from "react"; -import { applyReactStyle } from "../utils/apply-react-style"; -import { useControl } from "./use-control"; -import { ControlPosition } from "../types/lib"; +import * as React from 'react'; +import {useEffect, memo} from 'react'; +import {applyReactStyle} from '../utils/apply-react-style'; +import {useControl} from './use-control'; +import {ControlPosition} from '../types/lib'; export type GlobeControlProps = { /** Placement of the control relative to the map. */ @@ -12,8 +12,8 @@ export type GlobeControlProps = { }; function _GlobeControl(props: GlobeControlProps) { - const ctrl = useControl(({ mapLib }) => new mapLib.GlobeControl(props), { - position: props.position, + const ctrl = useControl(({mapLib}) => new mapLib.GlobeControl(props), { + position: props.position }); useEffect(() => { diff --git a/modules/react-maplibre/src/types/lib.ts b/modules/react-maplibre/src/types/lib.ts index 40b36a372..7a58c459e 100644 --- a/modules/react-maplibre/src/types/lib.ts +++ b/modules/react-maplibre/src/types/lib.ts @@ -19,7 +19,7 @@ import type { TerrainSpecification, LogoControl, LogoControlOptions, - GlobeControl, + GlobeControl } from 'maplibre-gl'; export type {