feat: add changelog to app

Merge branch 'changelog-in-app'

fix #16
This commit is contained in:
Yanick Champoux 2022-04-17 17:51:58 -04:00
commit 2bc8766cce
7 changed files with 144 additions and 30 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ package-lock.json
.temp .temp
node_modules/ node_modules/
dist/yarn-error.log dist/yarn-error.log
.task/

View File

@ -1,4 +1,7 @@
{ {
"scripts": {
"postchangelog": "gotask changelog"
},
"types": [ "types": [
{ "type": "feat", "section": "Features" }, { "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Bug Fixes" }, { "type": "fix", "section": "Bug Fixes" },

22
Taskfile.yml Normal file
View File

@ -0,0 +1,22 @@
# https://taskfile.dev
version: "3"
vars:
GREETING: Hello, World!
tasks:
release:
cmds:
- standard-version -a
changelog:
sources: [CHANGELOG.md]
generates: [src/lib/components/Changelog.svelte]
cmds:
- pnpx showdown makehtml -i CHANGELOG.md -o src/lib/components/Changelog.svelte
- git add src/lib/components/Changelog.svelte
default:
cmds:
- echo "{{.GREETING}}"
silent: true

View File

@ -25,6 +25,7 @@
"eslint-plugin-svelte3": "^3.4.1", "eslint-plugin-svelte3": "^3.4.1",
"prettier": "~2.5.1", "prettier": "~2.5.1",
"prettier-plugin-svelte": "^2.6.0", "prettier-plugin-svelte": "^2.6.0",
"showdown": "^2.0.3",
"standard-version": "^9.3.2", "standard-version": "^9.3.2",
"storybook-builder-vite": "0.1.21", "storybook-builder-vite": "0.1.21",
"svelte": "^3.46.4", "svelte": "^3.46.4",

View File

@ -1,8 +1,19 @@
<Card> {#if showChangelog}
<Card>
<h2 slot="header">Changelog for the Docks</h2>
<div class="changelog">
<Changelog />
</div>
</Card>
{:else}
<Card>
<div slot="header" class="header"> <div slot="header" class="header">
<h2>Welcome to the docks</h2> <h2>Welcome to the docks</h2>
<p class="version">version {import.meta.env.PACKAGE_VERSION}</p> <div class="version">
<div>version {import.meta.env.PACKAGE_VERSION}</div>
<a on:click={() => (showChangelog = true)}>changelog</a>
</div>
</div> </div>
<p> <p>
@ -20,9 +31,9 @@
</p> </p>
<p> <p>
The app is mostly developed for Firefox. I also check as much as I can that The app is mostly developed for Firefox. I also check as much as I can
I don't mess things too badly on Chrome. For the other browsers... caveat that I don't mess things too badly on Chrome. For the other browsers...
emptor. caveat emptor.
</p> </p>
<p> <p>
@ -31,10 +42,14 @@
. Code available on . Code available on
<a href="https://github.com/aotds/aotds-shipyard">Github</a>. <a href="https://github.com/aotds/aotds-shipyard">Github</a>.
</p> </p>
</Card> </Card>
{/if}
<script> <script>
import { Modal, Card } from "svelte-chota"; import { Modal, Card } from "svelte-chota";
import Changelog from "./Changelog.svelte";
let showChangelog = false;
</script> </script>
<style> <style>
@ -46,13 +61,32 @@
.header { .header {
margin-bottom: 1em; margin-bottom: 1em;
display: flex; display: flex;
align-items: baseline; align-items: center;
} }
p { p {
margin-left: 2em; margin-left: 2em;
} }
.version { .version {
flex: 1; flex: 1;
text-align: right; text-align: right;
} }
.changelog :global(h1),
:global(h1 + p) {
display: none;
}
.changelog :global(h2) {
font-size: var(--font-scale-12);
font-family: Faktos;
}
.changelog :global(h3) {
font-size: var(--font-scale-12);
font-family: Faktos;
}
.version a {
display: inline-block;
}
</style> </style>

View File

@ -0,0 +1,15 @@
<Meta title="Changelog" component={Changelog} argTypes={{}} />
<Story name="Primary" args={{}} />
<Template let:args>
<div style="width: 50em">
<Changelog />
</div>
</Template>
<script>
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
import Changelog from "./Changelog.svelte";
</script>

View File

@ -0,0 +1,38 @@
<h1 id="changelog">Changelog</h1>
<p>
All notable changes to this project will be documented in this file. See <a
href="https://github.com/conventional-changelog/standard-version"
>standard-version</a
> for commit guidelines.
</p>
<h2 id="230comparev220v23020220417">
<a href="///compare/v2.2.0…v2.3.0">2.3.0</a> (2022-04-17)
</h2>
<h3 id="features">Features</h3>
<ul>
<li>
<p>
add 'reset ship' button [GH<a
href="undefined/undefined/undefined/issues/15">#15</a
>] 49fc8d5
</p>
</li>
<li><p>add version to About component 919f286, closes #6</p></li>
<li><p><strong>release:</strong> 2.3.0 4d10119</p></li>
</ul>
<h2 id="220comparev210v22020220411">
<a href="///compare/v2.1.0…v2.2.0">2.2.0</a> (2022-04-11)
</h2>
<h3 id="features-1">Features</h3>
<ul>
<li>allow to edit the print layout 381d497</li>
</ul>
<h2 id="210comparev200v21020220407">
<a href="///compare/v2.0.0…v2.1.0">2.1.0</a> (2022-04-07)
</h2>
<h3 id="features-2">Features</h3>
<ul>
<li><p>add localStorage memory bf7206a</p></li>
<li><p>can move main system comps in the print output b425f4a</p></li>
<li><p>add standard-version 2fd047f</p></li>
</ul>