@tiddlywiki/mws 0.1.13 → 0.2.0

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 (118) hide show
  1. package/README.md +41 -20
  2. package/dist/metafile-esm.json +1 -1
  3. package/dist/mws.js +40249 -20249
  4. package/dist/mws.js.map +1 -1
  5. package/mws.run.mjs +28 -8
  6. package/package.json +20 -33
  7. package/plugins/client/plugin.info +1 -1
  8. package/plugins/client/src/multiwikiclientadaptor.ts +11 -39
  9. package/plugins/client/src/mws.d.ts +2 -1
  10. package/plugins/client/src/new-multiwikiclientadaptor.ts +634 -0
  11. package/plugins/client/src/types.d.ts +2531 -1036
  12. package/plugins/client/tiddlers/managetiddleraction.js +0 -5
  13. package/plugins/client/tiddlers/syncer/multiwikiclientadaptor.js +1 -1
  14. package/plugins/client/tiddlers/syncer/new-multiwikiclientadaptor.js +432 -0
  15. package/plugins/client/tiddlers/syncer/syncer.js +123 -241
  16. package/plugins/client/tsconfig.json +5 -1
  17. package/prisma/browser.ts +2 -0
  18. package/prisma/client/browser.ts +84 -0
  19. package/prisma/client/client.ts +108 -0
  20. package/prisma/client/commonInputTypes.ts +598 -0
  21. package/prisma/client/enums.ts +42 -0
  22. package/prisma/client/internal/class.ts +326 -0
  23. package/prisma/client/internal/prismaNamespace.ts +1870 -0
  24. package/prisma/client/internal/prismaNamespaceBrowser.ts +259 -0
  25. package/prisma/client/models/Bag.ts +1701 -0
  26. package/prisma/client/models/BagPermission.ts +1284 -0
  27. package/prisma/client/models/Recipe.ts +1722 -0
  28. package/prisma/client/models/RecipeBag.ts +1518 -0
  29. package/prisma/client/models/RecipePermission.ts +1284 -0
  30. package/prisma/client/models/Roles.ts +1316 -0
  31. package/prisma/client/models/Sessions.ts +1344 -0
  32. package/prisma/client/models/Settings.ts +1093 -0
  33. package/prisma/client/models/Template.ts +1477 -0
  34. package/prisma/client/models/TemplatePermission.ts +1284 -0
  35. package/prisma/client/models/Tiddler.ts +1434 -0
  36. package/prisma/client/models/TiddlerEvent.ts +1360 -0
  37. package/prisma/client/models/Users.ts +1579 -0
  38. package/prisma/client/models.ts +24 -0
  39. package/prisma/client/pjtg.ts +183 -0
  40. package/prisma/index.ts +74 -0
  41. package/prisma/migrations/20260708160259_init/migration.sql +172 -0
  42. package/prisma/migrations-v1/migration_lock.toml +3 -0
  43. package/prisma/package.json +12 -0
  44. package/prisma/schema.prisma +147 -89
  45. package/prisma/types.ts +9 -0
  46. package/public/.default.html +1 -0
  47. package/public/admin-vanilla/fish.svg +399 -0
  48. package/public/admin-vanilla/fish2.svg +389 -0
  49. package/public/admin-vanilla/main-64WYHWYI.js +1791 -0
  50. package/public/admin-vanilla/main-64WYHWYI.js.map +7 -0
  51. package/public/admin-vanilla/main-LYDE4NDJ.css +1 -0
  52. package/public/admin-vanilla/normalize.css +349 -0
  53. package/public/admin-vanilla/polyfill-ADOI2A4V.js +2 -0
  54. package/public/admin-vanilla/polyfill-ADOI2A4V.js.map +7 -0
  55. package/public/{react-admin → admin-vanilla}/site.webmanifest +1 -1
  56. package/public/admin-vanilla.html +62 -0
  57. package/public/admin-vanilla.json +1 -0
  58. package/public/{react-admin → stats}/stats.html +5 -2
  59. package/public/{react-admin → stats}/stats.js +2 -1
  60. package/scripts/build-docs.sh +30 -0
  61. package/scripts/helpers.mjs +107 -0
  62. package/scripts/json.js +8 -0
  63. package/scripts/scripts.mjs +114 -0
  64. package/prisma/client/client.d.ts +0 -1
  65. package/prisma/client/client.js +0 -3
  66. package/prisma/client/default.d.ts +0 -1
  67. package/prisma/client/default.js +0 -3
  68. package/prisma/client/edge.d.ts +0 -1
  69. package/prisma/client/edge.js +0 -297
  70. package/prisma/client/index-browser.js +0 -275
  71. package/prisma/client/index.d.ts +0 -17770
  72. package/prisma/client/index.js +0 -324
  73. package/prisma/client/package.json +0 -173
  74. package/prisma/client/query_engine_bg.js +0 -811
  75. package/prisma/client/query_engine_bg.wasm +0 -0
  76. package/prisma/client/runtime/edge-esm.js +0 -10000
  77. package/prisma/client/runtime/edge.js +0 -10036
  78. package/prisma/client/runtime/index-browser.d.ts +0 -370
  79. package/prisma/client/runtime/index-browser.js +0 -2300
  80. package/prisma/client/runtime/library.d.ts +0 -3681
  81. package/prisma/client/runtime/library.js +0 -10604
  82. package/prisma/client/runtime/react-native.js +0 -10629
  83. package/prisma/client/runtime/wasm-compiler-edge.js +0 -11238
  84. package/prisma/client/runtime/wasm-engine-edge.js +0 -7801
  85. package/prisma/client/schema.prisma +0 -156
  86. package/prisma/client/wasm-edge-light-loader.mjs +0 -4
  87. package/prisma/client/wasm-worker-loader.mjs +0 -4
  88. package/prisma/client/wasm.d.ts +0 -1
  89. package/prisma/client/wasm.js +0 -304
  90. package/prisma/global.ts +0 -53
  91. package/public/react-admin/chunk-YALWN5OT.js +0 -2
  92. package/public/react-admin/esm-L4WLVWJN.js +0 -3
  93. package/public/react-admin/esm-L4WLVWJN.js.map +0 -7
  94. package/public/react-admin/esm-QMNGI3LF.js +0 -3
  95. package/public/react-admin/esm-QMNGI3LF.js.map +0 -7
  96. package/public/react-admin/index.html +0 -36
  97. package/public/react-admin/main.js +0 -268
  98. package/public/react-admin/main.js.map +0 -7
  99. package/public/react-admin/stats.json +0 -1
  100. package/scripts.mjs +0 -142
  101. /package/prisma/{migrations → migrations-v1}/20250606001949_init/migration.sql +0 -0
  102. /package/prisma/{migrations → migrations-v1}/20250613000526_remove_group/migration.sql +0 -0
  103. /package/prisma/{migrations → migrations-v1}/20250620014502_settings/migration.sql +0 -0
  104. /package/prisma/{migrations → migrations-v1}/20250707205229_recipes/migration.sql +0 -0
  105. /package/public/{react-admin → admin-vanilla}/android-chrome-192x192.png +0 -0
  106. /package/public/{react-admin → admin-vanilla}/android-chrome-512x512.png +0 -0
  107. /package/public/{react-admin → admin-vanilla}/apple-touch-icon.png +0 -0
  108. /package/public/{react-admin → admin-vanilla}/favicon-16x16.png +0 -0
  109. /package/public/{react-admin → admin-vanilla}/favicon-32x32.png +0 -0
  110. /package/public/{react-admin → admin-vanilla}/favicon.ico +0 -0
  111. /package/public/{react-admin → admin-vanilla}/favicon.png +0 -0
  112. /package/public/{react-admin/chunk-YALWN5OT.js.map → admin-vanilla/main-LYDE4NDJ.css.map} +0 -0
  113. /package/public/{react-admin → admin-vanilla}/missing-favicon.png +0 -0
  114. /package/public/{react-admin → admin-vanilla}/motovun-jack.jpg +0 -0
  115. /package/public/{react-admin → admin-vanilla}/mws-icon.png +0 -0
  116. /package/public/{react-admin → admin-vanilla}/vite.svg +0 -0
  117. /package/public/{react-admin → stats}/stats.css +0 -0
  118. /package/public/{react-admin → stats}/stats.svg +0 -0
