Skip to content

Commit

Permalink
Merge pull request #1 from justcoded/feat/LK-13133-setup-plop-docker
Browse files Browse the repository at this point in the history
feat/LK-13133-setup-plop-docker
  • Loading branch information
jcapovkh authored Oct 21, 2024
2 parents c11fb61 + fd0870d commit 76120c4
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

# tabs 4 spaces for makefiles
[Makefile]
indent_size = 4
indent_style = tab
[*.mk]
indent_size = 4
indent_style = tab
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# phpstorm/netbeans/eclipse project files
.idea
.vscode
nbproject
.buildpath
.project
.settings

# windows/Mac thumbnail cache
Thumbs.db
.DS_Store
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--- BEGIN HEADER -->
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---
<!--- END HEADER -->

## [0.1.0](https://github.com/justcoded/dockerize-plop-js/compare/c11fb61e0409ea1d33490caa0d420a7768bd1286...v1.0.0) (2024-10-18)
### Features

* :building_construction: add docker & plop files
* :memo: add changelog-config

### Bug Fixes

* :memo: plop console info


---

13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:22.6.0

RUN mkdir /plop
RUN mkdir /codebase
RUN npm install -g plop tsx cross-env typescript
COPY ./plop/* /plop


CMD ['npm', 'run', 'plop']
SHELL ["/bin/bash", "-c"]

WORKDIR /plop

25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.PHONY: default chl chl-first

default:
@echo 'Plop helper from JustCoded'

##
# CHANGELOG vars and targets
##
CONV_CHL_IMAGE := justcoded/php-conventional-changelog:latest
CONV_CHL_DR := docker run -it --rm --volume "$$PWD":/codebase ${CONV_CHL_IMAGE} bash
CONV_CHL_CMD := conventional-changelog --config changelog-config.php

##
# @command chl Generate changelog based on conventional commits
##
chl:
${CONV_CHL_DR} \
-c "${CONV_CHL_CMD}"

##
# @command chl-first Generate changelog based on conventional commits, first version
##
chl-first:
${CONV_CHL_DR} \
-c "${CONV_CHL_CMD} --first-release"
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# dockerize-plop-js
# Dockerized Plop Repository

This repository provides a Dockerized setup for [Plop.js](https://plopjs.com/), a micro-generator framework that helps you automate the creation of files and components in your projects.

## Features

- **Dockerized Environment**: Run Plop.js in a containerized environment.

## Getting Started

### Prerequisites

- Docker installed on your machine.

### Usage

1. **Run the Docker image**:
You can use the local image name for now, or once finalized, use the public image URL provided by GitHub Actions:
```bash
docker run --rm -it plop_plop
```
18 changes: 18 additions & 0 deletions changelog-config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* @see: https://github.com/marcocesarato/php-conventional-changelog/blob/main/docs/config.md
*/

return [
'path' => 'CHANGELOG.md',
'headerTitle' => 'Changelog',
'headerDescription' => 'All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
---',
'ignoreTypes' => ['build', 'chore', 'ci', 'docs', 'perf', 'refactor', 'revert', 'style', 'test', 'bug'],

'hiddenHash' => true,
];
5 changes: 5 additions & 0 deletions plop/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"scripts": {
"plop": "cross-env NODE_OPTIONS='--import tsx' plop --plopfile=plopfile.ts"
}
}
16 changes: 16 additions & 0 deletions plop/plopfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { NodePlopAPI } from 'plop';


export default function (plop: NodePlopAPI) {
plop.setGenerator('Show README', {
description: 'Show the content of README.md',
actions: [
() => {
console.log(`
No real generators available. \n
To use docker image, mount your plopfile sources in /plop directory.`
);
}
]
});
}

0 comments on commit 76120c4

Please sign in to comment.