Skip to content

Commit

Permalink
Merge branch 'main' of github.com:redwoodjs/redwood into rc-service-c…
Browse files Browse the repository at this point in the history
…aching

* 'main' of github.com:redwoodjs/redwood: (244 commits)
  chore(deps): update dependency @replayio/playwright to v0.3.0 (#6735)
  chore: update all contributors
  Update Clerk docs (#6712)
  Update firebase auth docs (#6717)
  Clerk: Simplify web implementation (#6713)
  Add auth decoder to clerk auth setup (#6718)
  Auth: Update firebase setup script (#6716)
  chore: Remove redundant space " " (#6714)
  Update the Clerk setup script and templates (#6710)
  Fix decouple auth related type errors (#6709)
  fix(deps): update dependency css-minimizer-webpack-plugin to v4.2.2 (#6688)
  fix(deps): update dependency @graphql-codegen/cli to v2.13.7 (#6687)
  feat: publish 2nd canary (@next) from release branch (#6505)
  fix: don't pr if can't cherry pick cleanly (#6703)
  fix(dbAuth): add required packages to setup command (#6698)
  Netlify: Enable auth-providers-api and auth-providers-web installation (#6697)
  chore: make misc change to trigger canary publishing (#6695)
  chore: remove private on new packages (#6692)
  chore: run lint fix (#6691)
  Decouple auth (#5985)
  ...
  • Loading branch information
dac09 committed Oct 26, 2022
2 parents 3637bc1 + c604f38 commit 2f9bc6b
Show file tree
Hide file tree
Showing 762 changed files with 96,849 additions and 10,744 deletions.
12 changes: 7 additions & 5 deletions .eslintrc.js
Expand Up @@ -15,14 +15,14 @@ const findBabelConfig = (cwd = process.cwd()) => {
module.exports = {
extends: path.join(__dirname, 'packages/eslint-config/shared.js'),
parserOptions: {
ecmaVersion: 'latest',
babelOptions: {
configFile: findBabelConfig(),
},
},
ignorePatterns: [
'dist',
'fixtures',
'packages/structure/**',
'packages/internal/src/build/babelPlugins/__tests__/__fixtures__/**/*',
'packages/core/**/__fixtures__/**/*',
'packages/codemods/**/__testfixtures__/**/*',
Expand All @@ -32,9 +32,14 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
curly: 'error',
},
env: {
// We use the most modern environment available. Then we rely on Babel to
// transpile it to something that can run on all node versions we support
es2022: true,
},
overrides: [
{
files: ['packages/structure/**'],
files: ['packages/structure/src/**'],
rules: {
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
Expand All @@ -57,7 +62,6 @@ module.exports = {
'packages/web/src/**',
],
env: {
es6: true,
browser: true,
},
globals: {
Expand Down Expand Up @@ -101,7 +105,6 @@ module.exports = {
{
files: ['packages/web/src/entry/index.js'],
env: {
es6: true,
browser: true,
},
globals: {
Expand All @@ -126,7 +129,6 @@ module.exports = {
'packages/telemetry/src/**',
],
env: {
es6: true,
node: true,
},
},
Expand Down
Expand Up @@ -32,6 +32,7 @@ if (hasFixtureOkLabel) {
(file) =>
file.startsWith('packages/cli/src/commands/generate') ||
file.startsWith('packages/cli/src/commands/setup') ||
file.startsWith('packages/cli-helpers/src/') ||
file.startsWith('packages/create-redwood-app/template')
)

Expand Down
4 changes: 2 additions & 2 deletions .github/actions/check_test_project_fixture/package.json
Expand Up @@ -2,8 +2,8 @@
"name": "check_test_project_fixture",
"private": true,
"dependencies": {
"@actions/core": "1.9.1",
"@actions/core": "1.10.0",
"@actions/exec": "1.1.1"
},
"packageManager": "yarn@3.2.3"
"packageManager": "yarn@3.2.4"
}
10 changes: 5 additions & 5 deletions .github/actions/check_test_project_fixture/yarn.lock
Expand Up @@ -5,13 +5,13 @@ __metadata:
version: 6
cacheKey: 8c0

"@actions/core@npm:1.9.1":
version: 1.9.1
resolution: "@actions/core@npm:1.9.1"
"@actions/core@npm:1.10.0":
version: 1.10.0
resolution: "@actions/core@npm:1.10.0"
dependencies:
"@actions/http-client": ^2.0.1
uuid: ^8.3.2
checksum: 9e568d0df7d659ad0738da66f167d411714f7351fab527fcb91dd6afbeb58006e6cf1f752adc567aab1b9043f96581b2457746f394f7a756f7b14b554d7c4710
checksum: 9214d1e0cf5cf2a5d48b8f3b12488c6be9f6722ea60f2397409226e8410b5a3e12e558d9b66c93469d180399865ec20180119408a1770f026bd9ecac6965fcda
languageName: node
linkType: hard

Expand Down Expand Up @@ -44,7 +44,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "check_test_project_fixture@workspace:."
dependencies:
"@actions/core": 1.9.1
"@actions/core": 1.10.0
"@actions/exec": 1.1.1
languageName: unknown
linkType: soft
Expand Down
6 changes: 4 additions & 2 deletions .github/actions/only_doc_changes/only_doc_changes.mjs
@@ -1,9 +1,11 @@
import { exec, getExecOutput } from '@actions/exec'
import core from '@actions/core'

await exec('git fetch origin main')
const branch = process.env.GITHUB_BASE_REF

const { stdout } = await getExecOutput('git diff origin/main --name-only')
await exec(`git fetch origin ${branch}`)

const { stdout } = await getExecOutput(`git diff origin/${branch} --name-only`)

const changedFiles = stdout.toString().trim().split('\n').filter(Boolean)

Expand Down
4 changes: 2 additions & 2 deletions .github/actions/only_doc_changes/package.json
Expand Up @@ -2,8 +2,8 @@
"name": "only_doc_changes",
"private": true,
"dependencies": {
"@actions/core": "1.9.1",
"@actions/core": "1.10.0",
"@actions/exec": "1.1.1"
},
"packageManager": "yarn@3.2.3"
"packageManager": "yarn@3.2.4"
}
10 changes: 5 additions & 5 deletions .github/actions/only_doc_changes/yarn.lock
Expand Up @@ -5,13 +5,13 @@ __metadata:
version: 6
cacheKey: 8c0

"@actions/core@npm:1.9.1":
version: 1.9.1
resolution: "@actions/core@npm:1.9.1"
"@actions/core@npm:1.10.0":
version: 1.10.0
resolution: "@actions/core@npm:1.10.0"
dependencies:
"@actions/http-client": ^2.0.1
uuid: ^8.3.2
checksum: 9e568d0df7d659ad0738da66f167d411714f7351fab527fcb91dd6afbeb58006e6cf1f752adc567aab1b9043f96581b2457746f394f7a756f7b14b554d7c4710
checksum: 9214d1e0cf5cf2a5d48b8f3b12488c6be9f6722ea60f2397409226e8410b5a3e12e558d9b66c93469d180399865ec20180119408a1770f026bd9ecac6965fcda
languageName: node
linkType: hard

Expand Down Expand Up @@ -44,7 +44,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "only_doc_changes@workspace:."
dependencies:
"@actions/core": 1.9.1
"@actions/core": 1.10.0
"@actions/exec": 1.1.1
languageName: unknown
linkType: soft
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/update_all_contributors/action.yml
@@ -0,0 +1,5 @@
name: Update all contributors
description: Updates all contributors
runs:
using: node16
main: update_all_contributors.mjs
@@ -0,0 +1,72 @@
import { getExecOutput, exec } from '@actions/exec'

const runAllContributors = (args) => {
args = Array.isArray(args) ? args : [args]

return getExecOutput('yarn', [
'run',
'all-contributors',
'--config=.all-contributorsrc',
...args
], {
cwd: './tasks/all-contributors'
})
}

const ALL_CONTRIBUTORS_IGNORE_LIST = [
// core team
'agiannelli',
'ajcwebdev',
'alicelovescake',
'aldonline',
'callingmedic911',
'cannikin',
'dac09',
'dthyresson',
'forresthayes',
'jtoar',
'kimadeline',
'KrisCoulson',
'mojombo',
'noire-munich',
'peterp',
'realStandal',
'RobertBroersma',
'simoncrypta',
'Tobbe',
'thedavidprice',
'virtuoushub',

// bots
'codesee-maps[bot]',
'dependabot[bot]',
'dependabot-preview[bot]',
'redwoodjsbot',
'renovate[bot]',
]

const { stdout } = await runAllContributors('check')

const contributors = stdout
.trim()
.split('\n')[1]
.split(',')
.map((contributor) => contributor.trim())
.filter(
(contributor) => !ALL_CONTRIBUTORS_IGNORE_LIST.includes(contributor)
)

if (contributors.length === 0) {
console.log('No contributors to add')
} else {
for (const contributor of contributors) {
await runAllContributors(['add', contributor, 'code'])
}

await runAllContributors(['generate', '--contributorsPerLine=5'])

await exec('git', ['config', 'user.name', 'github-actions'])
await exec('git', ['config', 'user.email', 'github-actions@github.com'])
await exec('git', ['commit', '-am chore: update all contributors'])
await exec('git', ['push'])
}
3 changes: 2 additions & 1 deletion .github/renovate.json
Expand Up @@ -47,6 +47,7 @@
"pretty-bytes",
"is-port-reachable",
"pretty-ms",
"camelcase"
"camelcase",
"sort-package-json"
]
}
115 changes: 115 additions & 0 deletions .github/workflows/cherry-pick-into-next-branch.yml
@@ -0,0 +1,115 @@
# When a PR is merged into the main branch, this workflow tries to cherry pick the squashed commit into the next branch
# by fast forwarding the next branch via the `--ff` option.
# If that doesn't work (i.e. main and next have diverged), it'll open a PR against the next branch with the squashed commit.

name: 🍒 Cherry pick into next branch

on:
pull_request_target:
branches: [main]
types: [closed]

jobs:
cherry-pick-fast-forward:
# Don't cherry pick commits with breaking changes.
if: ${{ github.event.pull_request.merged == true && !contains(github.event.pull_request.labels.*.name, 'release:feature-breaking') && !contains(github.event.pull_request.labels.*.name, 'skip-cherry-pick') }}
name: ⏩ Cherry pick fast forward
runs-on: ubuntu-latest
outputs:
pr: ${{ steps.cherry-pick-fast-forward.outputs.value }}

steps:
- uses: actions/checkout@v3
with:
ref: next
# git isn't able to work with $GITHUB_SHA if we don't checkout everything.
fetch-depth: 0
# Since next is a protected branch, we need a token to run `git push` later.
token: ${{ secrets.JTOAR_TOKEN }}

- name: ⏩ Cherry pick fast forward
id: cherry-pick-fast-forward
run: |
git config user.name github-actions
git config user.email github-actions@github.com
# Here, $GITHUB_SHA is the last merge commit on the $GITHUB_REF branch.
# That merge commit is already in the main branch at this point (this action runs on "pull_request closed" events).
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request.
echo "Trying to cherry pick $GITHUB_SHA"
git cherry-pick --ff $GITHUB_SHA || exit 1
# If the HEAD of main and next point to the same commit, then the fast forward worked and we can go ahead and push.
echo "Comparing SHAs"
echo "main $(git rev-parse origin/main)"
echo "next $(git rev-parse next)"
if [[ "$(git rev-parse origin/main)" = "$(git rev-parse next)" ]]; then
echo "SHAs are the same, pushing"
git push
else
echo "SHAs are different"
echo "value=true" >> $GITHUB_OUTPUT
fi
cherry-pick-into-next-pr:
needs: cherry-pick-fast-forward
if: ${{ needs.cherry-pick-fast-forward.outputs.pr == 'true' }}
name: Cherry pick into next PR
runs-on: ubuntu-latest

steps:
- name: 🔑 Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Cherry pick into next PR
uses: carloscastrojumo/github-cherry-pick-action@v1.0.3
with:
# We specify a token because we want other workflows (like CI) to run on this PR.
# If we omit this, it uses the default token (GITHUB_TOKEN) which doesn't trigger other workflows.
token: ${{ steps.generate_token.outputs.token }}
branch: next
labels: cherry-pick

comment-on-pr:
needs: cherry-pick-into-next-pr
if: failure()
name: 💬 Comment on PR
runs-on: ubuntu-latest

steps:
- name: 🔑 Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- uses: actions/github-script@v6
with:
github-token: ${{ steps.generate_token.outputs.token }}
script: |
await github.rest.issues.createComment({
issue_number: '${{ github.event.number }}',
owner: context.repo.owner,
repo: context.repo.repo,
body: `🔔 @jtoar, @Tobbe—I couldn't cherry pick this one. If you want it in the next release, you'll have to cherry pick it manually.`,
});
await github.rest.issues.addLabels({
issue_number: '${{ github.event.number }}',
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['needs-cherry-pick']
})

0 comments on commit 2f9bc6b

Please sign in to comment.