Skip to content

Commit

Permalink
feat: add initial structure setup (#4)
Browse files Browse the repository at this point in the history
* feat: add initial structure setup

* refactor: update job name
  • Loading branch information
shuse2 authored Jan 8, 2024
1 parent 84e0152 commit 3ee3243
Show file tree
Hide file tree
Showing 32 changed files with 6,668 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/dist/**
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-env node */
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: [
'./tsconfig.eslint.json',
'./packages/*/tsconfig.json',
'./packages/*/test/tsconfig.json',
],
},
plugins: ['@typescript-eslint'],
root: true,
rules: {
'@typescript-eslint/require-await': 'off',
},
};
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'type: bug'
assignees: ''
---

### Expected behavior

### Actual behavior

### Steps to reproduce

### Which version(s) does this affect? (Environment, OS, etc...)
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Propose an idea for new improvements/features
title: ''
labels: ''
assignees: ''
---

### Description

Please describe what functionality is needed

### Motivation

Please describe why it is needed

### Additional Information
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_specification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature specification
about: Specification of new features/improvements
title: ''
labels: ''
assignees: ''
---

### Description

Please describe the specification of new features/improvements

### Acceptance Criteria

Please describe the conditions which must be met for this issue to close

### Additional Information
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### What was the problem?

This PR resolves #INSERT_ISSUE_NUMBER

### How was it solved?

<!--- Please describe your technical implementation -->

### How was it tested?

<!--- Please describe how you tested your changes -->
33 changes: 33 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'PR'
on:
pull_request:

jobs:
build-and-test:
runs-on: self-hosted
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install yarn
run: npm install --global yarn
- name: Install dependencies
shell: bash
run: yarn --prefer-offline
- name: Build
shell: bash
run: yarn build
- run: yarn format
- name: Check format
run: |
if [ -z "$(git status --untracked-files=no --porcelain)" ]; then
echo "All files formatted"
else
echo "Running format is required"
exit 1
fi
- run: yarn test
73 changes: 73 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local


# generate output
dist
.cache/

# vuepress v2.x temp and cache directory
.temp
.cache

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
32 changes: 32 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Files
LICENSE
.gitkeep
mocha.opts
.DS_Store
REVISION

# rc files
.*rc
## ignore files
.*ignore

# Ignore extensions
*.png
*.sql
*.sh
*.html
*.info
*.xml
*.log
*.proto
*.csv
*.cmd
*.tsbuildinfo
*.blob
*.lock

## jest snapshot
*.snap

# project specific paths
dist/
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all",
"useTabs": true,
"arrowParens": "avoid"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# lisk-token-claim
# lisk-token-claim
45 changes: 45 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "lisk-token-claim",
"private": true,
"version": "0.1.0",
"description": "Packages for token claim process",
"author": "Lisk Foundation <[email protected]>, lightcurve GmbH <[email protected]>",
"license": "Apache-2.0",
"keywords": [
"lisk",
"blockchain"
],
"homepage": "https://github.com/LiskHQ/lisk-token-claim#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/LiskHQ/lisk-token-claim.git"
},
"bugs": {
"url": "https://github.com/LiskHQ/lisk-token-claim/issues"
},
"engines": {
"node": ">=18.0.0",
"npm": ">=8.1.0"
},
"workspaces": [
"packages/*"
],
"scripts": {
"prepare": "husky install",
"postinstall": "husky install",
"lint": "eslint . --ext .ts",
"format": "prettier --write '**/*'",
"build": "yarn workspaces run build",
"test": "yarn workspaces run test"
},
"devDependencies": {
"husky": "8.0.2",
"lint-staged": "13.0.3",
"prettier": "^3.1.1",
"yarn": "^1.22.19",
"eslint": "^8.56.0",
"eslint-config-oclif": "^5",
"eslint-config-oclif-typescript": "^3",
"eslint-config-prettier": "^9.1.0"
}
}
7 changes: 7 additions & 0 deletions packages/claim-backend/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"require": ["ts-node/register"],
"watch-extensions": ["ts"],
"recursive": true,
"reporter": "spec",
"timeout": 60000
}
39 changes: 39 additions & 0 deletions packages/claim-backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@liskhq/claim-backend",
"version": "0.1.0",
"private": true,
"description": "Server to provide proof of the claim",
"author": "Lisk Foundation <[email protected]>, lightcurve GmbH <[email protected]>",
"license": "Apache-2.0",
"keywords": [
"blockchain",
"lisk"
],
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/LiskHQ/lisk-token-claim.git"
},
"bugs": {
"url": "https://github.com/LiskHQ/lisk-token-claim/issues"
},
"homepage": "https://github.com/LiskHQ/lisk-token-claim#readme",
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"build": "shx rm -rf dist && tsc -b",
"test": "mocha --forbid-only \"test/**/*.test.ts\""
},
"dependencies": {},
"devDependencies": {
"@types/chai": "^4",
"@types/mocha": "^9.0.0",
"@types/node": "^18",
"chai": "^4",
"mocha": "^10",
"shx": "^0.3.3",
"ts-node": "^10.9.2",
"typescript": "^5"
}
}
Empty file.
7 changes: 7 additions & 0 deletions packages/claim-backend/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { expect } from 'chai';

describe('Test', () => {
it('should return true', () => {
expect(true).to.be.true;
});
});
8 changes: 8 additions & 0 deletions packages/claim-backend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
},
"include": ["src/**/*"]
}
7 changes: 7 additions & 0 deletions packages/tree-builder/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"require": ["ts-node/register"],
"watch-extensions": ["ts"],
"recursive": true,
"reporter": "spec",
"timeout": 60000
}
3 changes: 3 additions & 0 deletions packages/tree-builder/bin/dev.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

node "%~dp0\dev" %*
6 changes: 6 additions & 0 deletions packages/tree-builder/bin/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env node_modules/.bin/ts-node
// eslint-disable-next-line node/shebang, unicorn/prefer-top-level-await
(async () => {
const oclif = await import('@oclif/core');
await oclif.execute({ development: true, dir: __dirname });
})();
3 changes: 3 additions & 0 deletions packages/tree-builder/bin/run.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

node "%~dp0\run" %*
7 changes: 7 additions & 0 deletions packages/tree-builder/bin/run.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node

// eslint-disable-next-line unicorn/prefer-top-level-await
(async () => {
const oclif = await import('@oclif/core');
await oclif.execute({ development: false, dir: __dirname });
})();
Loading

0 comments on commit 3ee3243

Please sign in to comment.