Skip to content

Commit

Permalink
feat!: update trpc to v10 and make CLI synchronous (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge authored Oct 6, 2022
1 parent 62e86c4 commit 75fcb49
Show file tree
Hide file tree
Showing 93 changed files with 2,769 additions and 2,524 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"baseBranch": "next",
"updateInternalDependencies": "patch",
"ignore": ["@ct3a/www"]
}
5 changes: 5 additions & 0 deletions .changeset/old-flies-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": minor
---

enable vercel_url to pass default env-schema
5 changes: 0 additions & 5 deletions .changeset/tall-pans-dream.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/violet-balloons-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": major
---

upgrades trpc to v10 and improves cli performance by making it synchronous
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners


* @juliusmarminge @nexxeln @TheoBr
- @juliusmarminge @nexxeln @TheoBr @c-ehrlich
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🐞 Bug Report
description: Create a bug report to help us improve
title: "bug: "
labels: ["unconfirmed bug"]
labels: ["🐞❔ unconfirmed bug"]
body:
- type: textarea
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🧑‍💻 Feature Request
description: Suggest an idea for this project
title: "feat: "
labels: ["enhancement"]
labels: ["🌟 enhancement"]
body:
- type: textarea
attributes:
Expand Down
16 changes: 10 additions & 6 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
"area: cli":
- any: ["cli/src/**"]
"📌 area: cli":
- any: ["cli/**/*"]

"area: t3-app":
- any: ["cli/template/**"]
"📌 area: t3-app":
- any: ["cli/template/**/*"]

"documentation":
- any: ["www/**", "**/*.md"]
"📚 documentation":
- any: ["www/**/*"]
- any: ["**/*.md"]

"📌 area: ci":
- any: [".github/**/*"]
63 changes: 7 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# this workflow will run on every pr to make sure the project is following the guidelines

# after labeler, run other actions with strict permissions
name: CI

on:
Expand Down Expand Up @@ -30,11 +31,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2.0.1
- uses: pnpm/action-setup@v2.2.2
name: Install pnpm
id: pnpm-install
with:
version: 7.9.5
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
Expand Down Expand Up @@ -63,11 +63,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2.0.1
- uses: pnpm/action-setup@v2.2.2
name: Install pnpm
id: pnpm-install
with:
version: 7.9.5
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
Expand Down Expand Up @@ -96,11 +95,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2.0.1
- uses: pnpm/action-setup@v2.2.2
name: Install pnpm
id: pnpm-install
with:
version: 7.9.5
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
Expand All @@ -118,51 +116,6 @@ jobs:

- run: pnpm typecheck

build-t3-app:
runs-on: ubuntu-latest
strategy:
matrix:
trpc: ["trpc", "nope"]
tailwind: ["tailwind", "nope"]
nextAuth: ["nextAuth", "nope"]
prisma: ["prisma", "nope"]

name: "Build and Start T3 App ${{ matrix.trpc }}-${{ matrix.tailwind }}-${{ matrix.nextAuth }}-${{ matrix.prisma }}"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7.9.5
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- run: pnpm turbo run --filter=create-t3-app build
# has to be scaffolded outside the CLI project so that no lint/tsconfig are leaking
# through. this way it ensures that it is the app's configs that are being used
# FIXME: this is a bit hacky, would rather have --packages=trpc,tailwind,... but not sure how to setup the matrix for that
- run: cd cli && pnpm start ../../ci-${{ matrix.trpc }}-${{ matrix.tailwind }}-${{ matrix.nextAuth }}-${{ matrix.prisma }} --noGit --CI --trpc=${{ matrix.trpc }} --tailwind=${{ matrix.tailwind }} --nextAuth=${{ matrix.nextAuth }} --prisma=${{ matrix.prisma }}
- run: cd ../ci-${{ matrix.trpc }}-${{ matrix.tailwind }}-${{ matrix.nextAuth }}-${{ matrix.prisma }} && pnpm build

