project rename

This commit is contained in:
Eugene Pankov
2021-06-29 23:57:04 +02:00
parent c61be3d52b
commit 43cd3318da
609 changed files with 510 additions and 530 deletions

View File

@@ -1,4 +1,4 @@
owner: eugeny
repo: terminus
provider: github
updaterCacheDirName: terminus-updater
updaterCacheDirName: tabby-updater

View File

@@ -1,5 +1,5 @@
doctype html
html.terminus
html.tabby
head
meta(charset='UTF-8')
base(href='index.html')
@@ -15,8 +15,8 @@ html.terminus
app-root
.preload-logo
div
.terminus-logo
h1.terminus-title Terminus
.tabby-logo
h1.tabby-title Tabby
sup α
.progress
.bar(style='width: 0%')

View File

@@ -154,7 +154,7 @@ export class Application {
this.tray.setContextMenu(contextMenu)
}
this.tray.setToolTip(`Terminus ${app.getVersion()}`)
this.tray.setToolTip(`Tabby ${app.getVersion()}`)
}
disableTray (): void {
@@ -195,7 +195,7 @@ export class Application {
{
label: 'Application',
submenu: [
{ role: 'about', label: 'About Terminus' },
{ role: 'about', label: 'About Tabby' },
{ type: 'separator' },
{
label: 'Preferences',

View File

@@ -6,7 +6,7 @@ export function parseArgs (argv: string[], cwd: string): any {
}
return require('yargs/yargs')(argv.slice(1))
.usage('terminus [command] [arguments]')
.usage('tabby [command] [arguments]')
.command('open [directory]', 'open a shell in a directory', {
directory: { type: 'string', 'default': cwd },
})

View File

@@ -3,7 +3,20 @@ import * as path from 'path'
import * as yaml from 'js-yaml'
import { app } from 'electron'
export function migrateConfig (): void {
const configPath = path.join(app.getPath('userData'), 'config.yaml')
const legacyConfigPath = path.join(app.getPath('userData'), '../terminus', 'config.yaml')
if (fs.existsSync(legacyConfigPath) && (
!fs.existsSync(configPath) ||
fs.statSync(configPath).mtime < fs.statSync(legacyConfigPath).mtime
)) {
fs.writeFileSync(configPath, fs.readFileSync(legacyConfigPath))
}
}
export function loadConfig (): any {
migrateConfig()
const configPath = path.join(app.getPath('userData'), 'config.yaml')
if (fs.existsSync(configPath)) {
return yaml.load(fs.readFileSync(configPath, 'utf8'))

View File

@@ -7,8 +7,8 @@ import { parseArgs } from './cli'
import { Application } from './app'
import electronDebug = require('electron-debug')
if (!process.env.TERMINUS_PLUGINS) {
process.env.TERMINUS_PLUGINS = ''
if (!process.env.TABBY_PLUGINS) {
process.env.TABBY_PLUGINS = ''
}
const application = new Application()

View File

@@ -4,9 +4,6 @@ import * as electron from 'electron'
const appPath = path.dirname(electron.app.getPath('exe'))
if (fs.existsSync(path.join(appPath, 'terminus-data'))) {
fs.renameSync(path.join(appPath, 'terminus-data'), path.join(appPath, 'data'))
}
const portableData = path.join(appPath, 'data')
if (fs.existsSync(portableData)) {
console.log('reset user data to ' + portableData)

View File

@@ -8,7 +8,7 @@ try {
release = require('@electron/remote').app.getVersion()
}
if (!process.env.TERMINUS_DEV) {
if (!process.env.TABBY_DEV) {
init({
dsn: SENTRY_DSN,
release,

View File

@@ -56,7 +56,7 @@ export class Window {
const bwOptions: BrowserWindowConstructorOptions = {
width: 800,
height: 600,
title: 'Terminus',
title: 'Tabby',
minWidth: 400,
minHeight: 300,
webPreferences: {
@@ -118,7 +118,7 @@ export class Window {
})
this.window.on('blur', () => {
if (this.configStore.appearance.dock !== 'off' && this.configStore.appearance?.dockHideOnBlur) {
if (this.configStore.appearance?.dock !== 'off' && this.configStore.appearance?.dockHideOnBlur) {
this.hide()
}
})

View File

@@ -1,5 +1,5 @@
{
"name": "terminus",
"name": "tabby",
"description": "A terminal for a modern age",
"private": true,
"repository": "https://github.com/eugeny/terminus",
@@ -55,15 +55,15 @@
"source-map-support": "^0.5.19"
},
"peerDependencies": {
"terminus-community-color-schemes": "*",
"terminus-core": "*",
"terminus-electron": "*",
"terminus-local": "*",
"terminus-plugin-manager": "*",
"terminus-serial": "*",
"terminus-settings": "*",
"terminus-ssh": "*",
"terminus-terminal": "*"
"tabby-community-color-schemes": "*",
"tabby-core": "*",
"tabby-electron": "*",
"tabby-local": "*",
"tabby-plugin-manager": "*",
"tabby-serial": "*",
"tabby-settings": "*",
"tabby-ssh": "*",
"tabby-terminal": "*"
},
"resolutions": {
"*/node-abi": "^2.20.0"

View File

@@ -12,7 +12,7 @@ import { ipcRenderer } from 'electron'
import { getRootModule } from './app.module'
import { findPlugins, initModuleLookup, loadPlugins } from './plugins'
import { BootstrapData, BOOTSTRAP_DATA, PluginInfo } from '../../terminus-core/src/api/mainProcess'
import { BootstrapData, BOOTSTRAP_DATA, PluginInfo } from '../../tabby-core/src/api/mainProcess'
// Always land on the start view
location.hash = ''
@@ -23,7 +23,7 @@ if (process.platform === 'win32' && !('HOME' in process.env)) {
process.env.HOME = `${process.env.HOMEDRIVE}${process.env.HOMEPATH}`
}
if (process.env.TERMINUS_DEV && !process.env.TERMINUS_FORCE_ANGULAR_PROD) {
if (process.env.TABBY_DEV && !process.env.TABBY_FORCE_ANGULAR_PROD) {
console.warn('Running in debug mode')
} else {
enableProdMode()
@@ -42,7 +42,7 @@ async function bootstrap (bootstrapData: BootstrapData, plugins: PluginInfo[], s
const moduleRef = await platformBrowserDynamic([
{ provide: BOOTSTRAP_DATA, useValue: bootstrapData },
]).bootstrapModule(module)
if (process.env.TERMINUS_DEV) {
if (process.env.TABBY_DEV) {
const applicationRef = moduleRef.injector.get(ApplicationRef)
const componentRef = applicationRef.components[0]
enableDebugTools(componentRef)

View File

@@ -1,7 +1,7 @@
import * as fs from 'mz/fs'
import * as path from 'path'
import * as remote from '@electron/remote'
import { PluginInfo } from '../../terminus-core/src/api/mainProcess'
import { PluginInfo } from '../../tabby-core/src/api/mainProcess'
const nodeModule = require('module') // eslint-disable-line @typescript-eslint/no-var-requires
@@ -16,7 +16,7 @@ function normalizePath (p: string): string {
return p
}
const builtinPluginsPath = process.env.TERMINUS_DEV ? path.dirname(remote.app.getAppPath()) : path.join((process as any).resourcesPath, 'builtin-plugins')
const builtinPluginsPath = process.env.TABBY_DEV ? path.dirname(remote.app.getAppPath()) : path.join((process as any).resourcesPath, 'builtin-plugins')
const builtinModules = [
'@angular/animations',
@@ -30,10 +30,10 @@ const builtinModules = [
'ngx-toastr',
'rxjs',
'rxjs/operators',
'terminus-core',
'terminus-local',
'terminus-settings',
'terminus-terminal',
'tabby-core',
'tabby-local',
'tabby-settings',
'tabby-terminal',
'zone.js/dist/zone.js',
]
@@ -42,15 +42,15 @@ export type ProgressCallback = (current: number, total: number) => void // eslin
export function initModuleLookup (userPluginsPath: string): void {
global['module'].paths.map((x: string) => nodeModule.globalPaths.push(normalizePath(x)))
if (process.env.TERMINUS_DEV) {
if (process.env.TABBY_DEV) {
nodeModule.globalPaths.unshift(path.dirname(remote.app.getAppPath()))
}
nodeModule.globalPaths.unshift(builtinPluginsPath)
nodeModule.globalPaths.unshift(path.join(userPluginsPath, 'node_modules'))
// nodeModule.globalPaths.unshift(path.join((process as any).resourcesPath, 'app.asar', 'node_modules'))
if (process.env.TERMINUS_PLUGINS) {
process.env.TERMINUS_PLUGINS.split(':').map(x => nodeModule.globalPaths.push(normalizePath(x)))
if (process.env.TABBY_PLUGINS) {
process.env.TABBY_PLUGINS.split(':').map(x => nodeModule.globalPaths.push(normalizePath(x)))
}
const cachedBuiltinModules = {}
@@ -79,7 +79,8 @@ export async function findPlugins (): Promise<PluginInfo[]> {
const paths = nodeModule.globalPaths
let foundPlugins: PluginInfo[] = []
const candidateLocations: { pluginDir: string, packageName: string }[] = []
const PREFIX = 'terminus-'
const PREFIX = 'tabby-'
const LEGACY_PREFIX = 'terminus-'
const processedPaths = []
@@ -101,7 +102,7 @@ export async function findPlugins (): Promise<PluginInfo[]> {
})
}
for (const packageName of pluginNames) {
if (packageName.startsWith(PREFIX)) {
if (packageName.startsWith(PREFIX) || packageName.startsWith(LEGACY_PREFIX)) {
candidateLocations.push({ pluginDir, packageName })
}
}
@@ -114,7 +115,7 @@ export async function findPlugins (): Promise<PluginInfo[]> {
continue
}
const name = packageName.substring(PREFIX.length)
const name = packageName.startsWith(PREFIX) ? packageName.substring(PREFIX.length) : packageName.substring(LEGACY_PREFIX.length)
if (builtinModules.includes(packageName) && pluginDir !== builtinPluginsPath) {
continue
@@ -129,7 +130,7 @@ export async function findPlugins (): Promise<PluginInfo[]> {
try {
const info = JSON.parse(await fs.readFile(infoPath, { encoding: 'utf-8' }))
if (!info.keywords || !(info.keywords.includes('terminus-plugin') || info.keywords.includes('terminus-builtin-plugin'))) {
if (!info.keywords || !(info.keywords.includes('terminus-plugin') || info.keywords.includes('terminus-builtin-plugin') || !info.keywords.includes('tabby-plugin') || info.keywords.includes('tabby-builtin-plugin'))) {
continue
}
let author = info.author

View File

@@ -38,7 +38,7 @@
.terminus-logo {
.tabby-logo {
width: 120px;
height: 120px;
background: url('../assets/logo.svg');
@@ -48,7 +48,7 @@
}
.terminus-title {
.tabby-title {
color: #a1c5e4;
font-family: 'Source Sans Pro';
text-align: center;

View File

@@ -27,7 +27,7 @@
"dist",
"node_modules",
"*/node_modules",
"terminus*",
"tabby*",
"platforms"
]
}

View File

@@ -2,7 +2,7 @@ const path = require('path')
const webpack = require('webpack')
module.exports = {
name: 'terminus',
name: 'tabby',
target: 'node',
entry: {
'index.ignore': 'file-loader?name=index.html!pug-html-loader!' + path.resolve(__dirname, './index.pug'),
@@ -10,7 +10,7 @@ module.exports = {
preload: path.resolve(__dirname, 'src/entry.preload.ts'),
bundle: path.resolve(__dirname, 'src/entry.ts'),
},
mode: process.env.TERMINUS_DEV ? 'development' : 'production',
mode: process.env.TABBY_DEV ? 'development' : 'production',
optimization:{
minimize: false,
},

View File

@@ -3,12 +3,12 @@ const webpack = require('webpack')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
module.exports = {
name: 'terminus-main',
name: 'tabby-main',
target: 'electron-main',
entry: {
main: path.resolve(__dirname, 'lib/index.ts'),
},
mode: process.env.TERMINUS_DEV ? 'development' : 'production',
mode: process.env.TABBY_DEV ? 'development' : 'production',
context: __dirname,
devtool: 'source-map',
output: {