Skip to content

Commit

Permalink
Fix offline schema, fix dep-graph for npm packaging (#117)
Browse files Browse the repository at this point in the history
* fix: hotfix schema as number

* fix(nx-serverless): install deps for npm dependency graph

Need to run `npm install` when using npm packager in order for dependency graph to work properly

* cleanup(nx-serverless): run formatting
  • Loading branch information
tstackhouse committed Dec 23, 2021
1 parent ea552df commit 2052b7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/nx-serverless/src/builders/offline/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"port": {
"type": "number",
"default": "7777",
"default": 7777,
"description": "The port to inspect the process on. Setting port to 0 will assign random free ports to all forked processes."
},
"runtimeArgs": {
Expand Down
7 changes: 7 additions & 0 deletions libs/nx-serverless/src/utils/packagers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ export function preparePackageJson(
join(options.package, packagerInstance.lockfileName),
result.stdout.toString()
);
} else if (packagerInstance === NPM) {
// need to install deps for dep-graph to work
const result = packagerInstance.install(dirname(packageJsonPath));
if (result.error) {
logger.error('ERROR: generating lock file!');
return of({ success: false, error: result.error.toString() });
}
}
// Get the packagelist with dependency graph and depth=2 level
// review: Change depth to options?
Expand Down

0 comments on commit 2052b7b

Please sign in to comment.