Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 696f9d361d | |||
| 31840da9e7 |
@@ -4,10 +4,30 @@ The Mintel CLI is the primary automation tool for managing the monorepo and ensu
|
|||||||
|
|
||||||
## 🚀 Installation
|
## 🚀 Installation
|
||||||
|
|
||||||
The CLI is intended to be used within the monorepo:
|
### Using npx (Recommended)
|
||||||
|
|
||||||
|
Run the CLI without installing it globally. This always uses the latest version from the registry:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm install
|
npx @mintel/cli init apps/my-new-website.com
|
||||||
|
```
|
||||||
|
|
||||||
|
### Global Installation
|
||||||
|
|
||||||
|
Install the CLI globally from the Mintel registry:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install -g @mintel/cli
|
||||||
|
```
|
||||||
|
|
||||||
|
### Development (Local Link)
|
||||||
|
|
||||||
|
If you are contributing to the CLI, you can link it locally:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd packages/cli
|
||||||
|
pnpm build
|
||||||
|
npm link
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🛠 Commands
|
## 🛠 Commands
|
||||||
@@ -17,10 +37,11 @@ pnpm install
|
|||||||
Scaffolds a new, production-ready client website in the specified path.
|
Scaffolds a new, production-ready client website in the specified path.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm --filter @mintel/cli start init apps/my-new-website.com
|
mintel init apps/my-new-website.com
|
||||||
```
|
```
|
||||||
|
|
||||||
#### What it does:
|
#### What it does:
|
||||||
|
|
||||||
1. **Project Structure**: Creates a modern Next.js directory layout.
|
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.
|
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.
|
3. **Localization**: Sets up a localized routing structure (`src/app/[locale]`) with `next-intl` pre-configured.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
import { Command } from "commander";
|
import { Command } from "commander";
|
||||||
import fs from "fs-extra";
|
import fs from "fs-extra";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
@@ -87,7 +88,7 @@ program
|
|||||||
.action(async (projectPath) => {
|
.action(async (projectPath) => {
|
||||||
const fullPath = path.isAbsolute(projectPath)
|
const fullPath = path.isAbsolute(projectPath)
|
||||||
? projectPath
|
? projectPath
|
||||||
: path.resolve(process.cwd(), "../../", projectPath);
|
: path.resolve(process.cwd(), projectPath);
|
||||||
const projectName = path.basename(fullPath);
|
const projectName = path.basename(fullPath);
|
||||||
|
|
||||||
console.log(chalk.blue(`Initializing new project: ${projectName}...`));
|
console.log(chalk.blue(`Initializing new project: ${projectName}...`));
|
||||||
|
|||||||
@@ -7,18 +7,29 @@
|
|||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"main": "./dist/index.js",
|
||||||
|
"module": "./dist/index.js",
|
||||||
|
"types": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts",
|
".": {
|
||||||
"./templates/*": "./src/templates/*"
|
"types": "./dist/index.d.ts",
|
||||||
|
"import": "./dist/index.js"
|
||||||
|
},
|
||||||
|
"./templates/*": {
|
||||||
|
"types": "./dist/templates/*.d.ts",
|
||||||
|
"import": "./dist/templates/*.js"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup src/index.ts --format esm --dts",
|
"build": "tsup src/index.ts src/templates/*.tsx --format esm --dts --clean",
|
||||||
"dev": "tsup src/index.ts --format esm --watch",
|
"dev": "tsup src/index.ts src/templates/*.tsx --format esm --watch --dts",
|
||||||
"lint": "eslint src",
|
"lint": "eslint src",
|
||||||
"test": "vitest run"
|
"test": "vitest run"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-email/components": "^0.0.33",
|
"@react-email/components": "^0.0.33"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"react-dom": "^19.0.0"
|
"react-dom": "^19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user