-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
preview implementation of the Laminas ecosystem RFC #226
base: staging
Are you sure you want to change the base?
Changes from 1 commit
da7ec0c
810aef0
c6b5790
0c5b576
4719966
0325362
3b467e2
b2c5860
d188f98
769a70a
7e64063
93ffe62
ae72ceb
646ac54
0dc8ec7
d2f16d2
061cc33
1188098
019c78f
6f6a545
319ac01
902e0d2
d939eac
a913a18
4a7c3f3
bf0f179
16cfffc
9aa4e5b
c312918
832c04b
8d11b86
7e7cf95
4741236
8b1a593
ab35953
fcc8c6c
3fc424b
5730358
0bd2f2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Adding your entry to the Laminas Ecosystem | ||
|
||
You can add packages **available via composer** to the `data/ecosystem/ecosystem-packages.json` file by following the steps below: | ||
|
||
- Entries must use the [template](#new-entry-template) as a guide. | ||
- Submit a PR. | ||
|
||
> Use the following command to make sure your submission will be correctly built: | ||
|
||
```bash | ||
composer build | ||
``` | ||
|
||
> The following command can be run individually for testing: | ||
|
||
```bash | ||
./vendor/bin/laminas ecosystem:create-db | ||
``` | ||
|
||
*Used for creating the database.* | ||
|
||
```bash | ||
./vendor/bin/laminas ecosystem:seed-db | ||
``` | ||
|
||
*Used for updating the package data every X hours.* | ||
|
||
## New entry template | ||
|
||
```json | ||
{ | ||
"packagistUrl": "", | ||
"githubUrl": "", | ||
"categories": [], | ||
"homepage": "" | ||
} | ||
``` | ||
|
||
### New entry fields description | ||
|
||
- `packagistUrl` **required** | ||
**string** - the packagist URL of the entry, with no query parameters | ||
|
||
- `githubUrl` | ||
**string** - optional link to be displayed on the package card | ||
|
||
- `categories` | ||
**array of strings** - user defined keywords used for filtering results | ||
|
||
- `homepage` | ||
**string** - optional URL to package homepage, will overwrite "homepage" field from Packagist Api data |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
'use strict'; | ||
|
||
$(document).ready(function () { | ||
$('.package-button').click(function (e) { | ||
e.preventDefault(); | ||
|
||
const url = new URL(window.location.href); | ||
const params = new URLSearchParams(url.search); | ||
const entry = $(this).data('value'); | ||
|
||
if ($(this).hasClass('tag')) { | ||
if (! params.has("tags[]", entry)) { | ||
params.append("tags[]", entry); | ||
url.search = params.toString(); | ||
|
||
window.location.replace(url.toString()); | ||
} | ||
} | ||
|
||
if ($(this).hasClass('category')) { | ||
if (! params.has("categories[]", entry)) { | ||
params.append("categories[]", entry); | ||
url.search = params.toString(); | ||
|
||
window.location.replace(url.toString()); | ||
} | ||
} | ||
}); | ||
|
||
$('.ecosystem-filter').click(function (e) { | ||
e.preventDefault(); | ||
|
||
const url = new URL(window.location.href); | ||
const params = new URLSearchParams(url.search); | ||
const entry = $(this).data('value'); | ||
|
||
if ($(this).hasClass('tag')) { | ||
if (params.has("tags[]", entry)) { | ||
params.delete("tags[]", entry); | ||
url.search = params.toString(); | ||
|
||
window.location.replace(url.toString()); | ||
} | ||
} | ||
|
||
if ($(this).hasClass('category')) { | ||
if (params.has("categories[]", entry)) { | ||
params.delete("categories[]", entry); | ||
url.search = params.toString(); | ||
|
||
window.location.replace(url.toString()); | ||
} | ||
} | ||
}); | ||
|
||
[...$('#ecosystem-pagination a')].forEach(a => { | ||
const url = new URL(a.href) | ||
for (let [k,v] of new URLSearchParams(window.location.search).entries()) { | ||
if (k === 'tags[]' || k === 'categories[]' || k === 'q') { | ||
url.searchParams.set(k,v) | ||
} | ||
} | ||
a.href = url.toString(); | ||
}) | ||
|
||
$('#ecosystem-search').keypress(function (e) { | ||
const search = $(this).val(); | ||
if (e.which === 13) { | ||
setSearchQuery(search); | ||
} | ||
}); | ||
|
||
$('#ecosystem-search-btn').click(function (e) { | ||
const search = $('#ecosystem-search').val(); | ||
setSearchQuery(search); | ||
}); | ||
|
||
function setSearchQuery(search) { | ||
const url = new URL(window.location.href); | ||
|
||
url.searchParams.set('q', search); | ||
window.location.replace(url.toString()); | ||
} | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[ | ||
{ | ||
"packagistUrl": "https://packagist.org/packages/akrabat/ip-address-middleware", | ||
"githubUrl": "https://github.com/akrabat/ip-address-middleware", | ||
"categories": ["ip", "address", "middleware"], | ||
"homepage": "" | ||
}, | ||
{ | ||
"packagistUrl": "https://packagist.org/packages/netglue/laminas-messenger", | ||
"githubUrl": "https://github.com/netglue/laminas-messenger", | ||
"categories": ["laminas", "messenger"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "laminas" does not make sense here, because we need to differentiate between integration in Mezzio-based and/or laminas-mvc-based applications. This means that the package can be used as a:
Maybe the categories are not suitable for this and a separate entry or entries are required. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the moment the "categories" key is only used for filtering in the interface, so I added a few here and there so they'll be visible in the preview - once a new role is found for them, I can upgrade the functionality to fit the request of course. Even if the current approach of "user defined keywords" is kept, some other guidelines could be defined for them if wanted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to brainstorm a bit about those possible categories. |
||
"homepage": "" | ||
}, | ||
{ | ||
"packagistUrl": "https://packagist.org/packages/dotkernel/dot-errorhandler", | ||
"githubUrl": "https://github.com/dotkernel/dot-errorhandler", | ||
"categories": ["error-handling"], | ||
"homepage": "https://dotkernel.com" | ||
}, | ||
{ | ||
"packagistUrl": "https://packagist.org/packages/roave/psr-container-doctrine", | ||
"githubUrl": "", | ||
"categories": ["middleware", "doctrine"], | ||
"homepage": "" | ||
}, | ||
{ | ||
"packagistUrl": "https://packagist.org/packages/asgrim/mini-mezzio", | ||
"githubUrl": "https://github.com/asgrim/mini-mezzio", | ||
"categories": ["mezzio"], | ||
"homepage": "" | ||
}, | ||
{ | ||
"packagistUrl": "https://packagist.org/packages/phly/phly-simple-page", | ||
"categories": [], | ||
"homepage": "https://github.com/phly/PhlySimplePage" | ||
}, | ||
{ | ||
"packagistUrl": "https://packagist.org/packages/mezzio/mezzio-aurarouter", | ||
"categories": [], | ||
"homepage": "" | ||
} | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vanilla JavaScript is good in 2024 and it should be dropped when we move to Bootstrap 5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I saw jquery was already added as a dependency and went with it, but I'll go ahead and refactor