Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 3 additions & 49 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Get started at **<https://qpace.dev>**

## Introduction

Examples with actual setup are available [here](https://github.com/nersent/qpace-examples).
Examples with actual setup are available [here](/examples).

## Installation

Expand Down Expand Up @@ -77,7 +77,7 @@ console.log(btc.minTick);

Browser / WASM:

[Here](https://github.com/nersent/qpace-examples/tree/main/web) is concrete example of how to use it in a browser. There may be some issues with webpack ect.
[Here](/examples/web) is concrete example of how to use it in a browser. There may be some issues with webpack ect.

```javascript
import * as qp from "qpace/web";
Expand Down Expand Up @@ -727,6 +727,6 @@ export const ta = { ..._ta, init: initTa } as typeof _ta & {
};
```

WASM may have problems with webpack. [webpack config that works](https://github.com/nersent/qpace-examples/blob/main/web/webpack.config.js)
WASM may have problems with webpack. [webpack config that works](/examples/web/webpack.config.js)

WASM `ta` must be initialized after `qp.init()` and is optional unless you use `qp.ta` methods
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

- [Home](https://qpace.dev)
- [Documentation](/DOCS.md)
- [Examples](/https://github.com/nersent/qpace-examples)
- [Examples](/examples)
- [Discord](https://qpace.dev/discord)

## Installation
Expand Down
8 changes: 7 additions & 1 deletion cli/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,15 @@ const build = async ({
chalk.blackBright(`\nRequest ID: ${chalk.magentaBright(reqId)}`),
);
}
ok = data.getOk();
pb.clear();
const logs = data.getMessage();
if (logs?.length) console.log(`${logs}\n`);
if (!ok) _resolve();
return;
}
if (e.hasBuildStart()) {
pb.text = `Building ${chalk.blueBright(target)}`;
pb.start(`Building ${chalk.blueBright(target)}`);
return;
}
if (e.hasBuildEnd()) {
Expand Down
7 changes: 3 additions & 4 deletions compiler/schema.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ message BuildEvent {
}

message CheckEnd {
string request_id = 1;
// bool ok = 1;
// string request_id = 2;
// optional string message = 3;
bool ok = 1;
string request_id = 2;
optional string message = 3;
}

message BuildStart {}
Expand Down
9 changes: 9 additions & 0 deletions compiler/schema_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,16 @@ export namespace BuildEvent {
}

export class CheckEnd extends jspb.Message {
getOk(): boolean;
setOk(value: boolean): CheckEnd;
getRequestId(): string;
setRequestId(value: string): CheckEnd;

hasMessage(): boolean;
clearMessage(): void;
getMessage(): string | undefined;
setMessage(value: string): CheckEnd;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): CheckEnd.AsObject;
static toObject(includeInstance: boolean, msg: CheckEnd): CheckEnd.AsObject;
Expand All @@ -234,7 +241,9 @@ export class CheckEnd extends jspb.Message {

export namespace CheckEnd {
export type AsObject = {
ok: boolean,
requestId: string,
message?: string,
}
}

Expand Down
88 changes: 83 additions & 5 deletions compiler/schema_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,9 @@ proto.compiler.CheckEnd.prototype.toObject = function(opt_includeInstance) {
*/
proto.compiler.CheckEnd.toObject = function(includeInstance, msg) {
var f, obj = {
requestId: jspb.Message.getFieldWithDefault(msg, 1, "")
ok: jspb.Message.getBooleanFieldWithDefault(msg, 1, false),
requestId: jspb.Message.getFieldWithDefault(msg, 2, ""),
message: jspb.Message.getFieldWithDefault(msg, 3, "")
};

if (includeInstance) {
Expand Down Expand Up @@ -1795,9 +1797,17 @@ proto.compiler.CheckEnd.deserializeBinaryFromReader = function(msg, reader) {
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {boolean} */ (reader.readBool());
msg.setOk(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setRequestId(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setMessage(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -1827,22 +1837,54 @@ proto.compiler.CheckEnd.prototype.serializeBinary = function() {
*/
proto.compiler.CheckEnd.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getOk();
if (f) {
writer.writeBool(
1,
f
);
}
f = message.getRequestId();
if (f.length > 0) {
writer.writeString(
1,
2,
f
);
}
f = /** @type {string} */ (jspb.Message.getField(message, 3));
if (f != null) {
writer.writeString(
3,
f
);
}
};


/**
* optional bool ok = 1;
* @return {boolean}
*/
proto.compiler.CheckEnd.prototype.getOk = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false));
};


/**
* @param {boolean} value
* @return {!proto.compiler.CheckEnd} returns this
*/
proto.compiler.CheckEnd.prototype.setOk = function(value) {
return jspb.Message.setProto3BooleanField(this, 1, value);
};


/**
* optional string request_id = 1;
* optional string request_id = 2;
* @return {string}
*/
proto.compiler.CheckEnd.prototype.getRequestId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};


Expand All @@ -1851,7 +1893,43 @@ proto.compiler.CheckEnd.prototype.getRequestId = function() {
* @return {!proto.compiler.CheckEnd} returns this
*/
proto.compiler.CheckEnd.prototype.setRequestId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
return jspb.Message.setProto3StringField(this, 2, value);
};


/**
* optional string message = 3;
* @return {string}
*/
proto.compiler.CheckEnd.prototype.getMessage = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};


/**
* @param {string} value
* @return {!proto.compiler.CheckEnd} returns this
*/
proto.compiler.CheckEnd.prototype.setMessage = function(value) {
return jspb.Message.setField(this, 3, value);
};


/**
* Clears the field making it undefined.
* @return {!proto.compiler.CheckEnd} returns this
*/
proto.compiler.CheckEnd.prototype.clearMessage = function() {
return jspb.Message.setField(this, 3, undefined);
};


/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.compiler.CheckEnd.prototype.hasMessage = function() {
return jspb.Message.getField(this, 3) != null;
};


Expand Down
Loading
Loading