decoupled-cli 2.0.3 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -11
- package/dist/commands/auth.js +16 -6
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/content.js +3 -3
- package/dist/commands/content.js.map +1 -1
- package/dist/commands/download.js +3 -3
- package/dist/commands/spaces.d.ts.map +1 -1
- package/dist/commands/spaces.js +20 -23
- package/dist/commands/spaces.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/api.js +7 -0
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +8 -3
- package/dist/lib/config.js.map +1 -1
- package/examples/.cursorrules +31 -31
- package/examples/CLAUDE.md +44 -44
- package/examples/GEMINI.md +42 -42
- package/examples/content-import-sample.json +237 -62
- package/package.json +3 -3
package/dist/lib/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":";;;;;;AA4KA,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":";;;;;;AA4KA,0CA0BC;AAtMD,kDAAiE;AAEjE,qCAAyC;AAEzC,MAAa,SAAS;IAKpB,YAAY,OAAe,EAAE,KAAa,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,GAAG,KAAK;QAC1E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,OAAO;YAChB,OAAO;YACP,OAAO,EAAE;gBACP,eAAe,EAAE,UAAU,KAAK,EAAE;gBAClC,cAAc,EAAE,kBAAkB;gBAClC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,CAAC,EAClD,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAC3B,IAAI;IAKM,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB7D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA0CtD,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBrD,YAAY,IAAI,MAAM,EAAE;IAIxB,aAAa,IAAI,MAAM;IAIvB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAKtC,eAAe,IAAI,MAAM,GAAG,SAAS;IAIrC,iBAAiB,IAAI,IAAI;IAKnB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IA0BzC;;OAEG;IACH,OAAO,CAAC,WAAW;IAOnB;;OAEG;YACW,oBAAoB;IAuClC;;OAEG;IACI,mBAAmB,IAAI,OAAO;IAMrC;;OAEG;IACI,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIxC;;OAEG;IACI,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI;IAQpE;;OAEG;IACI,qBAAqB,IAAI,OAAO;CAIxC;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
package/dist/lib/config.js
CHANGED
|
@@ -145,14 +145,19 @@ class ConfigManager {
|
|
|
145
145
|
async getToken(profileName) {
|
|
146
146
|
const profile = profileName || this.config.currentProfile;
|
|
147
147
|
const profileConfig = this.config.profiles[profile];
|
|
148
|
-
// Check
|
|
148
|
+
// Priority 1: Check for PAT in environment variable (for CI/CD, automated scripts)
|
|
149
|
+
const envToken = process.env.DECOUPLED_CLI_TOKEN;
|
|
150
|
+
if (envToken && envToken.startsWith('dc_tok_')) {
|
|
151
|
+
return envToken;
|
|
152
|
+
}
|
|
153
|
+
// Priority 2: Check if profile is configured for OAuth
|
|
149
154
|
if (profileConfig?.useOAuth) {
|
|
150
155
|
const oauthToken = await this.getOAuthTokenFromEnv();
|
|
151
156
|
if (oauthToken) {
|
|
152
157
|
return oauthToken;
|
|
153
158
|
}
|
|
154
159
|
}
|
|
155
|
-
// Try keytar
|
|
160
|
+
// Priority 3: Try keytar if available
|
|
156
161
|
if (keytarAvailable) {
|
|
157
162
|
try {
|
|
158
163
|
const token = await keytar.getPassword(SERVICE_NAME, profile);
|
|
@@ -164,7 +169,7 @@ class ConfigManager {
|
|
|
164
169
|
console.warn(chalk_1.default.yellow(`Warning: Failed to retrieve token from keychain: ${error}`));
|
|
165
170
|
}
|
|
166
171
|
}
|
|
167
|
-
// Fallback to config file stored token hash
|
|
172
|
+
// Priority 4: Fallback to config file stored token hash
|
|
168
173
|
if (profileConfig?.tokenHash) {
|
|
169
174
|
try {
|
|
170
175
|
return Buffer.from(profileConfig.tokenHash, 'base64').toString();
|
package/dist/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,kDAA0B;AAC1B,mCAAgD;AAChD,4DAA+B;AAE/B,oFAAoF;AACpF,IAAI,MAAM,GAAQ,IAAI,CAAC;AACvB,IAAI,eAAe,GAAG,KAAK,CAAC;AAE5B,IAAI,CAAC;IACH,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,eAAe,GAAG,IAAI,CAAC;AACzB,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,OAAO,CAAC,IAAI,CAAC,eAAK,CAAC,MAAM,CAAC,mGAAmG,CAAC,CAAC,CAAC;IAChI,eAAe,GAAG,KAAK,CAAC;AAC1B,CAAC;AAmB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C;IAC7C,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,OAAO,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,IAAI,CAAC;IACzD,CAAC;IAED;;OAEG;IACI,eAAe,CAAC,WAAmB,EAAE,QAAiB;QAC3D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,YAAY,WAAW,kBAAkB,CAAC,CAAC;QAC7D,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACtD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,qBAAqB;QAC1B,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAChD,OAAO,cAAc,EAAE,QAAQ,IAAI,KAAK,CAAC;IAC3C,CAAC;CACF;AA7RD,sCA6RC;AAEY,QAAA,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC"}
|
package/examples/.cursorrules
CHANGED
|
@@ -2,7 +2,7 @@ You are the Cursor AI working in a Next.js + Drupal monorepo. Follow these rules
|
|
|
2
2
|
|
|
3
3
|
# Project Overview
|
|
4
4
|
- Architecture: Headless Drupal backend with Next.js frontend
|
|
5
|
-
- Backend: Drupal 11 with GraphQL Compose and
|
|
5
|
+
- Backend: Drupal 11 with GraphQL Compose and DC Import API
|
|
6
6
|
- Frontend: Next.js 15 with TypeScript, Tailwind CSS, Apollo GraphQL
|
|
7
7
|
- Environment: DDEV local development
|
|
8
8
|
|
|
@@ -13,14 +13,14 @@ You are the Cursor AI working in a Next.js + Drupal monorepo. Follow these rules
|
|
|
13
13
|
- `DRUPAL_REVALIDATE_SECRET` – On-demand revalidation secret
|
|
14
14
|
- `NODE_TLS_REJECT_UNAUTHORIZED=0` – Allow self-signed certs (dev)
|
|
15
15
|
|
|
16
|
-
#
|
|
17
|
-
**CRITICAL**: Use
|
|
16
|
+
# DC CLI Usage
|
|
17
|
+
**CRITICAL**: Use DC CLI instead of direct API calls.
|
|
18
18
|
|
|
19
19
|
First-time setup:
|
|
20
20
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
decoupled-cli auth login # Authenticate with platform
|
|
22
|
+
decoupled-cli spaces use <id> # Set default space (optional)
|
|
23
|
+
decoupled-cli spaces current # Verify setup
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
# End-to-End Workflow
|
|
@@ -28,9 +28,9 @@ When asked to implement a new content type (e.g., “create a product page”),
|
|
|
28
28
|
|
|
29
29
|
1) Verify CLI authentication
|
|
30
30
|
```bash
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
decoupled-cli auth status # Check if authenticated
|
|
32
|
+
decoupled-cli spaces list # List available spaces
|
|
33
|
+
decoupled-cli spaces use <id> # Set default space if needed
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
2) Plan content type
|
|
@@ -38,8 +38,8 @@ dcloud spaces use <id> # Set default space if needed
|
|
|
38
38
|
- List fields and types
|
|
39
39
|
- Determine components, routes, display needs
|
|
40
40
|
|
|
41
|
-
3) Create
|
|
42
|
-
- Get example format: `
|
|
41
|
+
3) Create DC Import JSON
|
|
42
|
+
- Get example format: `decoupled-cli spaces content-import --example`
|
|
43
43
|
- Include model definition and sample content
|
|
44
44
|
- Important: In `values`, use field ID directly, never with `field_` prefix
|
|
45
45
|
- For image fields: Use full URLs with Drupal domain from `.env.local`, not relative paths
|
|
@@ -68,7 +68,7 @@ Template:
|
|
|
68
68
|
"body": "<p>Body content</p>",
|
|
69
69
|
"field_name": "field_value",
|
|
70
70
|
"image_field": {
|
|
71
|
-
"uri": "${DRUPAL_BASE_URL}/modules/custom/
|
|
71
|
+
"uri": "${DRUPAL_BASE_URL}/modules/custom/dc_import/resources/placeholder.png",
|
|
72
72
|
"alt": "Image description",
|
|
73
73
|
"title": "Image title"
|
|
74
74
|
}
|
|
@@ -78,14 +78,14 @@ Template:
|
|
|
78
78
|
}
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
4) Import via
|
|
81
|
+
4) Import via DC CLI
|
|
82
82
|
```bash
|
|
83
83
|
# Import content type and sample content
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
decoupled-cli spaces content-import --file content-type-import.json --preview # Preview first
|
|
85
|
+
decoupled-cli spaces content-import --file content-type-import.json # Apply changes
|
|
86
86
|
|
|
87
87
|
# Generate example if needed
|
|
88
|
-
|
|
88
|
+
decoupled-cli spaces content-import --example > content-type-import.json
|
|
89
89
|
```
|
|
90
90
|
- **CRITICAL**: Immediately run schema generation:
|
|
91
91
|
```bash
|
|
@@ -112,7 +112,7 @@ lib/
|
|
|
112
112
|
- Components: card + renderer; use `dangerouslySetInnerHTML` for processed HTML
|
|
113
113
|
- Routing: handle in dynamic route switch by `__typename`
|
|
114
114
|
- Navigation: add link in `app/components/Header.tsx`; update `navigationItems` and active detection with `pathname.startsWith('/route/')`
|
|
115
|
-
-
|
|
115
|
+
- DC GraphQL fields return simple types (`string`, `string[]`, `bool`, etc.), not `{ processed }` objects — probe schema with a quick query before typing components
|
|
116
116
|
|
|
117
117
|
5) Build and test
|
|
118
118
|
- `npm run build` → fix TypeScript/build errors
|
|
@@ -120,7 +120,7 @@ lib/
|
|
|
120
120
|
- Check URLs: `/[content-type]`, `/[content-type]/[slug]`
|
|
121
121
|
|
|
122
122
|
Checklist:
|
|
123
|
-
- [ ]
|
|
123
|
+
- [ ] DC import succeeds
|
|
124
124
|
- [ ] **Schema generation runs (`npm run generate-schema`)**
|
|
125
125
|
- [ ] GraphQL schema exposes fields
|
|
126
126
|
- [ ] Types compile
|
|
@@ -145,28 +145,28 @@ Checklist:
|
|
|
145
145
|
|
|
146
146
|
# Common Patterns
|
|
147
147
|
- Product: `price (string)`, `product_images (image[])`, `in_stock (bool)`, `features (string[])`
|
|
148
|
-
- Image URI: `{"uri": "${DRUPAL_BASE_URL}/modules/custom/
|
|
148
|
+
- Image URI: `{"uri": "${DRUPAL_BASE_URL}/modules/custom/dc_import/resources/placeholder.png", "alt": "Product image", "title": "Product"}`
|
|
149
149
|
- Event: `event_date (datetime)`, `location (string)`, `speakers (string[])`
|
|
150
150
|
- Team: `position (string)`, `profile_image (image)`, `bio (text)`
|
|
151
|
-
- Image URI: `{"uri": "${DRUPAL_BASE_URL}/modules/custom/
|
|
151
|
+
- Image URI: `{"uri": "${DRUPAL_BASE_URL}/modules/custom/dc_import/resources/placeholder.png", "alt": "Team member photo", "title": "Profile"}`
|
|
152
152
|
- Case Study: `project_url (string)`, `technologies (string[])`, `project_images (image[])`
|
|
153
|
-
- Image URI: `{"uri": "${DRUPAL_BASE_URL}/modules/custom/
|
|
153
|
+
- Image URI: `{"uri": "${DRUPAL_BASE_URL}/modules/custom/dc_import/resources/placeholder.png", "alt": "Project screenshot", "title": "Interface"}`
|
|
154
154
|
|
|
155
155
|
# Troubleshooting
|
|
156
|
-
-
|
|
157
|
-
- **Schema not updated**: ALWAYS run `npm run generate-schema` after
|
|
156
|
+
- DC import fails: check OAuth, JSON structure, no `field_` in values
|
|
157
|
+
- **Schema not updated**: ALWAYS run `npm run generate-schema` after DC imports
|
|
158
158
|
- GraphQL errors: confirm content type exists, clear GraphQL cache, regenerate schema
|
|
159
159
|
- Build errors: verify types, imports, query syntax
|
|
160
160
|
- Content not showing: confirm field names match GraphQL schema; for HTML use `dangerouslySetInnerHTML={{ __html: field.processed }}`
|
|
161
|
-
- **Field name mismatches**:
|
|
161
|
+
- **Field name mismatches**: DC field IDs may transform (e.g., `in_stock` → `inStock` in GraphQL)
|
|
162
162
|
|
|
163
163
|
Debug commands:
|
|
164
164
|
```bash
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
decoupled-cli auth status # Check authentication
|
|
166
|
+
decoupled-cli spaces list # List available spaces
|
|
167
|
+
decoupled-cli spaces current # Show default space
|
|
168
|
+
decoupled-cli health check # Platform status
|
|
169
|
+
decoupled-cli spaces content-import --file test.json --preview # Preview import
|
|
170
170
|
# MOST IMPORTANT: Generate fresh schema after any import
|
|
171
171
|
npm run generate-schema
|
|
172
172
|
# Check schema includes your content type
|
|
@@ -175,10 +175,10 @@ grep -i [content_type] schema/schema.graphql
|
|
|
175
175
|
```
|
|
176
176
|
|
|
177
177
|
# Best Practices
|
|
178
|
-
1. **ALWAYS run `npm run generate-schema` immediately after
|
|
178
|
+
1. **ALWAYS run `npm run generate-schema` immediately after DC imports**
|
|
179
179
|
2. Create sample content for immediate testing
|
|
180
180
|
3. Prefer `string[]` for simple lists; use `text[]` only when necessary
|
|
181
|
-
4. Verify GraphQL field names against the actual schema (may differ from
|
|
181
|
+
4. Verify GraphQL field names against the actual schema (may differ from DC field IDs)
|
|
182
182
|
5. Handle empty/missing data gracefully
|
|
183
183
|
6. Keep TypeScript types accurate and complete
|
|
184
184
|
7. Use semantic HTML and ensure responsive design
|
package/examples/CLAUDE.md
CHANGED
|
@@ -5,7 +5,7 @@ This document provides Claude Code with comprehensive instructions for building
|
|
|
5
5
|
## Project Overview
|
|
6
6
|
|
|
7
7
|
**Architecture**: Headless Drupal backend with Next.js frontend
|
|
8
|
-
**Backend**: Drupal 11 with GraphQL Compose and
|
|
8
|
+
**Backend**: Drupal 11 with GraphQL Compose and DC Import API
|
|
9
9
|
**Frontend**: Next.js 15 with TypeScript, Tailwind CSS, and Apollo GraphQL
|
|
10
10
|
**Environment**: DDEV local development
|
|
11
11
|
|
|
@@ -18,7 +18,7 @@ This document provides Claude Code with comprehensive instructions for building
|
|
|
18
18
|
- `DRUPAL_REVALIDATE_SECRET` - Secret for on-demand revalidation
|
|
19
19
|
- `NODE_TLS_REJECT_UNAUTHORIZED=0` - Allow self-signed certificates (development)
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## DC CLI Setup
|
|
22
22
|
|
|
23
23
|
**First-time CLI setup:**
|
|
24
24
|
```bash
|
|
@@ -40,7 +40,7 @@ npx decoupled-cli spaces use <space_id>
|
|
|
40
40
|
npx decoupled-cli spaces current
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
**OAuth Prerequisites (for `
|
|
43
|
+
**OAuth Prerequisites (for `decoupled-cli auth oauth`):**
|
|
44
44
|
Your `.env.local` must contain:
|
|
45
45
|
- `NEXT_PUBLIC_DRUPAL_BASE_URL=https://your-space.decoupled.io`
|
|
46
46
|
- `DRUPAL_CLIENT_ID=your_oauth_client_id`
|
|
@@ -48,7 +48,7 @@ Your `.env.local` must contain:
|
|
|
48
48
|
|
|
49
49
|
**Authentication Method Differences:**
|
|
50
50
|
- **OAuth** → Works with your Drupal site API (content import, Drupal operations)
|
|
51
|
-
- **Personal Access Token** → Works with
|
|
51
|
+
- **Personal Access Token** → Works with Decoupled Drupal platform API (spaces, users, organizations)
|
|
52
52
|
|
|
53
53
|
**If CLI is not available locally:**
|
|
54
54
|
- For projects with decoupled-cli in package.json: Run `npm install` then use `npx decoupled-cli`
|
|
@@ -73,8 +73,8 @@ Use OAuth authentication for direct Drupal content import, then frontend develop
|
|
|
73
73
|
|
|
74
74
|
**Create a todo list for tracking progress:**
|
|
75
75
|
```markdown
|
|
76
|
-
1. Verify
|
|
77
|
-
2. Create
|
|
76
|
+
1. Verify DC CLI authentication (npx decoupled-cli auth status)
|
|
77
|
+
2. Create DC Import JSON for [content_type]
|
|
78
78
|
3. Import content type and sample content to Drupal (npx decoupled-cli content import)
|
|
79
79
|
4. **CRITICAL**: Run schema generation (`npm run generate-schema`) to update GraphQL schema
|
|
80
80
|
5. Create TypeScript types and GraphQL queries
|
|
@@ -84,11 +84,11 @@ Use OAuth authentication for direct Drupal content import, then frontend develop
|
|
|
84
84
|
9. Validate end-to-end functionality
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
**Legacy Platform Workflow (PAT +
|
|
87
|
+
**Legacy Platform Workflow (PAT + Decoupled Drupal Platform):**
|
|
88
88
|
```markdown
|
|
89
|
-
1. Verify
|
|
89
|
+
1. Verify DC CLI authentication (npx decoupled-cli auth status)
|
|
90
90
|
2. Set default space if needed (npx decoupled-cli spaces use <id>)
|
|
91
|
-
3. Create
|
|
91
|
+
3. Create DC Import JSON for [content_type]
|
|
92
92
|
4. Import content type and sample content via platform (npx decoupled-cli spaces content-import)
|
|
93
93
|
5. **CRITICAL**: Run schema generation (`npm run generate-schema`) to update GraphQL schema
|
|
94
94
|
6. Create TypeScript types and GraphQL queries
|
|
@@ -119,7 +119,7 @@ npx decoupled-cli spaces use <space_id>
|
|
|
119
119
|
|
|
120
120
|
**If CLI authentication fails:**
|
|
121
121
|
- For OAuth: Verify `.env.local` contains `NEXT_PUBLIC_DRUPAL_BASE_URL`, `DRUPAL_CLIENT_ID`, `DRUPAL_CLIENT_SECRET`
|
|
122
|
-
- For personal tokens: Check that
|
|
122
|
+
- For personal tokens: Check that DC platform is accessible
|
|
123
123
|
- Ensure user has proper permissions for the operations you're trying to perform
|
|
124
124
|
|
|
125
125
|
**Important: Command Availability by Authentication Method**
|
|
@@ -127,7 +127,7 @@ npx decoupled-cli spaces use <space_id>
|
|
|
127
127
|
- **PAT-only commands**: `spaces list`, `spaces use`, `usage`, `org info`
|
|
128
128
|
- **Universal commands**: `auth login`, `auth oauth`, `auth test`
|
|
129
129
|
|
|
130
|
-
### 2.
|
|
130
|
+
### 2. DC Import JSON Creation
|
|
131
131
|
|
|
132
132
|
**Get example format with CLI:**
|
|
133
133
|
```bash
|
|
@@ -186,14 +186,14 @@ npx decoupled-cli spaces content-import --example > my-content-type.json
|
|
|
186
186
|
- **For image fields**: Use full URLs with the Drupal domain from `.env.local`, not relative paths:
|
|
187
187
|
```json
|
|
188
188
|
"featured_image": {
|
|
189
|
-
"uri": "${DRUPAL_BASE_URL}/modules/custom/
|
|
189
|
+
"uri": "${DRUPAL_BASE_URL}/modules/custom/dc_import/resources/placeholder.png",
|
|
190
190
|
"alt": "Description of the image",
|
|
191
191
|
"title": "Image title"
|
|
192
192
|
}
|
|
193
193
|
```
|
|
194
194
|
Always read the `NEXT_PUBLIC_DRUPAL_BASE_URL` from `.env.local` and use that as the base for image URIs to ensure images load correctly from the Drupal backend.
|
|
195
195
|
|
|
196
|
-
### 3. Import via
|
|
196
|
+
### 3. Import via DC CLI
|
|
197
197
|
|
|
198
198
|
**Import Content Type:**
|
|
199
199
|
```bash
|
|
@@ -203,7 +203,7 @@ npx decoupled-cli content import --file content-type-import.json
|
|
|
203
203
|
# Or preview first to see what will be imported
|
|
204
204
|
npx decoupled-cli content import --file content-type-import.json --preview
|
|
205
205
|
|
|
206
|
-
# LEGACY: Import via
|
|
206
|
+
# LEGACY: Import via Decoupled Drupal platform (requires PAT authentication and space setup)
|
|
207
207
|
npx decoupled-cli spaces content-import --file content-type-import.json
|
|
208
208
|
npx decoupled-cli spaces content-import <space_id> --file content-type-import.json
|
|
209
209
|
```
|
|
@@ -220,7 +220,7 @@ npx decoupled-cli content import --example > content-type-import.json
|
|
|
220
220
|
- Field machine names (auto-generated)
|
|
221
221
|
- Node IDs created
|
|
222
222
|
- GraphQL schema updates
|
|
223
|
-
- **Important**: GraphQL field names may differ from
|
|
223
|
+
- **Important**: GraphQL field names may differ from DC field IDs (check actual schema)
|
|
224
224
|
|
|
225
225
|
**CRITICAL: Immediately Update GraphQL Schema After Import:**
|
|
226
226
|
```bash
|
|
@@ -500,7 +500,7 @@ npm run dev
|
|
|
500
500
|
### 6. Testing Checklist
|
|
501
501
|
|
|
502
502
|
**Verify each step:**
|
|
503
|
-
- [ ]
|
|
503
|
+
- [ ] DC import successful with no errors
|
|
504
504
|
- [ ] GraphQL schema includes new content type
|
|
505
505
|
- [ ] TypeScript types are properly defined
|
|
506
506
|
- [ ] Build process completes without errors
|
|
@@ -540,7 +540,7 @@ npm run dev
|
|
|
540
540
|
```json
|
|
541
541
|
"product_images": [
|
|
542
542
|
{
|
|
543
|
-
"uri": "${DRUPAL_BASE_URL}/modules/custom/
|
|
543
|
+
"uri": "${DRUPAL_BASE_URL}/modules/custom/dc_import/resources/placeholder.png",
|
|
544
544
|
"alt": "Product showcase image",
|
|
545
545
|
"title": "Product Image"
|
|
546
546
|
}
|
|
@@ -588,7 +588,7 @@ npm run dev
|
|
|
588
588
|
**Sample content with image URI:**
|
|
589
589
|
```json
|
|
590
590
|
"profile_image": {
|
|
591
|
-
"uri": "${DRUPAL_BASE_URL}/modules/custom/
|
|
591
|
+
"uri": "${DRUPAL_BASE_URL}/modules/custom/dc_import/resources/placeholder.png",
|
|
592
592
|
"alt": "Team member headshot",
|
|
593
593
|
"title": "Profile Photo"
|
|
594
594
|
}
|
|
@@ -617,7 +617,7 @@ npm run dev
|
|
|
617
617
|
```json
|
|
618
618
|
"project_images": [
|
|
619
619
|
{
|
|
620
|
-
"uri": "${DRUPAL_BASE_URL}/modules/custom/
|
|
620
|
+
"uri": "${DRUPAL_BASE_URL}/modules/custom/dc_import/resources/placeholder.png",
|
|
621
621
|
"alt": "Project screenshot showing main interface",
|
|
622
622
|
"title": "Project Interface"
|
|
623
623
|
}
|
|
@@ -628,7 +628,7 @@ npm run dev
|
|
|
628
628
|
|
|
629
629
|
### Common Issues
|
|
630
630
|
|
|
631
|
-
**1.
|
|
631
|
+
**1. DC Import Fails**
|
|
632
632
|
- Check OAuth token expiration
|
|
633
633
|
- Verify JSON structure matches `schema/sample.json` format
|
|
634
634
|
- Ensure field IDs don't start with `field_`
|
|
@@ -645,15 +645,15 @@ npm run dev
|
|
|
645
645
|
- Verify GraphQL query syntax
|
|
646
646
|
|
|
647
647
|
**4. Content Not Displaying**
|
|
648
|
-
- Check GraphQL query field names match Drupal fields (may not match
|
|
648
|
+
- Check GraphQL query field names match Drupal fields (may not match DC field IDs)
|
|
649
649
|
- Verify content was created and published
|
|
650
650
|
- Check query variables and pagination
|
|
651
651
|
- For HTML content showing raw tags, use `dangerouslySetInnerHTML={{ __html: field.processed }}`
|
|
652
652
|
|
|
653
|
-
**5. GraphQL Schema Not Updated After
|
|
654
|
-
- **Critical Issue**:
|
|
653
|
+
**5. GraphQL Schema Not Updated After DC Import**
|
|
654
|
+
- **Critical Issue**: DC imports create content types successfully but GraphQL schema may not update immediately
|
|
655
655
|
- Content exists in Drupal but `nodeProducts` query returns "field not found" errors
|
|
656
|
-
- This is the most common issue with
|
|
656
|
+
- This is the most common issue with DC imports
|
|
657
657
|
|
|
658
658
|
**Solution Process**:
|
|
659
659
|
1. Clear Drupal caches (if you have admin access)
|
|
@@ -663,7 +663,7 @@ npm run dev
|
|
|
663
663
|
|
|
664
664
|
### Essential Schema Generation Workflow
|
|
665
665
|
|
|
666
|
-
**CRITICAL**: Always run schema generation after
|
|
666
|
+
**CRITICAL**: Always run schema generation after DC imports to ensure GraphQL integration works properly.
|
|
667
667
|
|
|
668
668
|
```bash
|
|
669
669
|
# Generate updated GraphQL schema after content type imports
|
|
@@ -677,7 +677,7 @@ This command:
|
|
|
677
677
|
- Validates that new content types are available in GraphQL
|
|
678
678
|
|
|
679
679
|
**Add this to your workflow**:
|
|
680
|
-
1. Import content type via
|
|
680
|
+
1. Import content type via DC API
|
|
681
681
|
2. **Immediately run**: `npm run generate-schema`
|
|
682
682
|
3. Check generated schema includes your new content type
|
|
683
683
|
4. Test GraphQL queries
|
|
@@ -709,7 +709,7 @@ npx decoupled-cli spaces list
|
|
|
709
709
|
# Check current default space
|
|
710
710
|
npx decoupled-cli spaces current
|
|
711
711
|
|
|
712
|
-
# Get health status of
|
|
712
|
+
# Get health status of DC platform
|
|
713
713
|
npx decoupled-cli health check
|
|
714
714
|
|
|
715
715
|
# Check organization info
|
|
@@ -774,7 +774,7 @@ npx decoupled-cli content import --file your-content.json
|
|
|
774
774
|
7. **Include proper TypeScript types** for all data structures
|
|
775
775
|
8. **Test the full user journey** from listing to detail pages
|
|
776
776
|
9. **Use `dangerouslySetInnerHTML`** for processed HTML content from Drupal to avoid raw tag display
|
|
777
|
-
10. **Verify GraphQL field names** match actual schema, not
|
|
777
|
+
10. **Verify GraphQL field names** match actual schema, not DC field IDs
|
|
778
778
|
|
|
779
779
|
## Success Criteria
|
|
780
780
|
|
|
@@ -792,7 +792,7 @@ A successful end-to-end implementation should:
|
|
|
792
792
|
|
|
793
793
|
Based on successful product catalog implementation, here are critical learnings to avoid common pitfalls:
|
|
794
794
|
|
|
795
|
-
###
|
|
795
|
+
### DC Import Format Issues
|
|
796
796
|
|
|
797
797
|
**Problem**: Field values incorrectly formatted with "field_" prefix
|
|
798
798
|
```json
|
|
@@ -813,14 +813,14 @@ Based on successful product catalog implementation, here are critical learnings
|
|
|
813
813
|
|
|
814
814
|
### GraphQL Field Name Mapping
|
|
815
815
|
|
|
816
|
-
**Problem**: Assuming GraphQL field names match
|
|
816
|
+
**Problem**: Assuming GraphQL field names match DC field IDs
|
|
817
817
|
```typescript
|
|
818
818
|
// WRONG - Field names may be transformed
|
|
819
|
-
price: string //
|
|
819
|
+
price: string // DC field ID
|
|
820
820
|
fieldPrice: string // What you might expect in GraphQL
|
|
821
821
|
|
|
822
822
|
// CORRECT - Check actual schema
|
|
823
|
-
price: string // Actual GraphQL field name (can match
|
|
823
|
+
price: string // Actual GraphQL field name (can match DC ID)
|
|
824
824
|
inStock: boolean // camelCase transformation
|
|
825
825
|
productImages: object // snake_case to camelCase
|
|
826
826
|
```
|
|
@@ -829,7 +829,7 @@ productImages: object // snake_case to camelCase
|
|
|
829
829
|
|
|
830
830
|
### GraphQL Field Value Structure Discovery
|
|
831
831
|
|
|
832
|
-
**Critical Learning**: GraphQL field values from
|
|
832
|
+
**Critical Learning**: GraphQL field values from DC imports return as simple types, not objects:
|
|
833
833
|
|
|
834
834
|
```typescript
|
|
835
835
|
// WRONG - Assuming field values are objects with .processed
|
|
@@ -840,7 +840,7 @@ fieldFeatures?: Array<{
|
|
|
840
840
|
processed: string
|
|
841
841
|
}>
|
|
842
842
|
|
|
843
|
-
// CORRECT -
|
|
843
|
+
// CORRECT - DC imports create simple value fields
|
|
844
844
|
price?: string
|
|
845
845
|
features?: string[]
|
|
846
846
|
```
|
|
@@ -953,29 +953,29 @@ npm run dev # Test in development mode
|
|
|
953
953
|
|
|
954
954
|
The most important learning from the product catalog implementation is the **mandatory schema generation step**:
|
|
955
955
|
|
|
956
|
-
**Problem**:
|
|
956
|
+
**Problem**: DC imports successfully create content types and content, but GraphQL schema doesn't update automatically.
|
|
957
957
|
**Symptoms**:
|
|
958
958
|
- `nodeProducts` query returns "field not found" errors
|
|
959
959
|
- Content exists in Drupal but not accessible via GraphQL
|
|
960
960
|
- Route queries work but content type queries fail
|
|
961
961
|
|
|
962
|
-
**Solution**: **ALWAYS run schema generation immediately after
|
|
962
|
+
**Solution**: **ALWAYS run schema generation immediately after DC imports**:
|
|
963
963
|
|
|
964
964
|
```bash
|
|
965
|
-
# After any
|
|
965
|
+
# After any DC import, immediately run:
|
|
966
966
|
npm run generate-schema
|
|
967
967
|
|
|
968
968
|
# This step is MANDATORY for GraphQL integration to work
|
|
969
969
|
```
|
|
970
970
|
|
|
971
971
|
**Why this is critical**:
|
|
972
|
-
-
|
|
972
|
+
- DC API creates Drupal content types but doesn't trigger GraphQL schema rebuilds
|
|
973
973
|
- The `generate-schema` script performs fresh introspection and updates local schema files
|
|
974
974
|
- Without this step, frontend development will fail with "type not found" errors
|
|
975
975
|
- This step bridges the gap between Drupal content type creation and Next.js GraphQL integration
|
|
976
976
|
|
|
977
977
|
**Workflow Integration**:
|
|
978
|
-
1. Import via
|
|
978
|
+
1. Import via DC API ✅
|
|
979
979
|
2. **Run `npm run generate-schema`** ✅ ← CRITICAL STEP
|
|
980
980
|
3. Verify schema includes new content type ✅
|
|
981
981
|
4. Proceed with frontend development ✅
|
|
@@ -984,7 +984,7 @@ This learning transforms the development workflow from "sometimes works" to "rel
|
|
|
984
984
|
|
|
985
985
|
### GraphQL Schema Field Name Discovery
|
|
986
986
|
|
|
987
|
-
**Critical Process**: Always verify actual GraphQL field names after
|
|
987
|
+
**Critical Process**: Always verify actual GraphQL field names after DC import - they may differ from field IDs used in import JSON.
|
|
988
988
|
|
|
989
989
|
**Discovery Method**:
|
|
990
990
|
```bash
|
|
@@ -994,7 +994,7 @@ grep -A 10 -B 5 nodeProducts schema/schema.graphql
|
|
|
994
994
|
# This shows the actual field names and types available
|
|
995
995
|
```
|
|
996
996
|
|
|
997
|
-
**Key Learning**:
|
|
997
|
+
**Key Learning**: DC field IDs may transform in GraphQL schema:
|
|
998
998
|
- `in_stock` becomes `inStock` (camelCase)
|
|
999
999
|
- `product_images` becomes `productImages` (camelCase)
|
|
1000
1000
|
- Simple field types work reliably (string, boolean, string[])
|
|
@@ -1048,7 +1048,7 @@ Based on successful product catalog implementation:
|
|
|
1048
1048
|
|
|
1049
1049
|
**Essential Commands Sequence**:
|
|
1050
1050
|
```bash
|
|
1051
|
-
# After
|
|
1051
|
+
# After DC import, always run:
|
|
1052
1052
|
npm run generate-schema # Updates GraphQL schema
|
|
1053
1053
|
npm run build # Validates TypeScript and builds
|
|
1054
1054
|
npm run dev # Test in development
|
|
@@ -1062,9 +1062,9 @@ npm run dev # Test in development
|
|
|
1062
1062
|
|
|
1063
1063
|
### Deployment Field Mapping Reference
|
|
1064
1064
|
|
|
1065
|
-
**
|
|
1065
|
+
**DC Import → GraphQL Schema Mapping**:
|
|
1066
1066
|
```json
|
|
1067
|
-
//
|
|
1067
|
+
// DC import format:
|
|
1068
1068
|
{
|
|
1069
1069
|
"in_stock": true, // → GraphQL: inStock
|
|
1070
1070
|
"product_images": [...], // → GraphQL: productImages
|