Skip to content

Commit

Permalink
Support Typescript 5.7 (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlansley authored Dec 3, 2024
1 parent b79c09c commit 1a22b72
Show file tree
Hide file tree
Showing 37 changed files with 3,330 additions and 1,685 deletions.
1 change: 0 additions & 1 deletion .github/workflows/check-published-scheduled.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Check Published

on:
workflow_dispatch:
schedule:
- cron: '30 20 * * *'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20.x', '22.x', '23.x']
node-version: ['22.x', '23.x']
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20.x', '22.x', '23.x']
node-version: ['22.x', '23.x']
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Dependency Review
uses: actions/dependency-review-action@v4
uses: actions/dependency-review-action@v4.3.3
with:
allow-licenses: ${{ vars.ALLOW_LICENSES }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: Check Label
uses: checkdigit/github-actions/check-label@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: Install latest npm
run: npm install -g npm@latest
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

Copyright (c) 2022–2024 [Check Digit, LLC](https://checkdigit.com)

### Introduction
## Introduction

This module contains the standard Check Digit Typescript configuration, along with our standard build tool `builder`.

### Typescript Configuration
## Typescript Configuration

- currently requires Node 20.17 or above.
- currently requires Node 22.11 or above.
- emits `esnext`, with the default libraries, to avoid down-leveling. It is intended that application spec tests pick
up any issues with using newer features unavailable in a particular environment. Browsers and Node.js are fast-moving
targets, and can add language features at any time.
- uses the `module` type of `esnext`.
- all compiler options set for maximum strictness.

### Builder
## Builder

`builder` is a command line tool that generates ESM modules from the Typescript source.
It is intended to be used when publishing a package to NPM, or to bundle a package for deployment.
Expand All @@ -26,7 +26,7 @@ It uses `tsc` for generating types, and `esbuild` for generating code.
**Note:** the `require` function will be defined as a global variable, to allow
dynamic `require`s by CommonJS submodules. This is not a problem for Node.js, but will cause issues in a browser environment.

#### Options
### Options

- `--type` the type of output to generate. Defaults to `module` (ESM). Valid values are `module` or `types`.
- `--entryPoint` the entry point for the bundle, relative to the inDir. if not provided, the files in the inDir will
Expand All @@ -39,17 +39,17 @@ dynamic `require`s by CommonJS submodules. This is not a problem for Node.js, bu
- `--minify` whether to minify the output.
- `--sourceMap` whether to include inline sourcemap.

#### Examples
### Examples

```
```shell
# build ESM .mjs files from Typescript source
npx builder --type=module --outDir=build-esm

# build single-file ESM .mjs bundle from Typescript source
npx builder --type=module --outDir=build-esm-bundle --entryPoint=index.ts --outFile=index.mjs
```

### Tests
## Tests

This module includes a number of integration-style tests, to ensure that a specific version of Typescript will interoperate
with `builder`, in addition to libraries and frameworks used by Check Digit:
Expand All @@ -60,6 +60,7 @@ with `builder`, in addition to libraries and frameworks used by Check Digit:
- prettier
- tsc
- esbuild
- Wallaby.js (supports `node:test` by including `@swc-node/register` as a peer dependency)

We do this to ensure that Typescript upgrades do not break these dependencies. New major versions of Typescript are not immediately
supported by projects such as ts-jest, eslint, prettier, etc. Our policy is to wait until these projects fully support
Expand All @@ -81,7 +82,7 @@ Bear in mind, any update of Typescript can potentially break your build. But hop

### Installation

```
```shell
npm add -D @checkdigit/typescript-config
```

Expand All @@ -92,7 +93,7 @@ Make sure your project's `tsconfig.json` extends `@checkdigit/typescript-config`

### Example `tsconfig.json`

```
```json
{
"extends": "@checkdigit/typescript-config"
}
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ These versions of `@checkdigit/typescript-config` are currently being supported

| Version | Supported |
| ------- | ------------------ |
| \>= 7.x | :white_check_mark: |
| \< 7.0 | :x: |
| \>= 9.x | :white_check_mark: |
| \< 9.0 | :x: |

## Reporting a Vulnerability

Expand Down
Loading

0 comments on commit 1a22b72

Please sign in to comment.