diff --git a/.github/actions/setup-project/action.yml b/.github/actions/setup-project/action.yml index 62fcb24..e4976ed 100644 --- a/.github/actions/setup-project/action.yml +++ b/.github/actions/setup-project/action.yml @@ -18,12 +18,3 @@ runs: - name: Install dependencies run: yarn shell: bash - - - name: Install React Dependencies in Root - shell: bash - run: | - cd ./packages/grapesjs-react && yarn add \ - react@^19.0.0 \ - react-dom@^19.0.0 \ - @types/react@^19.0.0 \ - @types/react-dom@^19.0.0 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 82d192a..51fa619 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -30,6 +30,15 @@ jobs: - name: Setup Project Base uses: ./.github/actions/setup-project + ## We specify the version of react and react-dom we want to run vite build with + - name: Install React Dependencies in Root + run: | + cd ./packages/grapesjs-react && yarn add \ + react@^19.0.0 \ + react-dom@^19.0.0 \ + @types/react@^19.0.0 \ + @types/react-dom@^19.0.0 + - name: Build Core run: yarn workspace @grapesjs/react run build diff --git a/.github/workflows/release-grapesjs-react-latest.yml b/.github/workflows/release-grapesjs-react-latest.yml deleted file mode 100644 index 421b348..0000000 --- a/.github/workflows/release-grapesjs-react-latest.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Publish GrapesJS React latest -on: - push: - branches: [main] - -jobs: - publish: - if: "contains(github.event.head_commit.message, 'Release GrapesJS React latest:')" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup project - uses: ./.github/actions/setup-project - - name: Build - run: yarn build:core - - name: Publish to npm - env: - NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} - run: | - echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> ./packages/grapesjs-react/.npmrc - yarn publish:core:latest diff --git a/package.json b/package.json index 288a05b..a7e8b25 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,7 @@ "clean": "find . -type d \\( -name \"node_modules\" -o -name \"build\" -o -name \"dist\" \\) -exec rm -rf {} + && rm ./yarn.lock", "build:core": "yarn workspace @grapesjs/react run build", "build:app-18": "yarn workspace @grapesjs/react-app-18 run build", - "build:app-19": "yarn workspace @grapesjs/react-app-19 run build", - "release:core:latest": "ts-node scripts/releaseCore latest", - "publish:core:latest": "cd packages/grapesjs-react && npm publish --access public" + "build:app-19": "yarn workspace @grapesjs/react-app-19 run build" }, "workspaces": { "packages": [ diff --git a/scripts/common.ts b/scripts/common.ts deleted file mode 100644 index d4fb423..0000000 --- a/scripts/common.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { execSync } from "child_process"; - -export function runCommand(command: string, error?: string) { - try { - return (execSync(command, { stdio: "inherit" }) || "").toString().trim(); - } catch (err) { - console.error(error || `Error while running command: ${command}`); - throw err; - } -} diff --git a/scripts/releaseCore.ts b/scripts/releaseCore.ts deleted file mode 100644 index 110ef1e..0000000 --- a/scripts/releaseCore.ts +++ /dev/null @@ -1,45 +0,0 @@ -import fs from "fs"; -import { resolve } from "path"; -import { runCommand } from "./common"; - -const grapesJSReactPath = resolve(__dirname, "../packages/grapesjs-react"); - -async function prepareReleaseGrapesJSReact() { - try { - const releaseTag = process.argv[2] || "rc"; - console.log("Prepare release GrapesJS tag:", releaseTag); - - runCommand( - "git diff-index --quiet HEAD --", - "You have uncommitted changes. Please commit or stash them before running the release script." - ); - - const versionCmd = - releaseTag === "latest" - ? "--patch" - : `--prerelease --preid ${releaseTag}`; - runCommand( - `yarn workspace @grapesjs/react version ${versionCmd} --no-git-tag-version --no-commit-hooks` - ); - - // Create a new release branch - const newVersion = JSON.parse( - fs.readFileSync(`${grapesJSReactPath}/package.json`, "utf8") - ).version; - const newBranch = `release-v${newVersion}`; - runCommand(`git checkout -b ${newBranch}`); - runCommand("git add ."); - runCommand( - `git commit -m "Release GrapesJS React ${releaseTag}: v${newVersion}"` - ); - - console.log( - `Release prepared! Push the current "${newBranch}" branch and open a new PR targeting 'main'` - ); - } catch (error) { - console.error(error); - process.exit(1); - } -} - -prepareReleaseGrapesJSReact();