Skip to content

Commit

Permalink
fix: admin package annotations (shopware#6358)
Browse files Browse the repository at this point in the history
  • Loading branch information
seggewiss authored Jan 23, 2025
1 parent bd78a3d commit 6c1bc65
Show file tree
Hide file tree
Showing 1,954 changed files with 2,152 additions and 2,160 deletions.
2 changes: 1 addition & 1 deletion src/Administration/Administration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* @internal
*/
#[Package('administration')]
#[Package('framework')]
class Administration extends Bundle
{
public function getTemplatePriority(): int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
name: 'administration:delete-files-after-build',
description: 'Deletes all unnecessary files of the administration after the build process.',
)]
#[Package('administration')]
#[Package('framework')]
class DeleteAdminFilesAfterBuildCommand extends Command
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
name: 'administration:delete-extension-local-public-files',
description: 'Deletes all files in the local public folder of the extension. This command should run after assets:install so the assets are available in the public folder.',
)]
#[Package('administration')]
#[Package('framework')]
class DeleteExtensionLocalPublicFilesCommand extends Command
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @internal Only to be used by the admin-extension-sdk.
*/
#[Route(defaults: ['_routeScope' => ['api']])]
#[Package('administration')]
#[Package('framework')]
class AdminExtensionApiController extends AbstractController
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Attribute\Route;

