Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
},
"sourceType": "module"
},
"parser": "@babel/eslint-parser",
"parser": "@typescript-eslint/parser",
"settings": {
"react": { "version": "detect" },
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
"import/parsers": {
"@babel/eslint-parser": [".js", ".jsx", ".ts", ".tsx"]
"@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx"]
},
"import/resolver": {
"node": {
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/check-pull-request-health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@ on:
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x]

timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
- name: Setup Node.js from .node-version
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] This workflow now only exercises the single version pinned in .node-version, but package.json newly declares support for >=24.0.0 as well. That means the Node 24 part of the published engines contract is untested in CI. Add a second 24.x job/matrix entry here, or narrow engines.node to the version(s) you actually verify.

uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version-file: .node-version

- name: Install dependencies
run: npm ci --legacy-peer-deps
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Read Node.js version from '.nvmrc'
id: nvmrc
run: |
echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT

- name: Setup Node.js ${{ steps.nvmrc.outputs.NODE_VERSION }}
- name: Setup Node.js from .node-version
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
node-version-file: .node-version

- name: Ensure npm 11.5.1 or later is installed
run: npm install -g npm@latest
Expand All @@ -46,7 +41,7 @@ jobs:
- name: Publish to GitHub Package Registry
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
node-version-file: .node-version
registry-url: https://npm.pkg.github.com/
scope: '@doist'
- run: npm publish
Expand All @@ -59,7 +54,7 @@ jobs:
- name: Publish to npm registry
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
node-version-file: .node-version
registry-url: https://registry.npmjs.org/
scope: '@doist'
- run: npm publish --provenance --access public
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.18.0
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# react-interpolate

[![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)
[![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)

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

Expand Down
5 changes: 3 additions & 2 deletions __test__/package-smoke.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ function assert(condition, message) {
}

async function main() {
const cjsPackage = require('..')
const esmPackage = await import('../dist/react-interpolate.mjs')
const cjsPackage = require('@doist/react-interpolate')
Comment thread
gnapse marked this conversation as resolved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] This file still relies on Node self-referencing instead of testing a packed tarball. Since you noted in the previous review that this smoke test would be removed, it appears it was mistakenly modified instead. If it's no longer needed, remember to delete this file and remove its execution from the test:package script.

const esmPackage = await import('@doist/react-interpolate')

assert(typeof cjsPackage === 'object', 'CJS package should be a namespace object')
assert(typeof cjsPackage.default === 'function', 'CJS default export should be a function')
assert(typeof esmPackage.default === 'function', 'ESM default export should be a function')
assert(cjsPackage.TOKEN_PLACEHOLDER === esmPackage.TOKEN_PLACEHOLDER, 'Named exports should match')
Expand Down
4 changes: 0 additions & 4 deletions __test__/tsconfig.package-cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
"moduleResolution": "NodeNext",
"strict": true,
"skipLibCheck": true,
"baseUrl": "..",
"noEmit": true,
"paths": {
"@doist/react-interpolate": ["./dist/index.d.ts"]
},
"types": ["node", "react"]
},
"files": ["package-types.cts"]
Expand Down
4 changes: 0 additions & 4 deletions __test__/tsconfig.package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
"moduleResolution": "NodeNext",
"strict": true,
"skipLibCheck": true,
"baseUrl": "..",
"noEmit": true,
"paths": {
"@doist/react-interpolate": ["./dist/index.d.ts"]
},
"types": ["node", "react"]
},
"files": ["package-types.mts"]
Expand Down
19 changes: 0 additions & 19 deletions babel.config.js

This file was deleted.

24 changes: 24 additions & 0 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|tsx)$': [
'@swc/jest',
{
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
},
transform: {
react: {
runtime: 'classic',
},
},
},
module: {
type: 'commonjs',
},
},
],
},
}
3 changes: 0 additions & 3 deletions jest.config.js

This file was deleted.

Loading
Loading