MCPcopy
hub / github.com/subquery/subql / createMultiChainTestProject

Function createMultiChainTestProject

packages/cli/src/createProject.fixtures.ts:99–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97}
98
99export async function createMultiChainTestProject(): Promise<{multichainManifestPath: string; fullPaths: string[]}> {
100 const tmpdir = await fs.promises.mkdtemp(`${os.tmpdir()}${path.sep}`);
101 const projectDir = path.join(tmpdir, multiProjectSpecV1_0_0.name);
102
103 const exampleProject = await getExampleProject('multi', 'multi');
104
105 await cloneProjectTemplate(tmpdir, multiProjectSpecV1_0_0.name, exampleProject);
106
107 await installAndBuild(projectDir);
108
109 const project = getProjectRootAndManifest(projectDir);
110 const fullPaths = project.manifests.map((manifest) => path.join(project.root, manifest));
111 let multichainManifestPath = getMultichainManifestPath(projectDir);
112 if (!multichainManifestPath) {
113 throw new Error(
114 'Selected project is not multi-chain. Please set correct file.\n\n https://academy.subquery.network/build/multi-chain.html'
115 );
116 }
117
118 multichainManifestPath = path.join(project.root, multichainManifestPath);
119 return {multichainManifestPath, fullPaths};
120}

Callers 1

Calls 6

cloneProjectTemplateFunction · 0.90
getExampleProjectFunction · 0.85
installAndBuildFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected