Code Monkey home page Code Monkey logo

nx-vue-cosmopolis's Introduction

NxVueSpark

ec6ba858e4bef8faa258dc913180d63a.png

English | 简体中文

Hello, fellows. Welcome to the NxVueCosmopolis.

The NxVueCosmopolis is a vue3 mono repo project with nx as a build tool. It can assist you in starting a vue3 mono repo swiftly.

other templates

If you want to build a vue or react or whatever application. Some other templates can help you.

use nx quickly

there is some basic knowledge about nx that can help you quickly use it. You can do some tests in this repo quickly.

Create a new lib or components?

the plugin of NX has some powerful cli functionality that can help you do something quickly.

The functionality of cli is all from plugins. Let's have a look quickly.

First, run nx list command in your terminal.

c15f4c743ba90dac238d72ceae606aad.png

54b706fb8585c6ec7c71745406e70cd5.png

2b502ee4d69954475340c75c75c83752.png

Now Let's use it.

#1. create a lib named products
nx g @nx/vue:library products --directory=modules/products --unit-test-runner=vitest --bundler=vite

#2. create a component under products lib
nx g @nx/vue:component product-list --directory=modules/products/src/cart

Okay. Now we have created a products lib and a component. The project name is defined at modules/products/project.json the outputs are defined at modules/products/vite.config.ts called outDir field.

Tip

The each of library that generated by cli

  • has a project details view where you can see the available tasks (e.g. running tests for just orders: nx test orders)
  • has its own project.json file where you can customize targets
  • has the name you specified in the generate command; you can find the name in the corresponding project.json file
  • has a dedicated index.ts file which is the "public API" of the library
  • is mapped in the tsconfig.base.json at the root of the workspace.

How to see or run a task that you have?

First, the Nx provides a `show`` command that can help you to look at How many projects you have and the details of your project.

Let me show you quickly bacf5293dbb385214402ba74cb8209a2.png 2275e0830651d44d42b3acfe6ed5c97a.png bd05f7ec013a0b46dd2d3de016c2f800.png

So that you know that all projects and tasks are in our repo. And the NX supports cache and parallel to run a task. It's a super powerful ability.

Visualizing your Project Structure

Graph dependencies within the workspace

nx graph

fa2c764fed78511301d04b12e7a68497.png

Tip

The arrows to orders and products are dashed because we're using lazy imports.

🌸 Thanks

Hope this repository can help you guys. If you like it. Please give me a star, thanks. ⭐️

nx-vue-cosmopolis's People

Watchers

fzhange 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.