Skip to content

Commit

Permalink
feat(core): add tauri-wry crate (#1756)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed May 9, 2021
1 parent f190f11 commit 45a7a11
Show file tree
Hide file tree
Showing 19 changed files with 433 additions and 276 deletions.
16 changes: 13 additions & 3 deletions .changes/config.json
Expand Up @@ -220,7 +220,16 @@
"dependencies": [
"tauri-utils"
],
"postversion": "node ../../.scripts/sync-prerelease.js ${ release.type }"
"postversion": "node ../../.scripts/sync-prerelease.js ${ pkg.pkg } ${ release.type }"
},
"tauri-runtime-wry": {
"path": "./core/tauri-runtime-wry",
"manager": "rust",
"dependencies": [
"tauri-utils",
"tauri-runtime"
],
"postversion": "node ../../.scripts/sync-prerelease.js ${ pkg.pkg } ${ release.type }"
},
"tauri-codegen": {
"path": "./core/tauri-codegen",
Expand Down Expand Up @@ -250,7 +259,8 @@
"dependencies": [
"tauri-macros",
"tauri-utils",
"tauri-runtime"
"tauri-runtime",
"tauri-runtime-wry"
],
"postversion": "node ../../.scripts/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
},
Expand Down Expand Up @@ -285,4 +295,4 @@
"manager": "javascript"
}
}
}
}
2 changes: 1 addition & 1 deletion .changes/runtime-crate.md
@@ -1,5 +1,5 @@
---
"tauri-runtime": patch
"tauri-runtime": minor
"tauri": patch
---

Expand Down
6 changes: 6 additions & 0 deletions .changes/tauri-wry.md
@@ -0,0 +1,6 @@
---
"tauri": patch
"tauri-runtime-wry": minor
---

`tauri-runtime-wry` initial release.
27 changes: 20 additions & 7 deletions .scripts/sync-prerelease.js
Expand Up @@ -10,15 +10,28 @@ keep the `tauri-release` crate version without the `beta` or `beta-rc` suffix.

const { readFileSync, writeFileSync } = require("fs")

const runtimeManifestPath = '../../core/tauri-runtime/Cargo.toml'
const dependencyManifestPaths = ['../../core/tauri/Cargo.toml']
const changelogPath = '../../core/tauri-runtime/CHANGELOG.md'
const packageNickname = process.argv[2]
const bump = process.argv[3]

const bump = process.argv[2]
let manifestPath
let dependencyManifestPaths
let changelogPath

let runtimeManifest = readFileSync(runtimeManifestPath, "utf-8")
runtimeManifest = runtimeManifest.replace(/version = "(\d+\.\d+\.\d+)-[^0-9\.]+\.0"/, 'version = "$1"')
writeFileSync(runtimeManifestPath, runtimeManifest)
if (packageNickname === 'tauri-runtime') {
manifestPath = '../../core/tauri-runtime/Cargo.toml'
dependencyManifestPaths = ['../../core/tauri/Cargo.toml', '../../core/tauri-runtime-wry/Cargo.toml']
changelogPath = '../../core/tauri-runtime/CHANGELOG.md'
} else if (packageNickname === 'tauri-runtime-wry') {
manifestPath = '../../core/tauri-runtime-wry/Cargo.toml'
dependencyManifestPaths = ['../../core/tauri/Cargo.toml']
changelogPath = '../../core/tauri-runtime-wry/CHANGELOG.md'
} else {
throw new Error(`Unexpected package ${packageNickname}`)
}

let manifest = readFileSync(manifestPath, "utf-8")
manifest = manifest.replace(/version = "(\d+\.\d+\.\d+)-[^0-9\.]+\.0"/, 'version = "$1"')
writeFileSync(manifestPath, manifest)

let changelog = readFileSync(changelogPath, "utf-8")
changelog = changelog.replace(/(\d+\.\d+\.\d+)-[^0-9\.]+\.0/, '$1')
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -3,6 +3,7 @@ members = [
# core
"core/tauri",
"core/tauri-runtime",
"core/tauri-runtime-wry",
"core/tauri-macros",
"core/tauri-utils",
"core/tauri-build",
Expand Down
3 changes: 3 additions & 0 deletions core/tauri-runtime-wry/.license_template
@@ -0,0 +1,3 @@
// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
17 changes: 17 additions & 0 deletions core/tauri-runtime-wry/Cargo.toml
@@ -0,0 +1,17 @@
[package]
name = "tauri-runtime-wry"
version = "0.0.0"
authors = [ "Tauri Programme within The Commons Conservancy" ]
categories = [ "gui", "web-programming" ]
license = "Apache-2.0 OR MIT"
homepage = "https://tauri.studio"
repository = "https://github.com/tauri-apps/tauri"
description = "Wry bindings to the Tauri runtime"
edition = "2018"

[dependencies]
wry = { git = "https://github.com/tauri-apps/wry", rev = "6bc97aff525644b83a3a00537316c46d7afb985b" }
tauri-runtime = { version = "0.0.0", path = "../tauri-runtime" }
tauri-utils = { version = "1.0.0-beta-rc.1", path = "../tauri-utils" }
image = "0.23"
uuid = { version = "0.8.2", features = [ "v4" ] }

0 comments on commit 45a7a11

Please sign in to comment.