#[Package('administration')]
#[Package('framework')]
class AdminProductStreamController extends AbstractController
{
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/Controller/AdminSearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Serializer\Encoder\DecoderInterface;

#[Package('administration')]
#[Package('framework')]
class AdminSearchController extends AbstractController
{
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/Controller/AdminTagController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Symfony\Component\Routing\Attribute\Route;

#[Route(defaults: ['_routeScope' => ['administration']])]
#[Package('administration')]
#[Package('framework')]
class AdminTagController extends AbstractController
{
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/Controller/AdministrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

#[Route(defaults: ['_routeScope' => ['administration']])]
#[Package('administration')]
#[Package('framework')]
class AdministrationController extends AbstractController
{
private readonly bool $esAdministrationEnabled;
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/Controller/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @internal
*/
#[Route(defaults: ['_routeScope' => ['administration']])]
#[Package('administration')]
#[Package('framework')]
class DashboardController extends AbstractController
{
public function __construct(private readonly OrderAmountService $orderAmountService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Shopware\Core\Framework\ShopwareHttpException;
use Symfony\Component\HttpFoundation\Response;

#[Package('administration')]
#[Package('framework')]
class AppByNameNotFoundException extends ShopwareHttpException
{
public function __construct(string $appName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\ShopwareHttpException;

#[Package('administration')]
#[Package('framework')]
class MissingAppSecretException extends ShopwareHttpException
{
public function __construct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\ShopwareHttpException;

#[Package('administration')]
#[Package('framework')]
class MissingShopUrlException extends ShopwareHttpException
{
public function __construct()
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/Controller/NotificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Symfony\Component\Routing\Attribute\Route;

#[Route(defaults: ['_routeScope' => ['api']])]
#[Package('administration')]
#[Package('framework')]
class NotificationController extends AbstractController
{
final public const NOTIFICATION = 'notification';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

#[Package('administration')]
#[Package('framework')]
class AdministrationMigrationCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Shopware\Core\Framework\Log\Package;
use Symfony\Contracts\EventDispatcher\Event;

#[Package('administration')]
#[Package('framework')]
class PreResetExcludedSearchTermEvent extends Event implements ShopwareEvent
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Shopware\Core\Framework\Routing\ApiContextRouteScopeDependant;
use Symfony\Component\HttpFoundation\Request;

#[Package('administration')]
#[Package('framework')]
class AdministrationRouteScope extends AbstractRouteScope implements ApiContextRouteScopeDependant
{
final public const ID = 'administration';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Shopware\Core\Framework\Log\Package;
use Symfony\Component\HttpFoundation\Request;

#[Package('administration')]
#[Package('framework')]
class KnownIpsCollector implements KnownIpsCollectorInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Shopware\Core\Framework\Log\Package;
use Symfony\Component\HttpFoundation\Request;

#[Package('administration')]
#[Package('framework')]
interface KnownIpsCollectorInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* @internal
*/
#[Package('administration')]
#[Package('framework')]
readonly class AdministrationNotFoundSubscriber implements EventSubscriberInterface
{
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/Framework/Search/CriteriaCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* @extends Collection<Criteria>
*/
#[Package('administration')]
#[Package('framework')]
class CriteriaCollection extends Collection
{
protected function getExpectedClass(): ?string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Shopware\Core\Framework\Log\Package;
use Symfony\Component\Asset\Packages;

#[Package('administration')]
#[Package('framework')]
class ViteFileAccessorDecorator extends FileAccessor
{
private string $assetPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* @deprecated tag:v6.7.0 - will be removed, use ApiException::notificationThrottled instead
*/
#[Package('administration')]
#[Package('framework')]
class NotificationThrottledException extends ShopwareHttpException
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @codeCoverageIgnore
*/
#[Package('administration')]
#[Package('framework')]
class IntegrationExtension extends EntityExtension
{
public function extendFields(FieldCollection $collection): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @codeCoverageIgnore
*/
#[Package('administration')]
#[Package('framework')]
class UserExtension extends EntityExtension
{
public function extendFields(FieldCollection $collection): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @codeCoverageIgnore
*/
#[Package('administration')]
#[Package('framework')]
class NotificationBulkEntityExtension extends BulkEntityExtension
{
public function collect(): \Generator
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/Notification/NotificationCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* @extends EntityCollection<NotificationEntity>
*/
#[Package('administration')]
#[Package('framework')]
class NotificationCollection extends EntityCollection
{
protected function getExpectedClass(): string
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/Notification/NotificationDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Shopware\Core\System\Integration\IntegrationDefinition;
use Shopware\Core\System\User\UserDefinition;

#[Package('administration')]
#[Package('framework')]
class NotificationDefinition extends EntityDefinition
{
final public const ENTITY_NAME = 'notification';
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/Notification/NotificationEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Shopware\Core\System\Integration\IntegrationEntity;
use Shopware\Core\System\User\UserEntity;

#[Package('administration')]
#[Package('framework')]
class NotificationEntity extends Entity
{
use EntityIdTrait;
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/Notification/NotificationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @phpstan-type Notification array{id: non-empty-string, status: string, message: string, adminOnly?: bool, requiredPrivileges: array<int, string>, createdByIntegrationId?: string|null, createdByUserId?: string|null}
*/
#[Package('administration')]
#[Package('framework')]
class NotificationService
{
public function __construct(private readonly EntityRepository $notificationRepository)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
let hasPackageAnnotation = false;

for (const comment of comments) {
if (comment.type === 'Block' && comment.value.includes('@package')) {
if (comment.type === 'Block' && comment.value.includes('@sw-package')) {
hasPackageAnnotation = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tester.run('require-package-annotation', rule, {
filename: 'test.js',
code: `
/**
* @package admin
* @sw-package admin
*/
const foo = 'bar';`
},
Expand All @@ -23,7 +23,7 @@ const foo = 'bar';`
filename: 'test.ts',
code: `
/**
* @package admin
* @sw-package admin
*/
const foo = 'bar';`
},
Expand All @@ -34,7 +34,7 @@ const foo = 'bar';`
// This is a comment
/**
* @package admin
* @sw-package admin
*/
const foo = 'bar';`
},
Expand All @@ -45,7 +45,7 @@ const foo = 'bar';`
// This is a comment
/**
* @package admin
* @sw-package admin
*/
const foo = 'bar';`
},
Expand Down Expand Up @@ -88,7 +88,7 @@ const foo = 'bar';`
name: 'JS File with package annotation in line comment',
filename: 'test.js',
code: `
// @package admin
// @sw-package admin
const foo = 'bar';
`,
Expand All @@ -101,7 +101,7 @@ const foo = 'bar';
name: 'TS File with package annotation in line comment',
filename: 'test.ts',
code: `
// @package admin
// @sw-package admin
const foo = 'bar';
`,
Expand Down
3 changes: 1 addition & 2 deletions src/Administration/Resources/app/administration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@
"generate-block-list": "ts-node --transpileOnly ./scripts/generate-block-list/index.ts",
"preinstall": "node ./scripts/validate-package-json/index.mjs",
"postinstall": "patch-package",
"lint": "eslint --ext .js,.ts,.vue,.html.twig src test --cache --quiet",
"lint": "eslint --ext .js,.ts,.vue,.html.twig src test --cache",
"lint-fix": "eslint --fix --ext .js,.ts,.vue,.html.twig src test",
"lint:all": "npm run lint:types && npm run lint",
"lint:debugging": "eslint --ext .js,.ts,.vue,.html.twig",
"lint:deprecations": "eslint --rule '\"sw-new-core-rules/private-feature-declarations\": \"error\"' $(git status -s | awk '/(js|ts|vue|html\\.twig)$/ {print $2}')",
"lint:fix": "npm run lint -- --fix",
"lint:junit": "eslint --ext .js,.ts,.vue,.html.twig --format junit src test > eslint.junit.xml",
"lint:loud": "eslint --ext .js,.ts,.vue,.html.twig src test --cache",
"lint:scss": "stylelint **/*.scss --cache",
"lint:scss-fix": "npm run lint:scss -- --fix",
"lint:test-parser": "eslint test/eslint/error-reference.html.twig --no-ignore",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @package admin
* @sw-package framework
*
* This test is written in TS to make sure that the type inheritance
* works correctly with the new Composition API extension system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { SetupContext, PublicProps } from '@vue/runtime-core';

/**
* @experimental stableVersion:v6.8.0 feature:ADMIN_COMPOSITION_API_EXTENSION_SYSTEM
* @package admin
* @sw-package framework
*
* Extendable Setup Utility for Vue Components
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/* Vue devtools plugins couldn't be tested well yet */
/**
* @package admin
* @sw-package framework
*/

import type { CustomInspectorNode } from '@vue/devtools-api';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @package admin
* @sw-package framework
*/

import { shallowMount, config } from '@vue/test-utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @package admin
* @sw-package framework
*/
import ViewAdapter from 'src/core/adapter/view.adapter';
import { createI18n } from 'vue-i18n';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @package admin
* @sw-package framework
*/

import registerAsyncComponents from 'src/app/asyncComponent/asyncComponents';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @package admin
* @sw-package framework
*/

/* @private */
Expand Down
Loading

0 comments on commit 6c1bc65

Please sign in to comment.