Bruno Windels
b5fe65d0cc
Merge pull request #617 from vector-im/bwindels/sdk-build
...
SDK build
2021-12-22 16:54:03 +01:00
Bruno Windels
24afe1e496
add licenses to readme of things we actually bundle
...
rather than just depend on
2021-12-22 16:45:08 +01:00
Bruno Windels
5f389e654a
add description
2021-12-22 16:37:53 +01:00
Bruno Windels
c31215bc2a
less logging during build
2021-12-22 16:31:19 +01:00
Bruno Windels
c3ff571af7
update SDK doc, use it as sdk package readme
2021-12-22 16:31:19 +01:00
Bruno Windels
441fa13bfd
change sdk package name to hydrogen-view-sdk
...
as we might want to also have a lower level sdk later on
2021-12-22 16:31:19 +01:00
Bruno Windels
3bee4b4585
bundle bs58 to avoid pain of bundle transitive dependency for lib users
...
bs58 depends on safe-buffer, which depends on buffer, which is a bit
of a pain to bundle as it is a built-in node module. You'd typically
replace buffer with a browser polyfill in your build system but:
a) this is somewhat a pain to setup for simple apps
b) the polyfill is way more than we need (6kb), so we prefer to bundle
our minimal buffer replacement that uses Uint8Array. Since it is
a transitive dependency, we need to bundle bs58 and all of its
transitive dependencies (2.5kb) as well, so if users of hydrogen-sdk
also use any of these, they'll be double included in their bundle.
2021-12-22 16:31:19 +01:00
Bruno Windels
b48280905e
include path/vite in sdk bundle
2021-12-22 16:31:19 +01:00
Bruno Windels
163dae647b
move output of both lib and asset build around for coherent package
2021-12-22 16:31:19 +01:00
Bruno Windels
c921091957
run two vite builds for the sdk build, assets & js separately
2021-12-22 16:31:19 +01:00
Bruno Windels
6add3f1da3
WIP
2021-12-22 16:31:19 +01:00
Bruno Windels
ceb0b5793b
somewhat works, but not everything we need
...
it's missing still:
- non-css assets like the download sandbox and the olm worker aren't written for some reason
- the es and cjs lib.js entry points end up in assets with a hash for some reason
- in these entry files, apart from our exports, something is adding an import statement for every import that was found in the tree
- all assets are hashed even though the config tries to disable that
- tests are included
2021-12-22 16:31:18 +01:00
Bruno Windels
14b854ad4f
make tsconfig file to build declaration files
2021-12-22 16:31:18 +01:00
Bruno Windels
df6000c706
basic sdk build config file for es and cjs
2021-12-22 16:31:18 +01:00
Bruno Windels
c11f0774eb
move common parts of build config to separate file and merge with it
2021-12-22 16:31:18 +01:00
Bruno Windels
f2b822e5d2
move deps that are not used for sdk to devDependencies
2021-12-22 16:31:18 +01:00
Bruno Windels
2d2005934a
WIP
2021-12-22 16:31:18 +01:00
Bruno Windels
363cd5b046
include css
2021-12-22 16:31:18 +01:00
Bruno Windels
8922d2aaf2
prototype of sdk build
2021-12-22 16:31:18 +01:00
RMidhunSuresh
10368500f2
Fix formatting
2021-12-10 12:12:52 +05:30
RMidhunSuresh
5ef7ab32df
Update doc
2021-12-10 12:09:18 +05:30
Bruno Windels
dacdc1aec6
Merge pull request #597 from vector-im/ts-conversion-matrix-ssss
...
Convert matrix/ssss to typescript
2021-12-09 18:54:25 +01:00
Bruno Windels
589a002d67
Merge pull request #588 from vector-im/ts-conversion-matrix-net
...
Convert /matrix/net to typescript
2021-12-09 18:51:33 +01:00
Bruno Windels
21a41e192b
Merge branch 'master' into ts-conversion-matrix-net
2021-12-09 18:49:54 +01:00
Bruno Windels
5ea29297cc
fix typescript errors
2021-12-09 18:44:44 +01:00
Bruno Windels
c5c08ea34b
Merge pull request #586 from vector-im/bwindels/log-signature-failure
...
log signature verification failure in logger, not console
2021-12-09 18:40:01 +01:00
Bruno Windels
8d315f2741
Merge branch 'master' into bwindels/log-signature-failure
2021-12-09 18:34:36 +01:00
Bruno Windels
cd0d9dcbba
Merge pull request #548 from vector-im/bwindels/vite-mvp
...
Convert develop server and build system to using Vite
2021-12-09 18:29:06 +01:00
Bruno Windels
ba84387722
remove commented out code
2021-12-09 18:15:22 +01:00
Bruno Windels
0ec86b6dc1
Merge branch 'master' into bwindels/vite-mvp
2021-12-09 18:07:17 +01:00
Bruno Windels
5c5193ef48
remove old build system and unused dependencies
...
some of these are for the ie11 legacy build, which has been
postponed. They will be brougth back when we bring back the legacy build
2021-12-09 18:04:11 +01:00
Bruno Windels
d9ff4a8484
sw.js is not part of the sdk yet, so just put the path in index.html
2021-12-09 17:12:08 +01:00
Bruno Windels
dea7e7b4f5
enable minification and source maps
2021-12-09 16:42:35 +01:00
Bruno Windels
62827b92b7
implement placeholder replacement so it still works with minification
2021-12-09 16:37:31 +01:00
Bruno Windels
9a82f88e1f
log swSource as build fails in CI
2021-12-09 15:13:19 +01:00
Bruno Windels
23e0d3f2ff
get notification badge icon url through import now we transpile the sw
2021-12-09 15:13:05 +01:00
Bruno Windels
a4fac68393
use same method for setting version and build hash placeholder in sw
...
also better naming in service worker plugin
2021-12-09 14:36:12 +01:00
Bruno Windels
f934262e35
also use global hash var here
2021-12-09 12:22:17 +01:00
Bruno Windels
14dffa4ad4
remove leftover logging
2021-12-09 12:21:34 +01:00
Bruno Windels
8e4da396ea
replace global hash in given chunks
2021-12-09 12:15:17 +01:00
Bruno Windels
c344032c0a
transpile service worker and cleanup build plugin
2021-12-09 11:39:28 +01:00
Bruno Windels
180681b602
manifest ends up in assets folder, index.html in parent folder
2021-12-08 18:29:32 +01:00
Bruno Windels
fb8149b6cf
add base to manifest path, just for completeness
2021-12-08 18:29:07 +01:00
Bruno Windels
4c2c99fc07
actually remove lookbehind
2021-12-08 18:05:57 +01:00
Bruno Windels
c8b0354d07
dont use lookbehind in regular expressions, safari & older firefoxes choke on them
2021-12-08 18:00:37 +01:00
Bruno Windels
c87628b614
cleanup
2021-12-06 15:40:15 +01:00
Bruno Windels
5bd28da4f3
loading olm from the worker was broken, reading the wrong global
2021-12-06 15:35:08 +01:00
Bruno Windels
0e2a22f509
also look in chunks for cacheable assets for service worker
2021-12-06 15:34:39 +01:00
Bruno Windels
91e69a2bd0
fix icons in manifest not being found
2021-12-06 15:25:44 +01:00
Bruno Windels
155cd4c9bd
make olmPath absolute if it isn't already
2021-12-06 13:49:14 +01:00