47 Commits

Author SHA1 Message Date
7434c9fb42 Add UserService (RPC version) 2019-08-28 18:26:26 +07:00
cd5ff9b5da Generate @rondo.dev/common entities 2019-08-28 08:08:00 +07:00
dffad844ad Rename scope @rondo to @rondo.dev 2019-08-25 11:33:06 +07:00
79c6d1a608 Refactor scripts, add ability to load external scripts 2019-08-18 09:57:47 +07:00
19565563cc Add Contextual<Service, Context> type
As seen in TeamService2.ts, the Contextual type will add Context as the
last argument to any method of the interface, as long as the method has
0-4 arguments.

Interfaces with more than 4 arguments cannot use this type, but they
could be converted to interfaces which use 1 argument
(object/dictionary) only.

Some long-term thinking: Maybe only methods with a single argument
should be supported, similar to the way gRPC does it.
2019-08-07 22:37:48 +07:00
b617069784 Add packages/services/src/services/TeamService2.ts
A few notes:

1) The context higher-order function will be tedious to define - a lot
   more typing than just an extra function argument.
2) As some methods do not require the context function, forgetting to
   call it might introduce bugs (await fn will not error out), but
   compile checks of the return value type might detect this

Possible solution is to go the GRPC way and allow only a single method
type as a parameter so all server-side method types would look like:

  async fn(param: IParam, context: Context) {}

and all client-side method types would look like:

  async fn(param: IParam) {}

However, This would deviate from the JSON-RPC standard which allows
multiple arguments to be passed in an array.

Alternatively, context could be passed as a first argument and then
filtered out:

  type Arguments<T> = T extends (context: Ctx, ...args: infer A) => infer R
    ? A
    : never

In this case, the type of Ctx would need to be known in advance. Will
have to think about this some more.
2019-08-06 19:26:11 +07:00
15d54639ab Move ILogger to @rondo/common 2019-08-04 13:15:33 +07:00
90d1e1a040 Fix broken StringUtils.test.ts 2019-04-11 13:42:19 +08:00
7711a9596c Remove markdown from client-side
Markdown parser takes too much space in the final compressed bundle
2019-04-11 12:20:39 +08:00
9d282b278d Build ESM client-side modules to enable tree shaking
TypeScript compiler needs to be configured to output ES6 module by
setting --module es6 or the equivalent tsconfig.json compilerOptions
parameter.

Since tsc --build does not accept compiler options flags, we need to
duplicate some of the configuration:

- specify separate output folder for ES6 module files (new
  tsconfig.esm.json file)
- add "module" field for ES6 module (esm) output files to package.json

Hence, a script `scripts/sync-esm-config.js` was added to automate this
process.
2019-04-11 11:40:07 +08:00
65f1703089 Add ability to load user votes on frontend 2019-04-08 13:34:19 +08:00
17d67900c1 Add safe Markdown parsing to CommentService 2019-04-07 13:44:35 +08:00
6418cd64b6 Add @rondo/common Markdown 2019-04-07 13:16:18 +08:00
89af2f0845 Add StringUtils 2019-04-06 13:58:20 +08:00
831001a9c5 Add createFilterProps 2019-04-03 18:02:36 +08:00
264f5aba60 Add T prefix for all type defs 2019-04-02 16:22:38 +08:00
adfa7a069a Add common tslint.json configuration 2019-04-02 14:46:40 +08:00
0a9648c392 Add packages/common/src/types.ts 2019-04-02 14:38:01 +08:00
fbfcb67c41 Throw error when URL param missing 2019-04-01 12:57:52 +08:00
5c22f44930 Use === in without.ts 2019-03-25 13:20:03 +08:00
e50dd99206 Add common/src/without.ts 2019-03-24 10:47:53 +08:00
a628082a73 Add packages/client/src/team 2019-03-20 15:01:15 +05:00
5317187a45 Add packages/common/src/indexBy.ts 2019-03-20 12:37:05 +05:00
7a0d44abe4 Return ITeam[] from /my/teams 2019-03-20 11:15:49 +05:00
46e56b7ad4 Add routes for managing users in teams 2019-03-19 17:51:16 +05:00
30a8c56119 Fix test for User firstName & lastName
Also fix CSRF token. This was probably broken since csurf middleware was
modified to use cookie instead of session storage to provide support for
single page app (SPA).
2019-03-18 15:53:05 +05:00
5a34885605 Add withForm HOC, as well as RegisterForm 2019-03-17 15:05:02 +05:00
61edf10a5b Extract @rondo/comments-common 2019-03-13 13:26:09 +05:00
cec34260ce Add test for PUT /comments/:commentId 2019-03-11 22:11:53 +05:00
051208753b Add more tests for Comments 2019-03-10 19:40:06 +05:00
234db553b1 Add ability to delete a Site 2019-03-10 16:05:20 +05:00
14e90f9559 Add put & delete team route 2019-03-09 22:56:55 +05:00
4cc03fe611 Add test for StoryRoutes 2019-01-27 16:19:35 +01:00
52dc876845 Add ability to specify query params in tests 2019-01-27 16:07:16 +01:00
3b295b2e13 Add StoryRoutes.test.ts 2019-01-25 12:28:20 +01:00
2ed3aeac26 Add Routes to application 2019-01-24 17:55:49 +01:00
f0943cfe80 Add SiteRoutes, StoryRoutes and TeamRoutes 2019-01-22 13:30:15 +01:00
d0e94808bb Fix CommentRoutes 2019-01-22 13:06:01 +01:00
8865b58747 Add basic Site, Story and TeamService 2019-01-22 12:29:47 +01:00
0c70a3b688 Move ICommentTree to @rondo/common 2019-01-22 11:59:23 +01:00
2e0402b189 Implement basic CommentService 2019-01-22 11:57:15 +01:00
10e5775bf4 Add initial comments setup 2019-01-21 01:04:58 +01:00
eedd57c527 Add ability to easily create unions of action types 2019-01-19 15:23:51 +01:00
8fd2eafdca Reorganize tsconfig.json files
According to:
https://github.com/RyanCavanaugh/learn-a
2019-01-18 23:00:36 +01:00
953b8f4abb Move react dependencies to packages/client 2019-01-18 20:42:09 +01:00
076ec515d3 Add packages/common 2019-01-18 20:33:54 +01:00
de174b8894 Create package common 2019-01-18 20:24:19 +01:00