diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9eb391c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# Top-most EditorConfig file +root = true + +# All files +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +# PHP files +[*.php] +indent_size = 4 + +# Markdown files +[*.md] +trim_trailing_whitespace = false + +# Indentation override for all HTML, CSS/SCSS, JS, and Vue files +[*.{html,css,scss,js,vue,twig}] +indent_style = tab \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..c49e71f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,52 @@ +name: CI + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + +jobs: + ecs: + name: ECS Check + runs-on: ubuntu-latest + env: + DEFAULT_COMPOSER_FLAGS: "--no-interaction --no-ansi --no-progress" + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + - run: composer install --prefer-dist --no-progress + - name: Run ecs check + run: | + vendor/bin/ecs --memory-limit=1G --no-progress-bar + rector: + name: Rector dry-run + runs-on: ubuntu-latest + env: + DEFAULT_COMPOSER_FLAGS: "--no-interaction --no-ansi --no-progress" + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + - run: composer install --prefer-dist --no-progress + - name: Run rector --dry-run + run: | + vendor/bin/rector --memory-limit=1G --no-progress-bar --dry-run + phpstan: + name: PHPStan + runs-on: ubuntu-latest + env: + DEFAULT_COMPOSER_FLAGS: "--no-interaction --no-ansi --no-progress" + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + - run: composer install --prefer-dist --no-progress + - name: Run phpstan + run: | + vendor/bin/phpstan --memory-limit=1G diff --git a/README.md b/README.md index 228f708..99aec0e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ in Craft. ### Username/Password ShipStation allows you to set a custom username and password combination for a -connected store. This combination should match the values stored in the +connected store. This combination should match the values stored in the ShipStation Connnect settings view in your Craft control panel. **Note:** These are *not* your ShipStation credentials, nor your Craft user diff --git a/composer.json b/composer.json index 646e0ee..5bad253 100644 --- a/composer.json +++ b/composer.json @@ -27,10 +27,10 @@ "craftcms/commerce": "^4.0" }, "require-dev": { - "roave/security-advisories": "dev-latest", - "craftcms/phpstan": "dev-main", - "craftcms/ecs": "dev-main", - "craftcms/rector": "dev-main" + "fostercommerce/phpstan": "dev-main", + "fostercommerce/ecs": "dev-main", + "fostercommerce/rector": "dev-main", + "roave/security-advisories": "dev-latest" }, "extra": { "handle": "shipstationconnect", @@ -43,6 +43,8 @@ "craftcms/plugin-installer": true } }, + "prefer-stable": true, + "minimum-stability": "dev", "scripts": { "phpstan": "phpstan --memory-limit=1G", "ecs-check": "ecs check --ansi --memory-limit=1G", diff --git a/ecs.php b/ecs.php index 5183d48..0d87e65 100644 --- a/ecs.php +++ b/ecs.php @@ -2,15 +2,16 @@ declare(strict_types=1); -use craft\ecs\SetList; +use fostercommerce\ecs\SetList; use Symplify\EasyCodingStandard\Config\ECSConfig; return static function(ECSConfig $ecsConfig): void { - $ecsConfig->parallel(); $ecsConfig->paths([ __DIR__ . '/src', __FILE__, ]); - $ecsConfig->sets([SetList::CRAFT_CMS_4]); + $ecsConfig->sets([ + SetList::CRAFT_CMS_4, + ]); }; diff --git a/phpstan.neon b/phpstan.neon index f9f81af..c9bb9b4 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,7 +1,6 @@ includes: - - vendor/craftcms/phpstan/phpstan.neon + - vendor/fostercommerce/phpstan/phpstan.neon parameters: - level: 0 paths: - src diff --git a/rector.php b/rector.php index 8798741..daf86d5 100644 --- a/rector.php +++ b/rector.php @@ -1,8 +1,7 @@ sets([ - SetList::PHP_80, - SetList::PHP_74, - SetList::PHP_73, - SetList::PHP_72, - SetList::PHP_71, - SetList::PHP_70, - SetList::PHP_56, - SetList::PHP_55, - SetList::PHP_54, - SetList::PHP_53, - SetList::PHP_52, - SetList::CODE_QUALITY, - SetList::CODING_STYLE, - SetList::DEAD_CODE, - SetList::STRICT_BOOLEANS, - SetList::NAMING, - SetList::TYPE_DECLARATION, - SetList::EARLY_RETURN, - SetList::INSTANCEOF, - CraftSetList::CRAFT_CMS_40, - CraftSetList::CRAFT_COMMERCE_40, + SetList::CRAFT_CMS_40_PHP_80, ]); };