release version system

This commit is contained in:
ThatOneCalculator 2023-01-03 17:38:07 -08:00
parent f4e2e5febf
commit ebc8ac76de
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
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)
[![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)
[![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/)
</div>

View File

@ -1,6 +1,6 @@
{
"name": "calckey",
"version": "13.0.6",
"version": "13.0.8",
"codename": "aqua",
"repository": {
"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___latestVersion from './endpoints/latest-version.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___requestResetPassword from './endpoints/request-reset-password.js';
import * as ep___resetDb from './endpoints/reset-db.js';
@ -610,6 +611,7 @@ const eps = [
['custom-splash-icons', ep___customSplashIcons],
['latest-version', ep___latestVersion],
['patrons', ep___patrons],
['release', ep___release],
['promo/read', ep___promo_read],
['request-reset-password', ep___requestResetPassword],
['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="title"><MkSparkle>{{ i18n.ts.misskeyUpdated }}</MkSparkle></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>
</div>
</MkModal>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import MkModal from '@/components/MkModal.vue';
import MkButton from '@/components/MkButton.vue';
import MkSparkle from '@/components/MkSparkle.vue';
import MkButton from '@/components/MkButton.vue';
import { version } from '@/config';
import { i18n } from '@/i18n';
import * as os from '@/os';
const modal = ref<InstanceType<typeof MkModal>>();
const whatIsNew = () => {
modal.value.close();
window.open('https://codeberg.org/calckey/calckey/releases', '_blank');
};
const data = await os.api('release');
const newRelease = (version === data.version);
</script>
<style lang="scss" scoped>
@ -47,5 +48,12 @@ const whatIsNew = () => {
> .gotIt {
margin: 8px 0 0 0;
}
> .releaseNotes {
> img {
border-radius: 10px;
}
}
}
</style>

View File

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

View File

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

View File

@ -257,7 +257,7 @@ export const defaultStore = markRaw(new Storage('base', {
},
showUpdates: {
where: 'device',
default: false,
default: true,
},
swipeOnDesktop: {
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": []
}