monorepo

Peer Dependencies In A Monorepo

懵懂的女人 提交于 2020-06-09 11:27:30
问题 When packages in a monorepo have peer dependencies, how should these dependencies be made available to them during development? For example a package at /packages/namespace/alpha/ might have a devDependency of styled-components in its package.json . Possible options: Declare the same dependencies as dev dependencies as well (unnecessary duplication and maintenance cost). Install the packages in the monorepo's route package.json (potential issues with module resolution when using yarn link . I

How to set up Lerna monorepo with TypeScript

泪湿孤枕 提交于 2020-06-08 19:34:11
问题 I have a core library with the following in package.json : "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "es2015": "dist/es2015/index.js", "types": "dist/es2015/index.d.ts", "typings": "dist/es2015/index.d.ts", The library builds TypeScript code into dist/ folder for distribution. The source code lies within src/ . I am using Lerna and monorepos, and I'm trying to get another package/module to load the TypeScript code as-is: import { someTypeScriptStuff } from '@test/core'

Granular access to directories within monorepo

跟風遠走 提交于 2020-06-08 06:19:21
问题 I've been reading about the advantages of monorepos, but haven't yet found a mitigation for the problem of sharing parts of a repo: Let's say an organization has a monorepo for a client/server web application. They hire a contractor to work on the design of some part of the client. How can they give the contractor access to only the relevant client code? Even sparse checkouts are not trivial. 回答1: Consider using git subtree . With git subtree you will be able to: create a monorepo composed of

Create React App + Typescript In monorepo code sharing

不打扰是莪最后的温柔 提交于 2020-05-29 06:48:41
问题 I currently have a monorepo where I have two (+) packages using yarn workspaces: root /packages /common /web ... root/package.json ... "workspaces": { "packages": [ "packages/*" ], "nohoist": [ "**" ], }, web is a plain create-react-app with the typescript template. I have some TS code in common I want to use in web , but it seems that CRA does not support compiling code outside of src , giving me an error when I try to import from common in web : ../common/state/user/actions.ts 4:66 Module

Monorepo with `rootDirs` produces unwanted sudirectories such as `src` in `outDir`

百般思念 提交于 2020-05-16 14:01:14
问题 I am planning a monorepo typescript porject like below: / (root) +--backend/ | +-src/ | \-tsconfig.json +--shared/ | \-src/ \--frontend/ \-src/ tsconfig.json is defined like below: { "compilerOptions": { "target": "es5", "module": "commonjs", "outDir": "./dist", "strict": true, "baseUrl": "./src", "paths": { "shared": [ "../../shared/src" ] }, "rootDirs": [ "./src", "../shared/src" ], "esModuleInterop": true } } When I execute tsc under backend it gives me like below: / (root) +-backend/ +

Monorepo with `rootDirs` produces unwanted sudirectories such as `src` in `outDir`

耗尽温柔 提交于 2020-05-16 13:58:31
问题 I am planning a monorepo typescript porject like below: / (root) +--backend/ | +-src/ | \-tsconfig.json +--shared/ | \-src/ \--frontend/ \-src/ tsconfig.json is defined like below: { "compilerOptions": { "target": "es5", "module": "commonjs", "outDir": "./dist", "strict": true, "baseUrl": "./src", "paths": { "shared": [ "../../shared/src" ] }, "rootDirs": [ "./src", "../shared/src" ], "esModuleInterop": true } } When I execute tsc under backend it gives me like below: / (root) +-backend/ +

Git and sparse-checkout on large monorepos - hiding irrelevant changes for a sparse-checkout specification? (git-diff, git-log, etc)

江枫思渺然 提交于 2020-04-30 06:37:26
问题 As git is increasingly advertised (and enhanced) to better support very large repositories (so-called "monorepos"), with major recent enhancements to the sparse-checkout workflow (git-sparse-checkout command and partial clone / promisors / --filter), I'm surprised that I can't find a way to leverage the sparse-checkout configuration/specification when dealing with commit history . I see that the topic has been partially brought up in previous questions: filter git commit history after sparse

Should a developer be able to create a docker artifact from a lerna monorepo in their development environment?

倖福魔咒の 提交于 2020-02-23 11:36:42
问题 I've recently started using lerna to manage a monorepo, and in development it works fine. Lerna creates symlinks between my various packages, and so tools like 'tsc --watch' or nodemon work fine for detecting changes in the other packages. But I've run into a problem with creating docker images in this environment. Let's say we have a project with this structure: root packages common → artifact is a private npm package, this depends on utilities, something-specific utilities → artifact is a

get a list of all 1st level directories impacted by recent commits for a git monorepo

百般思念 提交于 2020-01-13 19:04:46
问题 I am currently playing with monorepos and I am trying to retrieve a list all 1 level subfolders in the repo which are impacted since a given commit. So far I can retrieve all the files impacted using git diff --name-only $COMMIT_ID..head Using git diff --name-only $COMMIT_ID..head | xargs -L1 dirname I manage to get only the folder names. To remove all the duplicates I added sort | uniq to the mix: git diff --name-only $COMMIT_ID..head | xargs -L1 dirname | sort | uniq All I need now is to

get a list of all 1st level directories impacted by recent commits for a git monorepo

戏子无情 提交于 2020-01-13 19:04:07
问题 I am currently playing with monorepos and I am trying to retrieve a list all 1 level subfolders in the repo which are impacted since a given commit. So far I can retrieve all the files impacted using git diff --name-only $COMMIT_ID..head Using git diff --name-only $COMMIT_ID..head | xargs -L1 dirname I manage to get only the folder names. To remove all the duplicates I added sort | uniq to the mix: git diff --name-only $COMMIT_ID..head | xargs -L1 dirname | sort | uniq All I need now is to