├── apps
├── docs
│ ├── pages
│ │ ├── getting-started.md
│ │ ├── index.md
│ │ └── .vitepress
│ │ │ ├── theme
│ │ │ └── index.js
│ │ │ └── config.js
│ └── package.json
└── web
│ ├── app.vue
│ ├── tsconfig.json
│ ├── .gitignore
│ ├── nuxt.config.ts
│ ├── package.json
│ └── README.md
├── .npmrc
├── pnpm-workspace.yaml
├── packages
├── ui
│ ├── env.d.ts
│ ├── tsconfig.json
│ ├── components
│ │ ├── Button.story.vue
│ │ └── Button.vue
│ ├── histoire.config.ts
│ ├── vite.config.ts
│ ├── nuxt.mjs
│ ├── package.json
│ └── tests
│ │ └── Button.test.ts
├── eslint-config-custom
│ ├── index.js
│ └── package.json
└── tsconfig
│ ├── README.md
│ ├── package.json
│ ├── histoire.json
│ └── base.json
├── .eslintrc.js
├── .release-it.json
├── .github
└── workflows
│ ├── setup
│ └── action.yaml
│ └── ci.yaml
├── renovate.json
├── CHANGELOG.md
├── .gitignore
├── turbo.json
├── package.json
└── README.md
/apps/docs/pages/getting-started.md:
--------------------------------------------------------------------------------
1 | # Getting started
2 |
--------------------------------------------------------------------------------
/apps/docs/pages/index.md:
--------------------------------------------------------------------------------
1 | # Hello VitePress
2 |
3 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | shamefully-hoist=true
2 | strict-peer-dependencies=false
3 |
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - "apps/*"
3 | - "packages/*"
4 |
--------------------------------------------------------------------------------
/packages/ui/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/apps/web/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/eslint-config-custom/index.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ['turbo', '@antfu'],
3 | }
4 |
--------------------------------------------------------------------------------
/apps/web/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | // https://v3.nuxtjs.org/concepts/typescript
3 | "extends": "./.nuxt/tsconfig.json"
4 | }
5 |
--------------------------------------------------------------------------------
/apps/web/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | *.log*
3 | .nuxt
4 | .nitro
5 | .cache
6 | .output
7 | .env
8 | dist
9 | .netlify
10 |
--------------------------------------------------------------------------------
/packages/tsconfig/README.md:
--------------------------------------------------------------------------------
1 | # `tsconfig`
2 |
3 | These are base shared `tsconfig.json`s from which all other `tsconfig.json`'s inherit from.
4 |
--------------------------------------------------------------------------------
/packages/ui/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@myturborepo/tsconfig/histoire.json",
3 | "include": [
4 | "env.d.ts",
5 | "./**/*",
6 | "./**/*.vue"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/packages/ui/components/Button.story.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/packages/tsconfig/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@myturborepo/tsconfig",
3 | "version": "0.0.0",
4 | "private": true,
5 | "files": [
6 | "base.json",
7 | "histoire.json"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/apps/web/nuxt.config.ts:
--------------------------------------------------------------------------------
1 | // https://v3.nuxtjs.org/api/configuration/nuxt.config
2 | export default defineNuxtConfig({
3 | modules: ['@myturborepo/ui'],
4 | nitro: {
5 | preset: 'netlify',
6 | },
7 | })
8 |
--------------------------------------------------------------------------------
/packages/ui/histoire.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'histoire'
2 | import { HstVue } from '@histoire/plugin-vue'
3 |
4 | export default defineConfig({
5 | plugins: [
6 | HstVue(),
7 | ],
8 | })
9 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | // This tells ESLint to load the config from the package `eslint-config-custom`
4 | extends: ['@myturborepo/eslint-config-custom'],
5 | settings: {
6 | next: {
7 | rootDir: ['apps/*/'],
8 | },
9 | },
10 | }
11 |
--------------------------------------------------------------------------------
/apps/docs/pages/.vitepress/theme/index.js:
--------------------------------------------------------------------------------
1 | import DefaultTheme from 'vitepress/theme'
2 | import MyButton from '@myturborepo/ui/components/Button.vue'
3 |
4 | export default {
5 | ...DefaultTheme,
6 | enhanceApp({ app }) {
7 | app.component('MyButton', MyButton)
8 | },
9 | }
10 |
--------------------------------------------------------------------------------
/packages/ui/vite.config.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import vue from '@vitejs/plugin-vue'
3 | import { defineConfig } from 'vite'
4 |
5 | export default defineConfig({
6 | plugins: [vue()],
7 | test: {
8 | reporters: ['verbose'],
9 | include: ['tests/**/*.test.ts'],
10 | globals: true,
11 | environment: 'jsdom',
12 | },
13 | })
14 |
--------------------------------------------------------------------------------
/packages/tsconfig/histoire.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "display": "Histoire",
4 | "extends": "./base.json",
5 | "compilerOptions": {
6 | "target": "ESNext",
7 | "module": "ESNext",
8 | "lib": ["ESNext"],
9 | "strictNullChecks": true,
10 | "resolveJsonModule": true,
11 | "jsx": "preserve"
12 | }
13 | }
--------------------------------------------------------------------------------
/apps/docs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "docs",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "vitepress dev pages",
7 | "build": "vitepress build pages",
8 | "serve": "vitepress serve pages"
9 | },
10 | "devDependencies": {
11 | "@myturborepo/ui": "workspace:*",
12 | "vitepress": "1.0.0-beta.1",
13 | "vue": "^3.3.4"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/.release-it.json:
--------------------------------------------------------------------------------
1 | {
2 | "git": {
3 | "commitMessage": "chore: release v${version}"
4 | },
5 | "github": {
6 | "release": true,
7 | "releaseName": "v${version}"
8 | },
9 | "npm": {
10 | "publish": false
11 | },
12 | "plugins": {
13 | "@release-it/conventional-changelog": {
14 | "preset": "conventionalcommits",
15 | "infile": "CHANGELOG.md"
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/eslint-config-custom/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@myturborepo/eslint-config-custom",
3 | "version": "0.0.0",
4 | "main": "index.js",
5 | "private": true,
6 | "dependencies": {
7 | "@antfu/eslint-config": "^0.39.3",
8 | "eslint": "^8.41.0",
9 | "eslint-config-turbo": "latest"
10 | },
11 | "devDependencies": {
12 | "typescript": "^4.9.5"
13 | },
14 | "publishConfig": {
15 | "access": "public"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/ui/nuxt.mjs:
--------------------------------------------------------------------------------
1 | import { join, dirname } from 'path'
2 | import { fileURLToPath } from 'url'
3 | import { defineNuxtModule } from '@nuxt/kit'
4 |
5 | const __dirname = dirname(fileURLToPath(import.meta.url))
6 |
7 | export default defineNuxtModule({
8 | hooks: {
9 | 'components:dirs'(dirs) {
10 | dirs.push({
11 | path: join(__dirname, 'components'),
12 | prefix: 'MyTurborepo',
13 | })
14 | },
15 | },
16 | })
17 |
--------------------------------------------------------------------------------
/.github/workflows/setup/action.yaml:
--------------------------------------------------------------------------------
1 | name: setup
2 | description: 'Setup (Dependencies, Nodejs)'
3 |
4 | runs:
5 | using: 'composite'
6 | steps:
7 | - name: Install pnpm
8 | uses: pnpm/action-setup@v2.2.4
9 |
10 | - name: Use Node.js
11 | uses: actions/setup-node@v3
12 | with:
13 | node-version: 16
14 | cache: 'pnpm'
15 |
16 | - name: Install dependencies
17 | shell: bash
18 | run: pnpm install
19 |
--------------------------------------------------------------------------------
/packages/ui/components/Button.vue:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
14 |
15 |
16 |
23 |
--------------------------------------------------------------------------------
/apps/web/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@myturborepo/web",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "build": "nuxt build",
7 | "dev": "nuxt dev",
8 | "generate": "nuxt generate",
9 | "preview": "nuxt preview",
10 | "postinstall": "nuxt prepare",
11 | "lint": "eslint",
12 | "lint:fix": "eslint --fix"
13 | },
14 | "devDependencies": {
15 | "nuxt": "3.11.2",
16 | "@myturborepo/tsconfig": "workspace:*",
17 | "@myturborepo/ui": "workspace:*"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3 | "extends": [
4 | "github>nuxt/renovate-config-nuxt",
5 | ":labels(dependencies,devops)",
6 | ":maintainLockFilesWeekly",
7 | ":enableVulnerabilityAlerts",
8 | ":automergeLinters",
9 | ":automergeTypes",
10 | ":automergeMinor"
11 | ],
12 | "baseBranches": [
13 | "main",
14 | "tailwind",
15 | "tailwindui",
16 | "unocss",
17 | "unocss-anu",
18 | "unocss-vuetify",
19 | "adonis"
20 | ]
21 | }
22 |
--------------------------------------------------------------------------------
/packages/tsconfig/base.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "display": "Default",
4 | "compilerOptions": {
5 | "composite": false,
6 | "declaration": true,
7 | "declarationMap": true,
8 | "esModuleInterop": true,
9 | "forceConsistentCasingInFileNames": true,
10 | "inlineSources": false,
11 | "isolatedModules": true,
12 | "moduleResolution": "node",
13 | "noUnusedLocals": false,
14 | "noUnusedParameters": false,
15 | "preserveWatchOutput": true,
16 | "skipLibCheck": true,
17 | "strict": true
18 | },
19 | "exclude": ["node_modules"]
20 | }
21 |
--------------------------------------------------------------------------------
/apps/docs/pages/.vitepress/config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | title: 'VitePress',
3 | description: 'Just playing around with turborepo',
4 | themeConfig: {
5 | siteTitle: 'My Custom Title',
6 | nav: [
7 | { text: 'Index', link: '/index' },
8 | { text: 'Getting started', link: '/getting-started' },
9 | { text: 'Github', link: 'https://' },
10 | ],
11 | sidebar: [
12 | {
13 | text: 'Guide',
14 | items: [
15 | { text: 'Index', link: '/index' },
16 | { text: 'Getting started', link: '/getting-started' },
17 | ],
18 | },
19 | ],
20 | },
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/packages/ui/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@myturborepo/ui",
3 | "version": "0.0.0",
4 | "main": "nuxt.mjs",
5 | "private": true,
6 | "scripts": {
7 | "dev": "histoire dev",
8 | "build": "histoire build",
9 | "preview": "histoire preview",
10 | "test": "vitest run --coverage"
11 | },
12 | "devDependencies": {
13 | "@histoire/plugin-vue": "^0.16.1",
14 | "@myturborepo/tsconfig": "workspace:*",
15 | "@vitejs/plugin-vue": "^4.2.3",
16 | "@vitest/coverage-c8": "^0.31.1",
17 | "@vue/test-utils": "^2.3.2",
18 | "c8": "^7.14.0",
19 | "histoire": "^0.16.1",
20 | "jsdom": "^20.0.3",
21 | "vitest": "^0.31.1"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ### [0.0.5](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/compare/0.0.4...0.0.5) (2022-10-18)
4 |
5 | ### [0.0.4](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/compare/0.0.3...0.0.4) (2022-10-18)
6 |
7 | ### [0.0.3](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/compare/0.0.2...0.0.3) (2022-10-18)
8 |
9 | ### [0.0.2](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/compare/0.0.1...0.0.2) (2022-10-18)
10 |
11 | ### 0.0.1 (2022-10-18)
12 |
13 |
14 | ### Reverts
15 |
16 | * Revert "cd: bump to node 18" ([b11ebe4](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/commit/b11ebe469bf62bfa9642da00facb2d9394d3f09e))
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | node_modules
5 | .pnp
6 | .pnp.js
7 |
8 | # testing
9 | coverage
10 |
11 | # next.js
12 | .next/
13 | out/
14 | build
15 |
16 | # misc
17 | .DS_Store
18 | *.pem
19 |
20 | # debug
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 | .pnpm-debug.log*
25 |
26 | # local env files
27 | .env.local
28 | .env.development.local
29 | .env.test.local
30 | .env.production.local
31 | **/.env
32 |
33 | # turbo
34 | .turbo
35 |
36 | # IDEs
37 | .idea
38 |
39 | # nuxt
40 | .output
41 |
42 | # histoire
43 | .histoire
44 |
45 | # vitepress
46 | **/.vitepress/dist/**
47 |
--------------------------------------------------------------------------------
/turbo.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://turborepo.org/schema.json",
3 | "pipeline": {
4 | "build": {
5 | "dependsOn": ["^build"],
6 | "outputs": [
7 | "dist/**",
8 | ".output/**",
9 | ".histoire/**",
10 | "**/.vitepress/dist/**"
11 | ]
12 | },
13 | "generate" : {
14 | "dependsOn": ["^generate"],
15 | "outputs": [
16 | "dist/**",
17 | ".output/**"
18 | ]
19 | },
20 | "lint": {
21 | "outputs": []
22 | },
23 | "lint:fix": {
24 | "outputs": []
25 | },
26 | "dev": {
27 | "cache": false
28 | },
29 | "test": {
30 | "outputs": []
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "turborepo-nuxt-boilerplate",
3 | "version": "0.0.5",
4 | "private": true,
5 | "workspaces": [
6 | "apps/*",
7 | "packages/*"
8 | ],
9 | "scripts": {
10 | "build": "turbo run build",
11 | "generate": "turbo run generate",
12 | "dev": "turbo run dev --parallel",
13 | "lint": "turbo run lint",
14 | "lint:fix": "turbo run lint:fix",
15 | "test": "turbo run test"
16 | },
17 | "devDependencies": {
18 | "@myturborepo/eslint-config-custom": "workspace:*",
19 | "@release-it/conventional-changelog": "^5.1.1",
20 | "release-it": "^15.10.3",
21 | "turbo": "latest"
22 | },
23 | "engines": {
24 | "node": ">=v18.16.0"
25 | },
26 | "packageManager": "pnpm@7.32.5"
27 | }
28 |
--------------------------------------------------------------------------------
/apps/web/README.md:
--------------------------------------------------------------------------------
1 | # Nuxt 3 Minimal Starter
2 |
3 | Look at the [nuxt 3 documentation](https://v3.nuxtjs.org) to learn more.
4 |
5 | ## Setup
6 |
7 | Make sure to install the dependencies:
8 |
9 | ```bash
10 | # yarn
11 | yarn install
12 |
13 | # npm
14 | npm install
15 |
16 | # pnpm
17 | pnpm install --shamefully-hoist
18 | ```
19 |
20 | ## Development Server
21 |
22 | Start the development server on http://localhost:3000
23 |
24 | ```bash
25 | npm run dev
26 | ```
27 |
28 | ## Production
29 |
30 | Build the application for production:
31 |
32 | ```bash
33 | npm run build
34 | ```
35 |
36 | Locally preview production build:
37 |
38 | ```bash
39 | npm run preview
40 | ```
41 |
42 | Checkout the [deployment documentation](https://v3.nuxtjs.org/guide/deploy/presets) for more information.
43 |
--------------------------------------------------------------------------------
/packages/ui/tests/Button.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, expect, it } from 'vitest'
2 | import { mount } from '@vue/test-utils'
3 | import Button from '../components/Button.vue'
4 |
5 | describe('Button', () => {
6 | it('is defined', () => {
7 | const wrapper = mount(Button)
8 | expect(wrapper).toBeDefined()
9 | })
10 |
11 | it('is disabled', () => {
12 | const wrapper = mount(Button, {
13 | props: {
14 | disabled: true,
15 | },
16 | })
17 |
18 | const button = wrapper.find('button')
19 | expect(button.element.disabled).toBe(true)
20 | })
21 |
22 | it('has been clicked and event emitted', () => {
23 | const wrapper = mount(Button)
24 | const button = wrapper.find('button')
25 | button.trigger('click')
26 |
27 | expect(wrapper.emitted('submit')).toBeTruthy()
28 | })
29 |
30 | it('has a slot', () => {
31 | const wrapper = mount(Button, {
32 | slots: {
33 | default: 'Submit test',
34 | },
35 | })
36 |
37 | expect(wrapper.html()).toContain('Submit test')
38 | })
39 | })
40 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Turborepo nuxt starter
2 |
3 | [](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/actions/workflows/ci.yaml)
4 | [](https://turborepo-nuxt-boilerplate-web-main.netlify.app/)
5 | [-Preview-blue?logo=netlify&logoColor=white)](https://turborepo-nuxt-boilerplate-ui-main.netlify.app/)
6 | [-Preview-blue?logo=netlify&logoColor=white)](https://turborepo-nuxt-boilerplate-docs-main.netlify.app/)
7 |
8 | This is a monorepo with Nuxt, Histoire, Vitest & VitePress as a starter for any project that can be easily extended.
9 | You can also find additional branches:
10 | - [TailwindCSS](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/tree/tailwind)
11 | - [TailwindCSS + TailwindUI](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/tree/tailwindui)
12 | - [Unocss](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/tree/unocss)
13 | - [Unocss + Anu](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/tree/unocss-anu)
14 | - [Unocss + Vuetify](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/tree/unocss-vuetify)
15 | - [AdonisJS](https://github.com/gurvan-guss/turborepo-nuxt-boilerplate/tree/adonis)
16 |
17 | ## What's inside?
18 |
19 | This turborepo uses [pnpm](https://pnpm.io) as a package manager. It includes the following packages/apps:
20 |
21 | ### Apps and Packages
22 |
23 | - `web`: a [Nuxt.js](https://nuxtjs.org) app
24 | - `docs`: a [VitePress](https://vitepress.vuejs.org/) app
25 | - `ui`: a stub Nuxt component library with [Histoire](https://histoire.dev/)
26 | - `config`: `eslint` configuration (using [@antfu/eslint-config](https://github.com/antfu/eslint-config))
27 | - `tsconfig`: `tsconfig.json`s used throughout the monorepo
28 |
29 | Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
30 |
31 | ### Utilities
32 |
33 | This turborepo has some additional tools already setup for you:
34 |
35 | - [TypeScript](https://www.typescriptlang.org/) for static type checking
36 | - [ESLint](https://eslint.org/) for code linting
37 |
38 | ### Setup
39 |
40 | To install all dependencies, run the following command:
41 |
42 | ```
43 | pnpm install
44 | ```
45 |
46 | ### Develop
47 |
48 | To develop all apps and packages, run the following command:
49 |
50 | ```
51 | pnpm run dev
52 | ```
53 |
54 | ### Lint
55 |
56 | To check & fix linter through all apps and packages, run the following command:
57 |
58 | ```
59 | pnpm run lint
60 | pnpm run lint:fix
61 | ```
62 |
63 | ### Test
64 |
65 | To run tests through all apps and packages, run the following command:
66 |
67 | ```
68 | pnpm run test
69 | ```
70 |
71 | ### Build
72 |
73 | To build all apps and packages, run the following command:
74 |
75 | ```
76 | pnpm run build
77 | ```
78 |
79 | ### Generate: SSG
80 |
81 | To statically generate this project:
82 |
83 | ```
84 | pnpm run generate
85 | ```
86 |
87 | ### Remote Caching
88 |
89 | Turborepo can use a technique known as [Remote Caching](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.
90 |
91 | 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:
92 |
93 | ```
94 | pnpm dlx turbo login
95 | ```
96 |
97 | This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).
98 |
99 | Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo:
100 |
101 | ```
102 | pnpm dlx turbo link
103 | ```
104 |
105 | Use a custom remote cache server [turbo-remote-cache](https://github.com/ducktors/turborepo-remote-cache)
106 |
107 | ## Useful Links
108 |
109 | Learn more about the power of Turborepo:
110 |
111 | - [Pipelines](https://turborepo.org/docs/core-concepts/pipelines)
112 | - [Caching](https://turborepo.org/docs/core-concepts/caching)
113 | - [Remote Caching](https://turborepo.org/docs/core-concepts/remote-caching)
114 | - [Scoped Tasks](https://turborepo.org/docs/core-concepts/scopes)
115 | - [Configuration Options](https://turborepo.org/docs/reference/configuration)
116 | - [CLI Usage](https://turborepo.org/docs/reference/command-line-reference)
117 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yaml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | tags:
8 | - '*'
9 | pull_request:
10 |
11 | env:
12 | PATH_BUILD_DOCS: ./apps/docs/pages/.vitepress/dist
13 | PATH_BUILD_WEB: ./apps/web/dist
14 | PATH_BUILD_WEB_FUNCTIONS: ./apps/web/.netlify/functions-internal
15 | PATH_BUILD_UI: ./packages/ui/.histoire/dist
16 | CACHE_PATHS_BUILD: |
17 | ./apps/docs/pages/.vitepress/dist
18 | ./apps/web/.netlify
19 | ./apps/web/dist
20 | ./packages/ui/.histoire/dist
21 | CACHE_KEY_BUILD: build-${{ github.sha }}
22 | # To use Remote Caching, uncomment the next lines and follow the steps below.
23 | # TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
24 | # TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
25 |
26 | jobs:
27 | build:
28 | name: Build 🏗️
29 | runs-on: ubuntu-latest
30 |
31 | steps:
32 | - name: Checkout
33 | uses: actions/checkout@v3
34 |
35 | - name: Setup
36 | uses: ./.github/workflows/setup
37 |
38 | - name: Build
39 | run: pnpm build
40 |
41 | - name: Cache build
42 | uses: actions/cache@v3
43 | with:
44 | path: ${{ env.CACHE_PATHS_BUILD }}
45 | key: ${{ env.CACHE_KEY_BUILD }}
46 |
47 | lint:
48 | name: Lint ✅
49 | needs: build
50 | runs-on: ubuntu-latest
51 |
52 | steps:
53 | - name: Checkout
54 | uses: actions/checkout@v3
55 |
56 | - name: Setup
57 | uses: ./.github/workflows/setup
58 |
59 | - name: Lint
60 | run: pnpm lint
61 |
62 | test:
63 | name: Test 🧪
64 | needs: build
65 | runs-on: ubuntu-latest
66 |
67 | steps:
68 | - name: Checkout
69 | uses: actions/checkout@v3
70 |
71 | - name: Setup
72 | uses: ./.github/workflows/setup
73 |
74 | - name: Test
75 | run: pnpm test
76 |
77 | deploy-docs-main:
78 | name: Deploy docs from main branch 🚀
79 | needs: [build, lint, test]
80 | runs-on: ubuntu-latest
81 | if: github.ref_type == 'tag'
82 |
83 | environment:
84 | name: Docs (main)
85 | url: https://turborepo-nuxt-boilerplate-docs-main.netlify.app/
86 |
87 | steps:
88 | - uses: actions/cache@v3
89 | with:
90 | path: ${{ env.CACHE_PATHS_BUILD }}
91 | key: ${{ env.CACHE_KEY_BUILD }}
92 |
93 | - uses: nwtgck/actions-netlify@v2.0
94 | with:
95 | publish-dir: ${{ env.PATH_BUILD_DOCS }}
96 | production-deploy: true
97 | env:
98 | NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
99 | NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID_DOCS_MAIN }}
100 |
101 | deploy-web-main:
102 | name: Deploy web app from main branch 🚀
103 | needs: [build, lint, test]
104 | runs-on: ubuntu-latest
105 | if: github.ref_type == 'tag'
106 |
107 | environment:
108 | name: Web (main)
109 | url: https://turborepo-nuxt-boilerplate-web-main.netlify.app/
110 |
111 | steps:
112 | - uses: actions/cache@v3
113 | with:
114 | path: ${{ env.CACHE_PATHS_BUILD }}
115 | key: ${{ env.CACHE_KEY_BUILD }}
116 |
117 | # Doesn't work
118 | # - uses: nwtgck/actions-netlify@v1.2
119 | # with:
120 | # publish-dir: ${{ env.PATH_BUILD_WEB }}
121 | # functions-dir: ${{ env.PATH_BUILD_WEB_FUNCTIONS }}
122 | # production-deploy: true
123 | # env:
124 | # NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
125 | # NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID_UI_MAIN }}
126 |
127 | # Using netlify CLI https://github.com/nuxt/framework/issues/4439
128 | - name: Deploy to Netlify using their CLI
129 | uses: netlify/actions/cli@master
130 | with:
131 | args: deploy --dir=${{ env.PATH_BUILD_WEB }} --functions=${{ env.PATH_BUILD_WEB_FUNCTIONS }} -p
132 | env:
133 | NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID_WEB_MAIN }}
134 | NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
135 |
136 | deploy-ui-main:
137 | name: Deploy UI from main branch 🚀
138 | needs: [build, lint, test]
139 | runs-on: ubuntu-latest
140 | if: github.ref_type == 'tag'
141 |
142 | environment:
143 | name: UI (main)
144 | url: https://turborepo-nuxt-boilerplate-ui-main.netlify.app/
145 |
146 | steps:
147 | - uses: actions/cache@v3
148 | with:
149 | path: ${{ env.CACHE_PATHS_BUILD }}
150 | key: ${{ env.CACHE_KEY_BUILD }}
151 |
152 | - uses: nwtgck/actions-netlify@v2.0
153 | with:
154 | publish-dir: ${{ env.PATH_BUILD_UI }}
155 | production-deploy: true
156 | env:
157 | NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
158 | NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID_UI_MAIN }}
159 |
--------------------------------------------------------------------------------