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
48 changes: 48 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest

# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
contents: read

# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
cache: true

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Cache dependencies
run: deno install
81 changes: 81 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Croner - Agent Guide

## Project Overview

Croner is a lightweight, zero-dependency cron library for JavaScript and TypeScript that works across Node.js, Deno, Bun, and browsers.

## Project Structure

```
croner/
├── src/ # Source code
│ ├── croner.ts # Main entry point
│ ├── pattern.ts # Cron pattern parser
│ ├── date.ts # Date handling utilities
│ ├── options.ts # Configuration options
│ └── helpers/ # Helper utilities
├── test/ # Test files
│ ├── croner.test.ts
│ ├── pattern.test.ts
│ ├── options.test.ts
│ ├── range.test.ts
│ ├── stepping.test.ts
│ └── timezone.test.ts
├── build/ # Build scripts
├── docs/ # Documentation
└── deno.json # Deno configuration and tasks
```

## Standards Compliance

This project aims to follow the **OCPS (Open Cron Pattern Standard)** drafts available at [github.com/open-source-cron/ocps](https://github.com/open-source-cron/ocps).

## Development Environment

The project uses **Deno** as the primary development runtime, with cross-runtime support for Node.js and Bun.

### Setup
```bash
# Install Deno dependencies
deno install
```

## Contribution Guidelines

### Pre-commit Checks

Before committing changes, always run:
```bash
deno task pre-commit
```

This executes:
- **Formatting check**: `deno fmt --check` - ensures code follows style guidelines
- **Linting**: `deno lint` - checks for code quality issues
- **Type checking**: `deno check src/croner.ts` - validates TypeScript types

### Testing

Run tests during development:
```bash
deno task test
```

### Full Build

Before submitting a PR, run the full build to ensure all checks pass:
```bash
deno task build
```

This runs all tests, builds distribution files, and validates the entire codebase.

### Key Points

- Base work on the `dev` branch
- Add test cases for all changes
- Zero dependencies - do not add external dependencies
- Follow existing code style and patterns
- Update documentation if changing public APIs

For detailed contribution guidelines, see [docs/src/contributing.md](docs/src/contributing.md).
Loading