Sourcehunt-建立一个中等出口商+很酷的新库!

It’s time for our monthly hunt for new open source libraries to use and contribute to!

现在该是我们每月一次寻找使用新的开源库并做出贡献的时候了

If you’re new to Sourcehunt, it’s our monthly post for promoting open source projects that seem interesting or promising and could use help in terms of Github stars or pull requests.

如果您是Sourcehunt的新手,这是我们的月度帖子,用于推广看起来有趣或有前途的开源项目,这些项目可以在Github明星或请求请求方面使用帮助。

It’s our way of giving back – promoting projects that we use (or could use) so that they gain enough exposure to attract a wider audience, a powerful community and, possibly, new contributors or sponsors.

这是我们回馈的方式-推广我们使用(或可以使用)的项目,使它们获得足够的曝光度,以吸引更广泛的受众,强大的社区,并可能吸引新的贡献者或赞助者。

Sourcehunt logo

We’ve had a lot of fantastic submissions this month, so let’s dive in!

这个月我们提交了很多精彩的作品,所以让我们开始吧!



rethinkphp / json-validator [28★] (rethinkphp/json-validator [28 ★])

A Json Validator that designed to be elegant and easy to use.

一个Json验证器,设计优雅且易于使用。

Made by the author of the Blink framework, json-validator’s only purpose is to make sure a data structure conforms to the pre-defined specification. It currently supports int, double, bool, string, number, array, and object, but also lets you define fully custom types, like so:

Blink框架的作者制作,json-validator的唯一目的是确保数据结构符合预定义的规范。 它目前支持int,double,bool,string,number,array和object,但也允许您定义完全自定义的类型,如下所示:

$validator->defineType('User', [
    'name' => 'string',
    'gender' => 'string',
    'age' => '?integer',
]);

You can also define them in callables:

您还可以在可调用对象中定义它们:

$validator->defineType('timestamp', function ($value) {
    if ((!is_string($value) && !is_numeric($value)) || strtotime($value) === false) {
        return false;
    }

    $date = date_parse($value);

    return checkdate($date['month'], $date['day'], $date['year']);
});

The library is very new and could use contributions – everything from the docs to features needs work, so it’s a great opportunity to contribute.

该库非常新,可以使用贡献-从文档到功能的所有内容都需要工作,因此这是一个很好的贡献机会。



书呆子/博客 [20★] (Nerdmind/Blog [20 ★])

This minimalistic and mobile-friendly blogging engine, while leaving much to be desired in the visual department, is a practical quick-fix for anyone looking to start a blog without the baggage of larger system weighing them down.

这个简约且易于移动的博客引擎,尽管在视觉部门仍有很多需求,但对于希望创建博客而又无需大型系统负担的人,这是一个实用的快速解决方案。

It does seem somewhat like a learning experience for the author, so why not jump in, identify some issues (lots of antipatterns right off the bat), and maybe fix some while you’re at it? Perhaps both of you can learn from the experience.

对于作者而言,这似乎有点像是一种学习经历,那么为什么不介入,找出一些问题(马上就有很多反模式),或者也许在您解决时就解决一些问题呢? 也许你们两个都可以从经验中学到东西。



violet-php / streaming-json-encoder [125★] (violet-php/streaming-json-encoder [125 ★])

This streaming JSON encoder lets you process and send large JSON files without hitting the memory limit. As described in the README:

这种流式JSON编码器使您可以处理和发送大型JSON文件,而不会达到内存限制。 如自述文件所述:

Streaming JSON Encoder is a PHP library that provides a set of classes to help with encoding JSON in a streaming manner, i.e. allowing you to encode the JSON document bit by bit rather than encoding the whole document at once. Compared to the built in json_encode function, there are two main advantages:

流JSON Encoder是一个PHP库,它提供了一组类,以帮助以流方式对JSON进行编码,即允许您一点一点地对JSON文档进行编码,而不是一次对整个文档进行编码。 与内置的json_encode函数相比,有两个主要优点:

  • You will not need to load the entire data set into memory, as the encoder supports iterating over both arrays and any kind of iterators, like generators, for example.

    您无需将整个数据集加载到内存中,因为编码器支持在数组和任何种类的迭代器(例如生成器)上进行迭代。
  • You will not need to load the entire resulting JSON document into the memory, since the JSON document will be encoded value by value and it’s possible to output the encoded document piece by piece.

    您将不需要将整个生成的JSON文档加载到内存中,因为JSON文档将按值进行编码,并且可以逐段输出编码的文档。

It also provides a PSR-7 compatible stream for those kinds of frameworks.

它还为那些类型的框架提供了与PSR-7兼容的流。

The package could use more tutorials, tests, and usage examples, so get on it if you’re eager – we’ll pay!

该软件包可能会使用更多的教程,测试和用法示例,因此如果您急切需要继续使用它- 我们将付款



dsentker / phpinsights [2★] (dsentker/phpinsights [2 ★])

This simple but effective wrapper around Google PageSpeed Insights is incredibly useful for testing pipelines when you want to track your pagespeed score across time or commit.

