@travetto/manifest 7.1.0 → 7.1.1
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/package.json +1 -1
- package/src/context.ts +4 -5
package/package.json
CHANGED
package/src/context.ts
CHANGED
|
@@ -46,6 +46,10 @@ function findPackage(base: string, pred: (_p?: Pkg) => boolean): Pkg {
|
|
|
46
46
|
*/
|
|
47
47
|
export function getManifestContext(root: string = process.cwd()): ManifestContext {
|
|
48
48
|
const workspace = findPackage(root, pkg => !!pkg?.workspaces || !!pkg?.travetto?.build?.isolated);
|
|
49
|
+
if (workspace.type !== 'module') {
|
|
50
|
+
throw new Error('Only ESM modules are supported, package.json must be of type module');
|
|
51
|
+
}
|
|
52
|
+
|
|
49
53
|
const build = workspace.travetto?.build ?? {};
|
|
50
54
|
const resolve = createRequire(path.resolve(workspace.path, 'node_modules')).resolve.bind(null);
|
|
51
55
|
const wsPrefix = `${workspace.path}/`;
|
|
@@ -54,11 +58,6 @@ export function getManifestContext(root: string = process.cwd()): ManifestContex
|
|
|
54
58
|
readPackage(resolve(`${moduleName}/package.json`)) :
|
|
55
59
|
findPackage(root, pkg => !!pkg) ?? workspace;
|
|
56
60
|
|
|
57
|
-
if (workspace.type !== 'module') {
|
|
58
|
-
console.error('ERROR: Only ESM modules are supported, package.json must be of type module');
|
|
59
|
-
process.exit(1);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
61
|
return {
|
|
63
62
|
workspace: {
|
|
64
63
|
name: workspace.name ?? 'untitled',
|