This monorepo uses pnpm as a package manager. It includes the following packages/apps:
host
: a Vue 3 app that is the the host for module fedrationui
: a stub Vue component library shared by the applications in theapps
foldereslint-config-custom
:eslint
configurations (includeseslint-config-next
andeslint-config-prettier
)tsconfig
:tsconfig.json
s used throughout the monorepotailwind-config
: includes the main config of tailwind, with its main styles and pluginsvite-config
: a shared config for all vue microfrontends. Includes plugins like API Auto Import, Component Auto Import and File Based Routing.
This monorepo uses some additional tools:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
You can run this application inside a Dev Container by installing the related extension, opening the command palette (Ctrl-Shipt+p) and selecting Dev Containers: Reopen in container
. After the image has done building, you will see the project folder (that has been mounted as a volume in the container) and vscode will begin installing the extensions specified in the devcontainer.json
file. The execution of the container has nothing to do with the local files, so even if the container is destroyed there will be no issues
When first working with this project, it is necessary to disable the built-in typescript support of vscode in favor of the Vue Typescript Plugin. This will enable takeover mode,and let the Volar plugin to take care of the intellisense. To do so, input @builtin typescript
in the extension search bar and disable TypeScript and JavaScript Language Features
for the current workspace.
If everithing is working correctly, you will se in the bottom bar TakeOver Mode
when editing .vue
and .ts
files
For internal packages we usually mean those that are not published to npm but are still imported by other packages or by the ones in the apps
folder. If you want to specify internal packages that force the use of some version of dependencies, put those in the peerDependencies
block in their package.json
file. Then you will need to add the following block to each package that uses that internal package:
"dependenciesMeta": {
"internal-package": {
"injected": true
},
}
To build all apps and packages, run the following command:
cd my-turborepo
pnpm run build
To develop all apps and packages, run the following command:
cd my-turborepo
pnpm run dev
Turborepo can use a technique known as 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, then enter the following commands:
cd my-turborepo
pnpm dlx turbo login
This will authenticate the Turborepo CLI with your Vercel account.
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo:
pnpm dlx turbo link
Learn more about the power of Turborepo: