From 5aa585f1e1af2d4e8fea015608e299cddcecf489 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 15 Nov 2023 08:31:26 +0000 Subject: [PATCH] Template cleanup --- .github/workflows/template-cleanup.yml | 89 ------------------- COPYRIGHT | 4 +- LICENSE | 51 +++++------ README.md | 13 ++- composer.json | 63 +++++++++++++ deptrac.yaml | 26 ++++++ package.json | 16 ++++ phpstan.neon | 9 ++ phpunit.xml.dist | 23 +++++ .../IbexaNotificationsExtension.php | 67 ++++++++++++++ src/bundle/IbexaNotificationsBundle.php | 15 ++++ src/bundle/Resources/config/prepend.yaml | 5 ++ src/bundle/Resources/config/services.yaml | 2 + src/bundle/Resources/config/services/.gitkeep | 0 .../Resources/views/themes/admin/.gitkeep | 0 .../Resources/views/themes/standard/.gitkeep | 0 src/contracts/.gitkeep | 0 src/lib/.gitkeep | 0 tests/bundle/.gitkeep | 0 tests/integration/.gitkeep | 0 tests/lib/.gitkeep | 0 21 files changed, 260 insertions(+), 123 deletions(-) delete mode 100644 .github/workflows/template-cleanup.yml create mode 100644 composer.json create mode 100644 deptrac.yaml create mode 100644 package.json create mode 100644 phpstan.neon create mode 100644 phpunit.xml.dist create mode 100644 src/bundle/DependencyInjection/IbexaNotificationsExtension.php create mode 100644 src/bundle/IbexaNotificationsBundle.php create mode 100644 src/bundle/Resources/config/prepend.yaml create mode 100644 src/bundle/Resources/config/services.yaml create mode 100644 src/bundle/Resources/config/services/.gitkeep create mode 100644 src/bundle/Resources/views/themes/admin/.gitkeep create mode 100644 src/bundle/Resources/views/themes/standard/.gitkeep create mode 100644 src/contracts/.gitkeep create mode 100644 src/lib/.gitkeep create mode 100644 tests/bundle/.gitkeep create mode 100644 tests/integration/.gitkeep create mode 100644 tests/lib/.gitkeep diff --git a/.github/workflows/template-cleanup.yml b/.github/workflows/template-cleanup.yml deleted file mode 100644 index 784c18c..0000000 --- a/.github/workflows/template-cleanup.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Template Cleanup -on: - push: - branches: - - main - -jobs: - - template-cleanup: - name: Template Cleanup - runs-on: ubuntu-latest - if: github.event.repository.name != 'bundle-template-internal' - steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2 - - - name: Setup PHP Action - uses: shivammathur/setup-php@v2 - with: - php-version: 7.4 - coverage: none - extensions: pdo_sqlite, gd - tools: cs2pr - - - name: Get bundle generator - uses: actions/checkout@v2 - with: - token: ${{ secrets.EZROBOT_PAT }} - repository: ibexa/bundle-generator - path: .generator - - - name: "Install composer and dependencies" - run: | - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - php composer-setup.php - php composer.phar install -d .generator - - - name: "Apply repository labels" - uses: micnncim/action-label-syncer@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # Cleanup project - - name: Cleanup - run: | - export LC_CTYPE=C - export LANG=C - # Prepare variables - NAME="${GITHUB_REPOSITORY##*/}" - ACTOR=$(echo $GITHUB_ACTOR | tr '[:upper:]' '[:lower:]') - SAFE_NAME=$(echo $NAME | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') - SAFE_ACTOR=$(echo $ACTOR | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') - - # Converts repository name to UpperCamelCase (if separated by "-") - _temp=(${NAME//-/ }) - CC_NAME=$(printf %s "${_temp[@]^}") - - # Remove lines marked with #REMOVE-ON-CLEANUP# - find . -type f -exec sed -i '/#REMOVE-ON-CLEANUP#/d' {} + - - # Run generator - echo Running generator with: php .generator/bin/ibexa-bundle-generator $SAFE_NAME $SAFE_NAME-dir --vendor-name=ibexa --vendor-namespace=Ibexa --bundle-name=$CC_NAME --skeleton-name=ibexa-ee - php .generator/bin/ibexa-bundle-generator $SAFE_NAME $SAFE_NAME-dir --vendor-name=ibexa --vendor-namespace=Ibexa --bundle-name=$CC_NAME --skeleton-name=ibexa-ee - - # Move content - cp -R $SAFE_NAME-dir/* . - - # Cleanup - rm -rf \ - .github/readme \ - .github/template-cleanup \ - .github/workflows/template-cleanup.yml \ - .generator composer-setup.php composer.phar \ - $SAFE_NAME-dir - # Commit modified files - - name: Commit files - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add . - git commit -m "Template cleanup" - # Push changes - - name: Push changes - uses: ad-m/github-push-action@master - with: - branch: main - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/COPYRIGHT b/COPYRIGHT index 55491a1..de9ee86 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,9 +1,9 @@ -Copyright (C) 1999-2021 Ibexa AS (formerly eZ Systems AS). All rights reserved. +Copyright (C) 1999-2023 Ibexa AS (formerly eZ Systems AS). All rights reserved. This source code is available separately under the following licenses: A - Ibexa Business Use License Agreement (Ibexa BUL), -version 2.4 or later versions (as license terms may be updated from time to time) +version 2.3 or later versions (as license terms may be updated from time to time) Ibexa BUL is granted by having a valid Ibexa DXP (formerly eZ Platform Enterprise) subscription, as described at: https://www.ibexa.co/product For the full Ibexa BUL license text, please see: diff --git a/LICENSE b/LICENSE index 63d94f6..17c112b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,14 @@ -Copyright (C) 1999-2021 Ibexa AS (formerly eZ Systems AS). All rights reserved. +Copyright (C) 1999-2023 Ibexa AS. All rights reserved. +This source code is provided under the license bundled below. -This source code is available separately under the following licenses: - -A - Ibexa Business Use License Agreement (Ibexa BUL), -version 2.4 or later versions (as license terms may be updated from time to time) -Ibexa BUL is granted by having a valid Ibexa DXP (formerly eZ Platform Enterprise) subscription, -as described at: https://www.ibexa.co/product -For the full Ibexa BUL license text, please see: -- LICENSE-bul file placed in the root of this source code, or -- https://www.ibexa.co/software-information/licenses-and-agreements (latest version applies) - -AND - -B - Ibexa Trial and Test License Agreement (Ibexa TTL), -version 2.2 or later versions (as license terms may be updated from time to time) -Full Ibexa TTL license text below, or online on: https://www.ibexa.co/software-information/licenses-and-agreements (latest version applies) +The source code is available separately under the Ibexa BUL 2.3 License, +granted by having a valid Ibexa Digital Experience Platform (DXP) subscription: +- https://www.ibexa.co/products +- https://www.ibexa.co/software-information/licenses-and-agreements/ibexa-business-use-license-agreement-ibexa-bul-version-2.3 +To get access to the full source code under TTL license below, +reach out to Ibexa AS for evaluation access: +- https://www.ibexa.co/about-ibexa/contact-us ---------------------------------------------------------- @@ -25,14 +18,14 @@ Ibexa Trial and Test License Agreement ("Ibexa TTL") Version 2.2 IMPORTANT: Please read the following license agreement carefully. This license agreement is between Ibexa AS (Norwegian business -registration no. 981 601 564, formerly eZ Systems AS), a Norwegian company -("Licensor" or "Ibexa"), and a test or trial user ("Licensee" or "you"). -By installing all or any portion of the software (or authorizing any other -person to do so), you accept the terms and conditions of this license. -If you acquired the software without an opportunity to review this license -and do not accept the license, you must: (a) not use the software and (b) -return or delete the software, with your certification of deletion, within -thirty (30) days of the acquire date. +registration no. 981 601 564), a Norwegian company ("Licensor" or "Ibexa"), +and a test or trial user ("Licensee" or "you"). By installing all or any +portion of the software (or authorizing any other person to do so), you +accept the terms and conditions of this license. If you acquired the +software without an opportunity to review this license and do not accept +the license, you must: (a) not use the software and (b) return or delete +the software, with your certification of deletion, within thirty (30) +days of the acquire date. This license agreement is entered into in connection with Licensee's participation in testing a new version of Licensor software and is valid @@ -44,9 +37,9 @@ The parties hereby agree to the following software license terms: 1. Definitions "Licensed Software" means the Ibexa Digital Experience Platform (DXP) -or other Ibexa software product (such as eZ Platform Enterprise Edition, -eZ Publish Platform) downloaded, ordered or otherwise legally acquired -(licensed) by you from Ibexa (or other party authorized by Ibexa). +or other software product (such as Ibexa Commerce) downloaded, ordered or +otherwise legally acquired (licensed) by Licensee from Licensor (or +other party authorized by the Licensor) under these terms. "Licensed Copy" means one sample of the Licensed Software. @@ -285,8 +278,8 @@ Licensee at the address provided to Licensor (or authorized representative) at the time of order, and to Licensor at Attn: Software Licensing Dept/CLA, -Ibexa AS, -Solligata 2, +Ibexa AS +Solligata 2 0254 Oslo Norway diff --git a/README.md b/README.md index 5af5ad9..c90ec51 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,17 @@ -Ibexa DXP \ -==================== +# notifications + +This package is part of [Ibexa DXP](https://ibexa.co). + +To use this package, [install Ibexa DXP](https://doc.ibexa.co/en/latest/install/). + + ## COPYRIGHT -Copyright (C) 1999-2022 Ibexa AS (formerly eZ Systems AS). All rights reserved. + +Copyright (C) 1999-2023 Ibexa AS (formerly eZ Systems AS). All rights reserved. ## LICENSE + This source code is available separately under the following licenses: A - Ibexa Business Use License Agreement (Ibexa BUL), diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..5bc816a --- /dev/null +++ b/composer.json @@ -0,0 +1,63 @@ +{ + "name": "ibexa/notifications", + "license": "proprietary", + "type": "ibexa-bundle", + "keywords": [ + "ibexa-dxp" + ], + "repositories": [ + { "type": "composer", "url": "https://updates.ibexa.co" } + ], + "require": { + "php": "^7.4 || ^8.0", + "ibexa/core": "^4.5.x-dev", + "symfony/config": "^5.4", + "symfony/dependency-injection": "^5.4", + "symfony/event-dispatcher": "^5.4", + "symfony/event-dispatcher-contracts": "^2.2", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/yaml": "^5.4" + }, + "require-dev": { + "phpunit/phpunit": "^9", + "ibexa/code-style": "^1.1", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-phpunit": "^1.3", + "phpstan/phpstan-symfony": "^1.3", + "qossmic/deptrac-shim": "^0.24.0 || ^1.0.2" + }, + "autoload": { + "psr-4": { + "Ibexa\\Bundle\\Notifications\\": "src/bundle/", + "Ibexa\\Contracts\\Notifications\\": "src/contracts/", + "Ibexa\\Notifications\\": "src/lib/" + } + }, + "autoload-dev": { + "psr-4": { + "Ibexa\\Tests\\Bundle\\Notifications\\": "tests/bundle/", + "Ibexa\\Tests\\Integration\\Notifications\\": "tests/integration/", + "Ibexa\\Tests\\Notifications\\": "tests/lib/" + } + }, + "scripts": { + "fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php --show-progress=dots", + "check-cs": "@fix-cs --dry-run", + "test": "phpunit -c phpunit.xml.dist", + "phpstan": "phpstan analyse -c phpstan.neon", + "deptrac": "php vendor/bin/deptrac analyse" + }, + "scripts-descriptions": { + "fix-cs": "Automatically fixes code style in all files", + "check-cs": "Run code style checker for all files", + "test": "Run automatic tests", + "phpstan": "Run static code analysis", + "deptrac": "Run Deptrac architecture testing" + }, + "extra": { + "branch-alias": { + "dev-main": "4.5.x-dev" + } + } +} diff --git a/deptrac.yaml b/deptrac.yaml new file mode 100644 index 0000000..174c771 --- /dev/null +++ b/deptrac.yaml @@ -0,0 +1,26 @@ +deptrac: + paths: + - ./src + layers: + - name: Bundle + collectors: + - type: directory + value: bundle/.* + - name: Contracts + collectors: + - type: directory + value: contracts/.* + - name: Library + collectors: + - type: directory + value: lib/.* + ruleset: + Bundle: + - Bundle + - Contracts + - Library + Contracts: + - Contracts + Library: + - Contracts + - Library diff --git a/package.json b/package.json new file mode 100644 index 0000000..68df429 --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "name": "notifications", + "repository": "git@github.com:ibexa/notifications.git", + "private": true, + "prettier": "eslint-config-ibexa/prettier", + "dependencies": {}, + "devDependencies": { + "eslint-config-ibexa": "https://github.com/ibexa/eslint-config-ibexa.git#v1.0.0" + }, + "scripts": { + "test": "yarn prettier-test && yarn eslint-test", + "fix": "yarn prettier-test --write && yarn eslint-test --fix", + "eslint-test": "eslint \"./src/bundle/Resources/**/*.js\" \"./src/bundle/ui-dev/**/*.js\"", + "prettier-test": "yarn prettier \"./src/bundle/Resources/**/*.{js,scss}\" \"./src/bundle/ui-dev/**/*.js\" --check" + } +} diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..3756f56 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,9 @@ +includes: + - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/phpstan/phpstan-symfony/extension.neon + +parameters: + level: 8 + paths: + - src + - tests diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..1e2e4ee --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,23 @@ + + + + tests/bundle + + + tests/integration + + + tests/lib + + + diff --git a/src/bundle/DependencyInjection/IbexaNotificationsExtension.php b/src/bundle/DependencyInjection/IbexaNotificationsExtension.php new file mode 100644 index 0000000..e854c14 --- /dev/null +++ b/src/bundle/DependencyInjection/IbexaNotificationsExtension.php @@ -0,0 +1,67 @@ + $configs + */ + public function load(array $configs, ContainerBuilder $container): void + { + $loader = new YamlFileLoader( + $container, + new FileLocator(__DIR__ . '/../Resources/config') + ); + + $loader->load('services.yaml'); + } + + public function prepend(ContainerBuilder $container): void + { + $this->prependDefaultConfiguration($container); + $this->prependJMSTranslation($container); + } + + private function prependDefaultConfiguration(ContainerBuilder $container): void + { + $configFile = __DIR__ . '/../Resources/config/prepend.yaml'; + + $container->addResource(new FileResource($configFile)); + + $configs = Yaml::parseFile($configFile, Yaml::PARSE_CONSTANT) ?? []; + foreach ($configs as $name => $config) { + $container->prependExtensionConfig($name, $config); + } + } + + private function prependJMSTranslation(ContainerBuilder $container): void + { + $container->prependExtensionConfig('jms_translation', [ + 'configs' => [ + 'ibexa_notifications' => [ + 'dirs' => [ + __DIR__ . '/../../', + ], + 'excluded_dirs' => ['Behat'], + 'output_dir' => __DIR__ . '/../Resources/translations/', + 'output_format' => 'xliff', + ], + ], + ]); + } +} diff --git a/src/bundle/IbexaNotificationsBundle.php b/src/bundle/IbexaNotificationsBundle.php new file mode 100644 index 0000000..c7f2cf1 --- /dev/null +++ b/src/bundle/IbexaNotificationsBundle.php @@ -0,0 +1,15 @@ +