@travetto/manifest 3.0.0-rc.12 → 3.0.0-rc.14
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/bin/context.js +1 -1
- package/package.json +1 -1
- package/src/package.ts +5 -2
package/bin/context.js
CHANGED
package/package.json
CHANGED
package/src/package.ts
CHANGED
|
@@ -91,10 +91,14 @@ export class PackageUtil {
|
|
|
91
91
|
if (forceRead) {
|
|
92
92
|
delete this.#cache[modulePath];
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
const res = this.#cache[modulePath] ??= JSON.parse(readFileSync(
|
|
95
95
|
modulePath.endsWith('.json') ? modulePath : path.resolve(modulePath, 'package.json'),
|
|
96
96
|
'utf8'
|
|
97
97
|
));
|
|
98
|
+
|
|
99
|
+
res.name ??= 'untitled'; // If a package.json (root-only) is missing a name, allows for npx execution
|
|
100
|
+
|
|
101
|
+
return res;
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
/**
|
|
@@ -193,7 +197,6 @@ export class PackageUtil {
|
|
|
193
197
|
.map(([name, { location }]) => ({ sourcePath: location, name }));
|
|
194
198
|
break;
|
|
195
199
|
}
|
|
196
|
-
default: throw new Error(`Unknown package manager: ${ctx.packageManager}`);
|
|
197
200
|
}
|
|
198
201
|
|
|
199
202
|
this.#workspaces[rootPath] = out;
|