Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWS: fix a few obvious bugs that typescript caught #8886

Open
wants to merge 3 commits into
base: multi-wiki-support
Choose a base branch
from

Conversation

Arlen22
Copy link
Contributor

@Arlen22 Arlen22 commented Jan 8, 2025

I was playing around with Typescript support in the multiwikiserver plugin, and it caught a few bugs, so I thought I'd open a PR for them.

Copy link

github-actions bot commented Jan 8, 2025

Confirmed: Arlen22 has already signed the Contributor License Agreement (see contributing.md)

Copy link

netlify bot commented Jan 8, 2025

Deploy Preview for tiddlywiki-previews failed.

Name Link
🔨 Latest commit 8e9aa57
🔍 Latest deploy log https://app.netlify.com/sites/tiddlywiki-previews/deploys/677f5457f15e560008f3e987

@pmario
Copy link
Member

pmario commented Jan 8, 2025

@Arlen22 ... Did you see the tests. Some of them fail now.

@Arlen22
Copy link
Contributor Author

Arlen22 commented Jan 8, 2025

Oh, I thought they were failing before. I'll double check.

@Arlen22 Arlen22 closed this Jan 9, 2025
@Arlen22 Arlen22 force-pushed the multi-wiki-support branch from 10e47d5 to c7dc21a Compare January 9, 2025 03:40
@Arlen22 Arlen22 reopened this Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

Confirmed: Arlen22 has already signed the Contributor License Agreement (see contributing.md)

@Arlen22
Copy link
Contributor Author

Arlen22 commented Jan 9, 2025

Ok, yeah, the build is failing with only one change that should not have changed anything.

@Arlen22
Copy link
Contributor Author

Arlen22 commented Jan 9, 2025

I've added the other changes back in with slightly better descriptions.

@Arlen22
Copy link
Contributor Author

Arlen22 commented Jan 9, 2025

Not sure if I'll change it, but I think these lines are supposed to be $tw.mws.store.adminWiki.


text = $tw.wiki.renderTiddler("text/plain",title);

var wiki = $tw.wiki;
wiki.addTiddler({

@@ -20,7 +20,7 @@ if($tw.node) {
querystring = require("querystring"),
crypto = require("crypto"),
zlib = require("zlib"),
aclMiddleware = require('$:/plugins/tiddlywiki/multiwikiserver/modules/routes/helpers/acl-middleware.js').middleware;
aclMiddleware = require('$:/plugins/tiddlywiki/multiwikiserver/routes/helpers/acl-middleware.js').middleware;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sure that this change is wrong. There is no TW title without the modules subdirectory.

Copy link
Contributor Author

@Arlen22 Arlen22 Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most plugins, except evernote and text-slicer, leave it out. Core appears to leave it in. I don't have an opinion either way.

@@ -12,7 +12,7 @@ POST /admin/delete-acl
/*global $tw: false */
"use strict";

var aclMiddleware = require("$:/plugins/tiddlywiki/multiwikiserver/modules/routes/helpers/acl-middleware.js").middleware;
var aclMiddleware = require("$:/plugins/tiddlywiki/multiwikiserver/routes/helpers/acl-middleware.js").middleware;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upstream title was right.

@@ -12,7 +12,7 @@ DELETE /bags/:bag_name/tiddler/:title
/*global $tw: false */
"use strict";

var aclMiddleware = require("$:/plugins/tiddlywiki/multiwikiserver/modules/routes/helpers/acl-middleware.js").middleware;
var aclMiddleware = require("$:/plugins/tiddlywiki/multiwikiserver/routes/helpers/acl-middleware.js").middleware;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upstream title is right --- please check all of them

@@ -44,7 +42,7 @@ function setupStore() {
return store;
}

function ServerManager(store) {
function ServerManager() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think removing it, is not right. But @Jermolene there is an inconsistency. Here it says: ServerManager(store) but in line 25 it says:

	serverManager: new ServerManager({
			store: store
		})

Which seems to be an options object.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The option is not used anywhere. Store is passed in somewhere else, not here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants