@l4yercak3/cli 1.3.1 → 2.0.0-alpha.0
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 +10 -220
- package/dist/api/client.d.ts +12 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +37 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/platform.d.ts +161 -0
- package/dist/api/platform.d.ts.map +1 -0
- package/dist/api/platform.js +70 -0
- package/dist/api/platform.js.map +1 -0
- package/dist/bin/sevenlayers.d.ts +3 -0
- package/dist/bin/sevenlayers.d.ts.map +1 -0
- package/dist/bin/sevenlayers.js +198 -0
- package/dist/bin/sevenlayers.js.map +1 -0
- package/dist/commands/agent/catalog.d.ts +5 -0
- package/dist/commands/agent/catalog.d.ts.map +1 -0
- package/dist/commands/agent/catalog.js +142 -0
- package/dist/commands/agent/catalog.js.map +1 -0
- package/dist/commands/agent/drift.d.ts +5 -0
- package/dist/commands/agent/drift.d.ts.map +1 -0
- package/dist/commands/agent/drift.js +113 -0
- package/dist/commands/agent/drift.js.map +1 -0
- package/dist/commands/agent/init.d.ts +5 -0
- package/dist/commands/agent/init.d.ts.map +1 -0
- package/dist/commands/agent/init.js +75 -0
- package/dist/commands/agent/init.js.map +1 -0
- package/dist/commands/agent/permissions.d.ts +5 -0
- package/dist/commands/agent/permissions.d.ts.map +1 -0
- package/dist/commands/agent/permissions.js +88 -0
- package/dist/commands/agent/permissions.js.map +1 -0
- package/dist/commands/agent/runner.d.ts +14 -0
- package/dist/commands/agent/runner.d.ts.map +1 -0
- package/dist/commands/agent/runner.js +59 -0
- package/dist/commands/agent/runner.js.map +1 -0
- package/dist/commands/agent/shared.d.ts +13 -0
- package/dist/commands/agent/shared.d.ts.map +1 -0
- package/dist/commands/agent/shared.js +31 -0
- package/dist/commands/agent/shared.js.map +1 -0
- package/dist/commands/agent/template.d.ts +5 -0
- package/dist/commands/agent/template.d.ts.map +1 -0
- package/dist/commands/agent/template.js +104 -0
- package/dist/commands/agent/template.js.map +1 -0
- package/dist/commands/app/connect.d.ts +7 -0
- package/dist/commands/app/connect.d.ts.map +1 -0
- package/dist/commands/app/connect.js +12 -0
- package/dist/commands/app/connect.js.map +1 -0
- package/dist/commands/app/init.d.ts +7 -0
- package/dist/commands/app/init.d.ts.map +1 -0
- package/dist/commands/app/init.js +12 -0
- package/dist/commands/app/init.js.map +1 -0
- package/dist/commands/app/link.d.ts +3 -0
- package/dist/commands/app/link.d.ts.map +1 -0
- package/dist/commands/app/link.js +92 -0
- package/dist/commands/app/link.js.map +1 -0
- package/dist/commands/app/pages.d.ts +15 -0
- package/dist/commands/app/pages.d.ts.map +1 -0
- package/dist/commands/app/pages.js +180 -0
- package/dist/commands/app/pages.js.map +1 -0
- package/dist/commands/app/register.d.ts +3 -0
- package/dist/commands/app/register.d.ts.map +1 -0
- package/dist/commands/app/register.js +120 -0
- package/dist/commands/app/register.js.map +1 -0
- package/dist/commands/app/remote.d.ts +14 -0
- package/dist/commands/app/remote.d.ts.map +1 -0
- package/dist/commands/app/remote.js +44 -0
- package/dist/commands/app/remote.js.map +1 -0
- package/dist/commands/app/setup.d.ts +3 -0
- package/dist/commands/app/setup.d.ts.map +1 -0
- package/dist/commands/app/setup.js +299 -0
- package/dist/commands/app/setup.js.map +1 -0
- package/dist/commands/app/shared.d.ts +9 -0
- package/dist/commands/app/shared.d.ts.map +1 -0
- package/dist/commands/app/shared.js +122 -0
- package/dist/commands/app/shared.js.map +1 -0
- package/dist/commands/app/sync.d.ts +7 -0
- package/dist/commands/app/sync.d.ts.map +1 -0
- package/dist/commands/app/sync.js +107 -0
- package/dist/commands/app/sync.js.map +1 -0
- package/dist/commands/booking/check.d.ts +3 -0
- package/dist/commands/booking/check.d.ts.map +1 -0
- package/dist/commands/booking/check.js +68 -0
- package/dist/commands/booking/check.js.map +1 -0
- package/dist/commands/booking/setup.d.ts +3 -0
- package/dist/commands/booking/setup.d.ts.map +1 -0
- package/dist/commands/booking/setup.js +95 -0
- package/dist/commands/booking/setup.js.map +1 -0
- package/dist/commands/booking/shared.d.ts +31 -0
- package/dist/commands/booking/shared.d.ts.map +1 -0
- package/dist/commands/booking/shared.js +112 -0
- package/dist/commands/booking/shared.js.map +1 -0
- package/dist/commands/booking/smoke.d.ts +3 -0
- package/dist/commands/booking/smoke.d.ts.map +1 -0
- package/dist/commands/booking/smoke.js +101 -0
- package/dist/commands/booking/smoke.js.map +1 -0
- package/dist/commands/cms/bind.d.ts +3 -0
- package/dist/commands/cms/bind.d.ts.map +1 -0
- package/dist/commands/cms/bind.js +212 -0
- package/dist/commands/cms/bind.js.map +1 -0
- package/dist/commands/cms/content.d.ts +40 -0
- package/dist/commands/cms/content.d.ts.map +1 -0
- package/dist/commands/cms/content.js +169 -0
- package/dist/commands/cms/content.js.map +1 -0
- package/dist/commands/cms/doctor.d.ts +3 -0
- package/dist/commands/cms/doctor.d.ts.map +1 -0
- package/dist/commands/cms/doctor.js +69 -0
- package/dist/commands/cms/doctor.js.map +1 -0
- package/dist/commands/cms/migrate.d.ts +3 -0
- package/dist/commands/cms/migrate.d.ts.map +1 -0
- package/dist/commands/cms/migrate.js +78 -0
- package/dist/commands/cms/migrate.js.map +1 -0
- package/dist/commands/cms/registry.d.ts +3 -0
- package/dist/commands/cms/registry.d.ts.map +1 -0
- package/dist/commands/cms/registry.js +161 -0
- package/dist/commands/cms/registry.js.map +1 -0
- package/dist/commands/cms/seed.d.ts +3 -0
- package/dist/commands/cms/seed.d.ts.map +1 -0
- package/dist/commands/cms/seed.js +102 -0
- package/dist/commands/cms/seed.js.map +1 -0
- package/dist/commands/cms/shared.d.ts +22 -0
- package/dist/commands/cms/shared.d.ts.map +1 -0
- package/dist/commands/cms/shared.js +82 -0
- package/dist/commands/cms/shared.js.map +1 -0
- package/dist/commands/doctor/target.d.ts +3 -0
- package/dist/commands/doctor/target.d.ts.map +1 -0
- package/dist/commands/doctor/target.js +46 -0
- package/dist/commands/doctor/target.js.map +1 -0
- package/dist/commands/env/list.d.ts +3 -0
- package/dist/commands/env/list.d.ts.map +1 -0
- package/dist/commands/env/list.js +28 -0
- package/dist/commands/env/list.js.map +1 -0
- package/dist/commands/env/set.d.ts +3 -0
- package/dist/commands/env/set.d.ts.map +1 -0
- package/dist/commands/env/set.js +36 -0
- package/dist/commands/env/set.js.map +1 -0
- package/dist/commands/env/use.d.ts +3 -0
- package/dist/commands/env/use.d.ts.map +1 -0
- package/dist/commands/env/use.js +15 -0
- package/dist/commands/env/use.js.map +1 -0
- package/dist/commands/legacy/connect.d.ts +3 -0
- package/dist/commands/legacy/connect.d.ts.map +1 -0
- package/dist/commands/legacy/connect.js +8 -0
- package/dist/commands/legacy/connect.js.map +1 -0
- package/dist/commands/legacy/pages.d.ts +3 -0
- package/dist/commands/legacy/pages.d.ts.map +1 -0
- package/dist/commands/legacy/pages.js +16 -0
- package/dist/commands/legacy/pages.js.map +1 -0
- package/dist/commands/legacy/spread.d.ts +3 -0
- package/dist/commands/legacy/spread.d.ts.map +1 -0
- package/dist/commands/legacy/spread.js +8 -0
- package/dist/commands/legacy/spread.js.map +1 -0
- package/dist/commands/legacy/sync.d.ts +3 -0
- package/dist/commands/legacy/sync.d.ts.map +1 -0
- package/dist/commands/legacy/sync.js +8 -0
- package/dist/commands/legacy/sync.js.map +1 -0
- package/dist/config/env-diff.d.ts +10 -0
- package/dist/config/env-diff.d.ts.map +1 -0
- package/dist/config/env-diff.js +24 -0
- package/dist/config/env-diff.js.map +1 -0
- package/dist/config/env-parser.d.ts +20 -0
- package/dist/config/env-parser.d.ts.map +1 -0
- package/dist/config/env-parser.js +70 -0
- package/dist/config/env-parser.js.map +1 -0
- package/dist/config/env-writer.d.ts +22 -0
- package/dist/config/env-writer.d.ts.map +1 -0
- package/dist/config/env-writer.js +172 -0
- package/dist/config/env-writer.js.map +1 -0
- package/dist/config/profile-store.d.ts +29 -0
- package/dist/config/profile-store.d.ts.map +1 -0
- package/dist/config/profile-store.js +257 -0
- package/dist/config/profile-store.js.map +1 -0
- package/dist/core/args.d.ts +11 -0
- package/dist/core/args.d.ts.map +1 -0
- package/dist/core/args.js +106 -0
- package/dist/core/args.js.map +1 -0
- package/dist/core/colors.d.ts +6 -0
- package/dist/core/colors.d.ts.map +1 -0
- package/dist/core/colors.js +29 -0
- package/dist/core/colors.js.map +1 -0
- package/dist/safety/target-guard.d.ts +16 -0
- package/dist/safety/target-guard.d.ts.map +1 -0
- package/dist/safety/target-guard.js +55 -0
- package/dist/safety/target-guard.js.map +1 -0
- package/dist/testing/booking-smoke.d.ts +17 -0
- package/dist/testing/booking-smoke.d.ts.map +1 -0
- package/dist/testing/booking-smoke.js +43 -0
- package/dist/testing/booking-smoke.js.map +1 -0
- package/dist/tests/agent-commands.test.d.ts +2 -0
- package/dist/tests/agent-commands.test.d.ts.map +1 -0
- package/dist/tests/agent-commands.test.js +180 -0
- package/dist/tests/agent-commands.test.js.map +1 -0
- package/dist/tests/agent-governance.test.d.ts +2 -0
- package/dist/tests/agent-governance.test.d.ts.map +1 -0
- package/dist/tests/agent-governance.test.js +233 -0
- package/dist/tests/agent-governance.test.js.map +1 -0
- package/dist/tests/app-commands.test.d.ts +2 -0
- package/dist/tests/app-commands.test.d.ts.map +1 -0
- package/dist/tests/app-commands.test.js +462 -0
- package/dist/tests/app-commands.test.js.map +1 -0
- package/dist/tests/booking-commands.test.d.ts +2 -0
- package/dist/tests/booking-commands.test.d.ts.map +1 -0
- package/dist/tests/booking-commands.test.js +204 -0
- package/dist/tests/booking-commands.test.js.map +1 -0
- package/dist/tests/booking-smoke.test.d.ts +2 -0
- package/dist/tests/booking-smoke.test.d.ts.map +1 -0
- package/dist/tests/booking-smoke.test.js +183 -0
- package/dist/tests/booking-smoke.test.js.map +1 -0
- package/dist/tests/cms-commands.test.d.ts +2 -0
- package/dist/tests/cms-commands.test.d.ts.map +1 -0
- package/dist/tests/cms-commands.test.js +254 -0
- package/dist/tests/cms-commands.test.js.map +1 -0
- package/dist/tests/cms-ops.test.d.ts +2 -0
- package/dist/tests/cms-ops.test.d.ts.map +1 -0
- package/dist/tests/cms-ops.test.js +125 -0
- package/dist/tests/cms-ops.test.js.map +1 -0
- package/dist/tests/env-writer.test.d.ts +2 -0
- package/dist/tests/env-writer.test.d.ts.map +1 -0
- package/dist/tests/env-writer.test.js +90 -0
- package/dist/tests/env-writer.test.js.map +1 -0
- package/dist/tests/profile-store.test.d.ts +2 -0
- package/dist/tests/profile-store.test.d.ts.map +1 -0
- package/dist/tests/profile-store.test.js +88 -0
- package/dist/tests/profile-store.test.js.map +1 -0
- package/dist/tests/target-guard.test.d.ts +2 -0
- package/dist/tests/target-guard.test.d.ts.map +1 -0
- package/dist/tests/target-guard.test.js +132 -0
- package/dist/tests/target-guard.test.js.map +1 -0
- package/dist/ui/logo.d.ts +2 -0
- package/dist/ui/logo.d.ts.map +1 -0
- package/dist/ui/logo.js +22 -0
- package/dist/ui/logo.js.map +1 -0
- package/package.json +17 -53
- package/.claude/settings.local.json +0 -36
- package/.cursor/rules.md +0 -203
- package/.eslintrc.js +0 -31
- package/CLAUDE.md +0 -100
- package/bin/cli.js +0 -116
- package/docs/ADDING_FRAMEWORK_DETECTORS.md +0 -391
- package/docs/ADDING_NEW_PROJECT_TYPE.md +0 -156
- package/docs/ARCHITECTURE_RELATIONSHIPS.md +0 -411
- package/docs/CLI_AUTHENTICATION.md +0 -214
- package/docs/CLI_PAGE_DETECTION_REQUIREMENTS.md +0 -519
- package/docs/CRM-PIPELINES-SEQUENCES-SPEC.md +0 -429
- package/docs/DETECTOR_ARCHITECTURE.md +0 -326
- package/docs/DEVELOPMENT.md +0 -194
- package/docs/IMPLEMENTATION_PHASES.md +0 -468
- package/docs/INTEGRATION_PATHS_ARCHITECTURE.md +0 -1543
- package/docs/OAUTH_CLARIFICATION.md +0 -258
- package/docs/OAUTH_SETUP_GUIDE_TEMPLATE.md +0 -211
- package/docs/PHASE_0_PROGRESS.md +0 -120
- package/docs/PHASE_1_COMPLETE.md +0 -366
- package/docs/PHASE_SUMMARY.md +0 -149
- package/docs/PLAN.md +0 -511
- package/docs/README.md +0 -56
- package/docs/STRIPE_INTEGRATION.md +0 -447
- package/docs/SUMMARY.md +0 -230
- package/docs/UPDATED_PLAN.md +0 -447
- package/docs/mcp_server/MCP_EXTENSION_GUIDE.md +0 -1313
- package/docs/mcp_server/MCP_SERVER_ARCHITECTURE.md +0 -1481
- package/docs/mcp_server/applicationOntology.ts +0 -817
- package/docs/mcp_server/cliApplications.ts +0 -639
- package/docs/mcp_server/crmOntology.ts +0 -1063
- package/docs/mcp_server/eventOntology.ts +0 -1183
- package/docs/mcp_server/formsOntology.ts +0 -1401
- package/docs/mcp_server/ontologySchemas.ts +0 -185
- package/docs/mcp_server/schema.ts +0 -250
- package/docs/microsass_production_machine/CLI_API_REFERENCE.md +0 -1197
- package/docs/microsass_production_machine/CLI_PRODUCT_VISION.md +0 -676
- package/docs/microsass_production_machine/CLI_REQUIREMENTS.md +0 -606
- package/docs/microsass_production_machine/CONNECTED_APPLICATIONS_SPEC.md +0 -390
- package/docs/microsass_production_machine/IMPLEMENTATION_ROADMAP.md +0 -725
- package/docs/microsass_production_machine/OBJECT_MAPPINGS.md +0 -808
- package/docs/microsass_production_machine/REFERENCE_IMPLEMENTATION.md +0 -532
- package/src/api/backend-client.js +0 -449
- package/src/commands/api-keys.js +0 -119
- package/src/commands/connect.js +0 -243
- package/src/commands/login.js +0 -332
- package/src/commands/logout.js +0 -30
- package/src/commands/mcp-server.js +0 -85
- package/src/commands/mcp-setup.js +0 -686
- package/src/commands/pages.js +0 -317
- package/src/commands/scaffold.js +0 -409
- package/src/commands/spread.js +0 -861
- package/src/commands/status.js +0 -62
- package/src/commands/sync.js +0 -169
- package/src/commands/upgrade.js +0 -48
- package/src/config/config-manager.js +0 -206
- package/src/detectors/api-client-detector.js +0 -85
- package/src/detectors/base-detector.js +0 -77
- package/src/detectors/database-detector.js +0 -245
- package/src/detectors/expo-detector.js +0 -166
- package/src/detectors/github-detector.js +0 -74
- package/src/detectors/index.js +0 -106
- package/src/detectors/mapping-suggestor.js +0 -119
- package/src/detectors/model-detector.js +0 -318
- package/src/detectors/nextjs-detector.js +0 -139
- package/src/detectors/oauth-detector.js +0 -122
- package/src/detectors/page-detector.js +0 -480
- package/src/detectors/registry.js +0 -121
- package/src/generators/api-client-generator.js +0 -223
- package/src/generators/api-only/client.js +0 -683
- package/src/generators/api-only/index.js +0 -96
- package/src/generators/api-only/types.js +0 -618
- package/src/generators/api-only/webhooks.js +0 -377
- package/src/generators/env-generator.js +0 -191
- package/src/generators/expo-auth-generator.js +0 -1009
- package/src/generators/gitignore-generator.js +0 -92
- package/src/generators/index.js +0 -166
- package/src/generators/manifest-generator.js +0 -154
- package/src/generators/mcp-guide-generator.js +0 -256
- package/src/generators/nextauth-generator.js +0 -247
- package/src/generators/oauth-guide-generator.js +0 -277
- package/src/generators/quickstart/components/index.js +0 -1699
- package/src/generators/quickstart/components-mobile/index.js +0 -1440
- package/src/generators/quickstart/database/convex.js +0 -1257
- package/src/generators/quickstart/database/index.js +0 -34
- package/src/generators/quickstart/database/supabase.js +0 -1132
- package/src/generators/quickstart/hooks/index.js +0 -1065
- package/src/generators/quickstart/index.js +0 -191
- package/src/generators/quickstart/pages/index.js +0 -1466
- package/src/generators/quickstart/screens/index.js +0 -1498
- package/src/logo.js +0 -116
- package/src/mcp/auth.js +0 -127
- package/src/mcp/registry/domains/applications.js +0 -516
- package/src/mcp/registry/domains/benefits.js +0 -798
- package/src/mcp/registry/domains/codegen.js +0 -894
- package/src/mcp/registry/domains/core.js +0 -324
- package/src/mcp/registry/domains/crm.js +0 -591
- package/src/mcp/registry/domains/events.js +0 -649
- package/src/mcp/registry/domains/forms.js +0 -696
- package/src/mcp/registry/index.js +0 -164
- package/src/mcp/server.js +0 -116
- package/src/utils/file-utils.js +0 -117
- package/src/utils/init-helpers.js +0 -243
- package/src/utils/prompt-utils.js +0 -195
- package/templates/CLAUDE.md +0 -86
- package/tests/api-client-detector.test.js +0 -214
- package/tests/api-client-generator.test.js +0 -176
- package/tests/backend-client.test.js +0 -640
- package/tests/base-detector.test.js +0 -101
- package/tests/commands/login.test.js +0 -143
- package/tests/commands/logout.test.js +0 -84
- package/tests/commands/status.test.js +0 -167
- package/tests/config-manager.test.js +0 -321
- package/tests/database-detector.test.js +0 -221
- package/tests/detector-index.test.js +0 -209
- package/tests/detector-registry.test.js +0 -93
- package/tests/env-generator.test.js +0 -278
- package/tests/expo-detector.test.js +0 -263
- package/tests/file-utils.test.js +0 -194
- package/tests/generators-index.test.js +0 -454
- package/tests/github-detector.test.js +0 -145
- package/tests/gitignore-generator.test.js +0 -109
- package/tests/logo.test.js +0 -96
- package/tests/nextauth-generator.test.js +0 -255
- package/tests/nextjs-detector.test.js +0 -235
- package/tests/oauth-detector.test.js +0 -264
- package/tests/oauth-guide-generator.test.js +0 -273
- package/tests/page-detector.test.js +0 -371
package/bin/cli.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* CLI Entry Point
|
|
5
|
-
* Icing on the L4yercak3 - The sweet finishing touch for your Layer Cake integration
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const { Command } = require('commander');
|
|
9
|
-
const { showLogo } = require('../src/logo');
|
|
10
|
-
const chalk = require('chalk');
|
|
11
|
-
|
|
12
|
-
// Import commands
|
|
13
|
-
const loginCommand = require('../src/commands/login');
|
|
14
|
-
const logoutCommand = require('../src/commands/logout');
|
|
15
|
-
const statusCommand = require('../src/commands/status');
|
|
16
|
-
const spreadCommand = require('../src/commands/spread');
|
|
17
|
-
const apiKeysCommand = require('../src/commands/api-keys');
|
|
18
|
-
const upgradeCommand = require('../src/commands/upgrade');
|
|
19
|
-
const mcpServerCommand = require('../src/commands/mcp-server');
|
|
20
|
-
const mcpSetupCommand = require('../src/commands/mcp-setup');
|
|
21
|
-
const pagesCommand = require('../src/commands/pages');
|
|
22
|
-
const connectCommand = require('../src/commands/connect');
|
|
23
|
-
const scaffoldCommand = require('../src/commands/scaffold');
|
|
24
|
-
const syncCommand = require('../src/commands/sync');
|
|
25
|
-
|
|
26
|
-
// Create CLI program
|
|
27
|
-
const program = new Command();
|
|
28
|
-
|
|
29
|
-
program
|
|
30
|
-
.name('l4yercak3')
|
|
31
|
-
.description('Icing on the L4yercak3 - The sweet finishing touch for your Layer Cake integration')
|
|
32
|
-
.version(require('../package.json').version);
|
|
33
|
-
|
|
34
|
-
// Register commands
|
|
35
|
-
program
|
|
36
|
-
.command(loginCommand.command)
|
|
37
|
-
.description(loginCommand.description)
|
|
38
|
-
.action(loginCommand.handler);
|
|
39
|
-
|
|
40
|
-
program
|
|
41
|
-
.command(logoutCommand.command)
|
|
42
|
-
.description(logoutCommand.description)
|
|
43
|
-
.action(logoutCommand.handler);
|
|
44
|
-
|
|
45
|
-
program
|
|
46
|
-
.command('auth')
|
|
47
|
-
.description('Authentication commands')
|
|
48
|
-
.addCommand(
|
|
49
|
-
new Command('status')
|
|
50
|
-
.description(statusCommand.description)
|
|
51
|
-
.action(statusCommand.handler)
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
program
|
|
55
|
-
.command(spreadCommand.command)
|
|
56
|
-
.description(spreadCommand.description)
|
|
57
|
-
.action(spreadCommand.handler);
|
|
58
|
-
|
|
59
|
-
// Add 'init' as an alias for 'spread'
|
|
60
|
-
program
|
|
61
|
-
.command('init')
|
|
62
|
-
.description('Initialize L4YERCAK3 in your project (alias for spread)')
|
|
63
|
-
.action(spreadCommand.handler);
|
|
64
|
-
|
|
65
|
-
program
|
|
66
|
-
.command(apiKeysCommand.command)
|
|
67
|
-
.description(apiKeysCommand.description)
|
|
68
|
-
.action(apiKeysCommand.handler);
|
|
69
|
-
|
|
70
|
-
program
|
|
71
|
-
.command(upgradeCommand.command)
|
|
72
|
-
.description(upgradeCommand.description)
|
|
73
|
-
.action(upgradeCommand.handler);
|
|
74
|
-
|
|
75
|
-
program
|
|
76
|
-
.command(mcpServerCommand.command)
|
|
77
|
-
.description(mcpServerCommand.description)
|
|
78
|
-
.action(mcpServerCommand.handler);
|
|
79
|
-
|
|
80
|
-
program
|
|
81
|
-
.command(mcpSetupCommand.command)
|
|
82
|
-
.description(mcpSetupCommand.description)
|
|
83
|
-
.action(mcpSetupCommand.handler);
|
|
84
|
-
|
|
85
|
-
program
|
|
86
|
-
.command(connectCommand.command)
|
|
87
|
-
.description(connectCommand.description)
|
|
88
|
-
.action(connectCommand.handler);
|
|
89
|
-
|
|
90
|
-
program
|
|
91
|
-
.command(scaffoldCommand.command)
|
|
92
|
-
.description(scaffoldCommand.description)
|
|
93
|
-
.action(scaffoldCommand.handler);
|
|
94
|
-
|
|
95
|
-
program
|
|
96
|
-
.command(syncCommand.command)
|
|
97
|
-
.description(syncCommand.description)
|
|
98
|
-
.action(syncCommand.handler);
|
|
99
|
-
|
|
100
|
-
program
|
|
101
|
-
.command(pagesCommand.command)
|
|
102
|
-
.description(pagesCommand.description)
|
|
103
|
-
.argument('[subcommand]', 'sync, list, or detect')
|
|
104
|
-
.action((subcommand) => pagesCommand.handler([subcommand]));
|
|
105
|
-
|
|
106
|
-
// Show logo and welcome message if no command provided
|
|
107
|
-
if (process.argv.length === 2) {
|
|
108
|
-
console.log(''); // initial spacing
|
|
109
|
-
showLogo(true);
|
|
110
|
-
console.log(chalk.bold.hex('#9F7AEA')(' 🍰 Welcome to Icing on the L4yercak3! 🍰\n'));
|
|
111
|
-
console.log(chalk.gray(' The sweet finishing touch for your Layer Cake integration\n'));
|
|
112
|
-
program.help();
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// Parse arguments
|
|
116
|
-
program.parse(process.argv);
|
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
# Adding New Framework Detectors
|
|
2
|
-
|
|
3
|
-
This guide explains how to add support for new frameworks/platforms to the L4YERCAK3 CLI.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The CLI uses a detector system to identify what type of project it's running in. Each detector:
|
|
8
|
-
1. Checks if the project matches its framework
|
|
9
|
-
2. Returns metadata about the project (version, router type, TypeScript, etc.)
|
|
10
|
-
3. Specifies which features and generators are supported
|
|
11
|
-
|
|
12
|
-
## Architecture
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
src/detectors/
|
|
16
|
-
├── base-detector.js # Base class all detectors extend
|
|
17
|
-
├── registry.js # Central registry that runs all detectors
|
|
18
|
-
├── index.js # Main entry point (orchestrates detection)
|
|
19
|
-
├── nextjs-detector.js # Next.js detector
|
|
20
|
-
├── expo-detector.js # Expo/React Native detector
|
|
21
|
-
└── [your-detector].js # Your new detector
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Step 1: Create the Detector File
|
|
25
|
-
|
|
26
|
-
Create a new file in `src/detectors/` named `{framework}-detector.js`.
|
|
27
|
-
|
|
28
|
-
### Template
|
|
29
|
-
|
|
30
|
-
```javascript
|
|
31
|
-
/**
|
|
32
|
-
* {Framework} Project Detector
|
|
33
|
-
* Detects {Framework} projects and their configuration
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
const fs = require('fs');
|
|
37
|
-
const path = require('path');
|
|
38
|
-
const BaseDetector = require('./base-detector');
|
|
39
|
-
|
|
40
|
-
class {Framework}Detector extends BaseDetector {
|
|
41
|
-
/**
|
|
42
|
-
* Unique identifier for this framework
|
|
43
|
-
* Used in registration data and throughout the CLI
|
|
44
|
-
*/
|
|
45
|
-
get name() {
|
|
46
|
-
return '{framework}'; // lowercase, e.g., 'remix', 'astro', 'sveltekit'
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Detection priority (0-100)
|
|
51
|
-
*
|
|
52
|
-
* Guidelines:
|
|
53
|
-
* - 100: Meta-frameworks (Next.js, Nuxt, SvelteKit)
|
|
54
|
-
* - 95: Platform-specific (Expo, Tauri)
|
|
55
|
-
* - 75: Framework + bundler (Vite + React)
|
|
56
|
-
* - 50: Pure frameworks (React, Vue)
|
|
57
|
-
* - 25: Generic projects
|
|
58
|
-
*/
|
|
59
|
-
get priority() {
|
|
60
|
-
return 90; // Adjust based on specificity
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Detect if this is a {Framework} project
|
|
65
|
-
*
|
|
66
|
-
* @param {string} projectPath - Directory to check
|
|
67
|
-
* @returns {object} Detection result
|
|
68
|
-
*/
|
|
69
|
-
detect(projectPath = process.cwd()) {
|
|
70
|
-
// Check for package.json
|
|
71
|
-
const packageJsonPath = path.join(projectPath, 'package.json');
|
|
72
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
73
|
-
return { detected: false, confidence: 0, metadata: {} };
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
try {
|
|
77
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
78
|
-
const dependencies = {
|
|
79
|
-
...packageJson.dependencies,
|
|
80
|
-
...packageJson.devDependencies,
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
// Check for framework-specific dependency
|
|
84
|
-
if (!dependencies['{framework-package}']) {
|
|
85
|
-
return { detected: false, confidence: 0, metadata: {} };
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Gather metadata
|
|
89
|
-
const metadata = {
|
|
90
|
-
version: dependencies['{framework-package}'],
|
|
91
|
-
hasTypeScript: !!dependencies.typescript ||
|
|
92
|
-
fs.existsSync(path.join(projectPath, 'tsconfig.json')),
|
|
93
|
-
// Add framework-specific metadata:
|
|
94
|
-
routerType: this.detectRouterType(dependencies),
|
|
95
|
-
// config, plugins, etc.
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
return {
|
|
99
|
-
detected: true,
|
|
100
|
-
confidence: 0.95, // Adjust based on detection certainty
|
|
101
|
-
metadata,
|
|
102
|
-
};
|
|
103
|
-
} catch (error) {
|
|
104
|
-
return { detected: false, confidence: 0, metadata: {} };
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Detect router type for this framework
|
|
110
|
-
* IMPORTANT: Always return a string, never null/undefined
|
|
111
|
-
*/
|
|
112
|
-
detectRouterType(dependencies) {
|
|
113
|
-
// Example for a framework with multiple router options
|
|
114
|
-
if (dependencies['{file-router-package}']) {
|
|
115
|
-
return 'file-based';
|
|
116
|
-
} else if (dependencies['{other-router}']) {
|
|
117
|
-
return 'manual';
|
|
118
|
-
}
|
|
119
|
-
return 'default'; // Always have a fallback!
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Features supported by this framework
|
|
124
|
-
*/
|
|
125
|
-
getSupportedFeatures() {
|
|
126
|
-
return {
|
|
127
|
-
oauth: true, // true = full support, 'manual' = guide only, false = none
|
|
128
|
-
stripe: true, // Payment integration
|
|
129
|
-
crm: true, // CRM API access
|
|
130
|
-
projects: true, // Projects feature
|
|
131
|
-
invoices: true, // Invoices feature
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Available generators for this framework
|
|
137
|
-
*/
|
|
138
|
-
getAvailableGenerators() {
|
|
139
|
-
return [
|
|
140
|
-
'api-client', // Always include - generates API client
|
|
141
|
-
'env', // Always include - generates .env.local
|
|
142
|
-
'oauth-guide', // Include if oauth is supported
|
|
143
|
-
// Framework-specific generators:
|
|
144
|
-
// '{framework}-auth',
|
|
145
|
-
];
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
module.exports = new {Framework}Detector();
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
## Step 2: Register the Detector
|
|
153
|
-
|
|
154
|
-
Add your detector to `src/detectors/registry.js`:
|
|
155
|
-
|
|
156
|
-
```javascript
|
|
157
|
-
const nextJsDetector = require('./nextjs-detector');
|
|
158
|
-
const expoDetector = require('./expo-detector');
|
|
159
|
-
const yourDetector = require('./{framework}-detector'); // Add this
|
|
160
|
-
|
|
161
|
-
const detectors = [
|
|
162
|
-
nextJsDetector,
|
|
163
|
-
expoDetector,
|
|
164
|
-
yourDetector, // Add this
|
|
165
|
-
];
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Step 3: Update File Generators (if needed)
|
|
169
|
-
|
|
170
|
-
If your framework needs special file generation, update `src/generators/index.js`:
|
|
171
|
-
|
|
172
|
-
```javascript
|
|
173
|
-
// Check for your framework
|
|
174
|
-
if (frameworkType === '{framework}') {
|
|
175
|
-
// Generate framework-specific files
|
|
176
|
-
}
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
And update `src/generators/api-client-generator.js` for proper file paths:
|
|
180
|
-
|
|
181
|
-
```javascript
|
|
182
|
-
isMobileFramework(frameworkType) {
|
|
183
|
-
return ['expo', 'react-native', '{framework}'].includes(frameworkType);
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
## Step 4: Update Spread Command (if needed)
|
|
188
|
-
|
|
189
|
-
If your framework needs special handling in the setup flow, update `src/commands/spread.js`:
|
|
190
|
-
|
|
191
|
-
```javascript
|
|
192
|
-
// Framework-specific detection display
|
|
193
|
-
if (detection.framework.type === '{framework}') {
|
|
194
|
-
console.log(chalk.gray(` Router: ${meta.routerType}`));
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Framework-specific next steps
|
|
198
|
-
if (frameworkType === '{framework}') {
|
|
199
|
-
console.log(chalk.gray(' 3. Install {framework}-specific package'));
|
|
200
|
-
}
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
## Step 5: Write Tests
|
|
204
|
-
|
|
205
|
-
Create `tests/{framework}-detector.test.js`:
|
|
206
|
-
|
|
207
|
-
```javascript
|
|
208
|
-
const fs = require('fs');
|
|
209
|
-
const path = require('path');
|
|
210
|
-
|
|
211
|
-
jest.mock('fs');
|
|
212
|
-
|
|
213
|
-
const detector = require('../src/detectors/{framework}-detector');
|
|
214
|
-
|
|
215
|
-
describe('{Framework}Detector', () => {
|
|
216
|
-
beforeEach(() => {
|
|
217
|
-
jest.clearAllMocks();
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
it('detects {framework} project', () => {
|
|
221
|
-
fs.existsSync.mockReturnValue(true);
|
|
222
|
-
fs.readFileSync.mockReturnValue(JSON.stringify({
|
|
223
|
-
dependencies: {
|
|
224
|
-
'{framework-package}': '^1.0.0',
|
|
225
|
-
},
|
|
226
|
-
}));
|
|
227
|
-
|
|
228
|
-
const result = detector.detect('/test/project');
|
|
229
|
-
|
|
230
|
-
expect(result.detected).toBe(true);
|
|
231
|
-
expect(result.confidence).toBeGreaterThan(0.8);
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
it('returns correct metadata', () => {
|
|
235
|
-
fs.existsSync.mockImplementation((p) => {
|
|
236
|
-
if (p.includes('tsconfig.json')) return true;
|
|
237
|
-
if (p.includes('package.json')) return true;
|
|
238
|
-
return false;
|
|
239
|
-
});
|
|
240
|
-
fs.readFileSync.mockReturnValue(JSON.stringify({
|
|
241
|
-
dependencies: {
|
|
242
|
-
'{framework-package}': '^1.0.0',
|
|
243
|
-
'typescript': '^5.0.0',
|
|
244
|
-
},
|
|
245
|
-
}));
|
|
246
|
-
|
|
247
|
-
const result = detector.detect('/test/project');
|
|
248
|
-
|
|
249
|
-
expect(result.metadata.hasTypeScript).toBe(true);
|
|
250
|
-
expect(result.metadata.routerType).toBeDefined();
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
it('does not detect non-{framework} project', () => {
|
|
254
|
-
fs.existsSync.mockReturnValue(true);
|
|
255
|
-
fs.readFileSync.mockReturnValue(JSON.stringify({
|
|
256
|
-
dependencies: {
|
|
257
|
-
'some-other-framework': '^1.0.0',
|
|
258
|
-
},
|
|
259
|
-
}));
|
|
260
|
-
|
|
261
|
-
const result = detector.detect('/test/project');
|
|
262
|
-
|
|
263
|
-
expect(result.detected).toBe(false);
|
|
264
|
-
});
|
|
265
|
-
});
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
## Important Rules
|
|
269
|
-
|
|
270
|
-
### 1. Always Return a Router Type
|
|
271
|
-
|
|
272
|
-
The backend expects `routerType` to be a string if present. Never return `null` or `undefined`:
|
|
273
|
-
|
|
274
|
-
```javascript
|
|
275
|
-
// ❌ Bad
|
|
276
|
-
routerType: dependencies['some-router'] ? 'router' : null,
|
|
277
|
-
|
|
278
|
-
// ✅ Good
|
|
279
|
-
routerType: dependencies['some-router'] ? 'specific-router' : 'default',
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
### 2. Priority Order Matters
|
|
283
|
-
|
|
284
|
-
Higher priority detectors run first. If a project could match multiple detectors (e.g., Next.js is also React), the more specific one should have higher priority.
|
|
285
|
-
|
|
286
|
-
### 3. Confidence Levels
|
|
287
|
-
|
|
288
|
-
- `0.95+`: Very certain (found framework + config file)
|
|
289
|
-
- `0.85-0.94`: Certain (found framework package)
|
|
290
|
-
- `0.70-0.84`: Likely (found related packages)
|
|
291
|
-
- `< 0.70`: Uncertain
|
|
292
|
-
|
|
293
|
-
### 4. Metadata Requirements
|
|
294
|
-
|
|
295
|
-
These fields should always be present in metadata if applicable:
|
|
296
|
-
- `version`: Framework version from package.json
|
|
297
|
-
- `hasTypeScript`: Boolean
|
|
298
|
-
- `routerType`: String (never null!)
|
|
299
|
-
- `config`: Config file name if detected
|
|
300
|
-
|
|
301
|
-
## Example: Adding Remix Support
|
|
302
|
-
|
|
303
|
-
```javascript
|
|
304
|
-
// src/detectors/remix-detector.js
|
|
305
|
-
|
|
306
|
-
const fs = require('fs');
|
|
307
|
-
const path = require('path');
|
|
308
|
-
const BaseDetector = require('./base-detector');
|
|
309
|
-
|
|
310
|
-
class RemixDetector extends BaseDetector {
|
|
311
|
-
get name() {
|
|
312
|
-
return 'remix';
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
get priority() {
|
|
316
|
-
return 100; // Meta-framework, high priority
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
detect(projectPath = process.cwd()) {
|
|
320
|
-
const packageJsonPath = path.join(projectPath, 'package.json');
|
|
321
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
322
|
-
return { detected: false, confidence: 0, metadata: {} };
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
try {
|
|
326
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
327
|
-
const dependencies = {
|
|
328
|
-
...packageJson.dependencies,
|
|
329
|
-
...packageJson.devDependencies,
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
// Check for Remix
|
|
333
|
-
if (!dependencies['@remix-run/react']) {
|
|
334
|
-
return { detected: false, confidence: 0, metadata: {} };
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
// Detect adapter
|
|
338
|
-
let adapter = 'node'; // default
|
|
339
|
-
if (dependencies['@remix-run/vercel']) adapter = 'vercel';
|
|
340
|
-
else if (dependencies['@remix-run/cloudflare']) adapter = 'cloudflare';
|
|
341
|
-
else if (dependencies['@remix-run/deno']) adapter = 'deno';
|
|
342
|
-
|
|
343
|
-
return {
|
|
344
|
-
detected: true,
|
|
345
|
-
confidence: 0.95,
|
|
346
|
-
metadata: {
|
|
347
|
-
version: dependencies['@remix-run/react'],
|
|
348
|
-
hasTypeScript: !!dependencies.typescript ||
|
|
349
|
-
fs.existsSync(path.join(projectPath, 'tsconfig.json')),
|
|
350
|
-
routerType: 'file-based', // Remix always uses file-based routing
|
|
351
|
-
adapter,
|
|
352
|
-
},
|
|
353
|
-
};
|
|
354
|
-
} catch {
|
|
355
|
-
return { detected: false, confidence: 0, metadata: {} };
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
getSupportedFeatures() {
|
|
360
|
-
return {
|
|
361
|
-
oauth: true,
|
|
362
|
-
stripe: true,
|
|
363
|
-
crm: true,
|
|
364
|
-
projects: true,
|
|
365
|
-
invoices: true,
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
getAvailableGenerators() {
|
|
370
|
-
return ['api-client', 'env', 'oauth-guide'];
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
module.exports = new RemixDetector();
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
## Checklist
|
|
378
|
-
|
|
379
|
-
Before submitting a new detector:
|
|
380
|
-
|
|
381
|
-
- [ ] Detector extends `BaseDetector`
|
|
382
|
-
- [ ] `name` getter returns lowercase string
|
|
383
|
-
- [ ] `priority` is set appropriately (0-100)
|
|
384
|
-
- [ ] `detect()` returns `{ detected, confidence, metadata }`
|
|
385
|
-
- [ ] `routerType` in metadata is never null/undefined
|
|
386
|
-
- [ ] `getSupportedFeatures()` returns feature matrix
|
|
387
|
-
- [ ] `getAvailableGenerators()` returns generator list
|
|
388
|
-
- [ ] Detector is registered in `registry.js`
|
|
389
|
-
- [ ] Tests are written and passing
|
|
390
|
-
- [ ] File generators updated if needed
|
|
391
|
-
- [ ] Spread command updated if needed
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
# Adding a New Project Type
|
|
2
|
-
|
|
3
|
-
Quick guide for adding support for new frameworks (React, Vue, Svelte, etc.)
|
|
4
|
-
|
|
5
|
-
## Quick Start
|
|
6
|
-
|
|
7
|
-
### 1. Create Detector File
|
|
8
|
-
|
|
9
|
-
Create `src/detectors/react-detector.js` (example for React):
|
|
10
|
-
|
|
11
|
-
```javascript
|
|
12
|
-
const BaseDetector = require('./base-detector');
|
|
13
|
-
const fs = require('fs');
|
|
14
|
-
const path = require('path');
|
|
15
|
-
|
|
16
|
-
class ReactDetector extends BaseDetector {
|
|
17
|
-
get name() {
|
|
18
|
-
return 'react';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
get priority() {
|
|
22
|
-
return 50; // Lower than Next.js (100)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
detect(projectPath = process.cwd()) {
|
|
26
|
-
// Check for React-specific files
|
|
27
|
-
const packageJsonPath = path.join(projectPath, 'package.json');
|
|
28
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
29
|
-
return { detected: false, confidence: 0, metadata: {} };
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
34
|
-
const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };
|
|
35
|
-
|
|
36
|
-
const hasReact = !!deps.react;
|
|
37
|
-
const hasTypeScript = !!deps.typescript || fs.existsSync(path.join(projectPath, 'tsconfig.json'));
|
|
38
|
-
|
|
39
|
-
if (!hasReact) {
|
|
40
|
-
return { detected: false, confidence: 0, metadata: {} };
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
detected: true,
|
|
45
|
-
confidence: 0.9,
|
|
46
|
-
metadata: {
|
|
47
|
-
version: deps.react,
|
|
48
|
-
hasTypeScript,
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
} catch (error) {
|
|
52
|
-
return { detected: false, confidence: 0, metadata: {} };
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
getSupportedFeatures() {
|
|
57
|
-
return {
|
|
58
|
-
oauth: 'manual', // No NextAuth, manual setup only
|
|
59
|
-
stripe: true,
|
|
60
|
-
crm: true,
|
|
61
|
-
projects: true,
|
|
62
|
-
invoices: true,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
getAvailableGenerators() {
|
|
67
|
-
return [
|
|
68
|
-
'api-client', // Shared generator
|
|
69
|
-
'env', // Shared generator
|
|
70
|
-
// Add React-specific generators here if needed
|
|
71
|
-
];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
module.exports = new ReactDetector();
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### 2. Register Detector
|
|
79
|
-
|
|
80
|
-
Add to `src/detectors/registry.js`:
|
|
81
|
-
|
|
82
|
-
```javascript
|
|
83
|
-
const nextJsDetector = require('./nextjs-detector');
|
|
84
|
-
const reactDetector = require('./react-detector'); // Add this
|
|
85
|
-
|
|
86
|
-
const detectors = [
|
|
87
|
-
nextJsDetector,
|
|
88
|
-
reactDetector, // Add this
|
|
89
|
-
];
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### 3. Test
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
cd /path/to/react/project
|
|
96
|
-
l4yercak3 spread
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
You should see:
|
|
100
|
-
```
|
|
101
|
-
✅ Detected react project
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## What Gets Generated?
|
|
107
|
-
|
|
108
|
-
### Shared Generators (Work for All Frameworks)
|
|
109
|
-
|
|
110
|
-
- **`api-client`** - Generates API client (framework-agnostic)
|
|
111
|
-
- **`env`** - Generates `.env.local.example` (framework-agnostic)
|
|
112
|
-
|
|
113
|
-
### Framework-Specific Generators
|
|
114
|
-
|
|
115
|
-
- **Next.js**: `nextauth` (NextAuth.js setup)
|
|
116
|
-
- **React**: (none yet, but can add `react-auth` generator)
|
|
117
|
-
- **Vue**: (none yet, but can add `vue-auth` generator)
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## Feature Support Matrix
|
|
122
|
-
|
|
123
|
-
When implementing `getSupportedFeatures()`, use:
|
|
124
|
-
|
|
125
|
-
- `true` - Full support (e.g., Next.js OAuth with NextAuth.js)
|
|
126
|
-
- `'manual'` - Guide only (e.g., React OAuth setup guide)
|
|
127
|
-
- `false` - Not supported
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## Priority Guidelines
|
|
132
|
-
|
|
133
|
-
Set detector priority based on specificity:
|
|
134
|
-
|
|
135
|
-
- **100**: Very specific (Next.js, Nuxt, SvelteKit)
|
|
136
|
-
- **75**: Framework + build tool (Vite + React, Webpack + Vue)
|
|
137
|
-
- **50**: Pure framework (React, Vue, Svelte)
|
|
138
|
-
- **25**: Generic (JavaScript/TypeScript)
|
|
139
|
-
|
|
140
|
-
Higher priority detectors run first. First match with confidence > 0.8 wins.
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Example: Adding Vue Support
|
|
145
|
-
|
|
146
|
-
1. Create `src/detectors/vue-detector.js`
|
|
147
|
-
2. Register in `registry.js`
|
|
148
|
-
3. Test with a Vue project
|
|
149
|
-
4. Add Vue-specific generators if needed (e.g., `vue-auth-generator.js`)
|
|
150
|
-
|
|
151
|
-
That's it! The architecture handles the rest automatically.
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
**See:** `DETECTOR_ARCHITECTURE.md` for full architecture details
|
|
156
|
-
|