当您想跨时间或提交来跟踪Pagespeed得分时,这种围绕Google PageSpeed Insights的简单但有效的包装方法对于测试管道非常有用。

$uri = 'http://example.com';
$caller = new \PhpInsights\InsightsCaller('your-google-api-key-here', 'de');
$response = $caller->getResponse($uri, \PhpInsights\InsightsCaller::STRATEGY_MOBILE);
$result = $response->getMappedResult();

var_dump($result->getSpeedScore()); // 100 
var_dump($result->getUsabilityScore()); // 100

Note that you need to get an API key from the Google Dev console before you can use it.

请注意,您需要先从Google Dev控制台获取API密钥,然后才能使用它。

Right now, it needs more tests, so if your TDD-fu is weak, here’s a chance to refresh it!

现在,它需要更多的测试,因此,如果您的TDD-fu较弱,则有机会对其进行刷新!



lazychaser / laravel-nestedset [847★] (lazychaser/laravel-nestedset [847 ★])

A fairly popular library already, laravel-nestedset provides Laravel users with a very approachable and incredibly versatile solution to working with nested sets.

laravel-nestedset已经是一个非常流行的库,它为Laravel用户提供了一个非常平易近人且用途广泛的解决方案,用于处理嵌套集。

As the repo states, it is a way to effectively store hierarchical data in a relational table, and shows good performance when tree is updated rarely. It is tuned to be fast for getting related nodes and ideally suited for building multi-depth menus or categories for shops.

如回购所示,这是一种有效地将层次结构数据存储在关系表中的方法,并且在很少更新树时显示出良好的性能。 调整后可以快速获取相关节点,非常适合为商店构建多深度菜单或类别。

The library is feature-rich, including but not limited to reversed tree retrieval, appending and prepending to any parent level, dealing with siblings, flattening, and more.

该库功能丰富,包括但不限于反向树检索,在任何父级之前附加和前置,处理同级,展平等等。

Right now, it has 15 issues that need attention – go and give them a hand if you can, will you?

现在,它有15个需要注意的问题–如果可以,请去帮助他们,对吗?



jmespath / jmespath.php [238★] (jmespath/jmespath.php [238 ★])

While we’re still on the JSON train, let’s hop onto this wagon.

当我们仍在JSON火车上时,让我们跳上这辆马车。

This package by Michael Dowling of Guzzle fame allows you to “declaratively specify how to extract elements from a JSON document“. Here’s what this means exactly, in code:

这个由Guzzle成名的Michael Dowling制作软件包允许您“以声明方式指定如何从JSON文档中提取元素 ”。 这就是在代码中的确切含义:

$expression = 'foo.*.baz';

$data = [
    'foo' => [
        'bar' => ['baz' => 1],
        'bam' => ['baz' => 2],
        'boo' => ['baz' => 3]
    ]
];

JmesPath\search($expression, $data);
// Returns: [1, 2, 3]

Essentially, you define expressions via which you can traverse and extract very complex JSON structures with little to no effort.

本质上,您可以定义表达式,通过它们可以轻松地遍历和提取​​非常复杂的JSON结构。

There are some outstanding issues and pull requests one could look at, but we’re more interested in paying you for intricate usage examples. Dive in!

存在一些悬而未决的问题和拉取请求,但我们更愿意向您支付复杂的使用示例 。 潜入!



lubusIN / laravel分解器 [182★] (lubusIN/laravel-decomposer [182 ★])

Like the README succinctly puts it:

就像README简洁地指出的那样:

Laravel Decomposer decomposes and lists all the installed packages and their dependencies along with the Laravel & the Server environment details your app is running in. Decomposer also generates a markdown report from those details that can be used for troubleshooting purposes, also it allows you to generate the same report as an array anywhere in your code.

Laravel Decomposer分解并列出所有已安装的软件包及其依赖项,以及您的应用程序正在其中运行的Laravel和Server环境的详细信息。Decomposer还会从这些详细信息中生成降价报告,这些报告可用于进行故障排除,还允许您生成与代码在代码中任何位置的报告相同。

While definitely a niche product, this package will no doubt find its use in various non-technical scenarios where a project’s dependency setup needs to be shared with clients or development teams, where server environment variables are not obvious and need to be exposed, when users collect bug contexts, and more – a simple exposed endpoint publishing this data would provide answers to many questions developers simply must ask their clients when debugging.

虽然这绝对是一个小众产品,但该软件包无疑会在各种非技术场景中找到其用处,在这些非技术场景中,需要与客户或开发团队共享项目的依赖关系设置,而当用户使用时,服务器环境变量并不明显并且需要公开收集bug上下文,以及更多–发布该数据的简单公开终结点将为开发人员在调试时必须询问其客户的许多问题提供答案。

I can see it as being especially useful in Laravel-based CMS contexts where plugins and other details could be buried under hundreds of other packages.

我认为它在基于Laravel的CMS上下文中特别有用,在上下文中,插件和其他详细信息可能被埋在数百个其他软件包中。

There’s some todos on the roadmap, so go get some!

