Skip to content

Commit

Permalink
docs(ts): add development.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pplmx committed Aug 28, 2024
1 parent 0e3da2b commit 7bfcc5e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 53 deletions.
2 changes: 1 addition & 1 deletion template/ts/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"github_username": "your-org-or-username",


"python_version": "3.10",
"node_version": "18",


"__gh_slug": "{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}",
Expand Down
40 changes: 23 additions & 17 deletions template/ts/{{cookiecutter.project_slug}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![CI](https://github.com/{{cookiecutter.__gh_slug}}/workflows/CI/badge.svg)](https://github.com/{{cookiecutter.__gh_slug}}/actions)
[![Coverage Status](https://coveralls.io/repos/github/{{cookiecutter.__gh_slug}}/badge.svg?branch=main)](https://coveralls.io/github/{{cookiecutter.__gh_slug}}?branch=main)
[![PyPI version](https://badge.fury.io/py/{{cookiecutter.project_slug}}.svg)](https://badge.fury.io/py/{{cookiecutter.project_slug}})
[![Python Versions](https://img.shields.io/pypi/pyversions/{{cookiecutter.project_slug}}.svg)](https://pypi.org/project/{{cookiecutter.project_slug}}/)
[![NPM version](https://badge.fury.io/js/{{cookiecutter.project_slug}}.svg)](https://badge.fury.io/js/{{cookiecutter.project_slug}})
[![Node Version](https://img.shields.io/node/v/{{cookiecutter.project_slug}}.svg)](https://nodejs.org/en/)

## Table of Contents

Expand All @@ -22,7 +22,7 @@

## Overview

`{{cookiecutter.project_slug}}` is a Python project designed to [brief description of the project's main purpose or functionality]. This project aims to [explain the primary goals or problems it solves].
`{{cookiecutter.project_slug}}` is a TypeScript project designed to [brief description of the project's main purpose or functionality]. This project aims to [explain the primary goals or problems it solves].

## Features

Expand All @@ -33,42 +33,48 @@

## Quick Start

```python
import {{cookiecutter.project_slug}}
```typescript
import { doSomething } from '{{cookiecutter.project_slug}}';

# Example usage
result = {{cookiecutter.project_slug}}.do_something()
print(result)
// Example usage
const result = doSomething();
console.log(result);

# Add more examples showcasing key features
// Add more examples showcasing key features
```

## Installation

### Requirements
- Python {{cookiecutter.python_version}}+
- Node.js {{cookiecutter.node_version}}+
- Dependencies:
- [Dependency 1]: [version] - [brief description or purpose]
- [Dependency 2]: [version] - [brief description or purpose]
- [Add more dependencies as needed]

### User Installation
Install `{{cookiecutter.project_slug}}` using pip:
Install `{{cookiecutter.project_slug}}` using npm:

```bash
pip install {{cookiecutter.project_slug}}
npm install {{cookiecutter.project_slug}}
```

Or using yarn:

```bash
yarn add {{cookiecutter.project_slug}}
```

## Usage

Here's a brief overview of basic usage:

```python
import {{cookiecutter.project_slug}}
```typescript
import { doSomething } from '{{cookiecutter.project_slug}}';

# Example usage
result = {{cookiecutter.project_slug}}.do_something()
print(result)
// Example usage
const result = doSomething();
console.log(result);

```

Expand Down
70 changes: 35 additions & 35 deletions template/ts/{{cookiecutter.project_slug}}/docs/development.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Development Guide for {{cookiecutter.project_slug}}

Welcome to the development guide for `{{cookiecutter.project_slug}}`!
This document will walk you through setting up your development environment, running tests, building the project, and maintaining code quality.
Welcome to the development guide for `{{cookiecutter.project_slug}}`! This document will guide you through setting up your development environment, running tests, building the project, and maintaining code quality.

## Table of Contents

- [Setting Up the Development Environment](#setting-up-the-development-environment)
- [Prerequisites](#prerequisites)
- [Installation Steps](#installation-steps)
- [Prerequisites](#prerequisites)
- [Installation Steps](#installation-steps)
- [Running Tests](#running-tests)
- [Building the Project](#building-the-project)
- [Code Style and Linting](#code-style-and-linting)
Expand All @@ -16,27 +15,20 @@ This document will walk you through setting up your development environment, run

### Prerequisites

Before you start, make sure you have the following installed on your system:
Before you begin, make sure you have the following installed on your system:

- **Python {{cookiecutter.python_version}}+**: Ensure you have the correct version of Python. You can check your Python version with:
- **Node.js {{cookiecutter.node_version}}+**: Ensure you have the correct version of Node.js. You can check your Node.js version with:

```bash
python --version
```

- **`uv` tool**: This tool helps manage your Python environment.

- **macOS and Linux**:

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```
```bash
node --version
```

- **Windows**:
- **npm or yarn**: A package manager is required to install dependencies. You can check if you have npm or yarn installed with:

```bash
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
```
```bash
npm --version
yarn --version
```

### Installation Steps

Expand All @@ -47,46 +39,54 @@ Before you start, make sure you have the following installed on your system:
cd {{cookiecutter.project_slug}}
```

2. **Initialize the Development Environment**: This command sets up a virtual environment and installs all necessary dependencies.
2. **Install Dependencies**: Use npm or yarn to install all necessary dependencies:

```bash
make init
npm install
# or
yarn install
```

This step will also install any pre-commit hooks, ensuring your code adheres to the project’s coding standards before each commit.
This step will also set up any pre-commit hooks defined in the project, ensuring your code adheres to the project’s coding standards.

## Running Tests

Tests are crucial to ensure the stability of the project. To run all tests, use the following command:
Running tests is crucial to ensure the stability of the project. To run all tests, use the following command:

```bash
make test
npm test
# or
yarn test
```

This command will execute the test suite using `pytest`, ensuring all components work as expected.
This command will execute the test suite using `jest`, ensuring all components work as expected.

[Consider adding specific details on the structure of tests, testing strategy, or how to add new tests.]
[You may include additional details on the testing framework, testing strategy, or how to add new tests.]

## Building the Project

To build the project and create a distributable package, use:
To build the project and generate the compiled JavaScript files, use:

```bash
make build
npm run build
# or
yarn build
```

This command will generate a `.whl` file in the `dist` directory, which can be used to distribute and install the project.
This command will compile the TypeScript files into JavaScript and place them in the `dist` directory.

## Code Style and Linting

Maintaining consistent code style is essential. We use `ruff` for linting and formatting. To check for any style issues, run:
Maintaining consistent code style is essential. We use `biome` for linting and formatting. To check for any style issues and automatically fix them, run:

```bash
make ruff
npm run lint
# or
yarn lint
```

This command will automatically check and optionally fix any code style issues according to the project's style guide.
This command will check the codebase for any style issues and ensure that all code follows the project's style guide.
---
By following this guide, you'll be well on your way to contributing to `{{cookiecutter.project_slug}}`. Thank you for your efforts in maintaining and improving this project!
By following this guide, you'll be well-prepared to contribute to `{{cookiecutter.project_slug}}`. Thank you for helping maintain and improve this project!

0 comments on commit 7bfcc5e

Please sign in to comment.