Skip to content

Commit

Permalink
init cli project in ts (#105)
Browse files Browse the repository at this point in the history
* Moving Go files to server dir

* Update workflows to use the new server dir

* Attempt to fix server CI

* Attempt to fix lint workflow

* Add TS CLI base

* Add linting for CLI and update workflows server test job name

* Remove useless zip files

* Change massa-web3 dependency to version 5.0.0-next
  • Loading branch information
thomas-senechal authored Sep 5, 2024
1 parent ca38cdf commit 0f9265b
Show file tree
Hide file tree
Showing 97 changed files with 3,708 additions and 47 deletions.
4 changes: 3 additions & 1 deletion .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ runs:
with:
node-version: 20
cache: 'npm'
cache-dependency-path: pages/package-lock.json
cache-dependency-path: server/pages/package-lock.json

- name: Install Dependencies
run: task install
shell: bash
working-directory: ./server

- name: Generate
run: task generate
shell: bash
working-directory: ./server
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jobs:
target: darwin

runs-on: ${{ matrix.os }}

defaults:
run:
working-directory: ./server

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ on:
pull_request:

jobs:
lint:
lint-server:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./server

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -22,6 +27,7 @@ jobs:
with:
version: v1.59
args: --timeout=3m
working-directory: ./server

- name: install gofumpt
run: go install mvdan.cc/gofumpt@latest
Expand All @@ -35,18 +41,35 @@ jobs:
exit 1
fi
lint-cli:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cli
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: ./cli/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run code formating and linting
run: npm run fmt:check

lint-frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./pages
working-directory: ./server/pages
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: ./pages/package-lock.json
cache-dependency-path: ./server/pages/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run code formating and linting
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ on:
pull_request:

jobs:
test:
test-server:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./server

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
11 changes: 2 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
build

*.log

# Websites archives
*.zip

# Yaml files
*.yaml
# IDE
.idea

# MacOS
.DS_Store
3 changes: 3 additions & 0 deletions cli/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bin
node_modules
scripts
11 changes: 11 additions & 0 deletions cli/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: ['@massalabs', 'prettier'],
rules: {
'tsdoc/syntax': 'warn',
'max-len': ['error', 200],
camelcase: 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-console': 'warn',
'comma-dangle': 'off',
},
}
33 changes: 33 additions & 0 deletions cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

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

# Dependency directories
node_modules/
# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# build folder
dist/
bin/
9 changes: 9 additions & 0 deletions cli/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import("prettier").Config} */
const config = {
trailingComma: 'es5',
tabWidth: 2,
semi: false,
singleQuote: true,
}

module.exports = config
Loading

0 comments on commit 0f9265b

Please sign in to comment.