mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	#12: Set up client dependencies
This commit is contained in:
		
							parent
							
								
									6cf79fdcd4
								
							
						
					
					
						commit
						78791024bc
					
				
							
								
								
									
										1
									
								
								client/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								client/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| node_modules | ||||
							
								
								
									
										1724
									
								
								client/package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										1724
									
								
								client/package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										28
									
								
								client/package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								client/package.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,28 @@ | ||||
| { | ||||
|   "name": "client", | ||||
|   "version": "1.0.0", | ||||
|   "description": "", | ||||
|   "main": "index.js", | ||||
|   "scripts": { | ||||
|     "test": "echo \"Error: no test specified\" && exit 1" | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "@excalidraw/excalidraw": "0.17.3", | ||||
|     "boxicons": "2.1.4", | ||||
|     "dayjs-plugin-utc": "0.1.2", | ||||
|     "dayjs": "1.11.10", | ||||
|     "force-graph": "1.43.5", | ||||
|     "jquery-hotkeys": "0.2.2", | ||||
|     "jquery": "3.7.1", | ||||
|     "katex": "0.16.9", | ||||
|     "mermaid": "10.9.0", | ||||
|     "panzoom": "9.4.3", | ||||
|     "print-this": "2.0.0", | ||||
|     "react-dom": "18.2.0", | ||||
|     "react": "18.2.0", | ||||
|     "split.js": "1.6.5" | ||||
|   }, | ||||
|   "keywords": [], | ||||
|   "author": "", | ||||
|   "license": "ISC" | ||||
| } | ||||
| @ -33,28 +33,16 @@ | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "@electron/remote": "2.1.2", | ||||
|     "@excalidraw/excalidraw": "0.17.3", | ||||
|     "boxicons": "2.1.4", | ||||
|     "chokidar": "3.6.0", | ||||
|     "electron-debug": "3.2.0", | ||||
|     "electron-dl": "3.5.2", | ||||
|     "electron-window-state": "5.0.3", | ||||
|     "force-graph": "1.43.5", | ||||
|     "http-proxy-agent": "7.0.2", | ||||
|     "https-proxy-agent": "7.0.4", | ||||
|     "jquery": "3.7.1", | ||||
|     "jquery-hotkeys": "0.2.2", | ||||
|     "katex": "0.16.9", | ||||
|     "mermaid": "10.9.0", | ||||
|     "node-abi": "3.56.0", | ||||
|     "open": "8.4.1", | ||||
|     "panzoom": "9.4.3", | ||||
|     "print-this": "2.0.0", | ||||
|     "react": "18.2.0", | ||||
|     "react-dom": "18.2.0", | ||||
|     "request": "2.88.2", | ||||
|     "rimraf": "5.0.5", | ||||
|     "split.js": "1.6.5", | ||||
|     "tree-kill": "1.2.2" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|  | ||||
| @ -15,60 +15,60 @@ const persistentCacheStatic = (root: string, options?: serveStatic.ServeStaticOp | ||||
| }; | ||||
| 
 | ||||
