Skip to content
Open
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: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ tslint.json
*.ipr
*.iml
*.iws
lib/
lib-esm/
_bundles/
dist/
node_modules/
_doc
yarn-error.log
Expand Down
9 changes: 4 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
**/.*
**/webpack.config.js
**/webpack.example.js
**/tsconfig.json
**/tsconfig.webpack.json
**/tsdown.config.ts
**/vitest.config.ts
**/vitest.setup.ts
**/node_modules
downstream_projects
downstream_projects.json
integration
logo
src
scripts
example
build
_doc
41 changes: 23 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,34 @@
"name": "@uirouter/react",
"version": "1.0.8",
"description": "State based routing for React",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"jsnext:main": "lib-esm/index.js",
"module": "lib-esm/index.js",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts",
"exports": {
".": {
"types": "./dist/index.d.mts",
"import": "./dist/index.mjs",
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
Comment on lines +11 to +16
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The exports shape is atypical: nesting "types" under "require" is not a standard Node condition and is likely to be ignored by Node, and may not be interpreted by TypeScript the way you intend. Prefer either (a) keep "require" as a string target and provide a top-level "types" target, or (b) use a conditional "types" object keyed by "import"/"require" while keeping runtime "import"/"require" targets as strings.

Suggested change
"types": "./dist/index.d.mts",
"import": "./dist/index.mjs",
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
"types": {
"import": "./dist/index.d.mts",
"require": "./dist/index.d.cts"
},
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"

Copilot uses AI. Check for mistakes.
},
"./package.json": "./package.json"
},
Comment on lines +5 to +19
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The published type entrypoints look inconsistent with what most TS declaration emitters produce. dts: true commonly generates *.d.ts (not *.d.mts/*.d.cts), and if those files aren’t actually emitted into dist/, TypeScript consumers will fail to resolve types. Consider updating types/exports.types to point at the actual emitted declaration filenames (often ./dist/index.d.ts), or adjust the build so it truly emits both index.d.mts and index.d.cts.

Copilot uses AI. Check for mistakes.
"sideEffects": false,
"files": [
"dist"
],
"scripts": {
"test": "vitest run",
"test:watch": "vitest",
"test:ui": "vitest --ui",
"test:downstream": "npm run build && test_downstream_projects",
"test:integration": "npm run build && test_downstream_projects --group=react-versions",
"start": "cross-env NODE_ENV=development webpack-dev-server --host 0.0.0.0 --port 8000 --config ./examples/typescript/webpack.config.js --history-api-fallback",
"clean": "shx rm -rf _bundles lib lib-esm build _doc",
"compile": "npm run clean && tsc && tsc -m es6 --outDir lib-esm",
"bundle": "cross-env NODE_ENV=production webpack",
"build": "run-s compile bundle fixmaps:*",
"clean": "shx rm -rf dist _doc",
"build": "tsdown",
"release": "release --deps @uirouter/core",
"fixmaps:lib": "tweak_sourcemap_paths -a --include 'lib/**/*.js.map' 'lib-esm/**/*.js.map'",
"fixmaps:bundle": "tweak_sourcemap_paths -a --include '_bundles/**/*.js.map'",
"docs": "generate_docs",
"docs:publish": "generate_docs && publish_docs",
"prepublishOnly": "npm run build",
Expand Down Expand Up @@ -61,20 +71,15 @@
"@types/react-dom": "^19",
"@uirouter/publish-scripts": "^2.7.0",
"@vitest/ui": "^4.0.16",
"cross-env": "^10.1.0",
"husky": "^9.1.7",
"jsdom": "^27.4.0",
"prettier": "^3.7.4",
"pretty-quick": "^4.2.2",
"react": "^19",
"react-dom": "^19",
"ts-loader": "^9.5.4",
"tsconfig-paths-webpack-plugin": "^4.2.0",
"tsdown": "^0.19.0-beta.5",
"typescript": "^5.9.3",
"vitest": "^4.0.16",
"webpack": "^5.104.1",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.2"
"vitest": "^4.0.16"
},
"checkPeerDependencies": {
"ignore": [
Expand Down
26 changes: 15 additions & 11 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"jsx": "react-jsx",
"strict": true,
"skipLibCheck": true,
"moduleResolution": "node",
"module": "commonjs",
"target": "es5",
"lib": ["es2015", "dom"],
"outDir": "lib",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"inlineSources": true,
"declaration": true,
"jsx": "react",
"baseUrl": "./src"
"isolatedModules": true,
"noEmit": true,
"baseUrl": "."
},
"files": ["./src/index.ts"]
"include": ["src"],
"exclude": ["node_modules", "dist", "**/__tests__/**"]
}
11 changes: 11 additions & 0 deletions tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'tsdown';

export default defineConfig({
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
sourcemap: true,
clean: true,
external: ['react', 'react-dom', 'react/jsx-runtime'],
outDir: 'dist',
});
37 changes: 0 additions & 37 deletions webpack.config.js

This file was deleted.

Loading