Skip to content

Commit daceca7

Browse files
committed
fix(cubejs-cli): use process.cwd() in typegen to resolve current project's node_modules/
This also allows running the `typegen` command through `npx`.
1 parent 8369ce5 commit daceca7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/cubejs-cli/src/command/typegen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ const generateQueryTypes = async (apiUrl, { token }) => {
8080
}
8181

8282
const typeDefs = createTypeDefinitions(meta.cubes);
83-
const pathToCubeDX = require.resolve('@cubejs-client/dx');
83+
const pathToCubeDX = require.resolve('@cubejs-client/dx', {
84+
paths: [process.cwd()],
85+
});
8486
const pathToDefinitionFile = pathToCubeDX.replace('/src/index.js', '/generated.d.ts');
8587

8688
try {

0 commit comments

Comments
 (0)