Skip to content

Commit c982e1a

Browse files
committed
share the fermyon:[email protected] wit because otherwise wit merge will fail
This is sadly necessary because if each js package only defines its own interface as its wit, current tooling for wit will refuse to merge them. We can minimize the number of files in a future commit if required by turning it into single file format but I am afraid that the duplication is currently necessary. Signed-off-by: karthik2804 <[email protected]>
1 parent 36f4f35 commit c982e1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2789
-99
lines changed

packages/spin-kv/package-lock.json

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

packages/spin-kv/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@spinframework/spin-kv",
3-
"version": "1.0.0-beta1",
3+
"version": "1.0.0-beta2",
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

packages/spin-kv/wit/world.wit renamed to packages/spin-kv/wit/key-value.wit

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package fermyon:spin@2.0.0;
2-
31
interface key-value {
42
/// An open key-value store
53
resource store {
@@ -47,7 +45,3 @@ interface key-value {
4745
other(string)
4846
}
4947
}
50-
51-
world spin-kv {
52-
import key-value;
53-
}

packages/spin-llm/wit/world.wit renamed to packages/spin-kv/wit/llm.wit

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package fermyon:spin@2.0.0;
2-
31
// A WASI interface dedicated to performing inferencing for Large Language Models.
42
interface llm {
53
/// A Large Language Model.
@@ -70,7 +68,3 @@ interface llm {
7068
prompt-token-count: u32,
7169
}
7270
}
73-
74-
world spin-llm{
75-
import llm;
76-
}

packages/spin-mqtt/wit/world.wit renamed to packages/spin-kv/wit/mqtt.wit

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package fermyon:spin@2.0.0;
2-
31
interface mqtt {
42
/// Errors related to interacting with Mqtt
53
variant error {
@@ -30,8 +28,4 @@ interface mqtt {
3028

3129
/// The message payload.
3230
type payload = list<u8>;
33-
}
34-
35-
world spin-mqtt {
36-
import mqtt;
3731
}

packages/spin-kv/wit/mysql.wit

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
interface mysql {
2+
use rdbms-types.{parameter-value, row-set, error};
3+
4+
/// A connection to a MySQL database.
5+
resource connection {
6+
/// Open a connection to the MySQL instance at `address`.
7+
open: static func(address: string) -> result<connection, error>;
8+
9+
/// query the database: select
10+
query: func(statement: string, params: list<parameter-value>) -> result<row-set, error>;
11+
12+
/// execute command to the database: insert, update, delete
13+
execute: func(statement: string, params: list<parameter-value>) -> result<_, error>;
14+
}
15+
}

packages/spin-kv/wit/postgres.wit

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
interface postgres {
2+
use rdbms-types.{parameter-value, row-set, error};
3+
4+
/// A connection to a postgres database.
5+
resource connection {
6+
/// Open a connection to the Postgres instance at `address`.
7+
open: static func(address: string) -> result<connection, error>;
8+
9+
/// Query the database.
10+
query: func(statement: string, params: list<parameter-value>) -> result<row-set, error>;
11+
12+
/// Execute command to the database.
13+
execute: func(statement: string, params: list<parameter-value>) -> result<u64, error>;
14+
}
15+
}

packages/spin-postgres/wit/world.wit renamed to packages/spin-kv/wit/rdbms-types.wit

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
package fermyon:spin@2.0.0;
2-
3-
interface postgres {
1+
interface rdbms-types {
42
/// Errors related to interacting with a database.
53
variant error {
64
connection-failed(string),
@@ -79,21 +77,4 @@ interface postgres {
7977
columns: list<column>,
8078
rows: list<row>,
8179
}
82-
83-
84-
/// A connection to a postgres database.
85-
resource connection {
86-
/// Open a connection to the Postgres instance at `address`.
87-
open: static func(address: string) -> result<connection, error>;
88-
89-
/// Query the database.
90-
query: func(statement: string, params: list<parameter-value>) -> result<row-set, error>;
91-
92-
/// Execute command to the database.
93-
execute: func(statement: string, params: list<parameter-value>) -> result<u64, error>;
94-
}
9580
}
96-
97-
world spin-postgres {
98-
import postgres;
99-
}

packages/spin-redis/wit/world.wit renamed to packages/spin-kv/wit/redis.wit

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package fermyon:spin@2.0.0;
2-
31
interface redis {
42
/// Errors related to interacting with Redis
53
variant error {
@@ -70,7 +68,3 @@ interface redis {
7068
binary(payload)
7169
}
7270
}
73-
74-
world spin-redis {
75-
import redis;
76-
}

packages/spin-kv/wit/spin.wit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package fermyon:spin@2.0.0;
2+
3+
world spin-kv {
4+
import key-value;
5+
}

0 commit comments

Comments
 (0)