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

fix(http): version from deno.json import #4342

Merged
merged 2 commits into from
Feb 17, 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
13 changes: 8 additions & 5 deletions _tools/convert_to_workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,24 @@ await Deno.writeTextFile("README.md", readme);
let fileServer = await Deno.readTextFile("http/file_server.ts");
fileServer = fileServer.replace(
`import { VERSION } from "../version.ts";`,
`import { version } from "./deno.json" with { type: "json" };`,
`import denoConfig from "./deno.json" with { type: "json" };`,
);
fileServer = fileServer.replaceAll("${VERSION}", "${version}");
fileServer = fileServer.replaceAll("${VERSION}", "${denoConfig.version}");
fileServer = fileServer.replace(
"https://deno.land/std/http/file_server.ts",
"jsr:@std/http@${version}/file_server",
"jsr:@std/http@${denoConfig.version}/file_server",
);
await Deno.writeTextFile("http/file_server.ts", fileServer);

let fileServerTest = await Deno.readTextFile("http/file_server_test.ts");
fileServerTest = fileServerTest.replace(
`import { VERSION } from "../version.ts";`,
`import { version } from "./deno.json" with { type: "json" };`,
`import denoConfig from "./deno.json" with { type: "json" };`,
);
fileServerTest = fileServerTest.replaceAll(
"${VERSION}",
"${denoConfig.version}",
);
fileServerTest = fileServerTest.replaceAll("${VERSION}", "${version}");
await Deno.writeTextFile("http/file_server_test.ts", fileServerTest);

const packages = await discoverPackages();
Expand Down
Loading