| function register(app: express.Application) { | ||||
|     const srcRoot = path.join(__dirname, '..'); | ||||
|     app.use(`/${assetPath}/app`, persistentCacheStatic(path.join(srcRoot, 'public/app'))); | ||||
|     app.use(`/${assetPath}/app-dist`, persistentCacheStatic(path.join(srcRoot, 'public/app-dist'))); | ||||
|     app.use(`/${assetPath}/fonts`, persistentCacheStatic(path.join(srcRoot, 'public/fonts'))); | ||||
|     app.use(`/assets/vX/fonts`, express.static(path.join(srcRoot, 'public/fonts'))); | ||||
|     app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(srcRoot, '..', 'images'))); | ||||
|     app.use(`/assets/vX/images`, express.static(path.join(srcRoot, '..', 'images'))); | ||||
|     app.use(`/${assetPath}/stylesheets`, persistentCacheStatic(path.join(srcRoot, 'public/stylesheets'))); | ||||
|     app.use(`/assets/vX/stylesheets`, express.static(path.join(srcRoot, 'public/stylesheets'))); | ||||
|     app.use(`/${assetPath}/libraries`, persistentCacheStatic(path.join(srcRoot, '..', 'libraries'))); | ||||
|     app.use(`/assets/vX/libraries`, express.static(path.join(srcRoot, '..', 'libraries'))); | ||||
|     const srcRoot = path.join(__dirname, '..', '..', '..', 'client'); | ||||
|     app.use(`/${assetPath}/app`, persistentCacheStatic(path.join(srcRoot, 'src'))); | ||||
|     app.use(`/${assetPath}/app-dist`, persistentCacheStatic(path.join(srcRoot, 'src-dist'))); | ||||
|     app.use(`/${assetPath}/fonts`, persistentCacheStatic(path.join(srcRoot, 'assets/fonts'))); | ||||
|     app.use(`/assets/vX/fonts`, express.static(path.join(srcRoot, 'assets/fonts'))); | ||||
|     app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(srcRoot, 'images'))); | ||||
|     app.use(`/assets/vX/images`, express.static(path.join(srcRoot, 'images'))); | ||||
|     app.use(`/${assetPath}/stylesheets`, persistentCacheStatic(path.join(srcRoot, 'assets/stylesheets'))); | ||||
|     app.use(`/assets/vX/stylesheets`, express.static(path.join(srcRoot, 'assets/stylesheets'))); | ||||
|     app.use(`/${assetPath}/libraries`, persistentCacheStatic(path.join(srcRoot, 'libraries'))); | ||||
|     app.use(`/assets/vX/libraries`, express.static(path.join(srcRoot, 'libraries'))); | ||||
| 
 | ||||
|     // excalidraw-view mode in shared notes
 | ||||
