Compare commits

..

No commits in common. "5850c556c80edc9d606f9fc9cf20eafef34b1f89" and "3b245d586eca3c06cbc7907474b95a5d023b7dc6" have entirely different histories.

9 changed files with 2658 additions and 4289 deletions

View File

@ -5,5 +5,5 @@ EXPOSE 80
WORKDIR /app WORKDIR /app
ADD ./wiki /app ADD ./wiki /app
ADD ./templates /app/templates ADD ./templates /app/templates
ADD ./editor/dist /app/dist ADD ./dist /app/dist
ENTRYPOINT ["/app/wiki"] ENTRYPOINT ["/app/wiki"]

6743
editor/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,67 +1,57 @@
{ {
"name": "editor",
"main": "src/index.js",
"sideEffects": [
"**"
],
"dependencies": { "dependencies": {
"@egjs/hammerjs": "^2.0.17", "@egjs/hammerjs": "^2.0.17",
"axios": "^0.19.2", "axios": "^0.19.0",
"bulma": "^0.7.5", "bulma": "^0.7.5",
"clipboard": "^2.0.8", "clipboard": "^2.0.6",
"copy-text-to-clipboard": "^2.2.0", "copy-text-to-clipboard": "^2.2.0",
"css-loader": "^3.6.0", "css-loader": "^3.2.0",
"dragula": "^3.7.3", "dragula": "^3.7.3",
"extract-text-webpack-plugin": "^3.0.2", "extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^6.2.0", "file-loader": "^6.0.0",
"fuse.js": "^6.4.6", "fuse.js": "^6.0.0",
"he": "^1.2.0", "he": "^1.2.0",
"jquery": "^3.6.0", "jquery": "^3.5.1",
"jquery-contextmenu": "^2.9.2", "jquery-contextmenu": "^2.9.2",
"keycharm": "^0.3.1", "keycharm": "^0.3.1",
"lodash": "^4.17.21", "lodash": ">=4.17.19",
"lunr": "^2.3.9", "lunr": "^2.3.8",
"markdown-it": "^11.0.1", "markdown-it": "^11.0.0",
"markdown-it-katex": "^2.0.3", "markdown-it-katex": "^2.0.3",
"markdown-it-mark": "^3.0.1", "markdown-it-mark": "^3.0.0",
"markdown-it-wikilinks": "^1.0.1", "markdown-it-wikilinks": "^1.0.1",
"mathjs": "^7.6.0", "mathjs": "^7.2.0",
"mermaid": "^8.11.4", "mermaid": "^8.5.2",
"moment": "^2.29.1", "moment": "^2.26.0",
"mustache": "^4.2.0", "mustache": "^4.0.1",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
"prismjs": "^1.24.1", "prismjs": "^1.20.0",
"sass-loader": "^7.3.1", "sass-loader": "^7.3.1",
"style-loader": "^1.3.0", "style-loader": "^1.0.0",
"timsort": "^0.3.0", "timsort": "^0.3.0",
"util": "^0.12.4", "uuid": "^8.1.0",
"uuid": "^8.3.2",
"vis-data": "^6.6.1", "vis-data": "^6.6.1",
"vis-network": "^7.10.2", "vis-network": "^7.6.10",
"vis-util": "^4.3.4", "vis-util": "^4.3.2",
"wiki-list-editor": "file:../list-editor" "wiki-list-editor": "file:../list-editor"
}, },
"devDependencies": { "devDependencies": {
"clean-webpack-plugin": "^4.0.0-alpha.0", "clean-webpack-plugin": "^3.0.0",
"esm": "^3.2.25", "esm": "^3.2.25",
"html-webpack-plugin": "^5.0.0", "html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^2.2.0", "mini-css-extract-plugin": "^0.9.0",
"mocha": "^7.2.0", "mocha": "^7.2.0",
"mocha-webpack": "^1.1.0", "mocha-webpack": "^1.1.0",
"process": "^0.11.10",
"progress-bar-webpack-plugin": "^2.1.0",
"scss-loader": "0.0.1", "scss-loader": "0.0.1",
"webpack": "^5.50.0", "webpack": "^4.43.0",
"webpack-bundle-analyzer": "^4.4.2", "webpack-cli": "^3.3.7",
"webpack-cli": "^4.7.2", "webpack-dev-server": "^3.11.0"
"webpack-dev-server": "^3.11.2",
"webpack-validator": "^3.0.1"
}, },
"scripts": { "scripts": {
"test": "node_modules/.bin/mocha -r esm", "test": "node_modules/.bin/mocha -r esm",
"watch": "webpack --watch", "watch": "webpack --watch --hide-modules",
"start": "webpack-dev-server --open --hot", "start": "webpack-dev-server --open --hot",
"build": "webpack --progress --mode=production", "build": "webpack --progress --hide-modules --mode=production",
"docker": "webpack --no-color --mode=production" "docker": "webpack --color=false --hide-modules --mode=production"
} }
} }

