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
22 changes: 12 additions & 10 deletions .github/workflows/test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Suite
name: CI

on:
push:
Expand All @@ -7,28 +7,30 @@ on:
branches: [main, develop]

jobs:
test:
ci:
name: Build, Test & Lint (Node.js 20.x)
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
- name: Enable Corepack
run: corepack enable

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

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build packages
run: yarn build
run: |
yarn workspace @subzilla/types run build
yarn workspace @subzilla/core run build
yarn workspace @subzilla/cli run build

- name: Run type checking
run: yarn type-check
Expand Down
48 changes: 48 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Dependencies
node_modules/
.yarn/
yarn-error.log
yarn.lock

# Build output
dist/
**/dist/
*.tsbuildinfo

# Test coverage
coverage/
**/coverage/

# Generated type definitions
*.d.ts
**/*.d.ts

# IDE and editor files
.vscode/
.idea/
*.swp
*.swo

# OS files
.DS_Store
Thumbs.db

# Environment variables
.env*
.env.local
.env.*.local

# Development files
dummy/

# Build artifacts
*.log
*.cache

# Package manager
.pnp.*
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz

Binary file modified .yarn/install-state.gz
Binary file not shown.
29 changes: 29 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ module.exports = [
prev: '*',
next: 'break',
},
{
blankLine: 'always',
prev: '*',
next: 'continue',
},
{
blankLine: 'always',
prev: '*',
Expand Down Expand Up @@ -179,6 +184,30 @@ module.exports = [
],
},
},
{
// Test files: Relaxed import ordering for testing priorities
files: [
'**/*.test.ts',
'**/*.test.tsx',
'**/*.spec.ts',
'**/*.spec.tsx',
'**/jest.setup.ts',
'**/jest.setup.tsx',
'**/setup-tests.ts',
'**/setup-tests.tsx',
],
plugins: {
import: importPlugin,
},
rules: {
// Disable strict import ordering for test files
'import/order': 'off',
// Allow var declarations in test files
'no-var': 'off',
// Allow empty functions in test files (useful for mocks and stubs)
'@typescript-eslint/no-empty-function': 'off',
},
},
{
// Browser/Renderer JavaScript files (Electron renderer process)
files: ['packages/mac/src/renderer/**/*.js'],
Expand Down
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ module.exports = {
// Setup files for CLI tests
setupFilesAfterEnv: ['<rootDir>/packages/cli/jest.setup.ts'],
},
{
displayName: 'mac',
testMatch: ['<rootDir>/packages/mac/__tests__/**/*.test.ts'],
preset: 'ts-jest',
testEnvironment: 'node',
moduleNameMapper: {
'^@subzilla/types$': '<rootDir>/packages/types/src',
'^@subzilla/core$': '<rootDir>/packages/core/src',
'^@subzilla/mac/(.*)$': '<rootDir>/packages/mac/src/$1',
},
setupFiles: ['<rootDir>/packages/mac/__tests__/jest.setup.js'],
},
],

// Global settings
Expand Down
17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,19 @@
"format": "yarn workspaces foreach --all run format",
"format:check": "yarn workspaces foreach --all run format:check",
"prettify": "prettier --write \"**/*.{ts,js,json,md,yml,yaml}\" --ignore-path .gitignore",
"clean": "yarn workspaces foreach --all exec rm -rf dist && rm -rf dist"
"clean": "yarn workspaces foreach --all exec rm -rf dist && rm -rf dist",
"prepare": "husky"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"prettier --write",
"eslint --fix"
],
"*.{json,md,yml,yaml}": [
"prettier --write"
]
},
"packageManager": "yarn@4.9.4",
"keywords": [
"subtitle",
"converter",
Expand Down Expand Up @@ -54,5 +65,9 @@
"prettier": "^3.6.2",
"ts-jest": "^29.4.1",
"typescript": "^5.9.2"
},
"dependencies": {
"husky": "^9.1.7",
"lint-staged": "^16.2.6"
}
}
Loading