This repository has been archived by the owner on Dec 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #530 from form8ion/alpha
- Loading branch information
Showing
19 changed files
with
141 additions
and
157 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit $1 |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm test |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,37 @@ | ||
import {info, warn} from '@travi/cli-messages'; | ||
import {info} from '@travi/cli-messages'; | ||
import deepmerge from 'deepmerge'; | ||
import {lift as liftHusky} from '@form8ion/husky'; | ||
import {lift as liftEslint} from '@form8ion/eslint'; | ||
import liftPackage from './package'; | ||
import liftEslint from './eslint'; | ||
import resolvePackageManager from './package-manager'; | ||
|
||
function configIsProvidedForEslint(configs) { | ||
return configs && configs.eslint; | ||
} | ||
|
||
export default async function ({ | ||
projectRoot, | ||
configs, | ||
results: {scripts, tags, eslintConfigs, dependencies, devDependencies, packageManager: manager} | ||
}) { | ||
info('Lifting JavaScript-specific details'); | ||
|
||
const packageManager = await resolvePackageManager({projectRoot, packageManager: manager}); | ||
const huskyResults = await liftHusky({projectRoot, packageManager}); | ||
|
||
if (configIsProvidedForEslint(configs)) { | ||
const { | ||
nextSteps, | ||
devDependencies: eslintDevDependencies | ||
} = await liftEslint({configs: eslintConfigs, scope: configs.eslint.scope, projectRoot}); | ||
|
||
await liftPackage( | ||
deepmerge( | ||
{ | ||
projectRoot, | ||
scripts, | ||
tags, | ||
dependencies, | ||
devDependencies, | ||
packageManager, | ||
eslintDevDependencies | ||
}, | ||
huskyResults | ||
) | ||
); | ||
|
||
return {nextSteps}; | ||
} | ||
|
||
if (eslintConfigs) warn('Config for ESLint not provided. Skipping ESLint configuration'); | ||
const { | ||
nextSteps, | ||
devDependencies: eslintDevDependencies | ||
} = await liftEslint({projectRoot, configs: eslintConfigs}); | ||
|
||
await liftPackage( | ||
deepmerge( | ||
{projectRoot, scripts, tags, dependencies, devDependencies, packageManager}, | ||
{ | ||
projectRoot, | ||
scripts, | ||
tags, | ||
dependencies, | ||
devDependencies, | ||
packageManager, | ||
eslintDevDependencies | ||
}, | ||
huskyResults | ||
) | ||
); | ||
|
||
return {}; | ||
return {nextSteps}; | ||
} |
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
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
Oops, something went wrong.