Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-integration[patch]: Fill placeholders in package.json #5908

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libs/create-langchain-integration/helpers/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Install a internal template to a given `root` directory.
*/
export async function installTemplate({ appName, root }: any) {

Check warning on line 10 in libs/create-langchain-integration/helpers/templates.ts

View workflow job for this annotation

GitHub Actions / Check linting

Unexpected any. Specify a different type
/**
* Copy the template files to the target directory.
*/
Expand All @@ -25,10 +25,17 @@
* Update the package.json scripts.
*/
const packageJsonFile = path.join(root, "package.json");
const packageJson: any = JSON.parse(

Check warning on line 28 in libs/create-langchain-integration/helpers/templates.ts

View workflow job for this annotation

GitHub Actions / Check linting

Unexpected any. Specify a different type
await fs.readFile(packageJsonFile, "utf8")
);

packageJson.name = appName;
if (appName.startsWith("@langchain/")) {
const integrationName = appName.replace("@langchain/", "");
packageJson.description = `Integration for LangChain ${integrationName}`;
packageJson.homepage = `https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-${integrationName}/`;
packageJson.scripts.build = `yarn turbo:command build:internal --filter=${appName}`;
}

await fs.writeFile(
packageJsonFile,
Expand Down
Loading