Skip to content

Commit

Permalink
Merge pull request #6 from artisan-community/create-package-skeleton
Browse files Browse the repository at this point in the history
Create package skeleton
  • Loading branch information
edgrosvenor authored Jan 10, 2025
2 parents 16a16fb + 71ce2b0 commit 561e8f3
Show file tree
Hide file tree
Showing 31 changed files with 612 additions and 9 deletions.
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"$schema": "https://getcomposer.org/schema.json",
"name": "laravel/laravel",
"name": "artisan-build/kibble-app",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"description": "Artisan Build's Package Management Application",
"keywords": [
"laravel",
"framework"
],
"license": "MIT",
"license": "proprietary",
"require": {
"php": "^8.2",
"php": "^8.3",
"artisan-build/bench": "*",
"artisan-build/docsidian": "*",
"artisan-build/gh": "*",
"artisan-build/kibble": "*",
"artisan-build/verbs-flux": "*",
"internachi/modular": "^2.2",
"laravel/framework": "^11.31",
Expand Down
88 changes: 83 additions & 5 deletions composer.lock

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

15 changes: 15 additions & 0 deletions packages/kibble/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
20 changes: 20 additions & 0 deletions packages/kibble/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/art export-ignore
/docs export-ignore
/tests export-ignore
/workbench export-ignore
/.editorconfig export-ignore
/.php_cs.dist.php export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
/UPGRADING.md export-ignore
/phpstan.neon.dist export-ignore
/phpstan-baseline.neon export-ignore
11 changes: 11 additions & 0 deletions packages/kibble/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.idea
.phpunit.cache
build
composer.lock
coverage
docs
phpunit.xml
phpstan.neon
testbench.yaml
vendor
node_modules
7 changes: 7 additions & 0 deletions packages/kibble/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributing to Docsidian

Contributions are welcome from premium members of the [Artisan Build Community](https://artisan.community)

All others are welcome to make suggestions and report bugs in the free packages channel in the community.

Please follow the community contribution guidelines.
21 changes: 21 additions & 0 deletions packages/kibble/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Artisan Build <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
22 changes: 22 additions & 0 deletions packages/kibble/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Kibble

This is the package that makes our package manager work.

> [!WARNING]
> This package is currently under active development, and we have not yet released a major version. Once a 0.* version
> has been tagged, we strongly recommend locking your application to a specific working version because we might make
> breaking changes even in patch releases until we've tagged 1.0.
## Installation

`composer require artisan-build/kibble`

## Configuration

## Usage

## Memberware

This package is part of our internal toolkit and is optimized for our own purposes. We do not accept issues or PRs
in this repository.

59 changes: 59 additions & 0 deletions packages/kibble/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "artisan-build/kibble",
"description": "PHP package creation and management tools",
"type": "library",
"license": "MIT",
"require": {
"artisan-build/gh": "*",
"illuminate/support": "^11.36"
},
"require-dev": {
"larastan/larastan": "^v3.0.2",
"orchestra/testbench": "^v9.9.0",
"pestphp/pest": "^v3.7.1",
"laravel/pint": "^1.19.0",
"phpstan/phpstan": "^2.1.0"
},
"autoload": {
"psr-4": {
"ArtisanBuild\\Kibble\\": "src/",
"ArtisanBuild\\Kibble\\Tests\\": "tests/"
}
},
"minimum-stability": "stable",
"extra": {
"laravel": {
"providers": [
"ArtisanBuild\\Kibble\\Providers\\KibbleServiceProvider"
]
}
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"post-autoload-dump": "@composer run prepare",
"clear": "@php vendor/bin/testbench package:purge-bench --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": [
"@composer run prepare",
"@php vendor/bin/testbench workbench:build --ansi"
],
"start": [
"Composer\\Config::disableProcessTimeout",
"@composer run build",
"@php vendor/bin/testbench serve"
],
"test": "vendor/bin/pest",
"test-coverage": "vendor/bin/pest --coverage",
"lint": "vendor/bin/pint",
"stan": "vendor/bin/phpstan analyse --memory-limit=-1",
"ready": [
"@composer lint",
"@composer stan",
"@composer test"
]
}
}
4 changes: 4 additions & 0 deletions packages/kibble/config/kibble.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

return [
];
Empty file.
10 changes: 10 additions & 0 deletions packages/kibble/phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
includes:
- phpstan-baseline.neon

parameters:
level: 5
paths:
- src
- config
tmpDir: build/phpstan

28 changes: 28 additions & 0 deletions packages/kibble/src/Commands/CreatePackageCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Commands;

use Illuminate\Console\Command;

use function Laravel\Prompts\text;

class CreatePackageCommand extends Command
{
protected $signature = 'kibble:create-package';

protected $description = 'Create a new package and add it to GitHub and Packagist';

public function handle(): int
{
$name = text('What are we naming this package?');
$description = text('What does this package do?');

// Use GH to create a new repo from the template

// Import that repo into the packages directory

// Run string replacements to rename files and set up the correct class names, etc.

return self::SUCCESS;
}
}
20 changes: 20 additions & 0 deletions packages/kibble/src/Providers/KibbleServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace ArtisanBuild\Kibble\Providers;

use Illuminate\Support\ServiceProvider;

class KibbleServiceProvider extends ServiceProvider
{
public function register(): void
{
$this->mergeConfigFrom(__DIR__.'/../../config/kibble.php', 'kibble');
}

public function boot(): void
{
$this->publishes([
__DIR__.'/../../config/kibble.php' => config_path('kibble.php'),
], 'kibble');
}
}
15 changes: 15 additions & 0 deletions packages/kibble/tests/FORKED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Getting Tests Working if You've Forked This Package

We do all of our package development within a monorepo that provides the Laravel framework for us to test against.
So we don't actually use Orchestra Testbench ourselves. However, if you've forked this package, you'll need to tweak
a couple of things in this directory in order for the test suite to run.

## Renaming Files

Rename Pest.php.forked to Pest.php
Rename TestCase.php.forked to TestCase.php

## Run The Test Suite

At this point, you should be able to run the test suite with `composer test`. Please let us know if that doesn't work
for you so we can augment this documentation to include anything we may have missed.
5 changes: 5 additions & 0 deletions packages/kibble/tests/Pest.php.forked
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

use ArtisanBuild\Skeleton\Tests\TestCase;

uses(TestCase::class)->in(__DIR__);
Loading

0 comments on commit 561e8f3

Please sign in to comment.