From 7ec99c91e32c2e949cded4a58f2d4dbbcb47668a Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Thu, 24 Oct 2024 09:09:52 +0100 Subject: [PATCH] Update from template (#36) --- .github/actions/setup/action.yml | 2 +- clients/js/package.json | 10 ++++++++-- clients/js/pnpm-lock.yaml | 12 ------------ package.json | 5 ++++- scripts/client/test-rust.mjs | 5 +++-- scripts/program/build.mjs | 10 ++++------ scripts/program/format.mjs | 18 ++++++++---------- scripts/program/lint.mjs | 20 +++++++++----------- scripts/program/test.mjs | 18 ++++++++---------- 9 files changed, 45 insertions(+), 55 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 90c1bf5..a547a7b 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -63,7 +63,7 @@ runs: - name: Install Solana if: ${{ inputs.solana == 'true' }} - uses: metaplex-foundation/actions/install-solana@v1 + uses: solana-program/actions/install-solana@v1 with: version: ${{ env.SOLANA_VERSION }} cache: true diff --git a/clients/js/package.json b/clients/js/package.json index 54253cc..c4a5525 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -32,8 +32,15 @@ "access": "public", "registry": "https://registry.npmjs.org" }, - "repository": "https://github.com/solana-program/address-lookup-table.git", "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "git+https://github.com/solana-program/address-lookup-table.git" + }, + "bugs": { + "url": "https://github.com/solana-program/address-lookup-table/issues" + }, + "homepage": "https://github.com/solana-program/address-lookup-table#readme", "peerDependencies": { "@solana/web3.js": "2.0.0-rc.1" }, @@ -50,7 +57,6 @@ "rimraf": "^5.0.5", "tsup": "^8.1.2", "typedoc": "^0.25.12", - "typedoc-plugin-missing-exports": "^2.2.0", "typescript": "^5.5.3" }, "ava": { diff --git a/clients/js/pnpm-lock.yaml b/clients/js/pnpm-lock.yaml index a159a4d..df1af18 100644 --- a/clients/js/pnpm-lock.yaml +++ b/clients/js/pnpm-lock.yaml @@ -44,9 +44,6 @@ importers: typedoc: specifier: ^0.25.12 version: 0.25.12(typescript@5.5.3) - typedoc-plugin-missing-exports: - specifier: ^2.2.0 - version: 2.2.0(typedoc@0.25.12(typescript@5.5.3)) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -1877,11 +1874,6 @@ packages: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} - typedoc-plugin-missing-exports@2.2.0: - resolution: {integrity: sha512-2+XR1IcyQ5UwXZVJe9NE6HrLmNufT9i5OwoIuuj79VxuA3eYq+Y6itS9rnNV1D7UeQnUSH8kISYD73gHE5zw+w==} - peerDependencies: - typedoc: 0.24.x || 0.25.x - typedoc@0.25.12: resolution: {integrity: sha512-F+qhkK2VoTweDXd1c42GS/By2DvI2uDF4/EpG424dTexSHdtCH52C6IcAvMA6jR3DzAWZjHpUOW+E02kyPNUNw==} engines: {node: '>= 16'} @@ -3886,10 +3878,6 @@ snapshots: type-fest@0.20.2: {} - typedoc-plugin-missing-exports@2.2.0(typedoc@0.25.12(typescript@5.5.3)): - dependencies: - typedoc: 0.25.12(typescript@5.5.3) - typedoc@0.25.12(typescript@5.5.3): dependencies: lunr: 2.3.9 diff --git a/package.json b/package.json index 2afc50b..7ea548e 100644 --- a/package.json +++ b/package.json @@ -24,12 +24,15 @@ "template:upgrade": "zx ./scripts/upgrade-template.mjs" }, "devDependencies": { - "@iarna/toml": "^2.2.5", "@codama/renderers-js": "^1.0.0", "@codama/renderers-rust": "^1.0.0", + "@iarna/toml": "^2.2.5", "codama": "^1.0.0", "typescript": "^5.5.2", "zx": "^7.2.3" }, + "engines": { + "node": ">=v20.0.0" + }, "packageManager": "pnpm@9.1.0" } diff --git a/scripts/client/test-rust.mjs b/scripts/client/test-rust.mjs index 48e2a30..699acb1 100644 --- a/scripts/client/test-rust.mjs +++ b/scripts/client/test-rust.mjs @@ -7,11 +7,12 @@ import { cliArguments, workingDirectory } from '../utils.mjs'; const testArgs = cliArguments(); const hasSolfmt = await which('solfmt', { nothrow: true }); +const sbfOutDir = path.join(workingDirectory, 'target', 'deploy'); // Run the tests. cd(path.join(workingDirectory, 'clients', 'rust')); if (hasSolfmt) { - await $`cargo test-sbf ${testArgs} 2>&1 | solfmt`; + await $`SBF_OUT_DIR=${sbfOutDir} cargo test --features "test-sbf" ${testArgs} 2>&1 | solfmt`; } else { - await $`cargo test-sbf ${testArgs}`; + await $`SBF_OUT_DIR=${sbfOutDir} cargo test --features "test-sbf" ${testArgs}`; } diff --git a/scripts/program/build.mjs b/scripts/program/build.mjs index a2f868f..7e33f14 100644 --- a/scripts/program/build.mjs +++ b/scripts/program/build.mjs @@ -13,10 +13,8 @@ import './dump.mjs'; const buildArgs = ['--features', 'bpf-entrypoint', ...cliArguments()]; // Build the programs. -await Promise.all( - getProgramFolders().map(async (folder) => { - const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml'); +for (const folder of getProgramFolders()) { + const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml'); - await $`cargo-build-sbf --manifest-path ${manifestPath} ${buildArgs}`; - }) -); + await $`cargo-build-sbf --manifest-path ${manifestPath} ${buildArgs}`; +} diff --git a/scripts/program/format.mjs b/scripts/program/format.mjs index 9ff5a04..c73ddd4 100644 --- a/scripts/program/format.mjs +++ b/scripts/program/format.mjs @@ -18,14 +18,12 @@ const [cargoArgs, fmtArgs] = partitionArguments(formatArgs, '--'); const toolchain = getToolchainArgument('format'); // Format the programs. -await Promise.all( - getProgramFolders().map(async (folder) => { - const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml'); +for (const folder of getProgramFolders()) { + const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml'); - if (fix) { - await $`cargo ${toolchain} fmt --manifest-path ${manifestPath} ${cargoArgs} -- ${fmtArgs}`; - } else { - await $`cargo ${toolchain} fmt --manifest-path ${manifestPath} ${cargoArgs} -- --check ${fmtArgs}`; - } - }) -); + if (fix) { + await $`cargo ${toolchain} fmt --manifest-path ${manifestPath} ${cargoArgs} -- ${fmtArgs}`; + } else { + await $`cargo ${toolchain} fmt --manifest-path ${manifestPath} ${cargoArgs} -- --check ${fmtArgs}`; + } +} diff --git a/scripts/program/lint.mjs b/scripts/program/lint.mjs index 4df27c8..39cf804 100644 --- a/scripts/program/lint.mjs +++ b/scripts/program/lint.mjs @@ -20,17 +20,15 @@ const lintArgs = [ ]; const fix = popArgument(lintArgs, '--fix'); -const toolchain = getToolchainArgument('format'); +const toolchain = getToolchainArgument('lint'); // Lint the programs using clippy. -await Promise.all( - getProgramFolders().map(async (folder) => { - const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml'); +for (const folder of getProgramFolders()) { + const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml'); - if (fix) { - await $`cargo ${toolchain} clippy --manifest-path ${manifestPath} --fix ${lintArgs}`; - } else { - await $`cargo ${toolchain} clippy --manifest-path ${manifestPath} ${lintArgs}`; - } - }) -); + if (fix) { + await $`cargo ${toolchain} clippy --manifest-path ${manifestPath} --fix ${lintArgs}`; + } else { + await $`cargo ${toolchain} clippy --manifest-path ${manifestPath} ${lintArgs}`; + } +} diff --git a/scripts/program/test.mjs b/scripts/program/test.mjs index a82daad..ce29bc7 100644 --- a/scripts/program/test.mjs +++ b/scripts/program/test.mjs @@ -15,14 +15,12 @@ const testArgs = ['--features', 'bpf-entrypoint', ...cliArguments()]; const hasSolfmt = await which('solfmt', { nothrow: true }); // Test the programs. -await Promise.all( - getProgramFolders().map(async (folder) => { - const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml'); +for (const folder of getProgramFolders()) { + const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml'); - if (hasSolfmt) { - await $`RUST_LOG=error cargo test-sbf --manifest-path ${manifestPath} ${testArgs} 2>&1 | solfmt`; - } else { - await $`RUST_LOG=error cargo test-sbf --manifest-path ${manifestPath} ${testArgs}`; - } - }) -); + if (hasSolfmt) { + await $`RUST_LOG=error cargo test-sbf --manifest-path ${manifestPath} ${testArgs} 2>&1 | solfmt`; + } else { + await $`RUST_LOG=error cargo test-sbf --manifest-path ${manifestPath} ${testArgs}`; + } +}