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

feat: initial feature set #1

Merged
merged 8 commits into from
Nov 22, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2
93 changes: 93 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"prettier"
],
"ignorePatterns": ["**/*.d.ts", "**/*.js"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "license-header"],
"rules": {
"no-constant-condition": [
"error",
{
"checkLoops": false
}
],
"no-console": [
"error",
{
"allow": ["warn", "error", "info", "debug"]
}
],
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-expect-error": "allow-with-description"
}
],
"@typescript-eslint/ban-tslint-comment": "error",
"@typescript-eslint/consistent-type-assertions": [
"error",
{
"assertionStyle": "as",
"objectLiteralTypeAssertions": "never"
}
],
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-invalid-void-type": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
"ignoreRestSiblings": true,
"args": "none"
}
],
"@typescript-eslint/prefer-for-of": ["error"],
// "@typescript-eslint/prefer-optional-chain": ["error"],
"@typescript-eslint/prefer-ts-expect-error": ["error"],
"license-header/header": ["error", "./license-header.js"],
"import/no-unresolved": "off",
"import/extensions": ["error", "ignorePackages"],
"import/newline-after-import": [
"error",
{
"count": 1
}
],
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal",
["index", "parent", "sibling"],
"object",
"type"
],
"newlines-between": "always",
"pathGroupsExcludedImportTypes": ["builtin"],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
]
}
}
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Swap the comments on the following lines if you wish to use zero-installs
# Documentation here: https://yarnpkg.com/features/zero-installs
# !.yarn/cache
.pnp.*

# Dependencies
node_modules

# Build artefacts

esm
cjs

# VSCode

.vscode
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/Gallium
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cjs
esm
.vscode
.yarn
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"semi": false
}
550 changes: 550 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

Large diffs are not rendered by default.

874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.1.cjs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
nodeLinker: node-modules

npmPublishAccess: public

npmPublishRegistry: "https://registry.npmjs.org"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-3.6.1.cjs
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2023, Built on KILT
All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software must display the following acknowledgement: Built on KILT.
4. Neither the name of KILT nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY BOTLABS GMBH ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BOTLABS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6 changes: 6 additions & 0 deletions license-header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Copyright (c) 2023, BOTLabs GmbH.
*
* This source code is licensed under the BSD 4-Clause "Original" license
* found in the LICENSE file in the root directory of this source tree.
*/
57 changes: 57 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"bugs": "https://github.com/KILTprotocol/dip-sdk/issues",
"description": "An SDK to help integration of the KILT Decentralized Identity Provider (DIP) protocol using KILT as an Identity Provider.",
"dependencies": {
"@kiltprotocol/did": "0.34.0-dip-1",
"@kiltprotocol/types": "0.34.0-dip-1",
"@polkadot/api": "^10.10.1",
"@polkadot/util": "^12.5.1",
"typescript-object-builder": "^0.3.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.9.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-license-header": "^0.6.0",
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
"typescript": "^5.1.6",
"vitest": "^0.33.0"
},
"engines": {
"node": ">=16.0"
},
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"default": "./dist/cjs/index.js"
},
"files": [
"./dist/esm/**/*",
"./dist/cjs/**/*"
],
"homepage": "https://github.com/KILTprotocol/dip-sdk#readme",
"license": "BSD-4-Clause",
"main": "./dist/cjs/index.js",
"name": "@kiltprotocol/dip-sdk",
"packageManager": "[email protected]",
"repository": "github:kiltprotocol/dip-sdk",
"scripts": {
"build": "yarn build:cjs && yarn build:esm",
"build:cjs": "run -T tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json",
"build:esm": "run -T tsc -p tsconfig.json && echo '{\"type\": \"module\"}' > ./dist/esm/package.json",
"check": "tsc -p tsconfig.check.json",
"clean": "yarn rimraf -g */{cjs,esm}",
"lint": "eslint --ext .ts . && prettier -c .",
"lint:fix": "prettier -w . && eslint --fix --ext .ts .",
"test:e2e": "vitest run tests",
"prepublish": "yarn exec cp -f ../../LICENSE .",
"publish": "yarn npm publish --access=public --tolerate-republish"
},
"stableVersion": "0.0.0",
"type": "module",
ntn-x2 marked this conversation as resolved.
Show resolved Hide resolved
"types": "./dist/cjs/index.d.ts",
"version": "0.0.0"
}
14 changes: 14 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Copyright (c) 2023, BOTLabs GmbH.
*
* This source code is licensed under the BSD 4-Clause "Original" license
* found in the LICENSE file in the root directory of this source tree.
*/

/**
* @module @kiltprotocol/dip
*/

export * from "./parent.js"
export * from "./sibling.js"
export * from "./utils.js"
Loading