@solid-soda/scripts
Advanced tools
@@ -1,2 +0,2 @@ | ||
| const { install, json } = require('mrm-core'); | ||
| const { install, json, packageJson } = require('mrm-core'); | ||
@@ -6,17 +6,17 @@ const overwrite = require('../utils/overwrite') | ||
| const withVersions = require('../utils/withVersions') | ||
| const generateExecuteScript = require('../utils/generateExecuteScript') | ||
| function task() { | ||
| clearConfigs({ | ||
| files: ['commitlint.config.js', '.commitlintrc.js', '.commitlintrc.json', '.commitlintrc.yml'], | ||
| files: ['.commitlintrc', 'commitlint.config.js', '.commitlintrc.js', '.commitlintrc.json', '.commitlintrc.yml'], | ||
| packageJsonPath: 'commitlint', | ||
| }) | ||
| // dependencies | ||
| install(...withVersions(['@commitlint/cli', '@commitlint/config-conventional'])); | ||
| install(...withVersions(['@commitlint/cli', '@commitlint/config-conventional', '@commitlint/prompt-cli'])); | ||
| // config | ||
| overwrite(json, '.commitlintrc') | ||
| .merge({ | ||
| packageJson() | ||
| .set('commitlint', { | ||
| extends: ['@commitlint/config-conventional'] | ||
| }) | ||
| .setScript('commit', generateExecuteScript('commit')) | ||
| .save() | ||
@@ -23,0 +23,0 @@ } |
+1
-1
| { | ||
| "aliases": { | ||
| "all": ["migrate", "prettier", "commitlint", "commitizen", "husky", "eslint", "stylelint", "standard-version"] | ||
| "all": ["migrate", "prettier", "commitlint", "husky", "eslint", "stylelint", "standard-version"] | ||
| } | ||
| } |
+4
-1
@@ -16,3 +16,3 @@ const { install, packageJson, json } = require('mrm-core'); | ||
| clearConfigs({ | ||
| files: ['lint-staged.config.js'], | ||
| files: ['lint-staged.config.js', '.lintstagedrc'], | ||
| packageJsonPath: 'lint-staged' | ||
@@ -32,2 +32,5 @@ }) | ||
| packageJson() | ||
| .set('lint-staged', { | ||
| [`*.${createExtString(EXTS)}`]: [generateExecuteScript('prettier --write')] | ||
| }) | ||
| .set('husky.hooks', | ||
@@ -34,0 +37,0 @@ { |
+1
-1
| { | ||
| "name": "@solid-soda/scripts", | ||
| "version": "2.0.0-beta.10", | ||
| "version": "2.0.0-beta.11", | ||
| "author": "Igor Kamyshev <igor@kamyshev.me>", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+5
-11
@@ -11,14 +11,6 @@ const { json, install, packageJson, lines } = require('mrm-core'); | ||
| clearConfigs({ | ||
| files: ['.prettierrc.json', '.prettierrc.yml', '.prettierrc.yaml', '.prettierrc.js', 'prettier.config.js', '.prettierrc.toml'], | ||
| files: ['.prettierrc', '.prettierrc.json', '.prettierrc.yml', '.prettierrc.yaml', '.prettierrc.js', 'prettier.config.js', '.prettierrc.toml'], | ||
| packageJsonPath: 'prettier' | ||
| }) | ||
| // generate config | ||
| overwrite(json, '.prettierrc') | ||
| .set({ | ||
| trailingComma: 'all', | ||
| singleQuote: true, | ||
| }) | ||
| .save() | ||
| overwrite(lines, '.prettierignore') | ||
@@ -28,8 +20,10 @@ .add(getDefaultIgnore()) | ||
| // dependencies | ||
| install(...withVersions(['prettier'])); | ||
| // scripts | ||
| packageJson() | ||
| .setScript('pretty', generateExecuteScript('prettier --write .')) | ||
| .set('prettier', { | ||
| trailingComma: 'all', | ||
| singleQuote: true, | ||
| }) | ||
| .save() | ||
@@ -36,0 +30,0 @@ } |
+4
-4
@@ -26,3 +26,3 @@ # @solid-soda/scripts | ||
| 1. Before start to code we must set-up ESLint, Stylelint, Prettier, Commitizen, etc. We can to automate all of this. Machines have to suffer. | ||
| 1. Before start to code we must set-up ESLint, Stylelint, Prettier, Commitlint, etc. We can to automate all of this. Machines have to suffer. | ||
| 2. New lint rule adding is a hell. We provide the one source of true for any project. Just run `@solid-soda/scripts` in your project directory. | ||
@@ -47,3 +47,3 @@ | ||
| Some scripts will be added to your `package.json`: | ||
| + `commit` — runs Commitizen and allow create nice commit messages | ||
| + `commit` — runs Commitlint Prompt CLI and allow create nice commit messages | ||
| + `pretty` — runs Prettier and format all code in the repo | ||
@@ -53,3 +53,3 @@ + `lint:code` — runs ESLint and preform static analysis of code | ||
| If you have some styles in the repo, we will add extra script: | ||
| + `lint:styles` — runs Styleslint and preform static analysis of styles | ||
| + `lint:styles` — runs Stylelint and preform static analysis of styles | ||
@@ -72,2 +72,2 @@ If you want to release repo by git-tags, we will add ont more script: | ||
| This project based on [mrm](https://github.com/sapegin/mrm) and setup configs for [Commitizen](http://commitizen.github.io/cz-cli/), [Commitlint](https://commitlint.js.org/#/), [ESLint](https://eslint.org), [Husky](https://github.com/typicode/husky), [lint-staged](https://github.com/okonet/lint-staged), [Prettier](https://prettier.io), [Stylelint](https://stylelint.io). | ||
| This project based on [mrm](https://github.com/sapegin/mrm) and setup configs for [Commitlint](https://commitlint.js.org/#/), [ESLint](https://eslint.org), [Husky](https://github.com/typicode/husky), [lint-staged](https://github.com/okonet/lint-staged), [Prettier](https://prettier.io), [Stylelint](https://stylelint.io). |
| const { pick } = require('lodash') | ||
| const PACKAGE_VERSIONS = { | ||
| 'commitizen': '^4.0.4', | ||
| 'cz-conventional-changelog': '^3.1.0', | ||
| '@commitlint/cli': '^8.3.5', | ||
| '@commitlint/config-conventional': '^8.3.4', | ||
| '@commitlint/prompt-cli': '^8.3.5', | ||
| 'eslint': '^6.8.0', | ||
@@ -9,0 +8,0 @@ 'eslint-plugin-import-helpers': '^1.0.2', |
| const { install, packageJson } = require('mrm-core'); | ||
| const generateExecuteScript = require('../utils/generateExecuteScripts') | ||
| const withVersions = require('../utils/withVersions') | ||
| function task() { | ||
| // dependencies | ||
| install(...withVersions(['commitizen', 'cz-conventional-changelog'])); | ||
| // config | ||
| packageJson() | ||
| .merge({ | ||
| config: { | ||
| commitizen: { | ||
| path: "cz-conventional-changelog" | ||
| } | ||
| } | ||
| }) | ||
| .setScript('commit', generateExecuteScript('git-cz')) | ||
| .save() | ||
| } | ||
| task.description = 'Sync Commitizen config'; | ||
| module.exports = task |
46506
-1.08%25
-3.85%631
-3.52%