wiki-server 0.26.1 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/page.js CHANGED
@@ -76,19 +76,22 @@ export default argv => {
76
76
  // create a list of plugin pages.
77
77
  const pluginPages = new Map()
78
78
 
79
- Object.keys(packageJson.dependencies)
80
- .filter(depend => depend.startsWith('wiki-plugin'))
81
- .forEach(plugin => {
82
- const pagesPath = path.join(path.dirname(require.resolve(`${plugin}/package`)), 'pages')
83
- fs.readdir(pagesPath, { withFileTypes: true }, (err, entries) => {
84
- if (err) return
85
- entries.forEach(entry => {
86
- if (entry.isFile() && !pluginPages.has(entry.name)) {
87
- pluginPages.set(entry.name, { pluginName: plugin, pluginPath: entry.parentPath })
88
- }
89
- })
79
+ const dependencyPlugins = Object.keys(packageJson.dependencies).filter(depend => depend.startsWith('wiki-plugin'))
80
+ const plugins = dependencyPlugins.length
81
+ ? dependencyPlugins
82
+ : Object.keys(packageJson.devDependencies).filter(depend => depend.startsWith('wiki-plugin'))
83
+
84
+ plugins.forEach(plugin => {
85
+ const pagesPath = path.join(path.dirname(require.resolve(`${plugin}/package`)), 'pages')
86
+ fs.readdir(pagesPath, { withFileTypes: true }, (err, entries) => {
87
+ if (err) return
88
+ entries.forEach(entry => {
89
+ if (entry.isFile() && !pluginPages.has(entry.name)) {
90
+ pluginPages.set(entry.name, { pluginName: plugin, pluginPath: entry.parentPath })
91
+ }
90
92
  })
91
93
  })
94
+ })
92
95
 
93
96
  // #### Private utility methods. ####
94
97
  const load_parse = (loc, cb, annotations = {}) => {
package/lib/server.js CHANGED
@@ -449,12 +449,17 @@ export default async argv => {
449
449
  })
450
450
  }
451
451
 
452
+ // in test (wiki-server) the plugins are listed as devDependencues, so we need to fallback to
453
+ // using devDEpendencies when there are no plugins in dependencies.
454
+ const dependencyPlugins = Object.keys(packageJson.dependencies).filter(depend => depend.startsWith('wiki-plugin'))
455
+ const plugins = dependencyPlugins.length
456
+ ? dependencyPlugins
457
+ : Object.keys(packageJson.devDependencies).filter(depend => depend.startsWith('wiki-plugin'))
458
+
452
459
  Promise.all(
453
- Object.keys(packageJson.dependencies)
454
- .filter(depend => depend.startsWith('wiki-plugin'))
455
- .map(plugin => {
456
- return getPackageFactory(plugin)
457
- }),
460
+ plugins.map(plugin => {
461
+ return getPackageFactory(plugin)
462
+ }),
458
463
  ).then(() => res.end(JSON.stringify(factories)))
459
464
  })
460
465
 
@@ -635,14 +640,21 @@ export default async argv => {
635
640
 
636
641
  // Returns a list of installed plugins. (does this get called anymore!)
637
642
  app.get('/system/plugins.json', cors, (req, res) => {
643
+ // create a list of plugin pages.
638
644
  try {
639
- const pluginNames = Object.keys(require.main.require('./package').dependencies)
640
- .filter(depend => depend.startsWith('wiki-plugin'))
641
- .map(name => name.slice(12))
645
+ const dependencyPlugins = Object.keys(packageJson.dependencies).filter(depend => depend.startsWith('wiki-plugin'))
646
+ const plugins = dependencyPlugins.length
647
+ ? dependencyPlugins
648
+ : Object.keys(packageJson.devDependencies).filter(depend => depend.startsWith('wiki-plugin'))
649
+ const pluginNames = plugins.map(name => name.slice(12))
642
650
  res.send(pluginNames)
643
651
  } catch (e) {
644
652
  return res.e(e)
645
653
  }
654
+ // Object.keys(packageJson.dependencies)
655
+ // .filter(depend => depend.startsWith('wiki-plugin'))
656
+ // .map(name => name.slice(12))
657
+ // .then(names => res.send(names))
646
658
  })
647
659
  //{
648
660
  const sitemapLoc = path.join(argv.status, 'sitemap.json')
package/lib/sitemap.js CHANGED
@@ -233,7 +233,7 @@ export default argv => {
233
233
  itself.emit('finished')
234
234
  }
235
235
  itself.isWorking = () => {
236
- working
236
+ return working
237
237
  }
238
238
 
239
239
  itself.createSitemap = pagehandler => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wiki-server",
3
3
  "description": "A Federated Wiki Server",
4
- "version": "0.26.1",
4
+ "version": "0.26.2",
5
5
  "type": "module",
6
6
  "author": {
7
7
  "name": "Ward Cunningham",
@@ -34,14 +34,13 @@
34
34
  "dependencies": {
35
35
  "body-parser": "^2.2.1",
36
36
  "client-sessions": "^0.8.0",
37
- "coffeescript": "^2.5.0",
38
37
  "cookie-parser": "^1.4.4",
39
38
  "dompurify": "^3.3.0",
40
39
  "errorhandler": "^1.5.1",
41
40
  "express": "^5.1.0",
42
41
  "express-hbs": "^2.5.0",
43
42
  "flates": "0.0.5",
44
- "jsdom": "^27.2.0",
43
+ "jsdom": "^28.1.0",
45
44
  "method-override": "^3.0.0",
46
45
  "minisearch": "^7.2.0",
47
46
  "morgan": "^1.10.1",
@@ -51,14 +50,14 @@
51
50
  "scripts": {
52
51
  "prettier:format": "prettier --write './**/*.js'",
53
52
  "prettier:check": "prettier --check ./**/*.js",
54
- "test": "cd test; node --test",
55
- "watch": "cd test; node --test --watch",
53
+ "test": "node --test",
54
+ "watch": "node --test --watch",
56
55
  "update-authors": "node scripts/update-authors.js"
57
56
  },
58
57
  "devDependencies": {
59
- "@eslint/js": "^9.39.1",
60
- "eslint": "^9.39.1",
61
- "globals": "^17.2.0",
58
+ "@eslint/js": "^10.0.1",
59
+ "eslint": "^10.0.0",
60
+ "globals": "^17.3.0",
62
61
  "grunt-git-authors": "^3.2.0",
63
62
  "prettier": "^3.7.3",
64
63
  "supertest": "^7.1.4",