@tiddlywiki/mws 0.0.21 → 0.1.1
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/README.md +42 -9
- package/dist/metafile-esm.json +1 -0
- package/dist/mws.d.ts +1 -0
- package/dist/mws.js +34710 -0
- package/dist/mws.js.map +1 -0
- package/editions/mws-docs/tiddlers/$__StoryList.tid +1 -2
- package/editions/mws-docs/tiddlers/2025-02-18 - User Management.md.meta +2 -2
- package/editions/mws-docs/tiddlers/2025-04-14 - client plugins /342/234/224/357/270/217.md" +31 -0
- package/editions/mws-docs/tiddlers/2025-04-14 - client plugins /342/234/224/357/270/217.md.meta" +5 -0
- package/editions/mws-docs/tiddlers/{2025-05-04.md → 2025-05-04 - event hooks /342/234/224/357/270/217.md" } +7 -1
- package/editions/mws-docs/tiddlers/2025-05-04 - event hooks /342/234/224/357/270/217.md.meta" +5 -0
- package/editions/mws-docs/tiddlers/{2025-05-06.md → 2025-05-06 - syncer design.md } +0 -4
- package/editions/mws-docs/tiddlers/2025-05-06 - syncer design.md.meta +5 -0
- package/editions/mws-docs/tiddlers/Allowed Methods.tid +8 -0
- package/editions/mws-docs/tiddlers/Application Access & Security.md +14 -84
- package/editions/mws-docs/tiddlers/Application Access & Security.md.meta +1 -1
- package/editions/mws-docs/tiddlers/Body Format.md +19 -0
- package/editions/mws-docs/tiddlers/Body Format.md.meta +4 -0
- package/editions/mws-docs/tiddlers/Checklists and Features.md +0 -3
- package/editions/mws-docs/tiddlers/Checklists and Features.md.meta +1 -1
- package/editions/mws-docs/tiddlers/Client Plugins.md +17 -0
- package/editions/mws-docs/tiddlers/Client Plugins.md.meta +5 -0
- package/editions/mws-docs/tiddlers/HTTP API.md +4 -3
- package/editions/mws-docs/tiddlers/HTTP API.md.meta +1 -1
- package/editions/mws-docs/tiddlers/HelloThere.tid +2 -2
- package/editions/mws-docs/tiddlers/Installation.tid +2 -3
- package/editions/mws-docs/tiddlers/MWS Architecture.tid +6 -1
- package/editions/mws-docs/tiddlers/Multi-user Trust.md +12 -0
- package/editions/mws-docs/tiddlers/Multi-user Trust.md.meta +5 -0
- package/editions/mws-docs/tiddlers/Notes.tid +5 -3
- package/editions/mws-docs/tiddlers/Oracle Attacks.md +29 -0
- package/editions/mws-docs/tiddlers/Oracle Attacks.md.meta +5 -0
- package/editions/mws-docs/tiddlers/Reference.md +1 -0
- package/editions/mws-docs/tiddlers/Reference.md.meta +1 -1
- package/editions/mws-docs/tiddlers/Request Handling.md +53 -0
- package/editions/mws-docs/tiddlers/Request Handling.md.meta +5 -0
- package/editions/mws-docs/tiddlers/Roadmap.tid +7 -0
- package/editions/mws-docs/tiddlers/Route Definers.md +206 -0
- package/editions/mws-docs/tiddlers/Route Definers.md.meta +5 -0
- package/editions/mws-docs/tiddlers/Security.md +75 -0
- package/editions/mws-docs/tiddlers/Security.md.meta +5 -0
- package/editions/mws-docs/tiddlers/Server Plugins.md +7 -0
- package/editions/mws-docs/tiddlers/Server Plugins.md.meta +5 -0
- package/editions/mws-docs/tiddlers/Startup Cache.md +28 -0
- package/editions/mws-docs/tiddlers/Startup Cache.md.meta +5 -0
- package/editions/mws-docs/tiddlers/TiddlerFields.md +5 -0
- package/editions/mws-docs/tiddlers/TiddlerFields.md.meta +4 -0
- package/editions/mws-docs/tiddlers/Usage.tid +2 -2
- package/editions/mws-docs/tiddlers/system/$__mws_cssvar-macro.tid +10 -0
- package/editions/mws-docs/tiddlers/system/$__palettes_MUI +143 -0
- package/editions/mws-docs/tiddlers/system/$__palettes_MUI.meta +7 -0
- package/editions/mws-docs/tiddlers/system/$__palettes_MUI_styles.css +567 -0
- package/editions/mws-docs/tiddlers/system/$__palettes_MUI_styles.css.meta +6 -0
- package/editions/mws-docs/tiddlers/system/$__theme.tid +6 -0
- package/editions/mws-docs/tiddlers/system/SplashScreen.tid +21 -0
- package/editions/mws-docs/tiddlers/system/StaticBanner.tid +1 -1
- package/editions/mws-docs/tiddlers/system/Styles.tid +13 -0
- package/editions/mws-docs/tiddlers/system/palette.tid +4 -1
- package/editions/mws-docs/tiddlers/system/sidebarlayout.tid +4 -1
- package/editions/mws-docs/tiddlers/x-mws-tiddler.md +35 -0
- package/editions/mws-docs/tiddlers/x-mws-tiddler.md.meta +5 -0
- package/mws.run.mjs +30 -0
- package/package.json +47 -36
- package/plugins/client/package-lock.json +46 -83
- package/plugins/client/package.json +1 -6
- package/plugins/client/plugin.info +2 -2
- package/plugins/client/src/fflate.d.ts +1501 -0
- package/plugins/client/src/multiwikiclientadaptor.ts +768 -317
- package/plugins/client/src/mws.d.ts +4 -0
- package/plugins/client/src/types.d.ts +3928 -0
- package/plugins/client/tiddlers/en-US.multids +3 -0
- package/plugins/client/tiddlers/status/SaveWikiButtonTemplate.tid +3 -0
- package/plugins/client/tiddlers/status/icon-cloud.tid +4 -0
- package/plugins/client/tiddlers/status/info-segment.tid +8 -0
- package/plugins/client/tiddlers/status/readonly-styles.tid +27 -0
- package/plugins/client/tiddlers/status/save-offline.tid +7 -0
- package/plugins/client/tiddlers/status/save-wiki-button.tid +26 -0
- package/plugins/client/tiddlers/status/styles.tid +44 -0
- package/plugins/client/tiddlers/status/syncer-actions-copy-logs.tid +6 -0
- package/plugins/client/tiddlers/status/syncer-actions-login-status.tid +9 -0
- package/plugins/client/tiddlers/status/syncer-actions-login.tid +8 -0
- package/plugins/client/tiddlers/status/syncer-actions-logout.tid +8 -0
- package/plugins/client/tiddlers/status/syncer-actions-refresh.tid +9 -0
- package/plugins/client/tiddlers/status/syncer-actions-save-snapshot.tid +9 -0
- package/plugins/client/tiddlers/status/tags-syncerdropdown.tid +2 -0
- package/plugins/client/tiddlers/syncer/multiwikiclientadaptor.js +640 -0
- package/plugins/client/tiddlers/syncer/syncer.js +831 -0
- package/plugins/client/tsconfig.json +19 -16
- package/plugins/filter-ast-to-sql/example-run-series.ts +146 -0
- package/plugins/server/SplashScreen.tid +150 -0
- package/plugins/server/fflate.js +9 -0
- package/plugins/server/plugin.info +8 -0
- package/plugins/server/readme +1 -0
- package/plugins/server/url-polyfill.js +294 -0
- package/prisma/client/client.d.ts +1 -0
- package/prisma/client/client.js +3 -0
- package/prisma/client/default.d.ts +1 -0
- package/prisma/client/default.js +3 -0
- package/prisma/client/edge.d.ts +1 -0
- package/prisma/client/edge.js +297 -0
- package/prisma/client/index-browser.js +275 -0
- package/prisma/client/index.d.ts +17770 -0
- package/prisma/client/index.js +324 -0
- package/prisma/client/package.json +173 -0
- package/prisma/client/query_engine_bg.js +811 -0
- package/prisma/client/query_engine_bg.wasm +0 -0
- package/prisma/client/runtime/edge-esm.js +10000 -0
- package/prisma/client/runtime/edge.js +10036 -0
- package/prisma/client/runtime/index-browser.d.ts +370 -0
- package/prisma/client/runtime/index-browser.js +2300 -0
- package/prisma/client/runtime/library.d.ts +3681 -0
- package/prisma/client/runtime/library.js +10604 -0
- package/prisma/client/runtime/react-native.js +10629 -0
- package/prisma/client/runtime/wasm-compiler-edge.js +11238 -0
- package/prisma/client/runtime/wasm-engine-edge.js +7801 -0
- package/prisma/client/schema.prisma +156 -0
- package/prisma/client/wasm-edge-light-loader.mjs +4 -0
- package/prisma/client/wasm-worker-loader.mjs +4 -0
- package/prisma/client/wasm.d.ts +1 -0
- package/prisma/client/wasm.js +304 -0
- package/prisma/global.ts +53 -0
- package/prisma/migrations/{20250406213424_init → 20250606001949_init}/migration.sql +46 -48
- package/prisma/migrations/20250613000526_remove_group/migration.sql +22 -0
- package/prisma/migrations/20250620014502_settings/migration.sql +5 -0
- package/prisma/migrations/20250707205229_recipes/migration.sql +20 -0
- package/prisma/migrations/migration_lock.toml +1 -1
- package/prisma/notes.md +1 -2
- package/prisma/schema.prisma +52 -49
- package/prisma/test.sqlite +0 -0
- package/prisma/test.sqlite-journal +0 -0
- package/public/react-admin/android-chrome-192x192.png +0 -0
- package/public/react-admin/android-chrome-512x512.png +0 -0
- package/public/react-admin/apple-touch-icon.png +0 -0
- package/{react-user-mgmt/public/esm-QKDFEP3B.js → public/react-admin/esm-L4WLVWJN.js} +1 -1
- package/public/react-admin/esm-L4WLVWJN.js.map +7 -0
- package/public/react-admin/esm-QMNGI3LF.js +3 -0
- package/public/react-admin/favicon-16x16.png +0 -0
- package/public/react-admin/favicon-32x32.png +0 -0
- package/public/react-admin/favicon.ico +0 -0
- package/public/react-admin/index.html +36 -0
- package/public/react-admin/main.js +268 -0
- package/public/react-admin/main.js.map +7 -0
- package/public/react-admin/site.webmanifest +20 -0
- package/public/react-admin/stats.json +1 -0
- package/scripts.mjs +134 -25
- package/dist/server.d.ts +0 -945
- package/dist/server.js +0 -20775
- package/dist/server.js.map +0 -1
- package/editions/mws-docs/tiddlers/2025-04-03 - Phases of Development.md +0 -64
- package/editions/mws-docs/tiddlers/2025-04-03 - Phases of Development.md.meta +0 -5
- package/editions/mws-docs/tiddlers/2025-04-13 - Plugins.md +0 -18
- package/editions/mws-docs/tiddlers/2025-04-13 - Plugins.md.meta +0 -5
- package/editions/mws-docs/tiddlers/2025-05-04.md.meta +0 -5
- package/editions/mws-docs/tiddlers/2025-05-06.md.meta +0 -5
- package/editions/mws-docs/tiddlers/Moduler Design.md +0 -29
- package/editions/mws-docs/tiddlers/Moduler Design.md.meta +0 -5
- package/editions/mws-docs/tiddlers/Request Server.md +0 -20
- package/editions/mws-docs/tiddlers/Request Server.md.meta +0 -5
- package/editions/mws-docs/tiddlers/system/$__palettes_MUI-Dark +0 -173
- package/editions/mws-docs/tiddlers/system/$__palettes_MUI-Dark.meta +0 -6
- package/editions/mws-docs/tiddlers/system/$__palettes_MUI-Light +0 -172
- package/editions/mws-docs/tiddlers/system/$__palettes_MUI-Light.meta +0 -6
- package/plugins/client/tiddlers/config-tiddlers-filter.tid +0 -2
- package/plugins/client/tiddlers/config-use-server-sent-events.tid +0 -2
- package/plugins/client/tiddlers/info-segment.tid +0 -8
- package/plugins/client/tiddlers/multiwikiclientadaptor.js +0 -444
- package/prisma/migrations/20250407002306_disconnect_user_tables/migration.sql +0 -52
- package/prisma/old-db.sql +0 -144
- package/react-user-mgmt/README.md +0 -50
- package/react-user-mgmt/eslint.config.js +0 -28
- package/react-user-mgmt/package-lock.json +0 -2738
- package/react-user-mgmt/package.json +0 -31
- package/react-user-mgmt/public/index.html +0 -1
- package/react-user-mgmt/public/main.js +0 -295
- package/react-user-mgmt/public/main.js.map +0 -7
- package/react-user-mgmt/public/stats.json +0 -1
- package/react-user-mgmt/tsconfig.json +0 -40
- package/react-user-mgmt/types.d.ts +0 -2
- package/tiddlywiki-types/boot/boot.d.ts +0 -378
- package/tiddlywiki-types/boot/bootprefix.d.ts +0 -110
- package/tiddlywiki-types/core/modules/filters.d.ts +0 -107
- package/tiddlywiki-types/core/modules/tiddler.d.ts +0 -47
- package/tiddlywiki-types/core/modules/wiki-bulkops.d.ts +0 -36
- package/tiddlywiki-types/core/modules/wiki.d.ts +0 -208
- package/tiddlywiki-types/index.d.ts +0 -7
- package/tiddlywiki-types/package.json +0 -3
- /package/plugins/client/tiddlers/{sidebarsegment.tid → status/sidebarsegment.tid} +0 -0
- /package/plugins/client/tiddlers/{GettingStarted.tid → syncer/GettingStarted.tid} +0 -0
- /package/plugins/client/tiddlers/{config-incoming-updates-filter.tid → syncer/config-incoming-updates-filter.tid} +0 -0
- /package/plugins/client/tiddlers/{readme.tid → syncer/readme.tid} +0 -0
- /package/{react-user-mgmt/public → public/react-admin}/chunk-YALWN5OT.js +0 -0
- /package/{react-user-mgmt/public → public/react-admin}/chunk-YALWN5OT.js.map +0 -0
- /package/{react-user-mgmt/public/esm-QKDFEP3B.js.map → public/react-admin/esm-QMNGI3LF.js.map} +0 -0
- /package/{react-user-mgmt/public → public/react-admin}/favicon.png +0 -0
- /package/{react-user-mgmt/public → public/react-admin}/missing-favicon.png +0 -0
- /package/{react-user-mgmt/public → public/react-admin}/motovun-jack.jpg +0 -0
- /package/{react-user-mgmt/public → public/react-admin}/mws-icon.png +0 -0
- /package/{react-user-mgmt/public → public/react-admin}/stats.css +0 -0
- /package/{react-user-mgmt/public → public/react-admin}/stats.html +0 -0
- /package/{react-user-mgmt/public → public/react-admin}/stats.js +0 -0
- /package/{react-user-mgmt/public → public/react-admin}/stats.svg +0 -0
- /package/{react-user-mgmt/public → public/react-admin}/vite.svg +0 -0
package/scripts.mjs
CHANGED
|
@@ -3,32 +3,141 @@
|
|
|
3
3
|
// postinstall: `PRISMA_CLIENT_FORCE_WASM=true prisma generate`
|
|
4
4
|
|
|
5
5
|
import { spawn } from "child_process";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import EventEmitter from "events";
|
|
7
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "fs";
|
|
8
|
+
import * as path from "path";
|
|
9
|
+
const events = new EventEmitter();
|
|
10
|
+
const workspaces = [
|
|
11
|
+
"packages/server",
|
|
12
|
+
"packages/mws",
|
|
13
|
+
"packages/react-admin",
|
|
14
|
+
"packages/tiddlywiki-types",
|
|
15
|
+
"plugins/client"
|
|
16
|
+
];
|
|
17
|
+
(async function run(arg) {
|
|
18
|
+
switch(arg) {
|
|
19
|
+
case "start":
|
|
20
|
+
// don't wait on tsc, it's just for checking types
|
|
21
|
+
// await start("npm run tsc", []);
|
|
22
|
+
await start("tsup --silent", [], {
|
|
23
|
+
SKIPDTS: "1"
|
|
24
|
+
});
|
|
25
|
+
await start("node --trace-uncaught --trace-warnings mws.dev.mjs", process.argv.slice(3), {
|
|
26
|
+
ENABLE_DEV_SERVER: "mws",
|
|
27
|
+
ENABLE_EXTERNAL_PLUGINS: "1",
|
|
28
|
+
});
|
|
29
|
+
break;
|
|
30
|
+
case "docs":
|
|
31
|
+
// call this directly rather than going through npm start
|
|
32
|
+
process.env.ENABLE_DOCS_ROUTE = "1";
|
|
33
|
+
await run("start");
|
|
34
|
+
break;
|
|
35
|
+
case "prisma:generate":
|
|
36
|
+
// rm -rf prisma/client && PRISMA_CLIENT_FORCE_WASM=true npx prisma generate && npm run prisma:format && rm -f prisma/client/*.node
|
|
37
|
+
console.log("Generating Prisma client...");
|
|
38
|
+
// remove the old client
|
|
39
|
+
await start("rm -rf prisma/client");
|
|
40
|
+
await start("prisma generate", [], { PRISMA_CLIENT_FORCE_WASM: "true" });
|
|
41
|
+
// await start("npm run prisma:format");
|
|
42
|
+
console.log("Formatting Prisma client...");
|
|
43
|
+
await start("prettier --write prisma/client/*.js prisma/client/*/*.js");
|
|
44
|
+
// remove the .node files, we don't need them in the client
|
|
45
|
+
console.log("Removing .node files from Prisma client...");
|
|
46
|
+
readdirSync("prisma/client").forEach(file => {
|
|
47
|
+
if(file.endsWith(".node")) {
|
|
48
|
+
const filePath = path.join("prisma/client", file);
|
|
49
|
+
console.log(`Removing ${filePath}`);
|
|
50
|
+
if(existsSync(filePath)) rmSync(filePath);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
break;
|
|
54
|
+
case "client-types": {
|
|
55
|
+
const res = await start("node --trace-uncaught mws.dev.mjs", ["build-types"], {}, {
|
|
56
|
+
pipeOut: true,
|
|
57
|
+
});
|
|
58
|
+
writeFileSync("packages/react-admin/src/server-types.ts", res);
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case "build:types": {
|
|
62
|
+
await start("npx tsc -p tsconfig.types.json", process.argv.slice(3));
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case "test": {
|
|
66
|
+
// "test:pack": "(git clean -dfx tests && npm pack --pack-destination tests && cd tests && npm install && npm install ./tiddlywiki-mws-$npm_package_version.tgz --no-save && npm test)",
|
|
67
|
+
// "test": "(git clean -dfx tests && cd tests && npm install .. --no-save && npm test)",
|
|
68
|
+
// "fulltest": "mv node_modules node_modules_old; npm run test:pack; mv node_modules_old node_modules",
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
await Promise.resolve().then(async () => {
|
|
72
|
+
await start("mv node_modules node_modules_old");
|
|
73
|
+
}).then(async () => {
|
|
74
|
+
await start("git clean -dfx tests");
|
|
75
|
+
const filesFolder = path.resolve("create-package/files");
|
|
76
|
+
const testsFolder = path.resolve("tests");
|
|
77
|
+
mkdirSync(testsFolder, { recursive: false });
|
|
78
|
+
// copy files into the folder
|
|
79
|
+
console.log(`Copying files`);
|
|
80
|
+
readdirSync(filesFolder).forEach(file => {
|
|
81
|
+
const oldPath = path.join(filesFolder, file);
|
|
82
|
+
if(!statSync(oldPath).isFile()) return;
|
|
83
|
+
const newPath = path.join(testsFolder, file);
|
|
84
|
+
if(existsSync(newPath)) {
|
|
85
|
+
console.log(`File ${file} already exists. Skipping...`);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
console.log(`├─ ${file}`);
|
|
89
|
+
writeFileSync(newPath, readFileSync(oldPath));
|
|
90
|
+
});
|
|
91
|
+
await start("npm pack --pack-destination tests");
|
|
92
|
+
await start("npm install ./tiddlywiki-mws-$npm_package_version.tgz tiddlywiki", [], {}, { cwd: "tests" });
|
|
93
|
+
}).then(async () => {
|
|
94
|
+
await start("npx mws init-store", [], {}, { cwd: "tests" });
|
|
95
|
+
}).finally(async () => {
|
|
96
|
+
await start("mv node_modules_old node_modules");
|
|
97
|
+
});
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
default:
|
|
101
|
+
console.log("nothing ran");
|
|
102
|
+
}
|
|
103
|
+
})(process.argv[2]).catch(console.log);
|
|
104
|
+
|
|
105
|
+
const exit = (code) => { events.emit("exit", code); };
|
|
106
|
+
process.on("SIGTERM", exit);
|
|
107
|
+
process.on("SIGINT", exit);
|
|
108
|
+
process.on("SIGHUP", exit);
|
|
109
|
+
|
|
110
|
+
function start(cmd, args = [], env2 = {}, { cwd = process.cwd(), pipeOut } = {}) {
|
|
8
111
|
const cp = spawn(cmd, args, {
|
|
9
|
-
|
|
112
|
+
cwd,
|
|
113
|
+
env: { ...process.env, ...env2, },
|
|
10
114
|
shell: true,
|
|
11
|
-
stdio: "inherit",
|
|
12
|
-
});
|
|
13
|
-
return new Promise((r) => {
|
|
14
|
-
// if any process errors it will immediately exit the script
|
|
15
|
-
cp.on("exit", (code) => { if(code) process.exit(code); r(); })
|
|
115
|
+
stdio: ["inherit", pipeOut ? "pipe" : "inherit", "inherit"],
|
|
16
116
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
117
|
+
|
|
118
|
+
events.on("exit", (code) => { cp.kill(code); });
|
|
119
|
+
|
|
120
|
+
if(pipeOut) {
|
|
121
|
+
|
|
122
|
+
return new Promise((r, c) => {
|
|
123
|
+
const chunks = [];
|
|
124
|
+
cp.stdout.on("data", (data) => {
|
|
125
|
+
chunks.push(data);
|
|
126
|
+
});
|
|
127
|
+
cp.stdout.on("end", () => {
|
|
128
|
+
r(chunks.map(e => e.toString()).join(""));
|
|
129
|
+
});
|
|
130
|
+
// if any process errors it will immediately exit the script
|
|
131
|
+
cp.on("exit", (code) => {
|
|
132
|
+
if(code) c(code);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
} else {
|
|
136
|
+
return new Promise((r, c) => {
|
|
137
|
+
// if any process errors it will immediately exit the script
|
|
138
|
+
cp.on("exit", (code) => { if(code) c(code); else r(); });
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
|
|
34
143
|
}
|