Update Paths for Submodule

This commit is contained in:
Rokojori 2026-07-17 13:16:49 +02:00
parent e2b37b8820
commit 73fe3a3c9a
1 changed files with 9 additions and 9 deletions

View File

@ -86,10 +86,10 @@
<div class="card">
<h3>In your service repo</h3>
<pre><code>git submodule add https://community.rokojori.com/Rokojori/rokojori-auth-connector.git shared/auth-connector
<pre><code>git submodule add https://community.rokojori.com/Rokojori/rokojori-auth-connector.git source/auth-connector
git submodule update --init</code></pre>
<p style="margin-top:0.75rem">
This creates <code>shared/auth-connector/</code> inside your service repo.
This creates <code>source/auth-connector/</code> inside your service repo.
Import directly from that path — no build step, no install step.
</p>
</div>
@ -97,8 +97,8 @@ git submodule update --init</code></pre>
<div class="card">
<h3>When the submodule is updated</h3>
<pre><code># Inside your service repo — pull the latest connector and commit the new SHA
git submodule update --remote shared/auth-connector
git add shared/auth-connector
git submodule update --remote source/auth-connector
git add source/auth-connector
git commit -m "update auth-connector"</code></pre>
<p style="margin-top:0.75rem">
Each service repo pins a specific commit of the connector. Updates are
@ -124,12 +124,12 @@ git submodule update --init</code></pre>
<h3>tsconfig.json</h3>
<p>
Add a path alias so imports read cleanly instead of using relative
<code>../../shared/auth-connector/source/...</code> paths.
<code>../../source/auth-connector/source/...</code> paths.
</p>
<pre><code>{
"compilerOptions": {
"paths": {
"auth-connector/*": ["./shared/auth-connector/source/*"]
"auth-connector/*": ["./source/auth-connector/source/*"]
}
}
}</code></pre>
@ -143,8 +143,8 @@ import type { AuthPayload } from 'auth-connector/shared/types';</code>
<div class="card">
<h3>Without the alias (direct relative path)</h3>
<pre><code>import { jwtMiddleware, requireAuth } from '../../shared/auth-connector/source/server/auth';
import type { AuthPayload } from '../../shared/auth-connector/source/shared/types';</code></pre>
<pre><code>import { jwtMiddleware, requireAuth } from '../../source/auth-connector/source/server/auth';
import type { AuthPayload } from '../../source/auth-connector/source/shared/types';</code></pre>
</div>
</section>
@ -322,7 +322,7 @@ setAuthRedirectUrl( 'https://account.rokojori.com/login.html' );</code></pre>
<ol style="line-height:2;font-size:0.9rem;color:var(--muted)">
<li>
<code>git submodule add</code> — add the connector at
<code>shared/auth-connector/</code>
<code>source/auth-connector/</code>
</li>
<li>
Add path alias to <code>tsconfig.json</code>