Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alessey committed Mar 5, 2025
1 parent d823e86 commit 4a9c2a4
Show file tree
Hide file tree
Showing 5 changed files with 2,847 additions and 6 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/cli-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CLI Test
on:
push:
branches: ['main']
pull_request:
branches: ['main']
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Change to CLI directory
run: cd create-onchain

- name: Install CLI dependencies
working-directory: ./create-onchain
run: |
yarn install
- name: Run CLI tests
working-directory: ./create-onchain
run: |
yarn test:coverage
21 changes: 20 additions & 1 deletion create-onchain/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
src/manifest/*
!src/manifest/.gitkeep
!src/manifest/.gitkeep

dist
/coverage

# Yarn
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

# Bun
.bun/*
!.bun/patches
!.bun/releases
!.bun/plugins
!.bun/sdks
!.bun/versions
11 changes: 6 additions & 5 deletions create-onchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"build:esm+types": "tsc --project tsconfig.build.json --outDir ./dist/esm --declaration --declarationMap --declarationDir ./dist/types",
"check:types": "tsc --noEmit",
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"dev": "bun src/cli.ts"
"dev": "bun src/cli.ts",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage"
},
"files": [
"dist/**",
Expand All @@ -19,9 +21,7 @@
"!src/**/*.test-d.ts",
"templates/**"
],
"bin": {
"create-onchain": "./dist/esm/cli.js"
},
"bin": "./dist/esm/cli.js",
"sideEffects": false,
"type": "module",
"exports": {
Expand All @@ -40,6 +40,7 @@
"@types/express": "^5.0.0",
"@types/node": "^20.12.10",
"@types/prompts": "^2.4.9",
"@types/ws": "^8.5.14"
"@types/ws": "^8.5.14",
"vitest": "^3.0.5"
}
}
38 changes: 38 additions & 0 deletions create-onchain/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// biome-ignore lint/correctness/noNodejsModules: Needed for vite resolving
import path from 'node:path';
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
env: {
TZ: 'UTC',
},
coverage: {
include: ["src/**/*.ts"],
exclude: [
"src/manifest/**",
'create-onchain/dist/**',
'**/*.d.ts',
'node_modules/**',
],
reportOnFailure: true,
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
alias: {
'@': path.resolve(__dirname, './src'),
},
environment: 'jsdom',
exclude: [
"src/manifest/**",
'create-onchain/dist/**',
'**/*.d.ts',
'node_modules/**',
],
globals: true,
},
});
Loading

0 comments on commit 4a9c2a4

Please sign in to comment.