Skip to content

Commit

Permalink
Merge pull request #65 from ethdebug/monorepo
Browse files Browse the repository at this point in the history
Switch project to a yarn/lerna monorepo
  • Loading branch information
gnidan authored Jan 7, 2024
2 parents 4bd5303 + dc757e8 commit 3e9e73b
Show file tree
Hide file tree
Showing 71 changed files with 5,275 additions and 3,639 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
- pull_request

jobs:
run-schema-tests:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -12,15 +12,13 @@ jobs:
with:
node-version: 20
cache: yarn
cache-dependency-path: ./tests/yarn.lock
cache-dependency-path: yarn.lock

- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: ./tests

- name: Run schema tests
- name: Run tests
run: yarn test
working-directory: ./tests

build-web:
runs-on: ubuntu-latest
Expand All @@ -31,12 +29,11 @@ jobs:
with:
node-version: 20
cache: yarn
cache-dependency-path: ./web/yarn.lock
cache-dependency-path: yarn.lock

- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: ./web

- name: Build website
run: yarn build
working-directory: ./web
working-directory: ./packages/web
7 changes: 3 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@ jobs:
with:
node-version: 20
cache: yarn
cache-dependency-path: ./web/yarn.lock
cache-dependency-path: yarn.lock

- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: ./web

- name: Build website
run: yarn build
working-directory: ./web
working-directory: ./packages/web

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

publish_dir: ./web/build
publish_dir: ./packages/web/build

# default deployer
user_name: 'github-actions[bot]'
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
docs/build
docs/.venv
node_modules/
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
projects: ["<rootDir>/packages/*"],
};
9 changes: 9 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent",
"npmClient": "yarn",
"packages": [
"packages/*"
],
"rejectCycles": true
}
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"test": "node --experimental-vm-modules $(yarn bin jest)"
},
"devDependencies": {
"lerna": "^8.0.2"
}
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/package.json → packages/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": "node --experimental-vm-modules $(yarn bin jest)"
},
"devDependencies": {
"@hyperjump/json-schema": "^1.6.7",
"@hyperjump/json-schema": "1.6.7",
"@jest/globals": "^29.7.0",
"jest": "^29.7.0",
"json-schema-typed": "^8.0.1",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion tests/src/schemas.ts → packages/tests/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import type { JSONSchema as JSONSchemaTyped } from "json-schema-typed/draft-2020

export type JSONSchema = Exclude<JSONSchemaTyped, boolean>;

const schemasRoot = path.resolve("../schemas");
const filename = import.meta.url.slice("file://".length);
const repositoryRoot = path.resolve(filename, "../../../../");
const schemasRoot = path.resolve(repositoryRoot, "./schemas");

const readSchemas = (): {
[id: string]: JSONSchema
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const config: Config = {
return {
resolve: {
alias: {
react: path.resolve('./node_modules/react'),
react: path.resolve('../../node_modules/react'),
},
fallback: {
buffer: false
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 23 additions & 23 deletions web/src/schemas.ts → packages/web/src/schemas.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import YAML from "yaml";

import typeBaseSchemaYaml from "../../schemas/type/base.schema.yaml";
import typeWrapperSchemaYaml from "../../schemas/type/wrapper.schema.yaml";
import typeReferenceSchemaYaml from "../../schemas/type/reference.schema.yaml";
import typeDefinitionSchemaYaml from "../../schemas/type/definition.schema.yaml";
import typeElementaryUintSchemaYaml from "../../schemas/type/elementary/uint.schema.yaml";
import typeElementaryIntSchemaYaml from "../../schemas/type/elementary/int.schema.yaml";
import typeElementaryBoolSchemaYaml from "../../schemas/type/elementary/bool.schema.yaml";
import typeElementaryBytesSchemaYaml from "../../schemas/type/elementary/bytes.schema.yaml";
import typeElementaryStringSchemaYaml from "../../schemas/type/elementary/string.schema.yaml";
import typeElementaryUfixedSchemaYaml from "../../schemas/type/elementary/ufixed.schema.yaml";
import typeElementaryFixedSchemaYaml from "../../schemas/type/elementary/fixed.schema.yaml";
import typeElementaryAddressSchemaYaml from "../../schemas/type/elementary/address.schema.yaml";
import typeElementaryContractSchemaYaml from "../../schemas/type/elementary/contract.schema.yaml";
import typeElementaryEnumSchemaYaml from "../../schemas/type/elementary/enum.schema.yaml";
import typeElementarySchemaYaml from "../../schemas/type/elementary.schema.yaml";
import typeComplexAliasSchemaYaml from "../../schemas/type/complex/alias.schema.yaml";
import typeComplexArraySchemaYaml from "../../schemas/type/complex/array.schema.yaml";
import typeComplexMappingSchemaYaml from "../../schemas/type/complex/mapping.schema.yaml";
import typeComplexStructSchemaYaml from "../../schemas/type/complex/struct.schema.yaml";
import typeComplexTupleSchemaYaml from "../../schemas/type/complex/tuple.schema.yaml";
import typeComplexFunctionSchemaYaml from "../../schemas/type/complex/function.schema.yaml";
import typeComplexSchemaYaml from "../../schemas/type/complex.schema.yaml";
import typeSchemaYaml from "../../schemas/type.schema.yaml";
import typeBaseSchemaYaml from "../../../schemas/type/base.schema.yaml";
import typeWrapperSchemaYaml from "../../../schemas/type/wrapper.schema.yaml";
import typeReferenceSchemaYaml from "../../../schemas/type/reference.schema.yaml";
import typeDefinitionSchemaYaml from "../../../schemas/type/definition.schema.yaml";
import typeElementaryUintSchemaYaml from "../../../schemas/type/elementary/uint.schema.yaml";
import typeElementaryIntSchemaYaml from "../../../schemas/type/elementary/int.schema.yaml";
import typeElementaryBoolSchemaYaml from "../../../schemas/type/elementary/bool.schema.yaml";
import typeElementaryBytesSchemaYaml from "../../../schemas/type/elementary/bytes.schema.yaml";
import typeElementaryStringSchemaYaml from "../../../schemas/type/elementary/string.schema.yaml";
import typeElementaryUfixedSchemaYaml from "../../../schemas/type/elementary/ufixed.schema.yaml";
import typeElementaryFixedSchemaYaml from "../../../schemas/type/elementary/fixed.schema.yaml";
import typeElementaryAddressSchemaYaml from "../../../schemas/type/elementary/address.schema.yaml";
import typeElementaryContractSchemaYaml from "../../../schemas/type/elementary/contract.schema.yaml";
import typeElementaryEnumSchemaYaml from "../../../schemas/type/elementary/enum.schema.yaml";
import typeElementarySchemaYaml from "../../../schemas/type/elementary.schema.yaml";
import typeComplexAliasSchemaYaml from "../../../schemas/type/complex/alias.schema.yaml";
import typeComplexArraySchemaYaml from "../../../schemas/type/complex/array.schema.yaml";
import typeComplexMappingSchemaYaml from "../../../schemas/type/complex/mapping.schema.yaml";
import typeComplexStructSchemaYaml from "../../../schemas/type/complex/struct.schema.yaml";
import typeComplexTupleSchemaYaml from "../../../schemas/type/complex/tuple.schema.yaml";
import typeComplexFunctionSchemaYaml from "../../../schemas/type/complex/function.schema.yaml";
import typeComplexSchemaYaml from "../../../schemas/type/complex.schema.yaml";
import typeSchemaYaml from "../../../schemas/type.schema.yaml";

export const schemaYamls = [
typeBaseSchemaYaml,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3e9e73b

Please sign in to comment.