Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Apr 2, 2024
2 parents 550ea1b + 4bbceaf commit d40806e
Show file tree
Hide file tree
Showing 146 changed files with 209 additions and 311 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Before spending time creating a (potentially complex) Pull Request, you can [Con
If you Create A Pull Request, please ensure that the "All checks have passed" indicator gets green light on the Pull Request page (if it's not enabled, a maintainer will enable it for you).

For adding translations of locale dictionary files please follow
the [locales readme instructions here.](https://github.com/ddnexus/pagy/blob/master/lib/locales/README.md).
the [locales readme instructions here.](https://github.com/ddnexus/pagy/blob/master/gem/locales/README.md).

Thank you!
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.0.0
- label: I upgraded to pagy version 8.0.1
required: true
- label: I searched through the [Documentation](https://ddnexus.github.io/pagy/)
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/latest_release_body.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We may drop pagy's less used CSS extras.

If you wish to keep your favorites alive, please, [vote here](https://github.com/ddnexus/pagy/discussions/categories/survey)

### ✴ What's new in 8.0.0
### ✴ What's new in 8.+

- Better frontend helpers
- New [Pagy Playground](https://ddnexus.github.io/pagy/playground/) to showcase, clone and develop pagy APPs without any setup on
Expand Down
4 changes: 2 additions & 2 deletions .idea/runConfigurations/Calendar.xml

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

4 changes: 2 additions & 2 deletions .idea/runConfigurations/Demo.xml

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

2 changes: 1 addition & 1 deletion .idea/runConfigurations/IRB_pagy.xml

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

2 changes: 1 addition & 1 deletion .idea/runConfigurations/Rails.xml

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

6 changes: 3 additions & 3 deletions .idea/runConfigurations/Repro.xml

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

6 changes: 3 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ AllCops:
# "Unable to find gem panolint; is the gem installed? Gem::MissingSpecError" in all ruby versions
- vendor/bundle/**/*
- pnpm/**/*
- lib/optimist.rb
- gem/lib/optimist.rb

Layout/LineLength:
Max: 130
Expand All @@ -30,11 +30,11 @@ Layout/ExtraSpacing:
Enabled: true
Exclude:
- test/**/*
- lib/bin/pagy
- gem/bin/pagy

Layout/EmptyLines:
Exclude:
- lib/config/pagy.rb
- gem/config/pagy.rb

Layout/BlockAlignment:
Enabled: false
Expand Down
26 changes: 13 additions & 13 deletions .simplecov
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ SimpleCov.start do
merge_timeout 60
enable_coverage :branch

add_group 'All Extras', %w[lib/pagy/extras]
add_group 'Core', %w[lib/pagy.rb
lib/pagy/backend.rb
lib/pagy/console.rb
lib/pagy/countless.rb
lib/pagy/exceptions.rb
lib/pagy/frontend.rb
lib/pagy/i18n.rb
lib/pagy/url_helpers.rb]
add_group 'Countless', %w[lib/pagy/countless.rb
lib/pagy/extras/countless.rb]
add_group 'Calendar', %w[lib/pagy/extras/calendar.rb
lib/pagy/calendar]
add_group 'All Extras', %w[gem/lib/pagy/extras]
add_group 'Core', %w[gem/lib/pagy.rb
gem/lib/pagy/backend.rb
gem/lib/pagy/console.rb
gem/lib/pagy/countless.rb
gem/lib/pagy/exceptions.rb
gem/lib/pagy/frontend.rb
gem/lib/pagy/i18n.rb
gem/lib/pagy/url_helpers.rb]
add_group 'Countless', %w[gem/lib/pagy/countless.rb
gem/lib/pagy/extras/countless.rb]
add_group 'Calendar', %w[gem/lib/pagy/extras/calendar.rb
gem/lib/pagy/calendar]
# add_filter "/test/"
add_group 'Tests', %w[test]
end
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ If you upgrade from version `< 8.0.0` see the following:
None
<hr>

## Version 8.0.1

- Reorganize the gem root dir: it was the lib dir (containing everything), now is the gem dir (containing lib and everything else).
- Fix broken link in README

## Version 8.0.0

### Breaking changes
Expand All @@ -45,7 +50,9 @@ None
templates or helper overrides. See the complete changes below if you notice any cosmetic changes or get some exception.
- The `navs` and `support` extras has been merged into the new [pagy extra](https://ddnexus.github.io/pagy/docs/extras/pagy).
Search for `"extra/navs"` and
`"extras/support"` and replace with `"extras/pagy"` (remove the duplicate if you used both)
`"extras/support"` and replace with `"extras/pagy"` (remove the duplicate if you used both)
- The build path for javascript builders has moved from the `lib` to the `gem` dir so the correct setup in `package.json` is:
`build: "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" <your original command>"`

### Changes

Expand Down
2 changes: 1 addition & 1 deletion docs/api/ARIA.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ page number). It's arguably a better description of the nav content than just "P
languages).

!!!success Help us with your languages!
Please, check the `pagy.aria_label.nav` in the [locale files](https://github.com/ddnexus/pagy/tree/master/lib/locales)
Please, check the `pagy.aria_label.nav` in the [locale files](https://github.com/ddnexus/pagy/tree/master/gem/locales)
used by your app to be already correctly translated and pluralized. If it's not, please, post your translation in the issue linked
in the file itself. Thank you!
!!!
Expand Down
6 changes: 3 additions & 3 deletions docs/api/backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description: This module provides the base functionality for the backend.

# Pagy::Backend

This module _(see [source](https://github.com/ddnexus/pagy/blob/master/lib/pagy/backend.rb))_ provides a _generic_ pagination
method (`pagy`) that works with `ActiveRecord` out of the box. For any other collection (e.g. `Sequel`, `Mongoid`, ...) you may
need to override some sub-method or [write your own Pagy methods](#writing-your-own-pagy-methods).
This module provides a _generic_ pagination method (`pagy`) that works with `ActiveRecord` out of the box. For any other
collection (e.g. `Sequel`, `Mongoid`, ...) you may need to override some sub-method
or [write your own Pagy methods](#writing-your-own-pagy-methods).

For overriding convenience, the `pagy` method calls two sub-methods that you may need to override in order to customize it for any
type of collection (e.g. different ORM types, etc.).
Expand Down
8 changes: 1 addition & 7 deletions docs/api/calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ with the quarter (1-4).
## DEFAULT variables

The calendar defaults are not part of the `Pagy::DEFAULT` variables. Each subclass has its own `Pagy::Calendar::*::DEFAULT`
variable hash that you can set independently. See the [pagy.rb](https://github.com/ddnexus/pagy/blob/master/lib/config/pagy.rb)
configuration file for details.
variable hash that you can set independently. See the pagy initializer file for details.

## Attribute Readers

Expand Down Expand Up @@ -99,11 +98,6 @@ scope, `ActiveRecord` converts it for you.
Set the `Date.beginning_of_week` toto the symbol of the first day of the week (e.g. `Date.beginning_of_week = :sunday`). Notice
the default is `:monday` consistently with the ISO-8601 standard (and Rails).

## Files

- [calendar.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/calendar.rb)
- [calendar units](https://github.com/ddnexus/pagy/blob/master/lib/pagy/calendar/)

## Methods

==- `label(opts = {})`
Expand Down
7 changes: 3 additions & 4 deletions docs/api/countless.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ category:

# Pagy::Countless

This is a `Pagy` subclass (see [source](https://github.com/ddnexus/pagy/blob/master/lib/pagy/countless.rb)) that provides
pagination without the need of any `:count`.
This is a `Pagy` subclass that provides pagination without the need of any `:count`.

That may be especially useful in the following scenarios:

Expand All @@ -18,7 +17,7 @@ That may be especially useful in the following scenarios:
- when the full nav-bar is not a requirement and/or performance is more desirable

This class provides support for extras that don't need the full set of pagination support or need to avoid the `:count` variable (
e.g. the [countless](/docs/extras/countless.md) extra). The class API is documented here, however you should not need to use this
e.g. the [countless extra](/docs/extras/countless.md)). The class API is documented here, however you should not need to use this
class directly because it is required and used internally by the extra.

## Caveats
Expand Down Expand Up @@ -65,7 +64,7 @@ exception.

Retrieving these variables may be useful to supply a UI as complete as possible, when used with classic helpers, and can be
skipped when it's not needed (like for navless pagination, infinite-scroll, etc.). See
the [countless.rb extra](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/countless.rb) for more details.
the [countless extra](/docs/extras/countless.md) for more details.

## Methods

Expand Down
2 changes: 1 addition & 1 deletion docs/api/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ categories:

This module provides a few methods to deal with the navigation aspect of the pagination.

You will usually include it in some helper module, making its methods available (and overridable) in your views. _([source](https://github.com/ddnexus/pagy/blob/master/lib/pagy/frontend.rb))_
You will usually include it in some helper module, making its methods available (and overridable) in your views.

You can extend this module with a few more nav helpers _(see the [extras](/categories/extra) doc for more details)_

Expand Down
8 changes: 4 additions & 4 deletions docs/api/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ See [i18n extra](/docs/extras/i18n.md) if you need to use the slower standard `i

Pagy provides many ready-to-use dictionaries for different locales/languages usable with single or multi languages apps.

All the pagy strings are stored in the dictionary files of its [locales](https://github.com/ddnexus/pagy/blob/master/lib/locales),
All the pagy strings are stored in the dictionary files of its [locales](https://github.com/ddnexus/pagy/blob/master/gem/locales),
ready to be customized and/or used with or without the `I18n` gem. The files follow the same structure of the standard locale
files for the `i18n` gem.

!!!success PRs Welcome!
If you are using pagy with some language missing from the [locales](https://github.com/ddnexus/pagy/blob/master/lib/locales),
If you are using pagy with some language missing from the [locales](https://github.com/ddnexus/pagy/blob/master/gem/locales),
please, [submit your translation](https://github.com/ddnexus/pagy/pulls)!
!!!

Expand Down Expand Up @@ -110,5 +110,5 @@ and [How to customize the item name](/docs/how-to.md#customize-the-item-name))_
## Contribute a language

If you wish to add a new locale to
pagy ([see existing locales in the lib/locales directory](https://github.com/ddnexus/pagy/tree/master/lib/locales)) please follow
the [locales readme instructions here.](https://github.com/ddnexus/pagy/blob/master/lib/locales/README.md).
pagy ([see existing locales in the lib/locales directory](https://github.com/ddnexus/pagy/tree/master/gem/locales)) please follow
the [locales readme instructions here.](https://github.com/ddnexus/pagy/blob/master/gem/locales/README.md).
15 changes: 8 additions & 7 deletions docs/api/javascript/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ Your app uses modern build tools

* ES6 module to use with webpacker, esbuild, parcel, etc.

_ESM File: [pagy-module.js](https://github.com/ddnexus/pagy/blob/master/lib/javascripts/pagy-module.js);
Types: [pagy-module.d.ts](https://github.com/ddnexus/pagy/blob/master/lib/javascripts/pagy-module.d.ts)_
[!file](/gem/javascripts/pagy-module.js)

[!file](/gem/javascripts/pagy-module.d.ts)

+++ `pagy.js`
!!! success
Expand All @@ -49,7 +50,7 @@ Your app needs standard script or old browser compatibility
production pages and without any further processing
* Minified (~2k) and polyfilled to work also with quite old browsers

_JS File: [pagy.js](https://github.com/ddnexus/pagy/blob/master/lib/javascripts/pagy.js)_
[!file](/gem/javascripts/pagy.js)

<details>
<summary> Browser compatibility list: </summary>
Expand Down Expand Up @@ -102,7 +103,7 @@ You need to debug the javascript helpers
* It works only on new browsers
!!!

_JS File: [pagy-dev.js](https://github.com/ddnexus/pagy/blob/master/lib/javascripts/pagy-dev.js)_
[!file](/gem/javascripts/pagy-dev.js)
+++

### 2. Configure
Expand Down Expand Up @@ -166,15 +167,15 @@ unless Rails.env.production?
Prepend the `NODE_PATH` environment variable to the `scripts.build` command:
```json package.json
{
"build": "NODE_PATH=\"$(bundle show 'pagy')/lib/javascripts\" <your original command>"
"build": "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" <your original command>"
}
```

+++ Webpack
Prepend the `NODE_PATH` environment variable to the `scripts.build` command:
```json package.json
{
"build": "NODE_PATH=\"$(bundle show 'pagy')/lib/javascripts\" <your original command>"
"build": "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" <your original command>"
}
```

Expand Down Expand Up @@ -214,7 +215,7 @@ import './pagy.js.erb'
Prepend the `NODE_PATH` environment variable to the `scripts.build` command:
```json package.json
{
"build": "NODE_PATH=\"$(bundle show 'pagy')/lib/javascripts\" <your original command>"
"build": "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" <your original command>"
}
```

Expand Down
4 changes: 2 additions & 2 deletions docs/api/pagy.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ categories:
The scope of the `Pagy` class is keeping track of the all integers and variables involved in the pagination. It basically takes a
few integers (such as the count of the collection, the page number, the items per page, ...), does some simple arithmetic and
creates a very small object that allocates less than 3k of
memory ([source](https://github.com/ddnexus/pagy/blob/master/lib/pagy.rb)).
memory.

## Synopsis

Expand Down Expand Up @@ -61,7 +61,7 @@ Pagy::DEFAULT.freeze

==- `Pagy.root`

This method returns the `pathname` of the `pagy/lib` root dir. It is useful to get the absolute path of locale and javascript
This method returns the `pathname` of the `pagy/gem` root dir. It is useful to get the absolute path of locale and javascript
files installed with the gem.

==- `Pagy.new(vars)`
Expand Down
Loading

0 comments on commit d40806e

Please sign in to comment.