Skip to content

Commit

Permalink
Release 0.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Oct 31, 2024
1 parent e393790 commit b9e694e
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.10.0-SNAPSHOT.0"
"version": "0.10.1"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@quatico/magellan",
"description": "",
"version": "0.10.0-SNAPSHOT.0",
"version": "0.10.1",
"keywords": [
"typescript",
"java",
Expand Down
6 changes: 3 additions & 3 deletions packages/addons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quatico/magellan-addons",
"version": "0.10.0-SNAPSHOT.0",
"version": "0.10.1",
"description": "A example library for the websmith compiler",
"author": "Quatico Solutions AG",
"license": "SEE LICENSE IN LICENSE",
Expand Down Expand Up @@ -48,8 +48,8 @@
"ts-jest": "^29.1.0"
},
"dependencies": {
"@quatico/magellan-client": "^0.10.0-SNAPSHOT.0",
"@quatico/magellan-server": "^0.10.0-SNAPSHOT.0",
"@quatico/magellan-client": "^0.10.1",
"@quatico/magellan-server": "^0.10.1",
"@quatico/websmith-api": "0.4.0",
"typescript": "5.0.x"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@quatico/magellan-cli",
"description": "CLI for the Magellan project",
"version": "0.10.0-SNAPSHOT.0",
"version": "0.10.1",
"author": "Quatico Solutions AG",
"license": "SEE LICENSE IN LICENSE",
"main": "lib/index.js",
Expand Down Expand Up @@ -35,8 +35,8 @@
"publish-npm": "npm publish"
},
"dependencies": {
"@quatico/magellan-client": "^0.10.0-SNAPSHOT.0",
"@quatico/magellan-server": "^0.10.0-SNAPSHOT.0",
"@quatico/magellan-client": "^0.10.1",
"@quatico/magellan-server": "^0.10.1",
"@quatico/websmith-api": "0.4.0",
"@quatico/websmith-compiler": "0.4.0",
"@quatico/websmith-core": "0.4.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@quatico/magellan-client",
"description": "Client library for proxies generated with @quatico/websmith-compiler",
"version": "0.10.0-SNAPSHOT.0",
"version": "0.10.1",
"author": "Quatico Solutions AG",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -28,7 +28,7 @@
"publish-npm": "npm publish"
},
"dependencies": {
"@quatico/magellan-shared": "^0.10.0-SNAPSHOT.0"
"@quatico/magellan-shared": "^0.10.1"
},
"devDependencies": {
"@swc/core": "^1.3.57",
Expand Down
4 changes: 2 additions & 2 deletions packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@quatico/magellan-server",
"description": "Middleware for remote service execution with the @quatico/websmith-compiler",
"version": "0.10.0-SNAPSHOT.0",
"version": "0.10.1",
"author": "Quatico Solutions AG",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -29,7 +29,7 @@
"publish-npm": "npm publish"
},
"dependencies": {
"@quatico/magellan-shared": "^0.10.0-SNAPSHOT.0",
"@quatico/magellan-shared": "^0.10.1",
"cookie-parser": "1.4.x",
"cors": "2.8.5",
"express": "4.18.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@quatico/magellan-shared",
"description": "Shared functionality for server/client communication",
"version": "0.10.0-SNAPSHOT.0",
"version": "0.10.1",
"author": "Quatico Solutions AG",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
28 changes: 28 additions & 0 deletions packages/shared/src/serialize.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,19 @@ describe("packObject", () => {
});
});

it("packs w/ an object with an empty map", () => {
const expected = { persons: new Map() };

const actual = packObject(expected);

expect(actual).toEqual({
persons: {
__type__: "map",
value: {},
},
});
});

