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
53 commits
Select commit Hold shift + click to select a range
6b898d2
Move to pnpm
coder11 Aug 9, 2022
b359b74
Build with pnpm
coder11 Aug 10, 2022
b789f7a
Splitting packages (WIP)
coder11 Aug 10, 2022
6298828
Fix build
coder11 Aug 10, 2022
e18a92e
Fix build
coder11 Aug 10, 2022
bba8755
Fix gitignore
coder11 Aug 10, 2022
23a4539
Update CI
coder11 Aug 10, 2022
11ed89d
Fix CI 2
coder11 Aug 10, 2022
39bfe1a
Update CI
coder11 Aug 12, 2022
088bcb1
commin pnpm-lock
coder11 Aug 12, 2022
79d69e8
Fix CI 2
coder11 Aug 12, 2022
79d0d14
Fix package names
coder11 Aug 12, 2022
53247c1
CI wip
coder11 Aug 12, 2022
f71abcc
Split packages release and tag release
coder11 Aug 12, 2022
1274caa
Fix prettier format
coder11 Aug 12, 2022
435b2a0
Fix newlines
coder11 Aug 12, 2022
8650424
Take our common interfaces
coder11 Aug 12, 2022
135212a
Fix FJS version
coder11 Aug 12, 2022
868fadc
Merge branch 'master' into DXJ-85
coder11 Aug 23, 2022
d51a265
push new workflows
coder11 Aug 23, 2022
36a1521
fix publish-branch
coder11 Aug 23, 2022
77626a4
fix publish branch contd
coder11 Aug 23, 2022
28369d6
publish branch version on every commit
coder11 Aug 23, 2022
8b1d1ab
better publish branch name
coder11 Aug 23, 2022
9d5e9fa
trying out release workflow
coder11 Aug 23, 2022
4dff7aa
should work?
coder11 Aug 23, 2022
11ab8de
renaming
coder11 Aug 23, 2022
17aa059
for tests
coder11 Aug 23, 2022
a4e2e42
fix tag publishing step
coder11 Aug 23, 2022
703dbe8
fixes
coder11 Aug 23, 2022
235d8c8
another way to specify tag
coder11 Aug 23, 2022
8ba3b23
fix syntax
coder11 Aug 23, 2022
f93a87e
add gh token
coder11 Aug 23, 2022
9c070ae
add more token
coder11 Aug 23, 2022
a6a285c
fix permissions
coder11 Aug 23, 2022
1fce7db
remove unneded license files
coder11 Aug 23, 2022
a5e9ddf
fix readmes
coder11 Aug 23, 2022
d47bc4e
Fix build
coder11 Aug 23, 2022
9d92cd1
List packages in readme
coder11 Aug 23, 2022
19b8ee6
Bump version
coder11 Aug 23, 2022
aeb328f
not dry run
coder11 Aug 23, 2022
c081453
Check for non deployed packages
coder11 Aug 23, 2022
02e8832
Add smoke test
coder11 Aug 24, 2022
5701776
fix tsconfigs
coder11 Aug 24, 2022
2e01a00
fix build
coder11 Aug 24, 2022
b7d8092
fix CI
coder11 Aug 24, 2022
7c2936e
fix packages' content
coder11 Aug 24, 2022
14c2ece
finalizing
coder11 Aug 24, 2022
9988713
uncomment token
coder11 Aug 24, 2022
810d67f
changed to prepatch
coder11 Aug 24, 2022
f6fe531
Add readmes for other packages
coder11 Aug 24, 2022
c925c24
Apply suggestions from code review
coder11 Aug 24, 2022
fad5aac
Apply suggestion from code review
coder11 Aug 24, 2022
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
23 changes: 0 additions & 23 deletions .eslintrc.js

This file was deleted.

27 changes: 18 additions & 9 deletions .github/workflows/publish_branch.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: "publish-branch"
name: "Publish development branch packages"

on:
workflow_dispatch:
push:
Copy link
Contributor

@nahsi nahsi Aug 24, 2022

Choose a reason for hiding this comment

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

Do we really need a snapshot on every push to github? Perhaps it would be better to set it to workflow_dispatch and use that when you need a snapshot?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we are pushing to our internal registry I think it would be harmless. It's kind tedious when you are integrating your changes (e.g into aqua-playground ) and have to trigger the workflow for every commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We decided to leave it as is for now


jobs:
npm-publish:
name: "Publish"
publish-branch:
runs-on: ubuntu-latest

permissions:
Expand All @@ -14,15 +13,21 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.2.2
with:
version: 7

- name: "Setup node with self-hosted npm registry"
uses: actions/setup-node@v2
with:
node-version: "16"
registry-url: "https://npm.fluence.dev"

