chore: prepare first release 1.0.1
This commit is contained in:
7
packages/cli/CHANGELOG.md
Normal file
7
packages/cli/CHANGELOG.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# @mintel/cli
|
||||
|
||||
## 1.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Initial release of the Mintel factory packages.
|
||||
@@ -1,26 +1,33 @@
|
||||
# @mintel/cli
|
||||
|
||||
CLI tool for managing the Mintel monorepo and scaffolding new client websites.
|
||||
The Mintel CLI is the primary automation tool for managing the monorepo and ensuring all client websites follow the same high-quality standards and infrastructure patterns.
|
||||
|
||||
## Installation
|
||||
## 🚀 Installation
|
||||
|
||||
The CLI is intended to be used within the monorepo:
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
|
||||
## Commands
|
||||
## 🛠 Commands
|
||||
|
||||
### `init <path>`
|
||||
|
||||
Initializes a new website project in the specified path (relative to the monorepo root).
|
||||
Scaffolds a new, production-ready client website in the specified path.
|
||||
|
||||
```bash
|
||||
pnpm --filter @mintel/cli start init apps/my-new-website
|
||||
pnpm --filter @mintel/cli start init apps/my-new-website.com
|
||||
```
|
||||
|
||||
This command will:
|
||||
1. Create the project directory.
|
||||
2. Generate `package.json`, `tsconfig.json`, and `eslint.config.mjs` extending `@mintel` defaults.
|
||||
3. Set up a localized Next.js structure (`src/app/[locale]`).
|
||||
4. Configure `next-intl` middleware and request config.
|
||||
5. Inject production-ready `Dockerfile`, `docker-compose.yml`, and Gitea Actions deployment workflows.
|
||||
#### What it does:
|
||||
1. **Project Structure**: Creates a modern Next.js directory layout.
|
||||
2. **Shared Configs**: Generates `package.json`, `tsconfig.json`, and `eslint.config.mjs` that extend the `@mintel` shared packages.
|
||||
3. **Localization**: Sets up a localized routing structure (`src/app/[locale]`) with `next-intl` pre-configured.
|
||||
4. **Error Tracking**: Injects Sentry/GlitchTip instrumentation.
|
||||
5. **Environment Safety**: Adds a validation script (`scripts/validate-env.ts`) to catch missing secrets at build time.
|
||||
6. **Infrastructure**: Injects the universal `Dockerfile`, `docker-compose.yml`, and the tag-based Gitea Actions deployment workflow.
|
||||
|
||||
## 🛠 Development
|
||||
|
||||
To add new features to the scaffold (e.g., new shared files or config templates), modify `packages/cli/src/index.ts`.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mintel/cli",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://npm.infra.mintel.me"
|
||||
|
||||
@@ -99,6 +99,21 @@ export default nextConfig;
|
||||
eslintConfig
|
||||
);
|
||||
|
||||
// Create env validation script
|
||||
await fs.ensureDir(path.join(fullPath, "scripts"));
|
||||
await fs.writeFile(
|
||||
path.join(fullPath, "scripts/validate-env.ts"),
|
||||
`import { validateMintelEnv } from "@mintel/next-utils";
|
||||
|
||||
try {
|
||||
validateMintelEnv();
|
||||
console.log("✅ Environment variables validated");
|
||||
} catch (error) {
|
||||
process.exit(1);
|
||||
}
|
||||
`
|
||||
);
|
||||
|
||||
// Create basic src structure
|
||||
await fs.ensureDir(path.join(fullPath, "src/app/[locale]"));
|
||||
await fs.writeFile(
|
||||
@@ -186,10 +201,14 @@ export default function RootLayout({
|
||||
|
||||
await fs.writeFile(
|
||||
path.join(fullPath, "src/app/[locale]/page.tsx"),
|
||||
`export default function Home() {
|
||||
`import { useTranslations } from 'next-intl';
|
||||
|
||||
export default function Home() {
|
||||
const t = useTranslations('Index');
|
||||
|
||||
return (
|
||||
<main>
|
||||
<h1>Welcome to ${projectName}</h1>
|
||||
<h1>{t('title')} to ${projectName}</h1>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user