Skip to content

Update dependencies#110

Open
schorfES wants to merge 4 commits intomainfrom
update-dependencies
Open

Update dependencies#110
schorfES wants to merge 4 commits intomainfrom
update-dependencies

Conversation

@schorfES
Copy link
Copy Markdown
Owner

@schorfES schorfES commented Apr 10, 2026

  • Bump dependencies
  • Update typescript configs
  • Update export definitions
  • Update ESLint with XO Config

Open ToDos

  • Fix validation errors

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the project’s TypeScript/Jest configuration and bumps multiple devDependencies, while also adjusting published package entrypoints intended to reflect the build outputs.

Changes:

  • Add Jest type declarations to the Jest-specific tsconfig.
  • Remove explicit module/target/moduleResolution from the root tsconfig.json.
  • Update package.json entrypoint fields and upgrade several devDependencies (Jest, Rollup plugins, TypeScript, ESLint-related packages, etc.).

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 5 comments.

File Description
tsconfig.test.jest.json Adds types: ["jest"] to improve Jest test typechecking.
tsconfig.json Removes explicit TS compilation settings (now relies on defaults).
package.json Updates entrypoints (main/module/UMD fields) and upgrades devDependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread package.json Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment on lines 34 to 39
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/esm/index.esm.mjs",
"require": "./dist/formats/index.cjs.js"
"import": "./dist/index.js",
"require": "./dist/formats/cjs/index.js"
}
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

With "type": "module", Node will treat dist/formats/cjs/index.js as ESM (because it is a .js file within an ESM package scope). That means the exports["."].require entry will likely throw ERR_REQUIRE_ESM for CommonJS consumers. Consider emitting the CJS build with a .cjs extension (and pointing require to that), or adding a dist/formats/cjs/package.json with { "type": "commonjs" } during build/publish so that require resolves to true CommonJS.

Copilot uses AI. Check for mistakes.
Comment thread package.json
Comment on lines 33 to +38
"source": "src/index.ts",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": [
"dist"
],
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/esm/index.esm.mjs",
"require": "./dist/formats/index.cjs.js"
"import": "./dist/index.js",
"require": "./dist/formats/cjs/index.js"
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

The top-level types field was removed. While the exports["."].types entry works for newer TypeScript/tooling, older TypeScript versions and some ecosystem tools still rely on the root-level types/typings field to find declarations. Consider re-adding "types": "./dist/index.d.ts" for broader compatibility (it can coexist with the exports map).

Copilot uses AI. Check for mistakes.
Comment thread package.json
"require": "./dist/formats/index.cjs.js"
"import": "./dist/index.js",
"require": "./dist/formats/cjs/index.js"
}
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

exports no longer exposes ./package.json. When exports is present, Node disallows pkg/package.json access unless explicitly exported, so this is a breaking change for consumers/tools that read package metadata via import/require('react-hook-webstorage/package.json'). If that access should remain supported, consider restoring "./package.json": "./package.json" under exports.

Suggested change
}
},
"./package.json": "./package.json"

Copilot uses AI. Check for mistakes.
@schorfES schorfES force-pushed the update-dependencies branch from a9eb5a0 to 368b909 Compare April 13, 2026 07:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

Makefile:17

  • With .prettierrc/.prettierignore removed in this PR, "prettier . --check" will fall back to Prettier defaults and traverse the whole repo. Given the current codebase uses single quotes, this validate step is likely to start failing unless the code is reformatted or the Prettier config is reintroduced/migrated (e.g. prettier.config.* or a "prettier" key in package.json) and generated dirs like dist/ are ignored.
	./node_modules/.bin/eslint \
		.

	./node_modules/.bin/prettier \
		. \
    --check

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread eslint.config.mjs
Comment on lines +13 to +18
{
files: ['**/*.test.*'],
languageOptions: { globals: { ...globals.jest } },
...ConfigJest.configs['flat/recommended'],
...ConfigJest.configs['flat/style'],
},
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

The Jest ESLint override only targets files matching "**/.test.", but this repo's Jest tests are ".spec.ts" and "jest..ts" (e.g. src/useWebStorage.spec.ts). As-is, Jest globals/rules won’t apply to existing tests and lint will likely fail or miss intended test-specific rules. Update the "files" globs to include the project’s actual test naming patterns.

Copilot uses AI. Check for mistakes.
Comment thread eslint.config.mjs
Comment on lines +19 to +24
globalIgnores([
'coverage/',
'example/',
'tests/',
'package-lock.json',
]),
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

The flat-config ignores don’t include the generated "dist/" directory (previously ignored via .eslintignore, and still gitignored). If developers run build before validate, "eslint ." can end up linting generated output. Add "dist/" to globalIgnores (or otherwise ignore it) to keep linting focused on source.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants