diff --git a/.github/actions/prepare-playground/action.yml b/.github/actions/prepare-playground/action.yml index 0a2e1c94f4..859454033e 100644 --- a/.github/actions/prepare-playground/action.yml +++ b/.github/actions/prepare-playground/action.yml @@ -5,7 +5,7 @@ runs: steps: - name: Fetch trunk shell: bash - run: git fetch origin trunk --depth=1 + run: git fetch origin trunk --depth=1 --recurse-submodules - uses: actions/setup-node@v4 with: node-version: 18 diff --git a/.github/workflows/build-website.yml b/.github/workflows/build-website.yml index 58ef6f8ae0..00e29886d6 100644 --- a/.github/workflows/build-website.yml +++ b/.github/workflows/build-website.yml @@ -29,7 +29,9 @@ jobs: environment: name: playground-wordpress-net-wp-cloud steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + submodules: true - uses: ./.github/actions/prepare-playground - run: npm run build - run: tar -czf wasm-wordpress-net.tar.gz dist/packages/playground/wasm-wordpress-net diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f85003f768..7b0eed0ec2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: true - uses: ./.github/actions/prepare-playground - run: npx nx affected --target=lint - run: npx nx affected --target=typecheck @@ -26,6 +28,8 @@ jobs: needs: [lint-and-typecheck] steps: - uses: actions/checkout@v4 + with: + submodules: true - uses: ./.github/actions/prepare-playground - run: node --expose-gc node_modules/nx/bin/nx affected --target=test --configuration=ci test-e2e: @@ -34,6 +38,8 @@ jobs: # Run as root to allow node to bind to port 80 steps: - uses: actions/checkout@v4 + with: + submodules: true - uses: ./.github/actions/prepare-playground - run: sudo ./node_modules/.bin/cypress install --force - run: sudo CYPRESS_CI=1 npx nx e2e playground-website --configuration=ci --verbose @@ -49,6 +55,8 @@ jobs: needs: [lint-and-typecheck] steps: - uses: actions/checkout@v4 + with: + submodules: true - uses: ./.github/actions/prepare-playground - name: Install Playwright Browsers run: sudo npx playwright install --with-deps @@ -70,6 +78,8 @@ jobs: part: ['chromium', 'firefox', 'webkit'] steps: - uses: actions/checkout@v4 + with: + submodules: true - uses: ./.github/actions/prepare-playground - name: Download dist uses: actions/download-artifact@v4 @@ -104,6 +114,8 @@ jobs: needs: [lint-and-typecheck] steps: - uses: actions/checkout@v4 + with: + submodules: true - uses: ./.github/actions/prepare-playground - run: npx nx affected --target=build --parallel=3 --verbose @@ -128,6 +140,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: true - uses: ./.github/actions/prepare-playground - run: npm run build:docs - uses: actions/upload-pages-artifact@v1 diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml index eb744c272b..5ba59b18ac 100644 --- a/.github/workflows/publish-npm-packages.yml +++ b/.github/workflows/publish-npm-packages.yml @@ -40,6 +40,7 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} clean: true persist-credentials: false + submodules: true - name: Config git user run: | git config --global user.name "deployment_bot" diff --git a/.github/workflows/refresh-sqlite-integration.yml b/.github/workflows/refresh-sqlite-integration.yml index 6088e40f83..dc82866ca5 100644 --- a/.github/workflows/refresh-sqlite-integration.yml +++ b/.github/workflows/refresh-sqlite-integration.yml @@ -23,11 +23,12 @@ jobs: concurrency: group: check-version-and-run-build steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} clean: true persist-credentials: false + submodules: true - uses: ./.github/actions/prepare-playground - name: 'Refresh the SQLite bundle' shell: bash diff --git a/.github/workflows/refresh-wordpress-major-and-beta.yml b/.github/workflows/refresh-wordpress-major-and-beta.yml index a4336d79c3..40b412d06f 100644 --- a/.github/workflows/refresh-wordpress-major-and-beta.yml +++ b/.github/workflows/refresh-wordpress-major-and-beta.yml @@ -28,11 +28,12 @@ jobs: concurrency: group: check-version-and-run-build steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} clean: true persist-credentials: false + submodules: true - name: 'Install bun' run: | curl -fsSL https://bun.sh/install | bash diff --git a/.github/workflows/refresh-wordpress-nightly.yml b/.github/workflows/refresh-wordpress-nightly.yml index ed1ea9abde..df415dce13 100644 --- a/.github/workflows/refresh-wordpress-nightly.yml +++ b/.github/workflows/refresh-wordpress-nightly.yml @@ -21,11 +21,12 @@ jobs: environment: name: wordpress-assets steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} clean: true persist-credentials: false + submodules: true - uses: ./.github/actions/prepare-playground - name: 'Install bun' run: | diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index fc9c29a2ab..9313c6799c 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -31,14 +31,15 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: + submodules: true ref: trunk clean: true persist-credentials: false - name: Fetch trunk shell: bash - run: git fetch origin trunk --depth=1 + run: git fetch origin trunk --depth=1 --recurse-submodules - name: 'Install bun (for the changelog)' run: | curl -fsSL https://bun.sh/install | bash diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..3a4bb43c06 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "isomorphic-git"] + path="isomorphic-git" + url=git@github.com:adamziel/isomorphic-git.git diff --git a/README.md b/README.md index 75b8bd2135..3d19e4f660 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ The vanilla `git clone` command will take ages. Here's a faster alternative that only pull the latest revision of the trunk branch: ``` -git clone -b trunk --single-branch --depth 1 git@github.com:WordPress/wordpress-playground.git +git clone -b trunk --single-branch --depth 1 --recurse-submodules git@github.com:WordPress/wordpress-playground.git ``` ## Running WordPress Playground locally @@ -92,7 +92,7 @@ git clone -b trunk --single-branch --depth 1 git@github.com:WordPress/wordpress- You also can run WordPress Playground locally as follows: ```bash -git clone -b trunk --single-branch --depth 1 git@github.com:WordPress/wordpress-playground.git +git clone -b trunk --single-branch --depth 1 --recurse-submodules git@github.com:WordPress/wordpress-playground.git cd wordpress-playground npm install npm run dev diff --git a/isomorphic-git b/isomorphic-git new file mode 160000 index 0000000000..cdca7e5dbf --- /dev/null +++ b/isomorphic-git @@ -0,0 +1 @@ +Subproject commit cdca7e5dbf9bc4654eab3465ceab64a54ab30a76 diff --git a/package-lock.json b/package-lock.json index b8f8ca9bc2..ce6214df52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,21 +20,27 @@ "@types/react-transition-group": "4.4.11", "@types/wicg-file-system-access": "2023.10.5", "ajv": "8.12.0", + "async-lock": "1.4.1", "axios": "1.6.1", "classnames": "^2.3.2", "comlink": "^4.4.1", + "crc-32": "1.2.2", + "diff3": "0.0.4", "express": "4.19.2", "file-saver": "^2.0.5", "fs-extra": "11.1.1", "ini": "4.1.2", "octokit": "3.1.1", "octokit-plugin-create-pull-request": "5.1.1", + "pako": "1.0.10", "react": "^18.2.25", "react-dom": "^18.2.25", "react-hook-form": "7.53.0", "react-modal": "^3.16.1", "react-redux": "8.1.3", "react-transition-group": "4.4.5", + "sha.js": "2.4.11", + "sha1": "1.1.1", "unzipper": "0.10.11", "vite-plugin-api": "1.0.4", "wouter": "3.3.5", @@ -19795,6 +19801,12 @@ "dev": true, "license": "MIT" }, + "node_modules/async-lock": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/async-lock/-/async-lock-1.4.1.tgz", + "integrity": "sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ==", + "license": "MIT" + }, "node_modules/asynckit": { "version": "0.4.0", "license": "MIT" @@ -21490,6 +21502,15 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, "node_modules/check-error": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", @@ -22589,6 +22610,18 @@ "node": ">=10" } }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/create-require": { "version": "1.1.1", "dev": true, @@ -22669,6 +22702,15 @@ "dev": true, "license": "MIT" }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, "node_modules/crypto-random-string": { "version": "2.0.0", "dev": true, @@ -24328,6 +24370,12 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/diff3": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/diff3/-/diff3-0.0.4.tgz", + "integrity": "sha512-f1rQ7jXDn/3i37hdwRk9ohqcvLRH3+gEIgmA6qEM280WUOh7cOr3GXV8Jm5sPwUs46Nzl48SE8YNLGJoaLuodg==", + "license": "MIT" + }, "node_modules/dir-glob": { "version": "3.0.1", "dev": true, @@ -36467,6 +36515,12 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/pako": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", + "license": "(MIT AND Zlib)" + }, "node_modules/param-case": { "version": "3.0.4", "dev": true, @@ -41320,6 +41374,32 @@ "version": "1.2.0", "license": "ISC" }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "license": "(MIT AND BSD-3-Clause)", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/sha1": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz", + "integrity": "sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==", + "license": "BSD-3-Clause", + "dependencies": { + "charenc": ">= 0.0.1", + "crypt": ">= 0.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/shallow-clone": { "version": "3.0.1", "dev": true, diff --git a/package.json b/package.json index d3763de549..4a6fed2903 100644 --- a/package.json +++ b/package.json @@ -61,21 +61,27 @@ "@types/react-transition-group": "4.4.11", "@types/wicg-file-system-access": "2023.10.5", "ajv": "8.12.0", + "async-lock": "1.4.1", "axios": "1.6.1", "classnames": "^2.3.2", "comlink": "^4.4.1", + "crc-32": "1.2.2", + "diff3": "0.0.4", "express": "4.19.2", "file-saver": "^2.0.5", "fs-extra": "11.1.1", "ini": "4.1.2", "octokit": "3.1.1", "octokit-plugin-create-pull-request": "5.1.1", + "pako": "1.0.10", "react": "^18.2.25", "react-dom": "^18.2.25", "react-hook-form": "7.53.0", "react-modal": "^3.16.1", "react-redux": "8.1.3", "react-transition-group": "4.4.5", + "sha.js": "2.4.11", + "sha1": "1.1.1", "unzipper": "0.10.11", "vite-plugin-api": "1.0.4", "wouter": "3.3.5", diff --git a/packages/docs/site/docs/developers/23-architecture/18-host-your-own-playground.md b/packages/docs/site/docs/developers/23-architecture/18-host-your-own-playground.md index f5969e9f85..cdc822ea38 100644 --- a/packages/docs/site/docs/developers/23-architecture/18-host-your-own-playground.md +++ b/packages/docs/site/docs/developers/23-architecture/18-host-your-own-playground.md @@ -58,7 +58,7 @@ The most flexible and customizable method is to build the site locally. Create a shallow clone of the Playground repository, or your own fork. ```sh -git clone -b trunk --single-branch --depth 1 git@github.com:WordPress/wordpress-playground.git +git clone -b trunk --single-branch --depth 1 --recurse-submodules git@github.com:WordPress/wordpress-playground.git ``` Enter the `wordpress-playground` directory. diff --git a/packages/docs/site/docs/main/contributing/code.md b/packages/docs/site/docs/main/contributing/code.md index fa1c084d83..b35c447767 100644 --- a/packages/docs/site/docs/main/contributing/code.md +++ b/packages/docs/site/docs/main/contributing/code.md @@ -26,7 +26,7 @@ Be sure to review the following resources before you begin: [Fork the Playground repository](https://github.com/WordPress/wordpress-playground/fork) and clone it to your local machine. To do that, copy and paste these commands into your terminal: ```bash -git clone -b trunk --single-branch --depth 1 +git clone -b trunk --single-branch --depth 1 --recurse-submodules # replace `YOUR-GITHUB-USERNAME` with your GitHub username: git@github.com:YOUR-GITHUB-USERNAME/wordpress-playground.git diff --git a/packages/playground/components/index.html b/packages/playground/components/index.html index 840d9d8632..f36f85e15f 100644 --- a/packages/playground/components/index.html +++ b/packages/playground/components/index.html @@ -7,6 +7,6 @@
- +