Giter VIP home page Giter VIP logo

template-monorepo's Introduction

@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 ♥

template-monorepo's People

Contributors

nekomeowww avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.