Skip to content

Commit 1afb9c3

Browse files
committed
chore: make names similar to github release
1 parent e52cd87 commit 1afb9c3

File tree

17 files changed

+81
-184
lines changed

17 files changed

+81
-184
lines changed
File renamed without changes.

npm/@foundry-rs/forge-darwin-x64/package.json renamed to npm/@foundry-rs/forge-darwin-amd64/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "@foundry-rs/forge-darwin-x64",
2+
"name": "@foundry-rs/forge-darwin-amd64",
33
"version": "1.2.3",
44
"type": "module",
55
"homepage": "https://getfoundry.sh",
6-
"description": "Fast and flexible Ethereum testing framework (macOS x64)",
6+
"description": "Fast and flexible Ethereum testing framework (macOS amd64)",
77
"bin": {
88
"forge": "./bin/forge"
99
},

npm/@foundry-rs/forge-darwin-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@foundry-rs/forge-darwin-arm64",
3-
"version": "1.2.3",
3+
"version": "1.3.0",
44
"type": "module",
55
"homepage": "https://getfoundry.sh",
66
"description": "Fast and flexible Ethereum testing framework (macOS arm64)",
File renamed without changes.

npm/@foundry-rs/forge-linux-x64/package.json renamed to npm/@foundry-rs/forge-linux-amd64/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "@foundry-rs/forge-linux-x64",
2+
"name": "@foundry-rs/forge-linux-amd64",
33
"version": "1.2.3",
44
"type": "module",
55
"homepage": "https://getfoundry.sh",
6-
"description": "Fast and flexible Ethereum testing framework (Linux x64)",
6+
"description": "Fast and flexible Ethereum testing framework (Linux amd64)",
77
"bin": {
88
"forge": "./bin/forge"
99
},
File renamed without changes.

npm/@foundry-rs/forge-win32-x64/package.json renamed to npm/@foundry-rs/forge-win32-amd64/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "@foundry-rs/forge-win32-x64",
2+
"name": "@foundry-rs/forge-win32-amd64",
33
"version": "1.2.3",
44
"type": "module",
55
"homepage": "https://getfoundry.sh",
6-
"description": "Fast and flexible Ethereum testing framework (Windows x64)",
6+
"description": "Fast and flexible Ethereum testing framework (Windows amd64)",
77
"bin": {
88
"forge": "./bin/forge"
99
},

npm/@foundry-rs/forge/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@foundry-rs/forge",
3-
"version": "1.2.3",
3+
"version": "1.3.0",
44
"type": "module",
55
"homepage": "https://getfoundry.sh",
66
"description": "Fast and flexible Ethereum testing framework",
@@ -19,11 +19,11 @@
1919
"postinstall": "node ./dist/install.mjs"
2020
},
2121
"optionalDependencies": {
22-
"@foundry-rs/forge-darwin-arm64": "1.2.3",
23-
"@foundry-rs/forge-darwin-amd64": "1.2.3",
24-
"@foundry-rs/forge-linux-arm64": "1.2.3",
25-
"@foundry-rs/forge-linux-x64": "1.2.3",
26-
"@foundry-rs/forge-win32-x64": "1.2.3"
22+
"@foundry-rs/forge-darwin-arm64": "1.3.0",
23+
"@foundry-rs/forge-darwin-amd64": "1.3.0",
24+
"@foundry-rs/forge-linux-arm64": "1.3.0",
25+
"@foundry-rs/forge-linux-amd64": "1.3.0",
26+
"@foundry-rs/forge-win32-amd64": "1.3.0"
2727
},
2828
"publishConfig": {
2929
"access": "public",

npm/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
22
"private": true,
3-
"version": "0.0.1",
4-
"imports": {
5-
"#package.json": "./package.json"
6-
},
73
"scripts": {
84
"build": "tsdown --config='tsdown.config.ts'",
95
"prepublishOnly": "bun build && bun run ./scripts/prepublish.ts"

npm/scripts/prepublish.ts

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,15 @@ async function main() {
4545
function getPlatformInfo() {
4646
const platform = Bun.env.PLATFORM_NAME as keyof typeof PLATFORM_MAP
4747
const arch = Bun.env.ARCH as keyof typeof ARCH_MAP
48-
49-
if (!platform || !arch) {
48+
49+
if (!platform || !arch)
5050
throw new Error('PLATFORM_NAME and ARCH environment variables are required')
51-
}
5251

5352
const npmPlatform = PLATFORM_MAP[platform]
5453
const npmArch = ARCH_MAP[arch]
55-
56-
if (!npmPlatform || !npmArch) {
54+
55+
if (!npmPlatform || !npmArch)
5756
throw new Error('Invalid platform or architecture')
58-
}
5957

6058
const { values } = NodeUtil.parseArgs({
6159
args: Bun.argv,
@@ -75,11 +73,10 @@ function getPlatformInfo() {
7573
function findForgeBinary(arch: string, platform: string, profile: string): string {
7674
const targetDir = TARGET_MAP[`${arch}-${platform}` as keyof typeof TARGET_MAP]
7775
const targetPath = NodePath.join(process.cwd(), '..', 'target', targetDir, profile, 'forge')
78-
79-
if (NodeFS.existsSync(targetPath)) {
76+
77+
if (NodeFS.existsSync(targetPath))
8078
return targetPath
81-
}
82-
79+
8380
return NodePath.join(process.cwd(), '..', 'target', 'release', 'forge')
8481
}
8582

@@ -88,43 +85,42 @@ async function cleanPackageDirectory(packagePath: string) {
8885
withFileTypes: true,
8986
recursive: true
9087
})
91-
88+
9289
items
9390
.filter(item => !PRESERVED_FILES.includes(item.name))
94-
.forEach(item => NodeFS.rmSync(NodePath.join(packagePath, item.name), {
95-
recursive: true,
96-
force: true
97-
}))
91+
.forEach(item =>
92+
NodeFS.rmSync(NodePath.join(packagePath, item.name), {
93+
recursive: true,
94+
force: true
95+
})
96+
)
9897

9998
console.info(colors.green, 'Cleaned up package directory', colors.reset)
10099
}
101100

102101
async function buildScripts() {
103102
const result = await Bun.$`bun x tsdown --config tsdown.config.ts`.nothrow().quiet()
104-
105-
if (result.exitCode !== 0) {
103+
104+
if (result.exitCode !== 0)
106105
throw new Error(`Failed to build scripts: ${result.stderr.toString()}`)
107-
}
108-
106+
109107
console.info(colors.green, result.stdout.toString(), colors.reset)
110108
}
111109

112110
async function copyBinary(forgeBinPath: string, packagePath: string, platform: string) {
113-
if (!(await Bun.file(forgeBinPath).exists())) {
111+
if (!(await Bun.file(forgeBinPath).exists()))
114112
throw new Error(`Source binary not found at ${forgeBinPath}`)
115-
}
116113

117114
const binaryName = platform === 'win32' ? 'forge.exe' : 'forge'
118115
const targetDir = NodePath.join('@foundry-rs', NodePath.basename(packagePath), 'bin')
119-
116+
120117
NodeFS.mkdirSync(targetDir, { recursive: true })
121-
118+
122119
const targetPath = NodePath.join(targetDir, binaryName)
123120
console.info(colors.green, `Copying ${forgeBinPath} to ${targetPath}`, colors.reset)
124-
121+
125122
await Bun.write(targetPath, Bun.file(forgeBinPath))
126-
127-
if (platform !== 'win32') {
123+
124+
if (platform !== 'win32')
128125
NodeFS.chmodSync(targetPath, 0o755)
129-
}
130126
}

0 commit comments

Comments
 (0)