@storm-software/pnpm-tools 0.1.0

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.
Files changed (39) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +343 -0
  3. package/dist/bin/storm-pnpm.cjs +190 -0
  4. package/dist/bin/storm-pnpm.js +201 -0
  5. package/dist/chunk-37NNBVUD.js +1 -0
  6. package/dist/chunk-A7CA5CJR.cjs +1 -0
  7. package/dist/chunk-E5PO4ZUE.js +4 -0
  8. package/dist/chunk-GGNOJ77I.js +0 -0
  9. package/dist/chunk-GV6YH6UO.js +0 -0
  10. package/dist/chunk-MIMRANFI.cjs +1 -0
  11. package/dist/chunk-OOW4ISC7.js +1 -0
  12. package/dist/chunk-PTW7Z2XZ.cjs +4 -0
  13. package/dist/chunk-QNTSKZUU.cjs +1 -0
  14. package/dist/chunk-SFZRYJZ2.cjs +1 -0
  15. package/dist/helpers/catalog.cjs +1 -0
  16. package/dist/helpers/catalog.d.cts +46 -0
  17. package/dist/helpers/catalog.d.ts +46 -0
  18. package/dist/helpers/catalog.js +1 -0
  19. package/dist/helpers/index.cjs +1 -0
  20. package/dist/helpers/index.d.cts +4 -0
  21. package/dist/helpers/index.d.ts +4 -0
  22. package/dist/helpers/index.js +1 -0
  23. package/dist/helpers/pnpm-workspace.cjs +1 -0
  24. package/dist/helpers/pnpm-workspace.d.cts +28 -0
  25. package/dist/helpers/pnpm-workspace.d.ts +28 -0
  26. package/dist/helpers/pnpm-workspace.js +1 -0
  27. package/dist/helpers/replace-deps-aliases.cjs +1 -0
  28. package/dist/helpers/replace-deps-aliases.d.cts +11 -0
  29. package/dist/helpers/replace-deps-aliases.d.ts +11 -0
  30. package/dist/helpers/replace-deps-aliases.js +1 -0
  31. package/dist/index.cjs +1 -0
  32. package/dist/index.d.cts +4 -0
  33. package/dist/index.d.ts +4 -0
  34. package/dist/index.js +1 -0
  35. package/dist/types.cjs +1 -0
  36. package/dist/types.d.cts +63 -0
  37. package/dist/types.d.ts +63 -0
  38. package/dist/types.js +1 -0
  39. package/package.json +110 -0
