Skip to content
/ template-monorepo Public template

A UI component friendly, general TypeScript module first monorepo template repository with Vite, Vitest, unbuild, VitePress that @nolebase/integrations based on.

Notifications You must be signed in to change notification settings

nolebase/template-monorepo

Repository files navigation

@example-org/example-repo

TODO...

  • Replace example-org with the actual organization scope, namespace.
  • Replace Example Org with the actual organization name.
  • Replace example-org.com with the actual organization domain.
  • Replace example-repo with the actual repository name.
  • Customize the README.md file.
  • Customize the docs/.vitepress/config.ts file.
  • Implement the actual features.
    • packages/example-vue-component
    • packages/example-typescript

How to develop based on this template

  1. Clone
  2. Replace example-org with the actual organization scope, namespace.
  3. Replace Example Org with the actual organization name.
  4. Replace example-org.com with the actual organization domain.
  5. Replace example-repo with the actual repository name.
  6. pnpm install
  7. pnpm run packages:stub
  8. pnpm run docs:dev
  9. Change some of the code in the packages/example-vue-component and packages/example-typescript directories.
  10. To integrate more packages:
  11. Create a new package in the packages directory. For example, packages/example-new-package.
  12. After completing the development of the new package, run pnpm run packages:stub to generate the stubbed files for testing and importing.
  13. Install the new package in the docs directory. pnpm install -F @example-org/docs @example-org/example-new-package.
  14. If it's a pure TypeScript module without the need to integrate to run after any extra bundling (Vite, vite-node, etc.), you can now import the new package in the docs directory. For example, import { yourExportedField } from '@example-org/example-new-package'.
  15. If it's a Vue component, or a module that requires bundling and transforming, you need to add the new package to the docs/vite.config.ts file as alias, tsconfig.json as paths in order to import the new package in the docs directory. Once you are done, you can import the new package in the docs directory. For example, import { yourExportedField } from '@example-org/example-new-package'.
  16. Build the packages, pnpm run packages:build.
  17. Build the documentation, pnpm run docs:build.
  18. Publish the packages, pnpm run packages:publish.

How to develop

The project uses unbuild and vite to develop and build. With the powerful features offered from jiti, we no longer need to use Rollup for tedious configuration and then watch the local file changes and bundle the modified and developed the modules without vite for hot-reload. We can directly run the following command to output the bundled file and get started on development:

pnpm run packages:stub

If you use @antfu/ni, you can also use the following command:

nr packages:stub

Next, you need to start the the documentation site (with VitePress) for previewing and development. You can use the following command:

pnpm run docs:dev

If you use @antfu/ni, you can also use the following command:

nr docs:dev

How to build

pnpm run packages:build

If you use @antfu/ni, you can also use the following command:

nr packages:build

To build the documentation and preview site, you can use the following command:

pnpm run docs:build

If you use @antfu/ni, you can also use the following command:

nr docs:build

Written with ♥

About

A UI component friendly, general TypeScript module first monorepo template repository with Vite, Vitest, unbuild, VitePress that @nolebase/integrations based on.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published