generated from axetroy/go-cli-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add changelog repl. generate changelog online almose done.
- Loading branch information
Showing
21 changed files
with
3,135 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,5 @@ | |
bin | ||
dist | ||
coverage.out | ||
release.md | ||
release.md | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_API_HOST=http://localhost:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_API_HOST=https://whatchanged.herokuapp.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
.DS_Store | ||
dist | ||
*.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Changelog REPL</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "changelog-repl", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build" | ||
}, | ||
"dependencies": { | ||
"ant-design-vue": "^2.0.0-rc.1", | ||
"marked": "^1.2.5", | ||
"vue": "^3.x" | ||
}, | ||
"devDependencies": { | ||
"@types/marked": "^1.2.0", | ||
"@vue/compiler-sfc": "^3.0.2", | ||
"import-http": "^0.3.1", | ||
"rollup-plugin-esm-import-to-url": "^2.1.0", | ||
"sass": "^1.29.0", | ||
"vite": "^1.0.0-rc.9" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<template> | ||
<div> | ||
<div class="toolbar"> | ||
<a-form | ||
layout="inline" | ||
:model="form" | ||
@submit="onSubmit" | ||
@submit.native.prevent | ||
> | ||
<a-form-item label="Username"> | ||
<a-input v-model:value="form.username"> </a-input> | ||
</a-form-item> | ||
<a-form-item label="Repo"> | ||
<a-input v-model:value="form.repo"> </a-input> | ||
</a-form-item> | ||
<a-form-item label="Version"> | ||
<a-input v-model:value="form.version"> </a-input> | ||
</a-form-item> | ||
<a-form-item> | ||
<a-button type="primary" html-type="submit" :loading="loading"> | ||
Generate | ||
</a-button> | ||
</a-form-item> | ||
</a-form> | ||
</div> | ||
<div class="container"> | ||
<div class="left"> | ||
<div style="display: flex; height: 100%; padding-left: 10px"> | ||
<CodeMirror | ||
class="my-editor2" | ||
:content.sync="template" | ||
@update:content="template = $event" | ||
:readonly="true" | ||
/> | ||
</div> | ||
</div> | ||
<div class="right"> | ||
<Render :content="content"></Render> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { defineComponent } from "vue"; | ||
import Render from "./components/Render.vue"; | ||
import CodeMirror from "./components/CodeMirror.vue"; | ||
import TEMPLATE_DEFAULT from "./template/default"; | ||
export default defineComponent({ | ||
name: "App", | ||
components: { | ||
Render, | ||
CodeMirror, | ||
}, | ||
data() { | ||
return { | ||
loading: false, | ||
template: TEMPLATE_DEFAULT, | ||
content: "", | ||
form: { | ||
username: "axetroy", | ||
repo: "vscode-deno", | ||
version: "HEAD~", | ||
}, | ||
}; | ||
}, | ||
methods: { | ||
onSubmit() { | ||
const template = encodeURIComponent(this.template); | ||
this.loading = true; | ||
fetch( | ||
`${import.meta.env.VITE_API_HOST}/?username=${ | ||
this.form.username || "" | ||
}&repo=${this.form.repo || ""}&version=${ | ||
this.form.version || "" | ||
}&template=${template || ""}` | ||
) | ||
.then((res) => { | ||
return res.text(); | ||
}) | ||
.then((markdown) => { | ||
this.content = markdown; | ||
}) | ||
.finally(() => { | ||
this.loading = false; | ||
}); | ||
}, | ||
}, | ||
}); | ||
</script> | ||
<style lang="scss" scoped> | ||
$height: 60px; | ||
.toolbar { | ||
height: $height; | ||
background: yellow; | ||
display: flex; | ||
align-items: center; | ||
padding: 0 10px; | ||
} | ||
.container { | ||
display: flex; | ||
height: calc(100vh - #{$height}); | ||
width: 100vw; | ||
.left { | ||
// background-color: green; | ||
flex: 1; | ||
overflow: scroll; | ||
border-right: 1px solid #e2e2; | ||
} | ||
.right { | ||
// background-color: red; | ||
flex: 1; | ||
overflow: hidden; | ||
} | ||
} | ||
</style> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.