|     app.use(`/${assetPath}/node_modules/react/umd/react.production.min.js`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/react/umd/react.production.min.js'))); | ||||
|     app.use(`/${assetPath}/node_modules/react/umd/react.development.js`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/react/umd/react.development.js'))); | ||||
|     app.use(`/${assetPath}/node_modules/react-dom/umd/react-dom.production.min.js`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/react-dom/umd/react-dom.production.min.js'))); | ||||
|     app.use(`/${assetPath}/node_modules/react-dom/umd/react-dom.development.js`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/react-dom/umd/react-dom.development.js'))); | ||||
|     app.use(`/${assetPath}/node_modules/react/umd/react.production.min.js`, persistentCacheStatic(path.join(srcRoot, 'node_modules/react/umd/react.production.min.js'))); | ||||
|     app.use(`/${assetPath}/node_modules/react/umd/react.development.js`, persistentCacheStatic(path.join(srcRoot, 'node_modules/react/umd/react.development.js'))); | ||||
|     app.use(`/${assetPath}/node_modules/react-dom/umd/react-dom.production.min.js`, persistentCacheStatic(path.join(srcRoot, 'node_modules/react-dom/umd/react-dom.production.min.js'))); | ||||
|     app.use(`/${assetPath}/node_modules/react-dom/umd/react-dom.development.js`, persistentCacheStatic(path.join(srcRoot, 'node_modules/react-dom/umd/react-dom.development.js'))); | ||||
|     // expose the whole dist folder since complete assets are needed in edit and share
 | ||||
|     app.use(`/node_modules/@excalidraw/excalidraw/dist/`, express.static(path.join(srcRoot, '..', 'node_modules/@excalidraw/excalidraw/dist/'))); | ||||
|     app.use(`/${assetPath}/node_modules/@excalidraw/excalidraw/dist/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/@excalidraw/excalidraw/dist/'))); | ||||
|     app.use(`/node_modules/@excalidraw/excalidraw/dist/`, express.static(path.join(srcRoot, 'node_modules/@excalidraw/excalidraw/dist/'))); | ||||
|     app.use(`/${assetPath}/node_modules/@excalidraw/excalidraw/dist/`, persistentCacheStatic(path.join(srcRoot, 'node_modules/@excalidraw/excalidraw/dist/'))); | ||||
| 
 | ||||
|     // KaTeX
 | ||||
|     app.use( | ||||
|       `/${assetPath}/node_modules/katex/dist/katex.min.js`, | ||||
|       persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/katex/dist/katex.min.js'))); | ||||
|       persistentCacheStatic(path.join(srcRoot, 'node_modules/katex/dist/katex.min.js'))); | ||||
|     app.use( | ||||
|       `/${assetPath}/node_modules/katex/dist/contrib/mhchem.min.js`, | ||||
|       persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/katex/dist/contrib/mhchem.min.js'))); | ||||
|       persistentCacheStatic(path.join(srcRoot, 'node_modules/katex/dist/contrib/mhchem.min.js'))); | ||||
|     app.use( | ||||
|       `/${assetPath}/node_modules/katex/dist/contrib/auto-render.min.js`, | ||||
|       persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/katex/dist/contrib/auto-render.min.js'))); | ||||
|       persistentCacheStatic(path.join(srcRoot, 'node_modules/katex/dist/contrib/auto-render.min.js'))); | ||||
|     // expose the whole dist folder
 | ||||
|     app.use(`/node_modules/katex/dist/`, | ||||
|       express.static(path.join(srcRoot, '..', 'node_modules/katex/dist/'))); | ||||
|       express.static(path.join(srcRoot, 'node_modules/katex/dist/'))); | ||||
|     app.use(`/${assetPath}/node_modules/katex/dist/`, | ||||
|       persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/katex/dist/'))); | ||||
|       persistentCacheStatic(path.join(srcRoot, 'node_modules/katex/dist/'))); | ||||
| 
 | ||||
|     app.use(`/${assetPath}/node_modules/dayjs/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/dayjs/'))); | ||||
|     app.use(`/${assetPath}/node_modules/force-graph/dist/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/force-graph/dist/'))); | ||||
|     app.use(`/${assetPath}/node_modules/dayjs/`, persistentCacheStatic(path.join(srcRoot, 'node_modules/dayjs/'))); | ||||
|     app.use(`/${assetPath}/node_modules/force-graph/dist/`, persistentCacheStatic(path.join(srcRoot, 'node_modules/force-graph/dist/'))); | ||||
| 
 | ||||
|     app.use(`/${assetPath}/node_modules/boxicons/css/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/boxicons/css/'))); | ||||
|     app.use(`/${assetPath}/node_modules/boxicons/fonts/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/boxicons/fonts/'))); | ||||
|     app.use(`/${assetPath}/node_modules/boxicons/css/`, persistentCacheStatic(path.join(srcRoot, 'node_modules/boxicons/css/'))); | ||||
|     app.use(`/${assetPath}/node_modules/boxicons/fonts/`, persistentCacheStatic(path.join(srcRoot, 'node_modules/boxicons/fonts/'))); | ||||
| 
 | ||||
|     app.use(`/${assetPath}/node_modules/mermaid/dist/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/mermaid/dist/'))); | ||||
|     app.use(`/${assetPath}/node_modules/mermaid/dist/`, persistentCacheStatic(path.join(srcRoot, 'node_modules/mermaid/dist/'))); | ||||
| 
 | ||||
|     app.use(`/${assetPath}/node_modules/jquery/dist/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/jquery/dist/'))); | ||||
|     app.use(`/${assetPath}/node_modules/jquery/dist/`, persistentCacheStatic(path.join(srcRoot, 'node_modules/jquery/dist/'))); | ||||
| 
 | ||||
|     app.use(`/${assetPath}/node_modules/jquery-hotkeys/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/jquery-hotkeys/'))); | ||||
|     app.use(`/${assetPath}/node_modules/jquery-hotkeys/`, persistentCacheStatic(path.join(srcRoot, 'node_modules/jquery-hotkeys/'))); | ||||
| 
 | ||||
|     app.use(`/${assetPath}/node_modules/print-this/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/print-this/'))); | ||||
|     app.use(`/${assetPath}/node_modules/print-this/`, persistentCacheStatic(path.join(srcRoot, 'node_modules/print-this/'))); | ||||
| 
 | ||||
|     app.use(`/${assetPath}/node_modules/split.js/dist/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/split.js/dist/'))); | ||||
|     app.use(`/${assetPath}/node_modules/split.js/dist/`, persistentCacheStatic(path.join(srcRoot, 'node_modules/split.js/dist/'))); | ||||
| 
 | ||||
|     app.use(`/${assetPath}/node_modules/panzoom/dist/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/panzoom/dist/'))); | ||||
|     app.use(`/${assetPath}/node_modules/panzoom/dist/`, persistentCacheStatic(path.join(srcRoot, 'node_modules/panzoom/dist/'))); | ||||
| } | ||||
| 
 | ||||
| export = { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran