first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

21
node_modules/resolve-workspace-root/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,21 @@
# The MIT License (MIT)
Copyright (c) 2024-present Cedric van Putten <me@cedric.dev>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.

41
node_modules/resolve-workspace-root/README.md generated vendored Normal file
View File

@@ -0,0 +1,41 @@
# resolve-workspace-root
Resolve the root of a workspace using [bun](https://bun.sh/guides/install/workspaces), [npm](https://docs.npmjs.com/cli/configuring-npm/package-json#workspaces), [pnpm](https://pnpm.io/workspaces), or [yarn](https://yarnpkg.com/features/workspaces).
- For bun, npm, and yarn - it looks for a parent **package.json** file, containing the `workspaces` config.
- For pnpm - it looks for a **package.json** and **pnpm-workspaces.yaml** file, containing the workspaces config.
## 🚀 How to use it
This package supports both synchronous and asynchronous lookups.
```ts
import { resolveWorkspaceRoot, resolveWorkspaceRootAsync } from 'resolve-workspace-root';
// Synchronous lookup, supporting bun, npm, pnpm, and yarn
const workspaceRoot = resolveWorkspaceRoot(__dirname);
// Synchronous lookup, supporting only bun, npm, and yarn
const workspaceRoot = resolveWorkspaceRoot(__dirname, { packageWorkspaces: false });
// Synchronous lookup, supporting only pnpm
const workspaceRoot = resolveWorkspaceRoot(__dirname, { pnpmWorkspaces: false });
// Asynchronous lookup, supporting bun, npm, pnpm, and yarn
const workspaceRoot = await resolveWorkspaceRootAsync(__dirname);
// Asynchronous lookup, supporting only bun, npm, and yarn
const workspaceRoot = await resolveWorkspaceRootAsync(__dirname, { packageWorkspaces: false });
// Asynchronous lookup, supporting only pnpm
const workspaceRoot = await resolveWorkspaceRootAsync(__dirname, { pnpmWorkspaces: false });
import { getWorkspaceGlobs, getWorkspaceGlobsAsync } from 'resolve-workspace-root';
// Synchronous lookup, supporting bun, npm, pnpm, and yarn
const workspaces = getWorkspaceGlobs(resolveWorkspaceRoot(__dirname));
// Asynchronous lookup, supporting bun, npm, pnpm, and yarn
const workspaces = await getWorkspaceGlobsAsync(resolveWorkspaceRoot(__dirname));
```
<div align="center">
<br />
with&nbsp;❤️&nbsp;&nbsp;<strong><a href="https://cedric.dev">Cedric</a></strong>
<br />
</div>

39
node_modules/resolve-workspace-root/build/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,39 @@
type ResolveWorkspaceOptions = Partial<{
packageWorkspaces: boolean;
pnpmWorkspaces: boolean;
}>;
/**
* Resolve the root of the workspace, using bun, npm, pnpm, or yarn.
* This will iterate the parent directories until it finds a workspace config,
* where the starting directory is considered part of the workspace.
* - For bun and npm - it looks for the [`workspaces` list](https://docs.npmjs.com/cli/configuring-npm/package-json#workspaces) in `package.json`
* - For yarn - it looks for the [`workspaces` list or config](https://yarnpkg.com/features/workspaces) in `package.json`
* - For pnpm - it looks for the [`pnpm-workspace.yaml`](https://pnpm.io/workspaces) file
*/
export declare function resolveWorkspaceRoot(startingDir?: string, options?: ResolveWorkspaceOptions): string | null;
/**
* Resolve the root of the workspace, using bun, npm, pnpm, or yarn.
* This will iterate the parent directories until it finds a workspace config,
* where the starting directory is considered part of the workspace.
* - For bun and npm - it looks for the [`workspaces` list](https://docs.npmjs.com/cli/configuring-npm/package-json#workspaces) in `package.json`
* - For yarn - it looks for the [`workspaces` list or config](https://yarnpkg.com/features/workspaces) in `package.json`
* - For pnpm - it looks for the [`pnpm-workspace.yaml`](https://pnpm.io/workspaces) file
*/
export declare function resolveWorkspaceRootAsync(startingDir?: string, options?: ResolveWorkspaceOptions): Promise<string | null>;
/**
* Get the configured workspace globs from the monorepo.
* - For bun and npm - it looks for the [`workspaces` list](https://docs.npmjs.com/cli/configuring-npm/package-json#workspaces) in `package.json`
* - For yarn - it looks for the [`workspaces` list or config](https://yarnpkg.com/features/workspaces) in `package.json`
* - For pnpm - it looks for the [`pnpm-workspace.yaml`](https://pnpm.io/workspaces) file
* @note The provided `rootDir` must be the root of the monorepo
*/
export declare function getWorkspaceGlobs(rootDir?: string, options?: ResolveWorkspaceOptions): string[] | null;
/**
* Get the configured workspace globs from the monorepo.
* - For bun and npm - it looks for the [`workspaces` list](https://docs.npmjs.com/cli/configuring-npm/package-json#workspaces) in `package.json`
* - For yarn - it looks for the [`workspaces` list or config](https://yarnpkg.com/features/workspaces) in `package.json`
* - For pnpm - it looks for the [`pnpm-workspace.yaml`](https://pnpm.io/workspaces) file
* @note The provided `rootDir` must be the root of the monorepo
*/
export declare function getWorkspaceGlobsAsync(rootDir?: string, options?: ResolveWorkspaceOptions): Promise<string[] | null>;
export {};

22
node_modules/resolve-workspace-root/build/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

62
node_modules/resolve-workspace-root/package.json generated vendored Normal file
View File

@@ -0,0 +1,62 @@
{
"name": "resolve-workspace-root",
"version": "2.0.1",
"description": "Resolve the workspace root using bun, npm, pnpm, or yarn",
"main": "build/index.js",
"types": "build/index.d.ts",
"files": [
"build/index.js",
"build/index.d.ts"
],
"scripts": {
"build": "ncc build src/index.ts --out build --minify --no-cache --no-source-map-register && tsc --declaration --emitDeclarationOnly",
"lint": "eslint . --ext ts",
"test": "bun test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/byCedric/resolve-workspace-root.git"
},
"keywords": [
"monorepo",
"workspace",
"bun",
"npm",
"pnpm",
"yarn"
],
"author": "Cedric van Putten <me@cedric.dev>",
"license": "MIT",
"bugs": {
"url": "https://github.com/byCedric/resolve-workspace-root/issues"
},
"homepage": "https://github.com/byCedric/resolve-workspace-root#readme",
"devDependencies": {
"@tsconfig/node20": "^20.1.4",
"@types/bun": "^1.1.6",
"@types/js-yaml": "^4.0.9",
"@types/micromatch": "^4.0.9",
"@types/node": "^22.5.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"eslint-config-universe": "^13.0.0",
"js-yaml": "^4.1.0",
"memfs": "^4.11.1",
"micromatch": "^4.0.7",
"prettier": "^3.3.3",
"typescript": "^5.5.4"
},
"eslintConfig": {
"extends": "universe/node",
"ignorePatterns": [
"build",
"node_modules"
]
},
"prettier": {
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "es5"
}
}