Skip to content

Commit 63c4c80

Browse files
authored
v0.9.0 (#18)
- Bring back main module imports. - Refactor the repo structure into a monorepo where the lib, docs and tests are separate packages, for better isolation. Update names of package.json scripts. - Bring in ESLint for enforcing better code quality (also to sort imports). - Add new Draggable option/setting: sensorProcessingMode. It can be sampled (default) or immediate. Check the docs for more in-depth explanation. - Ensure the ticker can never accidentally tick on the server. - Update docs and deps. - BREAKING: In default sensorProcessingMode (sampled), if you previously had a sensor emitting end event before the draggable's drag start process was started/finished, the start procedure was discarded, which also meant that the start events/callbacks were never called. To me, this was a bit problematic, that an end event can be sent without a start event firing first (or at all). So now this is behavior is changed so that the start procedure is forcefully completed if it has not yet completed when the drag stops for one reason or another. - BREAKING: Rename Draggable group option/setting to dndGroups and enforce it to always be a Set of DraggableDndGroups. This makes the Droppable and Draggable matching quite a bit more flexible. - BREAKING: Droppable accept option/setting can not be an array anymore, but a Set instead. It can still be a function too though, like before.
1 parent ef51ffd commit 63c4c80

File tree

519 files changed

+19858
-16060
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

519 files changed

+19858
-16060
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
cache: npm
1515
- run: npm ci
1616
- name: Build docs
17-
run: npm run docs-build
17+
run: npm run docs:build
1818
- name: Deploy docs
1919
uses: peaceiris/actions-gh-pages@v3
2020
with:
2121
github_token: ${{ secrets.GITHUB_TOKEN }}
22-
publish_dir: docs/.vitepress/dist
22+
publish_dir: packages/dragdoll-docs/docs/.vitepress/dist

.github/workflows/publish-npm.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
node-version: '20.x'
1313
registry-url: 'https://registry.npmjs.org'
1414
- run: npm ci
15-
- run: npm publish
15+
- run: npm run build
16+
- run: npm publish --workspace=dragdoll
1617
env:
1718
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/run-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ jobs:
1818
node-version: '20.x'
1919
- name: Install dependencies
2020
run: npm ci
21+
- name: Build
22+
run: npm run build
2123
- name: Lint
2224
run: npm run lint
23-
- name: Tests
25+
- name: Test
2426
env:
2527
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
2628
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
27-
run: npm run test
29+
run: npm run test:browserstack

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
node_modules
2-
docs/.vitepress/cache
3-
docs/.vitepress/dist
2+
cache
43
*.log
54
*.env
65
*.DS_Store
7-
.parcel-cache
86
.cursorrules

.prettierignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
**/*.log
2-
**/*.map
3-
**/*.svg
4-
**/*.png
51
**/.env
62
**/.git
73
**/.gitignore
8-
**/.parcel-cache
94
**/.prettierignore
10-
**/.cursorrules
115
**/cache
126
**/dist
13-
**/docs/public/examples
147
**/node_modules
158
**/package-lock.json

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ Please [create an issue](https://github.com/niklasramo/dragdoll/issues/new) and
1515
- [Fork DragDoll](https://github.com/niklasramo/dragdoll#fork-destination-box).
1616
- Create a new branch for your pull request from the master branch. The name of the pull request branch should start with the id of the issue you opened for the pull request, e.g. `#123-fix-something`.
1717
3. **Setup the development environment.**
18-
- Run `npm ci` in the root.
19-
- You can now run the following commands:
18+
- Run `npm ci` in the root to install dependencies for all workspaces.
19+
- You can now run the following commands in the _root_:
2020
- `npm run build`
21-
- Builds the distributable files from `src` directory into the `dist` directory.
21+
- Builds the library (`dragdoll`), test suite (`dragdoll-tests`), and docs examples (`dragdoll-docs`), in that order.
2222
- `npm run format`
23-
- Formats all files in `src` directory with Prettier.
23+
- Formats all files in all workspaces with Prettier.
2424
- `npm run lint`
25-
- Lints all files in `src` directory with Prettier and validates TS types.
26-
- `npm run test`
27-
- Runs unit tests in Browserstack.
25+
- Lints all files in all workspaces with Prettier and validates TS types.
26+
- `npm run test:browserstack`
27+
- Runs tests (from `dragdoll-tests`) in Browserstack.
2828
- To make this work you need to create an `.env` file the project root, which should contain `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` variables.
29-
- `npm run test-local`
30-
- Runs unit tests locally in Chrome and Firefox. You have to have them both installed.
29+
- `npm run test:local`
30+
- Runs tests (from `dragdoll-tests`) locally in Chrome and Firefox. You have to have them both installed.
3131
4. **Do the updates.**
3232
- Remember scope. Don't refactor things that are not related to the pull request.
33-
- After you're done update unit tests and docs (`README.md`) if necessary.
33+
- After you're done update tests (`dragdoll-tests`) and docs (`dragdoll-docs`) if necessary.
3434
5. **Build and test changes.**
35-
- Run `npm run build` to build the lib with the changes and then run `npm run test` (or `npm run test-local`) to make sure the changes didn't cause regressions.
35+
- Run `npm run build` to build the lib after the changes and then run `npm run test:browserstack` (or `npm run test:local`) to make sure the changes didn't cause regressions.
3636
6. **Create the pull request.**
3737
- Do your best to explain what the pull request fixes.
3838
- Mention which issue(s) will be closed by the pull request, e.g. `Closes #123`.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ No frameworks were abused while writing this library. It's all vanilla framework
3636

3737
https://niklasramo.github.io/dragdoll/
3838

39+
## Repo structure
40+
41+
- [`dragdoll-root`](./) - Root package.
42+
- [`packages/dragdoll`](./packages/dragdoll) - The core dragdoll package.
43+
- [`packages/dragdoll-docs`](./packages/dragdoll-docs) - Docs for the dragdoll package.
44+
- [`packages/dragdoll-tests`](./packages/dragdoll-tests) - Tests for the dragdoll package.
45+
3946
## Copyright
4047

4148
Copyright © 2022-2024, Niklas Rämö (inramo@gmail.com). Licensed under the [MIT license](/LICENSE.md).

dist/auto-scroll-Drw3BB1r.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/auto-scroll-JoquSmSR.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/auto-scroll.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)