From 2a6ed8a456281574f84654824f3a705c688d483d Mon Sep 17 00:00:00 2001 From: Batuhan Wilhelm Date: Wed, 18 Dec 2024 12:23:51 +0300 Subject: [PATCH 1/2] chore: add workflow dispatch --- .github/workflows/refine-registry-release.yml | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/refine-registry-release.yml b/.github/workflows/refine-registry-release.yml index cbaa43008a33..51c0ae7de999 100644 --- a/.github/workflows/refine-registry-release.yml +++ b/.github/workflows/refine-registry-release.yml @@ -1,6 +1,12 @@ name: Refine Registry Release on: + workflow_dispatch: + inputs: + release-only: + type: boolean + default: false + description: "If true, tests will be skipped." push: paths: - ".changeset/**" @@ -8,13 +14,11 @@ on: branches: - next -env: - RELEASE_ONLY: ${{ secrets.RELEASE_ONLY }} - jobs: publish: runs-on: ubuntu-latest + strategy: matrix: node-version: [18.x] @@ -40,19 +44,19 @@ jobs: run: pnpm install - name: Lint run: pnpm lint:ci - if: ${{ env.RELEASE_ONLY != 'YES' }} + if: ${{ github.event.inputs.release-only != 'true' }} - name: Syncpack run: pnpm sp lint - if: ${{ env.RELEASE_ONLY != 'YES' }} + if: ${{ github.event.inputs.release-only != 'true' }} - name: Publint run: pnpm publint:all - if: ${{ env.RELEASE_ONLY != 'YES' }} + if: ${{ github.event.inputs.release-only != 'true' }} - name: Are The Types Wrong run: pnpm attw:all - if: ${{ env.RELEASE_ONLY != 'YES' }} + if: ${{ github.event.inputs.release-only != 'true' }} - name: Test run: pnpm test:all - if: ${{ env.RELEASE_ONLY != 'YES' }} + if: ${{ github.event.inputs.release-only != 'true' }} - name: Prepare Community Edition changesets run: node .github/workflows/scripts/changesets/prepare-community-edition-changesets.js - name: Create Release Pull Request or Publish to npm From 074f1989485d0acb08a4a69664637fb52d8123c5 Mon Sep 17 00:00:00 2001 From: Batuhan Wilhelm Date: Wed, 18 Dec 2024 14:20:05 +0300 Subject: [PATCH 2/2] fix(cli): snapshots --- .../workflows/scripts/build-example-chunks.js | 1 + .nxignore | 1 + .prettierrc | 3 +- lerna.json | 2 +- .../__snapshots__/ant-design.spec.tsx.snap | 120 ++---------------- .../__snapshots__/react-router.spec.tsx.snap | 55 +------- 6 files changed, 22 insertions(+), 160 deletions(-) diff --git a/.github/workflows/scripts/build-example-chunks.js b/.github/workflows/scripts/build-example-chunks.js index 3b5c7d208b2c..b3b6e3d041e9 100755 --- a/.github/workflows/scripts/build-example-chunks.js +++ b/.github/workflows/scripts/build-example-chunks.js @@ -10,6 +10,7 @@ const ignoredRegexes = [ /^with-nx/, /with-nextjs-headless/, /^blog-/, + /store/, ]; const CHUNK_COUNT = Number(process.env.CHUNKS ? process.env.CHUNKS : 1); const BASE_REF = process.env.BASE_REF ? process.env.BASE_REF : "main"; diff --git a/.nxignore b/.nxignore index 45932ef252a3..0ffd45292abb 100644 --- a/.nxignore +++ b/.nxignore @@ -42,3 +42,4 @@ examples/with-vite examples/mern-dashboard-client examples/with-nextjs-headless examples/blog-* +examples/store diff --git a/.prettierrc b/.prettierrc index 9da805e61e6b..3a0686878ba6 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,5 +4,6 @@ "trailingComma": "all", "singleQuote": false, "printWidth": 80, - "tabWidth": 2 + "tabWidth": 2, + "organizeImportsSkipDestructiveCodeActions": true } diff --git a/lerna.json b/lerna.json index 3b3fe6dddc03..2f940b2f474e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "packages": ["packages/*", "examples/*"], - "ignore": "{monorepo-*,with-nx,blog-*,mern-dashboard-client,with-nextjs-headless}", + "ignore": "{monorepo-*,with-nx,blog-*,mern-dashboard-client,with-nextjs-headless,store}", "version": "4.0.0", "stream": true, "npmClient": "pnpm" diff --git a/packages/cli/src/transformers/integrations/__snapshots__/ant-design.spec.tsx.snap b/packages/cli/src/transformers/integrations/__snapshots__/ant-design.spec.tsx.snap index 150697e6867d..17dbd16f201a 100644 --- a/packages/cli/src/transformers/integrations/__snapshots__/ant-design.spec.tsx.snap +++ b/packages/cli/src/transformers/integrations/__snapshots__/ant-design.spec.tsx.snap @@ -41,121 +41,23 @@ const App = () => { export default App; ---------------------------------------------------- 1`] = ` -"import { GitHubBanner, Refine, WelcomePage } from "@refinedev/core"; -import { - useNotificationProvider, - RefineThemes, - ThemedLayoutV2, +"import { ErrorComponent, -} from "@refinedev/antd"; -import dataProvider from "@refinedev/simple-rest"; -import routerProvider, { - UnsavedChangesNotifier, - DocumentTitleHandler, -} from "@refinedev/react-router"; - -import { BrowserRouter, Route, Routes, Outlet } from "react-router"; - -import { ConfigProvider, App as AntdApp } from "antd"; -import "@refinedev/antd/dist/reset.css"; - -const App = () => { - return ( - - - - - - - - - - } - > - } /> - } /> - - - - - - - - - ); -}; - -export default App;" -`; - -exports[`ant-design transformer should transform the file ----------------------------------------------------- -import { - GitHubBanner, - Refine, - ErrorComponent, - WelcomePage, -} from "@refinedev/core"; -import dataProvider from "@refinedev/simple-rest"; -import routerProvider, { - UnsavedChangesNotifier, - DocumentTitleHandler, -} from "@refinedev/react-router"; - -import { BrowserRouter, Route, Routes } from "react-router"; - -const App = () => { - return ( - - - - - } /> - } /> - - - - - - ); -}; - -export default App; ----------------------------------------------------- 1`] = ` -"import { GitHubBanner, Refine, WelcomePage } from "@refinedev/core"; -import { - useNotificationProvider, RefineThemes, ThemedLayoutV2, - ErrorComponent, + useNotificationProvider, } from "@refinedev/antd"; -import dataProvider from "@refinedev/simple-rest"; +import { GitHubBanner, Refine, WelcomePage } from "@refinedev/core"; import routerProvider, { - UnsavedChangesNotifier, DocumentTitleHandler, + UnsavedChangesNotifier, } from "@refinedev/react-router"; +import dataProvider from "@refinedev/simple-rest"; -import { BrowserRouter, Route, Routes, Outlet } from "react-router"; +import { BrowserRouter, Outlet, Route, Routes } from "react-router"; -import { ConfigProvider, App as AntdApp } from "antd"; import "@refinedev/antd/dist/reset.css"; +import { App as AntdApp, ConfigProvider } from "antd"; const App = () => { return ( @@ -212,9 +114,9 @@ export default App; ---------------------------------------------------- 1`] = ` "import { Refine, WelcomePage } from "@refinedev/core"; -import { useNotificationProvider, RefineThemes } from "@refinedev/antd"; -import { ConfigProvider, App as AntdApp } from "antd"; +import { RefineThemes, useNotificationProvider } from "@refinedev/antd"; import "@refinedev/antd/dist/reset.css"; +import { App as AntdApp, ConfigProvider } from "antd"; function App() { return ( @@ -255,9 +157,9 @@ export default App; ---------------------------------------------------- 1`] = ` "import { Refine, WelcomePage } from "@refinedev/core"; -import { useNotificationProvider, RefineThemes } from "@refinedev/antd"; -import { ConfigProvider, App as AntdApp } from "antd"; +import { RefineThemes, useNotificationProvider } from "@refinedev/antd"; import "@refinedev/antd/dist/reset.css"; +import { App as AntdApp, ConfigProvider } from "antd"; function App() { return ( diff --git a/packages/cli/src/transformers/integrations/__snapshots__/react-router.spec.tsx.snap b/packages/cli/src/transformers/integrations/__snapshots__/react-router.spec.tsx.snap index b37f93f96505..e581a5e7726f 100644 --- a/packages/cli/src/transformers/integrations/__snapshots__/react-router.spec.tsx.snap +++ b/packages/cli/src/transformers/integrations/__snapshots__/react-router.spec.tsx.snap @@ -14,10 +14,10 @@ function App() { export default App; ---------------------------------------------------- 1`] = ` -"import { Refine, WelcomePage, ErrorComponent } from "@refinedev/core"; +"import { ErrorComponent, Refine, WelcomePage } from "@refinedev/core"; import routerProvider from "@refinedev/react-router"; -import { BrowserRouter, Routes, Route } from "react-router"; +import { BrowserRouter, Route, Routes } from "react-router"; function App() { return ( @@ -54,10 +54,10 @@ function App() { export default App; ---------------------------------------------------- 1`] = ` -"import { Refine, WelcomePage, ErrorComponent } from "@refinedev/core"; +"import { ErrorComponent, Refine, WelcomePage } from "@refinedev/core"; import routerProvider from "@refinedev/react-router"; -import { BrowserRouter, Routes, Route } from "react-router"; +import { BrowserRouter, Route, Routes } from "react-router"; import { UseListExample, UseOneExample, UseUpdateExample } from "examples"; @@ -102,53 +102,10 @@ function App() { export default App; ---------------------------------------------------- 1`] = ` -"import { Refine, WelcomePage, ErrorComponent } from "@refinedev/core"; +"import { ErrorComponent, Refine, WelcomePage } from "@refinedev/core"; import routerProvider from "@refinedev/react-router"; -import { BrowserRouter, Routes, Route } from "react-router"; - -function App() { - return ( - - - - } /> - } /> - - - - ); -} - -export default App;" -`; - -exports[`react-router transformer should transform the file ----------------------------------------------------- -import { Refine, WelcomePage, ErrorComponent } from "@refinedev/core"; - -import routerProvider from "@refinedev/react-router"; -import { BrowserRouter, Routes, Route } from "react-router"; - -function App() { - return ( - - - - } /> - } /> - - - - ); -} - -export default App; ----------------------------------------------------- 1`] = ` -"import { Refine, WelcomePage, ErrorComponent } from "@refinedev/core"; - -import routerProvider from "@refinedev/react-router"; -import { BrowserRouter, Routes, Route } from "react-router"; +import { BrowserRouter, Route, Routes } from "react-router"; function App() { return (