Add remote provider compatibility map
This commit is contained in:
1 parent
d1e85c4e8f
commit
d90df543ed
19 files changed
+1251
-4
No files matched your search
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import * as Console from "effect/Console";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as FileSystem from "effect/FileSystem";
|
||||
import * as Path from "effect/Path";
|
||||
import * as Schema from "effect/Schema";
|
||||
|
||||
const decodeJson = Schema.decodeEffect(Schema.UnknownFromJsonString);
|
||||
|
||||
const program = Effect.gen(function* () {
|
||||
const fs = yield* FileSystem.FileSystem;
|
||||
const path = yield* Path.Path;
|
||||
const repoRoot = path.resolve(import.meta.dirname, "..");
|
||||
const sourcePath = path.join(repoRoot, "provider-compatibility.v1.json");
|
||||
const destinationPath = path.join(
|
||||
repoRoot,
|
||||
"apps",
|
||||
"marketing",
|
||||
"public",
|
||||
"provider-compatibility.v1.json",
|
||||
);
|
||||
|
||||
const source = yield* fs.readFileString(sourcePath);
|
||||
yield* decodeJson(source);
|
||||
|
||||
yield* fs.makeDirectory(path.dirname(destinationPath), { recursive: true });
|
||||
yield* fs.copyFile(sourcePath, destinationPath);
|
||||
|
||||
yield* Console.log(
|
||||
`Mirrored ${path.relative(repoRoot, sourcePath)} to ${path.relative(repoRoot, destinationPath)}.`,
|
||||
);
|
||||
});
|
||||
|
||||
if (import.meta.main) {
|
||||
program.pipe(Effect.provide(NodeServices.layer), NodeRuntime.runMain);
|
||||
}
|
||||
Reference in new issue
Block a user