Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run eslint && npm run test
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14
28 changes: 28 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
extends: ['@commitlint/config-conventional'],

rules: {
'body-case': [0],
'subject-case': [0],
'header-max-length': [0],
'type-enum': [
2,
'always',
[
// Conventional Commit types
'feat',
'feature',
'fix',
'perf',
'revert',
'docs',
'style',
'chore',
'refactor',
'test',
'build',
'ci',
],
],
},
};
3,439 changes: 1,987 additions & 1,452 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 18 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,50 +23,48 @@
"test:update": "src/bin/create-react-styleguide.js script test:update",
"test:watch": "src/bin/create-react-styleguide.js script test:watch",
"prepublishOnly": "src/bin/create-react-styleguide.js script prepublishOnly",
"release": "standard-version"
},
"husky": {
"hooks": {
"pre-commit": "npm run eslint && npm run test"
}
"release": "standard-version",
"prepare": "husky install"
},
"files": [
"lib",
"templates"
],
"engines": {
"node": ">=6.11.5"
"node": ">=14"
},
"dependencies": {
"@babel/cli": "^7.13.10",
"@babel/core": "^7.13.10",
"acorn": "^8.1.0",
"babel-loader": "^8.2.2",
"chalk": "^4.1.0",
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.0",
"acorn": "^8.6.0",
"babel-loader": "^8.2.3",
"chalk": "^4.1.2",
"circular-dependency-plugin": "^5.2.2",
"copy-template-dir": "^1.4.0",
"cross-spawn": "^7.0.3",
"eslint": "^7.22.0",
"inquirer": "^8.0.0",
"jest": "^26.6.3",
"ora": "^5.4.0",
"prettier": "^2.2.1",
"eslint": "^7.32.0",
"inquirer": "^8.2.0",
"jest": "^27.4.3",
"ora": "^5.4.1",
"prettier": "^2.5.0",
"react-styleguidist": "^11.1.6",
"resolve": "^1.20.0",
"resolve-pkg": "^2.0.0",
"rimraf": "^3.0.2",
"run-parallel": "^1.2.0",
"run-series": "^1.1.9",
"webpack": "^4.46.0",
"yargs": "^16.2.0"
"yargs": "^17.3.0"
},
"devDependencies": {
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"babel-preset-zillow": "^4.4.0",
"eslint-plugin-zillow": "^4.0.0",
"husky": "^4.3.8",
"husky": "^7.0.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"standard-version": "^9.1.1",
"standard-version": "^9.3.2",
"tacks": "^1.3.0",
"tempy": "^1.0.1"
},
Expand Down
37 changes: 18 additions & 19 deletions src/bin/create-react-styleguide.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

const yargs = require('yargs');
const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');

const onCommandComplete = code => process.exit(code);

Expand All @@ -10,24 +11,23 @@ const commandHandler = argv => {
};

// eslint-disable-next-line no-unused-expressions
yargs
.wrap(120)
yargs(hideBin(process.argv))
.usage('Usage: create-react-styleguide <command> [options]')
.command({
command: 'new <project-directory>',
desc: 'Create a new project in the given directory',
builder: y => {
.demandCommand(1)
.command(
'new <project-directory>',
'Create a new project in the given directory',
y =>
y.positional('project-directory', {
describe: 'The directory to create',
type: 'string',
});
},
handler: commandHandler,
})
.command({
command: 'script <script>',
desc: 'Run the given create-react-styleguide script',
builder: y => {
}),
argv => commandHandler(argv)
)
.command(
'script <script>',
'Run the given create-react-styleguide script',
y =>
y.positional('script', {
describe: 'The script to run',
choices: [
Expand All @@ -44,10 +44,9 @@ yargs
'test:watch',
'prepublishOnly',
],
});
},
handler: commandHandler,
})
}),
argv => commandHandler(argv)
)
.option('stable', {
desc: 'By default, the latest version of all project dependencies are installed. If that does not work for some reason, you can use this to revert to the last known stable configuration (use this with caution as this can quickly become out-of-date).',
type: 'boolean',
Expand Down