@vanillaes/esmtk 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/bin/commands/typings.js +4 -0
- package/bin/esmtk.js +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -122,8 +122,14 @@ Type check the JSDoc typings (using Typescript)
|
|
|
122
122
|
# type check the sources
|
|
123
123
|
esmtk type index.js
|
|
124
124
|
|
|
125
|
+
# type check the sources (with 'node' module resolution)
|
|
126
|
+
esmtk type --module nodenext index.js
|
|
127
|
+
|
|
125
128
|
# type check the sources (with 'strict mode' enabled)
|
|
126
129
|
esmtk type --strict index.js
|
|
130
|
+
|
|
131
|
+
# type check the sources (with '@types/node' typings included)
|
|
132
|
+
esmtk type --types node index.js
|
|
127
133
|
```
|
|
128
134
|
|
|
129
135
|
**Node: Due to Typescript limitations, inline JSDoc typings will be ignored if typings (ie `*.d.ts` files) exist.**
|
|
@@ -211,12 +217,20 @@ Generate Type Declarations (.d.ts) from JSDoc (using Typescript)
|
|
|
211
217
|
`esmtk typings [entry]`
|
|
212
218
|
|
|
213
219
|
- `[entry]` - the entry-point for the source
|
|
220
|
+
- `--module [module]` - module resolution type (default `esnext`)
|
|
221
|
+
- `--types [types]` - specify type package names to include (ex `node` for `@types/node`)
|
|
214
222
|
|
|
215
223
|
### Usage
|
|
216
224
|
|
|
217
225
|
```sh
|
|
218
226
|
# generate .d.ts files for all linked source files
|
|
219
227
|
esmtk typings index.js
|
|
228
|
+
|
|
229
|
+
# generate .d.ts files for all linked source files (with 'node' module resolution)
|
|
230
|
+
esmtk type --module nodenext index.js
|
|
231
|
+
|
|
232
|
+
# generate .d.ts files for all linked source files (with '@types/node' typings included)
|
|
233
|
+
esmtk type --types node index.js
|
|
220
234
|
```
|
|
221
235
|
|
|
222
236
|
|
package/bin/commands/typings.js
CHANGED
package/bin/esmtk.js
CHANGED
|
@@ -45,6 +45,7 @@ program.command('type <entry>')
|
|
|
45
45
|
program.command('typings <entry>')
|
|
46
46
|
.description('Generate typings from JSDoc using Typescript')
|
|
47
47
|
.option('--module <module>', 'Module resolution type (default esnext)', 'esnext')
|
|
48
|
+
.option('--types <types>', 'specify type package names to include (ex `node` for `@types/node`)')
|
|
48
49
|
.action((entry, options) => {
|
|
49
50
|
typings(entry, options)
|
|
50
51
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vanillaes/esmtk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "ES Module Toolkit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecmascript",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"scripts": {
|
|
41
41
|
"test": "./bin/esmtk.js test",
|
|
42
42
|
"lint": "./bin/esmtk.js lint",
|
|
43
|
-
"type": "./bin/esmtk.js type src/index.js && ./bin/esmtk.js type bin/esmtk.js --module nodenext",
|
|
43
|
+
"type": "./bin/esmtk.js type --module nodenext src/index.js && ./bin/esmtk.js type bin/esmtk.js --module nodenext",
|
|
44
44
|
"bundle": "./bin/esmtk.js bundle --platform=node src/index.js src/index.esm.js",
|
|
45
45
|
"minify": "./bin/esmtk.js minify --platform=node src/index.js src/index.min.js",
|
|
46
|
-
"typings": "./bin/esmtk.js typings src/index.js",
|
|
46
|
+
"typings": "./bin/esmtk.js typings --module nodenext src/index.js",
|
|
47
47
|
"clean": "./bin/esmtk.js clean --typings",
|
|
48
48
|
"preview": "./bin/esmtk.js preview",
|
|
49
49
|
"preversion": "npm run test && npm run lint && npm run type",
|