From 25e568254692f6638ad30646847bdfcb2fb06310 Mon Sep 17 00:00:00 2001 From: Gertjan Krol Date: Sun, 28 May 2023 22:49:45 +0200 Subject: [PATCH] Package skeleton update --- .forgejo/workflows/test.yaml | 27 +++++++++++++++++ LICENSE.md | 2 +- README.md | 11 ++++--- composer.json | 57 +++++++++++++++++++++++------------- package.json | 5 ++-- phpunit.xml | 13 ++++---- public/app.923f0842.css | 0 public/app.cdb7ca6c.js | 0 public/app.css | 1 + public/app.js | 1 + public/manifest.json | 12 ++++---- vite.config.js | 11 ++++--- 12 files changed, 96 insertions(+), 44 deletions(-) create mode 100644 .forgejo/workflows/test.yaml delete mode 100644 public/app.923f0842.css delete mode 100644 public/app.cdb7ca6c.js create mode 100644 public/app.css create mode 100644 public/app.js diff --git a/.forgejo/workflows/test.yaml b/.forgejo/workflows/test.yaml new file mode 100644 index 0000000..ab44513 --- /dev/null +++ b/.forgejo/workflows/test.yaml @@ -0,0 +1,27 @@ +name: Test +on: + push: + branches: + - '*' + +jobs: + test_all: + runs-on: ubuntu-22.04 + container: git.gertjankrol.nl/docker/php-toolkit:latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + - name: composer install + run: composer install --profile + - name: phpunit + run: composer unit + - name: phplint + run: composer lint + - name: phpcs + run: composer style + - name: composer require check + run: composer require-check + - name: composer security check + run: composer security-check + - name: composer unused package check + run: composer unused-check \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md index e344d12..40ded4e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) Author +Copyright (c) 2023 - Gertjan Krol Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 4006a72..3483f1d 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,13 @@ composer require crawl/skeleton ``` ### Testing - -```bash -composer test -``` +- Run PHPUnit: `composer unit` +- Run PHPLint: `composer lint` +- Run PHPCS/PHPCBF: `composer style`/`composer fix-style` +- Run require checker: `composer require-check` +- Run security checker: `composer security-check` +- Check for unused packages: `composer unused-check` +- **Run all tests: `composer test-all`** ### Changelog diff --git a/composer.json b/composer.json index c748f1a..e47c976 100644 --- a/composer.json +++ b/composer.json @@ -1,27 +1,31 @@ { "name": "crawl/skeleton", "description": "Crawl Laravel package skeleton", + "license": "MIT", + "type": "library", "keywords": [ "crawl", "skeleton" ], - "homepage": "https://git.gertjankrol.nl/crawl/skeleton", - "license": "MIT", - "type": "library", "authors": [ { "name": "Gertjan Krol", "email": "hello@gertjankrol.nl" } ], + "homepage": "https://git.gertjankrol.nl/crawl/skeleton", "require": { - "php": "^8.1", - "illuminate/support": "^9.25" + "php": "^8.2", + "laravel/framework": "^10.0" }, "require-dev": { + "crawl/coding-standard": "^1.1", "enlightn/security-checker": "^1.10", - "crawl/coding-standard": "^1.0", + "ergebnis/composer-normalize": "^2.31", + "icanhazstring/composer-unused": "^0.8.8", + "maglnet/composer-require-checker": "^4.6", "mockery/mockery": "^1.5", + "orchestra/testbench": "^8.5", "overtrue/phplint": "^4.3", "phpunit/phpunit": "^9.5" }, @@ -35,28 +39,39 @@ "Crawl\\Skeleton\\Tests\\": "tests" } }, - "scripts": { - "lint": "vendor/bin/phplint ./ --exclude=vendor", - "style": "vendor/bin/phpcs --standard=phpcs.xml", - "fix-style": "vendor/bin/phpcbf --standard=phpcs.xml", - "security-checker": "vendor/bin/security-checker security:check composer.lock", - "test": "vendor/bin/phpunit --configuration phpunit.xml --colors=never" - }, "config": { - "optimize-autoloader": true, - "sort-packages": true, "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } + "dealerdirect/phpcodesniffer-composer-installer": true, + "ergebnis/composer-normalize": true + }, + "optimize-autoloader": true, + "sort-packages": true }, "extra": { "laravel": { - "providers": [ - "Crawl\\Skeleton\\SkeletonServiceProvider" - ], "aliases": { "Skeleton": "Crawl\\Skeleton\\SkeletonFacade" - } + }, + "providers": [ + "Crawl\\Skeleton\\SkeletonServiceProvider" + ] } + }, + "scripts": { + "fix-style": "vendor/bin/phpcbf --standard=phpcs.xml", + "lint": "vendor/bin/phplint ./ --exclude=vendor", + "require-check": "vendor/bin/composer-require-checker check composer.json", + "security-check": "vendor/bin/security-checker security:check composer.lock", + "style": "vendor/bin/phpcs --standard=phpcs.xml", + "test-all": [ + "composer unit", + "composer lint", + "composer style", + "composer require-check", + "composer security-check", + "composer unused-check" + ], + "unit": "vendor/bin/phpunit --configuration phpunit.xml --colors=never", + "unused-check": "vendor/bin/composer-unused" } } diff --git a/package.json b/package.json index 4d59169..9eb0870 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "build": "vite build" }, "devDependencies": { - "laravel-vite-plugin": "^0.5", - "vite": "^3.0" + "laravel-vite-plugin": "^0.7", + "sass": "^1.62", + "vite": "^4.3" } } diff --git a/phpunit.xml b/phpunit.xml index f466529..f26461a 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,10 +1,6 @@ - - - - ./src - - + + ./tests/ @@ -13,4 +9,9 @@ + + + ./src + + diff --git a/public/app.923f0842.css b/public/app.923f0842.css deleted file mode 100644 index e69de29..0000000 diff --git a/public/app.cdb7ca6c.js b/public/app.cdb7ca6c.js deleted file mode 100644 index e69de29..0000000 diff --git a/public/app.css b/public/app.css new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/public/app.css @@ -0,0 +1 @@ + diff --git a/public/app.js b/public/app.js new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/public/app.js @@ -0,0 +1 @@ + diff --git a/public/manifest.json b/public/manifest.json index 825f3e3..37da698 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,12 +1,12 @@ { "resources/js/app.js": { - "file": "app.cdb7ca6c.js", - "src": "resources/js/app.js", - "isEntry": true + "file": "app.js", + "isEntry": true, + "src": "resources/js/app.js" }, "resources/sass/app.scss": { - "file": "app.923f0842.css", - "src": "resources/sass/app.scss", - "isEntry": true + "file": "app.css", + "isEntry": true, + "src": "resources/sass/app.scss" } } \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 2d7f605..8ba9147 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,7 +4,12 @@ import laravel from 'laravel-vite-plugin'; export default defineConfig({ build: { outDir: 'public', - assetsDir: '', + rollupOptions: { + output: { + entryFileNames: `[name].js`, + assetFileNames: `[name].[ext]` + }, + }, }, plugins: [ laravel({ @@ -13,8 +18,6 @@ export default defineConfig({ 'resources/js/app.js', ], refresh: false, - publicDirectory: 'public', - buildDirectory: '.', }), ], -}); \ No newline at end of file +});