From 052a95231470a620f89c616ecafad2c9fb7875a0 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 8 May 2026 18:07:19 +0100 Subject: [PATCH 1/4] add nix dev shell --- .envrc | 1 + .gitignore | 3 ++- flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 36 ++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 4e34073..3bcc4be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ npm/ -.cov/ \ No newline at end of file +.cov/ +.direnv/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..64da7c7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1777988971, + "narHash": "sha256-qIoWPDs+0/8JecyYgE3gpKQxW/4bLW/gp45vow9ioCQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "0678d8986be1661af6bb555f3489f2fdfc31f6ff", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1777954456, + "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1777168982, + "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b03b0ac --- /dev/null +++ b/flake.nix @@ -0,0 +1,36 @@ +{ + description = "Description for the project"; + + inputs = { + flake-parts.url = "github:hercules-ci/flake-parts"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = inputs@{ flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + imports = [ + # To import an internal flake module: ./other.nix + # To import an external flake module: + # 1. Add foo to inputs + # 2. Add foo as a parameter to the outputs function + # 3. Add here: foo.flakeModule + + ]; + systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; + perSystem = { config, self', inputs', pkgs, system, ... }: { + devShells.default = pkgs.mkShellNoCC { + packages = with pkgs; [ + biome + deno + nodejs_24 + ]; + }; + }; + flake = { + # The usual flake attributes can be defined here, including system- + # agnostic ones like nixosModule and system-enumerating ones, although + # those are more easily expressed in perSystem. + + }; + }; +} From f2ada0a494db464430a7a906d88ec97557c10d2b Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 8 May 2026 18:07:26 +0100 Subject: [PATCH 2/4] fix: parent client auth Co-authored-by: Kevin --- src/core/parentClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/parentClient.ts b/src/core/parentClient.ts index 7cc30a3..8d155cb 100644 --- a/src/core/parentClient.ts +++ b/src/core/parentClient.ts @@ -62,7 +62,7 @@ export class ParentClient extends BaseClient { } const cookies = String(response.headers.get("set-cookie")); - // this.authCookies = cookies.split(";"); + this.authCookies = cookies.split(";"); const sessionCookies = parseCookies(cookies); const sessionID = JSON.parse( String(sessionCookies.parent_session_credentials), From 5ccf141f3f36774a569658a26869c4076547576d Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 8 May 2026 18:33:08 +0100 Subject: [PATCH 3/4] fix: update CI --- .github/workflows/release.yml | 31 ++++--- deno.jsonc | 2 +- deno.lock | 159 ++++++++++++---------------------- flake.nix | 1 + scripts/build_npm.ts | 3 - 5 files changed, 76 insertions(+), 120 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a91efcd..677d7bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,10 @@ on: push: tags: - "*" - workflow_dispatch: + +permissions: + id-token: write + contents: read concurrency: ${{ github.workflow }}-${{ github.ref }} @@ -12,29 +15,31 @@ jobs: release: name: Release runs-on: ubuntu-latest - permissions: - id-token: write + environment: Publish steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 - uses: denoland/setup-deno@v2 with: - deno-version: "v2.x" + deno-version: "latest" + - name: Get tag version if: startsWith(github.ref, 'refs/tags/') id: get_tag_version run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT - - uses: actions/setup-node@v4 + + - uses: actions/setup-node@v6 with: - node-version: "22" - registry-url: "https://registry.npmjs.org" - - uses: pnpm/action-setup@v4 + node-version: '24' + registry-url: 'https://registry.npmjs.org' + package-manager-cache: false # never use caching in release builds + + - uses: pnpm/action-setup@v6 with: - version: latest + version: 11 + - name: npm build run: deno task npm ${{steps.get_tag_version.outputs.TAG_VERSION}} - name: npm publish if: startsWith(github.ref, 'refs/tags/') - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: cd npm && npm publish --provenance + run: cd npm && npm publish --provenance --access public diff --git a/deno.jsonc b/deno.jsonc index 6753cd3..9f85d5f 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -6,7 +6,7 @@ }, "exclude": ["npm"], "imports": { - "@deno/dnt": "jsr:@deno/dnt@^0.41.3", + "@deno/dnt": "jsr:@deno/dnt@^0.42.3", "@std/assert": "jsr:@std/assert@^0.225.3" } } diff --git a/deno.lock b/deno.lock index cce0922..2b11198 100644 --- a/deno.lock +++ b/deno.lock @@ -1,165 +1,118 @@ { - "version": "4", + "version": "5", "specifiers": { - "jsr:@david/code-block-writer@^13.0.2": "13.0.3", - "jsr:@deno/cache-dir@~0.10.3": "0.10.3", - "jsr:@deno/dnt@~0.41.3": "0.41.3", - "jsr:@deno/graph@~0.73.1": "0.73.1", - "jsr:@std/assert@0.223": "0.223.0", - "jsr:@std/assert@0.226": "0.226.0", + "jsr:@david/code-block-writer@^13.0.3": "13.0.3", + "jsr:@deno/dnt@~0.42.3": "0.42.3", "jsr:@std/assert@~0.225.3": "0.225.3", - "jsr:@std/bytes@0.223": "0.223.0", - "jsr:@std/fmt@0.223": "0.223.0", - "jsr:@std/fmt@1": "1.0.2", - "jsr:@std/fs@0.223": "0.223.0", - "jsr:@std/fs@1": "1.0.4", - "jsr:@std/fs@~0.229.3": "0.229.3", + "jsr:@std/fmt@1": "1.0.10", + "jsr:@std/fs@1": "1.0.23", "jsr:@std/internal@1": "1.0.0", - "jsr:@std/io@0.223": "0.223.0", - "jsr:@std/path@0.223": "0.223.0", - "jsr:@std/path@1": "1.0.6", - "jsr:@std/path@1.0.0-rc.1": "1.0.0-rc.1", - "jsr:@std/path@^1.0.6": "1.0.6", - "jsr:@std/path@~0.225.2": "0.225.2", - "jsr:@ts-morph/bootstrap@0.24": "0.24.0", - "jsr:@ts-morph/common@0.24": "0.24.0", + "jsr:@std/internal@^1.0.12": "1.0.13", + "jsr:@std/path@1": "1.1.4", + "jsr:@std/path@^1.1.4": "1.1.4", + "jsr:@ts-morph/bootstrap@0.27": "0.27.0", + "jsr:@ts-morph/common@0.27": "0.27.0", "npm:@biomejs/biome@*": "1.4.0" }, "jsr": { "@david/code-block-writer@13.0.3": { "integrity": "f98c77d320f5957899a61bfb7a9bead7c6d83ad1515daee92dbacc861e13bb7f" }, - "@deno/cache-dir@0.10.3": { - "integrity": "eb022f84ecc49c91d9d98131c6e6b118ff63a29e343624d058646b9d50404776", - "dependencies": [ - "jsr:@deno/graph", - "jsr:@std/fmt@0.223", - "jsr:@std/fs@0.223", - "jsr:@std/io", - "jsr:@std/path@0.223" - ] - }, - "@deno/dnt@0.41.3": { - "integrity": "b2ef2c8a5111eef86cb5bfcae103d6a2938e8e649e2461634a7befb7fc59d6d2", + "@deno/dnt@0.42.3": { + "integrity": "62a917a0492f3c8af002dce90605bb0d41f7d29debc06aca40dba72ab65d8ae3", "dependencies": [ "jsr:@david/code-block-writer", - "jsr:@deno/cache-dir", - "jsr:@std/fmt@1", - "jsr:@std/fs@1", + "jsr:@std/fmt", + "jsr:@std/fs", "jsr:@std/path@1", "jsr:@ts-morph/bootstrap" ] }, - "@deno/graph@0.73.1": { - "integrity": "cd69639d2709d479037d5ce191a422eabe8d71bb68b0098344f6b07411c84d41" - }, - "@std/assert@0.223.0": { - "integrity": "eb8d6d879d76e1cc431205bd346ed4d88dc051c6366365b1af47034b0670be24" - }, "@std/assert@0.225.3": { "integrity": "b3c2847aecf6955b50644cdb9cf072004ea3d1998dd7579fc0acb99dbb23bd4f", "dependencies": [ - "jsr:@std/internal" + "jsr:@std/internal@1" ] }, - "@std/assert@0.226.0": { - "integrity": "0dfb5f7c7723c18cec118e080fec76ce15b4c31154b15ad2bd74822603ef75b3" + "@std/fmt@1.0.10": { + "integrity": "90dfba288802ac6de82fb31d0917eb9e4450b9925b954d5e51fc29ac07419db5" }, - "@std/bytes@0.223.0": { - "integrity": "84b75052cd8680942c397c2631318772b295019098f40aac5c36cead4cba51a8" - }, - "@std/fmt@0.223.0": { - "integrity": "6deb37794127dfc7d7bded2586b9fc6f5d50e62a8134846608baf71ffc1a5208" - }, - "@std/fmt@1.0.2": { - "integrity": "87e9dfcdd3ca7c066e0c3c657c1f987c82888eb8103a3a3baa62684ffeb0f7a7" - }, - "@std/fs@0.223.0": { - "integrity": "3b4b0550b2c524cbaaa5a9170c90e96cbb7354e837ad1bdaf15fc9df1ae9c31c" - }, - "@std/fs@0.229.3": { - "integrity": "783bca21f24da92e04c3893c9e79653227ab016c48e96b3078377ebd5222e6eb", + "@std/fs@1.0.23": { + "integrity": "3ecbae4ce4fee03b180fa710caff36bb5adb66631c46a6460aaad49515565a37", "dependencies": [ - "jsr:@std/path@1.0.0-rc.1" - ] - }, - "@std/fs@1.0.4": { - "integrity": "2907d32d8d1d9e540588fd5fe0ec21ee638134bd51df327ad4e443aaef07123c", - "dependencies": [ - "jsr:@std/path@^1.0.6" + "jsr:@std/internal@^1.0.12", + "jsr:@std/path@^1.1.4" ] }, "@std/internal@1.0.0": { "integrity": "ac6a6dfebf838582c4b4f61a6907374e27e05bedb6ce276e0f1608fe84e7cd9a" }, - "@std/io@0.223.0": { - "integrity": "2d8c3c2ab3a515619b90da2c6ff5ea7b75a94383259ef4d02116b228393f84f1", + "@std/internal@1.0.13": { + "integrity": "2f9546691d4ac2d32859c82dff284aaeac980ddeca38430d07941e7e288725c0" + }, + "@std/path@1.1.4": { + "integrity": "1d2d43f39efb1b42f0b1882a25486647cb851481862dc7313390b2bb044314b5", "dependencies": [ - "jsr:@std/assert@0.223", - "jsr:@std/bytes" + "jsr:@std/internal@^1.0.12" ] }, - "@std/path@0.223.0": { - "integrity": "593963402d7e6597f5a6e620931661053572c982fc014000459edc1f93cc3989", - "dependencies": [ - "jsr:@std/assert@0.223" - ] - }, - "@std/path@0.225.2": { - "integrity": "0f2db41d36b50ef048dcb0399aac720a5348638dd3cb5bf80685bf2a745aa506", - "dependencies": [ - "jsr:@std/assert@0.226" - ] - }, - "@std/path@1.0.0-rc.1": { - "integrity": "b8c00ae2f19106a6bb7cbf1ab9be52aa70de1605daeb2dbdc4f87a7cbaf10ff6" - }, - "@std/path@1.0.6": { - "integrity": "ab2c55f902b380cf28e0eec501b4906e4c1960d13f00e11cfbcd21de15f18fed" - }, - "@ts-morph/bootstrap@0.24.0": { - "integrity": "a826a2ef7fa8a7c3f1042df2c034d20744d94da2ee32bf29275bcd4dffd3c060", + "@ts-morph/bootstrap@0.27.0": { + "integrity": "b8d7bc8f7942ce853dde4161b28f9aa96769cef3d8eebafb379a81800b9e2448", "dependencies": [ "jsr:@ts-morph/common" ] }, - "@ts-morph/common@0.24.0": { - "integrity": "12b625b8e562446ba658cdbe9ad77774b4bd96b992ae8bd34c60dbf24d06c1f3", + "@ts-morph/common@0.27.0": { + "integrity": "c7b73592d78ce8479b356fd4f3d6ec3c460d77753a8680ff196effea7a939052", "dependencies": [ - "jsr:@std/fs@~0.229.3", - "jsr:@std/path@~0.225.2" + "jsr:@std/fs", + "jsr:@std/path@1" ] } }, "npm": { "@biomejs/biome@1.4.0": { "integrity": "sha512-/rDlao6ra38nhxo4IYCqWCzfTJcpMk4YHjSVBI9yN/ifdhnzSwirL25xDVH7G9hZdNhpF9g78FaPJhFa9DX0Cw==", - "dependencies": [ + "optionalDependencies": [ "@biomejs/cli-darwin-arm64", "@biomejs/cli-darwin-x64", "@biomejs/cli-linux-arm64", "@biomejs/cli-linux-x64", "@biomejs/cli-win32-arm64", "@biomejs/cli-win32-x64" - ] + ], + "scripts": true, + "bin": true }, "@biomejs/cli-darwin-arm64@1.4.0": { - "integrity": "sha512-nBrtVRwr4IlTtxLOHwBwLv1sWvggf9/DnT5/ALIANJZOpoING6u8jHWipods69wK8kGa8Ld7iwHm3W5BrJJFFQ==" + "integrity": "sha512-nBrtVRwr4IlTtxLOHwBwLv1sWvggf9/DnT5/ALIANJZOpoING6u8jHWipods69wK8kGa8Ld7iwHm3W5BrJJFFQ==", + "os": ["darwin"], + "cpu": ["arm64"] }, "@biomejs/cli-darwin-x64@1.4.0": { - "integrity": "sha512-nny0VgOj3ksUGzU5GblgtQEvrAZFgFe1IJBoYOP978OQdDrg7BpS+GX5udfof87Dl4ZlHPRBU951ceHOxF7BTg==" + "integrity": "sha512-nny0VgOj3ksUGzU5GblgtQEvrAZFgFe1IJBoYOP978OQdDrg7BpS+GX5udfof87Dl4ZlHPRBU951ceHOxF7BTg==", + "os": ["darwin"], + "cpu": ["x64"] }, "@biomejs/cli-linux-arm64@1.4.0": { - "integrity": "sha512-gyLkT/Yh9xfW1T9yjQs/2txkCeG0e+LRs0adLugMwN0ptcNTRyusBvUoiHnpB+9rS6hWu9ZCedGMNmKQ8v2GSw==" + "integrity": "sha512-gyLkT/Yh9xfW1T9yjQs/2txkCeG0e+LRs0adLugMwN0ptcNTRyusBvUoiHnpB+9rS6hWu9ZCedGMNmKQ8v2GSw==", + "os": ["linux"], + "cpu": ["arm64"] }, "@biomejs/cli-linux-x64@1.4.0": { - "integrity": "sha512-LIxTuU2zSbIHM9XDYjQphJ5UU8h2eS7yR8uIvGYSba7Qt9AKqfbenyVJTsVnoj1CXxxgKNVSc/wVmlOlGz5DBQ==" + "integrity": "sha512-LIxTuU2zSbIHM9XDYjQphJ5UU8h2eS7yR8uIvGYSba7Qt9AKqfbenyVJTsVnoj1CXxxgKNVSc/wVmlOlGz5DBQ==", + "os": ["linux"], + "cpu": ["x64"] }, "@biomejs/cli-win32-arm64@1.4.0": { - "integrity": "sha512-U2jT1/0wZLJIRqnU8qHAfi/A/+yUwlL3sYJgqs+wO0BbR22WGQZlj03u5FdpEoyLXdsLv1pbeIcjNp+V0NYXWA==" + "integrity": "sha512-U2jT1/0wZLJIRqnU8qHAfi/A/+yUwlL3sYJgqs+wO0BbR22WGQZlj03u5FdpEoyLXdsLv1pbeIcjNp+V0NYXWA==", + "os": ["win32"], + "cpu": ["arm64"] }, "@biomejs/cli-win32-x64@1.4.0": { - "integrity": "sha512-gN6DgyyBxIwoCovAUFJHFWVallb0cLosayDRtNyxU3MDv/atZxSXOWQezfVKBIbgmFPxYWJObd+awvbPYXwwww==" + "integrity": "sha512-gN6DgyyBxIwoCovAUFJHFWVallb0cLosayDRtNyxU3MDv/atZxSXOWQezfVKBIbgmFPxYWJObd+awvbPYXwwww==", + "os": ["win32"], + "cpu": ["x64"] } }, "remote": { @@ -383,7 +336,7 @@ }, "workspace": { "dependencies": [ - "jsr:@deno/dnt@~0.41.3", + "jsr:@deno/dnt@~0.42.3", "jsr:@std/assert@~0.225.3" ] } diff --git a/flake.nix b/flake.nix index b03b0ac..538a404 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,7 @@ biome deno nodejs_24 + pnpm ]; }; }; diff --git a/scripts/build_npm.ts b/scripts/build_npm.ts index f1abbb0..93a0c1f 100644 --- a/scripts/build_npm.ts +++ b/scripts/build_npm.ts @@ -55,8 +55,5 @@ await build({ async postBuild() { await Deno.copyFile("LICENSE", "npm/LICENSE"); await Deno.copyFile("README.md", "npm/README.md"); - using npmIgnoreFile = await Deno.open("npm/.npmignore", { append: true }); - const data = new TextEncoder().encode("deps/" + "\n" + "*.map" + "\n"); - npmIgnoreFile.write(data); }, }); From 4003c6bb53edaec4382c0b9dc561c482748d9dcd Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 8 May 2026 18:36:26 +0100 Subject: [PATCH 4/4] remove env --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 677d7bb..c03e949 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,6 @@ jobs: release: name: Release runs-on: ubuntu-latest - environment: Publish steps: - name: Checkout Repo uses: actions/checkout@v5