Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2f316cc
Fix aqua-to-js, start to split responsibility
akim-bow Nov 12, 2023
426f154
Remove schema from js-client
akim-bow Nov 13, 2023
9272773
Adapt js-client ecosystem to the new API.
akim-bow Nov 13, 2023
3a039cd
Refactor tests
akim-bow Nov 13, 2023
d6eb91b
Fix all tests
akim-bow Nov 14, 2023
942a203
Fix tests
akim-bow Nov 14, 2023
90dbffa
Remove file
akim-bow Nov 14, 2023
91bde89
JS-client to dev deps
akim-bow Nov 14, 2023
bdf6644
Fix lint
akim-bow Nov 14, 2023
12eea31
Review fixes
akim-bow Nov 15, 2023
83f2239
Fix
akim-bow Nov 15, 2023
8eb5393
Ignore warnings
akim-bow Nov 15, 2023
d7c074e
Remove import
akim-bow Nov 15, 2023
889741b
Fix templates
akim-bow Nov 15, 2023
2a23052
Fix lint
akim-bow Nov 15, 2023
357726a
Fix condition
akim-bow Nov 15, 2023
c14344e
Use new param
akim-bow Nov 15, 2023
ff5de6a
Merge branch 'master' into DXJ-525
akim-bow Nov 15, 2023
34ab91d
Fix type
akim-bow Nov 15, 2023
3d8f233
Async loading
akim-bow Nov 15, 2023
6ab6e9d
Allow to use ^
akim-bow Nov 16, 2023
e647ab0
Fix comments
akim-bow Nov 16, 2023
166475e
Merge remote-tracking branch 'origin/DXJ-525' into DXJ-525
akim-bow Nov 16, 2023
26bfc36
Fix more comments
akim-bow Nov 16, 2023
ec830bc
Refactor
akim-bow Nov 16, 2023
20edd89
Fix
akim-bow Nov 16, 2023
2641379
Add validation to api
akim-bow Nov 16, 2023
0c8bed2
Remove validator.ts
akim-bow Nov 16, 2023
4717c20
Typo
akim-bow Nov 16, 2023
d3678c5
Remove marine-js from js-client
akim-bow Nov 16, 2023
1669750
Update generated code
akim-bow Nov 16, 2023
05bec9d
Bug fix
akim-bow Nov 16, 2023
3e0b45e
Fix tests
akim-bow Nov 16, 2023
741a017
Fix review
akim-bow Nov 17, 2023
242ff5c
Fix return type
akim-bow Nov 17, 2023
4ce35e4
Lint fix
akim-bow Nov 17, 2023
5b3fe66
Fix api
akim-bow Nov 17, 2023
c3eba6a
Fix types
akim-bow Nov 17, 2023
74e635a
Different nox image
akim-bow Nov 17, 2023
de96163
Revert "Different nox image"
akim-bow Nov 17, 2023
17962de
Remove unused import
akim-bow Nov 17, 2023
22a0cc2
Add doc
akim-bow Nov 17, 2023
56620ab
Review fixes
akim-bow Nov 17, 2023
f20f02b
Small fix
akim-bow Nov 17, 2023
711fbe1
Comment
akim-bow Nov 17, 2023
c42beaa
Improve error message
akim-bow Nov 17, 2023
3912056
Adjust error message
akim-bow Nov 17, 2023
9cb9923
Typo
akim-bow Nov 17, 2023
7c24805
Update e2e v
akim-bow Nov 17, 2023
327375f
Remove fire and forget
akim-bow Nov 18, 2023
f8650db
Update compiler
akim-bow Nov 18, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
uses: fluencelabs/aqua/.github/workflows/tests.yml@main
with:
js-client-snapshots: "${{ needs.js-client.outputs.js-client-snapshots }}"
nox-image: "fluencelabs/nox:unstable_minimal"
nox-image: "fluencelabs/nox:0.4.2"
flox:
needs:
- js-client
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
nox-image:
description: "nox image tag"
type: string
default: "fluencelabs/nox:0.4.0"
default: "fluencelabs/nox:0.4.2"
avm-version:
description: "@fluencelabs/avm version"
type: string
Expand Down
12 changes: 7 additions & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
.eslintcache
pnpm-lock.yaml

**/node_modules
**/dist
**/build
**/public
node_modules
dist
build
public

**/CHANGELOG.md

