Skip to content

It is recommended to further optimize the directory structure #869

Closed

Description

@sbfkcel

The src directory and entry-x file should be hidden. At least entry-x can define multiple entries without redundancy.

As an excellent starting project, developers don't need to care about src, dist and other directories, it would be better to remove them.

The compilation result is generated in the .solid directory, and the root directory is the project file.

This is like the next.js directory structure, which is worth learning from.

Activity

  1. boehs commented on May 5, 2023

    @boehs
    Contributor

    I think I understand what you mean. We run the equivalent of mv src/* .. I don't like removing entry-*, start is modular and this contributes to that, but it's worth discussing what you said.

    At first I thought it was a bad idea... Like what if people want to have their backend in the same repository, but the top level (with src & backend or whatever) is already polluted by our configuration, so I see no issue here...

  2. sbfkcel commented on May 5, 2023

    @sbfkcel
    Author

    It is also very reasonable to keep entry-* separately. Is it better to move entry-*, root to the specified directory? For example: the app directory, because it is not necessary to modify them frequently in most cases, it is not necessary to put it in the most conspicuous root directory.

    In addition, is it more intuitive to change the name of routes to pages? routes is more suitable for single-page applications in the past. And pages is more suitable for page entries routed by filename rules.

    Directory Structure Reference:

    ├── README.md
    ├── app
    │   ├── entry-client.tsx
    │   ├── entry-server.tsx
    │   └── root.tsx
    ├── components
    │   └── Counter
    │       ├── CounterUI.module.css
    │       ├── CounterUI.tsx
    │       └── index.tsx
    ├── package.json
    ├── pages
    │   ├── [...404].tsx
    │   └── index.tsx
    ├── public
    │   └── favicon.ico
    ├── styles
    │   └── root.css
    ├── tsconfig.json
    └── vite.config.ts
    
  3. locked and limited conversation to collaborators on Dec 19, 2023
  4. converted this issue into a discussion #1148 on Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions