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
7 changes: 0 additions & 7 deletions .browserslistrc

This file was deleted.

17 changes: 17 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": [
"@svitejs/changesets-changelog-github-compact",
{ "repo": "TanStack/ranger" }
],
"commit": false,
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"fixed": [],
"linked": [],
"ignore": [],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
2 changes: 1 addition & 1 deletion .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Tools
uses: tanstack/config/.github/setup@main
- name: Fix formatting
run: pnpm run format
run: pnpm prettier:write
- name: Apply fixes
uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
with:
Expand Down
36 changes: 32 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,35 @@ jobs:
fetch-depth: 0
- name: Setup Tools
uses: tanstack/config/.github/setup@main
- name: Run Build
run: pnpm run build
- name: Run Tests
run: pnpm -r test:types && pnpm -r test:lib
- name: Get base and head commits for `nx affected`
uses: nrwl/nx-set-shas@v4.3.3
with:
main-branch-name: main
- name: Run Checks
run: pnpm test:pr
preview:
name: Preview
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0
- name: Setup Tools
uses: tanstack/config/.github/setup@main
- name: Build Packages
run: pnpm run build:all
- name: Publish Previews
run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --template './examples/*/*'
provenance:
name: Provenance
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0
- name: Check Provenance
uses: danielroe/provenance-action@v0.1.1
with:
fail-on-downgrade: true
20 changes: 9 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ jobs:
- name: Run Build
run: pnpm run build
- name: Run Tests
run: pnpm -r test:types && pnpm -r test:lib
- name: Publish
run: |
pnpm install --no-frozen-lockfile
git config --global user.name 'Tanner Linsley'
git config --global user.email 'tannerlinsley@users.noreply.github.com'
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
pnpm run cipublish
run: pnpm run test:ci
- name: Run Changesets (version or publish)
uses: changesets/action@v1.5.3
with:
version: pnpm run changeset:version
publish: pnpm run changeset:publish
commit: 'ci: Version Packages'
title: 'ci: Version Packages'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ stats.html
.DS_Store
node_modules
.cache
.nx/cache
.nx/workspace-data
dist
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Tanner Linsley
Copyright (c) 2021-present Tanner Linsley

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
23 changes: 0 additions & 23 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ At the heart of every Ranger is the `Ranger` class. This class will provide ever

After reading about Ranger's concepts, you should:

- [Check Out Some Examples](./examples/react/basic)
- [Check Out Some Examples](/ranger/latest/docs/framework/react/examples/basic)
2 changes: 1 addition & 1 deletion docs/framework/react/api/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ menu: API

Want to skip to the implementation? Check out these examples:

- [basic](../examples/react/basic)
- [basic](/ranger/latest/docs/framework/react/examples/basic)

The API below described how to use the **basic** features.

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/react/api/update-on-drag.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ menu: API

Want to skip to the implementation? Check out these examples:

- [update-on-drag](../../examples/update-on-drag)
- [update-on-drag](/ranger/latest/docs/framework/react/examples/update-on-drag)

The API below described how to use the **update-on-drag** features.

Expand Down
5 changes: 5 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",

