Skip to content

Commit

Permalink
feat: favour local mode over dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vvagaytsev committed Jun 10, 2022
1 parent 7576519 commit d2a5854
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
6 changes: 4 additions & 2 deletions core/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,11 @@ export class DeployCommand extends Command<Args, Opts> {
}

const modules = Array.from(new Set(services.map((s) => s.module)))
const devModeServiceNames = getMatchingServiceNames(opts["dev-mode"], initGraph)
const hotReloadServiceNames = getHotReloadServiceNames(opts["hot-reload"], initGraph)
const localModeServiceNames = getMatchingServiceNames(opts["local-mode"], initGraph)
const devModeServiceNames = getMatchingServiceNames(opts["dev-mode"], initGraph).filter(
(name) => !localModeServiceNames.includes(name)
)
const hotReloadServiceNames = getHotReloadServiceNames(opts["hot-reload"], initGraph)

let watch = opts.watch

Expand Down
12 changes: 0 additions & 12 deletions core/src/tasks/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,6 @@ export class DeployTask extends BaseTask {
this.validate()
}

validate(): void {
const localModeServiceNames = new Set(this.localModeServiceNames)
const devLocalModeIntersection = new Set(this.devModeServiceNames.filter((name) => localModeServiceNames.has(name)))
if (devLocalModeIntersection.size > 0) {
const devLocalModeConflicts = [...devLocalModeIntersection].join(", ")
throw new ConfigurationError(
`Got conflicting deployment options --dev-mode and --local-mode for services: ${devLocalModeConflicts}.`,
{}
)
}
}

async resolveDependencies() {
const dg = this.graph

Expand Down

0 comments on commit d2a5854

Please sign in to comment.