@pnpm/workspace.projects-reader 1101.0.13 → 1101.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/workspace.projects-reader",
3
- "version": "1101.0.13",
3
+ "version": "1101.0.15",
4
4
  "description": "Finds packages inside a workspace",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -27,13 +27,13 @@
27
27
  "!*.map"
28
28
  ],
29
29
  "dependencies": {
30
+ "@pnpm/cli.utils": "1101.0.15",
31
+ "@pnpm/constants": "1100.0.0",
32
+ "@pnpm/types": "1101.4.0",
30
33
  "@pnpm/util.lex-comparator": "^4.0.1",
34
+ "@pnpm/workspace.project-manifest-reader": "1100.0.16",
31
35
  "p-filter": "^4.1.0",
32
- "tinyglobby": "^0.2.16",
33
- "@pnpm/cli.utils": "1101.0.13",
34
- "@pnpm/constants": "1100.0.0",
35
- "@pnpm/types": "1101.3.2",
36
- "@pnpm/workspace.project-manifest-reader": "1100.0.14"
36
+ "tinyglobby": "^0.2.16"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@pnpm/logger": "^1100.0.0"
@@ -41,8 +41,8 @@
41
41
  "devDependencies": {
42
42
  "@jest/globals": "30.4.1",
43
43
  "@pnpm/logger": "1100.0.0",
44
- "@pnpm/workspace.projects-reader": "1101.0.13",
45
- "@pnpm/workspace.workspace-manifest-reader": "1100.0.9"
44
+ "@pnpm/workspace.projects-reader": "1101.0.15",
45
+ "@pnpm/workspace.workspace-manifest-reader": "1100.1.0"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=22.13"
@@ -1,7 +0,0 @@
1
- import type { Project } from '@pnpm/types';
2
- export interface FindPackagesOptions {
3
- ignore?: string[];
4
- includeRoot?: boolean;
5
- patterns?: string[];
6
- }
7
- export declare function findPackages(root: string, opts?: FindPackagesOptions): Promise<Project[]>;
@@ -1,56 +0,0 @@
1
- import { promises as fs } from 'node:fs';
2
- import path from 'node:path';
3
- import util from 'node:util';
4
- import { lexCompare } from '@pnpm/util.lex-comparator';
5
- import { readExactProjectManifest } from '@pnpm/workspace.project-manifest-reader';
6
- import pFilter from 'p-filter';
7
- import { glob } from 'tinyglobby';
8
- const DEFAULT_IGNORE = [
9
- '**/node_modules/**',
10
- '**/bower_components/**',
11
- '**/test/**',
12
- '**/tests/**',
13
- ];
14
- export async function findPackages(root, opts) {
15
- opts = opts ?? {};
16
- const globOpts = { ...opts, cwd: root, expandDirectories: false };
17
- globOpts.ignore = opts.ignore ?? DEFAULT_IGNORE;
18
- const patterns = normalizePatterns(opts.patterns ?? ['.', '**']);
19
- delete globOpts.patterns;
20
- const paths = await glob(patterns, globOpts);
21
- if (opts.includeRoot) {
22
- // Always include the workspace root (https://github.com/pnpm/pnpm/issues/1986)
23
- paths.push(...(await glob(normalizePatterns(['.']), globOpts)));
24
- }
25
- return pFilter(
26
- // `Array.from()` doesn't create an intermediate instance,
27
- // unlike `array.map()`
28
- Array.from(
29
- // Remove duplicate paths using `Set`
30
- new Set(paths
31
- .map(manifestPath => path.join(root, manifestPath))
32
- .sort((path1, path2) => lexCompare(path.dirname(path1), path.dirname(path2)))), async (manifestPath) => {
33
- try {
34
- const rootDir = path.dirname(manifestPath);
35
- return {
36
- rootDir,
37
- rootDirRealPath: await fs.realpath(rootDir),
38
- ...await readExactProjectManifest(manifestPath),
39
- };
40
- }
41
- catch (err) {
42
- if (util.types.isNativeError(err) && 'code' in err && err.code === 'ENOENT') {
43
- return null;
44
- }
45
- throw err;
46
- }
47
- }), Boolean);
48
- }
49
- function normalizePatterns(patterns) {
50
- const normalizedPatterns = [];
51
- for (const pattern of patterns) {
52
- normalizedPatterns.push(pattern.replace(/\/?$/, '/package.{json,yaml,json5}'));
53
- }
54
- return normalizedPatterns;
55
- }
56
- //# sourceMappingURL=findPackages.js.map
package/lib/index.d.ts DELETED
@@ -1,20 +0,0 @@
1
- import type { Project, SupportedArchitectures } from '@pnpm/types';
2
- export { findPackages, type FindPackagesOptions } from './findPackages.js';
3
- export type { Project };
4
- export interface FindWorkspaceProjectsOpts {
5
- /**
6
- * An array of globs for the packages included in the workspace.
7
- *
8
- * In most cases, callers should read the pnpm-workspace.yml and pass the
9
- * "packages" field.
10
- */
11
- patterns?: string[];
12
- engineStrict?: boolean;
13
- nodeVersion?: string;
14
- sharedWorkspaceLockfile?: boolean;
15
- supportedArchitectures?: SupportedArchitectures;
16
- }
17
- export declare function findWorkspaceProjects(workspaceRoot: string, opts?: FindWorkspaceProjectsOpts): Promise<Project[]>;
18
- export declare function findWorkspaceProjectsNoCheck(workspaceRoot: string, opts?: {
19
- patterns?: string[];
20
- }): Promise<Project[]>;