Skip to content

Commit

Permalink
add readme and dot files
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasSovre committed Dec 18, 2024
1 parent 8881ba6 commit 17ed421
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
]
}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
lib
cache
testReal/*js
src/**/*.js
.env
.idea
cov
docs
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore artifacts:
lib
coverage
node_modules
*.sh
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": false,
"bracketSpacing": true,
"arrowParens": "always"
}
84 changes: 84 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,86 @@
# compose-craft-lib

A TypeScript library for working with Docker Compose configurations, providing strong typing and easy manipulation of Docker Compose data structures.

## Overview

`compose-craft-lib` is a powerful TypeScript library designed to simplify working with Docker Compose configurations. It offers:
- Strong TypeScript typing for Docker Compose structures
- Easy creation and manipulation of compose configurations
- Translation between different representation formats
- Intuitive, object-oriented approach to defining services and configurations

## Features

- Type-safe Docker Compose configuration management
- Support for creating and modifying services, images, and port mappings
- Translator design pattern for flexible configuration handling
- Comprehensive type definitions

## Installation

Install the library using npm:

```bash
npm install @composecraft/docker-compose-lib
```

Or using yarn:

```bash
yarn add @composecraft/docker-compose-lib
```

Or using pnpm:

```bash
pnpm add @composecraft/docker-compose-lib
```

## Usage Examples

### Basic Composition Creation

```typescript
import { Compose, Service, Image, PortMapping, Translator } from "@composecraft/docker-compose-lib"
import { stringify } from "yaml";

// Create a new Compose configuration
const compose = new Compose({name: "demo"});

// Define a web service
const webService = new Service({
name: "web",
image: new Image({ name: "nginx" }),
ports: [new PortMapping({ hostPort: 80, containerPort: 80 })],
});

// Add the service to the composition
compose.addService(webService);

// Translate to a dictionary and convert to YAML
const translator = new Translator(compose);
const yamlConfig = stringify(translator.toDict());
```

## API Documentation

For detailed API documentation, please visit the [official documentation](https://composecraft.github.io/docker-compose-lib).

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

Distributed under the MIT License. See `LICENSE` for more information.

## Contact

Project Link: [https://github.com/composecraft/docker-compose-lib](https://github.com/composecraft/docker-compose-lib)

0 comments on commit 17ed421

Please sign in to comment.