Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
58e4367
deps: update to react 19
danstarns Jan 31, 2025
33eef8d
package: move react and grapes to peers + add clean script
danstarns Feb 3, 2025
4bfe79a
refactor: move example app to 19
danstarns Feb 3, 2025
c493b60
feat: add react app 18 example
danstarns Feb 3, 2025
56ca50a
further changes to support react 18 + 19
danstarns Feb 3, 2025
75970fc
refactor: use create root for react 19 demo
danstarns Feb 4, 2025
8bf3ebe
package: updates *
danstarns Feb 4, 2025
f8b9f0b
yarn lock *
danstarns Feb 4, 2025
dee0ea2
ci: init
danstarns Feb 4, 2025
a9809e9
ci: add core build
danstarns Feb 4, 2025
9a6049f
ci: *
danstarns Feb 4, 2025
3c83fb1
ci: *
danstarns Feb 4, 2025
afff6d9
ci: *
danstarns Feb 5, 2025
97c0b1b
ci: *
danstarns Feb 5, 2025
c50ce78
feat: add docker files
danstarns Feb 5, 2025
553a949
*
danstarns Feb 5, 2025
67c8e32
docker *
danstarns Feb 5, 2025
8b295d1
apply react codemod
danstarns Feb 5, 2025
18e0509
*
danstarns Feb 5, 2025
4a1967c
ci: *
danstarns Feb 5, 2025
291e0d6
*
danstarns Feb 5, 2025
63ae684
*
danstarns Feb 5, 2025
3b13b45
fix build errors?
danstarns Feb 5, 2025
4efd8ef
fix errors 2?
danstarns Feb 5, 2025
5cbba9d
fix 3
danstarns Feb 5, 2025
a73b018
*
danstarns Feb 5, 2025
af306b2
*
danstarns Feb 5, 2025
3fc3f4b
*
danstarns Feb 5, 2025
4dc5f0b
*
danstarns Feb 5, 2025
53771f2
feat: add two simple examples in 18 & 19
danstarns Feb 7, 2025
c38067b
fix: use import type newline vs same
danstarns Feb 7, 2025
a08a910
fix: build cjs main
danstarns Feb 7, 2025
4675a6b
fix: cjs and exclude react jsx runtime from build
danstarns Feb 7, 2025
7811a3e
refactor: remove simple example
danstarns Feb 7, 2025
7e5c319
pkg fix
danstarns Feb 7, 2025
3be616b
ci *
danstarns Feb 7, 2025
4c17982
ci: add release runners (#25)
danstarns Feb 12, 2025
8738977
Revert "ci: add release runners (#25)" (#26)
danstarns Feb 12, 2025
ed5f309
React 19 release (#27)
danstarns Feb 12, 2025
bd09397
Merge branch 'main' into react-19
danstarns Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ 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
9 changes: 0 additions & 9 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ 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

Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/release-grapesjs-react-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"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"
"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"
},
"workspaces": {
"packages": [
Expand Down
10 changes: 10 additions & 0 deletions scripts/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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;
}
}
45 changes: 45 additions & 0 deletions scripts/releaseCore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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();