@@ -0,0 +1,190 @@
1
+ #!/usr/bin/env node
2
+
3
+ // bin/storm-pnpm.ts
4
+ var import_config_tools2 = require("@storm-software/config-tools");
5
+
6
+ // src/cli/index.ts
7
+ var import_config_tools = require("@storm-software/config-tools");
8
+ var import_commander = require("commander");
9
+ var import_node_child_process = require("child_process");
10
+
11
+ // src/helpers/catalog.ts
12
+ var import_find_workspace_root2 = require("@storm-software/config-tools/utilities/find-workspace-root");
13
+ var import_constants = require("@storm-software/npm-tools/constants");
14
+ var import_get_version = require("@storm-software/npm-tools/helpers/get-version");
15
+ var import_semver = require("semver");
16
+
17
+ // src/helpers/pnpm-workspace.ts
18
+ var import_correct_paths = require("@storm-software/config-tools/utilities/correct-paths");
19
+ var import_find_workspace_root = require("@storm-software/config-tools/utilities/find-workspace-root");
20
+ var import_js_yaml = require("js-yaml");
21
+ var import_node_fs = require("fs");
22
+ var import_promises = require("fs/promises");
23
+ async function readPnpmWorkspaceFile(workspaceRoot = (0, import_find_workspace_root.findWorkspaceRoot)(process.cwd())) {
24
+ const pnpmWorkspacePath = (0, import_correct_paths.joinPaths)(workspaceRoot, "pnpm-workspace.yaml");
25
+ if (!(0, import_node_fs.existsSync)(pnpmWorkspacePath)) {
26
+ console.warn(
27
+ `No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${pnpmWorkspacePath}).`
28
+ );
29
+ return;
30
+ }
31
+ return (0, import_js_yaml.load)(pnpmWorkspacePath);
32
+ }
33
+ async function writePnpmWorkspaceFile(pnpmWorkspaceFile, workspaceRoot = (0, import_find_workspace_root.findWorkspaceRoot)(process.cwd())) {
34
+ const pnpmWorkspacePath = (0, import_correct_paths.joinPaths)(workspaceRoot, "pnpm-workspace.yaml");
35
+ if (!(0, import_node_fs.existsSync)(pnpmWorkspacePath)) {
36
+ console.warn(
37
+ `No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${pnpmWorkspacePath}).`
38
+ );
39
+ return;
40
+ }
41
+ await (0, import_promises.writeFile)(pnpmWorkspacePath, (0, import_js_yaml.dump)(pnpmWorkspaceFile));
42
+ }
43
+
44
+ // src/helpers/catalog.ts
45
+ async function getCatalog(workspaceRoot = (0, import_find_workspace_root2.findWorkspaceRoot)(process.cwd())) {
46
+ const pnpmWorkspaceFile = await readPnpmWorkspaceFile(workspaceRoot);
47
+ if (pnpmWorkspaceFile?.catalog) {
48
+ return Object.fromEntries(
49
+ Object.entries(pnpmWorkspaceFile.catalog).map(([key, value]) => {
50
+ return [key, value.replaceAll(/^"/g, "").replaceAll(/"$/g, "")];
51
+ })
52
+ );
53
+ }
54
+ return;
55
+ }
56
+ async function setCatalog(catalog, workspaceRoot = (0, import_find_workspace_root2.findWorkspaceRoot)(process.cwd())) {
57
+ const pnpmWorkspaceFile = await readPnpmWorkspaceFile(workspaceRoot);
58
+ if (!pnpmWorkspaceFile) {
59
+ throw new Error("No pnpm-workspace.yaml file found");
60
+ }
61
+ pnpmWorkspaceFile.catalog = Object.fromEntries(
62
+ Object.entries(catalog).map(([key, value]) => {
63
+ return [key, `"${value}"`];
64
+ })
65
+ );
66
+ await writePnpmWorkspaceFile(pnpmWorkspaceFile, workspaceRoot);
67
+ }
68
+ async function upgradeCatalogPackage(packageName, options = {}) {
69
+ const {
70
+ tag = import_constants.DEFAULT_NPM_TAG,
71
+ throwIfMissingInCatalog = false,
72
+ workspaceRoot = (0, import_find_workspace_root2.findWorkspaceRoot)()
73
+ } = options;
74
+ const catalog = await getCatalog(workspaceRoot);
75
+ if (!catalog) {
76
+ throw new Error("No catalog found");
77
+ }
78
+ if (throwIfMissingInCatalog === true && !catalog[packageName]) {
79
+ throw new Error(
80
+ `Package "${packageName}" not found in catalog: ${JSON.stringify(
81
+ catalog,
82
+ null,
83
+ 2
84
+ )}`
85
+ );
86
+ }
87
+ const version = await (0, import_get_version.getVersion)(packageName, tag);
88
+ if (!(0, import_semver.valid)((0, import_semver.coerce)(catalog[packageName])) || (0, import_semver.coerce)(catalog[packageName]) && (0, import_semver.coerce)(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
89
+ (0, import_semver.gt)((0, import_semver.coerce)(version), (0, import_semver.coerce)(catalog[packageName]))) {
90
+ catalog[packageName] = version;
91
+ }
92
+ await setCatalog(catalog, workspaceRoot);
93
+ }
94
+
95
+ // src/cli/index.ts
96
+ var _config = {};
97
+ function createProgram(config) {
98
+ _config = config;
99
+ (0, import_config_tools.writeInfo)("\u26A1 Running Storm pnpm command-line application", config);
100
+ const root = (0, import_config_tools.findWorkspaceRootSafe)(process.cwd());
101
+ process.env.STORM_WORKSPACE_ROOT ??= root;
102
+ process.env.NX_WORKSPACE_ROOT_PATH ??= root;
103
+ if (root) {
104
+ process.chdir(root);
105
+ }
106
+ const program = new import_commander.Command("storm-pnpm");
107
+ program.version("1.0.0", "-v --version", "display CLI version");
108
+ program.command("update").description("Update pnpm catalog dependency package version.").addArgument(
109
+ new import_commander.Argument(
110
+ "<package-name>",
111
+ "The package name/pattern to update the version for (e.g., @storm-software/config or @storm-software/ for all Storm packages)."
112
+ )
113
+ ).option(
114
+ "--tag <tag>",
115
+ 'The npm tag to use when fetching the latest version of the package (e.g., "latest", "next", etc.). Defaults to "latest".',
116
+ "latest"
117
+ ).action(updateAction);
118
+ return program;
119
+ }
120
+ async function updateAction({
121
+ packageName,
122
+ tag
123
+ }) {
124
+ try {
125
+ (0, import_config_tools.writeInfo)(
126
+ `\u26A1 Preparing to update the package version for ${packageName}. Please provide the requested details below...`,
127
+ _config
128
+ );
129
+ const catalog = await getCatalog();
130
+ if (!catalog) {
131
+ throw new Error(
132
+ "No catalog found in the pnpm-workspace.yaml file of the current workspace."
133
+ );
134
+ }
135
+ const matchedPackages = Object.keys(catalog).filter(
136
+ (pkg) => packageName.endsWith("/") ? pkg.startsWith(packageName) : pkg === packageName
137
+ );
138
+ if (matchedPackages.length === 0) {
139
+ throw new Error(
140
+ `No packages found in the catalog matching the name/pattern "${packageName}".`
141
+ );
142
+ }
143
+ await Promise.all(
144
+ matchedPackages.map(
145
+ (pkg) => upgradeCatalogPackage(pkg, { tag, throwIfMissingInCatalog: true })
146
+ )
147
+ );
148
+ await new Promise((resolve, reject) => {
149
+ (0, import_node_child_process.exec)("pnpm dedupe", (error, stdout, stderr) => {
150
+ if (error) {
151
+ return reject(error);
152
+ }
153
+ if (stderr) {
154
+ return reject(stderr);
155
+ }
156
+ return resolve(stdout.trim());
157
+ });
158
+ });
159
+ (0, import_config_tools.writeSuccess)(
160
+ `\u{1F389} Storm pnpm update processing completed successfully!`,
161
+ _config
162
+ );
163
+ } catch (error) {
164
+ (0, import_config_tools.writeFatal)(
165
+ `A fatal error occurred while running Storm pnpm update:
166
+
167
+ ${error.message}`,
168
+ _config
169
+ );
170
+ throw new Error(error.message, { cause: error });
171
+ }
172
+ }
173
+
174
+ // bin/storm-pnpm.ts
175
+ void (async () => {
176
+ const config = await (0, import_config_tools2.getConfig)();
177
+ try {
178
+ (0, import_config_tools2.handleProcess)(config);
179
+ const program = createProgram(config);
180
+ await program.parseAsync(process.argv);
181
+ (0, import_config_tools2.writeSuccess)(
182
+ `\u{1F389} Git ${process.argv && process.argv.length >= 3 && process.argv[2] ? process.argv[2] : "tool"} processing completed successfully!`,
183
+ config
184
+ );
185
+ (0, import_config_tools2.exitWithSuccess)(config);
186
+ } catch (error) {
187
+ (0, import_config_tools2.exitWithError)(config);
188
+ process.exit(1);
189
+ }
190
+ })();
@@ -0,0 +1,201 @@
1
+ #!/usr/bin/env node
2
+
3
+ // bin/storm-pnpm.ts
4
+ import {
5
+ exitWithError,
6
+ exitWithSuccess,
7
+ getConfig,
8
+ handleProcess,
9
+ writeSuccess as writeSuccess2
10
+ } from "@storm-software/config-tools";
11
+
12
+ // src/cli/index.ts
13
+ import {
14
+ findWorkspaceRootSafe,
15
+ writeFatal,
16
+ writeInfo,
17
+ writeSuccess
18
+ } from "@storm-software/config-tools";
19
+ import { Argument, Command } from "commander";
20
+ import { exec } from "node:child_process";
21
+
22
+ // src/helpers/catalog.ts
23
+ import { findWorkspaceRoot as findWorkspaceRoot2 } from "@storm-software/config-tools/utilities/find-workspace-root";
24
+ import { DEFAULT_NPM_TAG } from "@storm-software/npm-tools/constants";
25
+ import { getVersion } from "@storm-software/npm-tools/helpers/get-version";
26
+ import { coerce, gt, valid } from "semver";
27
+
28
+ // src/helpers/pnpm-workspace.ts
29
+ import { joinPaths } from "@storm-software/config-tools/utilities/correct-paths";
30
+ import { findWorkspaceRoot } from "@storm-software/config-tools/utilities/find-workspace-root";
31
+ import { dump, load } from "js-yaml";
32
+ import { existsSync } from "node:fs";
33
+ import { writeFile } from "node:fs/promises";
34
+ async function readPnpmWorkspaceFile(workspaceRoot = findWorkspaceRoot(process.cwd())) {
35
+ const pnpmWorkspacePath = joinPaths(workspaceRoot, "pnpm-workspace.yaml");
36
+ if (!existsSync(pnpmWorkspacePath)) {
37
+ console.warn(
38
+ `No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${pnpmWorkspacePath}).`
39
+ );
40
+ return;
41
+ }
42
+ return load(pnpmWorkspacePath);
43
+ }
44
+ async function writePnpmWorkspaceFile(pnpmWorkspaceFile, workspaceRoot = findWorkspaceRoot(process.cwd())) {
45
+ const pnpmWorkspacePath = joinPaths(workspaceRoot, "pnpm-workspace.yaml");
46
+ if (!existsSync(pnpmWorkspacePath)) {
47
+ console.warn(
48
+ `No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${pnpmWorkspacePath}).`
49
+ );
50
+ return;
51
+ }
52
+ await writeFile(pnpmWorkspacePath, dump(pnpmWorkspaceFile));
53
+ }
54
+
55
+ // src/helpers/catalog.ts
56
+ async function getCatalog(workspaceRoot = findWorkspaceRoot2(process.cwd())) {
57
+ const pnpmWorkspaceFile = await readPnpmWorkspaceFile(workspaceRoot);
58
+ if (pnpmWorkspaceFile?.catalog) {
59
+ return Object.fromEntries(
60
+ Object.entries(pnpmWorkspaceFile.catalog).map(([key, value]) => {
61
+ return [key, value.replaceAll(/^"/g, "").replaceAll(/"$/g, "")];
62
+ })
63
+ );
64
+ }
65
+ return;
66
+ }
67
+ async function setCatalog(catalog, workspaceRoot = findWorkspaceRoot2(process.cwd())) {
68
+ const pnpmWorkspaceFile = await readPnpmWorkspaceFile(workspaceRoot);
69
+ if (!pnpmWorkspaceFile) {
70
+ throw new Error("No pnpm-workspace.yaml file found");
71
+ }
72
+ pnpmWorkspaceFile.catalog = Object.fromEntries(
73
+ Object.entries(catalog).map(([key, value]) => {
74
+ return [key, `"${value}"`];
75
+ })
76
+ );
77
+ await writePnpmWorkspaceFile(pnpmWorkspaceFile, workspaceRoot);
78
+ }
79
+ async function upgradeCatalogPackage(packageName, options = {}) {
80
+ const {
81
+ tag = DEFAULT_NPM_TAG,
82
+ throwIfMissingInCatalog = false,
83
+ workspaceRoot = findWorkspaceRoot2()
84
+ } = options;
85
+ const catalog = await getCatalog(workspaceRoot);
86
+ if (!catalog) {
87
+ throw new Error("No catalog found");
88
+ }
89
+ if (throwIfMissingInCatalog === true && !catalog[packageName]) {
90
+ throw new Error(
91
+ `Package "${packageName}" not found in catalog: ${JSON.stringify(
92
+ catalog,
93
+ null,
94
+ 2
95
+ )}`
96
+ );
97
+ }
98
+ const version = await getVersion(packageName, tag);
99
+ if (!valid(coerce(catalog[packageName])) || coerce(catalog[packageName]) && coerce(version) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
100
+ gt(coerce(version), coerce(catalog[packageName]))) {
101
+ catalog[packageName] = version;
102
+ }
103
+ await setCatalog(catalog, workspaceRoot);
104
+ }
105
+
106
+ // src/cli/index.ts
107
+ var _config = {};
108
+ function createProgram(config) {
109
+ _config = config;
110
+ writeInfo("\u26A1 Running Storm pnpm command-line application", config);
111
+ const root = findWorkspaceRootSafe(process.cwd());
112
+ process.env.STORM_WORKSPACE_ROOT ??= root;
113
+ process.env.NX_WORKSPACE_ROOT_PATH ??= root;
114
+ if (root) {
115
+ process.chdir(root);
116
+ }
117
+ const program = new Command("storm-pnpm");
118
+ program.version("1.0.0", "-v --version", "display CLI version");
119
+ program.command("update").description("Update pnpm catalog dependency package version.").addArgument(
120
+ new Argument(
121
+ "<package-name>",
122
+ "The package name/pattern to update the version for (e.g., @storm-software/config or @storm-software/ for all Storm packages)."
123
+ )
124
+ ).option(
125
+ "--tag <tag>",
126
+ 'The npm tag to use when fetching the latest version of the package (e.g., "latest", "next", etc.). Defaults to "latest".',
127
+ "latest"
128
+ ).action(updateAction);
129
+ return program;
130
+ }
131
+ async function updateAction({
132
+ packageName,
133
+ tag
134
+ }) {
135
+ try {
136
+ writeInfo(
137
+ `\u26A1 Preparing to update the package version for ${packageName}. Please provide the requested details below...`,
138
+ _config
139
+ );
140
+ const catalog = await getCatalog();
141
+ if (!catalog) {
142
+ throw new Error(
143
+ "No catalog found in the pnpm-workspace.yaml file of the current workspace."
144
+ );
145
+ }
146
+ const matchedPackages = Object.keys(catalog).filter(
147
+ (pkg) => packageName.endsWith("/") ? pkg.startsWith(packageName) : pkg === packageName
148
+ );
149
+ if (matchedPackages.length === 0) {
150
+ throw new Error(
151
+ `No packages found in the catalog matching the name/pattern "${packageName}".`
152
+ );
153
+ }
154
+ await Promise.all(
155
+ matchedPackages.map(
156
+ (pkg) => upgradeCatalogPackage(pkg, { tag, throwIfMissingInCatalog: true })
157
+ )
158
+ );
159
+ await new Promise((resolve, reject) => {
160
+ exec("pnpm dedupe", (error, stdout, stderr) => {
161
+ if (error) {
162
+ return reject(error);
163
+ }
164
+ if (stderr) {
165
+ return reject(stderr);
166
+ }
167
+ return resolve(stdout.trim());
168
+ });
169
+ });
170
+ writeSuccess(
171
+ `\u{1F389} Storm pnpm update processing completed successfully!`,
172
+ _config
173
+ );
174
+ } catch (error) {
175
+ writeFatal(
176
+ `A fatal error occurred while running Storm pnpm update:
177
+
178
+ ${error.message}`,
179
+ _config
180
+ );
181
+ throw new Error(error.message, { cause: error });
182
+ }
183
+ }
184
+
185
+ // bin/storm-pnpm.ts
186
+ void (async () => {
187
+ const config = await getConfig();
188
+ try {
189
+ handleProcess(config);
190
+ const program = createProgram(config);
191
+ await program.parseAsync(process.argv);
192
+ writeSuccess2(
193
+ `\u{1F389} Git ${process.argv && process.argv.length >= 3 && process.argv[2] ? process.argv[2] : "tool"} processing completed successfully!`,
194
+ config
195
+ );
196
+ exitWithSuccess(config);
197
+ } catch (error) {
198
+ exitWithError(config);
199
+ process.exit(1);
200
+ }
201
+ })();
@@ -0,0 +1 @@
1
+ import {b,d,e}from'./chunk-E5PO4ZUE.js';import {exec}from'node:child_process';import {valid,coerce,gt}from'semver';var _="latest";var p=_;async function l(){return new Promise((t,r)=>{exec("npm config get registry",(n,o,i)=>n?r(n):i?r(i):t(o.trim()));})}async function R(t,r=p,n={}){let{registry:o=l()}=n;return new Promise((i,e)=>{exec(`npm view ${t} version --registry=${o} --tag=${r}`,(s,E,u)=>s?e(s):u?e(u):i(E.trim()));})}async function A(t=b(process.cwd())){let r=await d(t);if(r?.catalog)return Object.fromEntries(Object.entries(r.catalog).map(([n,o])=>[n,o.replaceAll(/^"/g,"").replaceAll(/"$/g,"")]))}async function x(t,r=b(process.cwd())){let n=await d(r);if(!n)throw new Error("No pnpm-workspace.yaml file found");n.catalog=Object.fromEntries(Object.entries(t).map(([o,i])=>[o,`"${i}"`])),await e(n,r);}async function B(t,r={}){let{tag:n=p,throwIfMissingInCatalog:o=false,workspaceRoot:i=b()}=r,e=await A(i);if(!e)throw new Error("No catalog found");if(o===true&&!e[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(e,null,2)}`);let s=await R(t,n);(!valid(coerce(e[t]))||coerce(e[t])&&coerce(s)&&gt(coerce(s),coerce(e[t])))&&(e[t]=s),await x(e,i);}export{A as a,x as b,B as c};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkPTW7Z2XZ_cjs=require('./chunk-PTW7Z2XZ.cjs'),child_process=require('child_process'),semver=require('semver');var T="latest";var p=T;async function _(){return new Promise((t,r)=>{child_process.exec("npm config get registry",(n,o,i)=>n?r(n):i?r(i):t(o.trim()));})}async function l(t,r=p,n={}){let{registry:o=_()}=n;return new Promise((i,e)=>{child_process.exec(`npm view ${t} version --registry=${o} --tag=${r}`,(s,R,m)=>s?e(s):m?e(m):i(R.trim()));})}async function y(t=chunkPTW7Z2XZ_cjs.b(process.cwd())){let r=await chunkPTW7Z2XZ_cjs.d(t);if(r?.catalog)return Object.fromEntries(Object.entries(r.catalog).map(([n,o])=>[n,o.replaceAll(/^"/g,"").replaceAll(/"$/g,"")]))}async function A(t,r=chunkPTW7Z2XZ_cjs.b(process.cwd())){let n=await chunkPTW7Z2XZ_cjs.d(r);if(!n)throw new Error("No pnpm-workspace.yaml file found");n.catalog=Object.fromEntries(Object.entries(t).map(([o,i])=>[o,`"${i}"`])),await chunkPTW7Z2XZ_cjs.e(n,r);}async function W(t,r={}){let{tag:n=p,throwIfMissingInCatalog:o=false,workspaceRoot:i=chunkPTW7Z2XZ_cjs.b()}=r,e=await y(i);if(!e)throw new Error("No catalog found");if(o===true&&!e[t])throw new Error(`Package "${t}" not found in catalog: ${JSON.stringify(e,null,2)}`);let s=await l(t,n);(!semver.valid(semver.coerce(e[t]))||semver.coerce(e[t])&&semver.coerce(s)&&semver.gt(semver.coerce(s),semver.coerce(e[t])))&&(e[t]=s),await A(e,i);}exports.a=y;exports.b=A;exports.c=W;
@@ -0,0 +1,4 @@
1
+ import {existsSync}from'node:fs';import {join}from'node:path';import {load,dump}from'js-yaml';import {writeFile}from'node:fs/promises';var x=/^[A-Za-z]:\//;function P(e=""){return e&&e.replace(/\\/g,"/").replace(x,n=>n.toUpperCase())}var _=/^[/\\]{2}/,R=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,E=/^[A-Za-z]:$/;var a=function(e){if(!e||e.length===0)return ".";e=P(e);let n=e.match(_),t=h(e),o=e[e.length-1]==="/";return e=j(e,!t),e.length===0?t?"/":o?"./":".":(o&&(e+="/"),E.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!h(e)?`/${e}`:e)},l=function(...e){let n="";for(let t of e)if(t)if(n.length>0){let o=n[n.length-1]==="/",r=t[0]==="/";o&&r?n+=t.slice(1):n+=o||r?t:`/${t}`;}else n+=t;return a(n)};function j(e,n){let t="",o=0,r=-1,c=0,i=null;for(let s=0;s<=e.length;++s){if(s<e.length)i=e[s];else {if(i==="/")break;i="/";}if(i==="/"){if(!(r===s-1||c===1))if(c===2){if(t.length<2||o!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let k=t.lastIndexOf("/");k===-1?(t="",o=0):(t=t.slice(0,k),o=t.length-1-t.lastIndexOf("/")),r=s,c=0;continue}else if(t.length>0){t="",o=0,r=s,c=0;continue}}n&&(t+=t.length>0?"/..":"..",o=2);}else t.length>0?t+=`/${e.slice(r+1,s)}`:t=e.slice(r+1,s),o=s-r-1;r=s,c=0;}else i==="."&&c!==-1?++c:c=-1;}return t}var h=function(e){return R.test(e)};var A=30,O=0;function d(e,n=[],t=[]){let o=e??process.cwd();if(t.some(r=>existsSync(join(o,r)))||n.some(r=>existsSync(join(o,r))))return o;if(o!=="/"&&O++<A){let r=join(o,"..");return d(r,n,t)}}var y=["storm-workspace.json","storm-workspace.yaml","storm-workspace.yml","storm-workspace.js","storm-workspace.ts",".storm-workspace.json",".storm-workspace.yaml",".storm-workspace.yml",".storm-workspace.js",".storm-workspace.ts","lerna.json","nx.json","turbo.json","npm-workspace.json","yarn-workspace.json","pnpm-workspace.json","npm-workspace.yaml","yarn-workspace.yaml","pnpm-workspace.yaml","npm-workspace.yml","yarn-workspace.yml","pnpm-workspace.yml","npm-lock.json","yarn-lock.json","pnpm-lock.json","npm-lock.yaml","yarn-lock.yaml","pnpm-lock.yaml","npm-lock.yml","yarn-lock.yml","pnpm-lock.yml","bun.lockb"],T=[".storm-workspace",".nx",".github",".vscode",".verdaccio"];function W(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?a(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):a(d(e??process.cwd(),y,T))}function p(e){let n=W(e);if(!n)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
2
+ ${y.join(`
3
+ `)}
4
+ Path: ${e||process.cwd()}`);return n}async function V(e=p(process.cwd())){let n=l(e,"pnpm-workspace.yaml");if(!existsSync(n)){console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${n}).`);return}return n}async function G(e=p(process.cwd())){let n=l(e,"pnpm-workspace.yaml");if(!existsSync(n)){console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${n}).`);return}return load(n)}async function q(e,n=p(process.cwd())){let t=l(n,"pnpm-workspace.yaml");if(!existsSync(t)){console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${t}).`);return}await writeFile(t,dump(e));}export{l as a,p as b,V as c,G as d,q as e};
File without changes
File without changes
@@ -0,0 +1 @@
1
+ 'use strict';var chunkA7CA5CJR_cjs=require('./chunk-A7CA5CJR.cjs'),chunkPTW7Z2XZ_cjs=require('./chunk-PTW7Z2XZ.cjs'),devkit=require('@nx/devkit'),fs=require('fs'),promises=require('fs/promises'),prettier=require('prettier');async function C(c=process.cwd(),i=chunkPTW7Z2XZ_cjs.b(c)){let l=chunkPTW7Z2XZ_cjs.a(c,"package.json"),m=await promises.readFile(l,"utf8");if(!m)throw new Error("No package.json file found in package root: "+c);let p=await chunkA7CA5CJR_cjs.a(i),r=JSON.parse(m),g=chunkPTW7Z2XZ_cjs.a(i,"pnpm-workspace.yaml");if(!fs.existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),r;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=devkit.readCachedProjectGraph();}catch{await devkit.createProjectGraphAsync(),n=devkit.readCachedProjectGraph();}let d={};n&&await Promise.all(Object.keys(n.nodes).map(async a=>{let o=n.nodes[a];if(o?.data.root){let e=chunkPTW7Z2XZ_cjs.a(i,o.data.root,"package.json");if(fs.existsSync(e)){let t=await promises.readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d[f.name]=f.version);}}}));for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d[e])o[e]=`^${d[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return promises.writeFile(l,await prettier.format(JSON.stringify(r),{parser:"json",proseWrap:"always",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-pkg"]}))}exports.a=C;
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-37NNBVUD.js';import {b,a}from'./chunk-E5PO4ZUE.js';import {readCachedProjectGraph,createProjectGraphAsync}from'@nx/devkit';import {existsSync}from'node:fs';import {readFile,writeFile}from'node:fs/promises';import {format}from'prettier';async function $(c=process.cwd(),i=b(c)){let l=a(c,"package.json"),m=await readFile(l,"utf8");if(!m)throw new Error("No package.json file found in package root: "+c);let p=await a$1(i),r=JSON.parse(m),g=a(i,"pnpm-workspace.yaml");if(!existsSync(g))return console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${g}). Skipping pnpm catalog read for now.`),r;if(!p){console.warn("No pnpm catalog found. Skipping dependencies replacement for now.");return}for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e]==="catalog:"){if(!p)throw new Error(`Dependency ${e} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`);let t=p[e];if(!t)throw new Error("Missing pnpm catalog version for "+e);o[e]=t;}else if(o[e].startsWith("catalog:"))throw new Error("multiple named catalogs not supported")}}let n;try{n=readCachedProjectGraph();}catch{await createProjectGraphAsync(),n=readCachedProjectGraph();}let d={};n&&await Promise.all(Object.keys(n.nodes).map(async a$1=>{let o=n.nodes[a$1];if(o?.data.root){let e=a(i,o.data.root,"package.json");if(existsSync(e)){let t=await readFile(e,"utf8"),f=JSON.parse(t);f.private!==true&&(d[f.name]=f.version);}}}));for(let a of ["dependencies","devDependencies","peerDependencies"]){let o=r[a];if(o){for(let e of Object.keys(o))if(o[e].startsWith("workspace:"))if(d[e])o[e]=`^${d[e]}`;else throw new Error(`Workspace dependency ${e} not found in workspace packages.`)}}return writeFile(l,await format(JSON.stringify(r),{parser:"json",proseWrap:"always",trailingComma:"none",tabWidth:2,semi:true,singleQuote:false,quoteProps:"as-needed",insertPragma:false,bracketSameLine:true,printWidth:80,bracketSpacing:true,arrowParens:"avoid",endOfLine:"lf",plugins:["prettier-plugin-pkg"]}))}export{$ as a};
@@ -0,0 +1,4 @@
1
+ 'use strict';var fs=require('fs'),path=require('path'),jsYaml=require('js-yaml'),promises=require('fs/promises');var y=/^[A-Za-z]:\//;function x(e=""){return e&&e.replace(/\\/g,"/").replace(y,n=>n.toUpperCase())}var P=/^[/\\]{2}/,_=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,R=/^[A-Za-z]:$/;var a=function(e){if(!e||e.length===0)return ".";e=x(e);let n=e.match(P),t=k(e),o=e[e.length-1]==="/";return e=E(e,!t),e.length===0?t?"/":o?"./":".":(o&&(e+="/"),R.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!k(e)?`/${e}`:e)},l=function(...e){let n="";for(let t of e)if(t)if(n.length>0){let o=n[n.length-1]==="/",r=t[0]==="/";o&&r?n+=t.slice(1):n+=o||r?t:`/${t}`;}else n+=t;return a(n)};function E(e,n){let t="",o=0,r=-1,c=0,i=null;for(let s=0;s<=e.length;++s){if(s<e.length)i=e[s];else {if(i==="/")break;i="/";}if(i==="/"){if(!(r===s-1||c===1))if(c===2){if(t.length<2||o!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let g=t.lastIndexOf("/");g===-1?(t="",o=0):(t=t.slice(0,g),o=t.length-1-t.lastIndexOf("/")),r=s,c=0;continue}else if(t.length>0){t="",o=0,r=s,c=0;continue}}n&&(t+=t.length>0?"/..":"..",o=2);}else t.length>0?t+=`/${e.slice(r+1,s)}`:t=e.slice(r+1,s),o=s-r-1;r=s,c=0;}else i==="."&&c!==-1?++c:c=-1;}return t}var k=function(e){return _.test(e)};var j=30,A=0;function u(e,n=[],t=[]){let o=e??process.cwd();if(t.some(r=>fs.existsSync(path.join(o,r)))||n.some(r=>fs.existsSync(path.join(o,r))))return o;if(o!=="/"&&A++<j){let r=path.join(o,"..");return u(r,n,t)}}var w=["storm-workspace.json","storm-workspace.yaml","storm-workspace.yml","storm-workspace.js","storm-workspace.ts",".storm-workspace.json",".storm-workspace.yaml",".storm-workspace.yml",".storm-workspace.js",".storm-workspace.ts","lerna.json","nx.json","turbo.json","npm-workspace.json","yarn-workspace.json","pnpm-workspace.json","npm-workspace.yaml","yarn-workspace.yaml","pnpm-workspace.yaml","npm-workspace.yml","yarn-workspace.yml","pnpm-workspace.yml","npm-lock.json","yarn-lock.json","pnpm-lock.json","npm-lock.yaml","yarn-lock.yaml","pnpm-lock.yaml","npm-lock.yml","yarn-lock.yml","pnpm-lock.yml","bun.lockb"],O=[".storm-workspace",".nx",".github",".vscode",".verdaccio"];function T(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?a(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):a(u(e??process.cwd(),w,O))}function p(e){let n=T(e);if(!n)throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
2
+ ${w.join(`
3
+ `)}
4
+ Path: ${e||process.cwd()}`);return n}async function M(e=p(process.cwd())){let n=l(e,"pnpm-workspace.yaml");if(!fs.existsSync(n)){console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${n}).`);return}return n}async function V(e=p(process.cwd())){let n=l(e,"pnpm-workspace.yaml");if(!fs.existsSync(n)){console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${n}).`);return}return jsYaml.load(n)}async function G(e,n=p(process.cwd())){let t=l(n,"pnpm-workspace.yaml");if(!fs.existsSync(t)){console.warn(`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${t}).`);return}await promises.writeFile(t,jsYaml.dump(e));}exports.a=l;exports.b=p;exports.c=M;exports.d=V;exports.e=G;
@@ -0,0 +1 @@
1
+ 'use strict';
@@ -0,0 +1 @@
1
+ 'use strict';
@@ -0,0 +1 @@
1
+ 'use strict';var chunkA7CA5CJR_cjs=require('../chunk-A7CA5CJR.cjs');require('../chunk-PTW7Z2XZ.cjs');Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkA7CA5CJR_cjs.a}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkA7CA5CJR_cjs.b}});Object.defineProperty(exports,"upgradeCatalogPackage",{enumerable:true,get:function(){return chunkA7CA5CJR_cjs.c}});
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Retrieve the pnpm catalog from the workspace's `pnpm-workspace.yaml` file.
3
+ *
4
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(process.cwd())`.
5
+ * @returns A promise that resolves to the catalog object if found, or undefined if no catalog exists or the `pnpm-workspace.yaml` file is not found.
6
+ * @throws Will throw an error if the `pnpm-workspace.yaml` file is found but cannot be read.
7
+ */
8
+ declare function getCatalog(workspaceRoot?: string): Promise<Record<string, string> | undefined>;
9
+ /**
10
+ * Set the pnpm catalog in the workspace's `pnpm-workspace.yaml` file.
11
+ *
12
+ * @param catalog - The catalog object to set in the `pnpm-workspace.yaml` file.
13
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(process.cwd())`.
14
+ */
15
+ declare function setCatalog(catalog: Record<string, string>, workspaceRoot?: string): Promise<void>;
16
+ interface UpgradeCatalogPackageOptions {
17
+ /**
18
+ * The npm tag to use when fetching the latest version of the package.
19
+ *
20
+ * @defaultValue `"latest"`
21
+ */
22
+ tag?: string;
23
+ /**
24
+ * The root directory of the workspace.
25
+ *
26
+ * @defaultValue The value returned by `findWorkspaceRoot(process.cwd())`
27
+ */
28
+ workspaceRoot?: string;
29
+ /**
30
+ * An indicator of whether to throw an error if the package is not found in the catalog.
31
+ *
32
+ * @defaultValue `false`
33
+ */
34
+ throwIfMissingInCatalog?: boolean;
35
+ }
36
+ /**
37
+ * Update package.json dependencies currently using `catalog:` or `workspace:*` to use the pnpm catalog dependencies actual versions and the local workspace versions respectively.
38
+ *
39
+ * @param packageRoot - The root directory of the package to update. Defaults to the current working directory.
40
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(packageRoot)`.
41
+ * @returns A promise that resolves when the package.json file has been updated.
42
+ * @throws Will throw an error if no package.json file is found in the package root, or if a dependency is marked as `catalog:` but no catalog exists.
43
+ */
44
+ declare function upgradeCatalogPackage(packageName: string, options?: UpgradeCatalogPackageOptions): Promise<void>;
45
+
46
+ export { type UpgradeCatalogPackageOptions, getCatalog, setCatalog, upgradeCatalogPackage };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Retrieve the pnpm catalog from the workspace's `pnpm-workspace.yaml` file.
3
+ *
4
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(process.cwd())`.
5
+ * @returns A promise that resolves to the catalog object if found, or undefined if no catalog exists or the `pnpm-workspace.yaml` file is not found.
6
+ * @throws Will throw an error if the `pnpm-workspace.yaml` file is found but cannot be read.
7
+ */
8
+ declare function getCatalog(workspaceRoot?: string): Promise<Record<string, string> | undefined>;
9
+ /**
10
+ * Set the pnpm catalog in the workspace's `pnpm-workspace.yaml` file.
11
+ *
12
+ * @param catalog - The catalog object to set in the `pnpm-workspace.yaml` file.
13
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(process.cwd())`.
14
+ */
15
+ declare function setCatalog(catalog: Record<string, string>, workspaceRoot?: string): Promise<void>;
16
+ interface UpgradeCatalogPackageOptions {
17
+ /**
18
+ * The npm tag to use when fetching the latest version of the package.
19
+ *
20
+ * @defaultValue `"latest"`
21
+ */
22
+ tag?: string;
23
+ /**
24
+ * The root directory of the workspace.
25
+ *
26
+ * @defaultValue The value returned by `findWorkspaceRoot(process.cwd())`
27
+ */
28
+ workspaceRoot?: string;
29
+ /**
30
+ * An indicator of whether to throw an error if the package is not found in the catalog.
31
+ *
32
+ * @defaultValue `false`
33
+ */
34
+ throwIfMissingInCatalog?: boolean;
35
+ }
36
+ /**
37
+ * Update package.json dependencies currently using `catalog:` or `workspace:*` to use the pnpm catalog dependencies actual versions and the local workspace versions respectively.
38
+ *
39
+ * @param packageRoot - The root directory of the package to update. Defaults to the current working directory.
40
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(packageRoot)`.
41
+ * @returns A promise that resolves when the package.json file has been updated.
42
+ * @throws Will throw an error if no package.json file is found in the package root, or if a dependency is marked as `catalog:` but no catalog exists.
43
+ */
44
+ declare function upgradeCatalogPackage(packageName: string, options?: UpgradeCatalogPackageOptions): Promise<void>;
45
+
46
+ export { type UpgradeCatalogPackageOptions, getCatalog, setCatalog, upgradeCatalogPackage };
@@ -0,0 +1 @@
1
+ export{a as getCatalog,b as setCatalog,c as upgradeCatalogPackage}from'../chunk-37NNBVUD.js';import'../chunk-E5PO4ZUE.js';
@@ -0,0 +1 @@
1
+ 'use strict';require('../chunk-QNTSKZUU.cjs');var chunkMIMRANFI_cjs=require('../chunk-MIMRANFI.cjs'),chunkA7CA5CJR_cjs=require('../chunk-A7CA5CJR.cjs'),chunkPTW7Z2XZ_cjs=require('../chunk-PTW7Z2XZ.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkMIMRANFI_cjs.a}});Object.defineProperty(exports,"getCatalog",{enumerable:true,get:function(){return chunkA7CA5CJR_cjs.a}});Object.defineProperty(exports,"setCatalog",{enumerable:true,get:function(){return chunkA7CA5CJR_cjs.b}});Object.defineProperty(exports,"upgradeCatalogPackage",{enumerable:true,get:function(){return chunkA7CA5CJR_cjs.c}});Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkPTW7Z2XZ_cjs.c}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkPTW7Z2XZ_cjs.d}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkPTW7Z2XZ_cjs.e}});
@@ -0,0 +1,4 @@
1
+ export { UpgradeCatalogPackageOptions, getCatalog, setCatalog, upgradeCatalogPackage } from './catalog.cjs';
2
+ export { getPnpmWorkspaceFilePath, readPnpmWorkspaceFile, writePnpmWorkspaceFile } from './pnpm-workspace.cjs';
3
+ export { replaceDepsAliases } from './replace-deps-aliases.cjs';
4
+ import '../types.cjs';
@@ -0,0 +1,4 @@
1
+ export { UpgradeCatalogPackageOptions, getCatalog, setCatalog, upgradeCatalogPackage } from './catalog.js';
2
+ export { getPnpmWorkspaceFilePath, readPnpmWorkspaceFile, writePnpmWorkspaceFile } from './pnpm-workspace.js';
3
+ export { replaceDepsAliases } from './replace-deps-aliases.js';
4
+ import '../types.js';
@@ -0,0 +1 @@
1
+ import'../chunk-GV6YH6UO.js';export{a as replaceDepsAliases}from'../chunk-OOW4ISC7.js';export{a as getCatalog,b as setCatalog,c as upgradeCatalogPackage}from'../chunk-37NNBVUD.js';export{c as getPnpmWorkspaceFilePath,d as readPnpmWorkspaceFile,e as writePnpmWorkspaceFile}from'../chunk-E5PO4ZUE.js';
@@ -0,0 +1 @@
1
+ 'use strict';var chunkPTW7Z2XZ_cjs=require('../chunk-PTW7Z2XZ.cjs');Object.defineProperty(exports,"getPnpmWorkspaceFilePath",{enumerable:true,get:function(){return chunkPTW7Z2XZ_cjs.c}});Object.defineProperty(exports,"readPnpmWorkspaceFile",{enumerable:true,get:function(){return chunkPTW7Z2XZ_cjs.d}});Object.defineProperty(exports,"writePnpmWorkspaceFile",{enumerable:true,get:function(){return chunkPTW7Z2XZ_cjs.e}});
@@ -0,0 +1,28 @@
1
+ import { PnpmWorkspaceFile } from '../types.cjs';
2
+
3
+ /**
4
+ * Retrieve the pnpm catalog from the workspace's `pnpm-workspace.yaml` file.
5
+ *
6
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(process.cwd())`.
7
+ * @returns A promise that resolves to the catalog object if found, or undefined if no catalog exists or the `pnpm-workspace.yaml` file is not found.
8
+ * @throws Will throw an error if the `pnpm-workspace.yaml` file is found but cannot be read.
9
+ */
10
+ declare function getPnpmWorkspaceFilePath(workspaceRoot?: string): Promise<string | undefined>;
11
+ /**
12
+ * Retrieve the pnpm catalog from the workspace's `pnpm-workspace.yaml` file.
13
+ *
14
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(process.cwd())`.
15
+ * @returns A promise that resolves to the catalog object if found, or undefined if no catalog exists or the `pnpm-workspace.yaml` file is not found.
16
+ * @throws Will throw an error if the `pnpm-workspace.yaml` file is found but cannot be read.
17
+ */
18
+ declare function readPnpmWorkspaceFile(workspaceRoot?: string): Promise<PnpmWorkspaceFile | undefined>;
19
+ /**
20
+ * Retrieve the pnpm catalog from the workspace's `pnpm-workspace.yaml` file.
21
+ *
22
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(process.cwd())`.
23
+ * @returns A promise that resolves to the catalog object if found, or undefined if no catalog exists or the `pnpm-workspace.yaml` file is not found.
24
+ * @throws Will throw an error if the `pnpm-workspace.yaml` file is found but cannot be read.
25
+ */
26
+ declare function writePnpmWorkspaceFile(pnpmWorkspaceFile: PnpmWorkspaceFile, workspaceRoot?: string): Promise<void>;
27
+
28
+ export { getPnpmWorkspaceFilePath, readPnpmWorkspaceFile, writePnpmWorkspaceFile };
@@ -0,0 +1,28 @@
1
+ import { PnpmWorkspaceFile } from '../types.js';
2
+
3
+ /**
4
+ * Retrieve the pnpm catalog from the workspace's `pnpm-workspace.yaml` file.
5
+ *
6
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(process.cwd())`.
7
+ * @returns A promise that resolves to the catalog object if found, or undefined if no catalog exists or the `pnpm-workspace.yaml` file is not found.
8
+ * @throws Will throw an error if the `pnpm-workspace.yaml` file is found but cannot be read.
9
+ */
10
+ declare function getPnpmWorkspaceFilePath(workspaceRoot?: string): Promise<string | undefined>;
11
+ /**
12
+ * Retrieve the pnpm catalog from the workspace's `pnpm-workspace.yaml` file.
13
+ *
14
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(process.cwd())`.
15
+ * @returns A promise that resolves to the catalog object if found, or undefined if no catalog exists or the `pnpm-workspace.yaml` file is not found.
16
+ * @throws Will throw an error if the `pnpm-workspace.yaml` file is found but cannot be read.
17
+ */
18
+ declare function readPnpmWorkspaceFile(workspaceRoot?: string): Promise<PnpmWorkspaceFile | undefined>;
19
+ /**
20
+ * Retrieve the pnpm catalog from the workspace's `pnpm-workspace.yaml` file.
21
+ *
22
+ * @param workspaceRoot - The root directory of the workspace. Defaults to the result of `findWorkspaceRoot(process.cwd())`.
23
+ * @returns A promise that resolves to the catalog object if found, or undefined if no catalog exists or the `pnpm-workspace.yaml` file is not found.
24
+ * @throws Will throw an error if the `pnpm-workspace.yaml` file is found but cannot be read.
25
+ */
26
+ declare function writePnpmWorkspaceFile(pnpmWorkspaceFile: PnpmWorkspaceFile, workspaceRoot?: string): Promise<void>;
27
+
28
+ export { getPnpmWorkspaceFilePath, readPnpmWorkspaceFile, writePnpmWorkspaceFile };
@@ -0,0 +1 @@
1
+ export{c as getPnpmWorkspaceFilePath,d as readPnpmWorkspaceFile,e as writePnpmWorkspaceFile}from'../chunk-E5PO4ZUE.js';
@@ -0,0 +1 @@
1
+ 'use strict';var chunkMIMRANFI_cjs=require('../chunk-MIMRANFI.cjs');require('../chunk-A7CA5CJR.cjs'),require('../chunk-PTW7Z2XZ.cjs');Object.defineProperty(exports,"replaceDepsAliases",{enumerable:true,get:function(){return chunkMIMRANFI_cjs.a}});