路线图中有一些待办事项 ,所以快点去!



ightenco /竖锯 [532★] (tightenco/jigsaw [532 ★])

A static site generator powered by Laravel’s Blade. Jigsaw is like Sculpin or Spress, but built on Laravel instead of on Symfony – which means support for Blade plugins and syntax, and elixir for building assets. Jigsaw also supports Markdown, much like its competitors.

Laravel的Blade驱动的静态站点生成器。 拼图类似于SculpinSpress ,但基于Laravel而非Symfony构建–这意味着支持Blade插件和语法以及用于构建资产的长生不老药。 拼图也像竞争对手一样支持Markdown。

There are some issues and PRs to take care of, and their documentation is lacking as well, so get to it! Also, we need some tutorials about it!

有一些问题和PR需要解决,而且也缺少它们的文档,所以快点做吧! 另外,我们需要一些有关它的教程



slevomat /编码标准 [93★] (slevomat/coding-standard [93 ★])

This coding standard is an extension of the PHP_CodeSniffer Consistence Coding Standard and adds some useful sniffs on top of what’s already there.

该编码标准是PHP_CodeSniffer 一致性编码标准的扩展,并在已有功能的基础上添加了一些有用的嗅探。

It’d be futile to list them all here when they’re so well described in the README – go check! The sniffs are selective, so you can choose not to use those that don’t apply to your project. Most, however, are very handy cross-project rules that every professional dev team should readily enforce.

如果自述文件中对它们都进行了很好的描述,将它们全部列出在这里是徒劳的–请检查! 嗅探是选择性的,因此您可以选择不使用那些不适用于您的项目的嗅探。 但是,大多数都是非常方便的跨项目规则,每个专业开发团队都应立即执行。

Go star it and add it to your development environment and testing pipeline today!

给它加星标,立即将其添加到您的开发环境和测试管道中!



BrainMaestro / composer-git-hooks [95★] (BrainMaestro/composer-git-hooks [95 ★])

Manage git hooks easily in your composer configuration. This package makes it easy to implement a consistent project-wide usage of git hooks. Specifying hooks in the composer file makes them available for every member of the project team. This provides a consistent environment and behavior for everyone.

在您的作曲家配置中轻松管理git hooks。 这个包可以很容易地在项目范围内实现git hooks的一致使用。 在composer文件中指定挂钩可以使项目团队的每个成员都可以使用它们。 这为每个人提供了一致的环境和行为。

If you’re not familiar with a git-hooks-based workflow, we recommend this post and suggest you follow up with any of these – you’ll quickly find that they’re incredibly useful.

如果您不熟悉基于git-hooks的工作流程,我们建议您推荐此帖子,并建议您对其中的任何一个进行后续操作-您会很快发现它们非常有用。

This package makes their maintenance and managing much easier.

该软件包使他们的维护和管理更加容易。



That’s it for March. Found anything you could sink your teeth into?

三月就是这样。 发现什么可以让您的牙齿陷入其中?

As always, please throw your links at us with the #sourcehunt hashtag! If you build something with the projects we’ve mentioned, or if you submit an elaborate pull request you’d like to talk about, give us a shout and we’ll make sure the world knows about it!

与往常一样,请使用#sourcehunt标签将您的链接扔给我们! 如果您使用我们提到的项目构建项目,或者提交您想谈论的详尽请求请求,请向我们喊叫,我们将确保全世界都知道!

Like last time, (that challenge remains unclaimed, by the way – there’s $500 in it for you if you do it!), we’re using the above packages for inspiration on creating a potentially useful app:

就像上次一样,(顺便提一句,这个挑战仍然无人能解决-如果您这样做的话,其中有500美元给您!),我们正在使用以上软件包来启发您创建潜在有用的应用程序:

App+Tutorial idea of the month: Build an app which takes a Medium data export in zip format, processes it internally, turns it into JSON with the Streaming JSON library and verifies that JSON with the validator, and then converts this JSON into a format usable by either NerdMind/Blog or TigthenCo/Jigsaw (user chooses). The project needs to be sniffed with Slevomat/coding-standard, preferrably automatically, and there needs to be a UI in which users can load the aforementioned JSON format (again use the Streaming lib) and apply extraction expressions with jmespath.php to get some data out. Get in touch to find out how much this is worth to us!

本月的App + Tutorial想法:构建一个应用程序,该应用程序以zip格式导出Medium数据,在内部对其进行处理,并使用Streaming JSON库将其转换为JSON,然后使用验证程序验证该JSON,然后将该JSON转换为格式可由NerdMind / Blog或TigthenCo / Jigsaw使用(用户选择)。 该项目需要使用Slevomat / coding-standard进行嗅探,最好自动进行嗅探,并且需要有一个UI,用户可以在其中加载上述JSON格式(再次使用Streaming lib),并使用jmespath.php应用提取表达式以获取一些内容数据输出。 联系我们,以了解这对我们有多少价值!

Happy coding!

祝您编码愉快!

翻译自: https://www.sitepoint.com/sourcehunt-build-medium-exporter-cool-new-libs/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值