Skip to content

refactor: prefer polyrepo #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions packages/eslint-config-custom/library.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,44 @@ const { resolve } = require('node:path');

const project = resolve(process.cwd(), 'tsconfig.json');

/*
* This is a custom ESLint configuration for use with
* typescript packages.
*
* This config extends the Vercel Engineering Style Guide.
* For more information, see https://github.com/vercel/style-guide
*
*/

/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: [
'@vercel/style-guide/eslint/node',
'@vercel/style-guide/eslint/typescript',
].map(require.resolve),
parserOptions: {
project,
},
globals: {
React: true,
JSX: true,
},
settings: {
'import/resolver': {
typescript: {
project,
},
},
},
extends: [
'@vercel/style-guide/eslint/node',
'@vercel/style-guide/eslint/typescript',
].map(require.resolve),
rules: {
'no-bitwise': 'off',
'no-console': 'warn',
'eslint-comments/require-description': 'off',
'import/no-extraneous-dependencies': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
},
ignorePatterns: [
'node_modules/',
'dist/',
'build/',
'coverage/',
'generated/',
'test',
'*.config.*',
'node_modules',
'dist',
'build',
'coverage',
'generated',
'trade-interfaces',
'codegen',
'docs',
],
};
36 changes: 36 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Test

on:
push:
branches:
- main
- 'v**'
- 'releases/v**'
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- 'v**'
- 'releases/v**'

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install packages, build, lint, and test
run: |
pnpm i
pnpm build
pnpm lint
pnpm test
47 changes: 47 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# https://medium.com/full-human/configuring-ci-cd-building-an-npm-package-with-typescript-d0e2393f6bb
name: Bump Package Version and Tag Release

on:
workflow_dispatch:
inputs:
version:
description: 'Semver type of new version (major / minor / patch)'
required: true
type: choice
options:
- patch
- minor
- major

jobs:
bump-pkg-version-and-tag-release:
runs-on: ubuntu-latest
steps:
# Check out the content (source branch). Use a deploy key so that
# when we push changes, it will trigger the release workflow
# run that runs on: tag. (Using the GitHub token would
# not run the workflow to prevent infinite recursion.)
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install packages
run: pnpm i

- name: Setup Git
run: |
git config user.name '${{secrets.MAINTAINER_NAME}}'
git config user.email '${{secrets.MAINTAINER_EMAIL}}'

- name: bump version
run: npm version ${{ github.event.inputs.version }}

- name: Push latest version
run: git push origin main --follow-tags
34 changes: 34 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Deploy Docs

on:
release:
types: [released]

permissions:
contents: write

jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install packages, build, and generate Docs
run: |
pnpm i
pnpm build
pnpm gen-docs

- name: Deploy to Github Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs
42 changes: 42 additions & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Semantic Release

on:
release:
types: [released]

permissions:
contents: read # for checkout

jobs:
semantic-release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install packages and build
run: |
pnpm i
pnpm build

- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: pnpm audit signatures

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
43 changes: 6 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,11 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
*.log
.DS_Store
node_modules
.pnp
.pnp.js
dist

# testing
coverage

# next.js
.next/
out/
build

# misc
.DS_Store
*.pem
!trade.valorem.xyz.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# turbo
.turbo

# vercel
.vercel
src/lib/codegen
src/lib/trade-interfaces

# CI will build and deploy
# apps/docs
# WIP
packages/_react-hooks
docs
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "trade-interfaces"]
path = packages/proto/trade-interfaces
path = src/lib/trade-interfaces
url = https://github.com/valorem-labs-inc/trade-interfaces.git

1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

5 changes: 5 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://json.schemastore.org/semantic-release.json",
"branches": ["main"],
"repositoryUrl": "https://github.com/valorem-labs-inc/sdk.git"
}
7 changes: 0 additions & 7 deletions .vscode/settings.json

This file was deleted.

82 changes: 1 addition & 81 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1 @@
# Turborepo starter

This is an official starter Turborepo.

## Using this example

Run the following command:

```sh
npx create-turbo@latest
```

## What's inside?

This Turborepo includes the following packages/apps:

### Apps and Packages

- `docs`: a [Next.js](https://nextjs.org/) app
- `web`: another [Next.js](https://nextjs.org/) app
- `ui`: a stub React component library shared by both `web` and `docs` applications
- `eslint-config-custom`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
- `tsconfig`: `tsconfig.json`s used throughout the monorepo

Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).

### Utilities

This Turborepo has some additional tools already setup for you:

- [TypeScript](https://www.typescriptlang.org/) for static type checking
- [ESLint](https://eslint.org/) for code linting
- [Prettier](https://prettier.io) for code formatting

### Build

To build all apps and packages, run the following command:

```
cd my-turborepo
pnpm build
```

### Develop

To develop all apps and packages, run the following command:

```
cd my-turborepo
pnpm dev
```

### Remote Caching

Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands:

```
cd my-turborepo
npx turbo login
```

This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:

```
npx turbo link
```

## Useful Links

Learn more about the power of Turborepo:

- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)
TODO
1 change: 0 additions & 1 deletion apps/docs/.nojekyll

This file was deleted.

Loading