-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: setup monorepo and linting (#1)
- Loading branch information
Showing
17 changed files
with
4,936 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
root: true | ||
|
||
parser: '@typescript-eslint/parser' | ||
|
||
plugins: | ||
- '@typescript-eslint' | ||
- prettier | ||
- import | ||
|
||
parserOptions: | ||
tsconfigRootDir: . | ||
project: | ||
- './tsconfig.eslint.json' | ||
- './packages/**/tsconfig.json' | ||
|
||
extends: | ||
- eslint:recommended | ||
- plugin:@typescript-eslint/strict | ||
- plugin:@typescript-eslint/stylistic | ||
- plugin:prettier/recommended | ||
|
||
ignorePatterns: | ||
- '**/build/**' | ||
- '**/node_modules/**' | ||
|
||
rules: | ||
'@typescript-eslint/consistent-type-definitions': off | ||
'@typescript-eslint/no-extraneous-class': off | ||
'@typescript-eslint/no-use-before-define': | ||
- error | ||
- functions: false | ||
classes: false | ||
variables: true | ||
'@typescript-eslint/explicit-member-accessibility': error | ||
no-console: error | ||
'@typescript-eslint/consistent-type-imports': error | ||
import/newline-after-import: | ||
- error | ||
- count: 1 | ||
import/order: | ||
- error | ||
- groups: | ||
- type | ||
- - builtin | ||
- external | ||
- parent | ||
- sibling | ||
- index | ||
alphabetize: | ||
order: asc | ||
newlines-between: always | ||
'@typescript-eslint/no-non-null-assertion': error | ||
import/no-extraneous-dependencies: | ||
- error | ||
- devDependencies: false | ||
|
||
overrides: | ||
- files: '**/tests/**' | ||
env: | ||
jest: true | ||
node: true | ||
|
||
- files: | ||
- '**/scripts/**' | ||
- '**/*.config.js' | ||
env: | ||
node: true | ||
rules: | ||
no-undef: off | ||
no-console: off | ||
'@typescript-eslint/no-var-requires': off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: 'Pipeline' | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
|
||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
continous-integration: | ||
name: 'Continuous Integration' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.6.0 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Check formatting | ||
run: pnpm check-format | ||
|
||
- name: Check types | ||
run: pnpm check-types | ||
|
||
- name: Test | ||
run: pnpm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node-linker=hoisted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"printWidth": 120, | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# adeya-sdk | ||
# adeya-sdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { JestConfigWithTsJest } from 'ts-jest' | ||
|
||
const config: JestConfigWithTsJest = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
transform: { | ||
'^.+\\.ts$': [ | ||
'ts-jest', | ||
{ | ||
tsconfig: 'tsconfig.test.json', | ||
isolatedModules: true | ||
} | ||
] | ||
} | ||
} | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "adeya-sdk", | ||
"private": true, | ||
"license": "Apache-2.0", | ||
"description": "", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/credebl/adeya-sdk" | ||
}, | ||
"scripts": { | ||
"lint": "eslint .", | ||
"test": "jest", | ||
"check-types": "pnpm -r check-types", | ||
"check-format": "pnpm prettier --list-different", | ||
"build": "pnpm -r build", | ||
"clean": "pnpm -r clean", | ||
"prettier": "prettier --ignore-path .gitignore '**/*.+(js|json|ts|md|yml|yaml)'", | ||
"format": "pnpm prettier --write", | ||
"validate": "pnpm lint && pnpm check-types && pnpm check-format" | ||
}, | ||
"devDependencies": { | ||
"@pnpm/eslint-config": "^1.1.0", | ||
"@types/eslint": "^8.44.3", | ||
"@types/jest": "^29.5.5", | ||
"@types/node": "^20.7.0", | ||
"@typescript-eslint/eslint-plugin": "^6.7.3", | ||
"@typescript-eslint/parser": "^6.7.3", | ||
"eslint": "^8.50.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-import-resolver-typescript": "^3.6.1", | ||
"eslint-plugin-import": "^2.28.1", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"jest": "^29.7.0", | ||
"prettier": "^3.0.3", | ||
"ts-jest": "^29.1.1", | ||
"ts-node": "^10.9.1", | ||
"tsconfig-paths": "^4.2.0", | ||
"typescript": "~5.2.2" | ||
}, | ||
"engines": { | ||
"node": ">= 18" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "@adeya/ssi", | ||
"version": "0.0.0", | ||
"license": "Apache-2.0", | ||
"main": "build/index", | ||
"source": "src/index", | ||
"homepage": "https://github.com/hyperledger/anoncreds-rs/tree/main/wrappers/javascript/anoncreds-shared", | ||
"repository": { | ||
"url": "https://github.com/hyperledger/anoncreds-rs", | ||
"type": "git", | ||
"directory": "packages/ssi" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"files": [ | ||
"build" | ||
], | ||
"scripts": { | ||
"check-types": "pnpm compile --noEmit", | ||
"build": "pnpm clean && pnpm compile", | ||
"clean": "rimraf -rf ./build", | ||
"compile": "tsc" | ||
}, | ||
"devDependencies": { | ||
"rimraf": "3.0.2", | ||
"typescript": "~5.2.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const add = (a: number, b: number) => { | ||
return a + b | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { add } from '../src' | ||
|
||
describe('add function', () => { | ||
it('should return the sum of two numbers', () => { | ||
expect(add(1, 2)).toBe(3) | ||
expect(add(0, 0)).toBe(0) | ||
expect(add(-1, 1)).toBe(0) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"outDir": "./build" | ||
}, | ||
"include": ["src"] | ||
} |
Oops, something went wrong.