[go: nahoru, domu]

Skip to content

Commit

Permalink
turbo.json fix caching behaviour for env var update, and fix minor er…
Browse files Browse the repository at this point in the history
…rors
  • Loading branch information
versecafe committed Feb 4, 2024
1 parent d19b356 commit a053826
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 17 deletions.
47 changes: 47 additions & 0 deletions apps/web/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"extends": ["//"],
"pipeline": {
"build": {
"env": [
"DATABASE_URL",
"NEXT_PUBLIC_APP_NAME",
"VERCEL_ENV",
"VERCEL",
"VERCEL_URL",
"NODE_ENV",
"NEXTAUTH_SECRET",
"NEXTAUTH_URL",
"NEXT_PUBLIC_IS_DUB",
"NEXT_PUBLIC_APP_NAME",
"NEXT_PUBLIC_APP_DOMAIN",
"TEAM_ID_VERCEL",
"PROJECT_ID_VERCEL",
"AUTH_BEARER_TOKEN",
"CRON_SECRET",
"TINYBIRD_API_KEY",
"UPSTASH_REDIS_REST_URL",
"UPSTASH_REDIS_REST_TOKEN",
"RATELIMIT_UPSTASH_REDIS_REST_URL",
"RATELIMIT_UPSTASH_REDIS_REST_TOKEN",
"QSTASH_TOKEN",
"QSTASH_CURRENT_SIGNING_KEY",
"QSTASH_NEXT_SIGNING_KEY",
"RESEND_API_KEY",
"RESEND_AUDIENCE_ID",
"STRIPE_SECRET_KEY",
"STRIPE_SECRET_KEY_LIVE",
"NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY",
"NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE",
"GOOGLE_CLIENT_ID",
"GOOGLE_CLIENT_SECRET",
"GITHUB_CLIENT_ID",
"GITHUB_CLIENT_SECRET",
"NEXT_PUBLIC_BITLY_REDIRECT_URI",
"BITLY_CLIENT_SECRET",
"UNSPLASH_ACCESS_KEY",
"CLOUDINARY_URL"
],
"outputs": [".next/**"]
}
}
}
9 changes: 6 additions & 3 deletions packages/ui/src/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ export function Button({
<Tooltip content={disabledTooltip}>
<div className="flex h-10 w-full cursor-not-allowed items-center justify-center space-x-2 rounded-md border border-gray-200 bg-gray-100 px-4 text-sm text-gray-400 transition-all focus:outline-none">
<p>{text}</p>
{shortcut ? <kbd className="hidden rounded bg-zinc-200 px-2 py-0.5 text-xs font-light text-gray-400 md:inline-block">
{shortcut ? (
<kbd className="hidden rounded bg-zinc-200 px-2 py-0.5 text-xs font-light text-gray-400 md:inline-block">
{shortcut}
</kbd> : null}
</kbd>
) : null}
</div>
</Tooltip>
);
Expand Down Expand Up @@ -65,7 +67,8 @@ export function Button({
{shortcut && (
<kbd className="hidden rounded bg-zinc-700 px-2 py-0.5 text-xs font-light text-gray-400 transition-all duration-75 group-hover:bg-gray-100 group-hover:text-gray-500 md:inline-block">
{shortcut}
</kbd> : null}
</kbd>
)}
</button>
);
}
9 changes: 5 additions & 4 deletions packages/ui/src/icons/google.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
export default function Google({ className }: { className?: string }): JSX.Element {
export default function Google({
className,
}: {
className?: string;
}): JSX.Element {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
height="24"
viewBox="0 0 24 24"
width="24"
className={className}
fill="currentColor"
viewBox="0 0 488 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
Expand Down
23 changes: 13 additions & 10 deletions packages/ui/src/link-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { useDebounce } from "use-debounce";
import { useMediaQuery } from "./hooks";
import { LoadingCircle, Photo } from "./icons";

export function LinkPreview({ defaultUrl }: { defaultUrl?: string }): JSX.Element {
export function LinkPreview({
defaultUrl,
}: {
defaultUrl?: string;
}): JSX.Element {
const router = useRouter();
const searchParams = useSearchParams();
const url =
Expand Down Expand Up @@ -44,21 +48,18 @@ export function LinkPreview({ defaultUrl }: { defaultUrl?: string }): JSX.Elemen
<div className="relative flex items-center">
<Link2 className="absolute inset-y-0 left-0 my-2 ml-3 w-5 text-gray-400" />
<input
ref={inputRef}
name="url"
id="url"
type="url"
aria-invalid="true"
autoFocus={!isMobile}
className="block w-full rounded-md border-gray-200 pl-10 text-sm text-gray-900 placeholder-gray-400 shadow-lg focus:border-gray-500 focus:outline-none focus:ring-gray-500"
defaultValue={url}
id="url"
name="url"
onChange={(e) =>
{ router.replace(
router.replace(
`/tools/metatags${
e.target.value.length > 0 ? `?url=${e.target.value}` : ""
}`,
); }
)
}
placeholder="Enter your URL"
ref={inputRef}
Expand All @@ -68,9 +69,11 @@ export function LinkPreview({ defaultUrl }: { defaultUrl?: string }): JSX.Elemen
)}

<div className="relative overflow-hidden rounded-md border border-gray-300 bg-gray-50">
{isValidating ? <div className="absolute flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-gray-300 bg-gray-50">
{isValidating ? (
<div className="absolute flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-gray-300 bg-gray-50">
<LoadingCircle />
</div> : null}
</div>
) : null}
{image ? (
<img
alt="Preview"
Expand Down Expand Up @@ -116,7 +119,7 @@ export function LinkPreviewPlaceholder({
defaultUrl,
}: {
defaultUrl?: string;
}) {
}): JSX.Element {
return (
<>
<div className="relative flex items-center">
Expand Down
9 changes: 9 additions & 0 deletions packages/ui/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": ["//"],
"pipeline": {
"build": {
"env": ["NEXT_PUBLIC_APP_NAME"],
"outputs": [".next/**"]
}
}
}
21 changes: 21 additions & 0 deletions packages/utils/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": ["//"],
"pipeline": {
"build": {
"env": [
"NEXT_PUBLIC_APP_SHORT_DOMAIN",
"NEXT_PUBLIC_APP_DOMAIN",
"NEXT_PUBLIC_APP_NAME",
"NEXT_PUBLIC_VERCEL_ENV",
"NEXT_PUBLIC_IS_DUB",
"NGROK_URL",
"NODE_ENV",
"DUB_SLACK_HOOK_ALERTS",
"DUB_SLACK_HOOK_CRON",
"DUB_SLACK_HOOK_LINKS",
"DUB_SLACK_HOOK_ERRORS"
],
"outputs": [".next/**"]
}
}
}

0 comments on commit a053826

Please sign in to comment.