Skip to content

Commit da3e7af

Browse files
committed
0.25.1 - debug logging for resolving package root directories
1 parent 4cf3496 commit da3e7af

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@schemavaults/theme",
33
"description": "TailwindCSS theme shared by different SchemaVaults applications",
4-
"version": "0.25.0",
4+
"version": "0.25.1",
55
"private": false,
66
"license": "UNLICENSED",
77
"repository": {

src/TailwindConfigFactory.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,25 +235,27 @@ export class SchemaVaultsTailwindConfigFactory
235235

236236
if (!existsSync(current_path)) {
237237
throw new Error(
238-
`Error resolving package root directory for '@${scope}/${package_name}'`,
238+
`Error resolving package root directory for '@${scope}/${package_name}'! Path '${current_path}' does not exist during upwards traversal.`,
239239
);
240240
}
241241

242242
if (this.isdir(current_path)) {
243243
current_path = normalize(join(current_path, ".."));
244+
continue;
244245
} else if (this.isfile(current_path)) {
245246
current_path = dirname(current_path);
247+
continue;
246248
} else {
247249
throw new Error(
248-
"Expected current path to be either a directory or a file!",
250+
`Expected current path '${current_path}' to be either a directory or a file!`,
249251
);
250252
}
251253
}
252254
package_path = current_path;
253255

254-
if (!this.isdir(package_path)) {
256+
if (!existsSync(package_path) || !this.isdir(package_path)) {
255257
throw new Error(
256-
`Expected there to be a directory for package '@${scope}/${package_name}' at path '${package_path}'!`,
258+
`Expected there to be a directory for package '@${scope}/${package_name}' at path '${package_path}'; there's not!`,
257259
);
258260
}
259261
} catch (e: unknown) {

0 commit comments

Comments
 (0)