I’ve just published my first open source library, Posty!

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #5756
    KeironLowe
    Participant

    I know WordPress isn’t too popular around here, and for good reason, but I wanted to do what I can to try make it a bit better. So I built [Posty](https://github.com/KeironLowe/posty), which provides a fluent API for creating custom post types and managing its columns. Any of you who have built WordPress sites know that there is quite a bit of code required to create a CPT and even more if you want to manage the columns for it.

    I’ve tried to reduce that down and it’s it’s most simplest form, it’s now as simple as `PostyPosty::make(‘Product’, ‘Products’)->register();`.

    Let me know what you think, like I said it’s my first time publishing an open source package so happy for any critique.

    #5757
    Flibbertygibbety22
    Guest

    Nice! Looks really well written – clear code, good documentation, well-written tests. Some suggestions, from somebody that doesn’t know much about WordPress:
    – I don’t know much about the use case, perhaps the README could explain a bit more about when I would want to use this library.
    – WordPress isn’t mentioned in the `composer.json` as a dependency. Is that right?
    – With libraries, I try to keep dependencies to an absolute mininmum, even in dev, to minimise the risk of a blacklisted dependency cascading throughout my application. It feels like `brain/monkey` doesn’t add much, just a bit of syntactic sugar, so I’d probably just write my mocks out the long way and remove the dependency.
    – Could `PostySupportRepository` be an abstract class?
    – I’d remove the `.idea` from the `.gitignore` file, and use that in my personal global `.gitignore` instead.

    Good work on releasing it, I’m sure it will be really useful for some people.

    #5758
    michaelbiberich
    Guest

    Well done. Two small things I’ve noticed:

    * [Github Flavored Markdown](https://github.github.com/gfm/#example-112) supports PHP syntax highlighting (eg to use in your [README.md](https://github.com/KeironLowe/posty/commit/8a660d213719a8b9c5bc59e1c3dea3252dac1e1f#diff-04c6e90faac2675aa89e2176d2eec7d8R18)). [Example](https://github.com/michaelbiberich/turbolinks-location-middleware/commit/4b9dd9f98ad26d0450e5d04c7f95d8bd4fcf6048#diff-04c6e90faac2675aa89e2176d2eec7d8R61).
    * Is there a specific reason to use the `@var` annotations when the [properties are already typed](https://github.com/KeironLowe/posty/blob/master/src/Posty.php#L14) identically?

    Edit: Fixed some typos.

    #5759
    devmor
    Guest

    Though I lack the sanity protections for it, I wholeheartedly support any efforts to bring modern development to WordPress. This Looks like an amazingly built library and I hope other WP developers use it as inspiration.

    #5760
    tehjrow
    Guest

    +1 for the type-hinting and returning `: self` from the setters

    #5761
    theodorePjones
    Guest

    Sorry if this is a dumb question but I’m new to this sub. I need to set up a website for a new business and it will need to have a lot more functionality than something like squarespace or weebly. I have some background with coding so I was planning to use wordpress for the website and code what we need, but you mention wordpress isn’t popular here. Can you elaborate on why? Are there better website tools that I should use?

    #5762
    jsharief
    Guest

    Good luck

    #5763
    theodorePjones
    Guest

    Sorry if this is a dumb question but I’m new to this sub. I need to set up a website for a new business and it will need to have a lot more functionality than something like squarespace or weebly. I have some background with coding so I was planning to use wordpress for the website and code what we need, but you mention wordpress isn’t popular here. Can you elaborate on why? Are there better website tools that I should use?

    #5764
    justlasse
    Guest

    There’s also cpt ui which allows you to output php instead of shipping with the plugin. Perhaps inspiration?

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.