Skip to content

Commit

Permalink
refactor: remove changelog command and rethink presets
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `changelog` is no longer a valid command and `@siroc/jest-preset` and `@siroc/eslint-config`  must be installed separately
  • Loading branch information
danielroe committed Jul 27, 2020
1 parent 13338cd commit 9fd5e8a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 276 deletions.
68 changes: 41 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

- 💯 **Zero-config required**: Intelligent support for your package
- Supports running and compiling TypeScript and the latest JavaScript syntax
- Autoconfigured `jest` and `eslint`
- Autoconfigured `jest` and `eslint` with optional presets
- ⚒️ **Extensible**: Write your own commands and build hooks
- 💪 **Typescript**: Fully typed and self-documenting

Expand Down Expand Up @@ -120,32 +120,6 @@ If you're working in a monorepo, it can be helpful to have accurate and up-to-da

Running `siroc dev` will replace your package entrypoints with stubs that point to your source files. Your binaries will run your source files directly using `jiti`.

### `siroc eslint`

Rather than configure `eslint`, you can run it directly using `siroc eslint`, with support for TypeScript (and prettier, if you have it installed within your package dev dependencies).

If you would like to extend or modify the siroc base config you can do so with the following `.eslintrc.js`

```js
module.exports = {
extends: ['@siroc'],
// Your rules/plugins here
}
```

### `siroc jest`

Rather than configure `jest`, you can run it directly using `siroc jest`, with support for TypeScript test and source files. By default it will include any settings from a local `jest.config.js`.

If you would like to extend or modify the siroc base config (for example, to run jest directly with `yarn jest`) you can do so with the following `jest.config.js`

```js
module.exports = {
preset: '@siroc/jest-preset',
// Your customisations here
}
```

### `siroc run`

You can run arbitrary shell commands or node scripts using the power of [the `jiti` runtime](https://github.com/nuxt-contrib/jiti).
Expand All @@ -160,6 +134,46 @@ yarn siroc run myfile.ts
yarn siroc run ls --workspaces
```

## Presets

### eslint

Rather than configure `eslint`, you can extend `@siroc/eslint-config`, with zero-config support for TypeScript (and prettier, if you have it installed within your package dev dependencies).

1. Add the eslint config:

```bash
yarn add --dev @siroc/eslint-config
```

2. Add the following `.eslintrc.js` to your project:

```js
module.exports = {
extends: ['@siroc'],
// Your rules/plugins here
}
```

### jest

Rather than configure `jest`, you can extend `@siroc/jest-preset`, with zero-config support for TypeScript test and source files. By default it will also include any settings from a local `jest.config.js` (e.g. in a package directory).

1. Add the jest preset:

```bash
yarn add --dev @siroc/jest-preset
```

2. Add the following `jest.config.js` to your project:

```js
module.exports = {
preset: '@siroc/jest-preset',
// Your customisations here
}
```

## Contributors

Contributions are very welcome.
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
},
"dependencies": {
"@siroc/core": "0.2.0",
"@siroc/eslint-config": "0.2.0",
"@siroc/jest-preset": "0.2.0",
"cac": "^6.6.1",
"chalk": "^4.1.0",
"consola": "^2.14.0",
Expand Down
9 changes: 0 additions & 9 deletions packages/cli/src/commands/changelog.ts

This file was deleted.

72 changes: 0 additions & 72 deletions packages/cli/src/commands/testing.ts

This file was deleted.

20 changes: 0 additions & 20 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import consola from 'consola'
import { version } from '../package.json'

import { build, BuildCommandOptions } from './commands/build'
import { changelog } from './commands/changelog'
import { dev, DevCommandOptions } from './commands/dev'
import { run as runFile } from './commands/run'
import { test } from './commands/testing'

import { time, timeEnd, RemoveFirst } from './utils'

Expand Down Expand Up @@ -68,10 +66,6 @@ cli
run('building', build, { ...options, packages })
)

cli
.command('changelog', 'Generate changelog')
.action(() => run('changelog', changelog))

cli
.command('dev [...packages]', 'Generate package stubs for quick development')
.example(bin => ` ${bin} dev`)
Expand All @@ -91,20 +85,6 @@ cli
run('running', runFile, { file, args, options })
)

cli
.command('jest [...packages]', 'Run jest ')
.example(bin => ` ${bin} jest`)
.example(bin => ` ${bin} jest @siroc/cli`)
.action(packages => run('starting jest', test, { packages, command: 'jest' }))

cli
.command('eslint [...packages]', 'Run eslint ')
.example(bin => ` ${bin} eslint`)
.example(bin => ` ${bin} eslint @siroc/cli`)
.action(packages =>
run('starting eslint', test, { packages, command: 'eslint' })
)

Object.entries(rootPackage.options.commands).forEach(([command, action]) => {
cli
.command(`${command}`, `Custom command (${bold(rootPackage.pkg.name)})`)
Expand Down
146 changes: 0 additions & 146 deletions packages/core/src/version/changelog.ts

This file was deleted.

0 comments on commit 9fd5e8a

Please sign in to comment.