create-wirejs-app 2.0.174 → 2.0.176

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-wirejs-app",
3
- "version": "2.0.174",
3
+ "version": "2.0.176",
4
4
  "description": "Initializes a wirejs package.",
5
5
  "author": "Jon Wire",
6
6
  "license": "MIT",
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  AuthenticationApi,
3
3
  BackgroundJob,
4
+ CronJob,
4
5
  RealtimeService,
5
6
  withContext,
6
7
  } from "wirejs-resources";
@@ -31,6 +32,22 @@ const counter = new BackgroundJob('app', 'countdowns', {
31
32
  },
32
33
  });
33
34
 
35
+ new CronJob('app', 'chat-ping', {
36
+ schedule: '*/5 * * * *',
37
+ async handler() {
38
+ const now = new Date();
39
+ const nowString = now.toLocaleString();
40
+ const tzOffset = now.getTimezoneOffset() / 60;
41
+ const tzOffsetString = tzOffset ? `+${tzOffset}` : `-${tzOffset}`;
42
+ const tz = `UTC${tzOffsetString}`;
43
+
44
+ realtimeService.publish('test', [{
45
+ username: 'cron',
46
+ body: `Hi. Just here to let you know what time it is. It's ${nowString} ${tz} ...`
47
+ }])
48
+ }
49
+ });
50
+
34
51
  export const Chat = (auth: AuthenticationApi) => withContext(context => ({
35
52
  async publish(room: string, message: string) {
36
53
  const user = await auth.requireCurrentUser(context);
@@ -11,15 +11,15 @@
11
11
  "dependencies": {
12
12
  "dompurify": "^3.2.3",
13
13
  "marked": "^15.0.6",
14
- "wirejs-components": "^0.1.112",
14
+ "wirejs-components": "^0.1.114",
15
15
  "wirejs-dom": "^1.0.44",
16
- "wirejs-module-payments-stripe": "^0.1.63",
17
- "wirejs-resources": "^0.1.169",
18
- "wirejs-web-worker": "^1.0.66"
16
+ "wirejs-module-payments-stripe": "^0.1.65",
17
+ "wirejs-resources": "^0.1.171",
18
+ "wirejs-web-worker": "^1.0.68"
19
19
  },
20
20
  "devDependencies": {
21
21
  "typescript": "^5.7.3",
22
- "wirejs-scripts": "^3.0.167"
22
+ "wirejs-scripts": "^3.0.169"
23
23
  },
24
24
  "scripts": {
25
25
  "prebuild": "npm run prebuild --workspaces --if-present",