packages/core/js-client-isomorphic/src/versions.ts
packages/core/js-client-isomorphic/src/versions.ts
__snapshots__
packages/@tests/aqua/src/_aqua/**
2 changes: 1 addition & 1 deletion ci.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function checkConsistency(file, versionsMap) {

for (const [name, versionInDep] of versionsMap) {
const check = (x, version) => {
if (version.includes("*")) {
if (version.includes("*") || version.includes("^")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean? What does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file bumps version in ci to support e2e testing. Here i added support for workspace symbol.

return;
}

Expand Down
51 changes: 51 additions & 0 deletions packages/@tests/aqua/compile-aqua.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Copyright 2023 Fluence Labs Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { writeFile } from "fs/promises";
import { join, dirname } from "path";
import { fileURLToPath } from "url";

import { compileFromPath } from "@fluencelabs/aqua-api";
import aquaToJs from "@fluencelabs/aqua-to-js";

const files = ["smoke_test", "finalize_particle"];

for (const file of files) {
const cr = await compileFromPath({
filePath: join(
dirname(fileURLToPath(import.meta.url)),
"_aqua",
file + ".aqua",
),
targetType: "air",
imports: [fileURLToPath(new URL("./node_modules", import.meta.url))],
});

if (cr.errors.length > 0) {
throw new Error(cr.errors.join("\n"));
}

const res = await aquaToJs(cr, "ts");

if (res == null) {
throw new Error("AquaToJs gave null value after compilation");
}

await writeFile(
fileURLToPath(new URL(join("src", "_aqua", file + ".ts"), import.meta.url)),
res.sources,
);
}
12 changes: 7 additions & 5 deletions packages/@tests/aqua/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "module",
"scripts": {
"build": "tsc",
"compile-aqua": "fluence aqua -i ./_aqua -o ./src/_aqua"
"compile-aqua": "node --loader ts-node/esm compile-aqua.ts"
},
"repository": "https://github.com/fluencelabs/fluence-js",
"author": "Fluence Labs",
Expand All @@ -20,10 +20,12 @@
"base64-js": "1.5.1"
},
"devDependencies": {
"@fluencelabs/aqua-api": "0.12.4-main-cee4448-2196-1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use normal version here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will replace them later after releases in aqua and registry. Just don't want to block on them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a todos on these

"@fluencelabs/aqua-lib": "0.6.0",
"@fluencelabs/cli": "0.7.2",
"@fluencelabs/js-client": "workspace:^",
"@fluencelabs/registry": "0.8.2",
"@fluencelabs/trust-graph": "3.1.2"
"@fluencelabs/aqua-to-js": "workspace:*",
"@fluencelabs/js-client": "workspace:*",
"@fluencelabs/registry": "0.8.8-1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this version also looks interesting. I wonder why

"@fluencelabs/trust-graph": "3.1.2",
"ts-node": "10.9.1"
}
}
105 changes: 51 additions & 54 deletions packages/@tests/aqua/src/_aqua/finalize_particle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,68 @@
// @ts-nocheck
/**
*
* This file is auto-generated. Do not edit manually: changes may be erased.
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
* Aqua version: 0.12.0
* This file is generated using:
* @fluencelabs/aqua-api version: 0.12.4-main-cee4448-2196-1
* @fluencelabs/aqua-to-js version: 0.2.0
* If you find any bugs in generated AIR, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
* If you find any bugs in generated JS/TS, please write an issue on GitHub: https://github.com/fluencelabs/js-client/issues
*
*/
import type {
IFluenceClient as IFluenceClient$$,
CallParams as CallParams$$,
} from "@fluencelabs/js-client";
import type { IFluenceClient as IFluenceClient$$, ParticleContext as ParticleContext$$ } from '@fluencelabs/js-client';

// Making aliases to reduce chance of accidental name collision
import {
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from "@fluencelabs/js-client";
v5_callFunction as callFunction$$,
v5_registerService as registerService$$
} from '@fluencelabs/js-client';

// Services

// Functions
export const test_script = `
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(xor
(xor
(call -relay- ("op" "noop") [])
(fail %last_error%)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 0])
)
)
`;
(xor
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(xor
(call -relay- ("op" "noop") [])
(fail :error:)
)
)
(call %init_peer_id% ("callbackSrv" "response") [])
)
(call %init_peer_id% ("errorHandlingSrv" "error") [:error: 0])
)
`;

export function test(config?: { ttl?: number }): Promise<void>;
export type TestParams = [config?: {ttl?: number}] | [peer: IFluenceClient$$, config?: {ttl?: number}];

export function test(
peer: IFluenceClient$$,
config?: { ttl?: number },
): Promise<void>;
export type TestResult = Promise<void>;

export function test(...args: any) {
return callFunction$$(
args,
{
functionName: "test",
arrow: {
tag: "arrow",
domain: {
tag: "labeledProduct",
fields: {},
export function test(...args: TestParams): TestResult {
return callFunction$$(
args,
{
"functionName": "test",
"arrow": {
"domain": {
"fields": {},
"tag": "labeledProduct"
},
codomain: {
tag: "nil",
"codomain": {
"tag": "nil"
},
},
names: {
relay: "-relay-",
getDataSrv: "getDataSrv",
callbackSrv: "callbackSrv",
responseSrv: "callbackSrv",
responseFnName: "response",
errorHandlingSrv: "errorHandlingSrv",
errorFnName: "error",
},
"tag": "arrow"
},
test_script,
);
"names": {
"relay": "-relay-",
"getDataSrv": "getDataSrv",
"callbackSrv": "callbackSrv",
"responseSrv": "callbackSrv",
"responseFnName": "response",
"errorHandlingSrv": "errorHandlingSrv",
"errorFnName": "error"
}
},
test_script
);
}

/* eslint-enable */
Loading