Initialize Next.js

This commit is contained in:
AkiraFukushima 2023-11-02 01:20:27 +09:00
parent edaff50416
commit 9e228ede32
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
325 changed files with 1703 additions and 48778 deletions

View File

@ -1,55 +0,0 @@
{
"comments": false,
"env": {
"test": {
"presets": [
["@babel/preset-env", {
"targets": { "node": 10 }
}]
],
"plugins": [
"istanbul",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime"
]
},
"main": {
"presets": [
["@babel/preset-env", {
"targets": { "node": 10 }
}]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime"
]
},
"renderer": {
"presets": [
["@babel/preset-env", {
"modules": false,
"targets": { "electron": "6" }
}]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime"
]
},
"web": {
"presets": [
["@babel/preset-env", {
"modules": false
}]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime"
]
}
}
}

View File

@ -1,95 +0,0 @@
'use strict'
process.env.NODE_ENV = 'production'
const { say } = require('cfonts')
const chalk = require('chalk')
const del = require('del')
const { spawn } = require('child_process')
const webpack = require('webpack')
const Listr = require('listr')
const mainConfig = require('./webpack.main.config')
const rendererConfig = require('./webpack.renderer.config')
const doneLog = chalk.bgGreen.white(' DONE ') + ' '
const errorLog = chalk.bgRed.white(' ERROR ') + ' '
const okayLog = chalk.bgBlue.white(' OKAY ') + ' '
const isCI = process.env.CI || false
if (process.env.BUILD_TARGET === 'clean') clean()
else build()
function clean() {
del.sync(['build/*', '!build/icons', '!build/icons/icon.*', '!build/sounds', '!build/sounds/*', '!build/notarize.js'])
del.sync(['packages/*', '!packages/universal.js', '!packages/packager.js', "!packages/socialwhalebirdapp_MAS.provisionprofile"])
console.log(`\n${doneLog}\n`)
process.exit()
}
async function build() {
del.sync(['dist/electron/*', '!.gitkeep'])
let results = ''
const tasks = new Listr(
[
{
title: 'building master process',
task: async () => {
await pack(mainConfig).catch(err => {
console.log(`\n ${errorLog}failed to build main process`)
console.error(`\n${err}\n`)
})
}
},
{
title: 'building renderer process',
task: async () => {
await pack(rendererConfig).catch(err => {
console.log(`\n ${errorLog}failed to build renderer process`)
console.error(`\n${err}\n`)
})
}
}
],
{ concurrent: 2 }
)
await tasks
.run()
.then(() => {
process.stdout.write('\x1B[2J\x1B[0f')
console.log(`\n\n${results}`)
process.exit()
})
.catch(err => {
process.exit(1)
})
}
function pack(config) {
return new Promise((resolve, reject) => {
config.mode = 'production'
webpack(config, (err, stats) => {
if (err) reject(err.stack || err)
else if (stats.hasErrors()) {
let err = ''
stats
.toString({
chunks: false,
colors: true
})
.split(/\r?\n/)
.forEach(line => {
err += ` ${line}\n`
})
reject(err)
} else {
resolve(null)
}
})
})
}

View File

@ -1,40 +0,0 @@
const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
hotClient.subscribe(event => {
/**
* Reload browser when HTMLWebpackPlugin emits a new index.html
*
* Currently disabled until jantimon/html-webpack-plugin#680 is resolved.
* https://github.com/SimulatedGREG/electron-vue/issues/437
* https://github.com/jantimon/html-webpack-plugin/issues/680
*/
// if (event.action === 'reload') {
// window.location.reload()
// }
/**
* Notify `mainWindow` when `main` process is compiling,
* giving notice for an expected reload of the `electron` process
*/
if (event.action === 'compiling') {
document.body.innerHTML += `
<style>
#dev-client {
background: #4fc08d;
border-radius: 4px;
bottom: 20px;
box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
color: #fff;
font-family: 'Source Sans Pro', sans-serif;
left: 20px;
padding: 8px 12px;
position: absolute;
}
</style>
<div id="dev-client">
Compiling Main Process...
</div>
`
}
})

View File

@ -1,177 +0,0 @@
'use strict'
const clc = require('cli-color')
const electron = require('electron')
const path = require('path')
const { say } = require('cfonts')
const { spawn } = require('child_process')
const webpack = require('webpack')
const WebpackDevServer = require('webpack-dev-server')
const webpackHotMiddleware = require('webpack-hot-middleware')
const mainConfig = require('./webpack.main.config')
const rendererConfig = require('./webpack.renderer.config')
let electronProcess = null
let manualRestart = false
let hotMiddleware
function logStats(proc, data) {
let log = ''
log += clc.yellow.bold(`${proc} Process ${new Array(19 - proc.length + 1).join('-')}`)
log += '\n\n'
if (typeof data === 'object') {
data
.toString({
colors: true,
chunks: false
})
.split(/\r?\n/)
.forEach(line => {
log += ' ' + line + '\n'
})
} else {
log += ` ${data}\n`
}
log += '\n' + clc.yellow.bold(`${new Array(28 + 1).join('-')}`) + '\n'
console.log(log)
}
function startRenderer() {
return new Promise((resolve, reject) => {
rendererConfig.entry.renderer = [path.join(__dirname, 'dev-client')].concat(rendererConfig.entry.renderer)
rendererConfig.mode = 'development'
const compiler = webpack(rendererConfig)
hotMiddleware = webpackHotMiddleware(compiler, {
log: false,
heartbeat: 2500
})
compiler.hooks.compilation.tap('compilation', compilation => {
const HtmlWebpackPlugin = require('html-webpack-plugin')
HtmlWebpackPlugin.getHooks(compilation).afterEmit.tapAsync('html-webpack-plugin-after-emit', (data, cb) => {
hotMiddleware.publish({ action: 'reload' })
cb()
})
})
compiler.hooks.done.tap('done', stats => {
logStats('Renderer', stats)
})
const server = new WebpackDevServer(
{
static: {
directory: path.resolve(__dirname, '../')
},
setupMiddlewares: function (middlewares, devServer) {
middlewares.unshift(hotMiddleware)
devServer.middleware.waitUntilValid(() => {
resolve()
})
return middlewares
},
port: 9080
},
compiler
)
server.start()
})
}
function startMain() {
return new Promise((resolve, reject) => {
mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.ts')].concat(mainConfig.entry.main)
mainConfig.mode = 'development'
const compiler = webpack(mainConfig)
compiler.hooks.watchRun.tapAsync('watch-run', (compilation, done) => {
logStats('Main', clc.white.bold('compiling...'))
hotMiddleware.publish({ action: 'compiling' })
done()
})
compiler.watch({}, (err, stats) => {
if (err) {
console.log(err)
return
}
logStats('Main', stats)
resolve()
})
})
}
function startElectron() {
var args = ['--inspect=5858', path.join(__dirname, '../dist/electron/main.js')]
// detect yarn or npm and process commandline args accordingly
if (process.env.npm_execpath.endsWith('yarn.js')) {
args = args.concat(process.argv.slice(3))
} else if (process.env.npm_execpath.endsWith('npm-cli.js')) {
args = args.concat(process.argv.slice(2))
}
electronProcess = spawn(electron, args)
electronProcess.stdout.on('data', data => {
electronLog(data, 'blue')
})
electronProcess.stderr.on('data', data => {
electronLog(data, 'red')
})
electronProcess.on('close', () => {
if (!manualRestart) process.exit()
})
}
function electronLog(data, color) {
let log = ''
data = data.toString().split(/\r?\n/)
data.forEach(line => {
log += ` ${line}\n`
})
if (/[0-9A-z]+/.test(log)) {
console.log(clc[color].bold('┏ Electron -------------------') + '\n\n' + log + clc[color].bold('┗ ----------------------------') + '\n')
}
}
function greeting() {
const cols = process.stdout.columns
let text = ''
if (cols > 104) text = 'electron-vue'
else if (cols > 76) text = 'electron-|vue'
else text = false
if (text) {
say(text, {
colors: ['yellow'],
font: 'simple3d',
space: false
})
} else console.log(clc.yellow.bold('\n electron-vue'))
console.log(clc.blue(' getting ready...') + '\n')
}
function init() {
greeting()
Promise.all([startRenderer(), startMain()])
.then(() => {
startElectron()
})
.catch(err => {
console.error(err)
})
}
init()

View File

@ -1,105 +0,0 @@
'use strict'
process.env.BABEL_ENV = 'main'
const path = require('path')
const { dependencies } = require('../package.json')
const webpack = require('webpack')
const CopyWebpackPlugin = require('copy-webpack-plugin')
let mainConfig = {
entry: {
main: path.join(__dirname, '../src/main/index.ts'),
preload: path.join(__dirname, '../src/main/preload.js')
},
externals: [...Object.keys(dependencies || {})],
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true
}
}
]
},
{
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.node$/,
use: 'node-loader'
},
{
test: /\.json$/,
exclude: /node_modules/,
use: 'json-loader',
type: 'javascript/auto'
}
]
},
node: {
__dirname: process.env.NODE_ENV !== 'production',
__filename: process.env.NODE_ENV !== 'production'
},
output: {
filename: '[name].js',
libraryTarget: 'commonjs2',
path: path.join(__dirname, '../dist/electron')
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, '../src/config/locales'),
to: path.join(__dirname, '../dist/electron/locales'),
globOptions: {
ignore: ['.*', '*~']
}
}
]
})
],
resolve: {
alias: {
// Same as tsconfig.json
'@': path.join(__dirname, '../src/renderer'),
'~': path.join(__dirname, '../')
},
extensions: ['.js', '.json', '.node', '.ts']
},
target: 'electron-main'
}
/**
* Adjust mainConfig for development settings
*/
if (process.env.NODE_ENV !== 'production') {
mainConfig.plugins.push(
new webpack.DefinePlugin({
__static: `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
})
)
}
/**
* Adjust mainConfig for production settings
*/
if (process.env.NODE_ENV === 'production') {
mainConfig.mode = 'production'
mainConfig.plugins.push(
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
})
)
}
module.exports = mainConfig

View File

@ -1,262 +0,0 @@
'use strict'
process.env.BABEL_ENV = 'renderer'
const path = require('path')
const { dependencies } = require('../package.json')
const webpack = require('webpack')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { VueLoaderPlugin } = require('vue-loader')
let rendererConfig = {
entry: {
renderer: path.join(__dirname, '../src/renderer/main.ts')
},
module: {
rules: [
{
test: /\.m?js$/,
resolve: {
fullySpecified: false
}
},
{
test: /\.vue$/,
use: {
loader: 'vue-loader',
options: {
extractCSS: process.env.NODE_ENV === 'production',
esModule: true,
optimizeSSR: false
}
}
},
{
test: /\.scss$/,
use: [
'vue-style-loader',
{
loader: 'css-loader',
options: {
modules: false,
esModule: false
}
},
'sass-loader'
]
},
{
test: /\.sass$/,
use: [
'vue-style-loader',
{
loader: 'css-loader',
options: {
modules: false,
esModule: false
}
},
'sass-loader?indentedSyntax'
]
},
{
test: /\.less$/,
use: [
'vue-style-loader',
{
loader: 'css-loader',
options: {
modules: false,
esModule: false
}
},
'less-loader'
]
},
{
test: /\.css$/,
use: [
'vue-style-loader',
{
loader: 'css-loader',
options: {
modules: false,
esModule: false
}
}
]
},
{
test: /\.html$/,
use: 'vue-html-loader'
},
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader?cacheDirectory'
},
{
loader: 'ts-loader',
options: {
appendTsSuffixTo: [/\.vue$/],
transpileOnly: true
}
}
]
},
{
test: /\.js$/,
use: 'babel-loader?cacheDirectory',
exclude: /node_modules/
},
{
test: /\.node$/,
use: 'node-loader'
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
use: {
loader: 'url-loader',
options: {
limit: 10000,
name: 'imgs/[name]--[folder].[ext]',
esModule: false
}
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: 'media/[name]--[folder].[ext]'
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
use: {
loader: 'url-loader',
options: {
limit: 10000,
name: 'fonts/[name]--[folder].[ext]'
}
}
},
{
test: /\.json$/,
exclude: /node_modules/,
use: 'json-loader',
type: 'javascript/auto'
}
]
},
node: {
__dirname: process.env.NODE_ENV !== 'production',
__filename: process.env.NODE_ENV !== 'production'
},
devServer: {
hot: true,
hotOnly: true
},
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin({ filename: 'styles.css' }),
new HtmlWebpackPlugin({
filename: 'index.html',
template: path.resolve(__dirname, '../src/index.ejs'),
minify: {
collapseWhitespace: true,
removeAttributeQuotes: true,
removeComments: true
},
nodeModules: process.env.NODE_ENV !== 'production' ? path.resolve(__dirname, '../node_modules') : false
}),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
'process.browser': true,
'process.env.NODE_DEBUG': false
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer']
}),
new webpack.ProvidePlugin({
process: 'process/browser'
})
],
output: {
filename: '[name].js',
path: path.join(__dirname, '../dist/electron')
},
resolve: {
alias: {
// Same as tsconfig.json
'@': path.join(__dirname, '../src/renderer'),
'~': path.join(__dirname, '../')
},
extensions: ['.ts', '.js', '.vue', '.json', '.css', '.node'],
fallback: {
timers: require.resolve('timers-browserify'),
url: require.resolve('url/'),
assert: require.resolve('assert/'),
buffer: require.resolve('buffer/'),
os: require.resolve('os-browserify/browser'),
path: require.resolve('path-browserify'),
crypto: require.resolve('crypto-browserify'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
stream: require.resolve('stream-browserify'),
zlib: require.resolve('browserify-zlib'),
net: false,
tls: false,
fs: false,
dns: false
}
},
target: 'web'
}
/**
* Adjust rendererConfig for development settings
*/
if (process.env.NODE_ENV !== 'production') {
rendererConfig.plugins.push(
new webpack.DefinePlugin({
__static: `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
})
)
rendererConfig.devtool = 'eval-cheap-module-source-map'
}
/**
* Adjust rendererConfig for production settings
*/
if (process.env.NODE_ENV === 'production') {
rendererConfig.mode = 'production'
rendererConfig.plugins.push(
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/electron/static'),
globOptions: {
ignore: ['.*', '*~']
}
}
]
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
)
}
module.exports = rendererConfig

