state-in-url
Version:
Store state in URL as in object, types and structure are preserved, with TS validation. Same API as React.useState, wthout any hasssle or boilerplate. Next.js@14-15 and react-router@6-7.
447 lines (446 loc) • 12.2 kB
JSON
{
"name": "state-in-url",
"version": "4.3.0",
"description": "Store state in URL as in object, types and structure are preserved, with TS validation. Same API as React.useState, wthout any hasssle or boilerplate. Next.js@14-15 and react-router@6-7.",
"homepage": "https://state-in-url.dev",
"repository": {
"type": "git",
"url": "git+https://github.com/asmyshlyaev177/state-in-url.git"
},
"author": {
"name": "asmyshlyaev177",
"email": "asmyshlyaev177@gmail.com",
"url": "https://www.linkedin.com/in/asmyshlyaev177/"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"tag": "latest",
"provenance": true
},
"license": "MIT",
"funding": {
"type": "patreon",
"url": "https://patreon.com/asmyshlyaev177"
},
"bugs": {
"url": "https://github.com/asmyshlyaev177/state-in-url/issues"
},
"workspaces": [
"packages/urlstate",
"packages/example-nextjs14",
"packages/example-nextjs15",
"packages/example-react",
"packages/example-react-router6"
],
"files": [
"dist"
],
"main": "dist/index.mjs",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
},
"./next": {
"types": "./dist/next/index.d.ts",
"default": "./dist/next/index.mjs"
},
"./react-router": {
"types": "./dist/react-router/index.d.ts",
"default": "./dist/react-router/index.mjs"
},
"./encodeState": {
"types": "./dist/encodeState/index.d.ts",
"default": "./dist/encodeState/index.mjs"
},
"./encoder": {
"types": "./dist/encoder/index.d.ts",
"default": "./dist/encoder/index.mjs"
},
"./useSharedState": {
"types": "./dist/useSharedState/index.d.ts",
"default": "./dist/useSharedState/index.mjs"
},
"./useUrlEncode": {
"types": "./dist/useUrlEncode/index.d.ts",
"default": "./dist/useUrlEncode/index.mjs"
},
"./useUrlStateBase": {
"types": "./dist/useUrlStateBase/index.d.ts",
"default": "./dist/useUrlStateBase/index.mjs"
},
"./utils": {
"types": "./dist/utils.d.ts",
"default": "./dist/utils.mjs"
}
},
"types": "./dist/index.d.ts",
"scripts": {
"test:unit": "wireit",
"test:int": "wireit",
"test:int:ci": "wireit",
"test:exports": "npm run build && npx babel-node --extensions .js,.mjs,.ts,.mts --config-file ./babel.config.json -- ./packages/urlstate/exportsTest.ts",
"test": "wireit",
"tsc": "wireit",
"dev": "wireit",
"dev:lib": "wireit",
"dev:nextjs14": "wireit",
"bump": "npx standard-version --no-verify",
"build": "wireit",
"build:demo": "wireit",
"start:demo": "wireit",
"build:packages": "wireit",
"start:demo15": "wireit",
"start:demo15:ci": "wireit",
"start:react": "wireit",
"start": "wireit",
"start:ci": "wireit",
"kill-next": "wireit",
"kill-vite": "wireit",
"kill": "wireit",
"rmdist": "rm -rf dist",
"cleanup": "rm -rf dist .wireit node_modules test-results playwright-report coverage-reports nyc_coverage packages/example-nextjs14/node_modules packages/example-nextjs14/.next packages/example-nextjs15/node_modules packages/example-nextjs15/.next packages/example-react/node_modules packages/example-react-router6/node_modules",
"reinstall": "npm run cleanup && npm install",
"setup": "playwright install --with-deps",
"prepack": "npm run build && cp package.json dist/package.json && npm run build:demo",
"pin-gh-deps": "pin-github-action -i .github/workflows/tests.yml",
"prepare": "npx husky"
},
"wireit": {
"test": {
"dependencies": [
"tsc",
"test:unit",
"build:packages"
],
"command": "npm run test:exports && npm run test:int"
},
"kill-next": {
"command": "ps aux | grep .next | grep -v grep | awk '{print $2}' | xargs kill -9 2>&1; exit 0"
},
"kill-vite": {
"command": "ps aux | grep '.bin/vite' | grep -v grep | awk '{print $2}' | xargs kill -9 2>&1; exit 0"
},
"kill-wireit": {
"command": "ps axu | grep wireit | awk '{print $2}' | xargs kill -9"
},
"kill": {
"command": "killed",
"dependencies": [
"kill-next",
"kill-vite",
"kill-wireit"
]
},
"test:int:ci": {
"command": "npx cross-env HOME=/root PLAYWRIGHT_BROWSERS_PATH=0 playwright test"
},
"test:int": {
"command": "playwright test --project=chromium --retries=2"
},
"tsc": {
"command": "npx tsc --noEmit"
},
"test:unit": {
"dependencies": [
"tsc"
],
"command": "npx vitest"
},
"dev": {
"dependencies": [
"dev:lib",
"dev:react",
"dev:router6",
"dev:nextjs15"
],
"service": {
"readyWhen": {
"lineMatches": "http://localhost:3000"
}
},
"command": "npm run dev:nextjs14"
},
"dev:lib": {
"command": "cross-env IS_DEVELOPMENT=true rollup -c rollup.config.mjs -w",
"service": {
"readyWhen": {
"lineMatches": "created "
}
},
"dependencies": [
"rmdist"
]
},
"dev:router6": {
"command": "cd packages/example-react-router6 && npm run dev",
"service": true
},
"dev:nextjs14": {
"command": "cd packages/example-nextjs14 && npm run dev --turbo",
"service": true
},
"dev:nextjs15": {
"command": "cd packages/example-nextjs15 && npm run dev --turbo",
"service": true
},
"build:next15": {
"command": "cd packages/example-nextjs15 && npm run build",
"dependencies": [
"build"
]
},
"build:router6": {
"command": "cd packages/example-react-router6 && npm run build",
"dependencies": [
"build"
]
},
"build:demo": {
"dependencies": [
"build"
],
"command": "cd packages/example-nextjs14 && npm run build"
},
"build:demo:tests": {
"dependencies": [
"build"
],
"command": "cd packages/example-nextjs14 && npx cross-env TEST=true npm run build"
},
"start:demo": {
"dependencies": [
"build:demo"
],
"command": "cd packages/example-nextjs14 && npm run start",
"service": true
},
"start:demo:ci": {
"command": "cd packages/example-nextjs14 && npm run start",
"service": true
},
"start:react": {
"command": "npx vite preview --port 5180 packages/example-react",
"dependencies": [
"build:react"
],
"service": true
},
"start:react:ci": {
"command": "npx vite preview --port 5180 packages/example-react",
"service": true
},
"start:router6": {
"command": "npx vite preview --port 5181 packages/example-react-router6",
"dependencies": [
"build:router6"
],
"service": true
},
"start:router6:ci": {
"command": "npx vite preview --port 5181 packages/example-react-router6",
"service": true
},
"start:demo15": {
"dependencies": [
"build:next15"
],
"command": "cd packages/example-nextjs15 && npm run start",
"service": true
},
"start:demo15:ci": {
"command": "cd packages/example-nextjs15 && npm run start",
"service": true
},
"start": {
"command": "npm run start:demo15",
"dependencies": [
"start:demo",
"start:react",
"start:router6"
],
"service": true
},
"start:ci": {
"command": "npm run start:demo15:ci",
"dependencies": [
"start:demo:ci",
"start:react:ci",
"start:router6:ci"
],
"service": true
},
"dev:react": {
"command": "cd packages/example-react && npm run dev",
"service": true
},
"build:packages": {
"dependencies": [
"build",
"build:react",
"build:demo:tests",
"build:next15",
"build:router6"
]
},
"build:react": {
"command": "cd packages/example-react && npm run build"
},
"build": {
"command": "rollup -c rollup.config.mjs",
"dependencies": [
"rmdist"
]
}
},
"browserslist": [
"last 5 Chrome versions",
"last 5 ChromeAndroid versions",
"last 5 Firefox versions",
"last 5 FirefoxAndroid versions",
"Firefox ESR",
"last 2 Safari major versions",
"last 2 iOS major versions"
],
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix"
],
"*.{html,css,less,ejs,json}": [
"prettier --write"
]
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
],
"rules": {
"body-max-line-length": [
0,
"always",
"Infinity"
]
}
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/node": "^7.25.0",
"@babel/preset-env": "^7.25.3",
"@babel/preset-typescript": "^7.24.7",
"@commitlint/cli": "^19.0.3",
"@commitlint/config-conventional": "^19.0.3",
"@playwright/test": "^1.48.2",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-typescript": "^12.1.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^12.0.1",
"@semantic-release/release-notes-generator": "^14.0.1",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@types/glob": "^8.1.0",
"@types/node": "^20.11.24",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitest/coverage-istanbul": "^2.1.5",
"auto-changelog": "^2.4.0",
"babel-plugin-module-resolver": "^5.0.2",
"chokidar": "^4.0.3",
"commitizen": "^4.3.0",
"commitlint": "^19.8.0",
"conventional-recommended-bump": "^10.0.0",
"cross-env": "^7.0.3",
"cz": "^1.8.2",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-maintainable": "^0.4.4",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-simple-import-sort": "^12.1.1",
"happy-dom": "^15.11.6",
"husky": "^9.0.11",
"lint-staged": "^15.2.9",
"nyc": "^17.1.0",
"only-allow": "^1.2.1",
"pin-github-action": "^1.9.1",
"playwright": "^1.48.2",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.6.8",
"release-it": "^17.6.0",
"rollup": "^4.39.0",
"rollup-plugin-esbuild": "^6.2.1",
"rollup-plugin-filesize": "^10.0.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"semantic-release": "^24.1.0",
"standard-version": "^9.5.0",
"ts-node": "^10.9.2",
"typescript": "^5.8.2",
"unplugin-auto-import": "^0.18.5",
"vitest": "^2.1.5",
"wait-on": "^8.0.1",
"wireit": "^0.14.11"
},
"keywords": [
"state in url",
"useSearchParams",
"useUrlState",
"url state",
"search params",
"nuqs alternative",
"reactive",
"json",
"state sync",
"state management",
"encode",
"decode",
"Next.js",
"react-router",
"url",
"url synchronization",
"url sync",
"state synchronization",
"synchronized state",
"state-in-url",
"store",
"react hook",
"state hook",
"url-state",
"client components communication",
"query string",
"query-string",
"querystring",
"search-params",
"searchparams",
"params",
"parse",
"stringify",
"query params",
"typescript",
"hooks",
"react.js",
"reactjs",
"react",
"NextJS",
"query params parser",
"query params parsing",
"shared state",
"state sharing",
"front-end",
"state-management",
"state-sync",
"search",
"encode url",
"decode url",
"fast"
],
"packageManager": "npm@10.8.2"
}