1.13.0 • Published 4 years ago

jmd-scripts v1.13.0

Weekly downloads
21
License
MIT
Repository
github
Last release
4 years ago

Build Status Code Coverage version downloads MIT License All Contributors PRs Welcome Code of Conduct

The problem

I want to make it easier to maintain my projects.

This solution

This is a CLI that abstracts away all configuration for my open source projects for linting, testing, building, and more.

Table of Contents

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:

npm install --save-dev jmd-scripts

Usage

This is a CLI and exposes a bin called jmd-scripts. I don't really plan on documenting or testing it super duper well because it's really specific to my needs. You'll find all available scripts in src/scripts.

This project actually dogfoods itself. If you look in the package.json, you'll find scripts with node src {scriptName}. This serves as an example of some of the things you can do with jmd-scripts.

Overriding Config

Unlike react-scripts, jmd-scripts allows you to specify your own configuration for things and have that plug directly into the way things work with jmd-scripts. There are various ways that it works, but basically if you want to have your own config for something, just add the configuration and jmd-scripts will use that instead of it's own internal config. In addition, jmd-scripts exposes its configuration so you can use it and override only the parts of the config you need to.

This can be a very helpful way to make editor integration work for tools like ESLint which require project-based ESLint configuration to be present to work.

So, if we were to do this for ESLint, you could create an .eslintrc with the contents of:

{"extends": "./node_modules/jmd-scripts/eslint.js"}

Note: for now, you'll have to include an .eslintignore in your project until this eslint issue is resolved.

Or, for babel, a .babelrc with:

{"presets": ["jmd-scripts/babel"]}

Or, for jest:

const { jest: jestConfig } = require('jmd-scripts/config')
module.exports = Object.assign(jestConfig, {
  // your overrides here

  // for test written in Typescript, add:
  transform: {
    '\\.(ts|tsx)$': '<rootDir>/node_modules/ts-jest/preprocessor.js',
  },
})

Note: jmd-scripts intentionally does not merge things for you when you start configuring things to make it less magical and more straightforward. Extending can take place on your terms. I think this is actually a great way to do this.

TypeScript Support

If the tsconfig.json-file is present in the project root directory and typescript is a dependency the @babel/preset-typescript will automatically get loaded when you use the default babel config that comes with jmd-scripts. If you customized your .babelrc-file you might need to manually add @babel/preset-typescript to the presets-section.

jmd-scripts will automatically load any .ts and .tsx files, including the default entry point, so you don't have to worry about any rollup configuration.

If you have a typecheck script (normally set to jmd-scripts typecheck) that will be run as part of the validate script (which is run as part of the pre-commit script as well).

TypeScript definition files will also automatically be generated during the build script.

Inspiration

This is inspired by react-scripts and heavily borrows code from kcd-scripts.

Other Solutions

I'm not aware of any, if you are please make a pull request and add it here! Again, this is a very specific-to-me solution.

Issues

Looking to contribute? Look for the Good First Issue label.

🐛 Bugs

Please file an issue for bugs, missing documentation, or unexpected behavior.

See Bugs

💡 Feature Requests

Please file an issue to suggest new features. Vote on feature requests by adding a 👍. This helps maintainers prioritize what to work on.

See Feature Requests

Contributors ✨

Thanks goes to these people (emoji key):

Jeff Detmer💻 📖 🚇

This project follows the all-contributors specification. Contributions of any kind welcome!

LICENSE

MIT

1.13.0

4 years ago

1.12.5

6 years ago

1.12.4

6 years ago

1.12.3

6 years ago

1.12.2

6 years ago

1.12.1

6 years ago

1.12.0

6 years ago

1.11.0

6 years ago

1.10.0

6 years ago

1.9.5

6 years ago

1.9.4

6 years ago

1.9.3

6 years ago

1.9.2

6 years ago

1.9.1

6 years ago

1.9.0

6 years ago

1.8.0

6 years ago

1.5.78

7 years ago

1.5.77

7 years ago

1.5.76

7 years ago

1.5.75

7 years ago

1.5.74

7 years ago

1.5.73

7 years ago

1.5.72

7 years ago

1.5.71

7 years ago

1.5.70

7 years ago

1.5.69

7 years ago

1.5.68

7 years ago

1.5.67

7 years ago

1.5.66

7 years ago

1.5.65

7 years ago

1.5.64

7 years ago

1.5.63

7 years ago

1.5.62

7 years ago

1.5.61

7 years ago

1.5.60

7 years ago

1.5.59

7 years ago

1.5.58

7 years ago

1.5.57

7 years ago

1.5.56

7 years ago

1.5.55

7 years ago

1.5.54

7 years ago

1.5.53

7 years ago

1.5.52

7 years ago

1.5.51

7 years ago

1.5.50

7 years ago

1.5.49

7 years ago

1.5.48

7 years ago

1.5.47

7 years ago

1.5.46

7 years ago

1.5.45

7 years ago

1.5.44

7 years ago

1.5.43

7 years ago

1.5.42

7 years ago

1.5.41

7 years ago

1.5.40

7 years ago

1.5.39

7 years ago

1.5.38

7 years ago

1.5.37

7 years ago

1.5.36

7 years ago

1.5.35

7 years ago

1.5.34

7 years ago

1.5.33

7 years ago

1.5.32

7 years ago

1.5.31

7 years ago

1.5.30

7 years ago

1.5.29

7 years ago

1.5.28

7 years ago

1.5.27

7 years ago

1.5.26

7 years ago

1.5.25

7 years ago

1.5.24

7 years ago

1.5.23

7 years ago

1.5.22

7 years ago

1.5.21

7 years ago

1.5.20

7 years ago

1.5.19

7 years ago

1.5.18

7 years ago

1.5.17

7 years ago

1.5.16

7 years ago

1.5.15

7 years ago

1.5.14

7 years ago

1.5.13

7 years ago

1.5.12

7 years ago

1.5.11

7 years ago

1.5.10

7 years ago

1.5.9

7 years ago

1.5.8

7 years ago

1.5.7

7 years ago

1.5.6

7 years ago

1.5.5

7 years ago

1.5.4

7 years ago

1.5.3

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.29

7 years ago

1.4.28

7 years ago

1.4.27

7 years ago

1.4.26

7 years ago

1.4.25

7 years ago

1.4.24

7 years ago

1.4.23

7 years ago

1.4.22

7 years ago

1.4.21

7 years ago

1.4.20

7 years ago

1.4.19

7 years ago

1.4.18

7 years ago

1.4.17

7 years ago

1.4.16

7 years ago

1.4.15

7 years ago

1.4.14

7 years ago

1.4.13

7 years ago

1.4.12

7 years ago

1.4.11

7 years ago

1.4.10

7 years ago

1.4.9

7 years ago

1.4.8

7 years ago

1.4.7

7 years ago

1.4.6

7 years ago

1.4.5

7 years ago

1.4.4

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.18

7 years ago

1.2.17

7 years ago

1.2.16

7 years ago

1.2.15

7 years ago

1.2.14

7 years ago

1.2.13

7 years ago

1.2.12

7 years ago

1.2.11

7 years ago

1.2.10

7 years ago

1.2.9

7 years ago

1.2.8

7 years ago

1.2.7

7 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago