Skip to content

Commit 29cec81

Browse files
committed
fix setup of new document, closes zadam#966
1 parent 48aadc8 commit 29cec81

File tree

149 files changed

+194
-181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+194
-181
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DS_Store
22
node_modules/
33
dist/
4-
src/public/dist/
4+
src/public/app-dist/
55
npm-debug.log
66
yarn-error.log
77
*.db

bin/copy-trilium.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cp webpack-* $DIR/
2929

3030
find $DIR/libraries -name "*.map" -type f -delete
3131

32-
rm -r $DIR/src/public/javascripts
32+
rm -r $DIR/src/public/app
3333

34-
sed -i -e 's/javascripts\/desktop.js/dist\/desktop.js/g' $DIR/src/views/desktop.ejs
35-
sed -i -e 's/javascripts\/mobile.js/dist\/mobile.js/g' $DIR/src/views/mobile.ejs
34+
sed -i -e 's/app\/desktop.js/app-dist\/desktop.js/g' $DIR/src/views/desktop.ejs
35+
sed -i -e 's/app\/mobile.js/app-dist\/mobile.js/g' $DIR/src/views/mobile.ejs

package-lock.json

+162-162
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"start-server": "TRILIUM_ENV=dev node ./src/www",
1717
"start-electron": "TRILIUM_ENV=dev electron .",
1818
"build-backend-docs": "./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/entities/*.js src/services/backend_script_api.js",
19-
"build-frontend-docs": "./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/javascripts/entities/*.js src/public/javascripts/services/frontend_script_api.js",
19+
"build-frontend-docs": "./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js",
2020
"build-docs": "npm run build-backend-docs && npm run build-frontend-docs",
21-
"webpack": "npx webpack -c webpack-desktop.config.js && npx webpack -c webpack-mobile.config.js"
21+
"webpack": "npx webpack -c webpack-desktop.config.js && npx webpack -c webpack-mobile.config.js && npx webpack -c webpack-setup.config.js"
2222
},
2323
"dependencies": {
2424
"async-mutex": "0.2.1",
@@ -51,7 +51,7 @@
5151
"imagemin-pngquant": "8.0.0",
5252
"ini": "1.3.5",
5353
"is-svg": "4.2.1",
54-
"jimp": "0.10.1",
54+
"jimp": "0.10.2",
5555
"mime-types": "2.1.26",
5656
"multer": "1.4.2",
5757
"node-abi": "2.15.0",
@@ -62,11 +62,11 @@
6262
"rimraf": "3.0.2",
6363
"sanitize-filename": "1.6.3",
6464
"sax": "1.2.4",
65-
"semver": "7.2.2",
65+
"semver": "7.3.2",
6666
"serve-favicon": "2.5.0",
6767
"session-file-store": "1.4.0",
6868
"simple-node-logger": "18.12.24",
69-
"sqlite": "4.0.6",
69+
"sqlite": "4.0.7",
7070
"sqlite3": "4.1.1",
7171
"string-similarity": "4.0.1",
7272
"tar-stream": "2.1.2",
@@ -78,7 +78,7 @@
7878
"yazl": "^2.5.1"
7979
},
8080
"devDependencies": {
81-
"electron": "9.0.0-beta.15",
81+
"electron": "9.0.0-beta.16",
8282
"electron-builder": "22.4.1",
8383
"electron-packager": "14.2.1",
8484
"electron-rebuild": "1.10.1",

src/app.js

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ app.use(cookieParser());
4545
app.use(express.static(path.join(__dirname, 'public')));
4646
app.use('/libraries', express.static(path.join(__dirname, '..', 'libraries')));
4747
app.use('/images', express.static(path.join(__dirname, '..', 'images')));
48-
app.use('/dist', express.static(path.join(__dirname, '..', 'dist')));
4948
const sessionParser = session({
5049
secret: sessionSecret,
5150
resave: false, // true forces the session to be saved back to the session store, even if the session was never modified during the request.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/services/log.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function error(message) {
3333
console.trace(message);
3434
}
3535

36-
const requestBlacklist = [ "/libraries", "/javascripts", "/images", "/stylesheets" ];
36+
const requestBlacklist = [ "/libraries", "/app", "/images", "/stylesheets" ];
3737

3838
function request(req) {
3939
for (const bl of requestBlacklist) {

src/views/desktop.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<link href="stylesheets/style.css" rel="stylesheet">
7979
<link href="stylesheets/detail.css" rel="stylesheet">
8080

81-
<script src="javascripts/desktop.js" crossorigin type="module"></script>
81+
<script src="app/desktop.js" crossorigin type="module"></script>
8282

8383
<link rel="stylesheet" type="text/css" href="libraries/boxicons/css/boxicons.min.css">
8484

src/views/mobile.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131

132132
<link href="libraries/ckeditor/ckeditor-content.css" rel="stylesheet">
133133

134-
<script src="javascripts/mobile.js" crossorigin type="module"></script>
134+
<script src="app/mobile.js" crossorigin type="module"></script>
135135

136136
<link href="stylesheets/themes.css" rel="stylesheet">
137137
<link href="stylesheets/style.css" rel="stylesheet">

src/views/setup.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210

211211
<script src="libraries/knockout.min.js"></script>
212212

213-
<script src="javascripts/setup.js" crossorigin type="module"></script>
213+
<script src="app-dist/setup.js" crossorigin type="module"></script>
214214
<link href="stylesheets/themes.css" rel="stylesheet">
215215
</body>
216216
</html>

webpack-desktop.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ const path = require('path');
33
module.exports = {
44
mode: 'production',
55
entry: {
6-
mobile: './src/public/javascripts/desktop.js',
6+
mobile: './src/public/app/desktop.js',
77
},
88
output: {
99
publicPath: 'dist/',
10-
path: path.resolve(__dirname, 'src/public/dist'),
10+
path: path.resolve(__dirname, 'src/public/app-dist'),
1111
filename: 'desktop.js'
1212
},
1313
devtool: 'source-map'

webpack-mobile.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ const path = require('path');
33
module.exports = {
44
mode: 'production',
55
entry: {
6-
mobile: './src/public/javascripts/mobile.js',
6+
mobile: './src/public/app/mobile.js',
77
},
88
output: {
99
publicPath: '/dist/',
10-
path: path.resolve(__dirname, 'src/public/dist'),
10+
path: path.resolve(__dirname, 'src/public/app-dist'),
1111
filename: 'mobile.js'
1212
},
1313
devtool: 'source-map'

webpack-setup.config.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
mode: 'production',
5+
entry: {
6+
mobile: './src/public/app/setup.js',
7+
},
8+
output: {
9+
publicPath: '/dist/',
10+
path: path.resolve(__dirname, 'src/public/app-dist'),
11+
filename: 'setup.js'
12+
},
13+
devtool: 'source-map'
14+
};

0 commit comments

Comments
 (0)