Skip to content

BrachyKnight/MonorepoTest

Repository files navigation

EStep UI

What's inside?

This monorepo uses pnpm as a package manager. It includes the following packages/apps:

Apps and Packages

  • host: a Vue 3 app that is the the host for module fedration
  • ui: a stub Vue component library shared by the applications in the apps folder
  • eslint-config-custom: eslint configurations (includes eslint-config-next and eslint-config-prettier)
  • tsconfig: tsconfig.jsons used throughout the monorepo
  • tailwind-config: includes the main config of tailwind, with its main styles and plugins
  • vite-config: a shared config for all vue microfrontends. Includes plugins like API Auto Import, Component Auto Import and File Based Routing.

Utilities

This monorepo uses some additional tools:

Running a inside a Dev Container

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

Setup

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

Adding new 'internal' packages

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
    },
}

Build

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

cd my-turborepo
pnpm run build

Develop

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

cd my-turborepo
pnpm run dev

Remote Caching

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

Useful Links

Learn more about the power of Turborepo:

About

Monorepo test with turborepo, devcontainer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published