diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4c4e36..ba5f223 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,6 +126,21 @@ jobs: - name: Install dependencies run: npm ci + - name: Set version from release tag + run: npm version ${{ github.event.release.tag_name }} --git-tag-version=false + + - name: Generate jsr.json from package.json + run: | + jq '{ + name: .name, + version: .version, + license: .license, + exports: "src/index.ts" + }' package.json > jsr.json + + - name: Publish to JSR + run: npx jsr publish + - name: Download build artifact uses: actions/download-artifact@v8 with: @@ -136,9 +151,6 @@ jobs: working-directory: ./package run: tar -xzf cldn-ip-0.0.0-dev.tgz - - name: Set version from release tag - run: npm version ${{ github.event.release.tag_name }} --git-tag-version=false - - name: Copy package.json to build package run: cp package.json package/package diff --git a/src/Subnet.ts b/src/Subnet.ts index 5b9527d..526caa4 100644 --- a/src/Subnet.ts +++ b/src/Subnet.ts @@ -1,5 +1,5 @@ /*! - * Copyright © 2024–2025 Cloudnode OÜ. + * Copyright © 2024–2026 Cloudnode OÜ. * * This file is part of @cldn/ip. * @@ -25,7 +25,7 @@ export class Subnet implements Network { /** * Subnet for IPv4-mapped IPv6 addresses (`::ffff:0.0.0.0/96`). */ - public static readonly IPV4_MAPPED_IPV6 = Subnet.fromCIDR( + public static readonly IPV4_MAPPED_IPV6: Subnet = Subnet.fromCIDR( "::ffff:0.0.0.0/96", ); diff --git a/src/SubnetList.ts b/src/SubnetList.ts index 9b94e33..5407627 100644 --- a/src/SubnetList.ts +++ b/src/SubnetList.ts @@ -1,5 +1,5 @@ /*! - * Copyright © 2024–2025 Cloudnode OÜ. + * Copyright © 2024–2026 Cloudnode OÜ. * * This file is part of @cldn/ip. * @@ -23,7 +23,7 @@ export class SubnetList implements Network { /** * A network of reserved subnets. This network does not contain publicly routable IP addresses. */ - public static readonly BOGON = new SubnetList([ + public static readonly BOGON: SubnetList = new SubnetList([ // IPv4 Subnet.fromCIDR("0.0.0.0/8"), Subnet.fromCIDR("10.0.0.0/8"), @@ -133,7 +133,7 @@ export class SubnetList implements Network { * @param subnet Subnet to remove. * @returns Whether the subnet was found and removed. */ - public remove(subnet: Subnet) { + public remove(subnet: Subnet): boolean { for (const [index, s] of this.#subnets.entries()) { if (s.equals(subnet)) { this.#subnets.splice(index, 1);