Skip to content

Commit

Permalink
refactor(node-binding): renaming package @webview-bundle/binding in…
Browse files Browse the repository at this point in the history
…to `@webview-bundle/node-binding` (#7)

## Summary

Change the package name to a more clear naming.

## Test Plan

CI should pass
  • Loading branch information
seokju-na authored Oct 10, 2024
1 parent 02dada9 commit 94bf8de
Show file tree
Hide file tree
Showing 38 changed files with 84 additions and 84 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["crates/*", "packages/cli", "packages/binding"]
members = ["crates/*", "packages/cli", "packages/node-binding"]
resolver = "2"

[workspace.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions artifacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"dist": "crates/webview-bundle-cli/artifacts"
},
{
"source": "packages/binding/*.node",
"dist": "packages/binding/artifacts"
"source": "packages/node-binding/*.node",
"dist": "packages/node-binding/artifacts"
},
{
"source": "packages/cli/*.node",
Expand Down
4 changes: 2 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"*.json",
"packages/cli/index.js",
"packages/cli/index.d.ts",
"packages/binding/binding.js",
"packages/binding/binding.d.ts"
"packages/node-binding/binding.js",
"packages/node-binding/binding.d.ts"
]
},
"formatter": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
edition = "2021"
name = "webview-bundle-binding"
name = "webview-bundle-node-binding"
publish = false
version = "0.1.0"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
108 changes: 54 additions & 54 deletions packages/binding/binding.js → packages/node-binding/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@ switch (platform) {
case 'android':
switch (arch) {
case 'arm64':
localFileExisted = existsSync(join(__dirname, 'binding.android-arm64.node'))
localFileExisted = existsSync(join(__dirname, 'node-binding.android-arm64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./binding.android-arm64.node')
nativeBinding = require('./node-binding.android-arm64.node')
} else {
nativeBinding = require('@webview-bundle/binding-android-arm64')
nativeBinding = require('@webview-bundle/node-binding-android-arm64')
}
} catch (e) {
loadError = e
}
break
case 'arm':
localFileExisted = existsSync(join(__dirname, 'binding.android-arm-eabi.node'))
localFileExisted = existsSync(join(__dirname, 'node-binding.android-arm-eabi.node'))
try {
if (localFileExisted) {
nativeBinding = require('./binding.android-arm-eabi.node')
nativeBinding = require('./node-binding.android-arm-eabi.node')
} else {
nativeBinding = require('@webview-bundle/binding-android-arm-eabi')
nativeBinding = require('@webview-bundle/node-binding-android-arm-eabi')
}
} catch (e) {
loadError = e
Expand All @@ -63,41 +63,41 @@ switch (platform) {
switch (arch) {
case 'x64':
localFileExisted = existsSync(
join(__dirname, 'binding.win32-x64-msvc.node')
join(__dirname, 'node-binding.win32-x64-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.win32-x64-msvc.node')
nativeBinding = require('./node-binding.win32-x64-msvc.node')
} else {
nativeBinding = require('@webview-bundle/binding-win32-x64-msvc')
nativeBinding = require('@webview-bundle/node-binding-win32-x64-msvc')
}
} catch (e) {
loadError = e
}
break
case 'ia32':
localFileExisted = existsSync(
join(__dirname, 'binding.win32-ia32-msvc.node')
join(__dirname, 'node-binding.win32-ia32-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.win32-ia32-msvc.node')
nativeBinding = require('./node-binding.win32-ia32-msvc.node')
} else {
nativeBinding = require('@webview-bundle/binding-win32-ia32-msvc')
nativeBinding = require('@webview-bundle/node-binding-win32-ia32-msvc')
}
} catch (e) {
loadError = e
}
break
case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'binding.win32-arm64-msvc.node')
join(__dirname, 'node-binding.win32-arm64-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.win32-arm64-msvc.node')
nativeBinding = require('./node-binding.win32-arm64-msvc.node')
} else {
nativeBinding = require('@webview-bundle/binding-win32-arm64-msvc')
nativeBinding = require('@webview-bundle/node-binding-win32-arm64-msvc')
}
} catch (e) {
loadError = e
Expand All @@ -108,37 +108,37 @@ switch (platform) {
}
break
case 'darwin':
localFileExisted = existsSync(join(__dirname, 'binding.darwin-universal.node'))
localFileExisted = existsSync(join(__dirname, 'node-binding.darwin-universal.node'))
try {
if (localFileExisted) {
nativeBinding = require('./binding.darwin-universal.node')
nativeBinding = require('./node-binding.darwin-universal.node')
} else {
nativeBinding = require('@webview-bundle/binding-darwin-universal')
nativeBinding = require('@webview-bundle/node-binding-darwin-universal')
}
break
} catch {}
switch (arch) {
case 'x64':
localFileExisted = existsSync(join(__dirname, 'binding.darwin-x64.node'))
localFileExisted = existsSync(join(__dirname, 'node-binding.darwin-x64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./binding.darwin-x64.node')
nativeBinding = require('./node-binding.darwin-x64.node')
} else {
nativeBinding = require('@webview-bundle/binding-darwin-x64')
nativeBinding = require('@webview-bundle/node-binding-darwin-x64')
}
} catch (e) {
loadError = e
}
break
case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'binding.darwin-arm64.node')
join(__dirname, 'node-binding.darwin-arm64.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.darwin-arm64.node')
nativeBinding = require('./node-binding.darwin-arm64.node')
} else {
nativeBinding = require('@webview-bundle/binding-darwin-arm64')
nativeBinding = require('@webview-bundle/node-binding-darwin-arm64')
}
} catch (e) {
loadError = e
Expand All @@ -152,12 +152,12 @@ switch (platform) {
if (arch !== 'x64') {
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
}
localFileExisted = existsSync(join(__dirname, 'binding.freebsd-x64.node'))
localFileExisted = existsSync(join(__dirname, 'node-binding.freebsd-x64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./binding.freebsd-x64.node')
nativeBinding = require('./node-binding.freebsd-x64.node')
} else {
nativeBinding = require('@webview-bundle/binding-freebsd-x64')
nativeBinding = require('@webview-bundle/node-binding-freebsd-x64')
}
} catch (e) {
loadError = e
Expand All @@ -168,26 +168,26 @@ switch (platform) {
case 'x64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'binding.linux-x64-musl.node')
join(__dirname, 'node-binding.linux-x64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.linux-x64-musl.node')
nativeBinding = require('./node-binding.linux-x64-musl.node')
} else {
nativeBinding = require('@webview-bundle/binding-linux-x64-musl')
nativeBinding = require('@webview-bundle/node-binding-linux-x64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'binding.linux-x64-gnu.node')
join(__dirname, 'node-binding.linux-x64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.linux-x64-gnu.node')
nativeBinding = require('./node-binding.linux-x64-gnu.node')
} else {
nativeBinding = require('@webview-bundle/binding-linux-x64-gnu')
nativeBinding = require('@webview-bundle/node-binding-linux-x64-gnu')
}
} catch (e) {
loadError = e
Expand All @@ -197,26 +197,26 @@ switch (platform) {
case 'arm64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'binding.linux-arm64-musl.node')
join(__dirname, 'node-binding.linux-arm64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.linux-arm64-musl.node')
nativeBinding = require('./node-binding.linux-arm64-musl.node')
} else {
nativeBinding = require('@webview-bundle/binding-linux-arm64-musl')
nativeBinding = require('@webview-bundle/node-binding-linux-arm64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'binding.linux-arm64-gnu.node')
join(__dirname, 'node-binding.linux-arm64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.linux-arm64-gnu.node')
nativeBinding = require('./node-binding.linux-arm64-gnu.node')
} else {
nativeBinding = require('@webview-bundle/binding-linux-arm64-gnu')
nativeBinding = require('@webview-bundle/node-binding-linux-arm64-gnu')
}
} catch (e) {
loadError = e
Expand All @@ -226,26 +226,26 @@ switch (platform) {
case 'arm':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'binding.linux-arm-musleabihf.node')
join(__dirname, 'node-binding.linux-arm-musleabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.linux-arm-musleabihf.node')
nativeBinding = require('./node-binding.linux-arm-musleabihf.node')
} else {
nativeBinding = require('@webview-bundle/binding-linux-arm-musleabihf')
nativeBinding = require('@webview-bundle/node-binding-linux-arm-musleabihf')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'binding.linux-arm-gnueabihf.node')
join(__dirname, 'node-binding.linux-arm-gnueabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.linux-arm-gnueabihf.node')
nativeBinding = require('./node-binding.linux-arm-gnueabihf.node')
} else {
nativeBinding = require('@webview-bundle/binding-linux-arm-gnueabihf')
nativeBinding = require('@webview-bundle/node-binding-linux-arm-gnueabihf')
}
} catch (e) {
loadError = e
Expand All @@ -255,26 +255,26 @@ switch (platform) {
case 'riscv64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'binding.linux-riscv64-musl.node')
join(__dirname, 'node-binding.linux-riscv64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.linux-riscv64-musl.node')
nativeBinding = require('./node-binding.linux-riscv64-musl.node')
} else {
nativeBinding = require('@webview-bundle/binding-linux-riscv64-musl')
nativeBinding = require('@webview-bundle/node-binding-linux-riscv64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'binding.linux-riscv64-gnu.node')
join(__dirname, 'node-binding.linux-riscv64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.linux-riscv64-gnu.node')
nativeBinding = require('./node-binding.linux-riscv64-gnu.node')
} else {
nativeBinding = require('@webview-bundle/binding-linux-riscv64-gnu')
nativeBinding = require('@webview-bundle/node-binding-linux-riscv64-gnu')
}
} catch (e) {
loadError = e
Expand All @@ -283,13 +283,13 @@ switch (platform) {
break
case 's390x':
localFileExisted = existsSync(
join(__dirname, 'binding.linux-s390x-gnu.node')
join(__dirname, 'node-binding.linux-s390x-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./binding.linux-s390x-gnu.node')
nativeBinding = require('./node-binding.linux-s390x-gnu.node')
} else {
nativeBinding = require('@webview-bundle/binding-linux-s390x-gnu')
nativeBinding = require('@webview-bundle/node-binding-linux-s390x-gnu')
}
} catch (e) {
loadError = e
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@webview-bundle/binding",
"name": "@webview-bundle/node-binding",
"version": "0.1.0",
"main": "index.js",
"types": "index.d.ts",
"homepage": "https://github.com/seokju-na/webview-bundle",
"repository": {
"type": "git",
"url": "https://github.com/seokju-na/webview-bundle",
"directory": "packages/binding"
"directory": "packages/node-binding"
},
"bugs": {
"url": "https://github.com/seokju-na/webview-bundle/issues"
Expand All @@ -22,7 +22,7 @@
"node": ">= 10"
},
"napi": {
"name": "binding",
"name": "node-binding",
"triples": {
"additional": [
"aarch64-apple-darwin",
Expand Down
File renamed without changes.
File renamed without changes.
30 changes: 15 additions & 15 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,26 @@
}
]
},
"binding": {
"node-binding": {
"versionedFiles": [
"packages/binding/Cargo.toml",
"packages/binding/package.json",
"packages/binding/npm/darwin-arm64/package.json",
"packages/binding/npm/darwin-x64/package.json",
"packages/binding/npm/linux-arm64-gnu/package.json",
"packages/binding/npm/linux-arm64-musl/package.json",
"packages/binding/npm/linux-x64-gnu/package.json",
"packages/binding/npm/linux-x64-musl/package.json",
"packages/binding/npm/win32-arm64-msvc/package.json",
"packages/binding/npm/win32-ia32-msvc/package.json",
"packages/binding/npm/win32-x64-msvc/package.json"
"packages/node-binding/Cargo.toml",
"packages/node-binding/package.json",
"packages/node-binding/npm/darwin-arm64/package.json",
"packages/node-binding/npm/darwin-x64/package.json",
"packages/node-binding/npm/linux-arm64-gnu/package.json",
"packages/node-binding/npm/linux-arm64-musl/package.json",
"packages/node-binding/npm/linux-x64-gnu/package.json",
"packages/node-binding/npm/linux-x64-musl/package.json",
"packages/node-binding/npm/win32-arm64-msvc/package.json",
"packages/node-binding/npm/win32-ia32-msvc/package.json",
"packages/node-binding/npm/win32-x64-msvc/package.json"
],
"changelog": "packages/binding/CHANGELOG.md",
"scopes": ["binding"],
"changelog": "packages/node-binding/CHANGELOG.md",
"scopes": ["node-binding"],
"beforeReleaseScripts": [
{
"command": "yarn artifacts",
"cwd": "packages/cli"
"cwd": "packages/node-binding"
}
]
}
Expand Down
Loading

0 comments on commit 94bf8de

Please sign in to comment.