bootstrap 5 & angular 15 WIP

This commit is contained in:
Eugene Pankov 2023-02-05 18:58:58 +01:00
parent 153d11cfe2
commit a793c44b94
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
22 changed files with 727 additions and 554 deletions

View File

@ -1,15 +1,3 @@
parser: '@typescript-eslint/parser'
parserOptions:
project:
- tsconfig.json
- '*/tsconfig.typings.json'
extends:
- 'plugin:@typescript-eslint/all'
- plugin:import/recommended
- plugin:import/typescript
plugins:
- '@typescript-eslint'
- 'import'
settings: settings:
import/resolver: import/resolver:
typescript: true typescript: true
@ -19,126 +7,145 @@ env:
es6: true es6: true
node: true node: true
commonjs: true commonjs: true
rules:
'@typescript-eslint/semi': overrides:
- error - files: '*.mjs'
- never plugins:
'@typescript-eslint/indent': - 'import'
- error
- 4 - files: '*.ts'
'@typescript-eslint/explicit-member-accessibility': parser: '@typescript-eslint/parser'
- error parserOptions:
- accessibility: no-public project:
overrides: - tsconfig.json
parameterProperties: explicit - '*/tsconfig.typings.json'
'@typescript-eslint/no-require-imports': off extends:
'@typescript-eslint/no-parameter-properties': off - 'plugin:@typescript-eslint/all'
'@typescript-eslint/explicit-function-return-type': off - plugin:import/recommended
'@typescript-eslint/no-explicit-any': off - plugin:import/typescript
'@typescript-eslint/no-magic-numbers': off plugins:
'@typescript-eslint/member-delimiter-style': off - '@typescript-eslint'
'@typescript-eslint/promise-function-async': off - 'import'
'@typescript-eslint/require-array-sort-compare': off rules:
'@typescript-eslint/no-floating-promises': off '@typescript-eslint/semi':
'@typescript-eslint/prefer-readonly': off
'@typescript-eslint/require-await': off
'@typescript-eslint/strict-boolean-expressions': off
'@typescript-eslint/no-misused-promises':
- error
- checksVoidReturn: false
'@typescript-eslint/typedef': off
'@typescript-eslint/consistent-type-imports': off
'@typescript-eslint/sort-type-union-intersection-members': off
'@typescript-eslint/no-use-before-define':
- error
- classes: false
no-duplicate-imports: error
array-bracket-spacing:
- error
- never
block-scoped-var: error
brace-style: off
'@typescript-eslint/brace-style':
- error
- 1tbs
- allowSingleLine: true
computed-property-spacing:
- error
- never
comma-dangle: off
'@typescript-eslint/comma-dangle':
- error
- always-multiline
curly: error
eol-last: error
eqeqeq:
- error
- smart
max-depth:
- 1
- 5
max-statements:
- 1
- 80
no-multiple-empty-lines: error
no-mixed-spaces-and-tabs: error
no-trailing-spaces: error
'@typescript-eslint/no-unused-vars':
- error - error
- vars: all - never
args: after-used '@typescript-eslint/indent':
argsIgnorePattern: ^_ - error
no-undef: error - 4
no-var: error '@typescript-eslint/explicit-member-accessibility':
object-curly-spacing: off - error
'@typescript-eslint/object-curly-spacing': - accessibility: no-public
- error overrides:
- always parameterProperties: explicit
quote-props: '@typescript-eslint/no-require-imports': off
- warn '@typescript-eslint/no-parameter-properties': off
- as-needed '@typescript-eslint/explicit-function-return-type': off
- keywords: true '@typescript-eslint/no-explicit-any': off
numbers: true '@typescript-eslint/no-magic-numbers': off
quotes: off '@typescript-eslint/member-delimiter-style': off
'@typescript-eslint/quotes': '@typescript-eslint/promise-function-async': off
- error '@typescript-eslint/require-array-sort-compare': off
- single '@typescript-eslint/no-floating-promises': off
- allowTemplateLiterals: true '@typescript-eslint/prefer-readonly': off
'@typescript-eslint/no-confusing-void-expression': '@typescript-eslint/require-await': off
- error '@typescript-eslint/strict-boolean-expressions': off
- ignoreArrowShorthand: true '@typescript-eslint/no-misused-promises':
'@typescript-eslint/no-non-null-assertion': off - error
'@typescript-eslint/no-unnecessary-condition': - checksVoidReturn: false
- error '@typescript-eslint/typedef': off
- allowConstantLoopConditions: true '@typescript-eslint/consistent-type-imports': off
'@typescript-eslint/restrict-template-expressions': off '@typescript-eslint/sort-type-union-intersection-members': off
'@typescript-eslint/prefer-readonly-parameter-types': off '@typescript-eslint/no-use-before-define':
'@typescript-eslint/no-unsafe-member-access': off - error
'@typescript-eslint/no-unsafe-call': off - classes: false
'@typescript-eslint/no-unsafe-return': off no-duplicate-imports: error
'@typescript-eslint/no-unsafe-assignment': off array-bracket-spacing:
'@typescript-eslint/naming-convention': off - error
'@typescript-eslint/lines-between-class-members': - never
- error block-scoped-var: error
- exceptAfterSingleLine: true brace-style: off
'@typescript-eslint/dot-notation': off '@typescript-eslint/brace-style':
'@typescript-eslint/no-implicit-any-catch': off - error
'@typescript-eslint/member-ordering': off - 1tbs
'@typescript-eslint/no-var-requires': off - allowSingleLine: true
'@typescript-eslint/no-unsafe-argument': off computed-property-spacing:
'@typescript-eslint/restrict-plus-operands': off - error
'@typescript-eslint/space-infix-ops': off - never
'@typescript-eslint/no-type-alias': comma-dangle: off
- error '@typescript-eslint/comma-dangle':
- allowAliases: in-unions-and-intersections - error
allowLiterals: always - always-multiline
allowCallbacks: always curly: error
'@typescript-eslint/sort-type-constituents': off eol-last: error
'@typescript-eslint/parameter-properties': eqeqeq:
- error - error
- prefer: parameter-property - smart
'import/no-named-as-default-member': off max-depth:
'@typescript-eslint/consistent-type-exports': off - 1
'@typescript-eslint/consistent-generic-constructors': off - 5
'keyword-spacing': off max-statements:
'@typescript-eslint/keyword-spacing': off - 1
- 80
no-multiple-empty-lines: error
no-mixed-spaces-and-tabs: error
no-trailing-spaces: error
'@typescript-eslint/no-unused-vars':
- error
- vars: all
args: after-used
argsIgnorePattern: ^_
no-undef: error
no-var: error
object-curly-spacing: off
'@typescript-eslint/object-curly-spacing':
- error
- always
quote-props:
- warn
- as-needed
- keywords: true
numbers: true
quotes: off
'@typescript-eslint/quotes':
- error
- single
- allowTemplateLiterals: true
'@typescript-eslint/no-confusing-void-expression':
- error
- ignoreArrowShorthand: true
'@typescript-eslint/no-non-null-assertion': off
'@typescript-eslint/no-unnecessary-condition':
- error
- allowConstantLoopConditions: true
'@typescript-eslint/restrict-template-expressions': off
'@typescript-eslint/prefer-readonly-parameter-types': off
'@typescript-eslint/no-unsafe-member-access': off
'@typescript-eslint/no-unsafe-call': off
'@typescript-eslint/no-unsafe-return': off
'@typescript-eslint/no-unsafe-assignment': off
'@typescript-eslint/naming-convention': off
'@typescript-eslint/lines-between-class-members':
- error
- exceptAfterSingleLine: true
'@typescript-eslint/dot-notation': off
'@typescript-eslint/no-implicit-any-catch': off
'@typescript-eslint/member-ordering': off
'@typescript-eslint/no-var-requires': off
'@typescript-eslint/no-unsafe-argument': off
'@typescript-eslint/restrict-plus-operands': off
'@typescript-eslint/space-infix-ops': off
'@typescript-eslint/no-type-alias':
- error
- allowAliases: in-unions-and-intersections
allowLiterals: always
allowCallbacks: always
'@typescript-eslint/sort-type-constituents': off
'@typescript-eslint/parameter-properties':
- error
- prefer: parameter-property
'import/no-named-as-default-member': off
'@typescript-eslint/consistent-type-exports': off
'@typescript-eslint/consistent-generic-constructors': off
'keyword-spacing': off
'@typescript-eslint/keyword-spacing': off

