Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4 #28

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open

v4 #28

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
f43b532
feat: make turntable completely controllable from the parent element,…
nerdyman Nov 26, 2023
71a27bd
style: update linter to forbid any unused vars except prefixed ones
nerdyman Nov 26, 2023
204d4f6
fix: automatically set `activeImageIndex` `images.length` when `image…
nerdyman Nov 26, 2023
5e11d09
chore: use `latest` in example to avoid issues when it's used in isol…
nerdyman Nov 26, 2023
f1cfacb
refactor: move main code to `lib`, only build esm and replace np with…
nerdyman Nov 26, 2023
93e77ea
build: update build config and deps
nerdyman Dec 13, 2023
e56ea8b
chore: merge with main, fix conflicts
nerdyman Dec 16, 2023
e2a5f05
build: bump deps and remove lib scripts from package.json
nerdyman Dec 17, 2023
d5cc07e
refactor: move autorotate timeout handler inside effect and reset act…
nerdyman Dec 17, 2023
6fc22c7
docs: add controls to example and add advanced/basic demos
nerdyman Dec 17, 2023
5ae16a3
style: update eslint
nerdyman Dec 17, 2023
0ba7999
docs: update readme
nerdyman Dec 17, 2023
528f5cf
refactor: wrap turntable in `forwardRef` and rename `turntableRef` fr…
nerdyman Dec 17, 2023
166659e
docs(example): make buttons and inputs consistently space numbers to …
nerdyman Dec 17, 2023
97ac38d
style: enable stricter eslint settings to catch handing promises
nerdyman Dec 17, 2023
ad40df3
test: fix hanging promises
nerdyman Dec 17, 2023
20d2201
build(deps): force repo to resolve `react-image-turntable` to workspa…
nerdyman Dec 17, 2023
b92e6fb
refactor: merge with dev, fix conflicts
nerdyman Apr 8, 2024
3c12712
test: move tests into example folder and add granular interactivity t…
nerdyman Sep 21, 2024
33a066d
test: update playwright tests and reporters, move tests to example fo…
nerdyman Oct 19, 2024
d4ac3a8
style: replace eslint and prettier with biome and run biome on whole …
nerdyman Oct 19, 2024
3ab9ddd
build: bump pnpm version
nerdyman Oct 19, 2024
5744d62
fix: use `pan-y` instead of `none` to allow scrolling on touch device…
nerdyman Oct 19, 2024
30097c2
feat: make current image clickable, closes #35
nerdyman Oct 19, 2024
a18856f
ci: add publish preview workflow
nerdyman Oct 19, 2024
176984b
dx: do not error when biome doesn't find any matching files in pre-co…
nerdyman Oct 19, 2024
d194a58
build: make bootstrap script work with npm
nerdyman Oct 19, 2024
a877d27
build: update setup script in example
nerdyman Oct 19, 2024
b513cae
ci: run build before tests
nerdyman Oct 19, 2024
cf5470a
test: update target browsers
nerdyman Oct 19, 2024
cf627c4
ci: bump codeclimate action
nerdyman Oct 19, 2024
4d26d8c
chore: remove eslint tsconfig
nerdyman Oct 19, 2024
3a201f1
ci: copy src folder for coverage upload
nerdyman Oct 19, 2024
edfd1bd
ci: copy src folder for coverage upload again
nerdyman Oct 19, 2024
ae9994e
ci: copy src folder for coverage upload again again
nerdyman Oct 19, 2024
526c985
ci: copy src folder for coverage upload again again again
nerdyman Oct 19, 2024
91f5a38
ci: set wd for coverage action
nerdyman Oct 19, 2024
ecbe677
ci: remove install script from compressed size action
nerdyman Oct 19, 2024
52c0249
ci: update working directory of compressed size action
nerdyman Oct 19, 2024
dae60b6
ci: add install script to compressed size action
nerdyman Oct 19, 2024
e9f32c7
ci: update compressed action scripts
nerdyman Oct 19, 2024
33775c9
ci: update compressed size action for the last time hopefully
nerdyman Oct 19, 2024
51c41ec
ci: add test summary step
nerdyman Oct 19, 2024
672eaf6
ci: add esbuild bundle action
nerdyman Oct 19, 2024
388d504
build: don't minify the lib build when the `ANALYZE` environment veri…
nerdyman Oct 19, 2024
1be99ed
chore: update contrib guide
nerdyman Oct 19, 2024
cb61e4d
ci: update publish package job
nerdyman Oct 19, 2024
b881ec6
ci: add step to check package
nerdyman Oct 19, 2024
8eeb330
build: bump deps
nerdyman Oct 19, 2024
6206471
build(example): use glob for lib package version
nerdyman Oct 20, 2024
63121bc
build: bump publint and attw, only check node16 for attw
nerdyman Dec 17, 2024
ff51b3f
chore: update package.json formatting
nerdyman Dec 17, 2024
e86cbf3
chore: release v4.0.0-0
nerdyman Dec 17, 2024
de3c9d3
chore: put package.json formatting back the way it was
nerdyman Dec 17, 2024
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: 0 additions & 4 deletions .eslintignore

This file was deleted.

51 changes: 0 additions & 51 deletions .eslintrc

This file was deleted.

65 changes: 34 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: ci
name: CI

env:
ANALYZE: true

on:
push:
Expand All @@ -11,47 +14,47 @@ on:

jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['20.x']
os: [ubuntu-latest]
name: Build, lint and test
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: 🛒 Checkout Repo
uses: actions/checkout@v4

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v4

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v2
- name: ⚒️ Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install dependencies
- name: Install Dependencies
run: npm run bootstrap

- name: Build Library
run: pnpm --filter ./lib build

- name: Lint
run: pnpm lint
run: pnpm lint --reporter=github

- name: Test:Execute
run: pnpm run test
- name: Run Tests
run: |
pnpm run test
cat ${{github.workspace}}/example/tests/coverage-reports/coverage-summary.md >> $GITHUB_STEP_SUMMARY

- name: Test:Upload
uses: paambaati/[email protected]
- name: Check Package
run: pnpm --filter ./lib run check

- name: Upload Coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: '${{ secrets.CC_TEST_REPORTER_ID }}'
with:
coverageLocations: ${{github.workspace}}/coverage/*.info:lcov
debug: true
workingDirectory: ${{github.workspace}}/lib
coverageLocations: ${{github.workspace}}/example/tests/coverage-reports/*.info:lcov

# Disabled until https://github.com/pnpm/pnpm/issues/6424 is resolved.
# - uses: preactjs/compressed-size-action@v2
# with:
# repo-token: '${{ secrets.GITHUB_TOKEN }}'
# build-script: 'build'
- name: Analyze esbuild bundle size
uses: exoego/esbuild-bundle-analyzer@v1
with:
metafiles: "lib/dist/metafile-esm.json"
29 changes: 29 additions & 0 deletions .github/workflows/publish-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish Preview Release
on:
pull_request:
types: [synchronize]
jobs:
approved:
if: contains(join(github.event.pull_request.labels.*.name, ','), 'publish-preview')
runs-on: ubuntu-latest

steps:
- name: 🛒 Checkout repo
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- name: ⚒️ Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: 📦 Install Dependencies
run: npm run bootstrap

- name: 🔨 Build
run: pnpm run --filter react-image-turntable build

- name: 🚀 Publish Preview Release
run: pnpx pkg-pr-new publish './lib' --template='./example'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ storybook-static
.nyc_output
test-results/
playwright-report/
lib/README.md
lib/LICENSE
3 changes: 0 additions & 3 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm i --frozen-lockfile
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged && pnpm run test:no-coverage
pnpm biome check --staged --files-ignore-unknown=true --write --no-errors-on-unmatched
7 changes: 0 additions & 7 deletions .prettierignore

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
"recommendations": ["biomejs.biome"]
}
25 changes: 4 additions & 21 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.rulers": [100],
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"eslint.packageManager": "pnpm",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.codeActionsOnSave": {
"source.fixAll.biome": "always"
},
"javascript.suggest.autoImports": false,
"typescript.suggest.autoImports": false
"editor.rulers": [100]
}
37 changes: 22 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,44 @@

Thanks for contributing!

## About

The repo is split up into [`lib`](./lib) for the main library code and [`example`](./example) for
demos and testing.

If you're on Windows, it's recommended that you use WSL.

## Standards

- Commits use the [Conventional Commits](https://conventionalcommits.org/) standard
- pnpm to manage dependencies
- [fnm](https://github.com/Schniz/fnm) or [nvm](https://github.com/nvm-sh/nvm) to manage Node.js versions
- EditorConfig and Biome for formatting
- Biome for linting
- Husky for Git hooks

## Getting Started

Ensure you're using the Node version specified in [.nvmrc](./.nvmrc) and run the following to
bootstrap the project:
set up the project:

```sh
npm run dx
npm run bootstrap
```

Then run the following commands in separate terminals:
Then run the following:

```sh
# Run both the library dev build and the `example` repo dev server
pnpm run dev
pnpm -r run start

# Or run them separately
## Start the library dev build
pnpm run start
pnpm run --filter ./lib start
## Start the `example` codebase dev build
pnpm run --prefix example start
pnpm run --filter ./example start
```

## Standards

- Commits use the [Conventional Commits](https://conventionalcommits.org/) standard
- pnpm to manage dependencies
- nvm to manage Node.js versions
- Prettier & EditorConfig for code style
- ESLint for quality
- Husky for Git hooks

## VS Code

If you're using VS Code please make sure you install the [recommended extensions](./.vscode/extensions.json).
Loading
Loading