- run: npm ci
- run: npm run build
- name: "Build packages"
run: |
pnpm i
pnpm -r build

- name: "Import secrets"
uses: hashicorp/vault-action@v2.4.2
Expand Down Expand Up @@ -53,8 +58,12 @@ jobs:
RUN: ${{ github.run_number }}
ATTEMPT: ${{ github.run_attempt }}
run: |
npm version prerelease --no-git-tag-version \
--preid ${{ env.BRANCH }}-${{ env.SHA }}-${{ env.RUN }}-${{ env.ATTEMPT }}
for package in packages/*; do
cd $package
pnpm version prepatch --no-git-tag-version \
--preid ${{ env.BRANCH }}-${{ env.SHA }}-${{ env.RUN }}-${{ env.ATTEMPT }}
cd -
done

- name: "Publish to self-hosted npm repo"
run: npm publish --tag snapshot --registry https://npm.fluence.dev
run: pnpm --no-git-checks --registry https://npm.fluence.dev -r publish --tag snapshot -filter '@fluencelabs/*'
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: "release"
name: "Make github release"

on:
push:
tags:
- "v*"

jobs:
npm-publish:
name: "Publish"
release-github:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -20,23 +19,6 @@ jobs:
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

### Set version
- name: Set version to ${{ env.RELEASE_VERSION }}
run: npm version --new-version --allow-same-version ${{ env.RELEASE_VERSION }} --no-git-tag-version

### Publish to NPM registry
- uses: actions/setup-node@v1
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'

- run: npm i
- run: npm run build

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

### Create a release
- name: Build Changelog
id: changelog
Expand All @@ -56,4 +38,4 @@ jobs:
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions .github/workflows/release_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Release packages"

on:
workflow_dispatch:

jobs:
release-packages:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.2.2
with:
version: 7

- name: "Setup node"
uses: actions/setup-node@v2
with:
node-version: "16"

- name: "Build packages"
run: |
pnpm i
pnpm -r build

- name: "Publish to npmjs.com"
run: |
result=$(pnpm --no-git-checks -r publish -filter '@fluencelabs/*')
if [[ $result == "There are no new packages that should be published" ]]
then
echo ERROR: no packages have been published. Did you forget to bump version?
exit 1
fi
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: "Get the version of fluence-js package"
id: package-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: packages/fluence-js

- name: "Create tag for release"
uses: rickstaa/action-create-tag@v1
with:
tag: "v${{ steps.package-version.outputs.current-version }}"
message: ""
github_token: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,27 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
- uses: pnpm/action-setup@v2.2.2
with:
path: ~/.npm
key: ${{ runner.os }}-v1-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-v1-node-${{ matrix.node-version }}
version: 7

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Run container with Fluence node
run: |
docker pull fluencelabs/fluence
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

- run: npm install
- run: npm run test:all
- name: Install deps
run: pnpm i

- name: Run tests
run: |
pnpm -r build
pnpm -r test
env:
CI: true
18 changes: 0 additions & 18 deletions .github/workflows/tag.yml

This file was deleted.

14 changes: 1 addition & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
bundle/
.idea

# Dependency directories
node_modules/
jspm_packages/
/dist/

.idea
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers=true
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,28 @@ While the project is still in the early stages of development, you are welcome t

### Setting up dev environment

Install node packages
Fluence JS uses pnpm to manage monorepo packages. See [pnpm.io](https://pnpm.io/installation) for installation instructions.

Install dependencies

```bash
npm install
pnpm install
```

Build all packages

```
pnpm -r build
```

### Repository structure

| Folder | Package | Description |
| --------------------------- | ----------------------- | --------------------------------------------- |
| packages/fluence-js | @fluencelabs/fluence-js | TypeScript implementation of the Fluence Peer |
| packages/fluence-interfaces | @fluencelabs/interfaces | Common interfaces used in Fluence Peer |
| packages/fluence-connection | @fluencelabs/connection | Connectivity layer used in Fluence Peer |
| packages/fluence-keypair | @fluencelabs/keypair | Key Pair implementation |

### Running tests

Expand All @@ -28,28 +45,22 @@ Tests are split into unit and integration categories. By default integration tes
docker run --rm -e RUST_LOG="info" -p 1210:1210 -p 4310:4310 fluencelabs/fluence -t 1210 -w 4310 -k gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj
```

To run all tests in interactive mode
To run all tests

```bash
npm run test
pnpm -r test
```

To run only unit tests

```bash
npm run test:unit
pnpm -r test:unit
```

To run only integration tests

```bash
npm run test:unit
```

To run all tests

```bash
npm run test:all
pnpm -r test:integration
```

## License
Expand Down
Loading