浏览代码

chore: ext path fix + noto-emoji build script

NGPixel 2 年之前
父节点
当前提交
278a9bef1d

+ 0 - 8
.eslintignore

@@ -1,8 +0,0 @@
-**/node_modules/**
-**/*.min.js
-assets/**
-client/libs/**
-coverage/**
-repo/**
-data/**
-logs/**

+ 8 - 0
.eslintrc.yml

@@ -14,3 +14,11 @@ globals:
   navigator: false
   window: false
   WIKI: true
+ignorePatterns:
+  - '**/node_modules/**'
+  - '**/*.min.js'
+  - 'assets/**'
+  - 'coverage/**'
+  - 'repo/**'
+  - 'data/**'
+  - 'logs/**'

+ 0 - 0
SECURITY.md → .github/SECURITY.md


+ 0 - 5
.gitignore

@@ -18,13 +18,8 @@ npm-debug.log*
 
 # Generated assets
 /assets
-/assets-legacy
 /server/views/base.pug
 
-# Webpack
-.webpack-cache
-.fusebox
-
 # Config Files
 /config.yml
 

+ 9 - 0
dev/noto-emoji-build/build.sh

@@ -0,0 +1,9 @@
+echo "Downloading latest assets..."
+wget -q -O noto-emoji.tar.gz https://github.com/googlefonts/noto-emoji/archive/refs/heads/main.tar.gz
+echo "Extracting assets..."
+tar --strip-components=1 -xzf noto-emoji.tar.gz noto-emoji-main/svg
+echo "Building asar..."
+npx @electron/asar pack svg noto-emoji.asar
+echo "Cleaning up..."
+rm -rf svg noto-emoji.tar.gz
+echo "Done."

+ 2 - 2
server/modules/extensions/puppeteer/ext.js

@@ -15,7 +15,7 @@ module.exports = {
   isInstallable: true,
   async check () {
     try {
-      this.isInstalled = await fs.pathExists(path.join(process.cwd(), 'node_modules/puppeteer-core/.local-chromium'))
+      this.isInstalled = await fs.pathExists(path.join(WIKI.SERVERPATH, 'node_modules/puppeteer-core/.local-chromium'))
     } catch (err) {
       this.isInstalled = false
     }
@@ -24,7 +24,7 @@ module.exports = {
   async install () {
     try {
       const { stdout, stderr } = await exec('node install.js', {
-        cwd: path.join(process.cwd(), 'node_modules/puppeteer-core'),
+        cwd: path.join(WIKI.SERVERPATH, 'node_modules/puppeteer-core'),
         timeout: 300000,
         windowsHide: true
       })

+ 3 - 3
server/modules/extensions/sharp/ext.js

@@ -15,17 +15,17 @@ module.exports = {
   isInstalled: false,
   isInstallable: true,
   async check () {
-    this.isInstalled = await fs.pathExists(path.join(process.cwd(), 'node_modules/sharp/wiki_installed.txt'))
+    this.isInstalled = await fs.pathExists(path.join(WIKI.SERVERPATH, 'node_modules/sharp/wiki_installed.txt'))
     return this.isInstalled
   },
   async install () {
     try {
       const { stdout, stderr } = await exec('node install/libvips && node install/dll-copy', {
-        cwd: path.join(process.cwd(), 'node_modules/sharp'),
+        cwd: path.join(WIKI.SERVERPATH, 'node_modules/sharp'),
         timeout: 120000,
         windowsHide: true
       })
-      await fs.ensureFile(path.join(process.cwd(), 'node_modules/sharp/wiki_installed.txt'))
+      await fs.ensureFile(path.join(WIKI.SERVERPATH, 'node_modules/sharp/wiki_installed.txt'))
       this.isInstalled = true
       WIKI.logger.info(stdout)
       WIKI.logger.warn(stderr)

+ 1 - 1
ux/src/components/EditorMarkdown.vue

@@ -494,7 +494,7 @@ onMounted(async () => {
   // this.cm.on('paste', this.onCmPaste)
 
   // // Render initial preview
-  // this.processContent(this.$store.get('editor/content'))
+  processContent(pageStore.content)
   nextTick(() => {
     cm.value.refresh()
     cm.value.focus()

+ 5 - 1
ux/src/components/EditorWysiwyg.vue

@@ -116,6 +116,7 @@ import { useMeta, useQuasar, setCssVar } from 'quasar'
 import { useI18n } from 'vue-i18n'
 
 import { useEditorStore } from 'src/stores/editor'
+import { useSiteStore } from 'src/stores/site'
 
 // QUASAR
 
@@ -124,6 +125,7 @@ const $q = useQuasar()
 // STORES
 
 const editorStore = useEditorStore()
+const siteStore = useSiteStore()
 
 // I18N
 
@@ -494,7 +496,9 @@ const menuBar = [
     icon: 'mdi-image-plus',
     title: 'Image',
     action: () => {
-      // TODO: insert image
+      siteStore.$patch({
+        overlay: 'FileManager'
+      })
     }
   },
   {