Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native git support: lsRefs(), sparseCheckout(), GitPathControl #1764

Merged
merged 29 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1fd37ca
Git sparseCheckout function
adamziel Sep 14, 2024
beb55b8
implement listFiles() function
adamziel Sep 14, 2024
3169b88
Git repository browser
adamziel Sep 16, 2024
1c2a600
Pivot into GitPathControl
adamziel Sep 17, 2024
c96300a
Improve the git file picker interactions
adamziel Sep 18, 2024
f70e71b
Make GitPathControl a Button
adamziel Sep 18, 2024
67c0144
Make repo and branch configurable
adamziel Sep 18, 2024
04cb1a1
Add error handling
adamziel Sep 18, 2024
cd96f62
Split the demo into separate components, provide accessible interactions
adamziel Sep 19, 2024
eb75866
Potentially finished GitFilePickerControl
adamziel Sep 19, 2024
5be5c9e
Multiple path mappings support
adamziel Sep 19, 2024
066a6d5
Delete button (not working for now)
adamziel Sep 19, 2024
d73d35c
Include isomorphic-git as a submodule
adamziel Oct 7, 2024
3881125
Merge branch 'trunk' into git-sparse-checkout
adamziel Oct 7, 2024
57ae1b1
Merge trunk
adamziel Oct 7, 2024
701596c
Adjust the doc strings
adamziel Oct 7, 2024
7a8e6ea
Fix TS type errors
adamziel Oct 7, 2024
5d54f80
Adjust imports
adamziel Oct 7, 2024
d20c638
Remove the reference to ../../../types/isomorphic-git.d.t
adamziel Oct 7, 2024
f9d1b9d
Add --recurse-submodules to all clones
adamziel Oct 7, 2024
eeca388
Add a few more --recurse-submodules
adamziel Oct 7, 2024
4399074
Checkout submodules in CI
adamziel Oct 7, 2024
58b5621
Add .gitmodules
adamziel Oct 7, 2024
157199f
Support CSS modules in Playground components
adamziel Oct 7, 2024
dbafd1d
Use cssmodules in types, not files
adamziel Oct 7, 2024
9407555
Update tsconfig.spec.json
adamziel Oct 7, 2024
263b37b
Update tsconfig.lib.json
adamziel Oct 7, 2024
34e8580
Checkout submodules in test-unit action
adamziel Oct 7, 2024
b75222e
Adjust the unit tests
adamziel Oct 7, 2024
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
2 changes: 1 addition & 1 deletion .github/actions/prepare-playground/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/refresh-sqlite-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/refresh-wordpress-major-and-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/refresh-wordpress-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "isomorphic-git"]
path="isomorphic-git"
[email protected]:adamziel/isomorphic-git.git
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ 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 [email protected]:WordPress/wordpress-playground.git
git clone -b trunk --single-branch --depth 1 --recurse-submodules [email protected]:WordPress/wordpress-playground.git
```

## Running WordPress Playground locally

You also can run WordPress Playground locally as follows:

```bash
git clone -b trunk --single-branch --depth 1 [email protected]:WordPress/wordpress-playground.git
git clone -b trunk --single-branch --depth 1 --recurse-submodules [email protected]:WordPress/wordpress-playground.git
cd wordpress-playground
npm install
npm run dev
Expand Down
1 change: 1 addition & 0 deletions isomorphic-git
Submodule isomorphic-git added at cdca7e
80 changes: 80 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]:WordPress/wordpress-playground.git
git clone -b trunk --single-branch --depth 1 --recurse-submodules [email protected]:WordPress/wordpress-playground.git
```

Enter the `wordpress-playground` directory.
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/site/docs/main/contributing/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
[email protected]:YOUR-GITHUB-USERNAME/wordpress-playground.git
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/components/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="./src/demos.tsx"></script>
<script type="module" src="./src/demos/index.tsx"></script>
</body>
</html>
Loading
Loading