Skip to content

Commit

Permalink
chore: release v1 (#897)
Browse files Browse the repository at this point in the history
Combines a series of changes we've made to make the SDK more user-friendly. This is a major breaking change compared to existing `0.x.x` versions. 

- Releases version 1 of `@kiltprotocol/sdk-js` with a reduced, simplified, high-level surface that allows long-term support.
- This uses new releases (version 0.100.0) of the following packages:
  - `@kiltprotocol/chain-helpers`
  - `@kiltprotocol/types`
  - `@kiltprotocol/config`
  - `@kiltprotocol/did`
  - `@kiltprotocol/utils`
- It also introduces the following packages:
  - `@kiltprotocol/credentials`: Provides functionality to issue and verify Verifiable Credentials and Verifiable Presentations; helps with creating and loading CTypes.
  - `@kiltprotocol/legacy-credentials`: Provides legacy credential functionality formally provided by `@kiltprotocol/core`.
  - `@kiltprotocol/asset-credentials`: Provides functionality around Asset DIDs and Asset Credentials.
  - `@kiltprotocol/jsonld-suites`: Provides helpers for issuing and verifying KILT credentials using `@digitalbazaar/vc`.
- The following packages have been discontinued or moved:
  - `@kiltprotocol/augment-api` & `@kiltprotocol/type-definitions`: Moved into a new repository (KILTprotocol/types-augment).
  - `@kiltprotocol/vc-export`: Discontinued; Most functionality moved to `@kiltprotocol/jsonld-suites`, conversion between VCs and legacy credentials has moved to `@kiltprotocol/legacy-credentials`.
  - `@kiltprotocol/asset-did`: Discontinued; Moved into `@kiltprotocol/asset-credentials`.
  - `@kiltprotocol/core`: Discontinued; Most functions have moved into `@kiltprotocol/legacy-credentials`; CType-related functions have moved to `@kiltprotocol/credentials`; functions relating to connecting to a blockchain node have moved to `@kiltprotocol/chain-helpers`.
  - `@kiltprotocol/messaging`: Discontinued; Functionality has been moved to `@kiltprotocol/kilt-extension-api`

---------

Co-authored-by: Abdulrahim Al Methiab <[email protected]>
Co-authored-by: Antonio <[email protected]>
Co-authored-by: Skedley <[email protected]>
  • Loading branch information
4 people authored Aug 8, 2024
1 parent 1881c44 commit ec335d7
Show file tree
Hide file tree
Showing 330 changed files with 20,893 additions and 34,133 deletions.
9 changes: 2 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,15 @@ module.exports = {
'no-console': 'off',
},
},
{
files: ['**/augment-api/src/interfaces/**/*.ts'],
rules: {
'license-header/header': 'off',
},
},
{
files: ['tests/**/*'],
rules: {
'import/extensions': 'off',
'jsdoc/require-jsdoc': 'off',
'no-console': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'import/no-extraneous-dependencies': 'off'
'import/no-extraneous-dependencies': 'off',
'no-underscore-dangle': 'off'
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/cached-image-pull/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:
- name: check image cache
id: image-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.image-file.outputs.path }}
key: image-cache-${{ inputs.image }}
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/devpackpublish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
name: Publish dev package to npm
on:
push:
branches:
- develop
paths:
- '**/*.ts'
- 'package.json'
- '**/package.json'
- '!**/*.spec.ts'
- '!**/__integrationtests__'
- '!**/__mocks__'
- '!docs/**'
on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && github.repository == 'kiltprotocol/sdk-js'"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# fetch-depth 0 and token needed to push changes on the package.json files back.
fetch-depth: 0
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install and Build
run: |
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/npmpublish-rc.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
name: Publish candidate package

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
npm_tag:
description: The tag with which the package is tagged on npm.
required: true
options:
- dev
- alpha
- beta
- rc
type: choice
default: dev

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -19,8 +31,8 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -32,9 +44,9 @@ jobs:
run: yarn run bundle
- name: Get current package version
id: package_version
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Publish to NPM
run: yarn run publish --tag rc
run: yarn run publish --tag ${{ inputs.npm_tag }}
env:
YARN_NPM_AUTH_TOKEN: ${{secrets.npm_token}}
- name: Repository Dispatch
Expand All @@ -43,4 +55,4 @@ jobs:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: KILTProtocol/docs
event-type: sdk-update
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'
12 changes: 6 additions & 6 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -19,8 +19,8 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -32,7 +32,7 @@ jobs:
run: yarn run bundle
- name: Get current package version
id: package_version
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Publish to NPM
run: yarn run publish --tag latest
env:
Expand All @@ -43,4 +43,4 @@ jobs:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: KILTProtocol/docs
event-type: sdk-update
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'
33 changes: 16 additions & 17 deletions .github/workflows/test-node-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ env:
TESTCONTAINERS_WATCHER_IMG: testcontainers/ryuk:0.3.2

jobs:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -30,7 +29,7 @@ jobs:
- name: zip build
run: zip -r build.zip .
- name: upload build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
path: build.zip
Expand All @@ -39,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: make sure testcontainers image is in cache
uses: ./.github/actions/cached-image-pull
with:
Expand All @@ -51,28 +50,28 @@ jobs:
needs: cache_imgs

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build
- name: unzip
run: unzip build.zip -d .
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Log out node version
run: node --version

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@v2

- name: pull image
env:
Expand All @@ -97,19 +96,19 @@ jobs:
needs: build

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build
- name: unzip
run: unzip build.zip -d .
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: yarn bundle
run: yarn bundle
- name: upload bundle artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: checked-nonmin-bundle
path: packages/sdk-js/dist/sdk-js.umd.js
Expand All @@ -120,29 +119,29 @@ jobs:
needs: [cache_imgs, bundle_cache]

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build
- name: unzip
run: unzip build.zip -d .
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: checked-nonmin-bundle
path: packages/sdk-js/dist
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: basename /packages/sdk-js/dist/
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@v2
- name: pull node image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/tests-polkadot-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: master
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
Expand All @@ -35,7 +35,7 @@ jobs:
- name: list dependencies
run: echo "$(yarn info -A --name-only --json)" > locked_dependencies.txt
- name: upload dependencies list
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: deps-${{ matrix.node-version }}
path: |
Expand All @@ -47,7 +47,7 @@ jobs:
- name: zip build
run: zip -r build.zip .
- name: upload build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.node-version }}
path: build.zip
Expand All @@ -58,16 +58,18 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]
required: ['required']
include:
- node-version: 20.x
- node-version: 16.x
required: 'optional'
- node-version: 22.x
required: 'optional'

continue-on-error: ${{ matrix.required == 'optional' }}

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build-${{ matrix.node-version }}
- name: unzip
Expand All @@ -91,9 +93,9 @@ jobs:
continue-on-error: ${{ matrix.required == 'optional' }}

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build-16.x
name: build-20.x
- name: unzip
run: unzip build.zip -d .

Expand All @@ -106,9 +108,9 @@ jobs:

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@v2

- name: pull image
- name: pull node image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: kilt/prototype-chain
Expand All @@ -135,9 +137,9 @@ jobs:
needs: [test, integration_test]
if: failure()
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: deps-16.x
name: deps-20.x
- name: set dependencies env
run: |
echo 'DEPS<<EOF' >> $GITHUB_ENV
Expand Down
Loading

0 comments on commit ec335d7

Please sign in to comment.