Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 1, 2025

Summary

Reorganizes the monolithic JavaScript files into a modular file structure for better maintainability and reusability, without changing any functionality.

Changes

New directory structure:

  • js/shared/ - Cross-page utilities (csv-utils, json-utils, variables)
  • js/main/ - Main prompts page modules (theme, search, cards, modal, platform, preferences, yaml-modal, init)
  • js/main/templates/ - Reusable card and modal templates
  • js/vibe/ - Vibe page modules (csv-utils, prompts, search, modal, platform, init)
  • js/vibe/templates/ - Vibe-specific card templates
  • js/embed/ - Embed designer (designer.js)
  • js/embed-preview/ - Embed preview (preview.js)

Layout updates:

  • _layouts/default.html - Updated to load modular scripts in correct order
  • _layouts/embed.html - Points to js/embed/designer.js
  • _layouts/embed-preview.html - Points to js/embed-preview/preview.js
  • _layouts/vibe.html - New dedicated layout for vibe page with vibe-specific scripts

Human Review Checklist

  • Verify script load order - Scripts must load in correct dependency order (shared → templates → modules → init)
  • Check if original script files should be deleted - The original script.js, vibe/script.js, embed-script.js, and embed-preview-script.js may still exist in the repo
  • Test main page functionality - Search, cards, modals, platform selection, copy/chat buttons
  • Test vibe page functionality - Prompts display, search, modal interactions
  • Test embed designer and preview - Configuration, preview generation, embed code generation
  • Verify vibe layout - New _layouts/vibe.html was created from scratch and should match expected styling/behavior

Notes

  • No logic changes were made - code was only split into separate files
  • Global scope is preserved (no ES modules) to maintain compatibility
  • Jekyll build passes successfully

Link to Devin run: https://app.devin.ai/sessions/4c7016a90cc049d29019172ee40e0d1f
Requested by: Fatih Kadir Akın ([email protected]) (@f)

- Split script.js into modular files under js/main/
  - theme.js, search.js, cards.js, modal.js, platform.js, preferences.js, yaml-modal.js, init.js
- Create shared utilities under js/shared/
  - csv-utils.js, json-utils.js, variables.js
- Create reusable templates under js/main/templates/
  - card-template.js, modal-template.js
- Split vibe/script.js into modular files under js/vibe/
  - csv-utils.js, prompts.js, search.js, modal.js, platform.js, init.js
  - templates/card-template.js
- Move embed-script.js to js/embed/designer.js
- Move embed-preview-script.js to js/embed-preview/preview.js
- Create dedicated vibe layout for vibe page
- Update all HTML layouts to reference new script paths

Co-Authored-By: Fatih Kadir Akın <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

Original prompt from Fatih Kadir Akın
wake up, devin.
the matrix has you.
knock knock, devin.

now you must separate code into meaningful structure. do not rewrite it just split into files and reorganize the files with a better structure. refactor it., use template js files for reusability e.g. cards etc.

You only need to look in the following repo: f/awesome-chatgpt-prompts

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@f f closed this Dec 10, 2025
@f f deleted the devin/1764625630-refactor-js-structure branch December 10, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants