Repository: strapi/strapi
File: packages/core/upload/admin/src/index.ts (TypeScript)

Code before:
      intlLabel: {
        id: `${pluginId}.plugin.name`,
        defaultMessage: 'Media Library',
      },
      permissions: PERMISSIONS.main,
      Component: () => import('./pages/App/App').then((mod) => ({ default: mod.Upload })),
      position: 4,
    });

    app.addSettingsLink('global', {
      id: 'media-library-settings',
      to: 'media-library',
      intlLabel: {
        id: getTrad('plugin.name'),
        defaultMessage: 'Media Library',
      },
      async Component() {
        const { ProtectedSettingsPage } = await import('./pages/SettingsPage/SettingsPage');
        return { default: ProtectedSettingsPage };
      },
      permissions: PERMISSIONS.settings,
    });

    app.addFields({
      type: 'media',
      Component: MediaLibraryInput as React.FC<Partial<MediaLibraryInputProps>>,
    });
    app.addComponents([
      {
        name: 'media-library',
        Component: MediaLibraryDialog as React.FC<Partial<MediaLibraryDialogProps>>,
      },
    ]);

    app.registerPlugin({
      id: pluginId,
      name,
    });
  },
  async registerTrads({ locales }: { locales: string[] }) {
    const importedTrads = await Promise.all(
      locales.map((locale) => {
        return import(`./translations/${locale}.json`)
          .then(({ default: data }) => {
            return {
              data: prefixPluginTranslations(data, pluginId),
              locale,
            };
          })
          .catch(() => {
            return {

Review comment (suggestion):
Problem is that the CTB is also position 5 so it places this right after the CTB and not the previous ML. I don't know if we can do something about it though. If we change here for 4, it will move both ML + the unstable one after the CTB for some reason.

Code after:
      intlLabel: {
        id: `${pluginId}.plugin.name`,
        defaultMessage: 'Media Library',
      },
      permissions: PERMISSIONS.main,
      Component: () => {
        return import('./pages/App/App').then((mod) => ({ default: mod.Upload }));
      },
      position: 4,
    });

    if (window.strapi.future.isEnabled('unstableMediaLibrary')) {
      app.addMenuLink({
        to: `plugins/unstable-${pluginId}`,
        icon: WarningCircle,
        intlLabel: {
          id: `${pluginId}.plugin.name`,
          defaultMessage: 'Media Library',
        },
        permissions: PERMISSIONS.main,
        Component: () => {
          return import('./future/App').then((mod) => ({
            default: mod.UnstableMediaLibraryPage,
          }));
        },
        position: 5,
      });
    }

    app.addSettingsLink('global', {
      id: 'media-library-settings',
      to: 'media-library',
      intlLabel: {
        id: getTrad('plugin.name'),
        defaultMessage: 'Media Library',
      },
      async Component() {
        const { ProtectedSettingsPage } = await import('./pages/SettingsPage/SettingsPage');
        return { default: ProtectedSettingsPage };
      },
      permissions: PERMISSIONS.settings,
    });

    app.addFields({
      type: 'media',
      Component: MediaLibraryInput as React.FC<Partial<MediaLibraryInputProps>>,
    });
    app.addComponents([
      {
        name: 'media-library',
        Component: MediaLibraryDialog as React.FC<Partial<MediaLibraryDialogProps>>,