View File

@ -1,10 +1,11 @@
'use strict' 'use strict'
import Plugin from "markdown-it-regexp"; const Plugin = require('markdown-it-regexp')
import extend from "extend"; const extend = require('extend')
import sanitize from "sanitize-filename"; const sanitize = require('sanitize-filename')
module.exports = (options) => {
export default (options) => {
const defaults = { const defaults = {
baseURL: '/', baseURL: '/',
relativeBaseURL: './', relativeBaseURL: './',

View File

@ -2,20 +2,16 @@ const path = require('path');
const {CleanWebpackPlugin} = require('clean-webpack-plugin'); const {CleanWebpackPlugin} = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const webpack = require('webpack');
module.exports = env => { module.exports = {
return { mode: 'development',
// mode: 'production', entry: {
// devtool: 'source-map', index: './src/index.js'
// entry: { },
// index: './src/index.js' output: {
// }, filename: '[name].bundle.js',
// output: { path: path.resolve(__dirname, '../dist')
// filename: '[name].bundle.js', },
// path: path.resolve(__dirname, '../dist')
// },
module: { module: {
rules: [ rules: [
@ -25,40 +21,28 @@ module.exports = env => {
}, },
{ {
test: /\.(woff|woff2|eot|ttf|otf)$/, test: /\.(woff|woff2|eot|ttf|otf)$/,
type: 'asset/resource' loader: "file-loader",
options: {
name: '[name].[ext]',
outputPath: 'font/'
}
} }
] ]
}, },
stats: {
orphanModules: true
},
resolve: {
fallback: {
util: require.resolve("util/")
}
},
plugins: [ plugins: [
// new ProgressBarPlugin(), new CleanWebpackPlugin(),
// new CleanWebpackPlugin(),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: '[name].css' filename: '[name].css'
}), }),
new webpack.EnvironmentPlugin({
DEBUG: false,
NODE_DEBUG: false,
})
], ],
//
// devServer: { devServer: {
// contentBase: './dist', contentBase: './dist',
// hot: true hot: true
// }, },
//
optimization: { optimization: {
usedExports: true,
splitChunks: { splitChunks: {
cacheGroups: { cacheGroups: {
commons: { commons: {
@ -75,5 +59,5 @@ module.exports = env => {
} }
} }
} }
}
}; };

View File

@ -4,7 +4,6 @@
"description": "Simple editor of lists", "description": "Simple editor of lists",
"author": "Peter Stuifzand <peter@p83.nl>", "author": "Peter Stuifzand <peter@p83.nl>",
"main": "index.js", "main": "index.js",
"sideEffects": ["**"],
"scripts": { "scripts": {
"test": "jasmine --require=esm" "test": "jasmine --require=esm"
}, },

View File

@ -1225,7 +1225,7 @@ func main() {
}) })
http.Handle("/search/", sh) http.Handle("/search/", sh)
http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir("./editor/dist")))) http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir("./dist"))))
http.Handle("/save/", &saveHandler{}) http.Handle("/save/", &saveHandler{})
http.Handle("/edit/", &editHandler{}) http.Handle("/edit/", &editHandler{})
http.Handle("/history/", &historyHandler{}) http.Handle("/history/", &historyHandler{})

View File

@ -6,8 +6,8 @@
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="redirect_uri" href="{{ .RedirectURI }}" /> <link rel="redirect_uri" href="{{ .RedirectURI }}" />
<link rel="stylesheet" href="/public/main.css" /> <link rel="stylesheet" href="/public/vendors.css" />
<link rel="stylesheet" href="/public/styles.css" /> <link rel="stylesheet" href="/public/index.css" />
<!-- <link rel="stylesheet" href="https://unpkg.com/prismjs@1.20.0/themes/prism-tomorrow.css"> --> <!-- <link rel="stylesheet" href="https://unpkg.com/prismjs@1.20.0/themes/prism-tomorrow.css"> -->
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/> --> <!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/> -->
<title>{{ .Title }} - Wiki</title> <title>{{ .Title }} - Wiki</title>
@ -87,7 +87,7 @@
<li><a href="/edit/[[page]]">Create a page</a></li> <li><a href="/edit/[[page]]">Create a page</a></li>
</ul> </ul>
</div> </div>
<script async src="/public/vendors.js"></script> <script async src="/public/vendors.bundle.js"></script>
<script async src="/public/main.js"></script> <script async src="/public/index.bundle.js"></script>
</body> </body>
</html> </html>