@checkdigit/typescript-config 2.1.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,40 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - "main"
7
+
8
+ jobs:
9
+ branchBuild:
10
+ runs-on: ubuntu-latest
11
+ name: Branch Build
12
+ strategy:
13
+ matrix:
14
+ node-version: [16.x]
15
+ steps:
16
+ - uses: actions/checkout@v3
17
+ with:
18
+ ref: ${{ github.event.pull_request.head.sha }}
19
+ - name: Use Node.js ${{ matrix.node-version }}
20
+ uses: actions/setup-node@v3
21
+ with:
22
+ node-version: ${{ matrix.node-version }}
23
+ cache: 'npm'
24
+ - name: Install dependencies
25
+ run: npm ci
26
+ env:
27
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
28
+ CI: true
29
+ - name: Compile
30
+ run: npm run ci:compile
31
+ env:
32
+ CI: true
33
+ - name: Check Code Style
34
+ run: npm run ci:style
35
+ env:
36
+ CI: true
37
+ - name: Run Tests
38
+ run: npm run ci:test
39
+ env:
40
+ CI: true
package/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2021 Check Digit, LLC
3
+ Copyright (c) 2021-2022 Check Digit, LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,15 +1,17 @@
1
1
  # checkdigit/typescript-config
2
2
 
3
3
  [![MIT License](https://img.shields.io/github/license/checkdigit/typescript-config)](https://github.com/checkdigit/typescript-config/blob/master/LICENSE.txt)
4
- [![David](https://status.david-dm.org/gh/checkdigit/typescript-config.svg)](https://status.david-dm.org/gh/checkdigit/typescript-config.svg)
5
4
 
6
- Copyright (c) 2021 [Check Digit, LLC](https://checkdigit.com)
5
+ Copyright (c) 2022 [Check Digit, LLC](https://checkdigit.com)
7
6
 
8
7
  ### Introduction
9
8
 
10
9
  This module contains the standard Check Digit Typescript configuration.
11
- - requires Node 14 or above
12
- - emits ES2020
10
+ - requires Node 16 or above
11
+ - emits ES2022
12
+ - uses the new tsconfig `module` type of `node16`. This specifies that whether commonjs or ESM is emitted is dependent
13
+ on the value of the `type` field in `package.json`. If not supplied, the default value is `commonjs`.
14
+ Set `"type": "module"` to emit ESM.
13
15
  - all compiler options set for maximum strictness
14
16
 
15
17
  #### A note about versioning
@@ -27,10 +29,11 @@ Bear in mind, any update of Typescript can potentially break your build. But ho
27
29
  ### Installation
28
30
 
29
31
  ```
30
- npm add -D typescript
31
32
  npm add -D @checkdigit/typescript-config
32
33
  ```
33
34
 
35
+ Note: you do not need to explicitly install Typescript itself, as it comes in as a peer dependency of `@checkdigit/typescript-config`.
36
+
34
37
  Make sure your project's `tsconfig.json` extends `@checkdigit/typescript-config`.
35
38
 
36
39
  ### Example `tsconfig.json`
package/package.json CHANGED
@@ -1,19 +1,14 @@
1
1
  {
2
2
  "name": "@checkdigit/typescript-config",
3
- "version": "2.1.0",
3
+ "version": "3.0.1",
4
4
  "description": "Check Digit standard Typescript configuration",
5
- "scripts": {
6
- "prepublishOnly": "publish",
7
- "postpublish": "rimraf dist .npmignore",
8
- "preversion": "npm test",
9
- "postversion": "git push && git push --tags",
10
- "test": "rimraf build && tsc && test -f build/index.js && test -f build/index.d.ts && test -f build/index.js.map"
11
- },
5
+ "prettier": "@checkdigit/prettier-config",
12
6
  "engines": {
13
- "node": ">=14"
7
+ "node": ">=16"
14
8
  },
15
9
  "peerDependencies": {
16
- "typescript": ">=4.3.2"
10
+ "typescript": ">=4.7.4",
11
+ "@types/node": ">=16"
17
12
  },
18
13
  "repository": {
19
14
  "type": "git",
@@ -25,9 +20,18 @@
25
20
  "url": "https://github.com/checkdigit/typescript-config/issues"
26
21
  },
27
22
  "homepage": "https://github.com/checkdigit/typescript-config#readme",
23
+ "scripts": {
24
+ "preversion": "npm test",
25
+ "postversion": "git push && git push --tags",
26
+ "prettier": "prettier --list-different 'src/**/*.ts'",
27
+ "prettier:fix": "prettier --write 'src/**/*.ts'",
28
+ "test": "npm run ci:compile && npm run ci:test && npm run ci:style",
29
+ "ci:compile": "tsc --noEmit",
30
+ "ci:test": "tsc && node build/index.js | grep -q 'complete' && rimraf build",
31
+ "ci:style": "npm run prettier"
32
+ },
28
33
  "devDependencies": {
29
- "@checkdigit/publish": "^1.0.19",
30
- "rimraf": "^3.0.2",
31
- "typescript": "4.3.2"
34
+ "@checkdigit/prettier-config": "2.1.0",
35
+ "rimraf": "^3.0.2"
32
36
  }
33
37
  }
package/tsconfig.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "module": "commonjs",
4
- "target": "es2020",
3
+ "module": "node16",
4
+ "target": "es2022",
5
5
  "lib": ["esnext", "dom", "webworker"],
6
6
  "sourceMap": true,
7
7
  "outDir": "build",
@@ -27,7 +27,9 @@
27
27
  "noUncheckedIndexedAccess": true,
28
28
  "noPropertyAccessFromIndexSignature": true,
29
29
  "allowUnusedLabels": false,
30
- "noImplicitOverride": true
30
+ "noImplicitOverride": true,
31
+ "useUnknownInCatchVariables": true,
32
+ "exactOptionalPropertyTypes": true
31
33
  },
32
34
  "exclude": [
33
35
  "node_modules",
package/dist/index.d.ts DELETED
File without changes
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";