From e1dd3292f9977bdd19a14f374d4a2b21a21ecb58 Mon Sep 17 00:00:00 2001 From: Josh <37798644+joshuaellis@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:23:17 +0100 Subject: [PATCH 1/5] chore: add inputs & remove-dist-tag script --- .github/workflows/experimental.yml | 6 +++++- .github/workflows/remove-dist-tag.yml | 28 ++++++++++++++++++++++++++ scripts/remove-dist-tag.sh | 29 +++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/remove-dist-tag.yml create mode 100755 scripts/remove-dist-tag.sh diff --git a/.github/workflows/experimental.yml b/.github/workflows/experimental.yml index 61b0bff39a..7336d3d540 100644 --- a/.github/workflows/experimental.yml +++ b/.github/workflows/experimental.yml @@ -2,6 +2,10 @@ name: 'Experimental Releases' on: workflow_dispatch: + inputs: + dist-tag: + description: 'The tag you want to remove from 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/scripts/remove-dist-tag.sh b/scripts/remove-dist-tag.sh new file mode 100755 index 0000000000..dd87f231be --- /dev/null +++ b/scripts/remove-dist-tag.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Force start from root folder +cd "$(dirname "$0")/.." + +set -e + +distTag=$DIST_TAG + +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 + +# Get all the packages +packages=$(./node_modules/.bin/lerna ls) + +# Loop through the packages +for package in $packages; do + echo "Removing dist-tag $distTag from $package" + # Run npm dist-tag rm $distTag + npm dist-tag rm $package $distTag +done \ No newline at end of file From 88c2b66e8d7f1501cb54022d761739afd7466b8e Mon Sep 17 00:00:00 2001 From: Josh <37798644+joshuaellis@users.noreply.github.com> Date: Thu, 30 Mar 2023 16:19:36 +0100 Subject: [PATCH 2/5] chore: use lerna exec Update .github/workflows/experimental.yml --- .github/workflows/experimental.yml | 2 +- scripts/remove-dist-tag.sh | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/experimental.yml b/.github/workflows/experimental.yml index 7336d3d540..3520486ab7 100644 --- a/.github/workflows/experimental.yml +++ b/.github/workflows/experimental.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: dist-tag: - description: 'The tag you want to remove from NPM' + description: 'The tag you want to publish to NPM' default: 'experimental' permissions: diff --git a/scripts/remove-dist-tag.sh b/scripts/remove-dist-tag.sh index dd87f231be..7e76634cb1 100755 --- a/scripts/remove-dist-tag.sh +++ b/scripts/remove-dist-tag.sh @@ -18,12 +18,5 @@ if [[ "$distTag" == "latest" || "$distTag" == "beta" || "$distTag" == "alpha" || exit 1 fi -# Get all the packages -packages=$(./node_modules/.bin/lerna ls) - -# Loop through the packages -for package in $packages; do - echo "Removing dist-tag $distTag from $package" - # Run npm dist-tag rm $distTag - npm dist-tag rm $package $distTag -done \ No newline at end of file +# 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" \ No newline at end of file From 3b0c2be74fa8e6f1529422743318e6cfc0a833a7 Mon Sep 17 00:00:00 2001 From: Josh <37798644+joshuaellis@users.noreply.github.com> Date: Fri, 31 Mar 2023 08:35:13 +0100 Subject: [PATCH 3/5] chore: trim distTag Update scripts/remove-dist-tag.sh Co-Authored-By: Ben Irvin --- scripts/remove-dist-tag.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/remove-dist-tag.sh b/scripts/remove-dist-tag.sh index 7e76634cb1..eea0ce25e2 100755 --- a/scripts/remove-dist-tag.sh +++ b/scripts/remove-dist-tag.sh @@ -7,6 +7,9 @@ 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 @@ -19,4 +22,4 @@ if [[ "$distTag" == "latest" || "$distTag" == "beta" || "$distTag" == "alpha" || 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" \ No newline at end of file +./node_modules/.bin/lerna exec --no-private --stream -- "npm dist-tag rm \$LERNA_PACKAGE_NAME $distTag" From ac55981e236b42ce0d87d3f06d10176f591dca6c Mon Sep 17 00:00:00 2001 From: Josh <37798644+joshuaellis@users.noreply.github.com> Date: Tue, 11 Apr 2023 08:31:18 +0100 Subject: [PATCH 4/5] chore: rename experimental to publish-prerelease --- .github/workflows/{experimental.yml => publish-prerelease.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{experimental.yml => publish-prerelease.yml} (96%) diff --git a/.github/workflows/experimental.yml b/.github/workflows/publish-prerelease.yml similarity index 96% rename from .github/workflows/experimental.yml rename to .github/workflows/publish-prerelease.yml index 3520486ab7..530e5563c3 100644 --- a/.github/workflows/experimental.yml +++ b/.github/workflows/publish-prerelease.yml @@ -1,4 +1,4 @@ -name: 'Experimental Releases' +name: 'Publish Prerelease' on: workflow_dispatch: From eb2cf3a987b37526fb27314ffa04e58356e5cdb6 Mon Sep 17 00:00:00 2001 From: Mark Kaylor Date: Tue, 11 Apr 2023 10:03:32 +0200 Subject: [PATCH 5/5] Fix components not found --- .../core/admin/admin/src/content-manager/pages/App/index.js | 4 ++-- .../MarketplacePage/components/EmptyNpmPackageSearch/index.js | 4 ++-- .../src/components/AttributeOptions/EmptyAttributes/index.js | 4 ++-- .../core/upload/admin/src/components/EmptyAssets/index.js | 4 ++-- .../lib/files/js/plugin/admin/src/pages/App/index.js | 4 ++-- .../lib/files/ts/plugin/admin/src/pages/App/index.tsx | 4 ++-- .../plugins/users-permissions/admin/src/pages/Roles/index.js | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) 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 = () => { /> - + );