question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: Apostrophe 3 modules directory name/nesting

See original GitHub issue

In Apostrophe 2.x, the directory containing individual module directories is lib/modules. Having been involved with many Apostrophe sites over the last few years, I’ve only seen other files or directories directly in this root level lib directory a couple of times. To my understanding, nesting modules within the lib directory was originally done due to concern that developers might be confused by having a modules directory as a sibling of the common node_modules directory. There was also desire to keep it feeling like a Node application, rather than a CMS that’s simply using Node, and so the structure was kept more generic.

With Apostrophe 3.x we have a chance to reconsider this. Given that the node_modules directory is such a common concept for Javascript developers and, secondarily, that IDEs typically will fade directories like node_modules that are ignored by git, I’m not totally convinced that developers would have much trouble managing the two directories.

A case for lib/modules:

  • There is no change for developers used to the Apostrophe 2.x structure
  • This structure will not need to change when upgrading 2.x projects to 3.x.
  • If the concern about confusing modules and node_modules is warranted, that confusion will be avoided

A case for modules at project root level:

  • Less unnecessary directory nesting
  • We’re already requiring much more significant changes to modules when upgrading (e.g., naming, actual code structure), so simply shifting the parent directory to the project root seems trivial
  • Arguably cleaner code structure, with the root level telling a clearer “story” of the application, with app.js already on the root level.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
boutellcommented, Jul 22, 2020

So far it looks like everyone likes modules at root level. Greg discussed the hypothetical where lib is the root of the whole project, but also said he prefers a flatter structure, so I assume he’s comfortable if we go with modules.

Are we there?

1reaction
boutellcommented, Jul 23, 2020

We are there!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module configuration options - Apostrophe 3 Documentation
All settings described here are placed in a module's options configuration object. The options object can be added in the module's index.js file...
Read more >
Assembler Application Developer's Guide - product version: 11.2
This software or hardware and documentation may provide access to or information about content, products, and services from third parties.
Read more >
[U-Boot] [RFC 0/3] uboot-doc User's Manual Generation Tool
Hello all, I've been working on writing a User's Manual generation tool, and before. I get too far I'd like to see if...
Read more >
Can there be an apostrophe in an email address? [duplicate]
Yes, according to RFC 3696 apostrophes are valid as long as they come before the @ symbol.
Read more >
2020-September.txt - sourceware.org
c b/elf/argv0test.c > new file mode 100644 > index 00000000..6c6c7e9a ... 3 Sep 2020 11:47:30 +0200 Subject: [PATCH 0/5] iconv: module for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found