Skip to content

Commit

Permalink
Merge pull request #2 from murage-poc/main
Browse files Browse the repository at this point in the history
Feat: redoing first release all over again!
  • Loading branch information
Murage authored Oct 24, 2024
2 parents d413a32 + 99e84d5 commit bc400e8
Show file tree
Hide file tree
Showing 21 changed files with 3,492 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/semantic-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
push:
branches:
- release

jobs:
semantic_release:
runs-on:
- ubuntu-latest

steps:
- name: Set up git
env:
GH_TOKEN: ${{ github.token }}
run: |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: false

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'pnpm'

- name: Install dependencies # Install only the dependencies required for the release which are at root.
run: pnpm install --workspace-root --prod=false

- name: Run automated version
run: pnpm run release
env:
RELEASE_SCM_BASE: ${{github.event.before}} # the base is commit before merge
24 changes: 24 additions & 0 deletions apps/countopia/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
2 changes: 2 additions & 0 deletions apps/countopia/.release-it.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* eslint-disable @typescript-eslint/no-require-imports */
module.exports = require('@kala/release-it-config');
18 changes: 18 additions & 0 deletions apps/countopia/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Countopia|Home</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="app">
<h1>Counter: <span id="counter">0</span></h1>
<button id="increment">Increment</button>
<button id="decrement">Decrement</button>
<button id="reset">Reset</button>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions apps/countopia/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "countopia",
"description": "A simple vite project",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"release": "release-it --ci"
},
"devDependencies": {
"@kala/release-it-config": "workspace:*",
"typescript": "~5.6.2",
"vite": "^5.4.9"
}
}
16 changes: 16 additions & 0 deletions apps/countopia/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Countopia

A simple counter app built with Vite and TypeScript; where counting never stops.


### How to set up development environment
1. Install the dependencies
```shell
pnpm install
```

2. Start the development server
```shell
pnpm run dev
```

33 changes: 33 additions & 0 deletions apps/countopia/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import './style.css'
// src/main.ts

let count: number = 0;

const counterDisplay: HTMLElement | null = document.getElementById('counter');
const incrementButton: HTMLElement | null = document.getElementById('increment');
const decrementButton: HTMLElement | null = document.getElementById('decrement');
const resetButton: HTMLElement | null = document.getElementById('reset');

function updateDisplay(): void {
if (counterDisplay) {
counterDisplay.textContent = count.toString();
}
}

incrementButton?.addEventListener('click', () => {
count++;
updateDisplay();
});

decrementButton?.addEventListener('click', () => {
count--;
updateDisplay();
});

resetButton?.addEventListener('click', () => {
count = 0;
updateDisplay();
});

// Initialize the display
updateDisplay();
67 changes: 67 additions & 0 deletions apps/countopia/src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #625f5fbf;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}


body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}


#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

}


button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}

button:hover {
border-color: #646cff;
}

button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}

button {
background-color: #f9f9f9;
}
}
1 change: 1 addition & 0 deletions apps/countopia/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
24 changes: 24 additions & 0 deletions apps/countopia/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src"]
}
9 changes: 9 additions & 0 deletions apps/quote-oasis/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.idea/
.vscode/
venv
.env
__pycache__

*.pyc
*.pyo
*.pyd
2 changes: 2 additions & 0 deletions apps/quote-oasis/.release-it.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* eslint-disable @typescript-eslint/no-require-imports */
module.exports = require('@kala/release-it-config');
24 changes: 24 additions & 0 deletions apps/quote-oasis/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import random
from flask import Flask

app = Flask(__name__)


quotes = [
"The best way to predict the future is to invent it.",
"Life is what happens when you're busy making other plans.",
"You only live once, but if you do it right, once is enough.",
"In the end, we will remember not the words of our enemies, but the silence of our friends.",
"To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.",
]


@app.route("/")
def home():
quote = random.choice(quotes)
# Probably add bell and whistles to the quote here 😋😋
return quote


if __name__ == "__main__":
app.run(debug=True)
16 changes: 16 additions & 0 deletions apps/quote-oasis/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "quote-oasis",
"version": "1.0.0",
"description": "Dive into world of random quotes",
"type": "module",
"scripts": {
"preinstall": "python3 -m venv venv",
"install": "source venv/bin/activate && pip install -r requirements.txt",
"dev": "source venv/bin/activate && python app.py",
"release": "release-it --ci"
},
"license": "MIT",
"devDependencies": {
"@kala/release-it-config": "workspace:*"
}
}
42 changes: 42 additions & 0 deletions apps/quote-oasis/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Quote Oasis

A simple web application built with **Flask** that returns a random quote each time the page is visited.

This project showcases how release-it can be used with non-JavaScript apps.

## Prerequisites
- Python 3.12 (ensure `python3` is in your path)

### Setting Up Local Development Environment (Easier Way)
1. Install dependencies if not done yet:
```shell
pnpm install
```
This will create a virtual environment and install dependencies.

2. Start the local development server:
```shell
pnpm run dev
```

### Setting Up Local Development Environment (Long Version)
1. Create a virtual environment if it does not exist:
```shell
python3 -m venv ./venv
```

2. Activate the virtual environment:
```shell
source ./venv/bin/activate
```
Use the same shell for the following commands.

3. Install the project requirements:
```shell
pip install -r requirements.txt
```

4. Start the server:
```shell
python app.py
```
9 changes: 9 additions & 0 deletions apps/quote-oasis/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
blinker==1.8.2
click==8.1.7
Flask==3.0.3
importlib_metadata==8.5.0
itsdangerous==2.2.0
Jinja2==3.1.4
MarkupSafe==3.0.2
Werkzeug==3.0.4
zipp==3.20.2
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
"type": "module",
"description": "People will come for miles to see you burn",
"scripts": {
"release": "pnpm --recursive --workspace-concurrency 1 release"
},
"keywords": [],
"license": "MIT"
"license": "MIT",
"packageManager": "[email protected]+sha512.38dc6fba8dba35b39340b9700112c2fe1e12f10b17134715a4aa98ccf7bb035e76fd981cf0bb384dfa98f8d6af5481c2bef2f4266a24bfa20c34eb7147ce0b5e",
"devDependencies": {
"@release-it/conventional-changelog": "^9.0.1",
"release-it": "^17.10.0"
}
}
Loading

0 comments on commit bc400e8

Please sign in to comment.