Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit 267ebb6

Browse files
authored
Move non-relevant code from Marine repo into FluenceJS (#227)
1. Move marine-related part into FJS repo (DXJ184) 2. Move towards component-oriented architecture (DXJ183) 3. Different JS Client distros for node.js and web (DXJ185)
1 parent dcb15b7 commit 267ebb6

File tree

220 files changed

+7443
-6384
lines changed

Some content is hidden

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

220 files changed

+7443
-6384
lines changed
File renamed without changes.

.github/workflows/tests.yml

Lines changed: 38 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,42 @@
1-
name: Run tests with worflow_call
1+
name: Run tests
22

3-
on:
4-
workflow_call:
5-
inputs:
6-
rust-peer-image:
7-
description: "rust-peer image tag"
8-
type: string
9-
default: "fluencelabs/fluence:minimal"
10-
avm-version:
11-
description: "@fluencelabs/avm version"
12-
type: string
13-
default: "null"
14-
marine-js-version:
15-
description: "@fluencelabs/marine-js version"
16-
type: string
17-
default: "null"
18-
ref:
19-
description: "git ref to checkout to"
20-
type: string
21-
default: "master"
3+
defaults:
4+
run:
5+
working-directory: .
226

23-
env:
24-
RUST_PEER_IMAGE: "${{ inputs.rust-peer-image }}"
25-
FORCE_COLOR: true
26-
CI: true
7+
on:
8+
push:
279

2810
jobs:
29-
fluence-js:
30-
name: "Run tests"
31-
runs-on: ubuntu-latest
32-
33-
permissions:
34-
contents: read
35-
id-token: write
36-
37-
strategy:
38-
matrix:
39-
node-version:
40-
- 16.x
41-
- 17.x
42-
43-
steps:
44-
- name: Import secrets
45-
uses: hashicorp/[email protected]
46-
with:
47-
url: https://vault.fluence.dev
48-
path: jwt/github
49-
role: ci
50-
method: jwt
51-
jwtGithubAudience: "https://github.com/fluencelabs"
52-
jwtTtl: 300
53-
secrets: |
54-
kv/docker-registry/basicauth/ci username | DOCKER_USERNAME ;
55-
kv/docker-registry/basicauth/ci password | DOCKER_PASSWORD
56-
57-
- name: Login to DockerHub
58-
uses: docker/login-action@v2
59-
with:
60-
registry: docker.fluence.dev
61-
username: ${{ env.DOCKER_USERNAME }}
62-
password: ${{ env.DOCKER_PASSWORD }}
63-
64-
- name: Checkout
65-
uses: actions/checkout@v3
66-
with:
67-
repository: fluencelabs/fluence-js
68-
ref: ${{ inputs.ref }}
69-
70-
- name: Pull rust-peer image
71-
run: docker pull $RUST_PEER_IMAGE
72-
73-
- name: Run rust-peer
74-
uses: isbang/[email protected]
75-
with:
76-
compose-file: ".github/e2e/docker-compose.yml"
77-
down-flags: "--volumes"
78-
79-
- name: Setup pnpm
80-
uses: pnpm/[email protected]
81-
with:
82-
version: 7
83-
84-
- name: Setup node ${{ matrix.node-version }} with self-hosted registry
85-
uses: actions/setup-node@v3
86-
with:
87-
node-version: ${{ matrix.node-version }}
88-
registry-url: "https://npm.fluence.dev"
89-
cache: "pnpm"
90-
91-
- run: pnpm i
92-
93-
- name: Set avm version
94-
if: inputs.avm-version != 'null'
95-
uses: fluencelabs/github-actions/npm-set-dependency@main
96-
with:
97-
package: "@fluencelabs/avm"
98-
version: ${{ inputs.avm-version }}
99-
working-directory: packages/fluence-js
100-
package-manager: pnpm
101-
102-
- name: Set marine-js version
103-
if: inputs.marine-js-version != 'null'
104-
uses: fluencelabs/github-actions/npm-set-dependency@main
105-
with:
106-
package: "@fluencelabs/marine-js"
107-
version: ${{ inputs.marine-js-version }}
108-
working-directory: packages/fluence-js
109-
package-manager: pnpm
110-
111-
- run: pnpm -r build
112-
- run: pnpm -r test
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [16.x, 17.x, 18.x]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
26+
- name: Setup pnpm
27+
uses: pnpm/[email protected]
28+
with:
29+
version: 7
30+
31+
- name: Run container with Fluence node
32+
run: |
33+
docker pull fluencelabs/fluence
34+
docker run -d --rm -e RUST_LOG="info" -p 1210:1210 -p 4310:4310 fluencelabs/fluence -t 1210 -w 4310 -k gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj --local --aqua-pool-size 2
35+
36+
- run: pnpm i
37+
- run: pnpm -r build
38+
env:
39+
CI: true
40+
- run: pnpm -r test
41+
env:
42+
CI: true

.github/workflows/tests.yml.disabled

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Run tests with worflow_call
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
rust-peer-image:
7+
description: "rust-peer image tag"
8+
type: string
9+
default: "fluencelabs/fluence:minimal"
10+
avm-version:
11+
description: "@fluencelabs/avm version"
12+
type: string
13+
default: "null"
14+
marine-js-version:
15+
description: "@fluencelabs/marine-js version"
16+
type: string
17+
default: "null"
18+
ref:
19+
description: "git ref to checkout to"
20+
type: string
21+
default: "master"
22+
23+
env:
24+
RUST_PEER_IMAGE: "${{ inputs.rust-peer-image }}"
25+
FORCE_COLOR: true
26+
CI: true
27+
28+
jobs:
29+
fluence-js:
30+
name: "Run tests"
31+
runs-on: ubuntu-latest
32+
33+
permissions:
34+
contents: read
35+
id-token: write
36+
37+
strategy:
38+
matrix:
39+
node-version:
40+
- 16.x
41+
- 17.x
42+
43+
steps:
44+
- name: Import secrets
45+
uses: hashicorp/[email protected]
46+
with:
47+
url: https://vault.fluence.dev
48+
path: jwt/github
49+
role: ci
50+
method: jwt
51+
jwtGithubAudience: "https://github.com/fluencelabs"
52+
jwtTtl: 300
53+
secrets: |
54+
kv/docker-registry/basicauth/ci username | DOCKER_USERNAME ;
55+
kv/docker-registry/basicauth/ci password | DOCKER_PASSWORD
56+
57+
- name: Login to DockerHub
58+
uses: docker/login-action@v2
59+
with:
60+
registry: docker.fluence.dev
61+
username: ${{ env.DOCKER_USERNAME }}
62+
password: ${{ env.DOCKER_PASSWORD }}
63+
64+
- name: Checkout
65+
uses: actions/checkout@v3
66+
with:
67+
repository: fluencelabs/fluence-js
68+
ref: ${{ inputs.ref }}
69+
70+
- name: Pull rust-peer image
71+
run: docker pull $RUST_PEER_IMAGE
72+
73+
- name: Run rust-peer
74+
uses: isbang/[email protected]
75+
with:
76+
compose-file: ".github/e2e/docker-compose.yml"
77+
down-flags: "--volumes"
78+
79+
- name: Setup pnpm
80+
uses: pnpm/[email protected]
81+
with:
82+
version: 7
83+
84+
- name: Setup node ${{ matrix.node-version }} with self-hosted registry
85+
uses: actions/setup-node@v3
86+
with:
87+
node-version: ${{ matrix.node-version }}
88+
registry-url: "https://npm.fluence.dev"
89+
cache: "pnpm"
90+
91+
- run: pnpm i
92+
93+
- name: Set avm version
94+
if: inputs.avm-version != 'null'
95+
uses: fluencelabs/github-actions/npm-set-dependency@main
96+
with:
97+
package: "@fluencelabs/avm"
98+
version: ${{ inputs.avm-version }}
99+
working-directory: packages/fluence-js
100+
package-manager: pnpm
101+
102+
- name: Set marine-js version
103+
if: inputs.marine-js-version != 'null'
104+
uses: fluencelabs/github-actions/npm-set-dependency@main
105+
with:
106+
package: "@fluencelabs/marine-js"
107+
version: ${{ inputs.marine-js-version }}
108+
working-directory: packages/fluence-js
109+
package-manager: pnpm
110+
111+
- run: pnpm -r build
112+
- run: pnpm -r test

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
auto-install-peers=true
2+
save-exact=true

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@ pnpm -r build
3030

3131
### Repository structure
3232

33-
| Folder | Package | Description |
34-
| --------------------------- | ----------------------- | --------------------------------------------- |
35-
| packages/fluence-js | @fluencelabs/fluence-js | TypeScript implementation of the Fluence Peer |
36-
| packages/fluence-interfaces | @fluencelabs/interfaces | Common interfaces used in Fluence Peer |
37-
| packages/fluence-connection | @fluencelabs/connection | Connectivity layer used in Fluence Peer |
38-
| packages/fluence-keypair | @fluencelabs/keypair | Key Pair implementation |
33+
| Folder | Package | Description |
34+
| --------------------------------- | ------------------------------------- | --------------------------------------------- |
35+
| packages/core/js-peer | @fluencelabs/js-peer | TypeScript implementation of the Fluence Peer |
36+
| packages/core/interfaces | @fluencelabs/interfaces | Common interfaces used in Fluence Peer |
37+
| packages/core/connection | @fluencelabs/connection | Connectivity layer used in Fluence Peer |
38+
| packages/core/keypair | @fluencelabs/keypair | Key Pair implementation |
39+
| packages/marine/background-runner | @fluencelabs/marine.background-runner | MarineJS background runner |
40+
| packages/marine/deps-loader.node | @fluencelabs/marine.deps-loader.node | MarineJS deps loader for nodejs |
41+
| packages/marine/deps-loader.web | @fluencelabs/marine.deps-loader.web | MarineJS deps loader for web |
42+
| packages/marine/worker-script | @fluencelabs/marine.worker-script | MarineJS background worker script |
3943

4044
### Running tests
4145

docs/.nojekyll

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/assets/highlight.css

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)