Commit graph

183 commits

Author SHA1 Message Date
renovate[bot]
b6a13439f8 chore(deps): update yarn to v3.6.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-26 09:31:55 +00:00
renovate[bot]
1a581839fb chore(deps): update dependency eslint to v8.48.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-26 11:00:35 +02:00
renovate[bot]
6024179059 chore(deps): update test packages to v29.6.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-26 00:36:32 +00:00
renovate[bot]
85ba87efcc chore(deps): update typescript-eslint monorepo to v6.4.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-21 17:37:43 +00:00
renovate[bot]
f27b2264f0 chore(deps): update test packages to v29.6.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-21 17:37:10 +00:00
renovate[bot]
93773d6488 chore(deps): update dependency @jest/types to v29.6.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-21 13:40:17 +00:00
Tilman Vatteroth
09755272e6 fix: correct interval type
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-19 10:42:36 +00:00
renovate[bot]
1a4e234494 chore(deps): update yarn to v3.6.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-19 09:39:51 +00:00
renovate[bot]
1d31a1b11f chore(deps): update dependency prettier to v3.0.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-15 20:16:09 +00:00
renovate[bot]
36160a78ea chore(deps): update typescript-eslint monorepo to v6.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-15 21:24:16 +02:00
Tilman Vatteroth
dccd58f0c1 fix: remove subpath support for HD_BASE_URL
With this commit we drop the subpath support which results in the constraint that HedgeDoc must always run on the root of a domain. This makes a lot of things in testing, rendering and security much easier.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-13 20:38:53 +02:00
renovate[bot]
41b0deba19 chore(deps): update dependency eslint to v8.47.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-12 11:05:01 +02:00
renovate[bot]
27a0914069 chore(deps): update typescript-eslint monorepo to v6.3.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-10 21:06:09 +02:00
renovate[bot]
236562cd9d chore(deps): update linters
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-06 11:55:34 +00:00
renovate[bot]
c8e1a99ad1 chore(deps): update dependency eslint-config-prettier to v9
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-06 13:40:55 +02:00
renovate[bot]
4c0e8fe669 chore(deps): update dependency eslint-config-prettier to v8.10.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-05 17:54:01 +02:00
renovate[bot]
2ff3cd2b14 chore(deps): update typescript-eslint monorepo to v6.2.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-31 21:17:13 +02:00
Tilman Vatteroth
8e2d59ff3c fix(commons): replace microbundle with bash based compile script
The commons package ships wrong types because it is refering to the same files for the ESM and the CJS build.
See https://arethetypeswrong.github.io/?p=%40mrdrogdrog%2Foptional%401.1.0

This happens because microbundle can handle the generation of `.mjs` and `.cjs` from files itself but delegates the generation of types entirely to typescript by running it once. Microbundle uses the "type" field from the package.json to know if a `.js` file is meant to be mjs or cjs and generates the other type by using the specific file extension `.cjs` and `.mjs` (so if your package is a `type: module`, then `.js` file are interpreted as ECMAModule and if you have a commonjs file you need to name it `.cjs`).  But this causes a problem with typescript. If you use typescript with the newer module resolver then it expects the type declarations to be named exactly like the file you wanna import. So if you have a `.js` file it will try to look up types in a `.d.ts` file. If it is resolving a `.mjs` file it is looking for a `.d.mts` file.

This clashes with the types generated by microbundle because you can't use a `.mjs` file with a `.d.ts` file.

Running typescript multiple times can also be complicated.
When generating type declaration files, typescript takes a look at the source file extension. So a `.mts` file will generate a `.mjs` and a `.d.mts` file. A `.ts` will generate a `.js` and `.d.ts` file. It doesn't matter if you run microbundle on `.ts`, `.mts` or `.cjs` files, it will only generate the type declarations once.

How do you get the other type declaration? To solve this problem you either have to run typescript multiple times and manipulate the input or output data to have correct `.d.mts` / `.d.cts` files AND imports... or do what this PR changes.

