Skip to content

Commit f83ecc0

Browse files
authored
Update from template (#15)
1 parent fa8b70a commit f83ecc0

File tree

9 files changed

+306
-326
lines changed

9 files changed

+306
-326
lines changed

.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ runs:
2929
- name: Setup Node.js
3030
uses: actions/setup-node@v4
3131
with:
32-
node-version: 18
32+
node-version: 20
3333
cache: 'pnpm'
3434

3535
- name: Install Dependencies
@@ -63,7 +63,7 @@ runs:
6363

6464
- name: Install Solana
6565
if: ${{ inputs.solana == 'true' }}
66-
uses: metaplex-foundation/actions/install-solana@v1
66+
uses: solana-program/actions/install-solana@v1
6767
with:
6868
version: ${{ env.SOLANA_VERSION }}
6969
cache: true

clients/js/package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,22 @@
3232
"access": "public",
3333
"registry": "https://registry.npmjs.org"
3434
},
35+
"repository": {
36+
"type": "git",
37+
"url": "git+https://github.com/solana-program/config.git"
38+
},
39+
"bugs": {
40+
"url": "https://github.com/solana-program/config/issues"
41+
},
42+
"homepage": "https://github.com/solana-program/config#readme",
3543
"license": "MIT",
3644
"peerDependencies": {
37-
"@solana/web3.js": "2.0.0-preview.4"
45+
"@solana/web3.js": "2.0.0-rc.1"
3846
},
3947
"devDependencies": {
4048
"@ava/typescript": "^4.1.0",
4149
"@solana/eslint-config-solana": "^3.0.3",
42-
"@solana/web3.js": "2.0.0-preview.4",
43-
"@solana/webcrypto-ed25519-polyfill": "2.0.0-preview.4",
50+
"@solana/web3.js": "2.0.0-rc.1",
4451
"@types/node": "^20",
4552
"@typescript-eslint/eslint-plugin": "^7.16.1",
4653
"@typescript-eslint/parser": "^7.16.1",
@@ -50,16 +57,12 @@
5057
"rimraf": "^5.0.5",
5158
"tsup": "^8.1.2",
5259
"typedoc": "^0.25.12",
53-
"typedoc-plugin-missing-exports": "^2.2.0",
5460
"typescript": "^5.5.3"
5561
},
5662
"ava": {
5763
"nodeArguments": [
5864
"--no-warnings"
5965
],
60-
"require": [
61-
"@solana/webcrypto-ed25519-polyfill"
62-
],
6366
"typescript": {
6467
"compile": false,
6568
"rewritePaths": {

clients/js/pnpm-lock.yaml

Lines changed: 259 additions & 278 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@
2525
"template:upgrade": "zx ./scripts/upgrade-template.mjs"
2626
},
2727
"devDependencies": {
28-
"@iarna/toml": "^2.2.5",
2928
"@codama/renderers-js": "^1.0.0",
3029
"@codama/renderers-rust": "^1.0.1",
30+
"@iarna/toml": "^2.2.5",
3131
"codama": "^1.0.0",
3232
"typescript": "^5.5.2",
3333
"zx": "^7.2.3"
3434
},
35+
"engines": {
36+
"node": ">=v20.0.0"
37+
},
3538
"packageManager": "[email protected]"
3639
}

scripts/client/test-rust.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import { cliArguments, workingDirectory } from '../utils.mjs';
77
const testArgs = cliArguments();
88

99
const hasSolfmt = await which('solfmt', { nothrow: true });
10+
const sbfOutDir = path.join(workingDirectory, 'target', 'deploy');
1011

1112
// Run the tests.
1213
cd(path.join(workingDirectory, 'clients', 'rust'));
1314
if (hasSolfmt) {
14-
await $`cargo test-sbf ${testArgs} 2>&1 | solfmt`;
15+
await $`SBF_OUT_DIR=${sbfOutDir} cargo test --features "test-sbf" ${testArgs} 2>&1 | solfmt`;
1516
} else {
16-
await $`cargo test-sbf ${testArgs}`;
17+
await $`SBF_OUT_DIR=${sbfOutDir} cargo test --features "test-sbf" ${testArgs}`;
1718
}

scripts/program/build.mjs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ const buildArgs = [
1818
];
1919

2020
// Build the programs.
21-
await Promise.all(
22-
getProgramFolders().map(async (folder) => {
23-
const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
21+
for (const folder of getProgramFolders()) {
22+
const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
2423

25-
await $`cargo-build-sbf --manifest-path ${manifestPath} ${buildArgs}`;
26-
})
27-
);
24+
await $`cargo-build-sbf --manifest-path ${manifestPath} ${buildArgs}`;
25+
}

scripts/program/format.mjs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ const [cargoArgs, fmtArgs] = partitionArguments(formatArgs, '--');
1818
const toolchain = getToolchainArgument('format');
1919

2020
// Format the programs.
21-
await Promise.all(
22-
getProgramFolders().map(async (folder) => {
23-
const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
21+
for (const folder of getProgramFolders()) {
22+
const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
2423

25-
if (fix) {
26-
await $`cargo ${toolchain} fmt --manifest-path ${manifestPath} ${cargoArgs} -- ${fmtArgs}`;
27-
} else {
28-
await $`cargo ${toolchain} fmt --manifest-path ${manifestPath} ${cargoArgs} -- --check ${fmtArgs}`;
29-
}
30-
})
31-
);
24+
if (fix) {
25+
await $`cargo ${toolchain} fmt --manifest-path ${manifestPath} ${cargoArgs} -- ${fmtArgs}`;
26+
} else {
27+
await $`cargo ${toolchain} fmt --manifest-path ${manifestPath} ${cargoArgs} -- --check ${fmtArgs}`;
28+
}
29+
}

scripts/program/lint.mjs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ const fix = popArgument(lintArgs, '--fix');
2525
const toolchain = getToolchainArgument('lint');
2626

2727
// Lint the programs using clippy.
28-
await Promise.all(
29-
getProgramFolders().map(async (folder) => {
30-
const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
28+
for (const folder of getProgramFolders()) {
29+
const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
3130

32-
if (fix) {
33-
await $`cargo ${toolchain} clippy --manifest-path ${manifestPath} --fix ${lintArgs}`;
34-
} else {
35-
await $`cargo ${toolchain} clippy --manifest-path ${manifestPath} ${lintArgs}`;
36-
}
37-
})
38-
);
31+
if (fix) {
32+
await $`cargo ${toolchain} clippy --manifest-path ${manifestPath} --fix ${lintArgs}`;
33+
} else {
34+
await $`cargo ${toolchain} clippy --manifest-path ${manifestPath} ${lintArgs}`;
35+
}
36+
}

scripts/program/test.mjs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ const testArgs = [
2020
const hasSolfmt = await which('solfmt', { nothrow: true });
2121

2222
// Test the programs.
23-
await Promise.all(
24-
getProgramFolders().map(async (folder) => {
25-
const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
23+
for (const folder of getProgramFolders()) {
24+
const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
2625

27-
if (hasSolfmt) {
28-
await $`RUST_LOG=error cargo test-sbf --manifest-path ${manifestPath} ${testArgs} 2>&1 | solfmt`;
29-
} else {
30-
await $`RUST_LOG=error cargo test-sbf --manifest-path ${manifestPath} ${testArgs}`;
31-
}
32-
})
33-
);
26+
if (hasSolfmt) {
27+
await $`RUST_LOG=error cargo test-sbf --manifest-path ${manifestPath} ${testArgs} 2>&1 | solfmt`;
28+
} else {
29+
await $`RUST_LOG=error cargo test-sbf --manifest-path ${manifestPath} ${testArgs}`;
30+
}
31+
}

0 commit comments

Comments
 (0)