Skip to content

Commit

Permalink
chore: release 0.34.0 (#783)
Browse files Browse the repository at this point in the history
* refactor!: nest ctype in ICTypeDetails (#766)
* refactor: change ctype parameter name to cType where possible

* feat: re-export imported types from @kiltprotocol/types (#762)
* feat: deprecate CType meta schema draft-01 (#778)

* fix: default to log level warn in non-production environments

* test: skip expensive delegation node tests
* test: esm variant of integration tests (#779)
* test: make tests work with new kilt node cli (#796)
* chore: update metadata to 1.11.0
* chore(deps): update cbor-web to v9
* chore(deps-dev): bump webpack from 5.70.0 to 5.76.0 (#771)
* chore(deps-dev): bump semver-regex from 3.1.3 to 3.1.4 (#775)
* chore(deps-dev): bump typedoc to resolve dependency conflict
* ci: make latest-develop tests optional and latest mandatory

Co-authored-by: Gerawork Aynekulu <ggera@users.noreply.github.com>
Co-authored-by: Raphael Flechtner <raphael@kilt.io>
  • Loading branch information
3 people committed Aug 22, 2023
1 parent d0445c3 commit cb0b8e1
Show file tree
Hide file tree
Showing 119 changed files with 2,902 additions and 3,325 deletions.
23 changes: 6 additions & 17 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = {
devDependencies: [
'**/*.test.ts',
'**/*.spec.ts',
'**/__integrationtests__/*',
'tests/**/*',
'**/webpack.config.js',
],
},
Expand Down Expand Up @@ -142,7 +142,7 @@ module.exports = {
'jsdoc/check-tag-names': [
'warn',
{
definedTags: ['group', 'packageDocumentation'],
definedTags: ['packageDocumentation'],
},
],
'@typescript-eslint/no-var-requires': 'off',
Expand All @@ -152,31 +152,20 @@ module.exports = {
'no-console': 'off',
},
},
{
files: ['**/__integrationtests__/*.ts', '**/TestUtils.ts'],
rules: {
'import/extensions': 'off',
'jsdoc/require-jsdoc': 'off',
'no-console': 'off',
},
},
{
files: ['**/augment-api/src/interfaces/**/*.ts'],
rules: {
'license-header/header': 'off',
},
},
{
files: ['tests/*'],
files: ['tests/**/*'],
rules: {
'import/extensions': 'off',
'jsdoc/require-jsdoc': 'off',
'no-console': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['tests/*', 'tests/bundle.spec.ts'],
},
],
'import/no-extraneous-dependencies': 'off'
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-node-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:

- name: run integration tests
timeout-minutes: 60
run: yarn test:integration:ci
run: yarn test:integration -b

bundle_cache:
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/tests-polkadot-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,13 @@ jobs:
with:
image: ${{ env.TESTCONTAINERS_WATCHER_IMG }}

- name: run integration tests
- name: run integration tests (cjs)
timeout-minutes: 60
run: yarn test:integration:ci
run: yarn test:integration -b

- name: run integration tests (esm)
timeout-minutes: 60
run: yarn test:integration:esm -b

create-issue:
runs-on: ubuntu-latest
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ jobs:

strategy:
matrix:
image: ['latest-master', 'latest-develop', 'latest']
required: ['optional']
image: ['latest']
required: ['required']
include:
- image: 'latest-develop'
required: 'optional'

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

Expand Down Expand Up @@ -161,9 +164,14 @@ jobs:
with:
image: ${{ env.TESTCONTAINERS_WATCHER_IMG }}

- name: run integration tests
- name: run integration tests (cjs)
timeout-minutes: 60
run: yarn test:integration:ci
run: yarn test:integration -b

- name: run integration tests (esm)
timeout-minutes: 60
run: yarn test:integration:esm -b


bundle_cache:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -193,11 +201,11 @@ jobs:
needs: [cache_imgs, bundle_cache]
strategy:
matrix:
image: ['latest-master', 'latest']
required: ['optional']
image: ['latest']
required: ['required']
include:
- image: 'latest-develop'
required: 'required'
required: 'optional'

continue-on-error: ${{ matrix.required == 'optional' }}
steps:
Expand Down
3 changes: 2 additions & 1 deletion babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[
"@babel/preset-env",
{
"modules": "commonjs"
"modules": "commonjs",
"targets": {"node": "current"}
}
]
]
Expand Down
6 changes: 0 additions & 6 deletions jest-setup/setup.js

This file was deleted.

85 changes: 49 additions & 36 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
module.exports = {
preset: 'ts-jest',
const common = {
testEnvironment: 'node',
clearMocks: true,
runner: 'groups',
// Parachain block time is 12s
testTimeout: 15000,
setupFilesAfterEnv: ['../jest-setup/setup.js'],
setupFilesAfterEnv: ['<rootDir>/tests/jest.setup.js'],
transformIgnorePatterns: ['/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)'],
transform: {
"\\.js$": ["babel-jest", { root: './' }],
"\\.ts$": "ts-jest"
},
resolver: "ts-jest-resolver",
moduleDirectories: [
"node_modules",
"packages/*/src"
],
coverageDirectory: 'coverage',
coverageThreshold: {
global: {
branches: 70,
Expand All @@ -15,37 +21,44 @@ module.exports = {
statements: 80,
},
},
transform: {
"\\.js$": "babel-jest",
"\\.ts$": "ts-jest"
},
collectCoverageFrom: [
'**/*/src/**/*.ts',
'!**/index.ts',
'!**/__integrationtests__/**',
'!**/__mocks__/**',
'!**/__tests__/**',
'!**/lib/**',
'!**/test/**',
'!**/kilt/*',
'!**/types/**/*',
'!**/SDKErrors.ts',
'!utils/src/json-schema/*',
'!testing/**',
'!augment-api/**',
'!type-definitions/**',
'!**/*.chain.ts',
'!did/src/Did.chain.ts',
'!did/src/Did.rpc.ts',
'!did/src/Did.utils.ts',
'!utils/src/jsonabc.ts',
'!core/src/utils.ts',
'packages/*/src/**',
],
resolver: "ts-jest-resolver",
rootDir: 'packages',
coverageDirectory: 'coverage',
moduleDirectories: [
"node_modules",
"packages/*/src"
coveragePathIgnorePatterns: [
// test and library code
'/node_modules/',
'/lib/',
'/tests/',
// not properly testable
'packages/types/',
'packages/augment-api/',
'packages/type-definitions/',
'packages/core/src/kilt/',
'index.ts',
'types.ts',
'.chain.ts',
'SDKErrors.ts',
'Did.rpc.ts',
'packages/core/src/utils.ts',
// third party code copied to this repo
'packages/utils/src/json-schema/',
'jsonabc.ts',
],
}

module.exports = {
...common,
testTimeout: 5000,
projects: [
{
...common,
displayName: 'unit',
roots: ['<rootDir>/packages'],
},
{
...common,
displayName: 'breaking',
roots: ['<rootDir>/tests/breakingChanges'],
},
]
}
30 changes: 14 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@
"build": "yarn workspaces foreach -p -t --exclude '{root-workspace}' run build",
"build:docs": "typedoc --theme default --out docs/api --tsconfig tsconfig.docs.json && touch docs/.nojekyll",
"bundle": "yarn workspace @kiltprotocol/sdk-js run bundle",
"clean": "rimraf tests/dist && yarn workspaces foreach -p --exclude '{root-workspace}' run clean",
"clean": "rimraf tests/bundle/dist && rimraf tests/integration/dist && yarn workspaces foreach -p --exclude '{root-workspace}' run clean",
"clean:docs": "rimraf docs/api",
"prepublish": "yarn workspaces foreach -p --no-private exec cp -f ../../LICENSE .",
"publish": "yarn workspaces foreach -pt --no-private npm publish",
"lint": "eslint packages --format=codeframe",
"lint": "eslint packages tests --format=codeframe",
"lint:fix": "yarn lint --fix",
"set:version": "npm version --no-git-tag-version --no-workspaces-update --workspaces --include-workspace-root",
"style": "prettier -l packages",
"style:fix": "yarn style --write",
"test": "jest --coverage --group=unit",
"test:breaking": "jest --group=breaking",
"test": "jest --coverage --selectProjects=unit",
"test:breaking": "jest --selectProjects=breaking",
"test:ci": "yarn test --ci --forceExit",
"test:integration": "jest --group=integration -w 3 --testTimeout=30000",
"test:integration:ci": "jest --group=integration -b -w 3 --testTimeout=60000",
"test:integration": "jest -c tests/integration/jest.config.integration.js",
"build:esm-tests": "rimraf tests/integration/dist && tsc -p tests/integration/tsconfig.esm.json && echo '{\"type\":\"module\"}' > tests/integration/dist/package.json",
"test:integration:esm": "yarn build:esm-tests && yarn node --experimental-vm-modules $(yarn bin jest) -c tests/integration/jest.config.integration.esm.js",
"test:integration:latest-develop": "TESTCONTAINERS_NODE_IMG=kiltprotocol/mashnet-node:latest-develop yarn test:integration",
"test:watch": "yarn test --watch",
"test:bundle": "tsc -p tests/tsconfig.json && yarn ./tests playwright test --config playwright.config.ts",
"test:bundle": "tsc -p tests/bundle/tsconfig.json && yarn ./tests/bundle playwright test --config playwright.config.ts",
"test:ci:bundle": "yarn test:ci:bundle:preparation && yarn test:bundle",
"test:ci:bundle:preparation": "yarn playwright install-deps && yarn playwright install chromium"
},
Expand All @@ -47,7 +48,7 @@
"@commitlint/cli": "^9.0.1",
"@commitlint/config-conventional": "^9.0.1",
"@playwright/test": "^1.21.1",
"@types/jest": "^27.4.0",
"@types/jest": "^29.5.3",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"eslint": "^7.32.0",
Expand All @@ -58,18 +59,15 @@
"eslint-plugin-license-header": "^0.2.1",
"eslint-plugin-prettier": "^3.4.1",
"husky": "^4.2.5",
"jest": "^27.4.7",
"jest-docblock": "^27.4.0",
"jest-runner": "^27.4.6",
"jest-runner-groups": "^2.1.0",
"jest": "^29.6.1",
"prettier": "^2.4.1",
"rimraf": "^3.0.2",
"testcontainers": "^9.0.0",
"ts-jest": "^27.1.2",
"ts-jest-resolver": "^2.0.0",
"typedoc": "^0.22.15",
"ts-jest": "^29.1.1",
"ts-jest-resolver": "^2.0.1",
"typedoc": "^0.23.0",
"typescript": "^4.8.3"
},
"version": "0.33.1",
"version": "0.34.0",
"packageManager": "yarn@3.3.1"
}
2 changes: 1 addition & 1 deletion packages/asset-did/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kiltprotocol/asset-did",
"version": "0.33.1",
"version": "0.34.0",
"description": "",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/augment-api/metadata/spiritnet.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/augment-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kiltprotocol/augment-api",
"version": "0.33.1",
"version": "0.34.0",
"description": "",
"types": "./lib/index.d.ts",
"type": "module",
Expand Down
40 changes: 37 additions & 3 deletions packages/augment-api/src/interfaces/augment-api-consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,22 @@ declare module '@polkadot/api-base/types/consts' {
did: {
/**
* The amount of balance that will be taken for each DID as a deposit
* to incentivise fair use of the on chain storage. The deposit can be
* reclaimed when the DID is deleted.
* to incentivise fair use of the on chain storage. The deposits
* increase by the amount of used keys and service endpoints. The
* deposit can be reclaimed when the DID is deleted.
**/
deposit: u128 & AugmentedConst<ApiType>;
baseDeposit: u128 & AugmentedConst<ApiType>;
/**
* The amount of balance that will be taken for each DID as a fee to
* incentivise fair use of the on chain storage. The fee will not get
* refunded when the DID is deleted.
**/
fee: u128 & AugmentedConst<ApiType>;
/**
* The amount of balance that will be taken for each added key as a
* deposit to incentivise fair use of the on chain storage.
**/
keyDeposit: u128 & AugmentedConst<ApiType>;
/**
* The maximum number of blocks a DID-authorized operation is
* considered valid after its creation.
Expand Down Expand Up @@ -188,6 +194,13 @@ declare module '@polkadot/api-base/types/consts' {
* Should be greater than `MaxNewKeyAgreementKeys`.
**/
maxTotalKeyAgreementKeys: u32 & AugmentedConst<ApiType>;
/**
* The amount of balance that will be taken for each service endpoint
* as a deposit to incentivise fair use of the on chain storage. The
* deposit can be reclaimed when the service endpoint is removed or the
* DID deleted.
**/
serviceEndpointDeposit: u128 & AugmentedConst<ApiType>;
};
didLookup: {
/**
Expand Down Expand Up @@ -216,6 +229,27 @@ declare module '@polkadot/api-base/types/consts' {
**/
initialPeriodReward: u128 & AugmentedConst<ApiType>;
};
multisig: {
/**
* The base amount of currency needed to reserve for creating a multisig execution or to
* store a dispatch call for later.
*
* This is held for an additional storage item whose value size is
* `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is
* `32 + sizeof(AccountId)` bytes.
**/
depositBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of currency needed per unit threshold when creating a multisig execution.
*
* This is held for adding 32 bytes more into a pre-existing storage value.
**/
depositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of signatories allowed in the multisig.
**/
maxSignatories: u32 & AugmentedConst<ApiType>;
};
parachainStaking: {
/**
* Default number of blocks validation rounds last, as set in the
Expand Down
Loading

0 comments on commit cb0b8e1

Please sign in to comment.