Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

fix: linter

kapishdima848534873036
diff --git a/app/(home)/legal/page.tsx b/app/(home)/legal/page.tsx
index 696940de..0e7868ce 100644
--- a/app/(home)/legal/page.tsx
+++ b/app/(home)/legal/page.tsx
@@ -75,8 +75,8 @@ export default function LegalPage() {
anonymous usage data: pages visited, referrer, browser and
device type, and coarse location (country level). This tells us
which components people actually use. We do not use advertising
- trackers, we do not build cross-site profiles, and we never
- sell data.
+ trackers, we do not build cross-site profiles, and we never sell
+ data.
</li>
<li>
<strong>Local preferences.</strong> Your theme choice (light or
@@ -95,14 +95,16 @@ export default function LegalPage() {
<p>
Paid products are sold through{" "}
<a href="https://creem.io">Creem</a>, our merchant of record.
- Creem runs the checkout and handles payment processing,
- invoicing, and taxes. Your card details go directly to Creem and
- its payment processors — they never touch our servers. After a
- purchase we receive only what is needed to deliver it: your email
- address, the product, and the order details. How Creem handles
- your data is described in{" "}
- <a href="https://www.creem.io/privacy">Creem&apos;s privacy
- policy</a>.
+ Creem runs the checkout and handles payment processing, invoicing,
+ and taxes. Your card details go directly to Creem and its payment
+ processors — they never touch our servers. After a purchase we
+ receive only what is needed to deliver it: your email address, the
+ product, and the order details. How Creem handles your data is
+ described in{" "}
+ <a href="https://www.creem.io/privacy">
+ Creem&apos;s privacy policy
+ </a>
+ .
</p>
<h3>Third-party services</h3>
@@ -112,21 +114,21 @@ export default function LegalPage() {
analytics.
</li>
<li>
- <a href="https://creem.io">Creem</a> — checkout and payments,
- as merchant of record.
+ <a href="https://creem.io">Creem</a> — checkout and payments, as
+ merchant of record.
</li>
<li>
<a href={GITHUB_URL}>GitHub</a> — source code, issues, and
- sponsorships. Anything you do there is governed by
- GitHub&apos;s own terms.
+ sponsorships. Anything you do there is governed by GitHub&apos;s
+ own terms.
</li>
</ul>
<h3>Your data</h3>
<p>
We keep order emails for as long as we need them to provide
- support and meet legal obligations. To ask what we hold about
- you, or to have it deleted, email{" "}
+ support and meet legal obligations. To ask what we hold about you,
+ or to have it deleted, email{" "}
<a href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</a> and we
will sort it out.
</p>
@@ -147,9 +149,9 @@ export default function LegalPage() {
<p>
Some products are paid. Unless a product states otherwise at
purchase, buying it grants you a non-exclusive license to use it
- in any number of your own projects, commercial ones included.
- What it does not grant is the right to redistribute or resell
- the product itself — for example republishing the components in
+ in any number of your own projects, commercial ones included. What
+ it does not grant is the right to redistribute or resell the
+ product itself — for example republishing the components in
another registry, template marketplace, or paid bundle.
</p>
@@ -174,10 +176,10 @@ export default function LegalPage() {
<h3>Changes</h3>
<p>
- We may update this page as the project evolves — for example
- when new products or services launch. The date at the top
- reflects the latest revision, and continued use of the site
- after a change means you accept it.
+ We may update this page as the project evolves — for example when
+ new products or services launch. The date at the top reflects the
+ latest revision, and continued use of the site after a change
+ means you accept it.
</p>
<h3>Contact</h3>
diff --git a/scripts/21st/generate.mts b/scripts/21st/generate.mts
index 9b7cbf43..16b5eb90 100644
--- a/scripts/21st/generate.mts
+++ b/scripts/21st/generate.mts
@@ -1,4 +1,10 @@
-import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
+import {
+ existsSync,
+ mkdirSync,
+ readdirSync,
+ readFileSync,
+ writeFileSync,
+} from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import registry from "@/registry/__index__";
@@ -9,7 +15,9 @@ const outRoot = path.join(root, "out", "21st");
const publishRoot = path.join(outRoot, "publish");
const REMOTION_VERSION = "4.0.473";
-const rootPkg = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8"));
+const rootPkg = JSON.parse(
+ readFileSync(path.join(root, "package.json"), "utf8"),
+);
const versionOf = (dep: string): string => {
const v = rootPkg.dependencies?.[dep] ?? rootPkg.devDependencies?.[dep];
if (!v) throw new Error(`Unknown npm dep version for ${dep}`);
@@ -34,7 +42,8 @@ for (const dir of readdirSync(docsDir, { withFileTypes: true })) {
if (!existsSync(metaPath)) continue;
const meta = JSON.parse(readFileSync(metaPath, "utf8"));
for (const page of meta.pages ?? []) {
- if (typeof page === "string" && page !== "index") sectionOf.set(page, dir.name);
+ if (typeof page === "string" && page !== "index")
+ sectionOf.set(page, dir.name);
}
}
@@ -91,13 +100,15 @@ function mergeIconWithCore(iconCode: string, coreCode: string): string {
for (const s of specs) {
if (set.has(s.replace(/^type /, ""))) continue;
if (s.startsWith("type ") || !set.has(`type ${s}`)) set.add(s);
- if (!s.startsWith("type ") && set.has(`type ${s}`)) set.delete(`type ${s}`), set.add(s);
+ if (!s.startsWith("type ") && set.has(`type ${s}`))
+ set.delete(`type ${s}`), set.add(s);
}
named.set(mod, set);
}
}
const importLines = [...named.entries()].map(
- ([mod, specs]) => `import { ${[...specs].sort().join(", ")} } from "${mod}";`,
+ ([mod, specs]) =>
+ `import { ${[...specs].sort().join(", ")} } from "${mod}";`,
);
const rest = [...new Set([...core.imports.rest, ...icon.imports.rest])];
return `"use client";\n\n${[...importLines, ...rest].join("\n")}\n\n${core.body}\n${icon.body}`;
@@ -113,9 +124,24 @@ function demoSource(opts: {
durationInFrames: number;
background: string;
}): string {
- const { slug, exportName, props, width, height, fps, durationInFrames, background } = opts;
- const initialFrame = Math.min(Math.floor(durationInFrames * 0.66), durationInFrames - 1);
- const propsLiteral = JSON.stringify(props, null, 2).replace(/"([A-Za-z_$][A-Za-z0-9_$]*)":/g, "$1:");
+ const {
+ slug,
+ exportName,
+ props,
+ width,
+ height,
+ fps,
+ durationInFrames,
+ background,
+ } = opts;
+ const initialFrame = Math.min(
+ Math.floor(durationInFrames * 0.66),
+ durationInFrames - 1,
+ );
+ const propsLiteral = JSON.stringify(props, null, 2).replace(
+ /"([A-Za-z_$][A-Za-z0-9_$]*)":/g,
+ "$1:",
+ );
return `"use client";
import { Player, type PlayerRef } from "@remotion/player";
@@ -210,7 +236,10 @@ for (const ns of ["remocn", "remocn-icons"] as const) {
const regDeps = item.registryDependencies ?? [];
const nonCoreDeps = regDeps.filter((d) => d !== "@remocn/icons-core");
if (nonCoreDeps.length > 0) {
- skipped.push({ slug, reason: `registry deps: ${nonCoreDeps.join(", ")}` });
+ skipped.push({
+ slug,
+ reason: `registry deps: ${nonCoreDeps.join(", ")}`,
+ });
continue;
}
const srcFile = path.join(root, "registry", ns, item.files[0].path);
@@ -265,24 +294,36 @@ for (const ns of ["remocn", "remocn-icons"] as const) {
transpiler.transformSync(code);
transpiler.transformSync(demo);
} catch (err) {
- skipped.push({ slug, reason: `transpile failed: ${String(err).slice(0, 120)}` });
+ skipped.push({
+ slug,
+ reason: `transpile failed: ${String(err).slice(0, 120)}`,
+ });
continue;
}
const importedPkgs = new Set<string>(item.dependencies ?? []);
- for (const m of code.matchAll(/(?:from\s+|import\s*\(\s*)"([^".@/][^"]*|@[^"]+)"/g)) {
+ for (const m of code.matchAll(
+ /(?:from\s+|import\s*\(\s*)"([^".@/][^"]*|@[^"]+)"/g,
+ )) {
const spec = m[1];
if (spec.startsWith("@/") || spec.startsWith(".")) continue;
const parts = spec.split("/");
- importedPkgs.add(spec.startsWith("@") ? `${parts[0]}/${parts[1]}` : parts[0]);
+ importedPkgs.add(
+ spec.startsWith("@") ? `${parts[0]}/${parts[1]}` : parts[0],
+ );
}
importedPkgs.delete("react");
importedPkgs.delete("react-dom");
- const npmDeps: Record<string, string> = { "@remotion/player": REMOTION_VERSION };
+ const npmDeps: Record<string, string> = {
+ "@remotion/player": REMOTION_VERSION,
+ };
let missingDep: string | null = null;
for (const dep of importedPkgs) {
try {
- npmDeps[dep] = dep.startsWith("@remotion/") || dep === "remotion" ? REMOTION_VERSION : versionOf(dep);
+ npmDeps[dep] =
+ dep.startsWith("@remotion/") || dep === "remotion"
+ ? REMOTION_VERSION
+ : versionOf(dep);
} catch {
missingDep = dep;
break;
@@ -308,7 +349,11 @@ for (const ns of ["remocn", "remocn-icons"] as const) {
name: item.title,
slug,
description: item.description,
- tags: (TAGS[sectionOf.get(slug) ?? (ns === "remocn-icons" ? "icons" : "")] ?? DEFAULT_TAGS).slice(0, 5),
+ tags: (
+ TAGS[
+ sectionOf.get(slug) ?? (ns === "remocn-icons" ? "icons" : "")
+ ] ?? DEFAULT_TAGS
+ ).slice(0, 5),
},
null,
2,
@@ -329,7 +374,10 @@ for (const ns of ["remocn", "remocn-icons"] as const) {
}
const coverImports = generated
- .map((g) => `import { ${g.exportName} as C_${g.slug.replace(/-/g, "_")} } from "${g.modPath}";`)
+ .map(
+ (g) =>
+ `import { ${g.exportName} as C_${g.slug.replace(/-/g, "_")} } from "${g.modPath}";`,
+ )
.join("\n");
const coverComps = generated
.map((g) => {
diff --git a/scripts/21st/publish.mts b/scripts/21st/publish.mts
index d025b575..f643c837 100644
--- a/scripts/21st/publish.mts
+++ b/scripts/21st/publish.mts
@@ -1,4 +1,4 @@
-import { existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
+import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
@@ -28,7 +28,9 @@ function saveResults(results: Record<string, PublishResult>) {
function writeChecklist(results: Record<string, PublishResult>) {
const drafts = Object.values(results).filter((r) => r.status === "draft");
- const failedList = Object.values(results).filter((r) => r.status === "failed");
+ const failedList = Object.values(results).filter(
+ (r) => r.status === "failed",
+ );
const lines = [
"# 21st.dev CLI Review checklist",
"",
@@ -37,7 +39,12 @@ function writeChecklist(results: Record<string, PublishResult>) {
...drafts.map((r) => `- [ ] ${r.slug} — ${r.editor_url}`),
];
if (failedList.length) {
- lines.push("", "## Failed", "", ...failedList.map((r) => `- ${r.slug}: ${r.error}`));
+ lines.push(
+ "",
+ "## Failed",
+ "",
+ ...failedList.map((r) => `- ${r.slug}: ${r.error}`),
+ );
}
writeFileSync(path.join(outRoot, "checklist.md"), `${lines.join("\n")}\n`);
}
@@ -88,7 +95,12 @@ async function publishOne(slug: string): Promise<PublishResult> {
}
} catch {}
}
- const tail = `${stdout}\n${stderr}`.trim().split("\n").slice(-3).join(" | ").slice(0, 300);
+ const tail = `${stdout}\n${stderr}`
+ .trim()
+ .split("\n")
+ .slice(-3)
+ .join(" | ")
+ .slice(0, 300);
return { slug, status: "failed", error: `exit ${exitCode}: ${tail}` };
}
@@ -100,7 +112,9 @@ async function main() {
const all = readdirSync(publishRoot, { withFileTypes: true })
.filter((d) => d.isDirectory())
.map((d) => d.name);
- const queue = (only ?? all).filter((slug) => results[slug]?.status !== "draft");
+ const queue = (only ?? all).filter(
+ (slug) => results[slug]?.status !== "draft",
+ );
console.log(`publishing ${queue.length} components (of ${all.length})`);
let index = 0;
@@ -121,8 +135,12 @@ async function main() {
}
await Promise.all(Array.from({ length: CONCURRENCY }, worker));
- const failedCount = Object.values(results).filter((r) => r.status === "failed").length;
- console.log(`done. drafts: ${Object.values(results).filter((r) => r.status === "draft").length}, failed: ${failedCount}`);
+ const failedCount = Object.values(results).filter(
+ (r) => r.status === "failed",
+ ).length;
+ console.log(
+ `done. drafts: ${Object.values(results).filter((r) => r.status === "draft").length}, failed: ${failedCount}`,
+ );
console.log(`checklist: ${path.join(outRoot, "checklist.md")}`);
}
diff --git a/scripts/21st/render-covers.mts b/scripts/21st/render-covers.mts
index abefe009..0afaec27 100644
--- a/scripts/21st/render-covers.mts
+++ b/scripts/21st/render-covers.mts
@@ -2,7 +2,11 @@ import { existsSync, readFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { bundle } from "@remotion/bundler";
-import { ensureBrowser, renderStill, selectComposition } from "@remotion/renderer";
+import {
+ ensureBrowser,
+ renderStill,
+ selectComposition,
+} from "@remotion/renderer";
import { tsconfigWebpackAlias } from "../tsconfig-webpack-alias.mts";
const here = path.dirname(fileURLToPath(import.meta.url));
@@ -10,7 +14,9 @@ const root = path.resolve(here, "..", "..");
const outRoot = path.join(root, "out", "21st");
async function main() {
- const { generated } = JSON.parse(readFileSync(path.join(outRoot, "generated.json"), "utf8")) as {
+ const { generated } = JSON.parse(
+ readFileSync(path.join(outRoot, "generated.json"), "utf8"),
+ ) as {
generated: string[];
};
const only = process.argv.includes("--only")
@@ -31,11 +37,13 @@ async function main() {
const serveUrl = await bundle({
entryPoint: path.join(outRoot, "covers-root.tsx"),
webpackOverride: (config) => {
- const existing = Object.entries(config.resolve?.alias ?? {}).map(([name, alias]) => ({
- name: name.replace(/\$$/, ""),
- alias: alias as string,
- onlyModule: name.endsWith("$"),
- }));
+ const existing = Object.entries(config.resolve?.alias ?? {}).map(
+ ([name, alias]) => ({
+ name: name.replace(/\$$/, ""),
+ alias: alias as string,
+ onlyModule: name.endsWith("$"),
+ }),
+ );
return {
...config,
resolve: {
@@ -69,7 +77,8 @@ async function main() {
failed.push({ slug, error: String(err).slice(0, 200) });
}
done += 1;
- if (done % 10 === 0 || done === slugs.length) console.log(`covers: ${done}/${slugs.length}`);
+ if (done % 10 === 0 || done === slugs.length)
+ console.log(`covers: ${done}/${slugs.length}`);
}
if (failed.length) {
console.log(`FAILED (${failed.length}):`);