@powerhousedao/registry 6.0.0-dev.79 → 6.0.0-dev.81

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/dist/src/cli.js CHANGED
@@ -157321,6 +157321,7 @@ async function findUp(name, options = {}) {
157321
157321
  // src/run.ts
157322
157322
  var import_verdaccio = __toESM(require_build17(), 1);
157323
157323
  import { mkdir } from "node:fs/promises";
157324
+ import path7 from "node:path";
157324
157325
 
157325
157326
  // src/middleware.ts
157326
157327
  var import_express = __toESM(require_express(), 1);
@@ -160848,6 +160849,17 @@ function buildVerdaccioConfig(config) {
160848
160849
  }
160849
160850
 
160850
160851
  // src/run.ts
160852
+ async function resolveDir(dir) {
160853
+ if (path7.isAbsolute(dir)) {
160854
+ await mkdir(dir, { recursive: true });
160855
+ return dir;
160856
+ }
160857
+ const found = await findUp(dir, { type: "directory" });
160858
+ if (!found) {
160859
+ throw new Error(`Could not find directory "${dir}".`);
160860
+ }
160861
+ return found;
160862
+ }
160851
160863
  async function runRegistry(args) {
160852
160864
  const {
160853
160865
  port,
@@ -160863,18 +160875,8 @@ async function runRegistry(args) {
160863
160875
  s3Region,
160864
160876
  s3SecretAccessKey
160865
160877
  } = args;
160866
- const storagePath = await findUp(storageDir, {
160867
- type: "directory"
160868
- });
160869
- if (!storagePath) {
160870
- throw new Error(`Could not find storage path for dir "${storageDir}".`);
160871
- }
160872
- const cdnCachePath = await findUp(cdnCacheDir, {
160873
- type: "directory"
160874
- });
160875
- if (!cdnCachePath) {
160876
- throw new Error(`Could not find cdn cache path for dir "${cdnCacheDir}".`);
160877
- }
160878
+ const storagePath = await resolveDir(storageDir);
160879
+ const cdnCachePath = await resolveDir(cdnCacheDir);
160878
160880
  console.log({
160879
160881
  storagePath,
160880
160882
  cdnCachePath
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/run.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,YAAY,CAAC;AAGtE,wBAAsB,WAAW,CAAC,IAAI,EAAE,mBAAmB,8HA2F1D"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/run.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,YAAY,CAAC;AAetE,wBAAsB,WAAW,CAAC,IAAI,EAAE,mBAAmB,8HA8E1D"}