Browse Source

Basic tooling working, build broken

main
GreatBearShark 2 years ago
parent
commit
acb6da69ca
  1. 46
      index.html
  2. 12
      package.json
  3. 66
      src/utils.ts
  4. 34
      tsconfig.json
  5. 12
      vite.config.ts
  6. 1707
      yarn.lock

src/index.html → index.html

12
package.json

@ -6,17 +6,20 @@
"license": "AGPL-3.0-or-later",
"scripts": {
"api-test": "jest src/api_tests/api.spec.ts",
"build": "node generate_translations.js && EXTEND_ESLINT=true TSC_COMPILE_ON_ERROR=true react-scripts build",
"build": "node generate_translations.js && vite build",
"build_old": "node fuse prod",
"lint": "tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src",
"prebuild": "node generate_translations.js",
"prestart": "node generate_translations.js",
"start": "node generate_translations.js && EXTEND_ESLINT=true TSC_COMPILE_ON_ERROR=true PORT=4444 react-scripts start",
"dev": "vite --port 4444",
"start_old": "node fuse dev"
},
"keywords": [],
"dependencies": {
"@joeattardi/emoji-button": "^3.1.1",
"@pika/react": "^16.13.1",
"@pika/react-dom": "^16.13.1",
"@types/autosize": "^3.0.6",
"@types/js-cookie": "^2.2.6",
"@types/jwt-decode": "^2.2.1",
@ -30,7 +33,6 @@
"autosize": "^4.0.2",
"body-scroll-lock": "^3.0.3",
"bootswatch": "^4.3.1",
"browser-sync": "^2.26.12",
"choices.js": "^9.0.1",
"classcat": "^4.0.2",
"emoji-short-name": "^1.0.0",
@ -43,7 +45,6 @@
"markdown-it-emoji": "^1.4.0",
"markdown-it-for-inline": "^0.1.1",
"moment": "^2.24.0",
"node-fetch": "^2.6.0",
"parse-domain": "^3.0.2",
"prettier": "^2.0.4",
"psl": "^1.8.0",
@ -72,6 +73,7 @@
"eslint-plugin-inferno": "^7.14.3",
"eslint-plugin-jane": "^7.2.1",
"lint-staged": "^10.1.3",
"node-fetch": "^2.6.0",
"sortpack": "^2.1.4",
"source-map-loader": "^1.0.1",
"ts-jest": "^25.4.0",
@ -79,7 +81,9 @@
"ts-node": "^8.8.2",
"ts-transform-classcat": "^1.0.0",
"ts-transform-inferno": "^4.0.3",
"typescript": "^3.9.7"
"typescript": "^3.9.7",
"vite": "^1.0.0-rc.1",
"vite-plugin-react": "^3.0.0"
},
"extends": "@parcel/config-default",
"engines": {

66
src/utils.ts

@ -1,30 +1,30 @@
import 'moment/locale/es';
import 'moment/locale/el';
import 'moment/locale/eu';
import 'moment/locale/eo';
import 'moment/locale/de';
import 'moment/locale/zh-cn';
import 'moment/locale/fr';
import 'moment/locale/sv';
import 'moment/locale/ru';
import 'moment/locale/nl';
import 'moment/locale/it';
import 'moment/locale/fi';
import 'moment/locale/ca';
import 'moment/locale/fa';
import 'moment/locale/pl';
import 'moment/locale/pt-br';
import 'moment/locale/ja';
import 'moment/locale/ka';
import 'moment/locale/hi';
import 'moment/locale/gl';
import 'moment/locale/tr';
import 'moment/locale/hu';
import 'moment/locale/uk';
import 'moment/locale/sq';
import 'moment/locale/km';
import 'moment/locale/ga';
import 'moment/locale/sr';
// import 'moment/locale/es';
// import 'moment/locale/el';
// import 'moment/locale/eu';
// import 'moment/locale/eo';
// import 'moment/locale/de';
// import 'moment/locale/zh-cn';
// import 'moment/locale/fr';
// import 'moment/locale/sv';
// import 'moment/locale/ru';
// import 'moment/locale/nl';
// import 'moment/locale/it';
// import 'moment/locale/fi';
// import 'moment/locale/ca';
// import 'moment/locale/fa';
// import 'moment/locale/pl';
// import 'moment/locale/pt-br';
// import 'moment/locale/ja';
// import 'moment/locale/ka';
// import 'moment/locale/hi';
// import 'moment/locale/gl';
// import 'moment/locale/tr';
// import 'moment/locale/hu';
// import 'moment/locale/uk';
// import 'moment/locale/sq';
// import 'moment/locale/km';
// import 'moment/locale/ga';
// import 'moment/locale/sr';
import {
UserOperation,
@ -51,7 +51,7 @@ import { UserService, WebSocketService } from './services';
import Tribute from 'tributejs/src/Tribute.js';
import markdown_it from 'markdown-it';
import markdownitEmoji from 'markdown-it-emoji/light';
// import * as markdownitEmoji from 'markdown-it-emoji/light';
import markdown_it_container from 'markdown-it-container';
import iterator from 'markdown-it-for-inline';
import emojiShortName from 'emoji-short-name';
@ -180,9 +180,9 @@ export const md = new markdown_it({
}
},
})
.use(markdownitEmoji, {
defs: objectFlip(emojiShortName),
})
// .use(markdownitEmoji, {
// defs: objectFlip(emojiShortName),
// })
.use(iterator, 'url_new_win', 'link_open', function (tokens, idx) {
// make sure all inline links open in a new window and don't include the referrer
tokens[idx].attrPush(['target', '_blank']);
@ -464,8 +464,8 @@ export function setTheme(theme: string = 'darkly', loggedIn: boolean = false) {
// if the user is not logged in, we load the default themes and let the browser decide
if (!loggedIn) {
document.getElementById('default-light').removeAttribute('disabled');
document.getElementById('default-dark').removeAttribute('disabled');
document.getElementById('default-light')?.removeAttribute('disabled');
document.getElementById('default-dark')?.removeAttribute('disabled');
} else {
document
.getElementById('default-light')

34
tsconfig.json

@ -1,30 +1,26 @@
{
"compilerOptions": {
"module": "esnext",
"target": "es2016",
"sourceMap": true,
"inlineSources": true,
"jsx": "preserve",
"importHelpers": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"target": "ESNext",
"lib": [
"dom",
"dom.iterable",
"esnext"
"DOM",
"DOM.Iterable",
"ESNext"
],
"allowJs": true,
"skipLibCheck": true,
"types": [],
"allowJs": false,
"skipLibCheck": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
"noEmit": true,
"jsx": "react",
},
"include": [
"src"
"src", "public/assets"
]
}
}

12
vite.config.ts

@ -0,0 +1,12 @@
import * as reactPlugin from 'vite-plugin-react'
import type { UserConfig } from 'vite'
const config: UserConfig = {
jsx: 'react',
plugins: [reactPlugin],
optimizeDeps: {
include: ['markdown-it-container', 'moment']
}
}
export default config

1707
yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save