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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@biomejs/biome": "^2.0.6",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@rslib/core": "^0.12.1",
"@testing-library/react": "^16.3.0",
"@types/js-cookie": "^3.0.6",
"@types/lodash": "^4.17.20",
Expand Down
3 changes: 0 additions & 3 deletions packages/use-url-state/gulpfile.js

This file was deleted.

27 changes: 15 additions & 12 deletions packages/use-url-state/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
{
"name": "@ahooksjs/use-url-state",
"type": "module",
"version": "3.6.0",
"description": "A hook that stores the state into url query parameters.",
"main": "./lib/index.js",
"module": "./es/index.js",
"types": "./lib/index.d.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"unpkg": "dist/ahooks-use-url-state.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.js"
}
},
"files": [
"dist",
"lib",
"es",
"package.json"
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/alibaba/hooks.git"
},
"scripts": {
"build": "gulp && webpack-cli",
"build": "rslib build",
"test": "vitest run",
"test:cov": "vitest run --coverage"
},
Expand All @@ -31,10 +36,8 @@
"homepage": "https://github.com/alibaba/hooks",
"gitHead": "11f6ad571bd365c95ecb9409ca3050cbbfc9b34a",
"dependencies": {
"@babel/runtime": "^7.21.0",
"ahooks": "^3.4.1",
"query-string": "^8.1.0",
"tslib": "^2.4.1"
"ahooks": "workspace:*",
"query-string": "^8.1.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
Expand Down
44 changes: 44 additions & 0 deletions packages/use-url-state/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { defineConfig } from '@rslib/core';

export default defineConfig({
source: {
entry: {
index: './src/index.ts',
},
tsconfigPath: './tsconfig.build.json',
},
lib: [
{
format: 'umd',
umdName: 'ahooksUseUrlState',
output: {
target: 'web',
externals: {
react: 'React',
},
filename: {
js: (pathData) => {
return pathData.chunk?.name === 'index'
? 'ahooks-use-url-state.js'
: `ahooks-use-url-state.chunk-${pathData.chunk?.name}.js`;
},
},
minify: true,
},
},
{
format: 'esm',
dts: true,
output: {
target: 'web',
sourceMap: true,
},
},
{
format: 'cjs',
output: {
sourceMap: true,
},
},
],
});
4 changes: 2 additions & 2 deletions packages/use-url-state/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useMemoizedFn, useUpdate } from 'ahooks';
import qs from 'query-string';
import type { ParseOptions, StringifyOptions } from 'query-string';
import { useMemo, useRef } from 'react';
import qs from 'query-string';
import type * as React from 'react';
import { useMemo, useRef } from 'react';
import * as tmp from 'react-router';

// ignore waring `"export 'useNavigate' (imported as 'rc') was not found in 'react-router'`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.pro.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src"
},
Expand Down
12 changes: 0 additions & 12 deletions packages/use-url-state/webpack.config.js

This file was deleted.

Loading
Loading