View File

@ -47,7 +47,7 @@
"@types/mz": "2.7.4", "@types/mz": "2.7.4",
"@types/node": "18.7.23", "@types/node": "18.7.23",
"atomically": "^1.7.0", "atomically": "^1.7.0",
"ngx-filesize": "^2.0.16" "ngx-filesize": "^3.0.1"
}, },
"peerDependencies": { "peerDependencies": {
"tabby-community-color-schemes": "*", "tabby-community-color-schemes": "*",

View File

@ -6,5 +6,4 @@ import '@fortawesome/fontawesome-free/css/solid.css'
import '@fortawesome/fontawesome-free/css/brands.css' import '@fortawesome/fontawesome-free/css/brands.css'
import '@fortawesome/fontawesome-free/css/regular.css' import '@fortawesome/fontawesome-free/css/regular.css'
import '@fortawesome/fontawesome-free/css/fontawesome.css' import '@fortawesome/fontawesome-free/css/fontawesome.css'
import 'ngx-toastr/toastr.css'
import './preload.scss' import './preload.scss'

View File

@ -1,3 +1,5 @@
// TODO test toastr
app-root { app-root {
background: #1D272D; background: #1D272D;
} }

View File

@ -1,8 +1,9 @@
const path = require('path') import * as path from 'path'
const webpack = require('webpack') import wp from 'webpack'
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
const __dirname = path.dirname(new URL(import.meta.url).pathname)
module.exports = { const config = {
name: 'tabby-main', name: 'tabby-main',
target: 'electron-main', target: 'electron-main',
entry: { entry: {
@ -55,13 +56,15 @@ module.exports = {
'yargs/yargs': 'commonjs yargs/yargs', 'yargs/yargs': 'commonjs yargs/yargs',
}, },
plugins: [ plugins: [
new webpack.optimize.ModuleConcatenationPlugin(), new wp.optimize.ModuleConcatenationPlugin(),
new webpack.DefinePlugin({ new wp.DefinePlugin({
'process.type': '"main"', 'process.type': '"main"',
}), }),
], ],
} }
if (process.env.BUNDLE_ANALYZER) { if (process.env.BUNDLE_ANALYZER) {
module.exports.plugins.push(new BundleAnalyzerPlugin()) config.plugins.push(new BundleAnalyzerPlugin())
} }
export default () => config

View File

@ -1,7 +1,9 @@
const path = require('path') import * as path from 'path'
const webpack = require('webpack') import wp from 'webpack'
const __dirname = path.dirname(new URL(import.meta.url).pathname)
import linkerPlugin from '@angular/compiler-cli/linker/babel'
module.exports = { export default () => ({
name: 'tabby', name: 'tabby',
target: 'node', target: 'node',
entry: { entry: {
@ -28,6 +30,17 @@ module.exports = {
}, },
module: { module: {
rules: [ rules: [
{
test: /\.(m?)js$/,
loader: 'babel-loader',
options: {
compact: false,
plugins: [linkerPlugin],
},
resolve: {
fullySpecified: false,
},
},
{ {
test: /\.ts$/, test: /\.ts$/,
use: { use: {
@ -56,9 +69,9 @@ module.exports = {
path: 'commonjs path', path: 'commonjs path',
}, },
plugins: [ plugins: [
new webpack.optimize.ModuleConcatenationPlugin(), new wp.optimize.ModuleConcatenationPlugin(),
new webpack.DefinePlugin({ new wp.DefinePlugin({
'process.type': '"renderer"', 'process.type': '"renderer"',
}), }),
], ],
} })

View File

@ -1094,11 +1094,6 @@ figgy-pudding@^3.4.1, figgy-pudding@^3.5.1:
resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e"
integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==
"filesize@>= 4.0.0":
version "6.3.0"
resolved "https://registry.yarnpkg.com/filesize/-/filesize-6.3.0.tgz#dff53cfb3f104c9e422f346d53be8dbcc971bf11"
integrity sha512-ytx0ruGpDHKWVoiui6+BY/QMNngtDQ/pJaFwfBpQif0J63+E8DLdFyqS3NkKQn7vIruUEpoGD9JUJSg7Kp+I0g==
fill-range@^7.0.1: fill-range@^7.0.1:
version "7.0.1" version "7.0.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
@ -2261,13 +2256,12 @@ native-process-working-directory@^1.0.2:
dependencies: dependencies:
node-addon-api "^3.1.0" node-addon-api "^3.1.0"
ngx-filesize@^2.0.16: ngx-filesize@^3.0.1:
version "2.0.16" version "3.0.1"
resolved "https://registry.yarnpkg.com/ngx-filesize/-/ngx-filesize-2.0.16.tgz#fdaba04170edb6cfcdf7be932783cf913b03f016" resolved "https://registry.yarnpkg.com/ngx-filesize/-/ngx-filesize-3.0.1.tgz#620933ae181a1128905404e43b26abb99accba90"
integrity sha512-VdaCirE7hSyfQh8ZEmhzNEhbddiTYUHF4V6OX+KyTmnQSVx4hp9kmzDX5YlkIlmClI6wI+LZmH9/q7XS3fsMPA== integrity sha512-792I4fiG9EEPYjGib2+YTYAzfWIlccfy8uXNSXFFepuAntoS+eijLwnl0m7ajcQuNgbTtwEf9VmYIPN8mS3jqQ==
dependencies: dependencies:
filesize ">= 4.0.0" tslib "^2.3.0"
tslib "^2.0.0"
nice-try@^1.0.4: nice-try@^1.0.4:
version "1.0.5" version "1.0.5"
@ -3717,11 +3711,16 @@ tough-cookie@~2.5.0:
psl "^1.1.28" psl "^1.1.28"
punycode "^2.1.1" punycode "^2.1.1"
tslib@^2.0.0, tslib@^2.1.0: tslib@^2.1.0:
version "2.3.1" version "2.3.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
tslib@^2.3.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf"
integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==
tunnel-agent@^0.6.0: tunnel-agent@^0.6.0:
version "0.6.0" version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz"

View File

@ -1,17 +1,18 @@
{ {
"devDependencies": { "devDependencies": {
"@angular/animations": "^12.0.0", "@angular/animations": "^15.1.3",
"@angular/cdk": "^12.2.9", "@angular/cdk": "^15.1.3",
"@angular/common": "^12.0.0", "@angular/common": "^15.1.3",
"@angular/compiler": "^12.0.0", "@angular/compiler": "^15.1.3",
"@angular/compiler-cli": "^12.0.0", "@angular/compiler-cli": "^15.1.3",
"@angular/core": "^12.0.0", "@angular/core": "^15.1.3",
"@angular/forms": "^12.0.0", "@angular/forms": "^15.1.3",
"@angular/platform-browser": "^12.0.0", "@angular/platform-browser": "^15.1.3",
"@angular/platform-browser-dynamic": "^12.0.0", "@angular/platform-browser-dynamic": "^15.1.3",
"@biesbjerg/ngx-translate-extract-marker": "^1.0.0", "@biesbjerg/ngx-translate-extract-marker": "^1.0.0",
"@fortawesome/fontawesome-free": "^6.2.0", "@fortawesome/fontawesome-free": "^6.2.0",
"@ng-bootstrap/ng-bootstrap": "^10.0.0", "@ng-bootstrap/ng-bootstrap": "^14.0.1",
"@popperjs/core": "^2.11.6",
"@sentry/cli": "^1.74.3", "@sentry/cli": "^1.74.3",
"@sentry/electron": "^2.5.4", "@sentry/electron": "^2.5.4",
"@tabby-gang/to-string-loader": "^1.1.7-beta.2", "@tabby-gang/to-string-loader": "^1.1.7-beta.2",
@ -27,13 +28,14 @@
"@typescript-eslint/parser": "^5.45.0", "@typescript-eslint/parser": "^5.45.0",
"apply-loader": "2.0.0", "apply-loader": "2.0.0",
"axios": "^0.27.2", "axios": "^0.27.2",
"babel-loader": "^9.1.2",
"browserify-sign": "^4.2.1", "browserify-sign": "^4.2.1",
"clone-deep": "^4.0.1", "clone-deep": "^4.0.1",
"compare-versions": "^5", "compare-versions": "^5",
"core-js": "^3.21.1", "core-js": "^3.21.1",
"core-js-pure": "^3.21.1", "core-js-pure": "^3.21.1",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"css-loader": "^6.7.1", "css-loader": "^6.7.3",
"deep-equal": "2.0.5", "deep-equal": "2.0.5",
"electron": "21.3.1", "electron": "21.3.1",
"electron-builder": "^24.0.0-alpha.1", "electron-builder": "^24.0.0-alpha.1",
@ -52,7 +54,7 @@
"lru-cache": "^6.0.0", "lru-cache": "^6.0.0",
"macos-release": "^3.1.0", "macos-release": "^3.1.0",
"ngx-sortablejs": "^11.1.0", "ngx-sortablejs": "^11.1.0",
"ngx-toastr": "^14.0.0", "ngx-toastr": "^16.0.2",
"node-abi": "^3.25.0", "node-abi": "^3.25.0",
"npmlog": "6.0.2", "npmlog": "6.0.2",
"npx": "^10.2.2", "npx": "^10.2.2",
@ -66,28 +68,29 @@
"pug-static-loader": "2.0.0", "pug-static-loader": "2.0.0",
"raw-loader": "4.0.2", "raw-loader": "4.0.2",
"sass": "^1.58.0", "sass": "^1.58.0",
"sass-loader": "^12.6.0", "sass-loader": "^13.2.0",
"shell-quote": "^1.7.4", "shell-quote": "^1.7.4",
"shelljs": "0.8.5", "shelljs": "0.8.5",
"slugify": "^1.6.5", "slugify": "^1.6.5",
"sortablejs": "^1.15.0", "sortablejs": "^1.15.0",
"source-code-pro": "^2.38.0", "source-code-pro": "^2.38.0",
"source-map-loader": "^3.0.1", "source-map-loader": "^4.0.1",
"source-sans-pro": "3.6.0", "source-sans-pro": "3.6.0",
"ssh2": "Eugeny/ssh2#9de907d62907d6d45debdcc0ed8dda5b7b19dc7c", "ssh2": "Eugeny/ssh2#9de907d62907d6d45debdcc0ed8dda5b7b19dc7c",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",
"svg-inline-loader": "^0.8.2", "svg-inline-loader": "^0.8.2",
"thenby": "^1.3.4", "thenby": "^1.3.4",
"ts-loader": "^9.4.2", "ts-loader": "^9.4.2",
"tslib": "^2.4.0", "tsimportlib": "^0.0.3",
"tslib": "^2.5.0",
"typedoc": "^0.22.18", "typedoc": "^0.22.18",
"typescript": "^4.3.5", "typescript": "^4.9.5",
"utils-decorators": "^1.10.4", "utils-decorators": "^1.10.4",
"val-loader": "4.0.0", "val-loader": "5.0.1",
"webpack": "^5.75.0", "webpack": "^5.75.0",
"webpack-bundle-analyzer": "^4.7.0", "webpack-bundle-analyzer": "^4.7.0",
"webpack-cli": "^5.0.0", "webpack-cli": "^5.0.1",
"yaml-loader": "0.6.0", "yaml-loader": "0.8.0",
"zone.js": "^0.11.5" "zone.js": "^0.11.5"
}, },
"resolutions": { "resolutions": {
@ -110,5 +113,6 @@
"i18n:extract": "node scripts/i18n-extract.js", "i18n:extract": "node scripts/i18n-extract.js",
"i18n:push": "crowdin push" "i18n:push": "crowdin push"
}, },
"type": "module",
"private": true "private": true
} }

View File

@ -1,7 +1,7 @@
#!/usr/bin/env node #!/usr/bin/env node
const sh = require('shelljs') import sh from 'shelljs'
const vars = require('./vars') import * as vars from './vars.mjs'
const log = require('npmlog') import log from 'npmlog'
log.info('patch') log.info('patch')
sh.exec(`yarn patch-package`, { fatal: true }) sh.exec(`yarn patch-package`, { fatal: true })

View File

@ -1,53 +1,55 @@
const path = require('path') import * as path from 'path'
const fs = require('fs') import * as fs from 'fs'
const semver = require('semver') import * as semver from 'semver'
const childProcess = require('child_process') import * as childProcess from 'child_process'
const __dirname = path.dirname(new URL(import.meta.url).pathname)
const electronInfo = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../node_modules/electron/package.json'))) const electronInfo = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../node_modules/electron/package.json')))
exports.version = childProcess.execSync('git describe --tags', { encoding:'utf-8' }) export let version = childProcess.execSync('git describe --tags', { encoding:'utf-8' })
exports.version = exports.version.substring(1).trim() version = version.substring(1).trim()
exports.version = exports.version.replace('-', '-c') version = version.replace('-', '-c')
if (exports.version.includes('-c')) { if (version.includes('-c')) {
exports.version = semver.inc(exports.version, 'prepatch').replace('-0', `-nightly.${process.env.REV ?? 0}`) version = semver.inc(version, 'prepatch').replace('-0', `-nightly.${process.env.REV ?? 0}`)
} }
exports.builtinPlugins = [ export const builtinPlugins = [
'tabby-core', 'tabby-core',
'tabby-settings', // 'tabby-settings',
'tabby-terminal', // 'tabby-terminal',
'tabby-web', // 'tabby-web',
'tabby-community-color-schemes', // 'tabby-community-color-schemes',
'tabby-ssh', // 'tabby-ssh',
'tabby-serial', // 'tabby-serial',
'tabby-telnet', // 'tabby-telnet',
'tabby-electron', // 'tabby-electron',
'tabby-local', // 'tabby-local',
'tabby-plugin-manager', // 'tabby-plugin-manager',
'tabby-linkifier', // 'tabby-linkifier',
] ]
exports.packagesWithDocs = [ export const packagesWithDocs = [
['.', 'tabby-core'], ['.', 'tabby-core'],
['terminal', 'tabby-terminal'], ['terminal', 'tabby-terminal'],
['local', 'tabby-local'], ['local', 'tabby-local'],
['settings', 'tabby-settings'], ['settings', 'tabby-settings'],
] ]
exports.allPackages = [ export const allPackages = [
...exports.builtinPlugins, ...builtinPlugins,
'web', 'web',
'tabby-web-demo', 'tabby-web-demo',
] ]
exports.bundledModules = [ export const bundledModules = [
'@angular', '@angular',
'@ng-bootstrap', '@ng-bootstrap',
] ]
exports.electronVersion = electronInfo.version export const electronVersion = electronInfo.version
exports.keygenConfig = { export const keygenConfig = {
provider: 'keygen', provider: 'keygen',
account: 'a06315f2-1031-47c6-9181-e92a20ec815e', account: 'a06315f2-1031-47c6-9181-e92a20ec815e',
channel: 'stable', channel: 'stable',
@ -70,6 +72,6 @@ exports.keygenConfig = {
}[process.platform], }[process.platform],
} }
if (!exports.keygenConfig.product) { if (!keygenConfig.product) {
throw new Error(`Unrecognized platform ${process.platform}/${process.env.ARCH ?? process.arch}`) throw new Error(`Unrecognized platform ${process.platform}/${process.env.ARCH ?? process.arch}`)
} }

View File

@ -24,7 +24,6 @@
"js-yaml": "^4.0.0", "js-yaml": "^4.0.0",
"messageformat": "^2.3.0", "messageformat": "^2.3.0",
"mixpanel": "^0.17.0", "mixpanel": "^0.17.0",
"ngx-filesize": "^2.0.16",
"ngx-perfect-scrollbar": "^10.1.0", "ngx-perfect-scrollbar": "^10.1.0",
"ngx-translate-messageformat-compiler": "^4.11.0", "ngx-translate-messageformat-compiler": "^4.11.0",
"readable-stream": "4.2.0", "readable-stream": "4.2.0",

View File

@ -1,5 +0,0 @@
const config = require('../webpack.plugin.config')
module.exports = config({
name: 'core',
dirname: __dirname,
})

View File

@ -0,0 +1,8 @@
import * as path from 'path'
const __dirname = path.dirname(new URL(import.meta.url).pathname)
import config from '../webpack.plugin.config.mjs'
export default () => config({
name: 'core',
dirname: __dirname,
})

View File

@ -9,7 +9,7 @@ import { SettingsTabProvider } from '../api'
export class SettingsTabBodyComponent { export class SettingsTabBodyComponent {
@Input() provider: SettingsTabProvider @Input() provider: SettingsTabProvider
@ViewChild('placeholder', { read: ViewContainerRef }) placeholder: ViewContainerRef @ViewChild('placeholder', { read: ViewContainerRef }) placeholder: ViewContainerRef
component: ComponentRef<Component> component: ComponentRef<unknown>
constructor (private componentFactoryResolver: ComponentFactoryResolver) { } constructor (private componentFactoryResolver: ComponentFactoryResolver) { }

View File

@ -666,9 +666,9 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
let wheelDeltaY = 0 let wheelDeltaY = 0
if ('wheelDeltaY' in event) { if ('wheelDeltaY' in event) {
wheelDeltaY = (event as WheelEvent)['wheelDeltaY'] wheelDeltaY = (event as unknown as WheelEvent)['wheelDeltaY']
} else { } else {
wheelDeltaY = (event as WheelEvent).deltaY wheelDeltaY = (event as unknown as WheelEvent).deltaY
} }
if (event.altKey) { if (event.altKey) {

View File

@ -4,7 +4,6 @@ import '@fortawesome/fontawesome-free/css/solid.css'
import '@fortawesome/fontawesome-free/css/brands.css' import '@fortawesome/fontawesome-free/css/brands.css'
import '@fortawesome/fontawesome-free/css/regular.css' import '@fortawesome/fontawesome-free/css/regular.css'
import '@fortawesome/fontawesome-free/css/fontawesome.css' import '@fortawesome/fontawesome-free/css/fontawesome.css'
import 'ngx-toastr/toastr.css'
import '../app/src/preload.scss' import '../app/src/preload.scss'
// Required before other imports // Required before other imports

View File

@ -1,4 +1,5 @@
const path = require('path') import * as path from 'path'
const __dirname = path.dirname(new URL(import.meta.url).pathname)
const externals = {} const externals = {}
for (const key of [ for (const key of [
@ -20,7 +21,7 @@ for (const key of [
externals[key] = `commonjs ${key}` externals[key] = `commonjs ${key}`
} }
module.exports = { const config = {
name: 'tabby-web-entry', name: 'tabby-web-entry',
target: 'web', target: 'web',
entry: { entry: {
@ -70,3 +71,5 @@ module.exports = {
}, },
externals, externals,
} }
export default config

View File

@ -1,14 +0,0 @@
const log = require('npmlog')
const { builtinPlugins } = require('./scripts/vars')
const paths = [
'./app/webpack.config.js',
'./app/webpack.main.config.js',
'./web/webpack.config.js',
'./tabby-web-demo/webpack.config.js',
...builtinPlugins.map(x => `./${x}/webpack.config.js`),
]
paths.forEach(x => log.info(`Using config: ${x}`))
module.exports = paths.map(x => require(x))

15
webpack.config.mjs Normal file
View File

@ -0,0 +1,15 @@
import log from 'npmlog'
import { builtinPlugins } from './scripts/vars.mjs'
const paths = [
'./app/webpack.config.mjs',
'./app/webpack.config.main.mjs',
// './web/webpack.config.mjs',
// './tabby-web-demo/webpack.config.mjs',
...builtinPlugins.map(x => `./${x}/webpack.config.mjs`),
]
paths.forEach(x => log.info(`Using config: ${x}`))
const config = await Promise.all(paths.map(x => import(x).then(x => x.default())))
export default () => config

View File

@ -1,25 +1,27 @@
const path = require('path') import * as path from 'path'
const webpack = require('webpack') import wp from 'webpack'
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
const bundleAnalyzer = new BundleAnalyzerPlugin({ const bundleAnalyzer = new BundleAnalyzerPlugin({
analyzerPort: 0, analyzerPort: 0,
}) })
module.exports = options => { import linkerPlugin from '@angular/compiler-cli/linker/babel'
export default options => {
const sourceMapOptions = { const sourceMapOptions = {
exclude: [/node_modules/, /vendor/], exclude: [/node_modules/, /vendor/],
filename: '[file].map', filename: '[file].map',
moduleFilenameTemplate: `webpack-tabby-${options.name}:///[resource-path]`, moduleFilenameTemplate: `webpack-tabby-${options.name}:///[resource-path]`,
} }
let SourceMapDevToolPlugin = webpack.SourceMapDevToolPlugin let devtoolPlugin = wp.SourceMapDevToolPlugin
if (process.env.CI) { if (process.env.CI) {
sourceMapOptions.append = '\n//# sourceMappingURL=../../../app.asar.unpacked/assets/webpack/[url]' sourceMapOptions.append = '\n//# sourceMappingURL=../../../app.asar.unpacked/assets/webpack/[url]'
} }
if (process.platform === 'win32' && process.env.TABBY_DEV) { if (process.platform === 'win32' && process.env.TABBY_DEV) {
SourceMapDevToolPlugin = webpack.EvalSourceMapDevToolPlugin devtoolPlugin = wp.EvalSourceMapDevToolPlugin
} }
const isDev = !!process.env.TABBY_DEV const isDev = !!process.env.TABBY_DEV
@ -53,6 +55,17 @@ module.exports = options => {
module: { module: {
rules: [ rules: [
...options.rules ?? [], ...options.rules ?? [],
{
test: /\.mjs$/,
loader: 'babel-loader',
options: {
compact: false,
plugins: [linkerPlugin],
},
resolve: {
fullySpecified: false,
},
},
{ {
test: /\.js$/, test: /\.js$/,
enforce: 'pre', enforce: 'pre',
@ -84,7 +97,7 @@ module.exports = options => {
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'], exclude: /(theme.*|component)\.scss/ }, { test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'], exclude: /(theme.*|component)\.scss/ },
{ test: /\.css$/, use: ['@tabby-gang/to-string-loader', 'css-loader'], include: /component\.css/ }, { test: /\.css$/, use: ['@tabby-gang/to-string-loader', 'css-loader'], include: /component\.css/ },
{ test: /\.css$/, use: ['style-loader', 'css-loader'], exclude: /component\.css/ }, { test: /\.css$/, use: ['style-loader', 'css-loader'], exclude: /component\.css/ },
{ test: /\.yaml$/, use: ['json-loader', 'yaml-loader'] }, { test: /\.yaml$/, use: ['yaml-loader'] },
{ test: /\.svg/, use: ['svg-inline-loader'] }, { test: /\.svg/, use: ['svg-inline-loader'] },
{ {
test: /\.(eot|otf|woff|woff2|ogg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, test: /\.(eot|otf|woff|woff2|ogg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
@ -134,7 +147,7 @@ module.exports = options => {
...options.externals || [], ...options.externals || [],
], ],
plugins: [ plugins: [
new SourceMapDevToolPlugin(sourceMapOptions), new devtoolPlugin(sourceMapOptions),
], ],
} }
if (process.env.PLUGIN_BUNDLE_ANALYZER === options.name) { if (process.env.PLUGIN_BUNDLE_ANALYZER === options.name) {

744
yarn.lock

File diff suppressed because it is too large Load Diff