package/README.md CHANGED
@@ -23,13 +23,25 @@ Multiple users, multiple wikis for TiddlyWiki.
23
23
 
24
24
  Most of these features are still in development.
25
25
 
26
- **Do not use it to protect feelings or intellectual property.**
26
+ ## Here's a sneak peak at the new UI that's coming
27
+
28
+ ### Dark Mode
29
+
30
+ <img width="800" alt="light mode" src="https://github.com/user-attachments/assets/d2c8177a-e504-4bff-999d-4b260467ac2e" />
31
+
32
+ ### Light Mode
33
+
34
+ <img width="800" alt="dark mode" src="https://github.com/user-attachments/assets/301cb61c-1f39-4d4f-8f4a-8ecd5306c084" />
35
+
36
+ ## Warning: Security between users is still a dumpster fire.
27
37
 
28
- ## Warning: Security is still a dumpster fire.
38
+ **While the database structure is reliable, the security mechanism is more like swiss cheese.**
29
39
 
30
- **While the database structure is reliable, the security mechanism isn't. Do not use it to protect feelings or intellectual property. There are still ways to easily get around the security restrictions.**
40
+ **Do not use it to protect feelings or intellectual property.**
41
+
42
+ **There are plenty of ways for anyone with write access to get around the security restrictions.**
31
43
 
