Skip to content

Commit 3ee3243

Browse files
authored
feat: add initial structure setup (#4)
* feat: add initial structure setup * refactor: update job name
1 parent 84e0152 commit 3ee3243

32 files changed

+6668
-1
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/dist/**

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-env node */
2+
module.exports = {
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:@typescript-eslint/recommended-type-checked',
7+
],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: {
10+
tsconfigRootDir: __dirname,
11+
project: [
12+
'./tsconfig.eslint.json',
13+
'./packages/*/tsconfig.json',
14+
'./packages/*/test/tsconfig.json',
15+
],
16+
},
17+
plugins: ['@typescript-eslint'],
18+
root: true,
19+
rules: {
20+
'@typescript-eslint/require-await': 'off',
21+
},
22+
};

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'type: bug'
6+
assignees: ''
7+
---
8+
9+
### Expected behavior
10+
11+
### Actual behavior
12+
13+
### Steps to reproduce
14+
15+
### Which version(s) does this affect? (Environment, OS, etc...)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Propose an idea for new improvements/features
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
### Description
10+
11+
Please describe what functionality is needed
12+
13+
### Motivation
14+
15+
Please describe why it is needed
16+
17+
### Additional Information
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature specification
3+
about: Specification of new features/improvements
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
### Description
10+
11+
Please describe the specification of new features/improvements
12+
13+
### Acceptance Criteria
14+
15+
Please describe the conditions which must be met for this issue to close
16+
17+
### Additional Information

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### What was the problem?
2+
3+
This PR resolves #INSERT_ISSUE_NUMBER
4+
5+
### How was it solved?
6+
7+
<!--- Please describe your technical implementation -->
8+
9+
### How was it tested?
10+
11+
<!--- Please describe how you tested your changes -->

.github/workflows/pr.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 'PR'
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
build-and-test:
7+
runs-on: self-hosted
8+
timeout-minutes: 15
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
- name: Use Node.js 18
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: 18
16+
- name: Install yarn
17+
run: npm install --global yarn
18+
- name: Install dependencies
19+
shell: bash
20+
run: yarn --prefer-offline
21+
- name: Build
22+
shell: bash
23+
run: yarn build
24+
- run: yarn format
25+
- name: Check format
26+
run: |
27+
if [ -z "$(git status --untracked-files=no --porcelain)" ]; then
28+
echo "All files formatted"
29+
else
30+
echo "Running format is required"
31+
exit 1
32+
fi
33+
- run: yarn test

.gitignore

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# Compiled binary addons (https://nodejs.org/api/addons.html)
27+
build/Release
28+
29+
# Dependency directories
30+
node_modules/
31+
32+
# TypeScript cache
33+
*.tsbuildinfo
34+
35+
# Optional npm cache directory
36+
.npm
37+
38+
# Optional eslint cache
39+
.eslintcache
40+
41+
# Optional stylelint cache
42+
.stylelintcache
43+
44+
# Microbundle cache
45+
.rpt2_cache/
46+
.rts2_cache_cjs/
47+
.rts2_cache_es/
48+
.rts2_cache_umd/
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# dotenv environment variable files
57+
.env
58+
.env.development.local
59+
.env.test.local
60+
.env.production.local
61+
.env.local
62+
63+
64+
# generate output
65+
dist
66+
.cache/
67+
68+
# vuepress v2.x temp and cache directory
69+
.temp
70+
.cache
71+
72+
# Stores VSCode versions used for testing VSCode extensions
73+
.vscode-test

.prettierignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Files
2+
LICENSE
3+
.gitkeep
4+
mocha.opts
5+
.DS_Store
6+
REVISION
7+
8+
# rc files
9+
.*rc
10+
## ignore files
11+
.*ignore
12+
13+
# Ignore extensions
14+
*.png
15+
*.sql
16+
*.sh
17+
*.html
18+
*.info
19+
*.xml
20+
*.log
21+
*.proto
22+
*.csv
23+
*.cmd
24+
*.tsbuildinfo
25+
*.blob
26+
*.lock
27+
28+
## jest snapshot
29+
*.snap
30+
31+
# project specific paths
32+
dist/

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"useTabs": true,
6+
"arrowParens": "avoid"
7+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# lisk-token-claim
1+
# lisk-token-claim

