wiki-server 0.26.0-rc.7 → 0.26.0-rc.8

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.
Files changed (2) hide show
  1. package/lib/server.js +26 -8
  2. package/package.json +3 -3
package/lib/server.js CHANGED
@@ -58,10 +58,30 @@ import { warn } from 'node:console'
58
58
  import { createRequire } from 'module'
59
59
  const require = createRequire(import.meta.url)
60
60
 
61
- // Use dynamic import to load package.json from the main application's working directory
62
- const packageJsonPath = path.join(process.cwd(), 'package.json')
63
- const packageJsonUrl = url.pathToFileURL(packageJsonPath).href
64
- const { default: packageJson } = await import(packageJsonUrl, { with: { type: 'json' } })
61
+ // Use import to load package.json from the main application's working directory
62
+ //const { default: packageJson } = await import('wiki/package.json', { with: { type: 'json' } })
63
+ const wikiPackageImport = async () => {
64
+ return new Promise(resolve => {
65
+ import('wiki/package.json', { with: { type: 'json' } })
66
+ .then(imported => {
67
+ resolve(imported.default)
68
+ })
69
+ .catch(e => {
70
+ return e
71
+ })
72
+ .then(async () => {
73
+ const packageJsonPath = path.join(process.cwd(), 'package.json')
74
+ const packageJsonUrl = url.pathToFileURL(packageJsonPath).href
75
+ import(packageJsonUrl, { with: { type: 'json' } })
76
+ .then(imported => {
77
+ resolve(imported.default)
78
+ })
79
+ .catch(e => console.error('problems importing package', e))
80
+ })
81
+ })
82
+ }
83
+
84
+ const packageJson = await wikiPackageImport()
65
85
 
66
86
  const render = page => {
67
87
  return (
@@ -703,10 +723,8 @@ export default async argv => {
703
723
  const getPackageVersion = packageName => {
704
724
  return new Promise(resolve => {
705
725
  try {
706
- // Use dynamic import to load package.json from the main application's working directory
707
- const packageJsonPath = path.join(process.cwd(), 'node_modules', packageName, 'package.json')
708
- const packageJsonUrl = url.pathToFileURL(packageJsonPath).href
709
- import(packageJsonUrl, { with: { type: 'json' } }).then(({ default: packageJson }) => {
726
+ // Use import to load package.json from the main application's working directory
727
+ import('wiki/package.json', { with: { type: 'json' } }).then(({ default: packageJson }) => {
710
728
  resolve({ [packageName]: packageJson.version })
711
729
  })
712
730
  } catch (error) {
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.0-rc.7",
4
+ "version": "0.26.0-rc.8",
5
5
  "type": "module",
6
6
  "author": {
7
7
  "name": "Ward Cunningham",
@@ -32,7 +32,7 @@
32
32
  ],
33
33
  "main": "index.js",
34
34
  "dependencies": {
35
- "body-parser": "^2.2.0",
35
+ "body-parser": "^2.2.1",
36
36
  "client-sessions": "^0.8.0",
37
37
  "coffeescript": "^2.5.0",
38
38
  "cookie-parser": "^1.4.4",
@@ -60,7 +60,7 @@
60
60
  "eslint": "^9.39.1",
61
61
  "globals": "^16.5.0",
62
62
  "grunt-git-authors": "^3.2.0",
63
- "prettier": "^3.5.3",
63
+ "prettier": "^3.7.3",
64
64
  "supertest": "^7.1.4",
65
65
  "wiki-client": "^0.31.6",
66
66
  "wiki-plugin-activity": "0.7",