@plasmicapp/cli 0.1.334 → 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 +21 -12
- package/dist/lib.js +21 -12
- package/package.json +2 -2
- package/src/utils/file-utils.ts +24 -13
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
|
-
|
|
501475
|
-
|
|
501476
|
-
|
|
501477
|
-
|
|
501478
|
-
|
|
501479
|
-
|
|
501480
|
-
|
|
501481
|
-
|
|
501482
|
-
|
|
501483
|
-
|
|
501484
|
-
|
|
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;
|
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
|
-
|
|
496817
|
-
|
|
496818
|
-
|
|
496819
|
-
|
|
496820
|
-
|
|
496821
|
-
|
|
496822
|
-
|
|
496823
|
-
|
|
496824
|
-
|
|
496825
|
-
|
|
496826
|
-
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/cli",
|
|
3
|
-
"version": "0.1.
|
|
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": "
|
|
86
|
+
"gitHead": "eae6a42f2cfbb2d03d1a66cfbf8fbee5595ae25c"
|
|
87
87
|
}
|
package/src/utils/file-utils.ts
CHANGED
|
@@ -264,20 +264,31 @@ export function findFile(
|
|
|
264
264
|
traverseParents?: boolean;
|
|
265
265
|
}
|
|
266
266
|
): string | undefined {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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 = {
|