32
- ![this is fine](https://github.com/user-attachments/assets/49505d25-7a48-42f1-b4f7-73e8630c1ba1)
44
+ <img width="800" alt="this is fine" src="https://github.com/user-attachments/assets/49505d25-7a48-42f1-b4f7-73e8630c1ba1" />
33
45
 
34
46
 
35
47
  ## Also, this is a database, please make backups
@@ -42,13 +54,12 @@ The init command creates a new folder and installs what you need to get started.
42
54
 
43
55
  - `npm init @tiddlywiki/mws@latest my-folder`
44
56
  - `cd my-folder`
45
- - `npx mws init-store`
46
57
  - `npx mws listen --listener`
47
58
 
48
59
  You can run `npx mws help` to get more information about the commands.
49
60
 
50
61
  - the server runs on port `8080`. It does not use HTTPS by default, but you can enable it by specifying a key and cert.
51
- - A `passwords.key` file is created which contains the password master salt. If this file changes, all passwords will need to be reset.
62
+ - A `passwords.key` file is created which contains the password master salt. If this file changes, all passwords will become unusable and need to be reset.
52
63
  - Your database is in the `store` folder. All files in the `store` folder are data files, not temp or lock files! Never delete them!
53
64
 
54
65
  The initial user created on first run has the username `admin` and password `1234`.
@@ -57,38 +68,48 @@ If you run into trouble, or need help figuring something out, feel free to [star
57
68
 
58
69
  ## Updates
59
70
 
60
- If upgrading from 0.0, the best way to save your information is to open each wiki and click the cloud status icon, then click "save snapshot for offline use". You can then create a new instance and import your wikis via the browser.
71
+ Within 0.x versions, please do NOT use `npm install` to update your instance from one minor version to the next.
61
72
 
62
- If updating within 0.1,
73
+ To update between 0.x versions, open each wiki and click the cloud status icon, then click "save snapshot for offline use". You can then create a new instance and import your wikis via the browser.
63
74
 
64
- - Copy or zip your entire folder to **a safe backup folder**.
65
- - `npm install @tiddlywiki/mws@latest`
75
+ _Always, always, always save a backup of your store folder before updating._
66
76
 
67
- If there are any database changes, MWS should pick them up and apply them on startup. The changes are generated by prisma's builtin migration and are supposed to preserve data, but backups are still highly recommended.
77
+ ### Starting with 0.2
68
78
 
69
- The 0.1 database is incompatible with the 0.0 database. Version 0.1 will detect this and exit immediately to prevent data loss.
79
+ - You can update to the latest version of MWS using `npm update`.
80
+ - You can update to the latest version of tiddywiki using `npx mws update-tiddlywiki`.
81
+
82
+ If there are any database changes, MWS should pick them up and apply them on startup. The changes are generated by prisma's builtin migration and are supposed to preserve data, but backups are still highly recommended.
70
83
 
71
84
  ## Backups
72
85
 
73
- It is recommended to backup your entire data folder, not just the `store` folder, except the `cache` folder.
86
+ It is recommended to backup your entire data folder, not just the `store` folder, with a few exceptions.
74
87
 
75
88
  - You must *always* backup the *entire* `store` folder. Never delete any files in the `store` folder. All files in the `store` folder are data files!
76
- - You should definitely backup the `package.json` file, as it contains the MWS version you are currently using. The `package-lock.json` file is also useful if you don't want to back up the entire `node_modules` folder for some reason.
77
- - The `cache` folder (next to the `store` folder) is generated every time MWS starts, so you can exclude that from backups if you want.
78
- - The `node_modules` folder should be included in your backup, as it contains all the application code required to run your database, but it can also be reconstructed from the `package-lock.json` file or the `package.json` file.
79
-
80
- MWS uses NPM packages, so as long as you back up the *entire* store folder, and the package-lock.json file, you should have enough information for a NodeJS developer to reconstruct the site.
89
+ - `passwords.key` can be backed up, but since it never changes you could also just save a copy of it in a more secure location separate from your normal backups.
90
+ - You should backup `package.json` and `package-lock.json`.
91
+ - The `node_modules` folder can be ignored. `npm ci` will reinstall the `node_modules` folder based on `package-lock.json`.
92
+ - The `cache` folder (next to the `store` folder) is generated every time MWS starts, so it's nothing but bloat. You can always ignore it.
93
+ - Only the `tw5/versions.txt` file needs to be saved from the `tw5` folder.
94
+
95
+ So essentially, the paths you need to backup are:
96
+ - `/package.json`
97
+ - `/package-lock.json`
98
+ - `/store`
99
+ - `/tw5/versions.txt`
100
+ - `/passwords.key` (or save it separately)
81
101
 
82
102
  ## Development
83
103
 
84
- In 0.1, the development data folder is `/dev/wiki`.
104
+ In 0.2, the development data folder is `/dev/wiki`.
85
105
 
86
- If you want to work on the project,
106
+ If you want to work on the project, or just try out the latest changes,
87
107
 
88
108
  - `git clone https://github.com/TiddlyWiki/MultiWikiServer`
89
109
  - `cd MultiWikiServer`
90
110
  - `npm install` or `npm run install-android`
91
111
  - `npm run certs` - if you want https (unix only)
112
+ - `npm start update-tiddlywiki` - Download the latest TiddlyWiki version
92
113
  - `npm start init-store` - Create the `admin` user and import default wikis.
93
114
  - `npm start` - this will run the build every time, but it's very fast.
94
115