Skip to content

Commit

Permalink
add a basic service
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinewg committed Apr 30, 2022
1 parent c92f64f commit 4038507
Show file tree
Hide file tree
Showing 15 changed files with 2,201 additions and 1,257 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ node_modules
# testing
coverage

# next.js
.next/
out/
build

# misc
.DS_Store
*.pem
Expand Down
51 changes: 11 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Turborepo starter with pnpm

This is an official starter turborepo.
This is an unofficial starter turborepo for serverless + typescript.

## What's inside?

This turborepo uses [pnpm](https://pnpm.io) as a packages manager. It includes the following packages/apps:

### Apps and Packages
### 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
- `config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
- `config`: `eslint` configurations (includes `eslint-config-prettier`)
- `tsconfig`: `tsconfig.json`s used throughout the monorepo

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

### Services

TODO

### Utilities

Expand All @@ -24,15 +25,11 @@ This turborepo has some additional tools already setup for you:
- [ESLint](https://eslint.org/) for code linting
- [Prettier](https://prettier.io) for code formatting

## Setup

This repository is used in the `npx create-turbo@latest` command, and selected when choosing which package manager you wish to use with your monorepo (pnpm).

### Build

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

```
```bash
cd my-turborepo
pnpm run build
```
Expand All @@ -41,37 +38,11 @@ pnpm run build

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

```
```bash
cd my-turborepo
pnpm run dev
```

### Remote Caching

Turborepo can use a technique known as [Remote Caching (Beta)](https://turborepo.org/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 (Beta) 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
pnpx 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:

```
pnpx turbo link
```

## Useful Links

Learn more about the power of Turborepo:

- [Pipelines](https://turborepo.org/docs/core-concepts/pipelines)
- [Caching](https://turborepo.org/docs/core-concepts/caching)
- [Remote Caching (Beta)](https://turborepo.org/docs/core-concepts/remote-caching)
- [Scoped Tasks](https://turborepo.org/docs/core-concepts/scopes)
- [Configuration Options](https://turborepo.org/docs/reference/configuration)
- [CLI Usage](https://turborepo.org/docs/reference/command-line-reference)
See [Remote Caching (Beta)](https://turborepo.org/docs/core-concepts/remote-caching) for more info.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "turborepo-basic-shared",
"name": "turbo-serverless-typescript-starter",
"version": "0.0.0",
"private": true,
"workspaces": [
"apps/*",
"packages/*"
"packages/*",
"services/*"
],
"scripts": {
"build": "turbo run build",
Expand Down
72 changes: 72 additions & 0 deletions packages/config/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
module.exports = {
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"plugin:you-dont-need-lodash-underscore/compatible",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:jest/recommended",
"plugin:jest/style",
"plugin:security/recommended"
],
"plugins": [
"@typescript-eslint",
"jest",
"security",
"node"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/semi": "warn",
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/no-namespace": "warn",
"security/detect-object-injection": "warn",
"no-var": "error",
"no-console": "warn",
"camelcase": "off",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off",
"no-empty": "warn",
"no-unused-expressions": ["error", { "allowTernary": true }],
"no-use-before-define": "off",
"@typescript-eslint/naming-convention": [
"error",
{ "selector": "variableLike", "format": ["camelCase"] },
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"]
},
{
"selector": "variable",
"types": ["boolean"],
"format": ["PascalCase"],
"prefix": ["is", "should", "has", "can", "did", "will"]
},
{
"selector": "typeParameter",
"format": ["PascalCase"],
"prefix": ["T"]
}
]
},
"ignorePatterns": [
"./package.json",
"./package-lock.json"
]
}
3 changes: 3 additions & 0 deletions packages/config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `config`

These are base shared ESLint config files from which all other `.eslintrc.json`'s inherit from.
8 changes: 0 additions & 8 deletions packages/config/eslint-preset.js

This file was deleted.

13 changes: 10 additions & 3 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
"main": "index.js",
"license": "MIT",
"files": [
"eslint-preset.js"
".eslintrc.js"
],
"dependencies": {
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"eslint": "^8.14.0",
"eslint-config-prettier": "^8.3.0"
"eslint-plugin-jest": "^26.1.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-security": "^1.5.0",
"eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0",
"jest": "^28.0.3",
"typescript": "^4.5.3"
}
}
Loading

0 comments on commit 4038507

Please sign in to comment.