# Project-relative \`require\`?

**URL:** <https://forum.crystal-lang.org/t/project-relative-require/4617>\
**Category:** Help & Support\
**Created:** [May 10, 2022, 4:31am UTC](https://forum.crystal-lang.org/t/project-relative-require/4617 "2022-05-10T04:31:37Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/blacksmoke16/32/1241_2.png) [@Blacksmoke16](https://forum.crystal-lang.org/u/Blacksmoke16)\
**Post date:** [May 10, 2022, 5:17pm UTC](https://forum.crystal-lang.org/t/project-relative-require/4617/5 "2022-05-10T17:17:44Z")

</div>

> [@jwoertink](#):
>
> One tricky part would probably be that shards like [athena/src/components/dependency\_injection at master · athena-framework/athena · GitHub](https://github.com/athena-framework/athena/tree/master/src/components/dependency_injection) which have nested `shard.yml` may get a little tricky.

> [@jgaskins](#):
>
> Interesting. I didn’t realize anyone was doing that due to the one-shard-per-repo thing.

It’s not really as it appears. [How I migrated Athena to a Monorepo...and you can too](https://forum.crystal-lang.org/t/how-i-migrated-athena-to-a-monorepo-and-you-can-too/4154) goes into things in more detail, but the gist of it is that all _development_ happens within the monorepo, but then changes are synced out to read-only repo mirrors via git subtrees. This allows you to get the developmental benefits of a monorepo, while still adhering to the “one-shard-per-repo” requirement.

In regards to tests, they’re all still invoked on a per component basis. E.g. [https://github.com/athena-framework/athena/blob/master/scripts/test.sh](https://github.com/athena-framework/athena/blob/master/scripts/test.sh). So some sort of ` __ROOT__ ` const would still work.

Although I haven’t really run into a need for it too much. In the spec context I just require all my fixtures, helpers, and source code within `spec_helper` then require that one file in each spec versus the specific thing each test uses on its own.

A pipe dream of mine is having something like [import - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import), versus having `require` be global. But deff not something we’ll see soon, or ever ha.

EDIT: Which you can kinda replicate with like:

```auto
macro import(type)
  private alias {{type.stringify.split("::").last}} = {{type}}
end

import MyApp::SomeNamespace::Things::MyClass

pp MyClass.new

```

but 🤷, debatable of its usefulness, at least without proper IDE support and such.

---

_[View the full topic](https://forum.crystal-lang.org/t/project-relative-require/4617)._
