Skip to content

Commit 5d2a46c

Browse files
authored
📝 feat: Update readmes (#173)
1 parent 8867eca commit 5d2a46c

File tree

2 files changed

+118
-3
lines changed

2 files changed

+118
-3
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# create-drupal-decoupled
2+
3+
> A CLI tool that scaffolds Drupal integration for decoupled frontend projects.
4+
5+
## Features
6+
7+
- Automatic detection of frontend frameworks (Next.js, React Router, Remix)
8+
- Scaffolds GraphQL integration with type-safe queries
9+
- Configures authentication and API connection
10+
- Updates project configuration files
11+
- Framework-specific template generation
12+
13+
## Installation
14+
15+
```bash
16+
# Using npm
17+
npx @octahedroid/create-drupal-decoupled
18+
19+
# Using yarn
20+
yarn create @octahedroid/drupal-decoupled
21+
22+
# Using pnpm
23+
pnpm create @octahedroid/drupal-decoupled
24+
25+
# Using bun
26+
bunx @octahedroid/create-drupal-decoupled
27+
```
28+
29+
## Quick Start
30+
31+
Navigate to your existing frontend project and run the scaffolding command:
32+
33+
```bash
34+
# In your project directory
35+
npx @octahedroid/create-drupal-decoupled . --frontend next
36+
37+
# Or specify a different directory
38+
npx @octahedroid/create-drupal-decoupled my-project --frontend react-router
39+
```
40+
41+
## Supported Frameworks
42+
43+
- **Next.js** (`next`) - React framework with server-side rendering
44+
- **React Router** (`react-router`) - Modern React routing library
45+
- **Remix** (`remix`) - Full-stack React framework
46+
47+
## Usage
48+
49+
```bash
50+
create-drupal-decoupled [project-directory] [options]
51+
```
52+
53+
### Arguments
54+
55+
- `project-directory` - Target directory for scaffolding (defaults to current directory)
56+
57+
### Options
58+
59+
- `-f, --frontend <framework>` - Frontend framework to use (required)
60+
- `-v, --version` - Display version number
61+
- `-h, --help` - Display help information
62+
63+
### Examples
64+
65+
```bash
66+
# Scaffold Next.js integration in current directory
67+
npx @octahedroid/create-drupal-decoupled . --frontend next
68+
69+
# Scaffold React Router integration in specific directory
70+
npx @octahedroid/create-drupal-decoupled ./my-app --frontend react-router
71+
72+
# Scaffold Remix integration
73+
npx @octahedroid/create-drupal-decoupled ./remix-app --frontend remix
74+
```
75+
76+
## What Gets Generated
77+
78+
The CLI will add the following to your project:
79+
80+
- GraphQL configuration and type definitions
81+
- Drupal client setup with authentication
82+
- Framework-specific integration files
83+
- Environment variable templates
84+
- Updated `.gitignore` with Drupal-specific entries
85+
86+
## Requirements
87+
88+
- Node.js >= 20.15.1
89+
- Existing frontend project with supported framework
90+
- Package.json file in target directory
91+
92+
## Development
93+
94+
### Setup
95+
96+
```bash
97+
# Install dependencies
98+
yarn install
99+
100+
# Build the package
101+
yarn build
102+
103+
# Development mode with file watching
104+
yarn dev
105+
```
106+
107+
### Local Testing
108+
109+
```bash
110+
# Build the package
111+
yarn build
112+
113+
# Test locally
114+
node dist/index.js . --frontend next
115+
```

packages/drupal-decoupled/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Drupal Decoupled
22

3-
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.
3+
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.
44

55
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!
66

@@ -11,12 +11,12 @@ Visit the [docs](https://drupal-decoupled.octahedroid.com/) to see how to use th
1111

1212
### Quickstart
1313
- [Drupal](https://drupal-decoupled.octahedroid.com/docs/getting-started/quick-start/drupal/)
14-
- [Remix](https://drupal-decoupled.octahedroid.com/docs/getting-started/quick-start/remix)
14+
- [React Router](https://drupal-decoupled.octahedroid.com/docs/getting-started/quick-start/react-router)
1515
- [Next.js](https://drupal-decoupled.octahedroid.com/docs/getting-started/quick-start/next)
1616

1717
### Step by step
1818
- [Drupal](https://drupal-decoupled.octahedroid.com/docs/getting-started/step-by-step/drupal/install/)
19-
- [Remix](https://drupal-decoupled.octahedroid.com/docs/01-getting-started/02-step-by-step/02-starters/01-remix/)
19+
- [React Router](https://drupal-decoupled.octahedroid.com/docs/01-getting-started/02-step-by-step/02-starters/01-react-router/)
2020
- [Next.js](https://drupal-decoupled.octahedroid.com/docs/01-getting-started/02-step-by-step/02-starters/02-next/)
2121

2222
## Supporting organizations

0 commit comments

Comments
 (0)