From d8f28669f9b4bb6e8da161b551d2f469fd2eb34b Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Wed, 10 Jun 2026 12:54:47 +0100 Subject: [PATCH] Move the IDL to the repository root --- Makefile | 18 +++++++++--------- README.md | 2 +- codama.mjs | 2 +- program/idl.json => idl.json | 0 scripts/generate-idl.mjs | 3 ++- 5 files changed, 13 insertions(+), 12 deletions(-) rename program/idl.json => idl.json (100%) diff --git a/Makefile b/Makefile index 548e337..6b7f1c9 100644 --- a/Makefile +++ b/Makefile @@ -41,9 +41,18 @@ clippy-%: --deny=clippy::manual_let_else \ --deny=clippy::used_underscore_binding $(ARGS) +format-check-js-%: + cd $(call make-path,$*) && pnpm install && pnpm format $(ARGS) + format-check-%: cargo $(nightly) fmt --check --manifest-path $(call make-path,$*)/Cargo.toml $(ARGS) +lint-js-%: + cd $(call make-path,$*) && pnpm install && pnpm lint $(ARGS) + +test-js-%: + cd $(call make-path,$*) && pnpm install && pnpm build && pnpm test $(ARGS) + powerset-%: cargo $(nightly) hack check --feature-powerset --all-targets --manifest-path $(call make-path,$*)/Cargo.toml $(ARGS) @@ -77,15 +86,6 @@ build-doc-%: test-doc-%: cargo $(nightly) test --doc --all-features --manifest-path $(call make-path,$*)/Cargo.toml $(ARGS) -format-check-js-%: - cd $(call make-path,$*) && pnpm install && pnpm format $(ARGS) - -lint-js-%: - cd $(call make-path,$*) && pnpm install && pnpm lint $(ARGS) - -test-js-%: - cd $(call make-path,$*) && pnpm install && pnpm build && pnpm test $(ARGS) - test-%: SBF_OUT_DIR=$(PWD)/target/deploy cargo $(nightly) test --manifest-path $(call make-path,$*)/Cargo.toml $(ARGS) diff --git a/README.md b/README.md index 441ea16..a0f21da 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Solana Feature Gate Program - + diff --git a/codama.mjs b/codama.mjs index ad0bec0..0da8e2d 100644 --- a/codama.mjs +++ b/codama.mjs @@ -6,7 +6,7 @@ const nightly = cargo?.workspace?.metadata?.toolchains?.format; const prettierOptions = JSON.parse(readFileSync('clients/js/.prettierrc.json', 'utf-8')); export default { - idl: 'program/idl.json', + idl: 'idl.json', before: [ { from: 'codama#updateProgramsVisitor', diff --git a/program/idl.json b/idl.json similarity index 100% rename from program/idl.json rename to idl.json diff --git a/scripts/generate-idl.mjs b/scripts/generate-idl.mjs index 022a79e..f1441aa 100644 --- a/scripts/generate-idl.mjs +++ b/scripts/generate-idl.mjs @@ -4,6 +4,7 @@ import { generateIdl } from '@metaplex-foundation/shank-js'; import { cliArguments, getCargo, getProgramFolders } from './utils.mjs'; const binaryInstallDir = path.join(__dirname, '..', '.cargo'); +const rootDir = path.join(__dirname, '..'); const [folder] = cliArguments(); const cargo = getCargo(folder); @@ -14,7 +15,7 @@ generateIdl({ generator: isShank ? 'shank' : 'anchor', programName: cargo.package.name.replace(/-/g, '_'), programId: cargo.package.metadata.solana['program-id'], - idlDir: programDir, + idlDir: rootDir, idlName: 'idl', programDir, binaryInstallDir,