Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent Refactor #168

Merged
merged 11 commits into from
Aug 21, 2023
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
},
'ignorePatterns': [
'dist',
'__tests__'
'**/tests/compiled'
],
rules: {
'key-spacing': [
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/alpha-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ jobs:
matrix:
package:
[
"agent",
"api",
"common",
"credentials",
"crypto",
"dids",
"web5",
"web5-agent",
"web5-proxy-agent",
"web5-user-agent",
"identity-agent",
"proxy-agent",
"user-agent",
]

steps:
Expand Down Expand Up @@ -79,7 +81,7 @@ jobs:
- name: Build all workspace packages
run: npm run build

- name: Publish @tbd54566975/${{ matrix.package }}@${{ env.ALPHA_VERSION }}
- name: Publish @web5/${{ matrix.package }}@${{ env.ALPHA_VERSION }}
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
run: |
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/release-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ jobs:
matrix:
package:
[
"agent",
"api",
"common",
"credentials",
"crypto",
"dids",
"web5",
"web5-agent",
"web5-proxy-agent",
"web5-user-agent",
"identity-agent",
"proxy-agent",
"user-agent",
]

steps:
Expand Down Expand Up @@ -62,7 +64,7 @@ jobs:
cd packages/${{ matrix.package }}

# Fetch the published version on NPMjs.com.
PUBLISHED_VERSION=$(npm view @tbd54566975/${{ matrix.package }} version 2>/dev/null || echo "0.0.0")
PUBLISHED_VERSION=$(npm view @web5/${{ matrix.package }} version 2>/dev/null || echo "0.0.0")
echo "Published Version: $PUBLISHED_VERSION"

# Fetch the version in the GitHub repo's package.json file.
Expand All @@ -73,10 +75,10 @@ jobs:
# Compare the repo and NPMjs.com package versions.
IS_GREATER=$(semver --range ">$PUBLISHED_VERSION" $REPO_VERSION || true)
if [ -n "$IS_GREATER" ] ; then
echo "@tbd54566975/${{ matrix.package }}@$REPO_VERSION is latest"
echo "@web5/${{ matrix.package }}@$REPO_VERSION is latest"
echo "IS_LATEST=true" >> $GITHUB_ENV
else
echo "@tbd54566975/${{ matrix.package }}@$REPO_VERSION is already published or repo version is lower"
echo "@web5/${{ matrix.package }}@$REPO_VERSION is already published or repo version is lower"
echo "IS_LATEST=false" >> $GITHUB_ENV
fi
shell: bash
Expand All @@ -89,7 +91,7 @@ jobs:
if: env.IS_LATEST == 'true'
run: npm run build

- name: Publish @tbd54566975/${{ matrix.package }}@${{ env.REPO_VERSION }}
- name: Publish @web5/${{ matrix.package }}@${{ env.REPO_VERSION }}
if: env.IS_LATEST == 'true'
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ After one or more PRs have been approved and merged by project maintainers, a Gi
version tag. The act of creating the GitHub release triggers automated publication of the package to the
[NPM Registry](https://npmjs.com) which will be tagged as _latest_.

The next time someone runs `npm install @tbd54566975/<package_name>` the newly published release will be installed.
The next time someone runs `npm install @web5/<package_name>` the newly published release will be installed.

#### Alpha Releases

Expand All @@ -198,5 +198,5 @@ the [NPM Registry](https://npmjs.com) within a few minutes.
> **Note**
> Alpha version will never be tagged as _latest_.

To install an `alpha` tagged release use either the `npm install @tbd54566975/<package>@alpha` or
`npm install @tbd5456975/<package>@x.y.z-alpha-YYYYMMDD-commithash` syntax.
To install an `alpha` tagged release use either the `npm install @web5/<package>@alpha` or
`npm install @web5/<package>@x.y.z-alpha-YYYYMMDD-commithash` syntax.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Web5 JS SDK

[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)
[![NPM](https://img.shields.io/npm/v/@web5/api.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@web5/api)
[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)
[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)
[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)
[![Coverage](https://img.shields.io/codecov/c/gh/TBD54566975/web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)
[![License](https://img.shields.io/npm/l/@web5/api.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)
[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)

Making developing with Web5 components at least 5 times easier to work with.
Expand Down Expand Up @@ -46,25 +46,25 @@ possible.
_NPM_

```yaml
npm install @tbd54566975/web5
npm install @web5/api
```

_CDNs_

```yaml
https://unpkg.com/@tbd54566975/web5@0.7.11/dist/browser.js
https://unpkg.com/@web5/api@0.8.1/dist/browser.js
```

```yaml
https://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.11/dist/browser.mjs
https://cdn.jsdelivr.net/npm/@web5/api@0.8.1/dist/browser.mjs
```

## Usage

### Importing the SDK

```javascript
import { Web5 } from "@tbd54566975/web5";
import { Web5 } from "@web5/api";
```

or
Expand Down
30 changes: 17 additions & 13 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ component_management:
target: auto # auto compares coverage to the previous base commit
threshold: 5% # allows a 5% drop from the previous base commit coverage
- type: patch
target: 100 # every PR opened should strive for full test coverage
target: 90 # every PR opened should strive for at least 90% coverage

individual_components:
- component_id: package-api
name: api
paths: ["packages/api/**"]

- component_id: package_common
name: common
paths: ["packages/common/**"]
Expand All @@ -27,21 +31,21 @@ component_management:
name: dids
paths: ["packages/dids/**"]

- component_id: package-web5
name: web5
paths: ["packages/web5/**"]
- component_id: package-agent
name: agent
paths: ["packages/agent/**"]

- component_id: package-web5-agent
name: web5-agent
paths: ["packages/web5-agent/**"]
- component_id: package-identity-agent
name: identity-agent
paths: ["packages/identity-agent/**"]

- component_id: package-web5-proxy-agent
name: web5-proxy-agent
paths: ["packages/web5-proxy-agent/**"]
- component_id: package-proxy-agent
name: proxy-agent
paths: ["packages/proxy-agent/**"]

- component_id: package-web5-user-agent
name: web5-user-agent
paths: ["packages/web5-user-agent/**"]
- component_id: package-user-agent
name: user-agent
paths: ["packages/user-agent/**"]

coverage:
status:
Expand Down
Loading
Loading