-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c77e8a8
commit 9086f91
Showing
4 changed files
with
26 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { dirname, exists, resolve, copy } from "../deps.ts"; | ||
import { glob, bold, brightRed } from "./deps.ts"; | ||
import { copy, dirname, exists, resolve } from "../deps.ts"; | ||
import { bold, brightRed, glob } from "./deps.ts"; | ||
import { readConfig as readProjectConfig } from "../config/project.ts"; | ||
import { ProjectConfig } from "../config/project.ts"; | ||
import { loadModule, Module } from "./module.ts"; | ||
|
@@ -29,6 +29,7 @@ export async function loadProject(opts: LoadProjectOpts): Promise<Project> { | |
|
||
// Load registries | ||
const registries = new Map(); | ||
|
||
for (const registryName in projectConfig.registries) { | ||
const registryConfig = projectConfig.registries[registryName]; | ||
const registry = await loadRegistry( | ||
|
@@ -39,6 +40,25 @@ export async function loadProject(opts: LoadProjectOpts): Promise<Project> { | |
registries.set(registryName, registry); | ||
} | ||
|
||
if (!registries.has("default")) { | ||
const defaultRegistry = await loadRegistry( | ||
projectRoot, | ||
"default", | ||
{ | ||
git: { | ||
url: { | ||
https: "https://github.com/rivet-gg/open-game-services.git", | ||
ssh: "[email protected]:rivet-gg/opengb-registry.git", | ||
}, | ||
// TODO: https://github.com/rivet-gg/opengb/issues/151 | ||
rev: "f28b9c0ddbb69fcc092dfff12a18707065a69251", | ||
directory: "./modules", | ||
}, | ||
}, | ||
); | ||
registries.set("default", defaultRegistry); | ||
} | ||
|
||
// Load modules | ||
const modules = new Map<string, Module>(); | ||
for (const projectModuleName in projectConfig.modules) { | ||
|
@@ -71,7 +91,9 @@ export async function loadProject(opts: LoadProjectOpts): Promise<Project> { | |
if (missingDepsByModule.size > 0) { | ||
let message = bold(brightRed("Unresolved module dependencies:\n")); | ||
for (const [moduleName, missingDeps] of missingDepsByModule) { | ||
message += `\tModule ${moduleName} is missing dependencies: ${missingDeps.join(", ")}\n`; | ||
message += `\tModule ${moduleName} is missing dependencies: ${ | ||
missingDeps.join(", ") | ||
}\n`; | ||
} | ||
throw new Error(message); | ||
} | ||
|
@@ -92,8 +114,6 @@ export async function loadProject(opts: LoadProjectOpts): Promise<Project> { | |
throw new Error(message); | ||
} | ||
|
||
|
||
|
||
return { path: projectRoot, config: projectConfig, registries, modules }; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,16 +7,6 @@ export async function templateProject(rootPath: string) { | |
// Create backend.yaml | ||
const defaultBackend: ProjectConfig = { | ||
registries: { | ||
default: { | ||
git: { | ||
url: { | ||
https: "https://github.com/rivet-gg/open-game-services.git", | ||
ssh: "[email protected]:rivet-gg/opengb-registry.git" | ||
}, | ||
branch: "main", | ||
directory: "./modules", | ||
}, | ||
}, | ||
local: { | ||
local: { | ||
directory: "modules", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,4 @@ | ||
registries: | ||
default: | ||
git: | ||
url: | ||
https: https://github.com/rivet-gg/open-game-services.git | ||
ssh: [email protected]:rivet-gg/opengb-registry.git | ||
rev: f28b9c0ddbb69fcc092dfff12a18707065a69251 | ||
directory: ./modules | ||
# default: | ||
# local: | ||
# directory: ../../../opengb-registry/modules | ||
|
@@ -17,7 +10,7 @@ modules: | |
# friends: {} | ||
# rate_limit: {} | ||
# tokens: {} | ||
# users: {} | ||
users: {} | ||
# auth: | ||
# config: | ||
# google: | ||
|
This file was deleted.
Oops, something went wrong.