release version system

This commit is contained in:
ThatOneCalculator 2023-01-03 17:38:07 -08:00
parent 819db1c0aa
commit 0db6550efc
9 changed files with 53 additions and 13 deletions

View File

@ -10,6 +10,7 @@
[![liberapay-badge](https://img.shields.io/liberapay/receives/ThatOneCalculator?logo=liberapay)](https://liberapay.com/ThatOneCalculator) [![liberapay-badge](https://img.shields.io/liberapay/receives/ThatOneCalculator?logo=liberapay)](https://liberapay.com/ThatOneCalculator)
[![translate-badge](https://hosted.weblate.org/widgets/calckey/-/svg-badge.svg)](https://hosted.weblate.org/engage/calckey/) [![translate-badge](https://hosted.weblate.org/widgets/calckey/-/svg-badge.svg)](https://hosted.weblate.org/engage/calckey/)
[![docker-badge](https://img.shields.io/docker/pulls/thatonecalculator/calckey?logo=docker)](https://hub.docker.com/r/thatonecalculator/calckey) [![docker-badge](https://img.shields.io/docker/pulls/thatonecalculator/calckey?logo=docker)](https://hub.docker.com/r/thatonecalculator/calckey)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](./CODE_OF_CONDUCT.md)
[![codeberg-badge](https://custom-icon-badges.demolab.com/badge/hosted%20on-codeberg-blue.svg?logo=codeberg&logoColor=white)](https://codeberg.org/calckey/calckey/) [![codeberg-badge](https://custom-icon-badges.demolab.com/badge/hosted%20on-codeberg-blue.svg?logo=codeberg&logoColor=white)](https://codeberg.org/calckey/calckey/)
</div> </div>

View File

@ -1,6 +1,6 @@
{ {
"name": "calckey", "name": "calckey",
"version": "13.0.6", "version": "13.0.8",
"codename": "aqua", "codename": "aqua",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -277,6 +277,7 @@ import * as ep___customMOTD from './endpoints/custom-motd.js';
import * as ep___customSplashIcons from './endpoints/custom-splash-icons.js'; import * as ep___customSplashIcons from './endpoints/custom-splash-icons.js';
import * as ep___latestVersion from './endpoints/latest-version.js'; import * as ep___latestVersion from './endpoints/latest-version.js';
import * as ep___patrons from './endpoints/patrons.js'; import * as ep___patrons from './endpoints/patrons.js';
import * as ep___release from './endpoints/release.js';
import * as ep___promo_read from './endpoints/promo/read.js'; import * as ep___promo_read from './endpoints/promo/read.js';
import * as ep___requestResetPassword from './endpoints/request-reset-password.js'; import * as ep___requestResetPassword from './endpoints/request-reset-password.js';
import * as ep___resetDb from './endpoints/reset-db.js'; import * as ep___resetDb from './endpoints/reset-db.js';
@ -610,6 +611,7 @@ const eps = [
['custom-splash-icons', ep___customSplashIcons], ['custom-splash-icons', ep___customSplashIcons],
['latest-version', ep___latestVersion], ['latest-version', ep___latestVersion],
['patrons', ep___patrons], ['patrons', ep___patrons],
['release', ep___release],
['promo/read', ep___promo_read], ['promo/read', ep___promo_read],
['request-reset-password', ep___requestResetPassword], ['request-reset-password', ep___requestResetPassword],
['reset-db', ep___resetDb], ['reset-db', ep___resetDb],

View File

@ -0,0 +1,24 @@
import define from '../define.js';
export const meta = {
tags: ['meta'],
description: 'Get release notes from Codeberg',
requireCredential: false,
requireCredentialPrivateMode: false,
} as const;
export const paramDef = {
type: 'object',
properties: {},
required: [],
} as const;
// eslint-disable-next-line import/no-default-export
export default define(meta, paramDef, async () => {
await fetch('https://codeberg.org/calckey/calckey/raw/branch/develop/release.json')
.then((response) => response.json())
.then((data) => {
return data;
});
});

View File

@ -3,26 +3,27 @@
<div class="ewlycnyt"> <div class="ewlycnyt">
<div class="title"><MkSparkle>{{ i18n.ts.misskeyUpdated }}</MkSparkle></div> <div class="title"><MkSparkle>{{ i18n.ts.misskeyUpdated }}</MkSparkle></div>
<div class="version"> {{ version }} 🚀</div> <div class="version"> {{ version }} 🚀</div>
<MkButton full @click="whatIsNew">{{ i18n.ts.whatIsNew }}</MkButton> <div v-if="newRelease" class="releaseNotes">
<Mfm :text="data.notes"/>
<div v-if="data.screenshots.length > 0" style="max-width: 500">
<img v-for="i in data.screenshots" :key="i" :src="i"/>
</div>
</div>
<MkButton class="gotIt" primary full @click="$refs.modal.close()">{{ i18n.ts.gotIt }}</MkButton> <MkButton class="gotIt" primary full @click="$refs.modal.close()">{{ i18n.ts.gotIt }}</MkButton>
</div> </div>
</MkModal> </MkModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue';
import MkModal from '@/components/MkModal.vue'; import MkModal from '@/components/MkModal.vue';
import MkButton from '@/components/MkButton.vue';
import MkSparkle from '@/components/MkSparkle.vue'; import MkSparkle from '@/components/MkSparkle.vue';
import MkButton from '@/components/MkButton.vue';
import { version } from '@/config'; import { version } from '@/config';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import * as os from '@/os';
const modal = ref<InstanceType<typeof MkModal>>(); const data = await os.api('release');
const newRelease = (version === data.version);
const whatIsNew = () => {
modal.value.close();
window.open('https://codeberg.org/calckey/calckey/releases', '_blank');
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -47,5 +48,12 @@ const whatIsNew = () => {
> .gotIt { > .gotIt {
margin: 8px 0 0 0; margin: 8px 0 0 0;
} }
> .releaseNotes {
> img {
border-radius: 10px;
}
}
} }
</style> </style>

View File

@ -84,7 +84,7 @@ const containerEl = $ref<HTMLElement>();
function iconLoaded() { function iconLoaded() {
const emojis = defaultStore.state.reactions; const emojis = defaultStore.state.reactions;
const containerWidth = containerEl.offsetWidth; const containerWidth = containerEl?.offsetWidth;
for (let i = 0; i < 32; i++) { for (let i = 0; i < 32; i++) {
easterEggEmojis.push({ easterEggEmojis.push({
id: i.toString(), id: i.toString(),

View File

@ -33,7 +33,7 @@ async function init() {
function save() { function save() {
os.apiWithDialog('admin/update-meta', { os.apiWithDialog('admin/update-meta', {
blockedHosts: blockedHosts.split('\n') || [], blockedHosts: blockedHosts.split('\n').map(h => h.trim()) || [],
}).then(() => { }).then(() => {
fetchInstance(); fetchInstance();
}); });

View File

@ -257,7 +257,7 @@ export const defaultStore = markRaw(new Storage('base', {
}, },
showUpdates: { showUpdates: {
where: 'device', where: 'device',
default: false, default: true,
}, },
swipeOnDesktop: { swipeOnDesktop: {
where: 'device', where: 'device',

5
release.json Normal file
View File

@ -0,0 +1,5 @@
{
"version": "13.0.8",
"notes": "$[jelly Happy new year!] This release includes many changes, including:\n- New post layout\n- Automatic subdomain blocks\n- Notes are now called posts\n- Many bug fixes and performance improvements",
"screenshots": []
}