It runs typescript multiple times but places the complied files in different directories. It then places a package.json in both directories which declares if `.js` is commonjs or ESM.
This way the resolver is happy because it can import `.js` files according to the package.json content and typescript is happy because it can find type declarations. And because package.json files are inheriting properties from other package.json files no necessary file is missing.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-30 14:56:29 +02:00
renovate[bot]
3a1da59c16 fix(deps): update dependency @mrdrogdrog/optional to v1.2.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-30 11:51:05 +02:00
renovate[bot]
b016f7127d chore(deps): update linters
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-29 09:35:29 +02:00
renovate[bot]
6327f7fa16 chore(deps): update test packages to v29.6.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-27 10:56:59 +00:00
renovate[bot]
117d42b543 chore(deps): update typescript-eslint monorepo to v6.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-24 20:39:36 +02:00
Tilman Vatteroth
34bf8f16b1 fix: format code
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-19 12:36:32 +02:00
renovate[bot]
d75d406e67 chore(deps): update typescript-eslint monorepo to v6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-19 12:36:32 +02:00
renovate[bot]
ea2cac3f9f chore(deps): update dependency yjs to v13.6.7
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-19 10:25:34 +00:00
renovate[bot]
b42a6629ec chore(deps): update linters
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-16 10:51:51 +02:00
renovate[bot]
7d7c93d554 chore(deps): update dependency eslint to v8.45.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-16 10:41:43 +02:00
renovate[bot]
a0b9f72636 chore(deps): update dependency eslint-plugin-jest to v27.2.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-13 17:50:26 +00:00
renovate[bot]
b6ef68d081 chore(deps): update typescript-eslint monorepo to v5.62.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-10 20:49:06 +02:00
renovate[bot]
41c7cbfb75 chore(deps): update dependency @jest/types to v29.6.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-06 20:20:46 +00:00
renovate[bot]
8db1105522 chore(deps): update test packages to v29.6.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-06 18:07:12 +02:00
Tilman Vatteroth
eeef0ea025 test: add mocked message transporter
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
233fb263c7 fix: don't allow message sending before both sides are ready
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
57f7734f7f fix: add docs to sendMessage
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
823b8e5ad5 fix: don't block message receiving even despite the ready state
This shouldn't be handled here. If both sides are following the protocol then there shouldn't be any messages before this side hasn't sent the ready answer.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
e99a9f4855 fix: increase resend interval of READY_REQUEST
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
930e91195c fix: send one ready request immediately
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
9f1e0e48e3 fix: clear interval variable after deleting timer
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
ad04bb78a2 refactor: clean up y-doc sync adapter code
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
25ee20c15d refactor: rename ready function to match its intent
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
renovate[bot]
88bd420318 chore(deps): update dependency @jest/types to v29.6.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-05 14:06:32 +02:00
renovate[bot]
bd06c2e3cb chore(deps): update test packages to v29.6.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-04 21:00:35 +02:00
renovate[bot]
45b96a2e24 chore(deps): update typescript-eslint monorepo to v5.61.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-04 20:36:25 +02:00
renovate[bot]
14c42fc09e chore(deps): update yarn to v3.6.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-01 22:13:54 +02:00
renovate[bot]
b20e29b4d7 chore(deps): update dependency eslint to v8.44.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-01 22:11:35 +02:00
renovate[bot]
2276b4205d chore(deps): update dependency ts-jest to v29.1.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-30 10:51:59 +00:00
renovate[bot]
00692d8760 chore(deps): update dependency typescript to v5.1.6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-29 01:13:48 +00:00
Tilman Vatteroth
f4a1999a8b fix(communication): send ready event when both sides are ready
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-28 21:50:48 +02:00
renovate[bot]
e8c959268a chore(deps): update dependency typescript to v5.1.5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-28 04:37:04 +00:00
renovate[bot]
b14e711fac chore(deps): update typescript-eslint monorepo to v5.60.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 22:16:42 +00:00