Skip to content

Commit ea74478

Browse files
authored
feat!: migrate @doist/react-interpolate to tsdown (#56)
1 parent c8a0f88 commit ea74478

18 files changed

Lines changed: 3937 additions & 6097 deletions

.eslintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
},
1818
"sourceType": "module"
1919
},
20-
"parser": "@babel/eslint-parser",
20+
"parser": "@typescript-eslint/parser",
2121
"settings": {
2222
"react": { "version": "detect" },
2323
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
2424
"import/parsers": {
25-
"@babel/eslint-parser": [".js", ".jsx", ".ts", ".tsx"]
25+
"@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx"]
2626
},
2727
"import/resolver": {
2828
"node": {

.github/workflows/check-pull-request-health.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,15 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12-
13-
strategy:
14-
matrix:
15-
node-version: [16.x, 18.x]
16-
1712
timeout-minutes: 60
1813
steps:
1914
- name: Checkout repository
2015
uses: actions/checkout@v4
2116

22-
- name: Setup Node.js ${{ matrix.node-version }}
17+
- name: Setup Node.js from .node-version
2318
uses: actions/setup-node@v3
2419
with:
25-
node-version: ${{ matrix.node-version }}
20+
node-version-file: .node-version
2621

2722
- name: Install dependencies
2823
run: npm ci --legacy-peer-deps

.github/workflows/publish.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,10 @@ jobs:
1919
- name: Checkout repository
2020
uses: actions/checkout@v4
2121

22-
- name: Read Node.js version from '.nvmrc'
23-
id: nvmrc
24-
run: |
25-
echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
26-
27-
- name: Setup Node.js ${{ steps.nvmrc.outputs.NODE_VERSION }}
22+
- name: Setup Node.js from .node-version
2823
uses: actions/setup-node@v3
2924
with:
30-
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
25+
node-version-file: .node-version
3126

3227
- name: Ensure npm 11.5.1 or later is installed
3328
run: npm install -g npm@latest
@@ -46,7 +41,7 @@ jobs:
4641
- name: Publish to GitHub Package Registry
4742
uses: actions/setup-node@v3
4843
with:
49-
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
44+
node-version-file: .node-version
5045
registry-url: https://npm.pkg.github.com/
5146
scope: '@doist'
5247
- run: npm publish
@@ -59,7 +54,7 @@ jobs:
5954
- name: Publish to npm registry
6055
uses: actions/setup-node@v3
6156
with:
62-
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
57+
node-version-file: .node-version
6358
registry-url: https://registry.npmjs.org/
6459
scope: '@doist'
6560
- run: npm publish --provenance --access public

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.18.0

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# react-interpolate
22

3-
[![size](http://img.badgesize.io/https://cdn.jsdelivr.net/gh/Doist/react-interpolate/dist/react-interpolate.min.cjs?compression=gzip)](http://img.badgesize.io/https://cdn.jsdelivr.net/gh/Doist/react-interpolate/dist/react-interpolate.min.cjs?compression=gzip) [![Actions Status](https://github.com/Doist/react-interpolate/workflows/CI/badge.svg)](https://github.com/Doist/react-interpolate/actions)
3+
[![size](http://img.badgesize.io/https://cdn.jsdelivr.net/gh/Doist/react-interpolate/dist/index.cjs?compression=gzip)](http://img.badgesize.io/https://cdn.jsdelivr.net/gh/Doist/react-interpolate/dist/index.cjs?compression=gzip) [![Actions Status](https://github.com/Doist/react-interpolate/workflows/CI/badge.svg)](https://github.com/Doist/react-interpolate/actions)
44

55
A string interpolation component that formats and interpolates a template string in a safe way.
66

__test__/package-smoke.cjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ function assert(condition, message) {
88
}
99

1010
async function main() {
11-
const cjsPackage = require('..')
12-
const esmPackage = await import('../dist/react-interpolate.mjs')
11+
const cjsPackage = require('@doist/react-interpolate')
12+
const esmPackage = await import('@doist/react-interpolate')
1313

14+
assert(typeof cjsPackage === 'object', 'CJS package should be a namespace object')
1415
assert(typeof cjsPackage.default === 'function', 'CJS default export should be a function')
1516
assert(typeof esmPackage.default === 'function', 'ESM default export should be a function')
1617
assert(cjsPackage.TOKEN_PLACEHOLDER === esmPackage.TOKEN_PLACEHOLDER, 'Named exports should match')

__test__/tsconfig.package-cjs.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
"moduleResolution": "NodeNext",
66
"strict": true,
77
"skipLibCheck": true,
8-
"baseUrl": "..",
98
"noEmit": true,
10-
"paths": {
11-
"@doist/react-interpolate": ["./dist/index.d.ts"]
12-
},
139
"types": ["node", "react"]
1410
},
1511
"files": ["package-types.cts"]

__test__/tsconfig.package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
"moduleResolution": "NodeNext",
66
"strict": true,
77
"skipLibCheck": true,
8-
"baseUrl": "..",
98
"noEmit": true,
10-
"paths": {
11-
"@doist/react-interpolate": ["./dist/index.d.ts"]
12-
},
139
"types": ["node", "react"]
1410
},
1511
"files": ["package-types.mts"]

babel.config.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)