diff --git a/.changeset/cyan-dryers-deny.md b/.changeset/cyan-dryers-deny.md new file mode 100644 index 0000000..c6de4b3 --- /dev/null +++ b/.changeset/cyan-dryers-deny.md @@ -0,0 +1,5 @@ +--- +'@dfsync/client': patch +--- + +update LICENSE url diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..06780ea --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,44 @@ +--- +name: Bug report +about: Report a problem with dfsync +title: '[bug] ' +labels: bug +--- + +--- + +## Description + +A clear and concise description of the bug. + +## Reproduction + +Steps to reproduce the behavior. + +Example: + +1. create client +2. send request +3. observe unexpected behavior + +## Expected behavior + +What did you expect to happen? + +## Environment + +Please provide: + +- Node.js version +- dfsync version +- OS + +Example: + +Node.js: 20.x +dfsync: 0.x +OS: macOS / Linux / Windows + +## Additional context + +Add any other context, logs, or screenshots if relevant. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..9db98dc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,28 @@ +--- +name: Feature request +about: Suggest a new feature for dfsync +title: '[feature] ' +labels: enhancement +--- + +--- + +## Problem + +What problem are you trying to solve? + +Example: + +"I want to handle request retries differently..." + +## Proposed solution + +Describe the solution you would like to see. + +## Alternatives considered + +Describe alternative solutions you considered. + +## Additional context + +Add any other context or examples. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..fe82a2b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,38 @@ +# Pull Request + +## Description + +Please describe the changes in this pull request. + +What does this PR do and why? + +--- + +## Type of change + +Please mark relevant options: + +- [ ] Bug fix +- [ ] New feature +- [ ] Documentation update +- [ ] Refactoring +- [ ] Other + +--- + +## Checklist + +Before submitting, please confirm: + +- [ ] Code builds successfully +- [ ] Tests pass (`pnpm test`) +- [ ] Lint passes (`pnpm lint`) +- [ ] Type check passes (`pnpm typecheck`) +- [ ] Documentation updated if needed +- [ ] Changeset added (if package behavior changed) + +--- + +## Additional notes + +Add any additional information if needed. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..85905ca --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,62 @@ +# Code of Conduct + +## Our Pledge + +We as contributors and maintainers pledge to make participation in the **dfsync** community a respectful and harassment-free experience for everyone. + +We are committed to creating a welcoming, inclusive, and professional environment. + +--- + +## Our Standards + +Examples of behavior that contributes to a positive environment include: + +- being respectful and considerate +- welcoming new contributors +- giving and accepting constructive feedback +- focusing on what is best for the project +- communicating professionally + +Examples of unacceptable behavior include: + +- harassment or discrimination of any kind +- insulting or derogatory comments +- trolling or disruptive behavior +- publishing private information without permission +- any conduct that could reasonably be considered inappropriate in a professional environment + +--- + +## Scope + +This Code of Conduct applies to all project spaces, including: + +- GitHub issues +- pull requests +- discussions +- project documentation +- community interactions related to the project + +--- + +## Enforcement + +Project maintainers are responsible for clarifying and enforcing acceptable behavior. + +Maintainers may remove or reject comments, commits, code, issues, and other contributions that are not aligned with this Code of Conduct. + +--- + +## Reporting Issues + +If you experience or witness unacceptable behavior, please report it to the project maintainers. + +All reports will be reviewed and handled appropriately. + +--- + +## Attribution + +This Code of Conduct is inspired by the Contributor Covenant +https://www.contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a42d0be --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,214 @@ +# Contributing to dfsync + +Thank you for your interest in contributing to **dfsync**. + +dfsync is an open-source TypeScript library focused on **reliable HTTP communication between services**. +We welcome contributions that improve stability, developer experience, documentation, and examples. + +--- + +# Ways to Contribute + +You can contribute by: + +- fixing bugs +- improving documentation +- adding examples +- improving test coverage +- suggesting new features +- improving developer experience + +Small and focused pull requests are preferred. + +--- + +# Before You Start + +Before opening a pull request: + +1. Check existing **issues** and **pull requests** +2. For larger changes, consider opening an **issue** first +3. For small fixes (docs, typos, tests), feel free to open a PR directly + +--- + +# Project Structure + +This repository uses a **pnpm monorepo**. + +``` +packages/ + client/ main dfsync HTTP client package + +examples/ + node-basic/ basic usage example + +smoke/ + */ smoke tests verifying published packages +``` + +The main library lives in: + +``` +packages/client +``` + +--- + +# Local Development + +Clone the repository: + +```bash +git clone https://github.com/dfsyncjs/dfsync.git +cd dfsync +``` + +Install dependencies: + +```bash +pnpm install +``` + +Build the project: + +```bash +pnpm build +``` + +Run tests: + +```bash +pnpm test +``` + +Run lint: + +```bash +pnpm lint +``` + +Type checking: + +```bash +pnpm typecheck +``` + +--- + +# Coding Guidelines + +Please follow these principles: + +- Use **TypeScript** +- Keep the public API **minimal and predictable** +- Prefer **small focused changes** +- Avoid breaking public APIs without discussion +- Keep code readable and maintainable + +--- + +# Tests + +If your change affects behavior: + +- add or update tests +- ensure **all tests pass** + +Tests are run using **Vitest**. + +Run locally: + +```bash +pnpm test +``` + +--- + +# Documentation + +If your change affects the public API, please update: + +- README +- documentation +- examples (if necessary) + +Examples should remain **simple and runnable**. + +--- + +# Changesets and Releases + +This project uses **changesets** for release management. + +If your change affects the published package: + +```bash +pnpm changeset +``` + +Examples when a changeset is required: + +- new features +- bug fixes +- API changes + +Documentation-only changes usually **do not require a changeset**. + +## How to verify the package before release + +Before publishing `@dfsync/client`, run the standard test suite and the pack smoke checks. + +### 1. Run the regular checks + +```bash +pnpm test +``` + +### 2. Verify the published package shape + +These checks build the package, create a tarball with pnpm pack, install that tarball into isolated smoke projects, and verify that the package works as expected. + +```bash +pnpm smoke:pack +``` + +This command runs: + +- `pnpm smoke:pack:esm` — verifies ESM import from the packed tarball +- `pnpm smoke:pack:cjs` — verifies CommonJS `require()` from the packed tarball +- `pnpm smoke:pack:types` — verifies TypeScript types from the packed tarball + +### Why this matters + +Examples in the monorepo validate local workspace usage, but the pack smoke tests validate the actual publish artifact that users install from npm. This helps catch issues with: + +- `dist` output +- `exports` +- CommonJS / ESM entry points +- published type definitions + +--- + +# Pull Requests + +When submitting a PR: + +- create a branch from `main` +- keep PRs small and focused +- provide a clear description of the change +- explain **why the change is needed** + +Before submitting, ensure the following commands succeed: + +```bash +pnpm lint +pnpm typecheck +pnpm test +``` + +--- + +# Thank You + +Your contributions help make **dfsync** better for everyone. diff --git a/LICENSE b/LICENSE index 18e7ddd..9514dea 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2026 dfsync +Copyright (c) 2026 dfsync contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 97005e8..16f33da 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ pnpm install A lightweight HTTP client designed for service-to-service communication. -Features: +Main features: - typed responses - request timeout support @@ -54,7 +54,7 @@ const client = createClient({ const users = await client.get('/users'); ``` -View on npm: +NPM: [https://www.npmjs.com/package/@dfsync/client](https://www.npmjs.com/package/@dfsync/client) Home page: @@ -62,60 +62,15 @@ Home page: ## Project Structure -```bash -packages/ - client/ HTTP client implementation -``` - -## Development +This repository uses a **pnpm monorepo**. -Install dependencies: - -```bash -pnpm install -``` - -Run tests: - -```bash -pnpm test -``` - -Build packages: - -```bash -pnpm build ``` +packages/ + client/ main dfsync HTTP client package -## How to verify the package before release - -Before publishing `@dfsync/client`, run the standard test suite and the pack smoke checks. - -### 1. Run the regular checks - -```bash -pnpm test -``` - -### 2. Verify the published package shape - -These checks build the package, create a tarball with pnpm pack, install that tarball into isolated smoke projects, and verify that the package works as expected. +examples/ + node-basic/ basic usage example -```bash -pnpm smoke:pack +smoke/ + */ smoke tests verifying published packages ``` - -This command runs: - -- `pnpm smoke:pack:esm` — verifies ESM import from the packed tarball -- `pnpm smoke:pack:cjs` — verifies CommonJS `require()` from the packed tarball -- `pnpm smoke:pack:types` — verifies TypeScript types from the packed tarball - -### Why this matters - -Examples in the monorepo validate local workspace usage, but the pack smoke tests validate the actual publish artifact that users install from npm. This helps catch issues with: - -- `dist` output -- `exports` -- CommonJS / ESM entry points -- published type definitions diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..11f44b1 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,32 @@ +# Security Policy + +## Reporting a Vulnerability + +If you discover a security vulnerability in **dfsync**, please report it responsibly. + +Do **not** open a public GitHub issue for security vulnerabilities. + +Instead, please report the issue privately to the project maintainers. + +You may report vulnerabilities by: + +- opening a **GitHub Security Advisory** +- contacting the maintainers privately if contact information is available + +We will investigate all reports and respond as quickly as possible. + +--- + +## Supported Versions + +The **latest released version** of dfsync is currently supported. + +Older versions may not receive security updates. + +--- + +## Responsible Disclosure + +Please allow maintainers time to investigate and fix the issue before publicly disclosing the vulnerability. + +Responsible disclosure helps keep the ecosystem safe for everyone. diff --git a/packages/client/README.md b/packages/client/README.md index c744ca4..5296668 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -1,9 +1,10 @@ # @dfsync/client [![npm version](https://img.shields.io/npm/v/@dfsync/client.svg)](https://www.npmjs.com/package/@dfsync/client) +![TypeScript](https://img.shields.io/badge/TypeScript-ready-blue) [![npm downloads](https://img.shields.io/npm/dm/@dfsync/client.svg)](https://www.npmjs.com/package/@dfsync/client) [![CI](https://github.com/dfsyncjs/dfsync/actions/workflows/ci.yml/badge.svg)](https://github.com/dfsyncjs/dfsync/actions/workflows/ci.yml) -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/dfsyncjs/dfsync/blob/main/LICENSE) Reliable service-to-service HTTP communication for Node.js and TypeScript.