Bump preserves dep

This commit is contained in:
Tony Garnock-Jones 2022-01-26 14:44:35 +01:00
parent 4e5f7136ad
commit cdd1c2393d
5 changed files with 14 additions and 14 deletions

View File

@ -24,7 +24,7 @@
"types": "lib/index.d.ts",
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
"dependencies": {
"@preserves/core": ">=0.19",
"@preserves/schema": ">=0.20"
"@preserves/core": ">=0.20",
"@preserves/schema": ">=0.21"
}
}

View File

@ -1,7 +1,7 @@
/// SPDX-License-Identifier: GPL-3.0-or-later
/// SPDX-FileCopyrightText: Copyright © 2016-2022 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
import { IdentitySet, Value, embeddedId, is, fromJS } from '@preserves/core';
import { IdentitySet, Value, embeddedId, is, fromJS, stringify } from '@preserves/core';
import { Cell, Field, Graph } from './dataflow.js';
import { Attenuation, runRewrites } from './rewrite.js';
import { queueTask } from './task.js';
@ -143,7 +143,7 @@ export class Actor {
}
toString(): string {
return `Actor(${this.name.asPreservesText()})`;
return `Actor(${stringify(this.name)})`;
}
}
@ -233,7 +233,7 @@ export class Facet {
for (let f: Facet | null = this; f !== null; f = f.parent) {
facetIds.push(f.id);
}
return facetIds.reverse().join(':') + ':' + this.actor.name.asPreservesText();
return facetIds.reverse().join(':') + ':' + stringify(this.actor.name);
}
toString(): string {

View File

@ -1,10 +1,10 @@
/// SPDX-License-Identifier: GPL-3.0-or-later
/// SPDX-FileCopyrightText: Copyright © 2016-2022 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
import type { Assertion, Handle, Ref } from "./actor.js";
import { Turn } from "./actor.js";
import { Bytes, Dictionary, DoubleFloat, embed, IdentityMap, is, isEmbedded, Record, SingleFloat, Tuple } from "@preserves/core";
import { SturdyValue } from "../transport/sturdy.js";
import { Bytes, Dictionary, DoubleFloat, embed, IdentityMap, is, isEmbedded, Record, SingleFloat, Tuple, stringify } from "@preserves/core";
import type { Assertion, Handle, Ref } from "./actor.js";
import type { SturdyValue } from "../transport/sturdy.js";
import {
Alts,
@ -113,7 +113,7 @@ export function instantiate(t: Template, b: Bindings): Assertion {
case 'TAttenuate': {
const v = walk(t.value.template);
if (!isEmbedded(v)) {
throw new Error(`Attempt to attenuate non-capability: ${v.asPreservesText()}`);
throw new Error(`Attempt to attenuate non-capability: ${stringify(v)}`);
}
const r = v.embeddedValue;
return embed(attenuate(r, ... t.value.attenuation));

View File

@ -2,7 +2,7 @@
/// SPDX-FileCopyrightText: Copyright © 2016-2022 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
import { Actor, Assertion, Entity, Facet, Handle, Ref, Turn } from '../runtime/actor.js';
import { BytesLike, Decoder, Dictionary, embed, encode, IdentityMap, mapEmbeddeds, underlying, Value } from '@preserves/core';
import { BytesLike, Decoder, Dictionary, embed, encode, IdentityMap, mapEmbeddeds, stringify, underlying, Value } from '@preserves/core';
import * as IO from '../gen/protocol.js';
import { wireRefEmbeddedType, WireSymbol } from './protocol.js';
import { queueTask } from '../runtime/task.js';
@ -248,7 +248,7 @@ export class Relay {
send(remoteOid: IO.Oid, m: IO.Event<WireRef>): void {
if (this.pendingTurn.length === 0) {
queueTask(() => {
if (this.debug) console.log('OUT', IO.fromTurn(this.pendingTurn).asPreservesText());
if (this.debug) console.log('OUT', stringify(IO.fromTurn(this.pendingTurn)));
this.w(underlying(encode(IO.fromTurn(this.pendingTurn), {
canonical: true,
embeddedEncode: wireRefEmbeddedType,
@ -271,7 +271,7 @@ export class Relay {
if (rawTurn === void 0) break;
const wireTurn = IO.toTurn(rawTurn);
if (wireTurn === void 0) throw new Error("Bad IO.Turn");
if (this.debug) console.log('IN', rawTurn.asPreservesText());
if (this.debug) console.log('IN', stringify(rawTurn));
wireTurn.forEach(v => {
const { oid: localOid, event: m } = v;
this.handle(this.lookupLocal(localOid), m);

View File

@ -23,8 +23,8 @@
"types": "lib/index.d.ts",
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
"dependencies": {
"@preserves/core": ">=0.19",
"@preserves/schema": ">=0.20",
"@preserves/core": ">=0.20",
"@preserves/schema": ">=0.21",
"@syndicate-lang/core": "^0.11.1"
},
"devDependencies": {