Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Jun 4, 2024
2 parents dcc70e7 + 421753a commit 1bed382
Show file tree
Hide file tree
Showing 40 changed files with 293 additions and 11,511 deletions.
8 changes: 2 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ Here are a few useful information for contributors:
the [locales readme instructions here](https://github.com/ddnexus/pagy/blob/master/gem/locales/README.md).
3. **Pagy repo setup**
- Clone pagy: `git clone https://github.com/ddnexus/pagy && cd pagy`
- Install the gems: `bundle install`
- Install node if not present...
- Optional: install pnpm. It's better if you use corepack to get the right version from package.json
([instructions](https://pnpm.io/installation#using-corepack))
- Install modules: `npm install` (or `pnpm install`)
4. **Development**
- Please create your own branch out of `master` and use it for you development and PR
- Ensure you are basing your PR on the `master` branch and keep rebasing it on `master` when it changes
Expand All @@ -25,7 +20,8 @@ Here are a few useful information for contributors:
with the [Pagy::Console](https://ddnexus.github.io/pagy/docs/api/console/) directly from the repo
- **Docs**
- `cd` in the pagy root directory
- Run `npm install` or (`pnpm install` if pnpm is installed).
- Install [bun](https://bun.sh/docs/installation)
- Run `bun install`
- Run `retype start`
- Point your browser at `http://localhost:5000/pagy` for real-time feedback
5. **Testing**
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ body:
attributes:
label: 👀 Before submitting...
options:
- label: I upgraded to pagy version 8.4.1
- label: I upgraded to pagy version 8.4.2
required: true
- label: I searched through the [Documentation](https://ddnexus.github.io/pagy/)
required: true
Expand Down
7 changes: 3 additions & 4 deletions .github/latest_release_body.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
the [details](https://github.com/ddnexus/pagy/discussions/672#discussioncomment-9212328))
- See the [CHANGELOG](https://ddnexus.github.io/pagy/changelog) for possible breaking changes

### Changes in 8.4.1
### Changes in 8.4.2

<!-- changes start -->
- Fix pagy.in in pagy_get_items method introduced in 8.4.0 (see #696) (closes #704) (closes #708) (#707)
- Fix renamed Frontend Helpers to JS Tools and typo `next_a` "aria-label" (#700)
- Fix rubocop
- Limit the playground --rerun option to linux platforms
- Simplify and improve the js environment by using bun
<!-- changes end -->

[CHANGELOG](https://ddnexus.github.io/pagy/changelog)
17 changes: 7 additions & 10 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
"gem/**",
"e2e/**",
"Gemfile.lock",
"pnpm.lock.yaml"
"bun.lockb"
]'
paths_ignore: '[
"gem/config/**",
Expand All @@ -51,20 +51,17 @@ jobs:
with:
ruby-version: '3.3'
bundler-cache: true
- name: Install Pnpm
uses: pnpm/action-setup@v4
- name: Install Node / Setup Pnpm Cache
uses: actions/setup-node@v4
- name: Install bun
uses: oven-sh/setup-bun@v1
with:
node-version: 20
cache: 'pnpm'
bun-version: latest
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Setup Cypress Cache
uses: actions/cache@v4
with:
path: /home/runner/.cache/Cypress
key: ${{ runner.os }}-cypress-cache-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install Dependencies
run: pnpm install --frozen-lockfile
key: ${{ runner.os }}-cypress-cache-${{ hashFiles('bun.lockb') }}
- name: Cypress [${{ matrix.app }}] Test
uses: cypress-io/github-action@v6
with:
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@
/coverage/
/gem/pkg/
node_modules/
pnpm/
tmp/
/retype.manifest
.pnpm-debug.log
8 changes: 5 additions & 3 deletions .idea/runConfigurations/npm_check.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ AllCops:
- gem/lib/pagy/extras/materialize.rb
- gem/lib/pagy/extras/semantic.rb
- gem/lib/pagy/extras/uikit.rb
- pnpm/**/*
- src/**/*
- vendor/**/* # fix the problem with github ruby

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ If you upgrade from version `< 8.0.0` see the following:

<hr>

## Version 8.4.2

- Limit the playground --rerun option to linux platforms
- Simplify and improve the js environment by using bun

## Version 8.4.1

- Fix pagy.in in pagy_get_items method introduced in 8.4.0 (see #696) (closes #704) (closes #708) (#707)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: gem
specs:
pagy (8.4.1)
pagy (8.4.2)

GEM
remote: https://rubygems.org/
Expand Down
Binary file added bun.lockb
Binary file not shown.
38 changes: 0 additions & 38 deletions docs/api/javascript/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,44 +65,6 @@ Your app needs standard script or old browser compatibility
script_path = Pagy.root.join('javascripts', 'pagy.js')
```

<details>
<summary> Browser compatibility list: </summary>

- and_chr 103
- and_ff 101
- and_qq 10.4
- and_uc 12.12
- android 103
- chrome 103
- chrome 102
- chrome 101
- edge 103
- edge 102
- firefox 102
- firefox 101
- firefox 91
- ios_saf 15.5
- ios_saf 15.4
- ios_saf 15.2-15.3
- ios_saf 14.5-14.8
- ios_saf 14.0-14.4
- ios_saf 12.2-12.5
- kaios 2.5
- op_mini all
- op_mob 64
- opera 87
- opera 86
- opera 85
- safari 15.5

!!! info
You can generate custom targeted `pagy.js` files for the browsers you want to support by changing
the [browserslist](https://github.com/browserslist/browserslist) query in `src/package.json`, then compile it
with `cd src && npm run build`.
!!!

</details>

+++ `pagy-dev.js`

!!! success
Expand Down
5 changes: 4 additions & 1 deletion e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ enabled ASAP.

## 2. Run E2E Tests On Your System

Run `npm install` or (`pnpm install` if `pnpm` is installed).
The test environment uses [bun](https://bun.sh) ([cypress still needs node ATM](https://github.com/cypress-io/cypress/issues/28962) )
- Install [bun](https://bun.sh/docs/installation)
- Optional for updating: install `npm-check`: `bun install -g npm-check`.
- Install modules: `bun install`

### Run the test for all the apps

Expand Down
6 changes: 3 additions & 3 deletions e2e/cy-test
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ cd -- "$(dirname "$0")"

test () {
NODE_NO_WARNINGS=1 \
pnpm exec start-test "bundle exec pagy $app -p $port -q > /dev/null" http://0.0.0.0:$port \
"pnpm exec cypress run --quiet --config baseUrl=http://0.0.0.0:$port --spec cypress/e2e/$app.cy.ts"
start-test "bundle exec pagy $app -p $port -q > /dev/null" "http://0.0.0.0:$port" \
"cypress run --quiet --config baseUrl=http://0.0.0.0:$port --spec cypress/e2e/$app.cy.ts"
}

if [[ -z $app ]]
then
for app in demo repro rails calendar
do
port=$[port+1]
port=$((port+1))
test &
done
for p in $(jobs -p)
Expand Down
37 changes: 17 additions & 20 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
{
"name": "pagy.e2e",
"description": "Pagy E2E Testing",
"private": true,
"type": "module",
"engines": {
"node": ">=20.9.0"
},
"devDependencies": {
"@cypress/snapshot": "^2.1.7",
"@types/node": "20.13.0",
"cypress": "13.10.0",
"cypress-html-validate": "6.1.0",
"eslint-plugin-cypress": "3.3.0",
"eslint-plugin-promise": "6.2.0",
"html-validate": "8.19.1",
"start-server-and-test": "2.0.3"
},
"scripts": {
"lint-fix": "eslint --fix cypress --ext .ts"
}
"name": "pagy.e2e",
"description": "Pagy E2E Testing",
"private": true,
"type": "module",
"devDependencies": {
"@cypress/snapshot": "^2.1.7",
"@types/node": "20.14.0",
"cypress": "13.10.0",
"cypress-html-validate": "6.1.0",
"eslint-plugin-cypress": "3.3.0",
"eslint-plugin-promise": "6.2.0",
"html-validate": "8.20.0",
"start-server-and-test": "2.0.3"
},
"scripts": {
"lint-fix": "eslint --fix cypress --ext .ts"
}
}
2 changes: 1 addition & 1 deletion gem/apps/calendar.ru
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#4-calendar-app

VERSION = '8.4.1'
VERSION = '8.4.2'

require 'bundler/inline'
require 'bundler'
Expand Down
2 changes: 1 addition & 1 deletion gem/apps/demo.ru
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#3-demo-app

VERSION = '8.4.1'
VERSION = '8.4.2'

require 'bundler/inline'
require 'bundler'
Expand Down
2 changes: 1 addition & 1 deletion gem/apps/rails.ru
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#2-rails-app

VERSION = '8.4.1'
VERSION = '8.4.2'

# Gemfile
require 'bundler/inline'
Expand Down
2 changes: 1 addition & 1 deletion gem/apps/repro.ru
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#1-repro-app

VERSION = '8.4.1'
VERSION = '8.4.2'

require 'bundler/inline'
require 'bundler'
Expand Down
13 changes: 8 additions & 5 deletions gem/bin/pagy
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

VERSION = '8.4.1'
VERSION = '8.4.2'
APPS = %w[repro rails demo calendar].freeze
LINUX = RbConfig::CONFIG['host_os'].include?('linux')

require_relative '../lib/optimist'
opts = Optimist.options do
Expand All @@ -28,9 +29,11 @@ opts = Optimist.options do
opt :host, 'Host', default: '0.0.0.0', short: :o
opt :port, 'Port', default: 8000
opt :install, 'Install bundle for users', default: true
text 'Rerun options'
opt :rerun, 'Enable rerun for development', default: true
opt :clear, 'Clear screen before each rerun'
if LINUX
text 'Rerun options'
opt :rerun, 'Enable rerun for development', default: true
opt :clear, 'Clear screen before each rerun'
end
text 'Other options'
opt :quiet, 'Quiet mode for development'
version VERSION
Expand All @@ -48,7 +51,7 @@ Bundler.configure
gemfile(opts[:install]) do
source 'https://rubygems.org'
gem 'rackup'
gem 'rerun'
gem 'rerun' if LINUX
end

path = ->(app) { File.expand_path("../apps/#{app}.ru", __dir__) }
Expand Down
2 changes: 1 addition & 1 deletion gem/config/pagy.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Pagy initializer file (8.4.1)
# Pagy initializer file (8.4.2)
# Customize only what you really need and notice that the core Pagy works also without any of the following lines.
# Should you just cherry pick part of this file, please maintain the require-order of the extras

Expand Down
Loading

0 comments on commit 1bed382

Please sign in to comment.