Skip to content

Commit

Permalink
fix: scaffolding (#16)
Browse files Browse the repository at this point in the history
# 🤖 Linear

Closes ZKS-XXX

## Description
  • Loading branch information
0xkenj1 authored May 29, 2024
1 parent 8df4943 commit ba9dd4a
Show file tree
Hide file tree
Showing 55 changed files with 833 additions and 1,699 deletions.
3 changes: 0 additions & 3 deletions .commitlintrc

This file was deleted.

3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
36 changes: 18 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Build

on:
workflow_call:
workflow_call:

jobs:
build:
name: Run Build
runs-on: ubuntu-latest
build:
name: Run Build
runs-on: ubuntu-latest

steps:
- name: Check out github repository
uses: actions/checkout@v3
with:
fetch-depth: 1
steps:
- name: Check out github repository
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"

- name: Install dependencies
run: yarn --immutable
- name: Install dependencies
run: yarn --immutable

- name: Run Build
run: yarn build
- name: Run Build
run: yarn build
62 changes: 31 additions & 31 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
name: Lint

on:
workflow_call:
workflow_call:

jobs:
commitlint:
name: Lint Commit Messages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5

lint:
name: Run Linters
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"

- name: Install dependencies
run: yarn --immutable

- name: Run Prettier
run: yarn format

- name: Run Linter
run: yarn lint
commitlint:
name: Lint Commit Messages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5

lint:
name: Run Linters
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"

- name: Install dependencies
run: yarn --immutable

- name: Run Prettier
run: yarn format

- name: Run Linter
run: yarn lint
30 changes: 15 additions & 15 deletions .github/workflows/main-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: Main Workflow

on:
pull_request:
types: [opened, synchronize]
branches:
- dev
- main
pull_request:
types: [opened, synchronize]
branches:
- dev
- main

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
build:
uses: ./.github/workflows/build.yml
build:
uses: ./.github/workflows/build.yml

lint:
uses: ./.github/workflows/lint.yml
needs: build
lint:
uses: ./.github/workflows/lint.yml
needs: build

test:
uses: ./.github/workflows/test.yml
needs: lint
test:
uses: ./.github/workflows/test.yml
needs: lint
41 changes: 20 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
name: Tests

on:
workflow_call:
workflow_call:

jobs:
unit:
name: Run unit tests
runs-on: ubuntu-latest
steps:

- name: Log Not Implemented Message
run: echo "Not implemented yet"
# - name: Check out github repository
# uses: actions/checkout@v3
# with:
# fetch-depth: 1
unit:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- name: Log Not Implemented Message
run: echo "Not implemented yet"
# - name: Check out github repository
# uses: actions/checkout@v3
# with:
# fetch-depth: 1

# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 18.x
# cache: "yarn"
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 18.x
# cache: "yarn"

# - name: Install dependencies
# run: yarn --immutable
# - name: Install dependencies
# run: yarn --immutable

# - name: Run tests
# run: yarn test
# - name: Run tests
# run: yarn test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
!.yarn/sdks
!.yarn/versions

*.tsbuildinfo

# Dependencies
node_modules

Expand Down
875 changes: 0 additions & 875 deletions .yarn/releases/yarn-3.8.2.cjs

This file was deleted.

9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ The zkChainHub project for zkSync involves the creation of a comprehensive data

## Packages

- `@zkChainHub/typescript-config`: `tsconfig.json`s used throughout the monorepo
- `@zkChainHub/serverless`: Includes all serverless functions from the repository.
- `@zkchainhub/serverless`: Includes all serverless functions from the repository.

## Dev Environment

Expand All @@ -23,7 +22,7 @@ And `yarn build` Build all packages.
Address changes for each package can be done the following way:

```
yarn workspace @zkChainHub/serverless dev
yarn workspace @zkchainhub/serverless dev
```

## Running tests
Expand All @@ -38,7 +37,7 @@ For testing individual packages:

```
yarn workspace @huperhub/serverless build
yarn workspace @zkChainHub/serverless test
yarn workspace @zkchainhub/serverless test
```

## Creating a new package
Expand All @@ -59,5 +58,5 @@ Adding new dependencies should be done from root level, and not from each packag
For example:

```
yarn workspace @zkChainHub/serverless add ethers
yarn workspace @zkchainhub/serverless add ethers
```
4 changes: 4 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
// Lint then format TypeScript and JavaScript files
"(packages)/**/*.(ts|tsx|js)": (filenames) => [`yarn lint`, `yarn format`],
};
70 changes: 35 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"name": "zkChainHub",
"private": true,
"scripts": {
"build": "turbo build",
"dev": "turbo dev",
"lint": "turbo lint",
"prepare": "husky",
"test": "turbo run test",
"test:watch": "turbo run test:watch",
"format": "prettier --write \"**/*.{ts,tsx,md}\""
},
"workspaces": [
"packages/**",
"tooling/**"
],
"devDependencies": {
"@commitlint/config-conventional": "19.2.2",
"@types/node": "18.13.0",
"@zkChainHub/eslint-config": "workspace:*",
"@zkChainHub/prettier-config": "workspace:*",
"@zkChainHub/test-config": "workspace:*",
"@zkChainHub/typescript-config": "workspace:*",
"commitlint": "19.3.0",
"husky": "9.0.11",
"lint-staged": "15.2.4",
"prettier": "3.2.5",
"ts-node-dev": "2.0.0",
"turbo": "1.13.3",
"typescript": "4.9.4"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": "eslint --cache --fix",
"**/*.{md,json,yml,yaml}": "prettier --write"
},
"packageManager": "[email protected]"
"name": "zkchainhub",
"private": true,
"scripts": {
"build": "turbo build",
"dev": "turbo dev",
"lint": "turbo lint",
"prepare": "husky",
"test": "turbo test",
"format": "prettier --write \"**/*.{js,ts,md,json,yml,yaml}\"",
"clean": "rimraf **/*.tsbuildinfo & rimraf **/dist & rimraf **/.turbo & rimraf **/.cache & rimraf **/node_modules "
},
"workspaces": [
"packages/**",
"tooling/**"
],
"devDependencies": {
"@commitlint/config-conventional": "19.2.2",
"@total-typescript/tsconfig": "1.0.4",
"@types/node": "18.13.0",
"@zkchainhub/eslint-config": "workspace:*",
"@zkchainhub/prettier-config": "workspace:*",
"@zkchainhub/test-config": "workspace:*",
"commitlint": "19.3.0",
"eslint": "8.56.0",
"husky": "9.0.11",
"lint-staged": "13.2.3",
"prettier": "3.2.5",
"rimraf": "5.0.7",
"ts-node-dev": "2.0.0",
"turbo": "1.13.3",
"typescript": "5.4.5",
"vitest": "1.6.0"
},
"packageManager": "[email protected]",
"prettier": "@zkchainhub/prettier-config"
}
7 changes: 7 additions & 0 deletions packages/__example__/__test__/example.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, expect, test } from "vitest";

describe("exampleHandler", () => {
test("Sample exampleHandler test", () => {
expect(true).toBe(true);
});
});
12 changes: 12 additions & 0 deletions packages/__example__/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import parentConfig from "@zkchainhub/eslint-config";

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
...parentConfig,
{
files: ["src/**/*.ts"],
rules: {
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_+" }],
},
},
];
15 changes: 0 additions & 15 deletions packages/__example__/eslint.config.mjs

This file was deleted.

Loading

0 comments on commit ba9dd4a

Please sign in to comment.