@stacksjs/defaults 0.70.165 → 0.70.167

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.
@@ -1,4 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
+ import { log } from '@stacksjs/logging'
2
3
 
3
4
  export default new Action({
4
5
  name: 'BlogAnalyticsAction',
@@ -6,7 +7,7 @@ export default new Action({
6
7
  method: 'GET',
7
8
  async handle() {
8
9
  try {
9
- const { AnalyticsQueryAPI, AnalyticsStore } = await import('ts-analytics')
10
+ const { AnalyticsQueryAPI, AnalyticsStore } = await import('@ts-analytics/tracking/analytics')
10
11
  const store = new AnalyticsStore({ tableName: 'analytics' })
11
12
 
12
13
  const now = new Date()
@@ -51,7 +52,11 @@ export default new Action({
51
52
  authors: [],
52
53
  }
53
54
  }
54
- catch {
55
+ catch (error) {
56
+ // The analytics integration is optional: without
57
+ // @ts-analytics/tracking installed the dashboard renders empty
58
+ // rather than erroring. Log so a broken install is still visible.
59
+ log.debug('[BlogAnalyticsAction] analytics unavailable:', error)
55
60
  return { stats: [], topPosts: [], categories: [], authors: [] }
56
61
  }
57
62
  },
@@ -1,4 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
+ import { log } from '@stacksjs/logging'
2
3
 
3
4
  export default new Action({
4
5
  name: 'BrowserAnalyticsAction',
@@ -6,7 +7,7 @@ export default new Action({
6
7
  method: 'GET',
7
8
  async handle() {
8
9
  try {
9
- const { AnalyticsQueryAPI, AnalyticsStore } = await import('ts-analytics')
10
+ const { AnalyticsQueryAPI, AnalyticsStore } = await import('@ts-analytics/tracking/analytics')
10
11
  const store = new AnalyticsStore({ tableName: 'analytics' })
11
12
 
12
13
  const now = new Date()
@@ -35,7 +36,11 @@ export default new Action({
35
36
  })),
36
37
  }
37
38
  }
38
- catch {
39
+ catch (error) {
40
+ // The analytics integration is optional: without
41
+ // @ts-analytics/tracking installed the dashboard renders empty
42
+ // rather than erroring. Log so a broken install is still visible.
43
+ log.debug('[BrowserAnalyticsAction] analytics unavailable:', error)
39
44
  return { browsers: [] }
40
45
  }
41
46
  },
@@ -1,4 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
+ import { log } from '@stacksjs/logging'
2
3
 
3
4
  export default new Action({
4
5
  name: 'CommerceAnalyticsAction',
@@ -6,7 +7,7 @@ export default new Action({
6
7
  method: 'GET',
7
8
  async handle() {
8
9
  try {
9
- const { AnalyticsQueryAPI, AnalyticsStore } = await import('ts-analytics')
10
+ const { AnalyticsQueryAPI, AnalyticsStore } = await import('@ts-analytics/tracking/analytics')
10
11
  const store = new AnalyticsStore({ tableName: 'analytics' })
11
12
 
12
13
  const now = new Date()
@@ -57,7 +58,11 @@ export default new Action({
57
58
  revenueByChannel: [],
58
59
  }
59
60
  }
60
- catch {
61
+ catch (error) {
62
+ // The analytics integration is optional: without
63
+ // @ts-analytics/tracking installed the dashboard renders empty
64
+ // rather than erroring. Log so a broken install is still visible.
65
+ log.debug('[CommerceAnalyticsAction] analytics unavailable:', error)
61
66
  return { stats: [], topProducts: [], salesByRegion: [], revenueByChannel: [] }
62
67
  }
63
68
  },
@@ -1,4 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
+ import { log } from '@stacksjs/logging'
2
3
 
3
4
  export default new Action({
4
5
  name: 'CountryAnalyticsAction',
@@ -6,7 +7,7 @@ export default new Action({
6
7
  method: 'GET',
7
8
  async handle() {
8
9
  try {
9
- const { AnalyticsQueryAPI, AnalyticsStore } = await import('ts-analytics')
10
+ const { AnalyticsQueryAPI, AnalyticsStore } = await import('@ts-analytics/tracking/analytics')
10
11
  const store = new AnalyticsStore({ tableName: 'analytics' })
11
12
 
12
13
  const now = new Date()
@@ -34,7 +35,11 @@ export default new Action({
34
35
  })),
35
36
  }
36
37
  }
37
- catch {
38
+ catch (error) {
39
+ // The analytics integration is optional: without
40
+ // @ts-analytics/tracking installed the dashboard renders empty
41
+ // rather than erroring. Log so a broken install is still visible.
42
+ log.debug('[CountryAnalyticsAction] analytics unavailable:', error)
38
43
  return { countries: [] }
39
44
  }
40
45
  },
@@ -1,4 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
+ import { log } from '@stacksjs/logging'
2
3
 
3
4
  export default new Action({
4
5
  name: 'DeviceAnalyticsAction',
@@ -6,7 +7,7 @@ export default new Action({
6
7
  method: 'GET',
7
8
  async handle() {
8
9
  try {
9
- const { AnalyticsQueryAPI, AnalyticsStore } = await import('ts-analytics')
10
+ const { AnalyticsQueryAPI, AnalyticsStore } = await import('@ts-analytics/tracking/analytics')
10
11
  const store = new AnalyticsStore({ tableName: 'analytics' })
11
12
 
12
13
  const now = new Date()
@@ -51,7 +52,11 @@ export default new Action({
51
52
  })),
52
53
  }
53
54
  }
54
- catch {
55
+ catch (error) {
56
+ // The analytics integration is optional: without
57
+ // @ts-analytics/tracking installed the dashboard renders empty
58
+ // rather than erroring. Log so a broken install is still visible.
59
+ log.debug('[DeviceAnalyticsAction] analytics unavailable:', error)
55
60
  return { devices: [], os: [] }
56
61
  }
57
62
  },
@@ -1,4 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
+ import { log } from '@stacksjs/logging'
2
3
 
3
4
  export default new Action({
4
5
  name: 'EventAnalyticsAction',
@@ -6,7 +7,7 @@ export default new Action({
6
7
  method: 'GET',
7
8
  async handle() {
8
9
  try {
9
- const { AnalyticsQueryAPI, AnalyticsStore } = await import('ts-analytics')
10
+ const { AnalyticsQueryAPI, AnalyticsStore } = await import('@ts-analytics/tracking/analytics')
10
11
  const store = new AnalyticsStore({ tableName: 'analytics' })
11
12
 
12
13
  const now = new Date()
@@ -83,7 +84,11 @@ export default new Action({
83
84
  conversions,
84
85
  }
85
86
  }
86
- catch {
87
+ catch (error) {
88
+ // The analytics integration is optional: without
89
+ // @ts-analytics/tracking installed the dashboard renders empty
90
+ // rather than erroring. Log so a broken install is still visible.
91
+ log.debug('[EventAnalyticsAction] analytics unavailable:', error)
87
92
  return { goals: [], stats: [], conversions: [] }
88
93
  }
89
94
  },
@@ -1,4 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
+ import { log } from '@stacksjs/logging'
2
3
 
3
4
  export default new Action({
4
5
  name: 'MarketingAnalyticsAction',
@@ -6,7 +7,7 @@ export default new Action({
6
7
  method: 'GET',
7
8
  async handle() {
8
9
  try {
9
- const { AnalyticsQueryAPI, AnalyticsStore } = await import('ts-analytics')
10
+ const { AnalyticsQueryAPI, AnalyticsStore } = await import('@ts-analytics/tracking/analytics')
10
11
  const store = new AnalyticsStore({ tableName: 'analytics' })
11
12
 
12
13
  const now = new Date()
@@ -69,7 +70,11 @@ export default new Action({
69
70
  attribution: [],
70
71
  }
71
72
  }
72
- catch {
73
+ catch (error) {
74
+ // The analytics integration is optional: without
75
+ // @ts-analytics/tracking installed the dashboard renders empty
76
+ // rather than erroring. Log so a broken install is still visible.
77
+ log.debug('[MarketingAnalyticsAction] analytics unavailable:', error)
73
78
  return { stats: [], campaigns: [], channels: [], attribution: [] }
74
79
  }
75
80
  },
@@ -1,4 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
+ import { log } from '@stacksjs/logging'
2
3
 
3
4
  export default new Action({
4
5
  name: 'PageAnalyticsAction',
@@ -6,7 +7,7 @@ export default new Action({
6
7
  method: 'GET',
7
8
  async handle() {
8
9
  try {
9
- const { AnalyticsQueryAPI, AnalyticsStore } = await import('ts-analytics')
10
+ const { AnalyticsQueryAPI, AnalyticsStore } = await import('@ts-analytics/tracking/analytics')
10
11
  const store = new AnalyticsStore({ tableName: 'analytics' })
11
12
 
12
13
  const now = new Date()
@@ -38,7 +39,11 @@ export default new Action({
38
39
 
39
40
  return { pages }
40
41
  }
41
- catch {
42
+ catch (error) {
43
+ // The analytics integration is optional: without
44
+ // @ts-analytics/tracking installed the dashboard renders empty
45
+ // rather than erroring. Log so a broken install is still visible.
46
+ log.debug('[PageAnalyticsAction] analytics unavailable:', error)
42
47
  return { pages: [] }
43
48
  }
44
49
  },
@@ -1,4 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
+ import { log } from '@stacksjs/logging'
2
3
 
3
4
  export default new Action({
4
5
  name: 'ReferrerAnalyticsAction',
@@ -6,7 +7,7 @@ export default new Action({
6
7
  method: 'GET',
7
8
  async handle() {
8
9
  try {
9
- const { AnalyticsQueryAPI, AnalyticsStore } = await import('ts-analytics')
10
+ const { AnalyticsQueryAPI, AnalyticsStore } = await import('@ts-analytics/tracking/analytics')
10
11
  const store = new AnalyticsStore({ tableName: 'analytics' })
11
12
 
12
13
  const now = new Date()
@@ -65,7 +66,11 @@ export default new Action({
65
66
  })),
66
67
  }
67
68
  }
68
- catch {
69
+ catch (error) {
70
+ // The analytics integration is optional: without
71
+ // @ts-analytics/tracking installed the dashboard renders empty
72
+ // rather than erroring. Log so a broken install is still visible.
73
+ log.debug('[ReferrerAnalyticsAction] analytics unavailable:', error)
69
74
  return { referrers: [] }
70
75
  }
71
76
  },
@@ -1,4 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
+ import { log } from '@stacksjs/logging'
2
3
 
3
4
  export default new Action({
4
5
  name: 'WebAnalyticsAction',
@@ -6,7 +7,7 @@ export default new Action({
6
7
  method: 'GET',
7
8
  async handle() {
8
9
  try {
9
- const { AnalyticsQueryAPI, AnalyticsStore } = await import('ts-analytics')
10
+ const { AnalyticsQueryAPI, AnalyticsStore } = await import('@ts-analytics/tracking/analytics')
10
11
  const store = new AnalyticsStore({ tableName: 'analytics' })
11
12
  const queryApi = new AnalyticsQueryAPI(store)
12
13
 
@@ -107,7 +108,11 @@ export default new Action({
107
108
  })),
108
109
  }
109
110
  }
110
- catch {
111
+ catch (error) {
112
+ // The analytics integration is optional: without
113
+ // @ts-analytics/tracking installed the dashboard renders empty
114
+ // rather than erroring. Log so a broken install is still visible.
115
+ log.debug('[WebAnalyticsAction] analytics unavailable:', error)
111
116
  return { stats: [], topPages: [], sources: [], devices: [] }
112
117
  }
113
118
  },
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.70.165",
5
+ "version": "0.70.167",
6
6
  "description": "Default Stacks scaffold resources (views, layouts, components, preloader) — shipped so apps consuming the framework from node_modules get the same fallback resources a vendored checkout provides. Source of truth: storage/framework/defaults.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",