-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docz-core): remove installation step in .docz π
- Loading branch information
1 parent
b24fa6e
commit 6790179
Showing
7 changed files
with
35 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 3 additions & 35 deletions
38
core/docz-core/src/bundler/machine/services/install-deps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,4 @@ | ||
import { pipe } from 'lodash/fp' | ||
import spawn from 'cross-spawn' | ||
import chalk from 'chalk' | ||
import sh from 'shelljs' | ||
import ora from 'ora' | ||
|
||
import * as paths from '../../../config/paths' | ||
import { ServerMachineCtx } from '../context' | ||
|
||
const warn: Function = pipe( | ||
chalk.yellow, | ||
console.log | ||
) | ||
|
||
export const installDeps = async ({ firstInstall }: ServerMachineCtx) => { | ||
if (firstInstall) { | ||
warn('\n----------------') | ||
warn(`We need to install some dependencies in order to run your bundler.`) | ||
warn('This just happens the first time you run docz.') | ||
warn('This could take a while !') | ||
warn('----------------\n') | ||
} | ||
|
||
return new Promise(async (resolve, reject) => { | ||
sh.cd(paths.docz) | ||
|
||
const checking = !firstInstall && ora('Checking dependencies...').start() | ||
const result = spawn.sync('yarn', ['--production=false'], { | ||
stdio: 'inherit', | ||
}) | ||
|
||
if (checking) checking.succeed('Dependencies checked!') | ||
if (result.error) return reject(result.error) | ||
return resolve() | ||
}) | ||
export const installDeps = async () => { | ||
// No need to install dependencies | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters