Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @tobelabs/chainwright

## 0.11.0

### Minor Changes

- [Core] - Replace the 'glob' package with Node.js internal method

## 0.10.17

### Patch Changes
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chainwright",
"version": "0.10.17",
"version": "0.11.0",
"description": "Playwright Web3 wallet testing framework for end-to-end dApp automation with MetaMask, Phantom, Solflare, Petra, Meteor, and Keplr",
"type": "module",
"license": "MIT",
Expand Down Expand Up @@ -33,6 +33,10 @@
"keplr"
],
"exports": {
".": {
"types": "./dist/core/index.d.ts",
"import": "./dist/core/index.js"
},
"./keplr": {
"types": "./dist/wallets/keplr/index.d.ts",
"import": "./dist/wallets/keplr/index.js"
Expand Down Expand Up @@ -72,7 +76,7 @@
"access": "public"
},
"engines": {
"node": ">=22"
"node": ">=22.18"
},
"scripts": {
"build": "tsup",
Expand Down Expand Up @@ -101,6 +105,7 @@
"@types/cli-progress": "^3.11.6",
"@types/node": "^26.2.0",
"tsup": "^8.5.1",
"tsx": "^4.23.12",
"typescript": "^5.9.3",
"vitest": "^4.1.10"
},
Expand All @@ -109,9 +114,6 @@
"adm-zip": "^0.6.0",
"cli-progress": "^3.12.0",
"commander": "^15.0.0",
"glob": "^13.0.6",
"prool": "^0.2.14",
"tsx": "^4.23.12",
"zod": "^4.4.3"
"prool": "^0.2.14"
}
}
64 changes: 3 additions & 61 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cli/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env -S node --import tsx
#!/usr/bin/env node

export * from "./entry-point";
18 changes: 8 additions & 10 deletions src/core/get-setup-function.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { globSync as glob } from "node:fs";
import path from "node:path";
import { pathToFileURL } from "node:url";
import { styleText } from "node:util";
import { glob } from "glob";
import type { CLIOptions, GetSetupFunctionFileList, SupportedWallets } from "@/types";
import extractWalletNameFromPath from "@/utils/wallets/extract-wallet-name-from-path";
import type { defineWalletSetup } from "./define-wallet-setup";
Expand All @@ -17,7 +17,7 @@ const toPosix = (path: string) => path.replace(/\\/g, "/");

const createGlobPattern = (walletSetupDir: string) => {
const base = toPosix(path.resolve(walletSetupDir));
return `${base}/**/*.setup.{ts,js,}`;
return `${base}/**/*.setup.{ts,js,mjs}`;
};

const importSetupFile = (filePath: string) => {
Expand All @@ -27,14 +27,12 @@ const importSetupFile = (filePath: string) => {

export default async function getSetupFunction({ walletSetupDir, selectedWallets }: SetupFunctionHash) {
const globPattern = createGlobPattern(walletSetupDir);
const fileList = (
await glob(globPattern, {
dot: true,
absolute: true,
nodir: true,
windowsPathsNoEscape: true,
})
).sort();
const fileList = glob(globPattern, {
withFileTypes: true,
})
.filter((dirent) => dirent.isFile())
.map((dirent) => path.join(dirent.parentPath, dirent.name))
.sort();

// biome-ignore lint/style/noNonNullAssertion: We will always have a selected wallet
const _selectedWallets = selectedWallets.length === 1 ? selectedWallets[0]! : selectedWallets;
Expand Down
Loading
Loading