View File

@ -1,2 +0,0 @@
node_modules/*
dist/*

View File

@ -1,42 +0,0 @@
module.exports = {
root: true,
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module',
ecmaVersion: 12
},
env: {
browser: true,
node: true,
es2021: true
},
extends: ['eslint:recommended', 'plugin:vue/vue3-recommended', '@vue/typescript/recommended', 'prettier'],
globals: {
__static: true
},
plugins: ['@typescript-eslint', 'vue'],
rules: {
// allow paren-less arrow functions
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_'
}
],
'@typescript-eslint/no-explicit-any': 'off',
camelcase: 'off',
'@typescript-eslint/camelcase': 'off',
'space-before-function-paren': 'off',
'vue/multi-word-component-names': 'off',
'vue/attributes-order': 'off',
'vue/attribute-hyphenation': 'off',
'vue/no-v-html': 'off'
}
}

1
.github/FUNDING.yml vendored
View File

@ -1 +0,0 @@
github: h3poteto

View File

@ -1,22 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
## Description
<!-- A clear and concise description of what the bug is. -->
<!-- Please paste screenshots of the bug if you have. -->
## How To Reproduce
1.
2.
3.
## Your Environment
- OS: [e.g. MacOS]
- Whalebird Version: [e.g. 1.0.0]
- Instance: [e.g. mastodon.social]

View File

@ -1,14 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'feature'
assignees: ''
---
## Describe
<!-- A clear and concise description of what you want to happen. -->
## Why
<!-- Why do you want this feature? -->

View File

@ -1,10 +0,0 @@
---
name: Other request
about: Free format issue template
title: ''
labels: ''
assignees: ''
---

View File

@ -1,8 +0,0 @@
## Description
<!-- Please write a description. For example, why did you change this? -->
## Related Issues
<!-- If there are related issues, please write the issue number. -->
## Appearance
<!-- If you change the appearance, please paste the screenshots. -->

View File

@ -1,33 +0,0 @@
name: Build
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install
run: |
yarn install
- name: typecheck
run: |
yarn run typecheck
- name: Test
run: |
yarn run spec
- name: Compile main
run: |
yarn run pack:main
- name: Compile renderer
run: |
yarn run pack:renderer

View File

@ -1,110 +0,0 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
release-linux:
runs-on: ubuntu-latest
timeout-minutes: 40
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn
- name: Build
run: |
make install
make clean
make build
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
- name: Release
uses: samuelmeuli/action-electron-builder@v1
with:
skip_build: true
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
release-windows:
runs-on: windows-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn
- name: Build
run: |
make install
make clean
make build
- name: Release
uses: samuelmeuli/action-electron-builder@v1
with:
skip_build: true
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
release-macos:
runs-on: macos-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn
- name: Apple Codesigning
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Build
run: |
make install
make clean
make build
- name: Release
uses: samuelmeuli/action-electron-builder@v1
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
ASC_PROVIDER: ${{ secrets.ASC_PROVIDER }}
TEAM_ID: ${{ secrets.ASC_PROVIDER }}
with:
skip_build: true
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}

View File

@ -1,44 +0,0 @@
name: reviewdog
on:
pull_request:
permissions:
pull-requests: write
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install
run: |
yarn install
- uses: reviewdog/action-setup@v1
- name: Run eslint
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
run: |
yarn run lint:eslint | reviewdog -f=eslint -reporter=github-pr-review -fail-on-error=true
stylelint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install
run: |
yarn install
- uses: reviewdog/action-setup@v1
- name: Run stylelint
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
run: |
yarn run lint:stylelint --no-color | reviewdog -f=stylelint -reporter=github-pr-review -level=error -filter-mode=nofilter -fail-on-error=false

View File

@ -1,34 +0,0 @@
name: Thirdparty
on:
schedule:
- cron: '54 10 * * *'
permissions:
contents: write
pull-requests: write
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v4
- name: Install packages
run: |
yarn install
npm install -g license-checker
- name: Check
run: |
yarn run thirdparty
- uses: peter-evans/create-pull-request@v5
with:
commit-message: "[Auto update] Thirdparty libraries list"
branch: auto-update/thirdparty
base: master
delete-branch: true
title: "[Auto update] Thirdparty libraries list"

20
.gitignore vendored
View File

@ -1,15 +1,5 @@
.DS_Store
dist/electron/*
dist/web/*
build/*
!build/icons
coverage
node_modules/
npm-debug.log
npm-debug.log.*
thumbs.db
packages/*
!.gitkeep
*.db
*.provisionprofile
/thirdparty.json
node_modules
*.log
.next
app
dist

1
.npmrc
View File

@ -1 +0,0 @@
@h3poteto:registry=https://npm.pkg.github.com

View File

@ -5,4 +5,4 @@
"printWidth": 140,
"trailingComma": "none",
"arrowParens": "avoid"
}
}

View File

@ -1,5 +0,0 @@
node_modules
dist
build
packages
.electron-vue

View File

@ -1,25 +0,0 @@
{
"extends": ["stylelint-config-html/vue", "stylelint-config-standard", "stylelint-config-prettier"],
"overrides": [
{
"customSyntax": "postcss-scss",
"files": ["**/*.scss"]
}
],
"rules": {
"alpha-value-notation": "number",
"color-function-notation": "legacy",
"color-hex-length": null,
"no-descending-specificity": null,
"no-empty-source": null,
"selector-class-pattern": "^(([a-z][a-zA-Z0-9_]+)|([a-z][a-z0-9]*)(-[a-zA-Z0-9_]+)*)$",
"selector-id-pattern": "^(([a-z][a-zA-Z0-9_]+)|([a-z][a-z0-9]*)(-[a-zA-Z0-9_]+)*)$",
"selector-pseudo-class-no-unknown": [
true,
{
"ignorePseudoClasses": ["deep"]
}
],
"shorthand-property-no-redundant-values": null
}
}

View File

@ -1 +0,0 @@
nodejs 18.18.0

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
* @h3poteto

674
LICENSE
View File

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -1,46 +0,0 @@
.PHONY: all install clean
VERSION = 1.0.0
all: build mac linux win32 win64
install: package.json
yarn install
build: install
yarn run build
mac:
yarn run package:mac
mv build/Whalebird-${VERSION}-mac-x64.dmg build/Whalebird-${VERSION}-darwin-x64.dmg
mv build/Whalebird-${VERSION}-mac-arm64.dmg build/Whalebird-${VERSION}-darwin-arm64.dmg
cd build; shasum -a 256 Whalebird-${VERSION}-darwin-x64.dmg | awk '{ print $1 }' > Whalebird-${VERSION}-darwin-x64.dmg.shasum
cd build; shasum -a 256 Whalebird-${VERSION}-darwin-arm64.dmg | awk '{ print $1 }' > Whalebird-${VERSION}-darwin-arm64.dmg.shasum
mas:
yarn run build:clean
yarn run package:mas
linux:
yarn run package:linux
mv build/Whalebird-${VERSION}-linux-amd64.deb build/Whalebird-${VERSION}-linux-x64.deb
mv build/Whalebird-${VERSION}-linux-x86_64.rpm build/Whalebird-${VERSION}-linux-x64.rpm
mv build/Whalebird-${VERSION}-linux-x86_64.AppImage build/Whalebird-${VERSION}-linux-x64.AppImage
cd build; sha256sum Whalebird-${VERSION}-linux-arm64.tar.bz2 | awk '{ print $1 }' > Whalebird-${VERSION}-linux-arm64.tar.bz2.shasum
cd build; sha256sum Whalebird-${VERSION}-linux-x64.AppImage | awk '{ print $1 }' > Whalebird-${VERSION}-linux-x64.AppImage.shasum
cd build; sha256sum Whalebird-${VERSION}-linux-x64.deb | awk '{ print $1 }' > Whalebird-${VERSION}-linux-x64.deb.shasum
cd build; sha256sum Whalebird-${VERSION}-linux-x64.rpm | awk '{ print $1 }' > Whalebird-${VERSION}-linux-x64.rpm.shasum
cd build; sha256sum Whalebird-${VERSION}-linux-x64.tar.bz2 | awk '{ print $1 }' > Whalebird-${VERSION}-linux-x64.tar.bz2.shasum
win32:
yarn run package:win32
mv build/Whalebird-${VERSION}-win-ia32.exe build/Whalebird-${VERSION}-windows-ia32.exe
cd build; sha256sum Whalebird-${VERSION}-windows-ia32.exe | awk '{ print $1 }' > Whalebird-${VERSION}-windows-ia32.exe.shasum
win64:
yarn run package:win64
mv build/Whalebird-${VERSION}-win-x64.exe build/Whalebird-${VERSION}-windows-x64.exe
cd build; sha256sum Whalebird-${VERSION}-windows-x64.exe | awk '{ print $1 }' > Whalebird-${VERSION}-windows-x64.exe.shasum
clean:
yarn run build:clean

147
README.md
View File

