@plasmicapp/cli 0.1.333 → 0.1.335

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/index.js CHANGED
@@ -501471,19 +501471,28 @@ function findSrcDirPath(absoluteSrcDir, expectedPath, baseNameToFiles) {
501471
501471
  }
501472
501472
  }
501473
501473
  function findFile(dir, pred, opts) {
501474
- const files = import_fs.default.readdirSync(dir);
501475
- const found = files.find((f) => pred(f));
501476
- if (found) {
501477
- return import_upath3.default.join(dir, found);
501478
- }
501479
- if (!opts.traverseParents) {
501480
- return void 0;
501481
- }
501482
- const parent = import_upath3.default.dirname(dir);
501483
- if (parent === dir) {
501484
- return void 0;
501474
+ try {
501475
+ const files = import_fs.default.readdirSync(dir);
501476
+ const found = files.find((f) => pred(f));
501477
+ if (found) {
501478
+ return import_upath3.default.join(dir, found);
501479
+ }
501480
+ if (!opts.traverseParents) {
501481
+ return void 0;
501482
+ }
501483
+ const parent = import_upath3.default.dirname(dir);
501484
+ if (parent === dir) {
501485
+ return void 0;
501486
+ }
501487
+ return findFile(import_upath3.default.dirname(dir), pred, opts);
501488
+ } catch (err) {
501489
+ if (err instanceof Error && "code" in err && err.code === "EACCES") {
501490
+ logger.warn(err);
501491
+ return void 0;
501492
+ } else {
501493
+ throw err;
501494
+ }
501485
501495
  }
501486
- return findFile(import_upath3.default.dirname(dir), pred, opts);
501487
501496
  }
501488
501497
  function getAllPaths(context) {
501489
501498
  const config = context.config;
@@ -501822,9 +501831,9 @@ function installCommand(config, pkg, baseDir, opts = {}) {
501822
501831
  if (opts.global) {
501823
501832
  return `npm install -g ${pkg}`;
501824
501833
  } else if (opts.dev) {
501825
- return `npm install --save-dev --legacy-peer-deps --ignore-scripts ${pkg}`;
501834
+ return `npm install --save-dev --ignore-scripts ${pkg}`;
501826
501835
  } else {
501827
- return `npm install --legacy-peer-deps --ignore-scripts ${pkg}`;
501836
+ return `npm install --ignore-scripts ${pkg}`;
501828
501837
  }
501829
501838
  }
501830
501839
  }
package/dist/lib.js CHANGED
@@ -496813,19 +496813,28 @@ function findSrcDirPath(absoluteSrcDir, expectedPath, baseNameToFiles) {
496813
496813
  }
496814
496814
  }
496815
496815
  function findFile(dir, pred, opts) {
496816
- const files = import_fs.default.readdirSync(dir);
496817
- const found = files.find((f) => pred(f));
496818
- if (found) {
496819
- return import_upath3.default.join(dir, found);
496820
- }
496821
- if (!opts.traverseParents) {
496822
- return void 0;
496823
- }
496824
- const parent = import_upath3.default.dirname(dir);
496825
- if (parent === dir) {
496826
- return void 0;
496816
+ try {
496817
+ const files = import_fs.default.readdirSync(dir);
496818
+ const found = files.find((f) => pred(f));
496819
+ if (found) {
496820
+ return import_upath3.default.join(dir, found);
496821
+ }
496822
+ if (!opts.traverseParents) {
496823
+ return void 0;
496824
+ }
496825
+ const parent = import_upath3.default.dirname(dir);
496826
+ if (parent === dir) {
496827
+ return void 0;
496828
+ }
496829
+ return findFile(import_upath3.default.dirname(dir), pred, opts);
496830
+ } catch (err) {
496831
+ if (err instanceof Error && "code" in err && err.code === "EACCES") {
496832
+ logger.warn(err);
496833
+ return void 0;
496834
+ } else {
496835
+ throw err;
496836
+ }
496827
496837
  }
496828
- return findFile(import_upath3.default.dirname(dir), pred, opts);
496829
496838
  }
496830
496839
  function getAllPaths(context) {
496831
496840
  const config = context.config;
@@ -497164,9 +497173,9 @@ function installCommand(config, pkg, baseDir, opts = {}) {
497164
497173
  if (opts.global) {
497165
497174
  return `npm install -g ${pkg}`;
497166
497175
  } else if (opts.dev) {
497167
- return `npm install --save-dev --legacy-peer-deps --ignore-scripts ${pkg}`;
497176
+ return `npm install --save-dev --ignore-scripts ${pkg}`;
497168
497177
  } else {
497169
- return `npm install --legacy-peer-deps --ignore-scripts ${pkg}`;
497178
+ return `npm install --ignore-scripts ${pkg}`;
497170
497179
  }
497171
497180
  }
497172
497181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/cli",
3
- "version": "0.1.333",
3
+ "version": "0.1.335",
4
4
  "description": "plasmic cli for syncing local code with Plasmic designs",
5
5
  "engines": {
6
6
  "node": ">=12"
@@ -83,5 +83,5 @@
83
83
  "wrap-ansi": "^7.0.0",
84
84
  "yargs": "^15.4.1"
85
85
  },
86
- "gitHead": "34858a3c20d90574a7e28ddf1813b7ad5a93aaa4"
86
+ "gitHead": "eae6a42f2cfbb2d03d1a66cfbf8fbee5595ae25c"
87
87
  }
@@ -264,20 +264,31 @@ export function findFile(
264
264
  traverseParents?: boolean;
265
265
  }
266
266
  ): string | undefined {
267
- const files = fs.readdirSync(dir);
268
- const found = files.find((f) => pred(f));
269
- if (found) {
270
- return path.join(dir, found);
271
- }
272
- if (!opts.traverseParents) {
273
- return undefined;
274
- }
275
- const parent = path.dirname(dir);
276
- if (parent === dir) {
277
- // We've hit the root dir already
278
- return undefined;
267
+ try {
268
+ const files = fs.readdirSync(dir);
269
+ const found = files.find((f) => pred(f));
270
+ if (found) {
271
+ return path.join(dir, found);
272
+ }
273
+ if (!opts.traverseParents) {
274
+ return undefined;
275
+ }
276
+ const parent = path.dirname(dir);
277
+ if (parent === dir) {
278
+ // We've hit the root dir already
279
+ return undefined;
280
+ }
281
+ return findFile(path.dirname(dir), pred, opts);
282
+ } catch (err) {
283
+ if (err instanceof Error && "code" in err && err.code === "EACCES") {
284
+ // If the user is lacking file system permissions,
285
+ // show the error and assume the file is missing.
286
+ logger.warn(err);
287
+ return undefined;
288
+ } else {
289
+ throw err;
290
+ }
279
291
  }
280
- return findFile(path.dirname(dir), pred, opts);
281
292
  }
282
293
 
283
294
  type BundleKeyPair = {
@@ -194,9 +194,9 @@ export function installCommand(
194
194
  if (opts.global) {
195
195
  return `npm install -g ${pkg}`;
196
196
  } else if (opts.dev) {
197
- return `npm install --save-dev --legacy-peer-deps --ignore-scripts ${pkg}`;
197
+ return `npm install --save-dev --ignore-scripts ${pkg}`;
198
198
  } else {
199
- return `npm install --legacy-peer-deps --ignore-scripts ${pkg}`;
199
+ return `npm install --ignore-scripts ${pkg}`;
200
200
  }
201
201
  }
202
202
  }