Skip to content

Commit

Permalink
Merge pull request #47 from inaridiy/fix(cli)/playwright-install-commadn
Browse files Browse the repository at this point in the history
Fix(cli)/playwright install commadn
  • Loading branch information
inaridiy authored Oct 8, 2024
2 parents 04615fe + fc84541 commit ada103a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-snails-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webforai": patch
---

Fix Playwright installation command for improved reliability
35 changes: 7 additions & 28 deletions packages/webforai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@
"description": "A library that provides a web interface for AI",
"author": "inaridiy",
"license": "MIT",
"keywords": [
"web",
"ai",
"html",
"html2md",
"markdown",
"mdast",
"hast"
],
"keywords": ["web", "ai", "html", "html2md", "markdown", "mdast", "hast"],
"repository": {
"type": "git",
"url": "https://github.com/inaridiy/webforai.git"
Expand All @@ -26,10 +18,7 @@
"prerelease": "pnpm build",
"release": "np"
},
"files": [
"dist",
"!dist/types/**/*.js"
],
"files": ["dist", "!dist/types/**/*.js"],
"main": "dist/cjs/index.js",
"type": "module",
"module": "dist/index.js",
Expand Down Expand Up @@ -69,21 +58,11 @@
},
"typesVersions": {
"*": {
"types": [
"./dist/types/index.d.ts"
],
"loaders/playwright": [
"./dist/types/loaders/playwright.d.ts"
],
"loaders/cf-puppeteer": [
"./dist/types/loaders/cf-puppeteer.d.ts"
],
"loaders/fetch": [
"./dist/types/loaders/fetch.d.ts"
],
"loaders/puppeteer": [
"./dist/types/loaders/puppeteer.d.ts"
]
"types": ["./dist/types/index.d.ts"],
"loaders/playwright": ["./dist/types/loaders/playwright.d.ts"],
"loaders/cf-puppeteer": ["./dist/types/loaders/cf-puppeteer.d.ts"],
"loaders/fetch": ["./dist/types/loaders/fetch.d.ts"],
"loaders/puppeteer": ["./dist/types/loaders/puppeteer.d.ts"]
}
},
"peerDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/webforai/src/cli/commands/webforai/loadHtml.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from "node:fs/promises";
import { fileURLToPath } from "node:url";
import { log } from "@clack/prompts";
import boxen from "boxen";
import pc from "picocolors";
Expand All @@ -19,7 +20,7 @@ const checkPlaywrightAvailable = async () => {
const getPlaywrightVersion = async () => {
const path = await import.meta.resolve("playwright-core/package.json");
const pwPackageJson = await fs
.readFile(path.replace("file://", ""), "utf-8")
.readFile(fileURLToPath(path), "utf-8")
.then((res) => JSON.parse(res.toString()))
.catch(() => null);
return pwPackageJson?.version;
Expand Down

0 comments on commit ada103a

Please sign in to comment.