@ -1,135 +1,38 @@
# Whalebird
[![Build](https://github.com/h3poteto/whalebird-desktop/actions/workflows/build.yml/badge.svg)](https://github.com/h3poteto/whalebird-desktop/actions/workflows/build.yml)
[![GitHub release](http://img.shields.io/github/release/h3poteto/whalebird-desktop.svg)](https://github.com/h3poteto/whalebird-desktop/releases)
[![Mac App Store](https://img.shields.io/itunes/v/6445864587)](https://apps.apple.com/us/app/whalebird/id6445864587)
[![AUR version](https://img.shields.io/aur/version/whalebird)](https://aur.archlinux.org/packages/whalebird/)
[![Dependabot](https://img.shields.io/badge/Dependabot-enabled-blue.svg)](https://dependabot.com)
[![Crowdin](https://badges.crowdin.net/whalebird/localized.svg)](https://crowdin.com/project/whalebird)
<p align="center"><img src="https://i.imgur.com/a9QWW0v.png"></p>
## Usage
Whalebird is a Fediverse client app for desktop.
![demo](screenshot.png)
## Feature
- An interface like slack
- Notify to desktop
- Streaming
- Many keyboard shortcuts
- Manage multiple accounts
- Supporting
- Mastodon
- Pleroma
- Friendica
- Firefish
### Shortcuts
<table>
<thead>
<tr><th></th><th>Mac</th><th>Linux, Windows</th></tr>
</thead>
<tbody>
<tr><td> Toot, Reply </td><td> <kbd>Cmd + Enter</kbd> </td><td> <kbd>Ctrl + Enter</kbd> </td></tr>
<tr><td> Change accounts </td><td> <kbd>Cmd + 1, 2, 3...</kbd> </td><td> <kbd>Ctrl + 1, 2, 3...</kbd> </td></tr>
<tr><td> Jump to another timeline </td><td> <kbd>Cmd + k</kbd> </td><td> <kbd>Ctrl + k</kbd> </td></tr>
<tr><td> Reload current timeline </td><td> <kbd>Cmd + r</kbd> </td><td> <kbd>Ctrl + r</kbd> </td></tr>
<tr><td> Select next post </td><td> <kbd>j</kbd> </td><td> <kbd>j</kbd> </td></tr>
<tr><td> Select previous post </td><td> <kbd>k</kbd> </td><td> <kbd>k</kbd> </td></tr>
<tr><td> Reply to the post </td><td> <kbd>r</kbd> </td><td> <kbd>r</kbd> </td></tr>
<tr><td> Reblog the post </td><td> <kbd>b</kbd> </td><td> <kbd>b</kbd> </td></tr>
<tr><td> Favourite the post </td><td> <kbd>f</kbd> </td><td> <kbd>f</kbd> </td></tr>
<tr><td> Open details of the post </td><td> <kbd>o</kbd> </td><td> <kbd>o</kbd> </td></tr>
<tr><td> Open account profile of the post</td><td> <kbd>p</kbd> </td><td> <kbd>p</kbd> </td></tr>
<tr><td> Open the images </td><td> <kbd>i</kbd> </td><td> <kbd>i</kbd> </td></tr>
<tr><td> Show/hide CW and NSFW </td><td> <kbd>x</kbd> </td><td> <kbd>x</kbd> </td></tr>
<tr><td> Close current page </td><td> <kbd>esc</kbd> </td><td> <kbd>esc</kbd> </td></tr>
<tr><td> Show shortcut keys </td><td> <kbd>?</kbd> </td><td> <kbd>?</kbd> </td></tr>
</tbody>
</table>
## Install
### Mac
[![App Store](app-store.svg)](https://itunes.apple.com/us/app/whalebird/id1378283354)
Or you can download `.dmg` from [release page](https://github.com/h3poteto/whalebird-desktop/releases).
So on, you can install from Homebrew:
### Create an App
```
$ brew update
$ brew install --cask whalebird
# with npx
$ npx create-nextron-app my-app --example with-tailwindcss
# with yarn
$ yarn create nextron-app my-app --example with-tailwindcss
# with pnpm
$ pnpm dlx create-nextron-app my-app --example with-tailwindcss
```
:sparkles: Thanks to [@singingwolfboy](https://github.com/singingwolfboy) for adding it to [homebrew-cask](https://github.com/Homebrew/homebrew-cask/blob/cf568882b6e012956ca404a16be2db36ca873002/Casks/whalebird.rb).
### Linux
There are some packages in [release page](https://github.com/h3poteto/whalebird-desktop/releases), for example `.deb`, `.rpm` and `.AppImage`.
If you do not want to use the package manager, please download `.tar.bz2` file and decompress it.
If you are using snap, please install from [snapcraft.io](https://snapcraft.io/whalebird).
### Install Dependencies
```
$ sudo snap install whalebird
$ cd my-app
# using yarn or npm
$ yarn (or `npm install`)
# using pnpm
$ pnpm install --shamefully-hoist
```
If you are using flatpak, please install from
[flathub.org](https://flathub.org/apps/details/social.whalebird.WhalebirdDesktop).
### Use it
```
$ flatpak install social.whalebird.WhalebirdDesktop
# development mode
$ yarn dev (or `npm run dev` or `pnpm run dev`)
# production build
$ yarn build (or `npm run build` or `pnpm run build`)
```
Or you can install from [Arch User Repository](https://aur.archlinux.org/packages/whalebird/).
```
$ yay -S whalebird
```
### Windows
<a href="https://apps.microsoft.com/store/detail/whalebird/9NBW4CSDV5HC"><img src="./windows-store.svg" alt= "Windows Store" width="156" height="auto"></a>
We prepared winget package and `.exe` [files](https://github.com/h3poteto/whalebird-desktop/releases), **but we don't recommend these ways**.
Because these binary is not code signed, so you will get warnings when you launch. Only Windows Store version is signed, so please use it.
```
$ winget show "Whalebird" --versions
```
## Translation
If you can speak multiple languages, could you please help with translation in [Crowdin](https://crowdin.com/project/whalebird)?
Or if you want add new language, please create an issue. I will add it.
## Development
We'd love you to contribute to Whalebird.
### Minimum requirements for development
* Node.js greater than or equal version 15.0.0 (16.x is recommended)
* npm or yarn
### Getting started
``` bash
# clone this repository
$ git clone https://github.com/h3poteto/whalebird-desktop.git
$ cd whalebird-desktop
# Install font config
$ sudo apt-get install libfontconfig-dev
# install dependencies
$ yarn install
# serve with hot reload at localhost:9080
$ yarn run dev
```
# License
The software is available as open source under the terms of the [GPL-3.0 License](https://www.gnu.org/licenses/gpl-3.0.en.html). However, icons do not comply with this license, © Miho Fukuda.

View File

@ -1,51 +0,0 @@
<svg id="livetype" xmlns="http://www.w3.org/2000/svg" width="156.10054" height="40" viewBox="0 0 156.10054 40">
<title>Download_on_the_Mac_App_Store_Badge_US-UK_RGB_blk_092917</title>
<g>
<g>
<g>
<path d="M146.57123,0H9.53468c-.3667,0-.729,0-1.09473.002-.30615.002-.60986.00781-.91895.0127A13.21476,13.21476,0,0,0,5.5171.19141a6.66509,6.66509,0,0,0-1.90088.627A6.4378,6.4378,0,0,0,1.99757,1.99707,6.25844,6.25844,0,0,0,.81935,3.61816a6.60119,6.60119,0,0,0-.625,1.90332,12.993,12.993,0,0,0-.1792,2.002C.00587,7.83008.00489,8.1377,0,8.44434V31.5586c.00489.3105.00587.6113.01514.9219a12.99232,12.99232,0,0,0,.1792,2.0019,6.58756,6.58756,0,0,0,.625,1.9043A6.20778,6.20778,0,0,0,1.99757,38.001a6.27446,6.27446,0,0,0,1.61865,1.1787,6.70082,6.70082,0,0,0,1.90088.6308,13.45514,13.45514,0,0,0,2.0039.1768c.30909.0068.6128.0107.91895.0107C8.80567,40,9.168,40,9.53468,40H146.57123c.3594,0,.7246,0,1.084-.002.3047,0,.6172-.0039.9219-.0107a13.279,13.279,0,0,0,2-.1768,6.80432,6.80432,0,0,0,1.9082-.6308,6.27742,6.27742,0,0,0,1.6172-1.1787,6.39482,6.39482,0,0,0,1.1816-1.6143,6.60413,6.60413,0,0,0,.6191-1.9043,13.50643,13.50643,0,0,0,.1856-2.0019c.0039-.3106.0039-.6114.0039-.9219.0078-.3633.0078-.7246.0078-1.0938V9.53613c0-.36621,0-.72949-.0078-1.09179,0-.30664,0-.61426-.0039-.9209a13.5071,13.5071,0,0,0-.1856-2.002,6.6177,6.6177,0,0,0-.6191-1.90332,6.46619,6.46619,0,0,0-2.7988-2.7998,6.76754,6.76754,0,0,0-1.9082-.627,13.04394,13.04394,0,0,0-2-.17676c-.3047-.00488-.6172-.01074-.9219-.01269-.3594-.002-.7246-.002-1.084-.002Z" style="fill: #a6a6a6"/>
<path d="M8.44483,39.125c-.30468,0-.60205-.0039-.90429-.0107a12.68714,12.68714,0,0,1-1.86914-.1631,5.88381,5.88381,0,0,1-1.65674-.5479,5.40573,5.40573,0,0,1-1.397-1.0166,5.32082,5.32082,0,0,1-1.02051-1.3965,5.72184,5.72184,0,0,1-.543-1.6572,12.41339,12.41339,0,0,1-.1665-1.875c-.00634-.2109-.01464-.9131-.01464-.9131V8.44434S.88185,7.75293.8877,7.5498a12.37032,12.37032,0,0,1,.16553-1.87207,5.75552,5.75552,0,0,1,.54346-1.6621A5.3735,5.3735,0,0,1,2.61183,2.61768,5.56543,5.56543,0,0,1,4.01417,1.59521a5.82309,5.82309,0,0,1,1.65332-.54394A12.58589,12.58589,0,0,1,7.543.88721L8.44532.875h139.205l.9131.0127a12.38493,12.38493,0,0,1,1.8584.16259,5.93833,5.93833,0,0,1,1.6709.54785,5.59374,5.59374,0,0,1,2.415,2.41993,5.76267,5.76267,0,0,1,.5352,1.64892,12.995,12.995,0,0,1,.1738,1.88721c.0029.2832.0029.5874.0029.89014.0079.375.0079.73193.0079,1.09179V30.4648c0,.3633,0,.7178-.0079,1.0752,0,.3252,0,.6231-.0039.9297a12.73127,12.73127,0,0,1-.1709,1.8535,5.739,5.739,0,0,1-.54,1.67,5.48029,5.48029,0,0,1-1.0156,1.3857,5.4129,5.4129,0,0,1-1.3994,1.0225,5.86168,5.86168,0,0,1-1.668.5498,12.54218,12.54218,0,0,1-1.8692.1631c-.2929.0068-.5996.0107-.8974.0107l-1.084.002Z"/>
</g>
<g id="_Group_" data-name="&lt;Group&gt;">
<g id="_Group_2" data-name="&lt;Group&gt;">
<g id="_Group_3" data-name="&lt;Group&gt;">
<g id="_Group_4" data-name="&lt;Group&gt;">
<path id="_Path_" data-name="&lt;Path&gt;" d="M24.76888,20.30068a4.94881,4.94881,0,0,1,2.35656-4.15206,5.06566,5.06566,0,0,0-3.99116-2.15768c-1.67924-.17626-3.30719,1.00483-4.1629,1.00483-.87227,0-2.18977-.98733-3.6085-.95814a5.31529,5.31529,0,0,0-4.47292,2.72787c-1.934,3.34842-.49141,8.26947,1.3612,10.97608.9269,1.32535,2.01018,2.8058,3.42763,2.7533,1.38706-.05753,1.9051-.88448,3.5794-.88448,1.65876,0,2.14479.88448,3.591.8511,1.48838-.02416,2.42613-1.33124,3.32051-2.66914a10.962,10.962,0,0,0,1.51842-3.09251A4.78205,4.78205,0,0,1,24.76888,20.30068Z" style="fill: #fff"/>
<path id="_Path_2" data-name="&lt;Path&gt;" d="M22.03725,12.21089a4.87248,4.87248,0,0,0,1.11452-3.49062,4.95746,4.95746,0,0,0-3.20758,1.65961,4.63634,4.63634,0,0,0-1.14371,3.36139A4.09905,4.09905,0,0,0,22.03725,12.21089Z" style="fill: #fff"/>
</g>
</g>
<g>
<path d="M46.14895,30.49609V21.35645H46.0884l-3.74316,9.04492H40.91652l-3.75293-9.04492H37.104v9.13965H35.34816v-12.418h2.22949l4.01855,9.80176h.06836l4.01074-9.80176h2.2373v12.418Z" style="fill: #fff"/>
<path d="M49.396,27.92285c0-1.583,1.21289-2.53906,3.36523-2.668l2.47852-.1377v-.68848c0-1.00684-.66309-1.5752-1.791-1.5752a1.73035,1.73035,0,0,0-1.90137,1.27441H49.8091c.05176-1.63574,1.5752-2.79687,3.69141-2.79687,2.16016,0,3.58887,1.17871,3.58887,2.96v6.20508H55.30813V29.00684h-.043a3.23683,3.23683,0,0,1-2.85742,1.64453A2.74447,2.74447,0,0,1,49.396,27.92285Zm5.84375-.81738V26.4082l-2.22949.1377c-1.11035.06934-1.73828.55078-1.73828,1.3252,0,.792.6543,1.30859,1.65234,1.30859A2.17046,2.17046,0,0,0,55.23977,27.10547Z" style="fill: #fff"/>
<path d="M64.89309,24.55762a1.99909,1.99909,0,0,0-2.13379-1.66895c-1.42871,0-2.375,1.19629-2.375,3.08105,0,1.92773.95508,3.08887,2.3916,3.08887a1.94829,1.94829,0,0,0,2.11719-1.626h1.79A3.61835,3.61835,0,0,1,62.7593,30.6084c-2.582,0-4.26855-1.76465-4.26855-4.63867,0-2.81445,1.68652-4.63867,4.251-4.63867a3.63931,3.63931,0,0,1,3.9248,3.22656Z" style="fill: #fff"/>
<path d="M78.7593,27.13965H74.0259l-1.13672,3.35645H70.8843l4.4834-12.418h2.083l4.4834,12.418H79.895Zm-4.24316-1.54883h3.752l-1.84961-5.44727h-.05176Z" style="fill: #fff"/>
<path d="M91.61672,25.96973c0,2.81348-1.50586,4.62109-3.77832,4.62109a3.0693,3.0693,0,0,1-2.84863-1.584h-.043v4.48438H83.0884V21.44238h1.79883v1.50586h.03418a3.21161,3.21161,0,0,1,2.88281-1.60059C90.10207,21.34766,91.61672,23.16406,91.61672,25.96973Zm-1.91016,0c0-1.833-.94727-3.03809-2.39258-3.03809-1.41992,0-2.375,1.23047-2.375,3.03809,0,1.82422.95508,3.0459,2.375,3.0459C88.7593,29.01563,89.70656,27.81934,89.70656,25.96973Z" style="fill: #fff"/>
<path d="M101.58156,25.96973c0,2.81348-1.50586,4.62109-3.77832,4.62109a3.0693,3.0693,0,0,1-2.84863-1.584h-.043v4.48438h-1.8584V21.44238h1.79883v1.50586h.03418a3.21162,3.21162,0,0,1,2.88281-1.60059C100.06691,21.34766,101.58156,23.16406,101.58156,25.96973Zm-1.91016,0c0-1.833-.94727-3.03809-2.39258-3.03809-1.41992,0-2.375,1.23047-2.375,3.03809,0,1.82422.95508,3.0459,2.375,3.0459C98.72414,29.01563,99.67141,27.81934,99.67141,25.96973Z" style="fill: #fff"/>
<path d="M108.1675,27.03613c.1377,1.23145,1.334,2.04,2.96875,2.04,1.56641,0,2.69336-.80859,2.69336-1.91895,0-.96387-.67969-1.541-2.28906-1.93652l-1.60937-.3877c-2.28027-.55078-3.33887-1.61719-3.33887-3.34766,0-2.14258,1.86719-3.61426,4.51855-3.61426,2.624,0,4.42285,1.47168,4.4834,3.61426h-1.876c-.1123-1.23926-1.13672-1.9873-2.63379-1.9873s-2.52149.75684-2.52149,1.8584c0,.87793.65431,1.39453,2.25489,1.79l1.36816.33594c2.54785.60254,3.60645,1.626,3.60645,3.44238,0,2.32324-1.85059,3.77832-4.79395,3.77832-2.75391,0-4.61328-1.4209-4.7334-3.667Z" style="fill: #fff"/>
<path d="M119.80324,19.2998v2.14258h1.72168v1.47168h-1.72168v4.99121c0,.77539.34473,1.13672,1.10156,1.13672a5.80752,5.80752,0,0,0,.61133-.043v1.46289a5.10351,5.10351,0,0,1-1.03223.08594c-1.833,0-2.54785-.68848-2.54785-2.44434V22.91406h-1.31641V21.44238h1.31641V19.2998Z" style="fill: #fff"/>
<path d="M122.521,25.96973c0-2.84863,1.67773-4.63867,4.29395-4.63867,2.625,0,4.29492,1.79,4.29492,4.63867,0,2.85645-1.66113,4.63867-4.29492,4.63867C124.18215,30.6084,122.521,28.82617,122.521,25.96973Zm6.69531,0c0-1.9541-.89551-3.10742-2.40137-3.10742s-2.40137,1.16211-2.40137,3.10742c0,1.96191.89551,3.10645,2.40137,3.10645S129.21633,27.93164,129.21633,25.96973Z" style="fill: #fff"/>
<path d="M132.64309,21.44238h1.77246v1.541h.043a2.1594,2.1594,0,0,1,2.17773-1.63574,2.86616,2.86616,0,0,1,.63672.06934v1.73828a2.598,2.598,0,0,0-.835-.1123,1.87264,1.87264,0,0,0-1.93651,2.083v5.37012h-1.8584Z" style="fill: #fff"/>
<path d="M145.84035,27.83691c-.25,1.64355-1.85059,2.77148-3.89844,2.77148-2.63379,0-4.26855-1.76465-4.26855-4.5957,0-2.83984,1.64355-4.68164,4.19043-4.68164,2.50488,0,4.08008,1.7207,4.08008,4.46582v.63672h-6.39453v.1123a2.358,2.358,0,0,0,2.43555,2.56445,2.04834,2.04834,0,0,0,2.09082-1.27344Zm-6.28223-2.70215h4.52637a2.1773,2.1773,0,0,0-2.2207-2.29785A2.292,2.292,0,0,0,139.55813,25.13477Z" style="fill: #fff"/>
</g>
</g>
</g>
</g>
<g id="_Group_5" data-name="&lt;Group&gt;">
<g>
<path d="M37.82619,8.731a2.63964,2.63964,0,0,1,2.80762,2.96484c0,1.90625-1.03027,3.002-2.80762,3.002H35.67092V8.731Zm-1.22852,5.123h1.125a1.87588,1.87588,0,0,0,1.96777-2.146,1.881,1.881,0,0,0-1.96777-2.13379h-1.125Z" style="fill: #fff"/>
<path d="M41.68068,12.44434a2.13323,2.13323,0,1,1,4.24707,0,2.13358,2.13358,0,1,1-4.24707,0Zm3.333,0c0-.97607-.43848-1.54687-1.208-1.54687-.77246,0-1.207.5708-1.207,1.54688,0,.98389.43457,1.55029,1.207,1.55029C44.57521,13.99463,45.01369,13.42432,45.01369,12.44434Z" style="fill: #fff"/>
<path d="M51.57326,14.69775h-.92187l-.93066-3.31641h-.07031l-.92676,3.31641h-.91309l-1.24121-4.50293h.90137l.80664,3.436h.06641l.92578-3.436h.85254l.92578,3.436h.07031l.80273-3.436h.88867Z" style="fill: #fff"/>
<path d="M53.85354,10.19482H54.709v.71533h.06641a1.348,1.348,0,0,1,1.34375-.80225,1.46456,1.46456,0,0,1,1.55859,1.6748v2.915h-.88867V12.00586c0-.72363-.31445-1.0835-.97168-1.0835a1.03294,1.03294,0,0,0-1.0752,1.14111v2.63428h-.88867Z" style="fill: #fff"/>
<path d="M59.09377,8.437h.88867v6.26074h-.88867Z" style="fill: #fff"/>
<path d="M61.21779,12.44434a2.13323,2.13323,0,1,1,4.24707,0,2.13358,2.13358,0,1,1-4.24707,0Zm3.333,0c0-.97607-.43848-1.54687-1.208-1.54687-.77246,0-1.207.5708-1.207,1.54688,0,.98389.43457,1.55029,1.207,1.55029C64.11232,13.99463,64.5508,13.42432,64.5508,12.44434Z" style="fill: #fff"/>
<path d="M66.40041,13.42432c0-.81055.60352-1.27783,1.6748-1.34424l1.21973-.07031v-.38867c0-.47559-.31445-.74414-.92187-.74414-.49609,0-.83984.18213-.93848.50049h-.86035c.09082-.77344.81836-1.26953,1.83984-1.26953,1.12891,0,1.76563.562,1.76563,1.51318v3.07666h-.85547v-.63281h-.07031a1.515,1.515,0,0,1-1.35254.707A1.36026,1.36026,0,0,1,66.40041,13.42432Zm2.89453-.38477v-.37646l-1.09961.07031c-.62012.0415-.90137.25244-.90137.64941,0,.40527.35156.64111.835.64111A1.0615,1.0615,0,0,0,69.29494,13.03955Z" style="fill: #fff"/>
<path d="M71.34768,12.44434c0-1.42285.73145-2.32422,1.86914-2.32422a1.484,1.484,0,0,1,1.38086.79h.06641V8.437h.88867v6.26074h-.85156v-.71143h-.07031a1.56284,1.56284,0,0,1-1.41406.78564C72.07131,14.772,71.34768,13.87061,71.34768,12.44434Zm.918,0c0,.95508.4502,1.52979,1.20313,1.52979.749,0,1.21191-.583,1.21191-1.52588,0-.93848-.46777-1.52979-1.21191-1.52979C72.72072,10.91846,72.26564,11.49707,72.26564,12.44434Z" style="fill: #fff"/>
<path d="M79.22951,12.44434a2.13346,2.13346,0,1,1,4.24756,0,2.1338,2.1338,0,1,1-4.24756,0Zm3.333,0c0-.97607-.43848-1.54687-1.208-1.54687-.77246,0-1.207.5708-1.207,1.54688,0,.98389.43457,1.55029,1.207,1.55029C82.124,13.99463,82.56252,13.42432,82.56252,12.44434Z" style="fill: #fff"/>
<path d="M84.66945,10.19482h.85547v.71533h.06641a1.348,1.348,0,0,1,1.34375-.80225,1.46456,1.46456,0,0,1,1.55859,1.6748v2.915H87.605V12.00586c0-.72363-.31445-1.0835-.97168-1.0835a1.03294,1.03294,0,0,0-1.0752,1.14111v2.63428h-.88867Z" style="fill: #fff"/>
<path d="M93.51516,9.07373v1.1416h.97559v.74854h-.97559V13.2793c0,.47168.19434.67822.63672.67822a2.96657,2.96657,0,0,0,.33887-.02051v.74023a2.9155,2.9155,0,0,1-.4834.04541c-.98828,0-1.38184-.34766-1.38184-1.21582v-2.543h-.71484v-.74854h.71484V9.07373Z" style="fill: #fff"/>
<path d="M95.70461,8.437h.88086v2.48145h.07031a1.3856,1.3856,0,0,1,1.373-.80664,1.48339,1.48339,0,0,1,1.55078,1.67871v2.90723H98.69v-2.688c0-.71924-.335-1.0835-.96289-1.0835a1.05194,1.05194,0,0,0-1.13379,1.1416v2.62988h-.88867Z" style="fill: #fff"/>
<path d="M104.76125,13.48193a1.828,1.828,0,0,1-1.95117,1.30273A2.04531,2.04531,0,0,1,100.73,12.46045a2.07685,2.07685,0,0,1,2.07617-2.35254c1.25293,0,2.00879.856,2.00879,2.27V12.688h-3.17969v.0498a1.1902,1.1902,0,0,0,1.19922,1.29,1.07934,1.07934,0,0,0,1.07129-.5459Zm-3.126-1.45117h2.27441a1.08647,1.08647,0,0,0-1.1084-1.1665A1.15162,1.15162,0,0,0,101.63527,12.03076Z" style="fill: #fff"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,20 +0,0 @@
const { notarize } = require('@electron/notarize')
exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context
if (electronPlatformName !== 'darwin') {
return
}
const appName = context.packager.appInfo.productFilename
return await notarize({
tool: 'notarytool',
appBundleId: 'social.whalebird.app',
ascProvider: process.env.ASC_PROVIDER,
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_APP_SPECIFIC_PASSWORD,
teamId: process.env.TEAM_ID
})
}

Binary file not shown.

Binary file not shown.

View File

@ -1,27 +0,0 @@
files:
- source: /src/config/locales/en/translation.json
translation: /src/config/locales/%locale%/translation.json
languages_mapping:
locale:
cs: cs
de: de
es-ES: es_es
eu: eu
fa: fa
fr: fr
gd: gd
hu: hu
id: id
is: is
it: it
ja: ja
ko: ko
'no': 'no'
pl: pl
pt-PT: pt_pt
ru: ru
si-LK: si
sv-SE: sv_se
tzm: tzm
zh-CN: zh_cn
zh-TW: zh_tw

View File

0
dist/web/.gitkeep vendored
View File

View File

@ -1,98 +0,0 @@
{
"productName": "Whalebird",
"appId": "social.whalebird.app",
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
"directories": {
"output": "build"
},
"extraResources": [
"build/sounds/*",
"build/icons/*"
],
"files": [
"dist/electron/**/*",
"build/icons/*"
],
"afterSign": "build/notarize.js",
"dmg": {
"sign": false,
"contents": [
{
"x": 410,
"y": 150,
"type": "link",
"path": "/Applications"
},
{
"x": 130,
"y": 150,
"type": "file"
}
]
},
"mac": {
"icon": "build/icons/icon.icns",
"target": [
{
"target": "dmg",
"arch": [
"x64",
"arm64"
]
}
],
"category": "public.app-category.social-networking",
"entitlements": "plist/entitlements.mac.plist",
"entitlementsInherit": "plist/entitlements.mac.plist",
"entitlementsLoginHelper": "plist/loginhelper.plist",
"hardenedRuntime": true,
"gatekeeperAssess": false,
"darkModeSupport": true,
"mergeASARs": false,
"asarUnpack": "node_modules/**/*.node"
},
"win": {
"icon": "build/icons/icon.ico",
"target": "nsis"
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true
},
"linux": {
"icon": "build/icons",
"target": [
{
"target": "AppImage",
"arch": [
"x64"
]
},
{
"target": "deb",
"arch": [
"x64"
]
},
{
"target": "rpm",
"arch": [
"x64"
]
},
{
"target": "tar.bz2",
"arch": [
"x64"
]
},
{
"target": "snap",
"arch": [
"x64"
]
}
],
"category": "Network"
}
}

View File

@ -1,49 +0,0 @@
{
"productName": "Whalebird",
"appId": "social.whalebird.app",
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
"buildVersion": "168",
"directories": {
"output": "build"
},
"extraResources": [
"build/sounds/*",
"build/icons/*"
],
"files": [
"dist/electron/**/*",
"build/icons/*"
],
"mas": {
"type": "distribution",
"entitlements": "plist/parent.plist",
"entitlementsInherit": "plist/child.plist",
"entitlementsLoginHelper": "plist/loginhelper.plist",
"hardenedRuntime": false,
"gatekeeperAssess": false,
"extendInfo": {
"ITSAppUsesNonExemptEncryption": "false"
},
"provisioningProfile": "./packages/socialwhalebirdapp_MAS.provisionprofile"
},
"mac": {
"icon": "build/icons/icon.icns",
"target": [
{
"target": "mas",
"arch": [
"universal"
]
}
],
"category": "public.app-category.social-networking",
"hardenedRuntime": true,
"gatekeeperAssess": false,
"darkModeSupport": true,
"extendInfo": {
"ITSAppUsesNonExemptEncryption": "false"
},
"mergeASARs": false,
"asarUnpack": "node_modules/**/*.node"
}
}

15
electron-builder.yml Normal file
View File

@ -0,0 +1,15 @@
appId: social.whalebird.app
productName: Whalebird
copyright: Copyright © 2023 Akira Fukushima
directories:
output: dist
buildResources: resources
files:
- from: .
filter:
- package.json
- app
linux:
target: AppImage
category: Network
publish: null

View File

@ -1,10 +0,0 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Whalebird
Comment=Electron-based Mastodon/Pleroma/Misskey client
Exec=start-whalebird.sh %U
Icon=social.whalebird.WhalebirdDesktop
Categories=Network;
Terminal=false

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>social.whalebird.WhalebirdDesktop</id>
<name>Whalebird </name>
<summary>Whalebird is a Mastodon, Pleroma, and Misskey client for the desktop</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>MIT</project_license>
<url type="homepage">https://whalebird.social/en/desktop/contents</url>
<content_rating type="oars-1.1">
<content_attribute id="social-chat">intense</content_attribute>
<content_attribute id="social-audio">intense</content_attribute>
</content_rating>
<description>
<p>Whalebird is a Mastodon, Pleroma, and Misskey client for the desktop</p>
<p>Features</p>
<ul>
<li>An interface like slack</li>
<li>Notify to desktop</li>
<li>Streaming</li>
<li>Many keyboard shortcuts</li>
<li>Manage multiple accounts</li>
</ul>
</description>
<launchable type="desktop-id">social.whalebird.WhalebirdDesktop.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://github.com/h3poteto/whalebird-desktop/raw/master/screenshot.png</image>
</screenshot>
</screenshots>
<releases>
<release version="5.0.7" date="2023-6-15">
<description>
<p>Updated</p>
<ul>
<li>Whalebird 5.x doesn't migrate your local databases from version 4. So please re-authenticate all servers when you upgrade Whalebird from 4.7.4.</li>
</ul>
</description>
</release>
</releases>
</component>

47
main/background.ts Normal file
View File

@ -0,0 +1,47 @@
import path from 'path'
import { app, ipcMain, shell, IpcMainInvokeEvent } from 'electron'
import serve from 'electron-serve'
import { createWindow } from './helpers'
const isProd = process.env.NODE_ENV === 'production'
if (isProd) {
serve({ directory: 'app' })
} else {
app.setPath('userData', `${app.getPath('userData')} (development)`)
}
;(async () => {
await app.whenReady()
const mainWindow = createWindow('main', {
width: 1000,
height: 600,
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
webSecurity: false,
preload: path.join(__dirname, 'preload.js')
}
})
if (isProd) {
await mainWindow.loadURL('app://./')
} else {
const port = process.argv[2]
await mainWindow.loadURL(`http://localhost:${port}/`)
mainWindow.webContents.openDevTools()
}
})()
app.on('window-all-closed', () => {
app.quit()
})
ipcMain.on('message', async (event, arg) => {
event.reply('message', `${arg} World!`)
})
ipcMain.handle('open-browser', (_event: IpcMainInvokeEvent, url: string) => {
shell.openExternal(url)
})

View File

@ -0,0 +1,86 @@
import {
screen,
BrowserWindow,
BrowserWindowConstructorOptions,
Rectangle,
} from 'electron'
import Store from 'electron-store'
export const createWindow = (
windowName: string,
options: BrowserWindowConstructorOptions
): BrowserWindow => {
const key = 'window-state'
const name = `window-state-${windowName}`
const store = new Store<Rectangle>({ name })
const defaultSize = {
width: options.width,
height: options.height,
}
let state = {}
const restore = () => store.get(key, defaultSize)
const getCurrentPosition = () => {
const position = win.getPosition()
const size = win.getSize()
return {
x: position[0],
y: position[1],
width: size[0],
height: size[1],
}
}
const windowWithinBounds = (windowState, bounds) => {
return (
windowState.x >= bounds.x &&
windowState.y >= bounds.y &&
windowState.x + windowState.width <= bounds.x + bounds.width &&
windowState.y + windowState.height <= bounds.y + bounds.height
)
}
const resetToDefaults = () => {
const bounds = screen.getPrimaryDisplay().bounds
return Object.assign({}, defaultSize, {
x: (bounds.width - defaultSize.width) / 2,
y: (bounds.height - defaultSize.height) / 2,
})
}
const ensureVisibleOnSomeDisplay = (windowState) => {
const visible = screen.getAllDisplays().some((display) => {
return windowWithinBounds(windowState, display.bounds)
})
if (!visible) {
// Window is partially or fully not visible now.
// Reset it to safe defaults.
return resetToDefaults()
}
return windowState
}
const saveState = () => {
if (!win.isMinimized() && !win.isMaximized()) {
Object.assign(state, getCurrentPosition())
}
store.set(key, state)
}
state = ensureVisibleOnSomeDisplay(restore())
const win = new BrowserWindow({
...state,
...options,
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
...options.webPreferences,
},
})
win.on('close', saveState)
return win
}

1
main/helpers/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './create-window'

22
main/preload.ts Normal file
View File

@ -0,0 +1,22 @@
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron'
const handler = {
invoke(channel: string, value: any) {
ipcRenderer.invoke(channel, value)
},
send(channel: string, value: unknown) {
ipcRenderer.send(channel, value)
},
on(channel: string, callback: (...args: unknown[]) => void) {
const subscription = (_event: IpcRendererEvent, ...args: unknown[]) => callback(...args)
ipcRenderer.on(channel, subscription)
return () => {
ipcRenderer.removeListener(channel, subscription)
}
}
}
contextBridge.exposeInMainWorld('ipc', handler)
export type IpcHandler = typeof handler

View File

@ -1,205 +1,36 @@
{
"name": "Whalebird",
"version": "5.1.1",
"author": "AkiraFukushima <h3.poteto@gmail.com>",
"description": "An Electron based Mastodon client for Windows, Mac and Linux",
"keywords": [
"mastodon",
"client",
"electron",
"vue"
],
"repository": {
"type": "git",
"url": "https://github.com/h3poteto/whalebird-desktop.git"
},
"main": "./dist/electron/main.js",
"private": true,
"name": "whalebird",
"description": "Electron based Fediverse client application",
"version": "1.0.0",
"author": "Akira Fukushima <h3.poteto@gmail.com>",
"main": "app/background.js",
"scripts": {
"dev": "node .electron-vue/dev-runner.js",
"dev:main": "webpack --node-env=development --mode development --progress --config .electron-vue/webpack.main.config.js",
"dev:renderer": "webpack --node-env=development --mode development --progress --config .electron-vue/webpack.renderer.config.js",
"lint:eslint": "eslint -c .eslintrc.js --ext .js,.vue,.ts src spec",
"lint:stylelint": "stylelint '**/*.vue'",
"build": "node .electron-vue/build.js",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
"package:mas": "electron-builder --mac --publish never --config electron-builder.mas.json",
"package:mac": "electron-builder --mac --publish never --config electron-builder.json",
"package:linux": "electron-builder --linux --publish never --config electron-builder.json",
"package:win32": "electron-builder --win --ia32 --publish never --config electron-builder.json",
"package:win64": "electron-builder --win --x64 --publish never --config electron-builder.json",
"package:pacman": "electron-builder --linux pacman --publish never --config electron-builder.json",
"package:appx2": "electron-builder --win --x64 --config electron-builder.json && electron-windows-store --assets .\\build\\icons --input-directory .\\build\\win-unpacked --output-directory .\\build\\appx --package-name Whalebird --package-display-name Whalebird --package-version 5.1.1.0 --publisher-display-name h3poteto --identity-name 45610h3poteto.Whalebird",
"pack": "yarn run pack:main && yarn run pack:renderer",
"pack:main": "webpack --node-env=production --mode production --progress --config .electron-vue/webpack.main.config.js",
"pack:renderer": "webpack --node-env=production --mode production --progress --config .electron-vue/webpack.renderer.config.js",
"typecheck": "tsc -p . --noEmit && vue-tsc --noEmit",
"spec": "NODE_ENV=test jest -u --maxWorkers=3",
"postinstall": "electron-builder install-app-deps",
"thirdparty": "license-checker --production --json > thirdparty.json && node scripts/thirdparty.js"
},
"jest": {
"moduleFileExtensions": [
"ts",
"js",
"json"
],
"moduleNameMapper": {
"@/router": "<rootDir>/spec/mock/router.ts",
"^@/(.+)": "<rootDir>/src/renderer/$1",
"^~/(.+)": "<rootDir>/$1",
"axios": "axios/dist/node/axios.cjs"
},
"testMatch": [
"**/spec/**/*.spec.ts"
],
"preset": "ts-jest/presets/js-with-ts",
"transform": {
"^.+\\.(js|jsx)$": "babel-jest",
"^.+\\.(ts|tsx)$": "ts-jest"
},
"transformIgnorePatterns": [
"/node_modules/(?!axios)"
],
"setupFiles": [
"core-js",
"<rootDir>/spec/setupJest.ts"
],
"globals": {
"ts-jest": {
"tsconfig": "tsconfig.json"
}
}
"dev": "nextron",
"build": "nextron build",
"postinstall": "electron-builder install-app-deps"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.4.0",
"@fortawesome/free-regular-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/vue-fontawesome": "^3.0.3",
"@trodi/electron-splashscreen": "^1.0.2",
"@vueuse/core": "10.4.1",
"@vueuse/math": "^10.1.2",
"about-window": "^1.15.2",
"animate.css": "^4.1.0",
"auto-launch": "^5.0.5",
"axios": "1.5.1",
"better-sqlite3": "8.2.0",
"electron-context-menu": "^3.6.1",
"electron-json-storage": "^4.6.0",
"electron-log": "^4.4.8",
"electron-window-state": "^5.0.3",
"element-plus": "^2.3.14",
"emoji-mart-vue-fast": "^15.0.0",
"i18next": "^23.0.0",
"i18next-vue": "^2.1.1",
"megalodon": "8.1.4",
"minimist": "^1.2.8",
"mitt": "^3.0.0",
"moment": "^2.29.4",
"mousetrap": "^1.6.5",
"object-assign-deep": "^0.4.0",
"parse-link-header": "^2.0.0",
"sanitize-html": "^2.10.0",
"simplayer": "0.0.8",
"system-font-families": "^0.6.0",
"unicode-emoji-json": "^0.4.0",
"vue": "^3.3.4",
"vue-popperjs": "^2.3.0",
"vue-resize": "^2.0.0-alpha.1",
"vue-router": "^4.2.2",
"vue-virtual-scroller": "2.0.0-beta.8",
"vuex": "^4.1.0",
"vuex-router-sync": "^6.0.0-rc.1"
"dexie": "^3.2.4",
"electron-serve": "^1.1.0",
"electron-store": "^8.1.0",
"flowbite": "^2.0.0",
"flowbite-react": "^0.6.4",
"megalodon": "^9.1.1"
},
"devDependencies": {
"@babel/core": "^7.22.1",
"@babel/eslint-parser": "^7.21.8",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.21.4",
"@babel/preset-env": "^7.21.5",
"@babel/register": "^7.21.0",
"@babel/runtime": "7.23.1",
"@electron/notarize": "^2.0.0",
"@types/auto-launch": "^5.0.2",
"@types/better-sqlite3": "^7.6.3",
"@types/electron-json-storage": "^4.5.0",
"@types/jest": "27.5.2",
"@types/jsdom": "^21.1.1",
"@types/node": "^20.2.5",
"@types/parse-link-header": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vue/compiler-sfc": "^3.3.4",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"all-object-keys": "^2.2.0",
"assert": "^2.0.0",
"babel-jest": "^29.5.0",
"babel-loader": "^9.1.2",
"babel-plugin-istanbul": "^6.1.1",
"browserify-zlib": "^0.2.0",
"buffer": "^6.0.3",
"bufferutil": "^4.0.7",
"cfonts": "^3.2.0",
"cli-color": "^2.0.3",
"copy-webpack-plugin": "^11.0.0",
"core-js": "^3.30.2",
"cross-env": "^7.0.3",
"crypto-browserify": "^3.12.0",
"css-loader": "^6.7.3",
"del": "^6.1.1",
"devtron": "^1.4.0",
"electron": "22.3.25",
"electron-builder": "23.6.0",
"electron-debug": "^3.2.0",
"electron-devtools-installer": "^3.2.0",
"electron-mock-ipc": "^0.3.12",
"electron-windows-store": "^2.1.0",
"eslint": "^8.49.0",
"eslint-plugin-vue": "^9.14.1",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.5.1",
"https-browserify": "^1.0.0",
"jest": "^26.6.3",
"jsdom": "^22.1.0",
"json-loader": "^0.5.7",
"listr": "^0.14.3",
"mini-css-extract-plugin": "^2.7.5",
"node-loader": "^2.0.0",
"node-sass": "^9.0.0",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"postcss": "^8.4.23",
"postcss-html": "^1.5.0",
"postcss-scss": "^4.0.6",
"prettier": "^3.0.3",
"process": "^0.11.10",
"regenerator-runtime": "^0.14.0",
"sass-loader": "^13.2.2",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"style-loader": "^3.3.2",
"stylelint": "^14.16.1",
"stylelint-config-html": "^1.1.0",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-standard": "^34.0.0",
"stylelint-scss": "^5.2.0",
"timers-browserify": "^2.0.12",
"ts-jest": "^26.5.6",
"ts-loader": "^9.4.2",
"ttfinfo": "^0.2.0",
"typescript": "^4.9.5",
"url": "^0.11.0",
"url-loader": "^4.1.1",
"utf-8-validate": "^6.0.3",
"vue-html-loader": "^1.2.4",
"vue-loader": "^17.2.2",
"vue-style-loader": "^4.1.3",
"vue-tsc": "^1.6.5",
"webpack": "^5.82.1",
"webpack-cli": "^5.1.1",
"webpack-dev-server": "^4.15.0",
"webpack-hot-middleware": "^2.25.3"
"@babel/runtime-corejs3": "^7.23.2",
"@types/node": "^18.11.18",
"@types/react": "^18.0.26",
"autoprefixer": "^10.4.16",
"electron": "^26.2.2",
"electron-builder": "^24.6.4",
"next": "^12.3.4",
"nextron": "^8.12.0",
"postcss": "^8.4.31",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwindcss": "^3.3.3",
"typescript": "^5.2.2"
}
}

View File

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.inherit</key>
<true/>
</dict>
</plist>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
</dict>
</plist>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

3
renderer/app.css Normal file
View File

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,83 @@
import { Label, Modal, TextInput, Button } from 'flowbite-react'
import generator, { MegalodonInterface, detector } from 'megalodon'
import { useState } from 'react'
import { db } from '@/db'
type NewProps = {
opened: boolean
close: () => void
}
export default function New(props: NewProps) {
const [sns, setSNS] = useState<'mastodon' | 'pleroma' | 'firefish' | 'friendica' | null>(null)
const [domain, setDomain] = useState<string>('')
const [client, setClient] = useState<MegalodonInterface>()
const [clientId, setClientId] = useState<string>()
const [clientSecret, setClientSecret] = useState<string>()
const checkDomain = async () => {
const input = document.getElementById('domain') as HTMLInputElement
setDomain(input.value)
const url = `https://${input.value}`
const sns = await detector(url)
setSNS(sns)
const client = generator(sns, url)
setClient(client)
const appData = await client.registerApp('Whalebird', {})
setClientId(appData.client_id)
setClientSecret(appData.client_secret)
global.ipc.invoke('open-browser', appData.url)
}
const authorize = async () => {
const input = document.getElementById('authorization') as HTMLInputElement
if (!client || !clientId || !clientSecret) return
const tokenData = await client.fetchAccessToken(clientId, clientSecret, input.value)
if (!sns) return
const cli = generator(sns, `https://${domain}`, tokenData.access_token, 'Whalebird')
const acct = await cli.verifyAccountCredentials()
await db.accounts.add({
username: acct.data.username,
account_id: acct.data.id,
avatar: acct.data.avatar,
client_id: clientId,
client_secret: clientSecret,
access_token: tokenData.access_token,
refresh_token: tokenData.refresh_token,
url: `https://${domain}`,
domain: domain,
sns: sns
})
props.close()
}
return (
<>
<Modal dismissible={false} show={props.opened} onClose={() => props.close()}>
<Modal.Header>Add account</Modal.Header>
<Modal.Body>
<form className="flex max-w-md flex-col gap-2">
{sns === null && (
<>
<div className="block">
<Label htmlFor="domain" value="Domain" />
</div>
<TextInput id="domain" placeholder="mastodon.social" required type="text" />
<Button onClick={checkDomain}>Sign In</Button>{' '}
</>
)}
{sns && (
<>
<div className="block">
<Label htmlFor="authorization" value="Authorization Code" />
</div>
<TextInput id="authorization" required type="text" />
<Button onClick={authorize}>Authorize</Button>{' '}
</>
)}
</form>
</Modal.Body>
</Modal>
</>
)
}

View File

@ -0,0 +1,48 @@
import { useEffect, useState } from 'react'
import { FaPlus } from 'react-icons/fa6'
import { Account, db } from '@/db'
import NewAccount from '@/components/accounts/New'
import { Avatar } from 'flowbite-react'
type LayoutProps = {
children: React.ReactNode
}
export default function Layout({ children }: LayoutProps) {
const [accounts, setAccounts] = useState<Array<Account>>([])
const [openNewModal, setOpenNewModal] = useState(false)
useEffect(() => {
const fn = async () => {
const acct = await db.accounts.toArray()
setAccounts(acct)
if (acct.length === 0) {
setOpenNewModal(true)
}
}
fn()
}, [])
const closeNewModal = async () => {
const acct = await db.accounts.toArray()
setAccounts(acct)
setOpenNewModal(false)
}
return (
<div className="app flex flex-col min-h-screen">
<main className="flex w-full box-border my-0 mx-auto min-h-screen">
<aside className="w-16 bg-gray-900">
{accounts.map(account => (
<Avatar alt={account.domain} img={account.avatar} rounded key={account.id} className="py-2" />
))}
<button className="py-4 px-6 items-center" onClick={() => setOpenNewModal(true)}>
<FaPlus className="text-gray-400" />
</button>
<NewAccount opened={openNewModal} close={closeNewModal} />
</aside>
{children}
</main>
</div>
)
}

View File

@ -0,0 +1,82 @@
import { Account, db } from '@/db'
import { CustomFlowbiteTheme, Flowbite, Sidebar } from 'flowbite-react'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
type LayoutProps = {
children: React.ReactNode
}
const customTheme: CustomFlowbiteTheme = {
sidebar: {
root: {
inner: 'h-full overflow-y-auto overflow-x-hidden bg-blue-950 py-4 px-3 dark:bg-blue-950'
},
item: {
base: 'flex items-center justify-center rounded-lg p-2 text-base font-normal text-blue-200 hover:bg-blue-900 dark:text-blue-200 dark:hover:bg-blue-900 cursor-pointer',
active: 'bg-blue-400 text-gray-800 hover:bg-blue-300'
}
}
}
export default function Layout({ children }: LayoutProps) {
const router = useRouter()
const [account, setAccount] = useState<Account | null>(null)
useEffect(() => {
if (router.query.id) {
const f = async () => {
const acct = await db.accounts.get(parseInt(router.query.id as string))
if (!acct) return
setAccount(acct)
}
f()
}
}, [router.query.id])
const pages = [
{
id: 'home',
title: 'Home',
path: `/accounts/${router.query.id}/home`
},
{
id: 'notifications',
title: 'Notifications',
path: `/accounts/${router.query.id}/notifications`
},
{
id: 'local',
title: 'Local',
path: `/accounts/${router.query.id}/local`
},
{
id: 'public',
title: 'Public',
path: `/accounts/${router.query.id}/public`
}
]
return (
<section className="flex h-screen w-full">
<Flowbite theme={{ theme: customTheme }}>
<Sidebar className="text-blue-200">
<div className="max-w-full pl-4 mt-2 mb-4">
<p>{account?.username}</p>
<p>@{account?.domain}</p>
</div>
<Sidebar.Items>
<Sidebar.ItemGroup>
{pages.map(page => (
<Sidebar.Item key={page.id} active={`${page.path}/` === router.asPath} onClick={() => router.push(page.path)}>
{page.title}
</Sidebar.Item>
))}
</Sidebar.ItemGroup>
</Sidebar.Items>
</Sidebar>
</Flowbite>
{children}
</section>
)
}

30
renderer/db.ts Normal file
View File

@ -0,0 +1,30 @@
import Dexie, { type Table } from 'dexie'
export type Account = {
id?: number
username: string
account_id: string
avatar: string
client_id: string
client_secret: string
access_token: string
refresh_token: string | null
url: string
domain: string
sns: 'mastodon' | 'pleroma' | 'friendica' | 'firefish'
}
export class SubClassedDexie extends Dexie {
// 'friends' is added by dexie when declaring the stores()
// We just tell the typing system this is the case
accounts!: Table<Account>
constructor() {
super('whalebird')
this.version(1).stores({
accounts: '++id, username, account_id, avatar, client_id, client_secret, access_token, refresh_token, url, domain, sns'
})
}
}
export const db = new SubClassedDexie()

View File

@ -0,0 +1,16 @@
// You can include shared interfaces/types in a separate file
// and then use them in any component by importing them. For
// example, to import the interface below do:
//
// import User from 'path/to/interfaces';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { IpcRenderer } from 'electron'
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace NodeJS {
interface Global {
ipc: IpcRenderer
}
}
}

5
renderer/next-env.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

10
renderer/next.config.js Normal file
View File

@ -0,0 +1,10 @@
/** @type {import('next').NextConfig} */
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config) => {
return config
},
}

14
renderer/pages/_app.tsx Normal file
View File

@ -0,0 +1,14 @@
import type { AppProps } from 'next/app'
import '../app.css'
import AccountLayout from '@/components/layouts/account'
import TimelineLayout from '@/components/layouts/timelines'
export default function MyApp({ Component, pageProps }: AppProps) {
return (
<AccountLayout>
<TimelineLayout>
<Component {...pageProps} />
</TimelineLayout>
</AccountLayout>
)
}

View File

@ -0,0 +1,6 @@
import { useRouter } from 'next/router'
export default function Timeline() {
const router = useRouter()
return <div>{router.query.timeline}</div>
}

View File

@ -0,0 +1,15 @@
import { useRouter } from 'next/router'
type AccountProps = {}
export default function Account(props: AccountProps) {
const router = useRouter()
const lastTimeline = localStorage.getItem(`${router.query.id}_lastTimeline`)
if (lastTimeline) {
router.push(`/accounts/${router.query.id}/${lastTimeline}`)
} else {
router.push(`/accounts/${router.query.id}/home`)
}
return <>{router.query.id}</>
}

25
renderer/pages/index.tsx Normal file
View File

@ -0,0 +1,25 @@
import Image from 'next/image'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import Icon from '@/assets/256x256.png'
import { db } from '@/db'
export default function Index() {
const router = useRouter()
useEffect(() => {
const f = async () => {
const accounts = await db.accounts.toArray()
if (accounts.length > 0) {
router.push(`/accounts/${accounts[0].id}`)
}
}
f()
}, [])
return (
<div className="h-screen w-full flex justify-center items-center">
<Image src={Icon} alt="icon" width={128} height={128} />
</div>
)
}

View File

@ -0,0 +1,8 @@
module.exports = {
plugins: {
tailwindcss: {
config: './renderer/tailwind.config.js',
},
autoprefixer: {},
},
}

7
renderer/preload.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
import { IpcHandler } from '../main/preload'
declare global {
interface Window {
ipc: IpcHandler
}
}

View File

@ -0,0 +1,25 @@
module.exports = {
content: ['./node_modules/flowbite-react/**/*.js', './renderer/pages/**/*.{js,ts,jsx,tsx}', './renderer/components/**/*.{js,ts,jsx,tsx}'],
plugins: [require('flowbite/plugin')],
darkMode: 'class',
theme: {
extend: {
colors: {
// flowbite-svelte
// Refs: https://github.com/themesberg/flowbite-svelte/blob/main/tailwind.config.cjs
primary: {
50: '#eff6ff',
100: '#dbeafe',
200: '#bfdbfe',
300: '#93c5fd',
400: '#60a5fa',
500: '#3b82f6',
600: '#2563eb',
700: '#1d4ed8',
800: '#1e40af',
900: '#1e3a8a'
}
}
}
}
}

13
renderer/tsconfig.json Normal file
View File

@ -0,0 +1,13 @@
{
"extends": "../tsconfig.json",
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": [
"./*"
]
}
}
}

View File

@ -1,18 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"prConcurrentLimit": 20,
"prHourlyLimit": 20,
"packageRules": [
{
"matchPackageNames": ["better-sqlite3"],
"allowedVersions": "< 8.3.0"
},{
"matchPackageNames": ["electron"],
"matchUpdateTypes": ["minor", "patch", "pin", "pinDigest"],
"enabled": false
}
]
}

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 361 KiB

After

Width:  |  Height:  |  Size: 361 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

View File

Before

Width:  |  Height:  |  Size: 920 B

After

Width:  |  Height:  |  Size: 920 B

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View File

Before

Width:  |  Height:  |  Size: 920 B

After

Width:  |  Height:  |  Size: 920 B

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View File

Before

Width:  |  Height:  |  Size: 313 KiB

After

Width:  |  Height:  |  Size: 313 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 KiB

View File

@ -1,27 +0,0 @@
const path = require('path')
const fs = require('fs')
const npmPath = path.join(__dirname, '../thirdparty.json')
const outPath = path.join(__dirname, '../', 'src', 'config', 'thirdparty.json')
const npmData = JSON.parse(fs.readFileSync(npmPath))
let npm = Object.keys(npmData).map(k => {
let r = {
package_name: k,
license: npmData[k].licenses
}
if (npmData[k].publisher) {
r = Object.assign(r, {
publisher: npmData[k].publisher
})
}
if (npmData[k].repository) {
r = Object.assign(r, {
repository: npmData[k].repository
})
}
return r
})
fs.writeFileSync(outPath, JSON.stringify(npm))

View File

@ -1,5 +0,0 @@
{
"env": {
"jest": true
}
}

View File

@ -1,43 +0,0 @@
import * as path from 'path'
import fs from 'fs'
import keys from 'all-object-keys'
const locales = [
'de',
'fr',
'gd',
'it',
'ja',
'ko',
'pl',
'is',
'it',
'zh_cn',
'zh_tw',
'cs',
'es_es',
'no',
'pt_pt',
'ru',
'si',
'sv_se',
'tzm',
'fa'
]
describe('i18n', () => {
describe('should not define duplicate keys', () => {
locales.forEach(locale => {
it(`${locale} translation`, () => {
const targetJson = JSON.parse(
fs.readFileSync(path.resolve(__dirname, `../../src/config/locales/${locale}/translation.json`), 'utf8')
)
const allKeys = keys(targetJson)
const duplicates: Array<string> = allKeys.filter(
(x: string, _: number, self: Array<string>) => self.indexOf(x) !== self.lastIndexOf(x)
)
expect(duplicates).toEqual([])
})
})
})
})

View File

@ -1,69 +0,0 @@
import path from 'path'
import ProxyConfiguration from '~/src/main/proxy'
import { ManualProxy, ProxyProtocol } from '~/src/types/proxy'
const preferencesDBPath = path.resolve(__dirname, '../../preferences.json')
const proxyConfiguration = new ProxyConfiguration(preferencesDBPath)
jest.mock('electron', () => ({
app: {
// getVersion is used by electron-log
getVersion: jest.fn(),
// getName is used by electron-json-storage
getName: jest.fn()
}
}))
describe('Parser', () => {
it('do not use proxy', () => {
proxyConfiguration.setSystemProxy('DIRECT')
const proxy = proxyConfiguration.parseSystemProxy()
expect(proxy).toEqual(false)
})
it('HTTP and HTTPS proxy', () => {
proxyConfiguration.setSystemProxy('PROXY hoge.example.com:8080')
const proxy = proxyConfiguration.parseSystemProxy()
expect(proxy).not.toBe(false)
const manualProxy = proxy as ManualProxy
expect(manualProxy.protocol).toEqual(ProxyProtocol.http)
expect(manualProxy.host).toEqual('hoge.example.com')
expect(manualProxy.port).toEqual('8080')
})
it('SOCKS4 proxy', () => {
proxyConfiguration.setSystemProxy('SOCKS4 hoge.example.com:8080')
const proxy = proxyConfiguration.parseSystemProxy()
expect(proxy).not.toBe(false)
const manualProxy = proxy as ManualProxy
expect(manualProxy.protocol).toEqual(ProxyProtocol.socks4)
})
it('SOCKS4A proxy', () => {
proxyConfiguration.setSystemProxy('SOCKS4A hoge.example.com:8080')
const proxy = proxyConfiguration.parseSystemProxy()
expect(proxy).not.toBe(false)
const manualProxy = proxy as ManualProxy
expect(manualProxy.protocol).toEqual(ProxyProtocol.socks4a)
})
it('SOCKS5 proxy', () => {
proxyConfiguration.setSystemProxy('SOCKS5 hoge.example.com:8080')
const proxy = proxyConfiguration.parseSystemProxy()
expect(proxy).not.toBe(false)
const manualProxy = proxy as ManualProxy
expect(manualProxy.protocol).toEqual(ProxyProtocol.socks5)
})
it('SOCKS5H proxy', () => {
proxyConfiguration.setSystemProxy('SOCKS5H hoge.example.com:8080')
const proxy = proxyConfiguration.parseSystemProxy()
expect(proxy).not.toBe(false)
const manualProxy = proxy as ManualProxy
expect(manualProxy.protocol).toEqual(ProxyProtocol.socks5h)
})
it('SOCKS proxy', () => {
proxyConfiguration.setSystemProxy('SOCKS hoge.example.com:8080')
const proxy = proxyConfiguration.parseSystemProxy()
expect(proxy).not.toBe(false)
const manualProxy = proxy as ManualProxy
expect(manualProxy.protocol).toEqual(ProxyProtocol.socks5)
})
})

View File

@ -1,8 +0,0 @@
import createIPCMock from 'electron-mock-ipc'
import { IpcRenderer, IpcMain } from 'electron'
const mocked = createIPCMock()
const ipcMain = mocked.ipcMain as IpcMain
const ipcRenderer = mocked.ipcRenderer as IpcRenderer
export { ipcMain, ipcRenderer }

View File

@ -1,3 +0,0 @@
export default {
push: jest.fn()
}

View File

@ -1 +0,0 @@
{}

View File

@ -1,107 +0,0 @@
import { createStore, Store } from 'vuex'
import { ipcMain, ipcRenderer } from '~/spec/mock/electron'
import App from '@/store/App'
import DisplayStyle from '~/src/constants/displayStyle'
import { LightTheme, DarkTheme } from '~/src/constants/themeColor'
import Theme from '~/src/constants/theme'
import TimeFormat from '~/src/constants/timeFormat'
import Language from '~/src/constants/language'
import DefaultFonts from '@/utils/fonts'
import { MyWindow } from '~/src/types/global'
import { RootState } from '@/store'
;(window as any as MyWindow).ipcRenderer = ipcRenderer
const state = () => {
return {
theme: LightTheme,
fontSize: 14,
displayNameStyle: DisplayStyle.DisplayNameAndUsername.value,
notify: {
reply: true,
reblog: true,
favourite: true,
follow: true
},
timeFormat: TimeFormat.Absolute.value,
language: Language.en.key,
defaultFonts: DefaultFonts,
ignoreCW: false,
ignoreNSFW: false,
hideAllAttachments: false
}
}
const initStore = () => {
return {
namespaced: true,
state: state(),
actions: App.actions,
mutations: App.mutations
}
}
describe('App', () => {
let store: Store<RootState>
beforeEach(() => {
store = createStore({
modules: {
App: initStore()
}
})
})
describe('loadPreferences', () => {
describe('error', () => {
it('should not change', async () => {
ipcMain.handle('get-preferences', async () => {
throw new Error()
})
await store.dispatch('App/loadPreferences').catch(err => {
expect(err instanceof Error).toEqual(true)
expect(store.state.App.theme).toEqual(LightTheme)
})
ipcMain.removeHandler('get-preferences')
})
})
describe('success', () => {
it('should be changed', async () => {
ipcMain.handle('get-preferences', () => {
return {
general: {
timeline: {
cw: true,
nsfw: true
}
},
language: {
language: Language.en.key
},
notification: {
notify: {
reply: true,
reblog: true,
favourite: true,
follow: true
}
},
appearance: {
theme: Theme.Dark.key,
fontSize: 13,
displayNameStyle: DisplayStyle.DisplayNameAndUsername.value,
timeFormat: TimeFormat.Absolute.value,
customThemeColor: LightTheme,
font: DefaultFonts[0]
}
}
})
await store.dispatch('App/loadPreferences')
expect(store.state.App.fontSize).toEqual(13)
expect(store.state.App.theme).toEqual(DarkTheme)
expect(store.state.App.ignoreCW).toEqual(true)
expect(store.state.App.ignoreNSFW).toEqual(true)
ipcMain.removeHandler('get-preferences')
})
})
})
})

View File

@ -1,97 +0,0 @@
import { RootState } from '@/store'
import { createStore, Store } from 'vuex'
import { ipcMain, ipcRenderer } from '~/spec/mock/electron'
import GlobalHeader, { GlobalHeaderState } from '~/src/renderer/store/GlobalHeader'
import { MyWindow } from '~/src/types/global'
;((window as any) as MyWindow).ipcRenderer = ipcRenderer
const state = (): GlobalHeaderState => {
return {
accounts: [],
changing: false,
hide: false
}
}
const initStore = () => {
return {
namespaced: true,
state: state(),
actions: GlobalHeader.actions,
mutations: GlobalHeader.mutations
}
}
const routerState = {
namespaced: true,
state: {
params: {
id: 'account_id'
}
}
}
describe('GlobalHeader', () => {
let store: Store<RootState>
beforeEach(() => {
store = createStore({
modules: {
GlobalHeader: initStore(),
route: routerState
}
})
})
describe('listAccounts', () => {
beforeEach(() => {
ipcMain.handle('list-accounts', () => {
return ['account']
})
})
afterEach(() => {
ipcMain.removeHandler('list-accounts')
})
it('should be updated', async () => {
await store.dispatch('GlobalHeader/listAccounts')
expect(store.state.GlobalHeader.accounts).toEqual(['account'])
})
})
describe('removeShortcutEvents', () => {
it('should be removed', async () => {
const removed = await store.dispatch('GlobalHeader/removeShortcutEvents')
expect(removed).toEqual(true)
})
})
describe('loadHide', () => {
beforeEach(() => {
ipcMain.handle('get-global-header', () => {
return true
})
})
afterEach(() => {
ipcMain.removeHandler('get-global-header')
})
it('should be changed', async () => {
await store.dispatch('GlobalHeader/loadHide')
expect(store.state.GlobalHeader.hide).toEqual(true)
})
})
describe('switchHide', () => {
beforeEach(() => {
ipcMain.handle('change-global-header', (_, value) => {
return value
})
})
afterEach(() => {
ipcMain.removeHandler('change-global-header')
})
it('should be switched', async () => {
const hide = await store.dispatch('GlobalHeader/switchHide', true)
expect(hide).toEqual(true)
})
})
})

View File

@ -1,146 +0,0 @@
import { IpcMainInvokeEvent } from 'electron'
import { createStore, Store } from 'vuex'
import Theme from '~/src/constants/theme'
import DisplayStyle from '~/src/constants/displayStyle'
import TimeFormat from '~/src/constants/timeFormat'
import { LightTheme, DarkTheme } from '~/src/constants/themeColor'
import DefaultFonts from '@/utils/fonts'
import Appearance, { AppearanceState } from '@/store/Preferences/Appearance'
import { ipcMain, ipcRenderer } from '~/spec/mock/electron'
import { MyWindow } from '~/src/types/global'
import { RootState } from '@/store'
;(window as any as MyWindow).ipcRenderer = ipcRenderer
const state = (): AppearanceState => {
return {
appearance: {
theme: Theme.Light.key,
fontSize: 14,
displayNameStyle: DisplayStyle.DisplayNameAndUsername.value,
timeFormat: TimeFormat.Absolute.value,
customThemeColor: LightTheme,
font: DefaultFonts[0],
tootPadding: 8
},
fonts: []
}
}
const initStore = () => {
return {
namespaced: true,
state: state(),
actions: Appearance.actions,
mutations: Appearance.mutations
}
}
const preferencesStore = () => ({
namespaced: true,
modules: {
Appearance: initStore()
}
})
const App = {
namespaced: true,
actions: {
loadPreferences: jest.fn()
}
}
describe('Preferences/Appearance', () => {
let store: Store<RootState>
beforeEach(() => {
store = createStore({
modules: {
Preferences: preferencesStore(),
App: App
}
})
})
describe('load', () => {
describe('loadAppearance', () => {
beforeEach(() => {
ipcMain.handle('get-preferences', () => {
return {
appearance: {
theme: Theme.Dark.key,
fontSize: 15
}
}
})
})
afterEach(() => {
ipcMain.removeHandler('get-preferences')
})
it('should be loaded', async () => {
await store.dispatch('Preferences/Appearance/loadAppearance')
expect(store.state.Preferences.Appearance.appearance.theme).toEqual(Theme.Dark.key)
expect(store.state.Preferences.Appearance.appearance.fontSize).toEqual(15)
})
})
describe('loadFonts', () => {
beforeEach(() => {
ipcMain.handle('list-fonts', () => {
return ['my-font']
})
})
afterEach(() => {
ipcMain.removeHandler('list-fonts')
})
it('should be loaded', async () => {
await store.dispatch('Preferences/Appearance/loadFonts')
expect(store.state.Preferences.Appearance.fonts).toEqual([DefaultFonts[0], 'my-font'])
})
})
})
describe('update', () => {
beforeEach(() => {
ipcMain.handle('update-preferences', (_: IpcMainInvokeEvent, config: any) => {
return config
})
})
afterEach(() => {
ipcMain.removeHandler('update-preferences')
})
it('updateTheme', async () => {
await store.dispatch('Preferences/Appearance/updateTheme', Theme.Dark.key)
expect(store.state.Preferences.Appearance.appearance.theme).toEqual(Theme.Dark.key)
expect(App.actions.loadPreferences).toBeCalled()
})
it('updateFontSize', async () => {
await store.dispatch('Preferences/Appearance/updateFontSize', 15)
expect(store.state.Preferences.Appearance.appearance.fontSize).toEqual(15)
expect(App.actions.loadPreferences).toBeCalled()
})
it('updateDisplayNameStyle', async () => {
await store.dispatch('Preferences/Appearance/updateDisplayNameStyle', DisplayStyle.DisplayName.value)
expect(store.state.Preferences.Appearance.appearance.displayNameStyle).toEqual(DisplayStyle.DisplayName.value)
expect(App.actions.loadPreferences).toBeCalled()
})
it('updateTimeFormat', async () => {
await store.dispatch('Preferences/Appearance/updateTimeFormat', TimeFormat.Relative.value)
expect(store.state.Preferences.Appearance.appearance.timeFormat).toEqual(TimeFormat.Relative.value)
expect(App.actions.loadPreferences).toBeCalled()
})
it('updateCustomThemeColor', async () => {
await store.dispatch('Preferences/Appearance/updateCustomThemeColor', DarkTheme)
expect(store.state.Preferences.Appearance.appearance.customThemeColor).toEqual(DarkTheme)
expect(App.actions.loadPreferences).toBeCalled()
})
it('updateFont', async () => {
await store.dispatch('Preferences/Appearance/updateFont', DefaultFonts[1])
expect(store.state.Preferences.Appearance.appearance.font).toEqual(DefaultFonts[1])
expect(App.actions.loadPreferences).toBeCalled()
})
})
})

View File

@ -1,131 +0,0 @@
import { createStore, Store } from 'vuex'
import { ipcMain, ipcRenderer } from '~/spec/mock/electron'
import General, { GeneralState } from '@/store/Preferences/General'
import { MyWindow } from '~/src/types/global'
import { IpcMainInvokeEvent } from 'electron'
import { RootState } from '@/store'
;(window as any as MyWindow).ipcRenderer = ipcRenderer
const state = (): GeneralState => {
return {
general: {
sound: {
fav_rb: true,
toot: true
},
timeline: {
cw: false,
nsfw: false,
hideAllAttachments: false
},
other: {
launch: false,
hideOnLaunch: false
}
},
loading: false
}
}
const initStore = () => {
return {
namespaced: true,
state: state(),
actions: General.actions,
mutations: General.mutations
}
}
const preferencesStore = () => ({
namespaced: true,
modules: {
General: initStore()
}
})
const app = {
namespaced: true,
actions: {
loadPreferences(_) {
return true
}
}
}
describe('Preferences/General', () => {
let store: Store<RootState>
beforeEach(() => {
store = createStore({
modules: {
Preferences: preferencesStore(),
App: app
}
})
})
describe('loadGeneral', () => {
beforeEach(() => {
ipcMain.handle('get-preferences', () => {
return {
general: {
sound: {
fav_rb: false,
toot: false
}
}
}
})
})
afterEach(() => {
ipcMain.removeHandler('get-preferences')
})
it('should be updated', async () => {
await store.dispatch('Preferences/General/loadGeneral')
expect(store.state.Preferences.General.general.sound.fav_rb).toEqual(false)
expect(store.state.Preferences.General.general.sound.toot).toEqual(false)
expect(store.state.Preferences.General.loading).toEqual(false)
})
})
describe('updateSound', () => {
beforeEach(() => {
ipcMain.handle('update-preferences', (_: IpcMainInvokeEvent, config: any) => {
return config
})
})
afterEach(() => {
ipcMain.removeHandler('update-preferences')
})
it('should be updated', async () => {
await store.dispatch('Preferences/General/updateSound', {
fav_rb: false,
toot: false
})
expect(store.state.Preferences.General.general.sound.fav_rb).toEqual(false)
expect(store.state.Preferences.General.general.sound.toot).toEqual(false)
expect(store.state.Preferences.General.loading).toEqual(false)
})
})
describe('updateTimeline', () => {
beforeEach(() => {
ipcMain.handle('update-preferences', (_: IpcMainInvokeEvent, config: any) => {
return config
})
})
afterEach(() => {
ipcMain.removeHandler('update-preferences')
})
it('should be updated', async () => {
await store.dispatch('Preferences/General/updateTimeline', {
cw: true,
nsfw: true,
hideAllAttachments: true
})
expect(store.state.Preferences.General.general.timeline.cw).toEqual(true)
expect(store.state.Preferences.General.general.timeline.nsfw).toEqual(true)
expect(store.state.Preferences.General.general.timeline.hideAllAttachments).toEqual(true)
expect(store.state.Preferences.General.loading).toEqual(false)
})
})
})

View File

@ -1,85 +0,0 @@
import { createStore, Store } from 'vuex'
import { ipcMain, ipcRenderer } from '~/spec/mock/electron'
import Language, { LanguageState } from '@/store/Preferences/Language'
import DefaultLanguage from '~/src/constants/language'
import { MyWindow } from '~/src/types/global'
import { RootState } from '@/store'
;(window as any as MyWindow).ipcRenderer = ipcRenderer
const state = (): LanguageState => {
return {
language: {
language: DefaultLanguage.en.key,
spellchecker: {
enabled: true,
languages: []
}
}
}
}
const initStore = () => {
return {
namespaced: true,
state: state,
actions: Language.actions,
mutations: Language.mutations
}
}
const preferencesStore = () => ({
namespaced: true,
modules: {
Language: initStore()
}
})
describe('Preferences/Language', () => {
let store: Store<RootState>
beforeEach(() => {
store = createStore({
modules: {
Preferences: preferencesStore()
}
})
})
describe('loadLanguage', () => {
beforeEach(() => {
ipcMain.handle('get-preferences', () => {
return {
language: {
language: DefaultLanguage.ja.key,
spellchecker: {
enabled: true,
languages: []
}
}
}
})
})
afterEach(() => {
ipcMain.removeHandler('get-preferences')
})
it('should be updated', async () => {
await store.dispatch('Preferences/Language/loadLanguage')
expect(store.state.Preferences.Language.language.language).toEqual(DefaultLanguage.ja.key)
})
})
describe('changeLanguage', () => {
beforeEach(() => {
ipcMain.handle('change-language', (_, key: string) => {
return key
})
})
afterEach(() => {
ipcMain.removeHandler('change-language')
})
it('should be changed', async () => {
await store.dispatch('Preferences/Language/changeLanguage', DefaultLanguage.ja.key)
expect(store.state.Preferences.Language.language.language).toEqual(DefaultLanguage.ja.key)
})
})
})

View File

@ -1,132 +0,0 @@
import { createStore, Store } from 'vuex'
import { ipcMain, ipcRenderer } from '~/spec/mock/electron'
import Notification, { NotificationState } from '@/store/Preferences/Notification'
import { MyWindow } from '~/src/types/global'
import { RootState } from '@/store'
;(window as any as MyWindow).ipcRenderer = ipcRenderer
const state = (): NotificationState => {
return {
notification: {
notify: {
reply: true,
reblog: true,
favourite: true,
follow: true,
follow_request: true,
reaction: true,
status: true,
poll_vote: true,
poll_expired: true
}
}
}
}
const initStore = () => {
return {
namespaced: true,
state: state(),
actions: Notification.actions,
mutations: Notification.mutations
}
}
const preferencesStore = () => ({
namespaced: true,
modules: {
Notification: initStore()
}
})
const App = {
namespaced: true,
actions: {
loadPreferences: jest.fn()
}
}
describe('Preferences/Notification', () => {
let store: Store<RootState>
beforeEach(() => {
store = createStore({
modules: {
Preferences: preferencesStore(),
App: App
}
})
})
describe('loadNotification', () => {
beforeEach(() => {
ipcMain.handle('get-preferences', () => {
return {
notification: {
notify: {
reply: false,
reblog: false,
favourite: false,
follow: false,
follow_request: false,
reaction: false,
status: false,
poll_vote: false,
poll_expired: false
}
}
}
})
afterEach(() => {
ipcMain.removeHandler('get-preferences')
})
it('should be updated', async () => {
await store.dispatch('Preferences/Notification/loadNotification')
expect(store.state.Preferences.Notification.notification).toEqual({
notify: {
reply: false,
reblog: false,
favourite: false,
follow: false,
follow_request: false,
reaction: false,
status: false,
poll_vote: false,
poll_expired: false
}
})
})
})
})
describe('updateNotify', () => {
beforeEach(() => {
ipcMain.handle('update-preferences', (_, conf: object) => {
return conf
})
})
afterEach(() => {
ipcMain.removeHandler('update-preferences')
})
it('should be updated', async () => {
await store.dispatch('Preferences/Notification/updateNotify', {
reply: false,
reblog: false
})
expect(store.state.Preferences.Notification.notification).toEqual({
notify: {
reply: false,
reblog: false,
favourite: true,
follow: true,
follow_request: true,
reaction: true,
status: true,
poll_vote: true,
poll_expired: true
}
})
expect(App.actions.loadPreferences).toBeCalled()
})
})
})

Some files were not shown because too many files have changed in this diff Show More