"ignoreDependencies": ["@arethetypeswrong/core", "publint"]
}
54 changes: 54 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"defaultBase": "main",
"useInferencePlugins": false,
"parallel": 5,
"namedInputs": {
"sharedGlobals": [
"{workspaceRoot}/.nvmrc",
"{workspaceRoot}/package.json",
"{workspaceRoot}/tsconfig.json"
],
"default": [
"sharedGlobals",
"{projectRoot}/**/*",
"!{projectRoot}/**/*.md"
],
"production": [
"default",
"!{projectRoot}/tests/**/*",
"!{projectRoot}/eslint.config.js"
]
},
"targetDefaults": {
"test:docs": {
"cache": true,
"inputs": ["{workspaceRoot}/docs/**/*"]
},
"test:knip": {
"cache": true,
"inputs": ["{workspaceRoot}/**/*"]
},
"test:sherif": {
"cache": true,
"inputs": ["{workspaceRoot}/**/package.json"]
},
"test:lib": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["default", "^production"],
"outputs": ["{projectRoot}/coverage"]
},
"test:types": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["default", "^production"]
},
"build": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["production", "^production"],
"outputs": ["{projectRoot}/build", "{projectRoot}/dist"]
}
}
}
64 changes: 26 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,41 @@
"url": "https://github.com/tanstack/ranger.git"
},
"packageManager": "pnpm@10.24.0",
"type": "module",
"scripts": {
"clean": "pnpm --filter \"./packages/**\" run clean",
"test:types": "pnpm -r test:types",
"test:lib": "pnpm -r test:lib",
"test:docs": "ts-node scripts/verify-links.ts",
"build": "rollup --config rollup.config.js",
"watch": "concurrently --kill-others \"rollup --config rollup.config.js -w\" \"tsc -b --watch\"",
"test": "pnpm run test:ci",
"test:pr": "nx affected --targets=test:sherif,test:knip,test:docs,test:lib,test:types,build",
"test:ci": "nx run-many --targets=test:sherif,test:knip,test:docs,test:lib,test:types,build",
"test:types": "nx affected --target=test:types --exclude=examples/**",
"test:lib": "nx affected --target=test:lib --exclude=examples/**",
"test:knip": "knip",
"test:sherif": "sherif",
"test:docs": "node scripts/verify-links.ts",
"build": "nx affected --target=build",
"build:all": "nx run-many --target=build",
"watch": "pnpm run build:all && nx watch --all -- pnpm run build:all",
"dev": "pnpm run watch",
"format": "prettier --experimental-cli --ignore-unknown '**/*' --write",
"visualize": "pnpm -rc --parallel exec open build/stats-html.html",
"cipublish": "ts-node scripts/publish.ts",
"cipublishforce": "CI=true pnpm cipublish"
"prettier": "prettier --experimental-cli --ignore-unknown '**/*'",
"prettier:write": "pnpm run prettier --write",
"changeset": "changeset",
"changeset:version": "changeset version && pnpm install --no-frozen-lockfile && pnpm prettier:write",
"changeset:publish": "changeset publish"
},
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@commitlint/parse": "^16.2.1",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^23.0.4",
"@rollup/plugin-node-resolve": "^13.2.1",
"@rollup/plugin-replace": "^4.0.0",
"@types/babel__core": "^7.1.20",
"@types/fs-extra": "^9.0.13",
"@types/luxon": "^2.3.1",
"@types/node": "^17.0.25",
"@types/semver": "^7.3.13",
"axios": "^0.26.1",
"concurrently": "^7.1.0",
"current-git-branch": "^1.1.0",
"fs-extra": "^10.1.0",
"git-log-parser": "^1.2.0",
"@arethetypeswrong/core": "^0.18.2",
"@changesets/cli": "^2.29.8",
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
"@types/node": "^24.1.0",
"knip": "^5.71.0",
"luxon": "^2.3.2",
"markdown-link-extractor": "^4.0.3",
"nx": "22.1.3",
"premove": "^4.0.0",
"prettier": "^3.7.4",
"rollup": "^2.70.2",
"rollup-plugin-dts": "^4.2.2",
"rollup-plugin-size": "^0.2.2",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-visualizer": "^5.6.0",
"stream-to-array": "^2.3.0",
"publint": "^0.3.15",
"sherif": "^1.9.0",
"tinyglobby": "^0.2.15",
"ts-node": "^10.7.0",
"typescript": "^4.9.4",
"vitest": "^0.26.2"
"typescript": "^5.9.3",
"vitest": "^4.0.15"
}
}
46 changes: 30 additions & 16 deletions packages/ranger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,48 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/tanstack/ranger.git"
"url": "git+https://github.com/tanstack/ranger.git",
"directory": "packages/ranger"
},
"homepage": "https://github.com/tanstack/ranger#readme",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"keywords": [
"react",
"ranger",
"ranger"
"slider"
],
"type": "commonjs",
"module": "build/esm/index.js",
"main": "build/cjs/index.js",
"browser": "build/umd/index.production.js",
"types": "build/types/index.d.ts",
"engines": {
"node": ">=12"
"scripts": {
"clean": "premove ./dist ./build",
"test:lib": "vitest run",
"test:lib:dev": "pnpm test:lib --watch",
"test:types": "tsc",
"build": "tsdown"
},
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": "./src/index.ts",
"./package.json": "./package.json"
},
"publishConfig": {
"exports": {
".": "./dist/index.js",
"./package.json": "./package.json"
}
},
"sideEffects": false,
"files": [
"build/**",
"dist",
"src"
],
"scripts": {
"clean": "premove ./build",
"test:lib": "vitest run",
"test:lib:dev": "pnpm test:lib --watch",
"test:types": "tsc --emitDeclarationOnly"
"engines": {
"node": ">=18"
},
"devDependencies": {
"tsdown": "^0.17.0"
}
}
6 changes: 5 additions & 1 deletion packages/ranger/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { linearInterpolator, getBoundingClientRect, sortNumList } from './utils'
import {
linearInterpolator,
getBoundingClientRect,
sortNumList,
} from './utils.js'

export type RangerChangeEvent<TTrackElement> = (
instance: Ranger<TTrackElement>,
Expand Down
12 changes: 2 additions & 10 deletions packages/ranger/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{
"composite": true,
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./build/types"
},
"files": ["src/index.ts", "src/utils.ts"],
"include": [
"src"
// "__tests__/**/*.test.*"
]
"extends": "../../tsconfig.json",
"include": ["src"]
}
Loading
Loading