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

V0.3.3 #57

Merged
merged 21 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
64d1bfe
:art: unify component type
damien-schneider Nov 9, 2024
1e89ba1
:fire: remove dupplicated lib files
damien-schneider Nov 9, 2024
5132fa3
:fire: remove lastUpdatedDateComponent from multiple categories
damien-schneider Nov 9, 2024
d228016
:sparkles: v0.3.2
damien-schneider Nov 14, 2024
2a6e650
:art: update slugPreviewFile format in gradientPricingTableComponent
damien-schneider Nov 14, 2024
8a595ca
:lipstick: update header and category title styles for improved reada…
damien-schneider Nov 22, 2024
d6a3880
:art: update component type definitions to allow function components …
damien-schneider Nov 22, 2024
1a25e07
:sparkles: add functionality to retrieve the latest changelog date an…
damien-schneider Nov 22, 2024
ae9cbd4
🚚 move back the biome config at root
damien-schneider Nov 22, 2024
ba856ae
:sparkles: add sticky footer components
damien-schneider Nov 22, 2024
914d51d
:art: rename QR code generator component file and update imports for …
damien-schneider Nov 22, 2024
453691f
📝 add latest changelog
damien-schneider Nov 22, 2024
8163b12
Merge branch 'main' into v0.3.3
damien-schneider Nov 22, 2024
9156da9
:fire: remove sidemenu useless test file
damien-schneider Nov 22, 2024
6d953c4
📦 update pnpm-lock
damien-schneider Nov 22, 2024
af206db
:art: refactor GithubStarsButton component for improved readability a…
damien-schneider Nov 22, 2024
2235a0b
🚧 disable changelog date logic in InfoMenuList component
damien-schneider Nov 22, 2024
9214e22
🚚 remove getLatestChangelogDate function and related logic from InfoM…
damien-schneider Nov 22, 2024
d3e8373
:art: refactor InfoMenuList component to streamline changelog date logic
damien-schneider Nov 23, 2024
4ebf3ec
:art: add "use server" directive to InfoMenuList component
damien-schneider Nov 23, 2024
ad6b9e3
:art: add script to generate last changelog date and update InfoMenuL…
damien-schneider Nov 23, 2024
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
38 changes: 0 additions & 38 deletions apps/website/__tests__/sidemenu.test.tsx

This file was deleted.

3 changes: 2 additions & 1 deletion apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
"private": false,
"publisher": "Damien Schneider",
"scripts": {
"build": "next build",
"build": "pnpm pre-build && next build",
"pre-build": "pnpm scripts/generate-latest-changelog-date.mjs && pnpm scripts/generate-package-list-check.mjs",
"dev": "next dev --turbo",
"start": "next start",
"format:check": "biome format --check ./src",
Expand Down
34 changes: 34 additions & 0 deletions apps/website/scripts/generate-latest-changelog-date.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env node
// chmod +x scripts/generate-latest-changelog-date.js

import { parseISO } from "date-fns";
import { promises as fs } from "node:fs";
import path from "node:path";

const changelogDir = path.join(process.cwd(), "src/changelogs");
const filenames = await fs.readdir(changelogDir);

let latestChangelogDate = new Date(0);

for (const file of filenames) {
const filenameWithoutExtension = file.replace(/\.mdx$/, "");
const isoDate = parseISO(filenameWithoutExtension);
if (isoDate > latestChangelogDate) {
latestChangelogDate = isoDate;
}
}

// Define the output path for the last-changelog-date.ts file
const outputPath = path.join(
process.cwd(),
"src/changelogs/last-changelog-date.ts",
);

// Prepare the content to be written to the file
const content = `// This file is generated by the generate-latest-changelog-date script
export const lastChangelogDate = new Date("${latestChangelogDate.toISOString()}");\n`;

// Write the content to the last-changelog-date.ts file
await fs.writeFile(outputPath, content);

console.log(`Last changelog date exported to ${outputPath}`);
71 changes: 0 additions & 71 deletions apps/website/scripts/generate-package-list-check.js

This file was deleted.

85 changes: 85 additions & 0 deletions apps/website/scripts/generate-package-list-check.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/usr/bin/env node
// chmod +x scripts/generate-package-list-check.js

import fs from "node:fs";
import path from "node:path";

// Define the paths to package.json files
const packageJsonPath = path.resolve(process.cwd(), "package.json");
const cuicuiPackageJsonPath = path.resolve(
process.cwd(),
"../../packages/ui/package.json",
);

// Define the output TypeScript file path inside ./src/lib/
const outputDirectory = path.resolve(process.cwd(), "src", "lib");
const outputTsPath = path.join(
outputDirectory,
"generated-package-check-list-to-install.ts",
);

const importStatement = `import type { PackageToInstallType } from "#/src/components/steps-to-install/packages";\n`;
const commentStatement =
"// This is an automatically generated file with the ./scripts/generate-package-list-check.ts script\n";

// biome-ignore lint/style/noUnusedTemplateLiteral: <We need template literals in the final file>
const exportStatementStart = `export const packageCheckListToInstall: PackageToInstallType[] = [`;

// biome-ignore lint/style/noUnusedTemplateLiteral: <We need template literals in the final file>
const exportStatementEnd = `];\n`;

// Function to escape double quotes in strings
const escapeDoubleQuotes = (str) => str.replace(/"/g, '\\"');

try {
// Ensure the output directory exists; if not, create it
if (!fs.existsSync(outputDirectory)) {
fs.mkdirSync(outputDirectory, { recursive: true });
}

// Read and parse main package.json
const packageJsonData = fs.readFileSync(packageJsonPath, "utf-8");
const packageJson = JSON.parse(packageJsonData);

// Read and parse cuicui ui package.json
const cuicuiPackageJsonData = fs.readFileSync(cuicuiPackageJsonPath, "utf-8");
const cuicuiPackageJson = JSON.parse(cuicuiPackageJsonData);

// Extract dependencies and devDependencies from main package.json
const dependencies = packageJson.dependencies || {};
const devDependencies = packageJson.devDependencies || {};

// Extract dependencies and devDependencies from cuicui ui package.json
const cuicuiDependencies = cuicuiPackageJson.dependencies || {};
const cuicuiDevDependencies = cuicuiPackageJson.devDependencies || {};

// Combine all dependencies and devDependencies from both package.json files
const allPackages = {
...dependencies,
...devDependencies,
...cuicuiDependencies,
...cuicuiDevDependencies,
};

// Generate the checklist array as TypeScript objects
const packageCheckListToInstall = Object.keys(allPackages).map((pkg) => {
return ` {
find: [\`from "${escapeDoubleQuotes(pkg)}"\`],
packageName: "${pkg}",
},`;
});

// Combine all parts to form the complete TypeScript file content
const tsFileContent = [
commentStatement,
importStatement,
exportStatementStart,
...packageCheckListToInstall,
exportStatementEnd,
].join("\n");

// Write the TypeScript file
fs.writeFileSync(outputTsPath, tsFileContent, "utf-8");
} catch (_error) {
process.exit(1);
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function CategoryLayout({ children, params }: Props) {
/>
<meta content="all" name="robots" />
</Head>
<h1 className="bg-gradient-to-br from-sky-400 via-violet-500 to-orange-400 bg-clip-text font-medium text-transparent text-5xl inline tracking-tighter">
<h1 className="bg-gradient-to-b from-black to-black/40 dark:from-white dark:to-white/10 bg-clip-text font-medium text-transparent text-3xl sm:text-5xl inline tracking-tighter">
{category.name} components
</h1>
{children}
Expand Down
Loading