@vanillaes/esmtk 0.9.0 → 0.10.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.
@@ -1,6 +1,18 @@
1
1
  {
2
2
  "version": "0.2.0",
3
3
  "configurations": [
4
+ {
5
+ "name": "Version",
6
+ "type": "node",
7
+ "request": "launch",
8
+ "skipFiles": [
9
+ "<node_internals>/**"
10
+ ],
11
+ "program": "${workspaceFolder}/bin/esmtk.js",
12
+ "cwd": "${workspaceFolder}",
13
+ "args": ["--version"],
14
+ "console": "integratedTerminal",
15
+ },
4
16
  {
5
17
  "name": "Lint",
6
18
  "type": "node",
@@ -22,7 +34,7 @@
22
34
  ],
23
35
  "program": "${workspaceFolder}/bin/esmtk.js",
24
36
  "cwd": "${workspaceFolder}",
25
- "args": ["types", "./test/index.js"],
37
+ "args": ["types", "./src/index.js"],
26
38
  "console": "integratedTerminal",
27
39
  },
28
40
  {
@@ -34,7 +46,7 @@
34
46
  ],
35
47
  "program": "${workspaceFolder}/bin/esmtk.js",
36
48
  "cwd": "${workspaceFolder}",
37
- "args": ["typings", "./test/index.js"],
49
+ "args": ["typings", "./src/index.js"],
38
50
  "console": "integratedTerminal",
39
51
  },
40
52
  {
package/README.md CHANGED
@@ -34,6 +34,7 @@ Type check the JSDoc typings (using Typescript)
34
34
  `esmtk types index.js`
35
35
 
36
36
  - `[entry]` - the entry-point for the source
37
+ - `--strict` - enable 'strict mode' type checks
37
38
 
38
39
  ### Usage
39
40
 
@@ -5,7 +5,7 @@ import { spawn } from 'child_process'
5
5
  * Type Check the JSDOC typings
6
6
  * @param {string} entry the entry point
7
7
  */
8
- export async function types (entry) {
8
+ export async function types (entry, options) {
9
9
  const npmExists = await which('npm')
10
10
  if (!npmExists) {
11
11
  console.error('npm not found')
@@ -20,10 +20,19 @@ export async function types (entry) {
20
20
  process.exit(1)
21
21
  }
22
22
 
23
- spawn('tsc', [entry, '-t', 'esnext', '--allowJS', '--checkJS', '--skipLibCheck', '--noEmit'], {
24
- cwd: process.cwd(),
25
- stdio: ['pipe', process.stdout, process.stderr]
26
- }).on('error', err => {
27
- console.error(err)
28
- })
23
+ if (options?.strict) {
24
+ spawn('tsc', [entry, '-t', 'esnext', '--allowJS', '--checkJS', '--skipLibCheck', '--noEmit', '--strict'], {
25
+ cwd: process.cwd(),
26
+ stdio: ['pipe', process.stdout, process.stderr]
27
+ }).on('error', err => {
28
+ console.error(err)
29
+ })
30
+ } else {
31
+ spawn('tsc', [entry, '-t', 'esnext', '--allowJS', '--checkJS', '--skipLibCheck', '--noEmit'], {
32
+ cwd: process.cwd(),
33
+ stdio: ['pipe', process.stdout, process.stderr]
34
+ }).on('error', err => {
35
+ console.error(err)
36
+ })
37
+ }
29
38
  }
package/bin/esmtk.js CHANGED
@@ -18,8 +18,9 @@ program.command('lint')
18
18
 
19
19
  program.command('types <entry>')
20
20
  .description('Type check the JSDoc typings using Typescript')
21
- .action((entry) => {
22
- types(entry)
21
+ .option('--strict', 'Enable strict type checks')
22
+ .action((entry, options) => {
23
+ types(entry, options)
23
24
  })
24
25
 
25
26
  program.command('typings <entry>')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanillaes/esmtk",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "ES Module Toolkit",
5
5
  "keywords": [
6
6
  "esm",
@@ -13,6 +13,9 @@
13
13
  "author": "Evan Plaice <evanplaice@gmail.com> (https://evanplaice.com/)",
14
14
  "license": "MIT",
15
15
  "type": "module",
16
+ "bin": {
17
+ "esmtk": "bin/esmtk.js"
18
+ },
16
19
  "exports": {
17
20
  ".": {
18
21
  "types": "./src/index.d.ts",
@@ -27,9 +30,6 @@
27
30
  "default": "./src/rm.js"
28
31
  }
29
32
  },
30
- "bin": {
31
- "esmtk": "bin/esmtk.js"
32
- },
33
33
  "scripts": {
34
34
  "lint": "./bin/esmtk.js lint",
35
35
  "types": "./bin/esmtk.js types src/index.js",
@@ -41,9 +41,6 @@
41
41
  "commander": "^14.0.3",
42
42
  "standard": "^17.1.2"
43
43
  },
44
- "engines": {
45
- "node": ">=17"
46
- },
47
44
  "devDependencies": {
48
45
  "@types/node": "^25.3.5"
49
46
  }