build-www:
runs-on: ubuntu-latest
name: Build and Check Astro
Expand All @@ -174,11 +127,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2.0.1
- uses: pnpm/action-setup@v2.2.2
name: Install pnpm
id: pnpm-install
with:
version: 7.9.5
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
Expand All @@ -194,8 +146,7 @@ jobs:
- name: Install dependencies
run: pnpm install

# No need to lint & typecheck here (which is otherwise done by the `check` script), done in above jobs
- run: pnpm run --filter=www astro check
- run: pnpm turbo run --filter=www build
- run: pnpm run --filter=www check
- run: pnpm turbo --filter=www build
env:
PUBLIC_GITHUB_TOKEN: ${{ secrets.PUBLIC_GITHUB_TOKEN }}
63 changes: 63 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# this workflow will run on every pr to make sure the project is following the guidelines

# after labeler, run other actions with strict permissions
name: E2E Tests

on:
pull_request:
branches:
- "*"
paths:
- "cli/**/*"

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

jobs:
build-t3-app:
runs-on: ubuntu-latest
# if: |
# contains(github.event.pull_request.labels.*.name, '📌 area: cli') ||
# contains(github.event.pull_request.labels.*.name, '📌 area: t3-app')
strategy:
matrix:
trpc: ["trpc", "nope"]
tailwind: ["tailwind", "nope"]
nextAuth: ["nextAuth", "nope"]
prisma: ["prisma", "nope"]

name: "Build and Start T3 App ${{ matrix.trpc }}-${{ matrix.tailwind }}-${{ matrix.nextAuth }}-${{ matrix.prisma }}"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- run: pnpm turbo --filter=create-t3-app build
# has to be scaffolded outside the CLI project so that no lint/tsconfig are leaking
# through. this way it ensures that it is the app's configs that are being used
# FIXME: this is a bit hacky, would rather have --packages=trpc,tailwind,... but not sure how to setup the matrix for that
- run: cd cli && pnpm start ../../ci-${{ matrix.trpc }}-${{ matrix.tailwind }}-${{ matrix.nextAuth }}-${{ matrix.prisma }} --noGit --CI --trpc=${{ matrix.trpc }} --tailwind=${{ matrix.tailwind }} --nextAuth=${{ matrix.nextAuth }} --prisma=${{ matrix.prisma }}
- run: cd ../ci-${{ matrix.trpc }}-${{ matrix.tailwind }}-${{ matrix.nextAuth }}-${{ matrix.prisma }} && pnpm build
45 changes: 0 additions & 45 deletions .github/workflows/nextrelease.yml

This file was deleted.

14 changes: 11 additions & 3 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name: "PR-Labeler"
# this workflow will run on every pr to make sure the project is following the guidelines

# run labeler with elevated permissions before other actions

name: Label PR

on:
- pull_request_target
pull_request_target:
branches: ["*"]

jobs:
triage:
labeler:
name: Label PR
permissions:
contents: read
pull-requests: write
Expand All @@ -12,3 +19,4 @@ jobs:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
52 changes: 52 additions & 0 deletions .github/workflows/prerelease-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Write Beta Release comment

on:
workflow_run:
workflows: ["Release - Beta"]
types:
- completed

jobs:
comment:
if: |
github.repository_owner == 't3-oss' &&
${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
name: Write comment to the PR
steps:
- name: "Comment on PR"
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
for (const artifact of allArtifacts.data.artifacts) {
// Extract the PR number and package version from the artifact name
const match = /^npm-package-create-t3-app@(.*?)-pr-(\d+)/.exec(artifact.name);
if (match) {
require("fs").appendFileSync(
process.env.GITHUB_ENV,
`\nBETA_PACKAGE_VERSION=${match[1]}` +
`\nWORKFLOW_RUN_PR=${match[2]}` +
`\nWORKFLOW_RUN_ID=${context.payload.workflow_run.id}`
);
break;
}
}
- name: "Comment on PR with Link"
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ env.WORKFLOW_RUN_PR }}
message: |
A new create-t3-app prerelease is available for testing. You can install this latest build in your project with:
```sh
npx create-t3-app@${{ env.BETA_PACKAGE_VERSION }}
```
Loading

0 comments on commit 75fcb49

Please sign in to comment.