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

WIP Bun support #13456

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ tests export-ignore
.* export-ignore
*.config.cjs export-ignore
*.config.test.cjs export-ignore
*.lockb binary diff=lockb
bun.lockb export-ignore
codecov.yml export-ignore
package.json export-ignore
package-lock.json export-ignore
Expand Down
29 changes: 9 additions & 20 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,8 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version-file: '.nvmrc'
cache: npm
- name: Setup Bun
uses: oven-sh/setup-bun@9b21598af8d4dfc302e5a30250007de0fda92acc

- name: Bundle size check
uses: preactjs/compressed-size-action@6fa0e7ca017120c754863b31123c5ee2860fd434
Expand Down Expand Up @@ -136,11 +133,8 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version-file: '.nvmrc'
cache: npm
- name: Setup Bun
uses: oven-sh/setup-bun@9b21598af8d4dfc302e5a30250007de0fda92acc

- name: Setup PHP
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35
Expand All @@ -150,20 +144,15 @@ jobs:
tools: composer

- name: Install dependencies
run: npm ci
run: bun install
env:
PUPPETEER_SKIP_DOWNLOAD: true

- name: Install PHP dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6
with:
composer-options: '--prefer-dist --no-progress --no-interaction'

- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5
with:
bun-version: latest

- name: Build plugin
run: |
bun run build:js
Expand All @@ -178,7 +167,7 @@ jobs:
- name: Bundle development version
run: |
rm -rf assets/css/* assets/js/*
npx webpack --env=development
bunx webpack --env=development
bun run workflow:build-plugin -- --zip web-stories-dev.zip

# Upload ZIP file to GCS for use in QA environment.
Expand Down Expand Up @@ -232,7 +221,7 @@ jobs:
github.event.pull_request.user.login != 'dependabot[bot]'

- name: Create or update comment on PR with links to plugin builds
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
Expand All @@ -248,7 +237,7 @@ jobs:
# Deploy to staging site if on main branch.

- name: Setup SSH Keys and known_hosts
uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387
uses: webfactory/ssh-agent@d4b9b8ff72958532804b70bbe600ad43b36d5f2e
with:
ssh-private-key: ${{ secrets.PANTHEON_DEPLOY_KEY }}
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,16 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version-file: '.nvmrc'
cache: npm
- name: Setup Bun
uses: oven-sh/setup-bun@9b21598af8d4dfc302e5a30250007de0fda92acc

- name: Install dependencies
run: npm ci
run: bun install
env:
PUPPETEER_SKIP_DOWNLOAD: true

- name: Build storyook
run: npm run storybook:build
run: bun run storybook:build

- name: Checkout gh-pages
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/lint-css-js-md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,46 +76,38 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version-file: '.nvmrc'
cache: npm
- name: Setup Bun
uses: oven-sh/setup-bun@9b21598af8d4dfc302e5a30250007de0fda92acc

- name: Install dependencies
run: npm ci
run: bun install
env:
PUPPETEER_SKIP_DOWNLOAD: true

- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5
with:
bun-version: latest

- name: Markdown Lint
run: npm run lint:md
run: bun run lint:md

- name: CSS Lint
run: npm run lint:css
run: bun run lint:css

- name: package.json Lint
run: npm run lint:package-json
run: bun run lint:package-json

# Do this first so that the types are available to ESLint,
# particularly the more sophisticated `@typescript/eslint` rules.
- name: Type checking
run: npm run workflow:bundle-packages:types
run: bun run workflow:bundle-packages:types

- name: JS Lint
run: npm run lint:js
run: bun run lint:js
env:
NODE_OPTIONS: --max-old-space-size=4096
if: >
github.event.pull_request.head.repo.fork == true ||
github.event.pull_request.user.login == 'dependabot[bot]'

- name: JS Lint Report
run: npm run lint:js:report
run: bun run lint:js:report
continue-on-error: true
env:
NODE_OPTIONS: --max-old-space-size=4096
Expand All @@ -135,4 +127,4 @@ jobs:
github.event.pull_request.user.login != 'dependabot[bot]'

- name: JSON Schema validation
run: npm run test:schema
run: bun run test:schema
16 changes: 4 additions & 12 deletions .github/workflows/lint-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ jobs:
- name: Install latest version of i18n-command
run: wp package install wp-cli/i18n-command:@stable

- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version-file: '.nvmrc'
cache: npm
- name: Setup Bun
uses: oven-sh/setup-bun@9b21598af8d4dfc302e5a30250007de0fda92acc

- name: Setup PHP
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35
Expand All @@ -74,20 +71,15 @@ jobs:

- name: Install dependencies
run: |
npm ci
bun install
env:
PUPPETEER_SKIP_DOWNLOAD: true

- name: Install PHP dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6
with:
composer-options: '--prefer-dist --no-progress --no-interaction'

- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5
with:
bun-version: latest

- name: Build plugin
run: bun run build:js

Expand Down
24 changes: 7 additions & 17 deletions .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,14 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version-file: '.nvmrc'
cache: npm
- name: Setup Bun
uses: oven-sh/setup-bun@9b21598af8d4dfc302e5a30250007de0fda92acc

- name: Install dependencies
run: npm ci
run: bun install
env:
PUPPETEER_SKIP_DOWNLOAD: true

- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5
with:
bun-version: latest

- name: Bundle packages
run: bun run workflow:bundle-packages
env:
Expand Down Expand Up @@ -120,16 +112,14 @@ jobs:
registry-url: ${{ env.PRODUCTION_REGISTRY_URL }}
scope: '@googleforcreators'

- name: Setup Bun
uses: oven-sh/setup-bun@9b21598af8d4dfc302e5a30250007de0fda92acc

- name: Install dependencies
run: npm ci
run: bun install
env:
PUPPETEER_SKIP_DOWNLOAD: true

- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5
with:
bun-version: latest

- name: Bundle packages
run: bun run workflow:bundle-packages
env:
Expand Down
32 changes: 8 additions & 24 deletions .github/workflows/plugin-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,8 @@ jobs:
rm -rf assets_version.txt
continue-on-error: true

- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version-file: '.nvmrc'
cache: npm
- name: Setup Bun
uses: oven-sh/setup-bun@9b21598af8d4dfc302e5a30250007de0fda92acc

- name: Setup PHP
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35
Expand All @@ -283,20 +280,15 @@ jobs:

- name: Install dependencies
run: |
npm ci
bun install
env:
PUPPETEER_SKIP_DOWNLOAD: true

- name: Install PHP dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6
with:
composer-options: '--prefer-dist --no-progress --no-interaction'

- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5
with:
bun-version: latest

- name: Create release branch
id: release_branch
run: |
Expand Down Expand Up @@ -454,25 +446,17 @@ jobs:
ref: main
token: ${{ secrets.GOOGLEFORCREATORS_BOT_TOKEN }}

- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version-file: '.nvmrc'
cache: npm
- name: Setup Bun
uses: oven-sh/setup-bun@9b21598af8d4dfc302e5a30250007de0fda92acc

- name: Install dependencies
run: npm ci
run: bun install
env:
PUPPETEER_SKIP_DOWNLOAD: true

- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5
with:
bun-version: latest

# If we're releasing 1.6.0, bump version on main to 1.7.0-alpha.0.
- name: Update plugin version
run: npm run workflow:version -- --increment preminor --preid alpha
run: bun run workflow:version -- --increment preminor --preid alpha

- name: Commit changes
run: |
Expand Down
Loading
Loading