diff --git a/.github/workflows/experimental.yml b/.github/workflows/publish-prerelease.yml similarity index 73% rename from .github/workflows/experimental.yml rename to .github/workflows/publish-prerelease.yml index 61b0bff39a..530e5563c3 100644 --- a/.github/workflows/experimental.yml +++ b/.github/workflows/publish-prerelease.yml @@ -1,7 +1,11 @@ -name: 'Experimental Releases' +name: 'Publish Prerelease' on: workflow_dispatch: + inputs: + dist-tag: + description: 'The tag you want to publish to NPM' + default: 'experimental' permissions: contents: read # to fetch code (actions/checkout) @@ -22,4 +26,4 @@ jobs: - run: ./scripts/pre-publish.sh --yes env: VERSION: '0.0.0-experimental.${{ github.sha }}' - DIST_TAG: experimental + DIST_TAG: ${{ github.event.inputs.dist-tag }} diff --git a/.github/workflows/remove-dist-tag.yml b/.github/workflows/remove-dist-tag.yml new file mode 100644 index 0000000000..4afe14fa67 --- /dev/null +++ b/.github/workflows/remove-dist-tag.yml @@ -0,0 +1,28 @@ +name: 'Remove dist-tag from NPM' + +on: + workflow_dispatch: + inputs: + dist-tag: + description: 'The tag you want to remove from NPM' + required: true + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + publish: + name: 'Publish' + runs-on: ubuntu-latest + if: github.repository == 'strapi/strapi' + steps: + - uses: actions/checkout@v3 + - name: Setup npmrc + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: yarn + - run: ./scripts/remove-dist-tag + env: + DIST_TAG: ${{ github.event.inputs.dist-tag }} diff --git a/packages/core/admin/admin/src/content-manager/pages/App/index.js b/packages/core/admin/admin/src/content-manager/pages/App/index.js index 75dbf08e00..8dae70fecc 100644 --- a/packages/core/admin/admin/src/content-manager/pages/App/index.js +++ b/packages/core/admin/admin/src/content-manager/pages/App/index.js @@ -4,7 +4,7 @@ import { Switch, Route, useRouteMatch, Redirect, useLocation } from 'react-route import { CheckPagePermissions, LoadingIndicatorPage, - NotFound, + AnErrorOccurred, useGuidedTour, } from '@strapi/helper-plugin'; import { Layout, HeaderLayout, Main } from '@strapi/design-system'; @@ -104,7 +104,7 @@ const App = () => { - + diff --git a/packages/core/admin/admin/src/pages/MarketplacePage/components/EmptyNpmPackageSearch/index.js b/packages/core/admin/admin/src/pages/MarketplacePage/components/EmptyNpmPackageSearch/index.js index 7195e01eb9..d7e458f5e5 100644 --- a/packages/core/admin/admin/src/pages/MarketplacePage/components/EmptyNpmPackageSearch/index.js +++ b/packages/core/admin/admin/src/pages/MarketplacePage/components/EmptyNpmPackageSearch/index.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Typography, Box, Flex, Icon } from '@strapi/design-system'; -import { EmptyStateDocument } from '@strapi/icons'; +import { EmptyDocuments } from '@strapi/icons'; import { EmptyNpmPackageGrid } from './EmptyNpmPackageGrid'; const EmptyNpmPackageSearch = ({ content }) => { @@ -10,7 +10,7 @@ const EmptyNpmPackageSearch = ({ content }) => { - + {content} diff --git a/packages/core/content-type-builder/admin/src/components/AttributeOptions/EmptyAttributes/index.js b/packages/core/content-type-builder/admin/src/components/AttributeOptions/EmptyAttributes/index.js index 686d5cd452..d07ba8c617 100644 --- a/packages/core/content-type-builder/admin/src/components/AttributeOptions/EmptyAttributes/index.js +++ b/packages/core/content-type-builder/admin/src/components/AttributeOptions/EmptyAttributes/index.js @@ -3,7 +3,7 @@ import styled from 'styled-components'; import { useIntl } from 'react-intl'; import qs from 'qs'; import { Box, Flex, Typography, LinkButton, Icon } from '@strapi/design-system'; -import { Plus, EmptyStateDocument } from '@strapi/icons'; +import { Plus, EmptyDocuments } from '@strapi/icons'; import { getTrad } from '../../../utils'; const EmptyCard = styled(Box)` @@ -38,7 +38,7 @@ const EmptyAttributes = () => { - + diff --git a/packages/core/upload/admin/src/components/EmptyAssets/index.js b/packages/core/upload/admin/src/components/EmptyAssets/index.js index 4031a339eb..9747f8c636 100644 --- a/packages/core/upload/admin/src/components/EmptyAssets/index.js +++ b/packages/core/upload/admin/src/components/EmptyAssets/index.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Typography, Flex, Box, Icon } from '@strapi/design-system'; -import { EmptyStateDocuments } from '@strapi/icons'; +import { EmptyDocuments } from '@strapi/icons'; import { EmptyAssetGrid } from './EmptyAssetGrid'; export const EmptyAssets = ({ icon, content, action, size, count }) => { @@ -12,7 +12,7 @@ export const EmptyAssets = ({ icon, content, action, size, count }) => { - + {content} diff --git a/packages/generators/generators/lib/files/js/plugin/admin/src/pages/App/index.js b/packages/generators/generators/lib/files/js/plugin/admin/src/pages/App/index.js index b2d80ef744..c87a263d1c 100644 --- a/packages/generators/generators/lib/files/js/plugin/admin/src/pages/App/index.js +++ b/packages/generators/generators/lib/files/js/plugin/admin/src/pages/App/index.js @@ -7,7 +7,7 @@ import React from 'react'; import { Switch, Route } from 'react-router-dom'; -import { NotFound } from '@strapi/helper-plugin'; +import { AnErrorOccurred } from '@strapi/helper-plugin'; import pluginId from '../../pluginId'; import HomePage from '../HomePage'; @@ -16,7 +16,7 @@ const App = () => {
- +
); diff --git a/packages/generators/generators/lib/files/ts/plugin/admin/src/pages/App/index.tsx b/packages/generators/generators/lib/files/ts/plugin/admin/src/pages/App/index.tsx index b2d80ef744..c87a263d1c 100644 --- a/packages/generators/generators/lib/files/ts/plugin/admin/src/pages/App/index.tsx +++ b/packages/generators/generators/lib/files/ts/plugin/admin/src/pages/App/index.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { Switch, Route } from 'react-router-dom'; -import { NotFound } from '@strapi/helper-plugin'; +import { AnErrorOccurred } from '@strapi/helper-plugin'; import pluginId from '../../pluginId'; import HomePage from '../HomePage'; @@ -16,7 +16,7 @@ const App = () => {
- +
); diff --git a/packages/plugins/users-permissions/admin/src/pages/Roles/index.js b/packages/plugins/users-permissions/admin/src/pages/Roles/index.js index 9087ee2b7b..371f14b301 100644 --- a/packages/plugins/users-permissions/admin/src/pages/Roles/index.js +++ b/packages/plugins/users-permissions/admin/src/pages/Roles/index.js @@ -1,6 +1,6 @@ import React from 'react'; import { Switch, Route } from 'react-router-dom'; -import { CheckPagePermissions, NotFound } from '@strapi/helper-plugin'; +import { CheckPagePermissions, AnErrorOccurred } from '@strapi/helper-plugin'; import pluginId from '../../pluginId'; import pluginPermissions from '../../permissions'; import ProtectedRolesListPage from './ProtectedListPage'; @@ -18,7 +18,7 @@ const Roles = () => { /> - + ); diff --git a/scripts/remove-dist-tag.sh b/scripts/remove-dist-tag.sh new file mode 100755 index 0000000000..eea0ce25e2 --- /dev/null +++ b/scripts/remove-dist-tag.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Force start from root folder +cd "$(dirname "$0")/.." + +set -e + +distTag=$DIST_TAG + +# trim distTag for whitespace at the start and end +distTag=$(echo "$distTag" | xargs) + +if [[ -z "$distTag" ]]; then + echo "Please enter the dist-tag you want to remove" + read -r distTag +fi + +# Check if dist tag is latest, beta, alpha or next and reject +if [[ "$distTag" == "latest" || "$distTag" == "beta" || "$distTag" == "alpha" || "$distTag" == "next" ]]; then + echo "You cannot remove the dist-tag $distTag" + exit 1 +fi + +# Run npm dist-tag rm $distTag on each package +./node_modules/.bin/lerna exec --no-private --stream -- "npm dist-tag rm \$LERNA_PACKAGE_NAME $distTag"