it("packs w/ an object with a set of objects", () => {
const expected = {
days: new Set([{ day: "monday" }, { day: "tuesday" }]),
Expand All @@ -208,6 +221,21 @@ describe("packObject", () => {
});
});

it("packs w/ an object with an empty set", () => {
const expected = {
days: new Set(),
};

const actual = packObject(expected);

expect(actual).toEqual({
days: {
__type__: "set",
value: [],
},
});
});

it("packs w/ a complex nested datastructure", () => {
const target = {
lists: [new Set([new Map([["expected", { day: "monday" }]])])],
Expand Down
7 changes: 5 additions & 2 deletions packages/shared/src/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ export const packObject = (value: unknown): unknown => {
if (value instanceof Map) {
return {
__type__: SerializedTypes.Map,
value: value.size < 1 ? null : Object.fromEntries(Array.from(value.entries()).map(it => [it.at(0), packObject(it.at(1))])),
value: value.size < 1 ? {} : Object.fromEntries(Array.from(value.entries()).map(it => [it.at(0), packObject(it.at(1))])),
};
}
if (value instanceof Set) {
return { __type__: SerializedTypes.Set, value: value.size < 1 ? null : Array.from(value.values()).map(it => packObject(it)) };
return {
__type__: SerializedTypes.Set,
value: value.size < 1 ? [] : Array.from(value.values()).map(it => packObject(it)),
};
}
if (value instanceof Object) {
const fields = Object.entries(value).map(it => [it.at(0), packObject(it.at(1))]);
Expand Down
10 changes: 5 additions & 5 deletions packages/test/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@quatico/magellan-test",
"description": "End to end tests for magellan suite",
"version": "0.10.0-SNAPSHOT.0",
"version": "0.10.1",
"author": "Quatico Solutions AG",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -25,10 +25,10 @@
},
"devDependencies": {
"@cucumber/cucumber": "^8.7.0",
"@quatico/magellan-cli": "^0.10.0-SNAPSHOT.0",
"@quatico/magellan-client": "^0.10.0-SNAPSHOT.0",
"@quatico/magellan-server": "^0.10.0-SNAPSHOT.0",
"@quatico/magellan-shared": "^0.10.0-SNAPSHOT.0",
"@quatico/magellan-cli": "^0.10.1",
"@quatico/magellan-client": "^0.10.1",
"@quatico/magellan-server": "^0.10.1",
"@quatico/magellan-shared": "^0.10.1",
"@types/node": "16",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
Expand Down
24 changes: 23 additions & 1 deletion test/__data__/json/Person.json
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
{"address":{"city":"Musterhausen","street":"Musterstrasse 9","zip":"1234"},"age":22,"birthday":{"__type__":"date","value":"1970-04-01T00:00:00.000Z"},"children":[{"address":null,"age":123,"birthday":{"__type__":"date","value":"1999-04-01T00:00:00.000Z"},"children":[],"friends":{"__type__":"map","value":null},"height":1.723,"name":"chucky","surname":"cheese","tel":{"__type__":"set","value":null}}],"friends":{"__type__":"map","value":{"bff":"chucky cheese","favorite":3.0}},"height":1.721,"name":"fanny","surname":"may","tel":{"__type__":"set","value":["0791234567"]}}
{
"address": { "city": "Musterhausen", "street": "Musterstrasse 9", "zip": "1234" },
"age": 22,
"birthday": { "__type__": "date", "value": "1970-04-01T00:00:00.000Z" },
"children": [
{
"address": null,
"age": 123,
"birthday": { "__type__": "date", "value": "1999-04-01T00:00:00.000Z" },
"children": [],
"friends": { "__type__": "map", "value": { } },
"height": 1.723,
"name": "chucky",
"surname": "cheese",
"tel": { "__type__": "set", "value": [] }
}
],
"friends": { "__type__": "map", "value": { "bff": "chucky cheese", "favorite": 3.0 } },
"height": 1.721,
"name": "fanny",
"surname": "may",
"tel": { "__type__": "set", "value": ["0791234567"] }
}

0 comments on commit b9e694e

Please sign in to comment.