-
Notifications
You must be signed in to change notification settings - Fork 0
AINATIVEM-41: CLI tool foundation — create-pipedrive-app scaffold #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
9e052e1
docs: add initial setup design spec for AINATIVEM-41
dmitriyeff ab19f42
docs: add implementation plan for AINATIVEM-41 CLI foundation
dmitriyeff b3e3c62
chore: initialize project scaffold
dmitriyeff 85eeab6
chore: remove extra placeholder files from src/
dmitriyeff 252d98b
chore: add .gitignore and untrack node_modules
dmitriyeff b83a875
ci: add GitHub Actions workflow for lint and test
dmitriyeff 08356e7
feat: add GeneratorOptions and Generator interface
dmitriyeff d3b3a31
feat: add writeFile utility with prettier formatting
dmitriyeff e0424d7
fix: narrow writeFile catch to no-parser errors only
dmitriyeff c926756
feat: add projectName prompt
dmitriyeff 6cbb05c
feat: add database prompt
dmitriyeff 245822f
feat: add appExtensions prompt
dmitriyeff 9a923f6
feat: add webhooks prompt
dmitriyeff da99a4e
fix: trim project name input
dmitriyeff f1bc3d6
feat: add oauth stub generator
dmitriyeff e9babef
feat: add database stub generator
dmitriyeff 3ceec43
feat: add webhooks stub generator
dmitriyeff 9800ce9
feat: add appExtensions stub generator
dmitriyeff 36ffe6e
fix: revert trim on projectName, configure eslint to ignore _-prefixe…
dmitriyeff 9424dbd
feat: add app.ts generator with conditional router logic
dmitriyeff 21a6b84
feat: add node generator orchestrator with root project file generators
dmitriyeff b5628ca
feat: add php generator stub
dmitriyeff a8f7fe4
feat: add CLI entry point
dmitriyeff 2c9457c
test: add end-to-end generator test with tsc --noEmit validation
dmitriyeff 1480757
chore: exclude superpowers plans and specs from version control
dmitriyeff a1a469e
chore: remove dev script, run CLI locally with npx tsx src/cli.ts
dmitriyeff 612c6bf
Potential fix for pull request finding
dmitriyeff 2382a9a
AINATIVEM-41 co-pilot review adjustments
dmitriyeff 77eed6a
AINATIVEM-41 pretify src files
dmitriyeff f67f24c
AINATIVEM-41 use native fs lib
dmitriyeff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| ci: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - run: npm ci | ||
| - run: npm run lint | ||
| - run: npm run typecheck | ||
| - run: npm test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| node_modules/ | ||
| dist/ | ||
| .env | ||
| docs/superpowers/ | ||
|
|
||
| # locally generated test apps | ||
| *-app/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "printWidth": 120, | ||
| "singleQuote": true, | ||
| "useTabs": true, | ||
| "tabWidth": 4, | ||
| "trailingComma": "all", | ||
| "quoteProps": "consistent", | ||
| "proseWrap": "always" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Project Purpose | ||
|
|
||
| `create-pipedrive-app` is a CLI scaffolding tool for external Pipedrive Marketplace developers. It generates a production-ready integration project via `npx create-pipedrive-app <project-name>`. | ||
|
|
||
| ## Architecture | ||
|
|
||
| The tool is **CLI-first**, with an **AI plugin layer** built on top: | ||
|
|
||
| - **CLI core**: Collects user choices via interactive prompts, then generates a project scaffold from templates. | ||
| - **AI plugin layer** (secondary): Claude/Codex skills that wrap the CLI — guide developers, modify existing projects, and explain generated code. | ||
|
|
||
| ### Interactive prompts (CLI) | ||
|
|
||
| The CLI asks for: | ||
| - Backend: Node.js/Express, Node.js/Fastify, or PHP/Laravel | ||
| - Database: Postgres, MySQL, or SQLite | ||
| - App Extensions frontend: React, Vanilla JS, or none | ||
| - Webhooks: Yes/No | ||
|
Comment on lines
+18
to
+22
|
||
|
|
||
| ### Generated project structure | ||
|
|
||
| ``` | ||
| <project-name>/ | ||
| backend/ | ||
| oauth/ # Authorization redirect, callback, token exchange, refresh, state validation | ||
| pipedrive-client/ # Official API client wrapper with preconfigured auth | ||
| database/ # Tenant/account mapping, tokens, scopes, installation status | ||
| webhooks/ # Optional webhook handlers | ||
| frontend/ | ||
| app-extension-ui/ # Optional: React or Vanilla iframe UI with App Extensions SDK | ||
| .env.example | ||
| README.md | ||
| docker-compose.yml | ||
| marketplace-checklist.md | ||
| ``` | ||
|
|
||
| ## MVP Scope | ||
|
|
||
| The initial implementation targets: | ||
| - **Runtime**: Node.js + TypeScript | ||
| - **Backend**: Express or Fastify | ||
| - **Database**: Postgres via Docker Compose | ||
| - **Auth**: Full OAuth 2.0 install/callback/token-refresh flow | ||
| - **API client**: Pipedrive Node.js client wrapper | ||
| - **Frontend** (optional): React App Extensions UI | ||
| - Outputs `.env.example` and a Marketplace readiness checklist | ||
|
|
||
| PHP and MySQL/SQLite backends come after MVP. | ||
|
|
||
| ## Core Modules | ||
|
|
||
| ### OAuth (`backend/oauth/`) | ||
| Full OAuth 2.0: app registration guidance, authorization redirect, callback handling, token exchange, token refresh, state validation. | ||
|
|
||
| ### Database (`backend/database/`) | ||
| Uses **Drizzle ORM** (`drizzle-orm` + `drizzle-kit`) for schema definition and migrations. Drizzle is chosen because it supports Postgres, MySQL, and SQLite with the same TypeScript API — matching the three database options the CLI offers — and produces readable schema files with no codegen step. | ||
|
|
||
| Structure: | ||
| - `schema.ts` — Drizzle table definitions (tenants, oauth_tokens, installations) | ||
| - `migrations/` — SQL migration files managed by `drizzle-kit` | ||
| - `db.ts` — driver setup (selects `postgres-js`, `mysql2`, or `better-sqlite3` based on the chosen DB) | ||
|
|
||
| Key packages: `drizzle-orm`, `drizzle-kit`, and the appropriate driver for the selected database. | ||
|
|
||
| ### Pipedrive API client (`backend/pipedrive-client/`) | ||
| Wrapper around the official Pipedrive Node.js client with preconfigured authentication and helpers for common API calls. | ||
|
|
||
| ### App Extensions frontend (`frontend/app-extension-ui/`) | ||
| Only generated when the user opts in. Iframe-based UI using the App Extensions SDK, supporting: initialization, resizing, modals, notifications/snackbars, theme handling. | ||
|
|
||
| ## Development | ||
|
|
||
| To test app generation locally: | ||
|
|
||
| ```bash | ||
| npx tsx src/cli.ts app | ||
| ``` | ||
|
|
||
| This creates an `app/` directory in the repo root (gitignored via `*-app/`). | ||
|
|
||
| ## AI Plugin Commands (future layer) | ||
|
|
||
| ``` | ||
| /pipedrive-new-app | ||
| /pipedrive-add-oauth | ||
| /pipedrive-add-app-extension | ||
| /pipedrive-review-marketplace-readiness | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import eslint from '@eslint/js'; | ||
| import tseslint from 'typescript-eslint'; | ||
|
|
||
| export default tseslint.config( | ||
| eslint.configs.recommended, | ||
| ...tseslint.configs.recommended, | ||
| { | ||
| ignores: ['dist/**'], | ||
| }, | ||
| { | ||
| rules: { | ||
| '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], | ||
| }, | ||
| }, | ||
| ); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.