CI/CD Pipelines
Relevant source files
The following files were used as context for generating this wiki page:
The @wonderland/walletless project utilizes a CI/CD-friendly architecture designed to support high-performance end-to-end (E2E) testing within automated environments. The system is specifically optimized for headless browsers and Docker containers, enabling deterministic blockchain interactions without the overhead of physical browser extensions or manual wallet approvals.
The pipeline integration relies on standard Node.js tooling, including pnpm for package management and a suite of scripts for building, linting, and testing. The library detects CI environments (typically via the CI=true environment variable) to toggle between production wallet connectors and the virtualized E2E provider.
Sources: README.md:28-34, package.json:96-98
Pipeline Lifecycle and Automation
The project defines a standard set of lifecycle scripts that form the basis of the CI/CD pipeline. These scripts ensure code quality, type safety, and functional correctness before deployment or distribution.
Core Automation Scripts
| Script | Command | Purpose |
|---|---|---|
build | tsc -p tsconfig.build.json | Compiles TypeScript source to JavaScript in the dist directory. |
check-types | tsc --noEmit -p ./tsconfig.json | Performs static type analysis without generating output files. |
lint | eslint "{src,test}/**/*.{js,ts,json}" | Enforces code style and identifies programmatic errors. |
format | prettier --check ... | Verifies that all files adhere to defined formatting rules. |
test | vitest run --config vitest.config.ts | Executes the test suite in a single run mode suitable for CI. |
test:cov | vitest run ... --coverage | Generates code coverage reports using the V8 provider. |
Sources: package.json:44-54, tsconfig.build.json:1-14
Pre-commit and Staging Logic
To prevent broken code from entering the repository, the project employs husky and lint-staged. This ensures that every commit undergoes local validation, mirroring the checks performed in the remote CI pipeline.
The diagram shows the local automation flow triggered before code is pushed to the remote repository.
Sources: package.json:55-60
Testing Infrastructure
Testing is central to the CI/CD strategy, utilizing vitest with a configuration tailored for both unit and E2E scenarios.
Test Environment Configuration
The test runner is configured to operate in a Node.js environment, including specific aliases for source resolution and excluding build artifacts from the test scope.
The testing configuration ensures consistency across local and remote CI environments.
Sources: vitest.config.ts:4-15
CI Detection for E2E Testing
Applications consuming this library are encouraged to use environment variables to swap connectors dynamically. This allows the same codebase to run with real wallets in development and the @wonderland/walletless provider in CI pipelines.
const isE2E = process.env.CI === "true";
export const config = createConfig({
chains: [mainnet],
connectors: isE2E ? [e2eConnector()] : [/* real wallets */],
transports: {
[mainnet.id]: isE2E ? http("http://localhost:8545") : http(),
},
});
Sources: README.md:52-66
Build and Distribution
The distribution process transforms TypeScript source files into a package ready for NPM consumption. The build pipeline uses tsconfig.build.json to manage output settings.
Build Artifacts
- Output Directory:
dist/ - Modules: ES Modules (
type: module) - Type Definitions: Included as
.d.tsfiles with declaration maps for debugging. - Engines: Requires Node.js
>=20.
Sources: package.json:17-21, package.json:100-102, tsconfig.build.json:4-9
Summary
The CI/CD pipelines for @wonderland/walletless focus on maintaining high performance and reliability for Web3 applications. By integrating vitest for execution, eslint and prettier for quality, and environment-aware configuration for E2E tests, the project ensures that blockchain-dependent software can be tested rapidly and deterministically in automated environments. The 16x speedup observed in benchmarks over traditional tools like Synpress highlights the efficiency of this CI-first approach.
Sources: README.md:36-44