diff --git a/.github/workflows/e2e-next-faustwp-example.yml b/.github/workflows/e2e-next-faustwp-example.yml index 5eeb42693..a47972917 100644 --- a/.github/workflows/e2e-next-faustwp-example.yml +++ b/.github/workflows/e2e-next-faustwp-example.yml @@ -4,14 +4,12 @@ on: pull_request: paths: - 'examples/next/**' + - '.github/workflows/e2e-next-faustwp-example.yml' jobs: e2e-test-faustwp-getting-started-example: name: (faustwp) Next Getting Started Example on Node ${{ matrix.node }} runs-on: ubuntu-22.04 - env: - PR_REPO: ${{github.event.pull_request.head.repo.full_name}} - PR_BRANCH: ${{github.event.pull_request.head.ref}} strategy: matrix: node: ['20', '22', '24'] @@ -25,48 +23,20 @@ jobs: uses: actions/setup-node@v7 with: node-version: ${{ matrix.node }} - # Get the PR branch so we can pull the correct Next.js example path - - name: echo current pr branch name + # Copy the example from this checkout so the app is built from the + # PR's own example source. + - name: copy getting started example run: | - echo $PR_BRANCH - # Get the PR repo so we can pull the correct Next.js example path - - name: echo current pr repo - run: | - echo $PR_REPO - # Install the Faust.js Next getting started example via npx create next app - # and use the PR branch to pull the correct example URL - - name: npx create next app - run: | - npx create-next-app@13 \ - -e https://github.com/${PR_REPO}/tree/${PR_BRANCH} \ - --example-path examples/next/faustwp-getting-started \ - --use-npm \ - e2e-app + cp -r examples/next/faustwp-getting-started e2e-app - name: install and build packages working-directory: ./ run: | npm ci npm run build - # To ensure PR changes are tested accurately, we replace the - # faust node_modules downloaded from NPM with the faust packages - # built in the previous step - # TODO: It would be nice to use symlink or npm link here, but upon - # writing this they do not function as expected on GH actions - - name: replace downloaded registry faust packages with local build - run: | - mkdir -p e2e-app/node_modules/@faustwp - rm -rf e2e-app/node_modules/@faustwp/cli - rm -rf e2e-app/node_modules/@faustwp/core - cp -r packages/faustwp-cli e2e-app/node_modules/@faustwp/cli - cp -r packages/faustwp-core e2e-app/node_modules/@faustwp/core - mkdir -p e2e-app/node_modules/.bin - ln -sf ../@faustwp/cli/dist/index.js e2e-app/node_modules/.bin/faust - chmod +x e2e-app/node_modules/@faustwp/cli/dist/index.js - # create-next-app's npm install may fail if @faustwp/* versions - # are not yet published. Point deps at local builds so npm install - # can resolve them and install all remaining dependencies. - # --install-links copies packages instead of symlinking, avoiding - # duplicate React instances from split module resolution. + # Point the app at the local package builds before its first install + # so npm installs their current dependencies. --install-links copies + # packages instead of symlinking, avoiding duplicate React instances + # from split module resolution. - name: install e2e-app dependencies working-directory: e2e-app run: | diff --git a/examples/next/faustwp-getting-started/package.json b/examples/next/faustwp-getting-started/package.json index f8cbeced4..703e9e7df 100644 --- a/examples/next/faustwp-getting-started/package.json +++ b/examples/next/faustwp-getting-started/package.json @@ -19,7 +19,7 @@ "graphql": "^16.12.0", "next": "^16.3.8", "react": "^18.3.1", - "react-dom": "^19.3.0", + "react-dom": "^18.3.1", "sass": "1.97.3" }, "devDependencies": { diff --git a/package-lock.json b/package-lock.json index 90573cc4a..d67e0a04d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,7 @@ "graphql": "^16.12.0", "next": "^16.3.8", "react": "^18.3.1", - "react-dom": "^19.3.0", + "react-dom": "^18.3.1", "sass": "1.97.3" }, "devDependencies": { @@ -102,18 +102,6 @@ } } }, - "examples/next/faustwp-getting-started/node_modules/react-dom": { - "version": "19.3.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.0.tgz", - "integrity": "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==", - "license": "MIT", - "dependencies": { - "scheduler": "^0.28.0" - }, - "peerDependencies": { - "react": "^19.3.0" - } - }, "examples/next/faustwp-getting-started/node_modules/sass": { "version": "1.97.3", "license": "MIT", @@ -132,12 +120,6 @@ "@parcel/watcher": "^2.4.1" } }, - "examples/next/faustwp-getting-started/node_modules/scheduler": { - "version": "0.28.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", - "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", - "license": "MIT" - }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", @@ -3226,13 +3208,6 @@ "@types/node": "*" } }, - "node_modules/@types/glob-to-regexp": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@types/glob-to-regexp/-/glob-to-regexp-0.4.4.tgz", - "integrity": "sha512-nDKoaKJYbnn1MZxUY0cA1bPmmgZbg0cTq7Rh13d0KWYNOiKbqoR+2d89SnRPszGh7ROzSwZ/GOjZ4jPbmmZ6Eg==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/graceful-fs": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", @@ -21892,16 +21867,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/regexparam": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-3.0.0.tgz", - "integrity": "sha512-RSYAtP31mvYLkAHrOlh25pCNQ5hWnT106VukGaaFfuJrZFkGRX5GhUAdPqpSDXxOhA2c4akmRuplv1mRqnBn6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/rehackt": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.1.0.tgz", @@ -24686,7 +24651,7 @@ }, "peerDependencies": { "react": "^18.0.0", - "react-dom": "^18.3.1" + "react-dom": "^18.0.0" } }, "packages/block-editor-utils/node_modules/@ariakit/components": { @@ -26501,7 +26466,7 @@ "@wordpress/style-engine": ">=1.18.0", "next": "^16.3.8", "react": ">=17.0.2", - "react-dom": "^18.3.1" + "react-dom": ">=17.0.2" } }, "packages/blocks/node_modules/@testing-library/dom": { @@ -26784,7 +26749,7 @@ "@wry/equality": "^0.5.6", "@wry/trie": "^0.5.0", "concurrently": "^7.6.0", - "fetch-mock": "12.6.0", + "fetch-mock": "9.11.0", "graphql-tag": "^2.12.6", "hoist-non-react-statics": "^3.3.2", "is-typedarray": "1.0.0", @@ -26815,7 +26780,7 @@ "@apollo/client": ">=3.6.6", "next": "^16.3.8", "react": ">=17.0.2", - "react-dom": "^18.3.1" + "react-dom": ">=17.0.2" } }, "packages/faustwp-core/node_modules/@apollo/client": { @@ -26978,22 +26943,6 @@ "node": ">=6" } }, - "packages/faustwp-core/node_modules/fetch-mock": { - "version": "12.6.0", - "resolved": "https://registry.npmjs.org/fetch-mock/-/fetch-mock-12.6.0.tgz", - "integrity": "sha512-oAy0OqAvjAvduqCeWveBix7LLuDbARPqZZ8ERYtBcCURA3gy7EALA3XWq0tCNxsSg+RmmJqyaeeZlOCV9abv6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/glob-to-regexp": "^0.4.4", - "dequal": "^2.0.3", - "glob-to-regexp": "^0.4.1", - "regexparam": "^3.0.0" - }, - "engines": { - "node": ">=18.11.0" - } - }, "packages/faustwp-core/node_modules/get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", diff --git a/packages/block-editor-utils/package.json b/packages/block-editor-utils/package.json index 2bd917d8e..354403265 100644 --- a/packages/block-editor-utils/package.json +++ b/packages/block-editor-utils/package.json @@ -7,7 +7,7 @@ "types": "dist/mjs/index.d.ts", "peerDependencies": { "react": "^18.0.0", - "react-dom": "^18.3.1" + "react-dom": "^18.0.0" }, "dependencies": { "@wordpress/block-editor": "^18.0.0", diff --git a/packages/blocks/package.json b/packages/blocks/package.json index cfde7b787..bc94a7b84 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -11,7 +11,7 @@ "@wordpress/style-engine": ">=1.18.0", "next": "^16.3.8", "react": ">=17.0.2", - "react-dom": "^18.3.1" + "react-dom": ">=17.0.2" }, "devDependencies": { "@testing-library/jest-dom": "^7.0.1", diff --git a/packages/faustwp-core/package.json b/packages/faustwp-core/package.json index c1e44f512..7b2c81072 100644 --- a/packages/faustwp-core/package.json +++ b/packages/faustwp-core/package.json @@ -9,7 +9,7 @@ "@apollo/client": ">=3.6.6", "next": "^16.3.8", "react": ">=17.0.2", - "react-dom": "^18.3.1" + "react-dom": ">=17.0.2" }, "devDependencies": { "@apollo/client": "^3.6.6", @@ -28,7 +28,7 @@ "@wry/equality": "^0.5.6", "@wry/trie": "^0.5.0", "concurrently": "^7.6.0", - "fetch-mock": "12.6.0", + "fetch-mock": "9.11.0", "graphql-tag": "^2.12.6", "hoist-non-react-statics": "^3.3.2", "is-typedarray": "1.0.0",