package.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "lisk-token-claim",
3+
"private": true,
4+
"version": "0.1.0",
5+
"description": "Packages for token claim process",
6+
"author": "Lisk Foundation <[email protected]>, lightcurve GmbH <[email protected]>",
7+
"license": "Apache-2.0",
8+
"keywords": [
9+
"lisk",
10+
"blockchain"
11+
],
12+
"homepage": "https://github.com/LiskHQ/lisk-token-claim#readme",
13+
"repository": {
14+
"type": "git",
15+
"url": "git+https://github.com/LiskHQ/lisk-token-claim.git"
16+
},
17+
"bugs": {
18+
"url": "https://github.com/LiskHQ/lisk-token-claim/issues"
19+
},
20+
"engines": {
21+
"node": ">=18.0.0",
22+
"npm": ">=8.1.0"
23+
},
24+
"workspaces": [
25+
"packages/*"
26+
],
27+
"scripts": {
28+
"prepare": "husky install",
29+
"postinstall": "husky install",
30+
"lint": "eslint . --ext .ts",
31+
"format": "prettier --write '**/*'",
32+
"build": "yarn workspaces run build",
33+
"test": "yarn workspaces run test"
34+
},
35+
"devDependencies": {
36+
"husky": "8.0.2",
37+
"lint-staged": "13.0.3",
38+
"prettier": "^3.1.1",
39+
"yarn": "^1.22.19",
40+
"eslint": "^8.56.0",
41+
"eslint-config-oclif": "^5",
42+
"eslint-config-oclif-typescript": "^3",
43+
"eslint-config-prettier": "^9.1.0"
44+
}
45+
}

packages/claim-backend/.mocharc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"require": ["ts-node/register"],
3+
"watch-extensions": ["ts"],
4+
"recursive": true,
5+
"reporter": "spec",
6+
"timeout": 60000
7+
}

packages/claim-backend/package.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "@liskhq/claim-backend",
3+
"version": "0.1.0",
4+
"private": true,
5+
"description": "Server to provide proof of the claim",
6+
"author": "Lisk Foundation <[email protected]>, lightcurve GmbH <[email protected]>",
7+
"license": "Apache-2.0",
8+
"keywords": [
9+
"blockchain",
10+
"lisk"
11+
],
12+
"main": "index.js",
13+
"repository": {
14+
"type": "git",
15+
"url": "git+https://github.com/LiskHQ/lisk-token-claim.git"
16+
},
17+
"bugs": {
18+
"url": "https://github.com/LiskHQ/lisk-token-claim/issues"
19+
},
20+
"homepage": "https://github.com/LiskHQ/lisk-token-claim#readme",
21+
"engines": {
22+
"node": ">=18.0.0"
23+
},
24+
"scripts": {
25+
"build": "shx rm -rf dist && tsc -b",
26+
"test": "mocha --forbid-only \"test/**/*.test.ts\""
27+
},
28+
"dependencies": {},
29+
"devDependencies": {
30+
"@types/chai": "^4",
31+
"@types/mocha": "^9.0.0",
32+
"@types/node": "^18",
33+
"chai": "^4",
34+
"mocha": "^10",
35+
"shx": "^0.3.3",
36+
"ts-node": "^10.9.2",
37+
"typescript": "^5"
38+
}
39+
}

packages/claim-backend/src/index.ts

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { expect } from 'chai';
2+
3+
describe('Test', () => {
4+
it('should return true', () => {
5+
expect(true).to.be.true;
6+
});
7+
});

packages/claim-backend/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../tsconfig",
3+
"compilerOptions": {
4+
"rootDir": "./src",
5+
"outDir": "./dist"
6+
},
7+
"include": ["src/**/*"]
8+
}

packages/tree-builder/.mocharc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"require": ["ts-node/register"],
3+
"watch-extensions": ["ts"],
4+
"recursive": true,
5+
"reporter": "spec",
6+
"timeout": 60000
7+
}

packages/tree-builder/bin/dev.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
node "%~dp0\dev" %*

packages/tree-builder/bin/dev.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env node_modules/.bin/ts-node
2+
// eslint-disable-next-line node/shebang, unicorn/prefer-top-level-await
3+
(async () => {
4+
const oclif = await import('@oclif/core');
5+
await oclif.execute({ development: true, dir: __dirname });
6+
})();

packages/tree-builder/bin/run.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
node "%~dp0\run" %*

packages/tree-builder/bin/run.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env node
2+
3+
// eslint-disable-next-line unicorn/prefer-top-level-await
4+
(async () => {
5+
const oclif = await import('@oclif/core');
6+
await oclif.execute({ development: false, dir: __dirname });
7+
})();

0 commit comments

Comments
 (0)