diff --git a/packages/create-drupal-decoupled/README.md b/packages/create-drupal-decoupled/README.md new file mode 100644 index 0000000..ad73538 --- /dev/null +++ b/packages/create-drupal-decoupled/README.md @@ -0,0 +1,115 @@ +# create-drupal-decoupled + +> A CLI tool that scaffolds Drupal integration for decoupled frontend projects. + +## Features + +- Automatic detection of frontend frameworks (Next.js, React Router, Remix) +- Scaffolds GraphQL integration with type-safe queries +- Configures authentication and API connection +- Updates project configuration files +- Framework-specific template generation + +## Installation + +```bash +# Using npm +npx @octahedroid/create-drupal-decoupled + +# Using yarn +yarn create @octahedroid/drupal-decoupled + +# Using pnpm +pnpm create @octahedroid/drupal-decoupled + +# Using bun +bunx @octahedroid/create-drupal-decoupled +``` + +## Quick Start + +Navigate to your existing frontend project and run the scaffolding command: + +```bash +# In your project directory +npx @octahedroid/create-drupal-decoupled . --frontend next + +# Or specify a different directory +npx @octahedroid/create-drupal-decoupled my-project --frontend react-router +``` + +## Supported Frameworks + +- **Next.js** (`next`) - React framework with server-side rendering +- **React Router** (`react-router`) - Modern React routing library +- **Remix** (`remix`) - Full-stack React framework + +## Usage + +```bash +create-drupal-decoupled [project-directory] [options] +``` + +### Arguments + +- `project-directory` - Target directory for scaffolding (defaults to current directory) + +### Options + +- `-f, --frontend ` - Frontend framework to use (required) +- `-v, --version` - Display version number +- `-h, --help` - Display help information + +### Examples + +```bash +# Scaffold Next.js integration in current directory +npx @octahedroid/create-drupal-decoupled . --frontend next + +# Scaffold React Router integration in specific directory +npx @octahedroid/create-drupal-decoupled ./my-app --frontend react-router + +# Scaffold Remix integration +npx @octahedroid/create-drupal-decoupled ./remix-app --frontend remix +``` + +## What Gets Generated + +The CLI will add the following to your project: + +- GraphQL configuration and type definitions +- Drupal client setup with authentication +- Framework-specific integration files +- Environment variable templates +- Updated `.gitignore` with Drupal-specific entries + +## Requirements + +- Node.js >= 20.15.1 +- Existing frontend project with supported framework +- Package.json file in target directory + +## Development + +### Setup + +```bash +# Install dependencies +yarn install + +# Build the package +yarn build + +# Development mode with file watching +yarn dev +``` + +### Local Testing + +```bash +# Build the package +yarn build + +# Test locally +node dist/index.js . --frontend next +``` \ No newline at end of file diff --git a/packages/drupal-decoupled/README.md b/packages/drupal-decoupled/README.md index ddcc7a3..112b037 100644 --- a/packages/drupal-decoupled/README.md +++ b/packages/drupal-decoupled/README.md @@ -1,6 +1,6 @@ # Drupal Decoupled -Using Drupal as a headless CMS with a Decoupled front-end implementation is a great way to get an enterprise-quality CMS, paired with a great modern development experience using Remix, Next.js, Astro and/or others. +Using Drupal as a headless CMS with a Decoupled front-end implementation is a great way to get an enterprise-quality CMS, paired with a great modern development experience using React Router, Next.js, Astro and/or others. Unlock the full potential of Drupal as an API-first CMS. Our quick-start guides and ready-to-use examples help you get started in no time! @@ -11,12 +11,12 @@ Visit the [docs](https://drupal-decoupled.octahedroid.com/) to see how to use th ### Quickstart - [Drupal](https://drupal-decoupled.octahedroid.com/docs/getting-started/quick-start/drupal/) -- [Remix](https://drupal-decoupled.octahedroid.com/docs/getting-started/quick-start/remix) +- [React Router](https://drupal-decoupled.octahedroid.com/docs/getting-started/quick-start/react-router) - [Next.js](https://drupal-decoupled.octahedroid.com/docs/getting-started/quick-start/next) ### Step by step - [Drupal](https://drupal-decoupled.octahedroid.com/docs/getting-started/step-by-step/drupal/install/) -- [Remix](https://drupal-decoupled.octahedroid.com/docs/01-getting-started/02-step-by-step/02-starters/01-remix/) +- [React Router](https://drupal-decoupled.octahedroid.com/docs/01-getting-started/02-step-by-step/02-starters/01-react-router/) - [Next.js](https://drupal-decoupled.octahedroid.com/docs/01-getting-started/02-step-by-step/02-starters/02-next/) ## Supporting organizations