Skip to content

Commit

Permalink
initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jinoosss committed Jul 30, 2024
0 parents commit c398e4e
Show file tree
Hide file tree
Showing 23 changed files with 2,648 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Setup
description: Set up project environment.
runs:
using: composite
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.yarn
key: yarn-${{ hashFiles('yarn.lock') }}
restore-keys: yarn-

- name: Install modules
shell: sh
run: yarn install
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
Thanks for sending a pull request!
If this is your first time, please read our contributor guidelines:
https://github.com/onbloc/adena-wallet/blob/main/CONTRIBUTING.md
-->

### What type of PR is this?

<!--
Add one of the following kinds:
- feature
- chore
- bug
- style
- cleanup
- documentation
- test
-->

### What this PR does:
10 changes: 10 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
on:
workflow_call:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup
- run: yarn build
10 changes: 10 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
on:
workflow_call:
workflow_dispatch:

jobs:
lints:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup
- run: yarn lint
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
branches:
- main
pull_request:

jobs:
lints:
name: Linter
uses: ./.github/workflows/lint.yaml

tests:
name: Test
uses: ./.github/workflows/test.yaml

build:
name: Build
uses: ./.github/workflows/build.yaml
10 changes: 10 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
on:
workflow_call:
workflow_dispatch:

jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup
- run: yarn test:ci
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dependencies
node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# testing
/coverage

# Build files
build
bin

# Dev environment metadata
.idea
.DS_Store
*.log
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.14.2
894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.3.1.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
enableScripts: false

enableTelemetry: false

nodeLinker: node-modules

pnpMode: loose

yarnPath: .yarn/releases/yarn-4.3.1.cjs
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright 2024 Onbloc, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Adena Wallet SDK

## Adena Wallet SDK allows dapps to connect to Adena Wallet

1. Adena Wallet
- [Docs](https://docs.adena.app)
- [Extension](https://www.adena.app/)

### Installing Adena Wallet SDK

1. Check available versions:

```shell
# yarn
yarn info @adena-wallet/sdk versions

# npm
npm view @adena-wallet/sdk versions
```

2. Install latest version:

```shell
# yarn
yarn add @adena-wallet/sdk

# npm
npm install @adena-wallet/sdk
```

3. Check installed version:

```shell
# yarn
yarn list @adena-wallet/sdk

# npm
npm list @adena-wallet/sdk
```

### Development Setup

The Node.js version is 18.14.2.
We recommend using [nvm](https://github.com/nvm-sh/nvm).

```bash
# If you don't have that version installed,
# $ nvm install

$ nvm use
```
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "adena-wallet-sdk",
"version": "0.0.1",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/onbloc/adena-wallet-sdk"
},
"scripts": {
"build": "yarn workspaces foreach -vptR run build",
"lint": "yarn workspaces foreach -vA run lint",
"lint:fix": "yarn workspaces foreach -vA run lint:fix",
"test": "yarn workspaces foreach -vA run test",
"test:ci": "yarn workspaces foreach -vA run test:ci"
},
"workspaces": [
"packages/sdk"
],
"packageManager": "yarn@4.3.1"
}
29 changes: 29 additions & 0 deletions packages/sdk/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"ignorePatterns": ["node_modules/*", "*.json", "bin/*"],
"plugins": ["@typescript-eslint"],
"rules": {
"comma-dangle": ["error", "always-multiline"],
"quotes": ["error", "single"],
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-unused-vars": "error"
},
"settings": {
"import/resolver": {
"typescript": {}
}
}
}
6 changes: 6 additions & 0 deletions packages/sdk/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
printWidth: 120 # Specify the line length that the printer will wrap on
trailingComma: es5 # Trailing commas where valid in ES5
tabWidth: 2 # Specify the number of spaces per indentation-level
semi: true # Print semicolons at the ends of statements
bracketSpacing: true # Print spaces between brackets in object literals
singleQuote: true # Use single quotes instead of double quotes
20 changes: 20 additions & 0 deletions packages/sdk/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright 2024 Onbloc, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
51 changes: 51 additions & 0 deletions packages/sdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Adena Wallet SDK

## Adena Wallet SDK allows dapps to connect to Adena Wallet

1. Adena Wallet
- [Docs](https://docs.adena.app)
- [Extension](https://www.adena.app/)

### Installing Adena Wallet SDK

1. Check available versions:

```shell
# yarn
yarn info @adena-wallet/sdk versions

# npm
npm view @adena-wallet/sdk versions
```

2. Install latest version:

```shell
# yarn
yarn add @adena-wallet/sdk

# npm
npm install @adena-wallet/sdk
```

3. Check installed version:

```shell
# yarn
yarn list @adena-wallet/sdk

# npm
npm list @adena-wallet/sdk
```

### Development Setup

The Node.js version is 18.14.2.
We recommend using [nvm](https://github.com/nvm-sh/nvm).

```bash
# If you don't have that version installed,
# $ nvm install

$ nvm use
```
46 changes: 46 additions & 0 deletions packages/sdk/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: ['**/*.json', 'node_modules/*', 'bin/*'],
},
...compat.extends('plugin:@typescript-eslint/recommended', 'prettier'),
{
plugins: {
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
globals: {
...globals.browser,
...globals.jest,
},

parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
},

settings: {
'import/resolver': {
typescript: {},
},
},

rules: {},
},
];
5 changes: 5 additions & 0 deletions packages/sdk/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"preset": "ts-jest",
"testEnvironment": "node",
"modulePathIgnorePatterns": ["bin", "node_modules"]
}
Loading

0 comments on commit c398e4e

Please sign in to comment.