Several Vue applications utilizing common components within a single monorepository

In our system, we have identified two primary user types and want to organize the apps into separate folders within a single repository. The goal is to create a shared components library that can be used by both projects.

I'm seeking advice on the best approach to achieve this setup while meeting the following requirements:

  • Separate folder for each app
  • Shared library possibly utilizing Github packages
  • Shared configuration file
  • Storybook implementation in the shared library folder

Answer №1

While I may have limited experience, a common setup for pnpm typically involves:

mkdir <repo-name>
cd <repo-name>
pnpm init
mkdir packages
mkdir apps

pnpm-workspace.yaml

packages:
  - "packages/**"
  - "apps/**"

.npmrc

shamefully-hoist=true

.gitignore

node_modules

package.json

To maintain consistency, change the name to follow this format:

"name":"@<repo-name>/root"

Applications belong in the "apps" directory, while reusable packages and components should be placed in the "packages" directory.

I am unable to provide insights on storybook at this time.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

An illustration of webpack 4 and Vue.js compatibility tailored specifically for Internet Explorer 11, featuring multiple entry points

This feels like déjà vu - yet another issue with Internet Explorer and webpack. I'm on the brink of deploying my project when IE 11 decides to mess everything up. I thought I had covered all bases with babel-polyfill and the latest versions, but of ...

ultimate peer-to-peer communication platform

I am in the process of developing a one on one chat web application using PHP. Currently, I have been storing messages in a MySQL database, but I understand that this method is not very efficient. I would prefer to only have a user table with IP addresses ...

Encountering an unexpected token error while attempting to incorporate JQuery into a React JS project

I am currently diving into the world of React.js and attempting to incorporate a side navigation bar on my homepage. However, I encountered an eslint error when trying to implement the sidebar using jQuery code. Below you will find the code snippet for the ...

The command 'run-s' is not valid and cannot be found as an internal or external command. Please make sure it is a recognized program or batch file

Unexpectedly, I encountered an issue while attempting to utilize the npm link command to test my local package. Any ideas on how to resolve this? Operating System: Windows 10 Node version: 15.9.0 NPM version: 8.12.2 ...

Tips for creating child divs with a width that spans the entire page

When viewing multiple rows of containers on my page, the elements shift inline on smaller screens. I am looking to have the orange bar positioned behind and slightly below the header, spanning the width of the page. To achieve this, I utilized relative pos ...

What is preventing the code from concealing the html div when the winOrNot function is given the argument (false)?

Can you identify why the "Congratulations" message in the div is not being hidden when the function is called with the (false) argument? <!DOCTYPE html> <html> <head> <title></title> </head> <body> <div id= ...

Absence of loaders detected in a uniquely crafted npm package

Experiencing an issue with a private npm package loaded from a local git server for use in multiple react applications. When the package is loaded in the application, an error occurs: Error: Module parse failed: Unexpected token (22:6) You may need an app ...

Unable to properly access required file path through HTML source

I have a confidential folder named 'inc' where I store sensitive files such as passwords in php connection files. This folder is located at the same level as the 'public_html' folder. I successfully accessed php files with database conn ...

the event binding was unsuccessful within the render function

This is the BadCodeSelector component. It emits a 'confirm' function when the button is clicked, and the confirm method is executed. <template> <div class="BadCodeSelector-buttons"> <el-button size="small" ...

Encountering Difficulties Setting Variable in Vue

Recently delving into the world of VueJS & Tailwind, I am faced with a steep learning curve as I navigate npm for the first time. Within my code below lies a mixture of Tailwind and Headless UI that is almost complete, except for one nagging error message ...

Animation in Three.JS not visible in Chrome version 61 on Mac OS X Sierra

I've been going through some beginner tutorials for three.js and I'm facing an issue where I only see a red background when I try to run the code I created in Atom on Chrome (Version 62.0.3202.75 (Official Build) (64-bit)), Mac OS X (macOS Sierra ...

How do I verify response values in Postman tests when the input parameter may be empty and can have multiple possible values?

In my program, there is an input parameter known as IsFruit that can have a value of either 0 or 1. If IsFruit is set to 0, the response should return fruits with a FruitsYN value of N. Similarly, if it is set to 1, FruitsYN should be Y. In cases where I ...

How to eliminate rows with images in Exceljs

I created a worksheet with an image in each row. However, when I filter or remove a row, the image for that row stays visible. I tested this on versions v4.4.0 and v4.3.0 I attempted various methods of adding images, but none of them seemed to work. Initi ...

JavaScript calculation: how tall is the image?

Can you calculate the CSS height of an image with a width of 3px? The original image is: - Height: 400px - Width: 800px I have attempted to: Convert the 3px into a percentage based on the original image width: function getPercentageOfWidth(v){ return ...

Manually sending the form via Ajax for submission

I'm facing an issue where I am trying to utilize ajax to call a servlet upon form submission. However, the ajax call is not being triggered and the page ends up reloading. To solve this problem, I have set up a manual trigger for the form submission, ...

Does anyone know if it's feasible to return a value from PHP to an HTML form without relying on JavaScript?

Currently, I am in the process of learning how to create a basic web form. My goal is to develop an HTML web form that sends a number to PHP and then displays the number in another text field without refreshing the page. After doing some research online, ...

localization within vue component

if (self.form.pickupTime == '') { self.formError.pickupTime = 'Please enter a pickup time that is ready for collection.'; status = false; return status; } else { self.formError.pickupTime = ''; } I am struggling ...

How to eliminate Internet Explorer error messages

Encountering the following error message in IE8 "Do you want to view the webpage content that was delivered securely" To prevent this error, we must adjust this setting "Internet options -> Security -> Internet -> Custom -> Miscellaneous ...

Updating reactive objects in Vue.js 3 while maintaining reactivity without any loss

I'm looking for the best approach to update a reactive object with data after fetching it: setup(){ const formData = reactive({}) onMounted(() => { fetchData().then((data) => { if (data) { formData = data //is ...

Tips for maintaining a persistent login session in React Native with Firebase forever

I've been grappling with this issue for a few days now. Essentially, my aim is to have Firebase remember the user so they remain logged in after logging in once. The first block of code is the App component (I've omitted some of the irrelevant co ...