@@ -6,22 +6,27 @@ centralized place rather than repeating the same process for each codebase.
6
6
7
7
Inspired by ` react-scripts ` and ` kcd-scripts ` .
8
8
9
+ ## Table of Contents
10
+
11
+ - [ Installation] ( #installation )
12
+ - [ Usage] ( #usage )
13
+
9
14
## Installation
10
15
11
16
` npm install @cdimitroulas/typescript-scripts `
12
17
13
18
## Usage
14
19
15
20
The ` typescript-scripts ` script will be available in ` node_modules/.bin/typescript-scripts ` so
16
- you can either reference it directly by using that path, use ` npx typescript-scripts ` or if you
17
- are using it within ` package.json ` simply write ` typescript-scripts [script name] ` .
21
+ you can either reference it directly by using that path or use ` npx typescript-scripts ` . If you
22
+ are using it from a ` package.json ` script, you can simply write ` typescript-scripts [script name] ` .
18
23
19
- - ` typescript-scripts init`
24
+ - ` init `
20
25
21
26
Initialises a repository for Typescript development. Currently it only checks that typescript
22
27
is installed and creates a tsconfig.json file for you if it doesn't already exist.
23
28
24
- - ` typescript-scripts lint [options] [files/dirs]`
29
+ - ` lint [options] [files/dirs] `
25
30
26
31
Lints the specified files and directories. Defaults to checking for .js and .ts extensions.
27
32
@@ -37,7 +42,7 @@ are using it within `package.json` simply write `typescript-scripts [script name
37
42
38
43
All the usual eslint flags can be passed to this script, they will be passed on to eslint.
39
44
40
- - ` typescript-scripts format`
45
+ - ` format `
41
46
42
47
Formats all the files in the repository using prettier.
43
48
@@ -56,22 +61,22 @@ are using it within `package.json` simply write `typescript-scripts [script name
56
61
57
62
TODO - allow passing an argument to configure which files/folders should be formatted
58
63
59
- - `typescript-scripts run [entrypoint]`
64
+ - `run [entrypoint]`
60
65
61
66
Runs typescript files using `ts-node`. Useful for creating a run/start command which
62
67
can be used to run a project for local development.
63
68
64
69
For example, add a script to your package.json called `dev` which runs
65
70
`typescript-scripts run src/index.ts` (replace the path to your project entrypoint)
66
71
67
- - `typescript-scripts test [files/directories/globs]`
72
+ - `test [files/directories/globs]`
68
73
69
74
Runs tests with mocha using `ts-node` to execute Typescript files. Pass `--watch` to watch
70
75
for changes and rerun the tests automatically.
71
76
72
77
Accepts all the usual [mocha CLI flags and options](https://mochajs.org/#command-line-usage).
73
78
74
- - `typescript-scripts compile`
79
+ - `compile`
75
80
76
81
Runs the `tsc` compiler.
77
82
0 commit comments