Skip to content

Commit

Permalink
Add vuejs template
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirrezaNasiri committed Dec 16, 2023
1 parent 29f85f0 commit 0f6f7e8
Show file tree
Hide file tree
Showing 38 changed files with 1,281 additions and 2 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/vuejs-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Integration tests
on:
push:
branches:
- 'main'
pull_request:
types: [opened, synchronize, reopened]
branches:
- 'main'
paths:
- 'vuejs/**'
- '.github/workflows/vuejs-ci.yaml'

env:
GOLANG_VERSION: '1.20'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
prepare-template:
name: Prepare Cookiecutter Template
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Cookiecutter
run: pip install cookiecutter
- name: Run Cookiecutter
run: cookiecutter --no-input -o $(pwd)/.data/ $(pwd)/vuejs/
- name: Temporarily save cookiecutter output
uses: actions/upload-artifact@v2
with:
name: vuejs-src
path: .data/MyVueJSApp
retention-days: 1

test-image-functionality:
name: Test Image
runs-on: ubuntu-22.04
needs: prepare-template
steps:
- name: Retrieve saved cookiecutter output
uses: actions/download-artifact@v2
with:
name: vuejs-src
path: .data/MyVueJSApp
- name: Build and export to Docker
uses: docker/build-push-action@v4
with:
context: .data/MyVueJSApp
load: true
tags: app:test
- name: Test container structure
uses: plexsystems/container-structure-test-action@cc689017bbb16a3c98e6e87b0e07f92ad35a9df1
with:
image: app:test
config: .data/MyVueJSApp/container-structure-test.yaml
- name: Run integration test
working-directory: .data/MyVueJSApp
run: |
docker run -p 8080:80 app:test &
sleep 1
response=$(curl --connect-timeout 10 http://0.0.0.0:8080)
if [[ $response != *"<title>MyVueJSApp</title>"* ]]; then
exit 1
fi
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,19 @@ golang-local-scaffold:
&& rm -rf "$$OUT" \
&& cookiecutter --no-input -o $$OUT $$(pwd)/golang/ \
&& cd $$OUT_PROJECT \
&& go get \
&& echo "" && echo "🌿 Output: $$OUT_PROJECT"
&& printf "\n\n🌿 Templating Done. Now you can run:\n\ncd $$OUT_PROJECT\ngo get\ngo run main.go\n"

vuejs-local-scaffold:
export OUT=$$(pwd)/.tmp/vuejs \
&& export OUT_PROJECT=$$OUT/MyVueJSApp \
&& echo "$$OUT" \
&& rm -rf "$$OUT" \
&& cookiecutter --no-input -o $$OUT $$(pwd)/vuejs/ \
&& cd $$OUT_PROJECT \
&& printf "\n\n🌿 Templating Done. Now you can run:\n\ncd $$OUT_PROJECT\nnpm install\nnpm run dev\n"

act-golang-ci:
act -W .github/workflows/golang-ci.yaml --artifact-server-path /tmp/artifacts

act-vuejs-ci:
act -W .github/workflows/vuejs-ci.yaml --artifact-server-path /tmp/artifacts
7 changes: 7 additions & 0 deletions vuejs/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"app_name": "MyVueJSApp",
"repository_name": "my-vuejs-app",
"description": "Project description goes here ...",
"organization_name": "PashmakGuru",
"repository_email": "nasiri.amirreza.96@gmail.com"
}
6 changes: 6 additions & 0 deletions vuejs/{{cookiecutter.app_name}}/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
README.md
docker-compose.yml
Dockerfile
.github
.gitignore
.git
15 changes: 15 additions & 0 deletions vuejs/{{cookiecutter.app_name}}/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
parserOptions: {
ecmaVersion: 'latest'
}
}
128 changes: 128 additions & 0 deletions vuejs/{{cookiecutter.app_name}}/.github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[{{cookiecutter.repository_email}}](mailto:cookiecutter.repository_email).
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
61 changes: 61 additions & 0 deletions vuejs/{{cookiecutter.app_name}}/.github/CONTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Contributing to [Project Name]

Thank you for your interest in contributing to [Project Name]! We welcome contributions from the community to make our project better. Before you get started, please take a moment to read this guide to understand how you can contribute.

## Table of Contents

1. [Getting Started](#getting-started)
2. [Code of Conduct](#code-of-conduct)
3. [How to Contribute](#how-to-contribute)
- [Reporting Bugs](#reporting-bugs)
- [Requesting Features](#requesting-features)
- [Submitting Pull Requests](#submitting-pull-requests)
4. [Development Setup](#development-setup)
5. [Coding Guidelines](#coding-guidelines)
6. [Commit Guidelines](#commit-guidelines)
7. [License](#license)

## Getting Started

- **[GitHub Repository](https://github.com/{{cookiecutter.organization_name}}/{{cookiecutter.repository_name}})**: Visit the repository to find the latest source code and documentation.

- **[Issue Tracker](https://github.com/{{cookiecutter.organization_name}}/{{cookiecutter.repository_name}}/issues)**: Check out the existing issues to see if there's something you'd like to work on or report a new issue.

## Code of Conduct

Please review our [Code of Conduct](CODE_OF_CONDUCT.md) to understand our expectations for contributors.

## How to Contribute

### Reporting Bugs

If you encounter a bug, please open an issue on the [Issue Tracker](https://github.com/{{cookiecutter.organization_name}}/{{cookiecutter.repository_name}}/issues) with a clear and detailed description of the problem. Include steps to reproduce the issue if possible.

### Requesting Features

If you have an idea for a new feature or enhancement, please open an issue on the [Issue Tracker](https://github.com/{{cookiecutter.organization_name}}/{{cookiecutter.repository_name}}/issues) and describe your proposed feature or enhancement. We welcome community input and will consider your ideas.

### Submitting Pull Requests

1. Fork the repository to your GitHub account.
2. Clone your forked repository to your local machine.
3. Create a new branch for your contribution: `git checkout -b feature/your-feature`.
4. Make your changes and commit them with clear and concise messages.
5. Push your branch to your forked repository: `git push origin feature/your-feature`.
6. Create a pull request (PR) on the [GitHub repository](https://github.com/{{cookiecutter.organization_name}}/{{cookiecutter.repository_name}}) with a clear title and description.

Our maintainers will review your PR, provide feedback, and work with you to merge it once it's ready.

## Coding Guidelines

Please review our [Coding Guidelines](CODING_GUIDELINES.md) to ensure your code adheres to our standards.

## Commit Guidelines

We follow [conventional commit messages](https://www.conventionalcommits.org/) for our commit messages. Please use descriptive and meaningful commit messages.

## License

By contributing to this project, you agree that your contributions will be licensed under the [LICENSE](LICENSE.md) of the project.

Thank you for considering contributing to {{cookiecutter.app_name}}! Your contributions help make this project better for everyone.
Loading

0 comments on commit 0f6f7e8

Please sign in to comment.