@posthog/wizard 1.7.0 → 1.8.0
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/dist/src/run.js +1 -1
- package/dist/src/run.js.map +1 -1
- package/dist/src/utils/__tests__/analytics.test.js +23 -41
- package/dist/src/utils/__tests__/analytics.test.js.map +1 -1
- package/dist/src/utils/analytics.js +4 -6
- package/dist/src/utils/analytics.js.map +1 -1
- package/dist/src/utils/query.d.ts +3 -2
- package/dist/src/utils/query.js +3 -2
- package/dist/src/utils/query.js.map +1 -1
- package/dist/src/utils/types.d.ts +1 -0
- package/dist/src/utils/types.js.map +1 -1
- package/package.json +3 -3
package/dist/src/run.js
CHANGED
|
@@ -74,7 +74,7 @@ async function runWizard(argv) {
|
|
|
74
74
|
arguments: JSON.stringify(finalArgs),
|
|
75
75
|
});
|
|
76
76
|
await analytics_1.analytics.shutdown('error');
|
|
77
|
-
clack_1.default.log.error(`Something went wrong. You can read the documentation
|
|
77
|
+
clack_1.default.log.error(`Something went wrong. You can read the documentation at ${chalk_1.default.cyan(`${config_1.INTEGRATION_CONFIG[integration].docsUrl}`)} to set up PostHog manually.`);
|
|
78
78
|
process.exit(1);
|
|
79
79
|
}
|
|
80
80
|
}
|
package/dist/src/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/run.ts"],"names":[],"mappings":";;;;;AA8BA,8BAmEC;AAjGD,qDAAuD;AAEvD,0DAAyD;AAGzD,+CAAyE;AACzE,qDAAsD;AACtD,0DAAkC;AAClC,gDAAwB;AACxB,yCAAqE;AACrE,uDAAsD;AACtD,iDAA8C;AAC9C,0DAAyD;AACzD,4EAA0E;AAC1E,uDAAsD;AACtD,mCAAsC;AACtC,kDAA0B;AAE1B,qBAAY,CAAC,mBAAmB,GAAG,EAAE,CAAC;AAY/B,KAAK,UAAU,SAAS,CAAC,IAAU;IACxC,MAAM,SAAS,GAAG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,CAAC,CAAC;IAE7D,IAAI,mBAAmB,EAAE,CAAC;QACxB,eAAK,CAAC,GAAG,CAAC,OAAO,CACf,yBAAyB,IAAA,qCAAyB,EAAC,mBAAmB,CAAC,EAAE,CAC1E,CAAC;QACF,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,MAAM,WAAW,GAAgB,MAAM,IAAA,8BAAgB,EACrD,eAAK,CAAC,MAAM,CAAC;QACX,OAAO,EAAE,6BAA6B;QACtC,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,uBAAW,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;YAC/C,EAAE,KAAK,EAAE,uBAAW,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE;YAC5C,EAAE,KAAK,EAAE,uBAAW,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE;YAC5C,EAAE,KAAK,EAAE,uBAAW,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;YAC9C,EAAE,KAAK,EAAE,uBAAW,CAAC,WAAW,EAAE,KAAK,EAAE,cAAc,EAAE;SAC1D;KACF,CAAC,CACH,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import { abortIfCancelled } from './utils/clack-utils';\n\nimport { runNextjsWizard } from './nextjs/nextjs-wizard';\nimport type { CloudRegion, WizardOptions } from './utils/types';\n\nimport { getIntegrationDescription, Integration } from './lib/constants';\nimport { readEnvironment } from './utils/environment';\nimport clack from './utils/clack';\nimport path from 'path';\nimport { INTEGRATION_CONFIG, INTEGRATION_ORDER } from './lib/config';\nimport { runReactWizard } from './react/react-wizard';\nimport { analytics } from './utils/analytics';\nimport { runSvelteWizard } from './svelte/svelte-wizard';\nimport { runReactNativeWizard } from './react-native/react-native-wizard';\nimport { runAstroWizard } from './astro/astro-wizard';\nimport { EventEmitter } from 'events';\nimport chalk from 'chalk';\n\nEventEmitter.defaultMaxListeners = 50;\n\ntype Args = {\n integration?: Integration;\n debug?: boolean;\n forceInstall?: boolean;\n installDir?: string;\n region?: CloudRegion;\n default?: boolean;\n signup?: boolean;\n};\n\nexport async function runWizard(argv: Args) {\n const finalArgs = {\n ...argv,\n ...readEnvironment(),\n };\n\n let resolvedInstallDir: string;\n if (finalArgs.installDir) {\n if (path.isAbsolute(finalArgs.installDir)) {\n resolvedInstallDir = finalArgs.installDir;\n } else {\n resolvedInstallDir = path.join(process.cwd(), finalArgs.installDir);\n }\n } else {\n resolvedInstallDir = process.cwd();\n }\n\n const wizardOptions: WizardOptions = {\n debug: finalArgs.debug ?? false,\n forceInstall: finalArgs.forceInstall ?? false,\n installDir: resolvedInstallDir,\n cloudRegion: finalArgs.region ?? undefined,\n default: finalArgs.default ?? false,\n signup: finalArgs.signup ?? false,\n };\n\n clack.intro(`Welcome to the PostHog setup wizard ✨`);\n\n const integration =\n finalArgs.integration ?? (await getIntegrationForSetup(wizardOptions));\n\n analytics.setTag('integration', integration);\n\n try {\n switch (integration) {\n case Integration.nextjs:\n await runNextjsWizard(wizardOptions);\n break;\n case Integration.react:\n await runReactWizard(wizardOptions);\n break;\n case Integration.svelte:\n await runSvelteWizard(wizardOptions);\n break;\n case Integration.reactNative:\n await runReactNativeWizard(wizardOptions);\n break;\n case Integration.astro:\n await runAstroWizard(wizardOptions);\n break;\n default:\n clack.log.error('No setup wizard selected!');\n }\n } catch (error) {\n analytics.captureException(error as Error, {\n integration,\n arguments: JSON.stringify(finalArgs),\n });\n\n await analytics.shutdown('error');\n clack.log.error(\n `Something went wrong. You can read the documentation at ${chalk.cyan(\n `${INTEGRATION_CONFIG[integration].docsUrl}`,\n )} to set up PostHog manually.`,\n );\n process.exit(1);\n }\n}\n\nasync function detectIntegration(\n options: Pick<WizardOptions, 'installDir'>,\n): Promise<Integration | undefined> {\n const integrationConfigs = Object.entries(INTEGRATION_CONFIG).sort(\n ([a], [b]) =>\n INTEGRATION_ORDER.indexOf(a as Integration) -\n INTEGRATION_ORDER.indexOf(b as Integration),\n );\n\n for (const [integration, config] of integrationConfigs) {\n const detected = await config.detect(options);\n if (detected) {\n return integration as Integration;\n }\n }\n}\n\nasync function getIntegrationForSetup(\n options: Pick<WizardOptions, 'installDir'>,\n) {\n const detectedIntegration = await detectIntegration(options);\n\n if (detectedIntegration) {\n clack.log.success(\n `Detected integration: ${getIntegrationDescription(detectedIntegration)}`,\n );\n return detectedIntegration;\n }\n\n const integration: Integration = await abortIfCancelled(\n clack.select({\n message: 'What do you want to set up?',\n options: [\n { value: Integration.nextjs, label: 'Next.js' },\n { value: Integration.astro, label: 'Astro' },\n { value: Integration.react, label: 'React' },\n { value: Integration.svelte, label: 'Svelte' },\n { value: Integration.reactNative, label: 'React Native' },\n ],\n }),\n );\n\n return integration;\n}\n"]}
|
|
@@ -28,10 +28,8 @@ describe('Analytics', () => {
|
|
|
28
28
|
const properties = { integration: 'nextjs' };
|
|
29
29
|
analytics.captureException(error, properties);
|
|
30
30
|
expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(error, 'test-uuid', {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
...properties,
|
|
34
|
-
},
|
|
31
|
+
team: 'growth',
|
|
32
|
+
...properties,
|
|
35
33
|
});
|
|
36
34
|
});
|
|
37
35
|
it('should capture exception with tags included in properties', () => {
|
|
@@ -40,11 +38,9 @@ describe('Analytics', () => {
|
|
|
40
38
|
analytics.setTag('testTag', 'testValue');
|
|
41
39
|
analytics.captureException(error, properties);
|
|
42
40
|
expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(error, 'test-uuid', {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
...properties,
|
|
47
|
-
},
|
|
41
|
+
team: 'growth',
|
|
42
|
+
testTag: 'testValue',
|
|
43
|
+
...properties,
|
|
48
44
|
});
|
|
49
45
|
});
|
|
50
46
|
it('should capture exception with distinct ID when set', () => {
|
|
@@ -53,18 +49,14 @@ describe('Analytics', () => {
|
|
|
53
49
|
analytics.setDistinctId(distinctId);
|
|
54
50
|
analytics.captureException(error);
|
|
55
51
|
expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(error, distinctId, {
|
|
56
|
-
|
|
57
|
-
team: 'growth',
|
|
58
|
-
},
|
|
52
|
+
team: 'growth',
|
|
59
53
|
});
|
|
60
54
|
});
|
|
61
55
|
it('should capture exception without properties when not provided', () => {
|
|
62
56
|
const error = new Error('Test error');
|
|
63
57
|
analytics.captureException(error);
|
|
64
58
|
expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(error, 'test-uuid', {
|
|
65
|
-
|
|
66
|
-
team: 'growth',
|
|
67
|
-
},
|
|
59
|
+
team: 'growth',
|
|
68
60
|
});
|
|
69
61
|
});
|
|
70
62
|
it('should merge tags with provided properties', () => {
|
|
@@ -74,13 +66,11 @@ describe('Analytics', () => {
|
|
|
74
66
|
analytics.setTag('version', '1.0.0');
|
|
75
67
|
analytics.captureException(error, properties);
|
|
76
68
|
expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(error, 'test-uuid', {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
step: 'installation',
|
|
83
|
-
},
|
|
69
|
+
team: 'growth',
|
|
70
|
+
environment: 'test',
|
|
71
|
+
version: '1.0.0',
|
|
72
|
+
integration: 'nextjs',
|
|
73
|
+
step: 'installation',
|
|
84
74
|
});
|
|
85
75
|
});
|
|
86
76
|
it('should override tags with properties when keys conflict', () => {
|
|
@@ -89,19 +79,15 @@ describe('Analytics', () => {
|
|
|
89
79
|
analytics.setTag('integration', 'nextjs');
|
|
90
80
|
analytics.captureException(error, properties);
|
|
91
81
|
expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(error, 'test-uuid', {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
integration: 'react',
|
|
95
|
-
},
|
|
82
|
+
team: 'growth',
|
|
83
|
+
integration: 'react',
|
|
96
84
|
});
|
|
97
85
|
});
|
|
98
86
|
it('should always include team:growth property in exceptions', () => {
|
|
99
87
|
const error = new Error('Test error');
|
|
100
88
|
analytics.captureException(error);
|
|
101
89
|
expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(error, 'test-uuid', {
|
|
102
|
-
|
|
103
|
-
team: 'growth',
|
|
104
|
-
},
|
|
90
|
+
team: 'growth',
|
|
105
91
|
});
|
|
106
92
|
});
|
|
107
93
|
});
|
|
@@ -116,14 +102,12 @@ describe('Analytics', () => {
|
|
|
116
102
|
step: 'wizard-execution',
|
|
117
103
|
});
|
|
118
104
|
expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(error, 'test-uuid', {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
step: 'wizard-execution',
|
|
126
|
-
},
|
|
105
|
+
team: 'growth',
|
|
106
|
+
integration: 'nextjs',
|
|
107
|
+
forceInstall: true,
|
|
108
|
+
debug: false,
|
|
109
|
+
arguments: JSON.stringify({ installDir: '/test' }),
|
|
110
|
+
step: 'wizard-execution',
|
|
127
111
|
});
|
|
128
112
|
});
|
|
129
113
|
it('should work correctly with setDistinctId and captureException', () => {
|
|
@@ -133,10 +117,8 @@ describe('Analytics', () => {
|
|
|
133
117
|
analytics.setTag('integration', 'svelte');
|
|
134
118
|
analytics.captureException(error);
|
|
135
119
|
expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(error, distinctId, {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
integration: 'svelte',
|
|
139
|
-
},
|
|
120
|
+
team: 'growth',
|
|
121
|
+
integration: 'svelte',
|
|
140
122
|
});
|
|
141
123
|
});
|
|
142
124
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.test.js","sourceRoot":"","sources":["../../../../src/utils/__tests__/analytics.test.ts"],"names":[],"mappings":";;AAAA,4CAAyC;AACzC,+CAAuC;AACvC,+BAAoC;AAEpC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC1B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,CAAC,CAAC;YACtC,MAAM,UAAU,GAAG,UAAU,CAAC;YAE9B,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YACpC,SAAS,CAAC,MAAM,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;YAC1C,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAElC,MAAM,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,oBAAoB,CAC/D,KAAK,EACL,UAAU,EACV;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,QAAQ;iBACtB;aACF,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Analytics } from '../analytics';\nimport { PostHog } from 'posthog-node';\nimport { v4 as uuidv4 } from 'uuid';\n\njest.mock('posthog-node');\njest.mock('uuid');\n\nconst mockUuidv4 = uuidv4 as jest.MockedFunction<typeof uuidv4>;\nconst MockedPostHog = PostHog as jest.MockedClass<typeof PostHog>;\n\ndescribe('Analytics', () => {\n let analytics: Analytics;\n let mockPostHogInstance: jest.Mocked<PostHog>;\n\n beforeEach(() => {\n jest.clearAllMocks();\n mockUuidv4.mockReturnValue('test-uuid' as any);\n\n mockPostHogInstance = {\n capture: jest.fn(),\n captureException: jest.fn(),\n alias: jest.fn(),\n shutdown: jest.fn().mockResolvedValue(undefined),\n } as any;\n\n MockedPostHog.mockImplementation(() => mockPostHogInstance);\n\n analytics = new Analytics();\n });\n\n describe('captureException', () => {\n it('should capture exception with error object and properties', () => {\n const error = new Error('Test error');\n const properties = { integration: 'nextjs' };\n\n analytics.captureException(error, properties);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n properties: {\n team: 'growth',\n ...properties,\n },\n },\n );\n });\n\n it('should capture exception with tags included in properties', () => {\n const error = new Error('Test error');\n const properties = { integration: 'nextjs' };\n\n analytics.setTag('testTag', 'testValue');\n analytics.captureException(error, properties);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n properties: {\n team: 'growth',\n testTag: 'testValue',\n ...properties,\n },\n },\n );\n });\n\n it('should capture exception with distinct ID when set', () => {\n const error = new Error('Test error');\n const distinctId = 'user-123';\n\n analytics.setDistinctId(distinctId);\n analytics.captureException(error);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n distinctId,\n {\n properties: {\n team: 'growth',\n },\n },\n );\n });\n\n it('should capture exception without properties when not provided', () => {\n const error = new Error('Test error');\n\n analytics.captureException(error);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n properties: {\n team: 'growth',\n },\n },\n );\n });\n\n it('should merge tags with provided properties', () => {\n const error = new Error('Test error');\n const properties = { integration: 'nextjs', step: 'installation' };\n\n analytics.setTag('environment', 'test');\n analytics.setTag('version', '1.0.0');\n analytics.captureException(error, properties);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n properties: {\n team: 'growth',\n environment: 'test',\n version: '1.0.0',\n integration: 'nextjs',\n step: 'installation',\n },\n },\n );\n });\n\n it('should override tags with properties when keys conflict', () => {\n const error = new Error('Test error');\n const properties = { integration: 'react' };\n\n analytics.setTag('integration', 'nextjs');\n analytics.captureException(error, properties);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n properties: {\n team: 'growth',\n integration: 'react',\n },\n },\n );\n });\n\n it('should always include team:growth property in exceptions', () => {\n const error = new Error('Test error');\n\n analytics.captureException(error);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n properties: {\n team: 'growth',\n },\n },\n );\n });\n });\n\n describe('integration with other methods', () => {\n it('should work correctly with setTag and captureException', () => {\n const error = new Error('Test error');\n\n analytics.setTag('integration', 'nextjs');\n analytics.setTag('forceInstall', true);\n analytics.setTag('debug', false);\n\n analytics.captureException(error, {\n arguments: JSON.stringify({ installDir: '/test' }),\n step: 'wizard-execution',\n });\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n properties: {\n team: 'growth',\n integration: 'nextjs',\n forceInstall: true,\n debug: false,\n arguments: JSON.stringify({ installDir: '/test' }),\n step: 'wizard-execution',\n },\n },\n );\n });\n\n it('should work correctly with setDistinctId and captureException', () => {\n const error = new Error('Test error');\n const distinctId = 'user-456';\n\n analytics.setDistinctId(distinctId);\n analytics.setTag('integration', 'svelte');\n analytics.captureException(error);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n distinctId,\n {\n properties: {\n team: 'growth',\n integration: 'svelte',\n },\n },\n );\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"analytics.test.js","sourceRoot":"","sources":["../../../../src/utils/__tests__/analytics.test.ts"],"names":[],"mappings":";;AAAA,4CAAyC;AACzC,+CAAuC;AACvC,+BAAoC;AAEpC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAElB,MAAM,UAAU,GAAG,SAA4C,CAAC;AAChE,MAAM,aAAa,GAAG,sBAA2C,CAAC;AAElE,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAI,SAAoB,CAAC;IACzB,IAAI,mBAAyC,CAAC;IAE9C,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,UAAU,CAAC,eAAe,CAAC,WAAkB,CAAC,CAAC;QAE/C,mBAAmB,GAAG;YACpB,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;YAClB,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE;YAC3B,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE;YAChB,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,CA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EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;gBAClD,IAAI,EAAE,kBAAkB;aACzB,CAAC,CAAC;YAEH,MAAM,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,oBAAoB,CAC/D,KAAK,EACL,WAAW,EACX;gBACE,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,QAAQ;gBACrB,YAAY,EAAE,IAAI;gBAClB,KAAK,EAAE,KAAK;gBACZ,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;gBAClD,IAAI,EAAE,kBAAkB;aACzB,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;YACvE,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;YACtC,MAAM,UAAU,GAAG,UAAU,CAAC;YAE9B,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YACpC,SAAS,CAAC,MAAM,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;YAC1C,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAElC,MAAM,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,oBAAoB,CAC/D,KAAK,EACL,UAAU,EACV;gBACE,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,QAAQ;aACtB,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Analytics } from '../analytics';\nimport { PostHog } from 'posthog-node';\nimport { v4 as uuidv4 } from 'uuid';\n\njest.mock('posthog-node');\njest.mock('uuid');\n\nconst mockUuidv4 = uuidv4 as jest.MockedFunction<typeof uuidv4>;\nconst MockedPostHog = PostHog as jest.MockedClass<typeof PostHog>;\n\ndescribe('Analytics', () => {\n let analytics: Analytics;\n let mockPostHogInstance: jest.Mocked<PostHog>;\n\n beforeEach(() => {\n jest.clearAllMocks();\n mockUuidv4.mockReturnValue('test-uuid' as any);\n\n mockPostHogInstance = {\n capture: jest.fn(),\n captureException: jest.fn(),\n alias: jest.fn(),\n shutdown: jest.fn().mockResolvedValue(undefined),\n } as any;\n\n MockedPostHog.mockImplementation(() => mockPostHogInstance);\n\n analytics = new Analytics();\n });\n\n describe('captureException', () => {\n it('should capture exception with error object and properties', () => {\n const error = new Error('Test error');\n const properties = { integration: 'nextjs' };\n\n analytics.captureException(error, properties);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n team: 'growth',\n ...properties,\n },\n );\n });\n\n it('should capture exception with tags included in properties', () => {\n const error = new Error('Test error');\n const properties = { integration: 'nextjs' };\n\n analytics.setTag('testTag', 'testValue');\n analytics.captureException(error, properties);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n team: 'growth',\n testTag: 'testValue',\n ...properties,\n },\n );\n });\n\n it('should capture exception with distinct ID when set', () => {\n const error = new Error('Test error');\n const distinctId = 'user-123';\n\n analytics.setDistinctId(distinctId);\n analytics.captureException(error);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n distinctId,\n {\n team: 'growth',\n },\n );\n });\n\n it('should capture exception without properties when not provided', () => {\n const error = new Error('Test error');\n\n analytics.captureException(error);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n team: 'growth',\n },\n );\n });\n\n it('should merge tags with provided properties', () => {\n const error = new Error('Test error');\n const properties = { integration: 'nextjs', step: 'installation' };\n\n analytics.setTag('environment', 'test');\n analytics.setTag('version', '1.0.0');\n analytics.captureException(error, properties);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n team: 'growth',\n environment: 'test',\n version: '1.0.0',\n integration: 'nextjs',\n step: 'installation',\n },\n );\n });\n\n it('should override tags with properties when keys conflict', () => {\n const error = new Error('Test error');\n const properties = { integration: 'react' };\n\n analytics.setTag('integration', 'nextjs');\n analytics.captureException(error, properties);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n team: 'growth',\n integration: 'react',\n },\n );\n });\n\n it('should always include team:growth property in exceptions', () => {\n const error = new Error('Test error');\n\n analytics.captureException(error);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n team: 'growth',\n },\n );\n });\n });\n\n describe('integration with other methods', () => {\n it('should work correctly with setTag and captureException', () => {\n const error = new Error('Test error');\n\n analytics.setTag('integration', 'nextjs');\n analytics.setTag('forceInstall', true);\n analytics.setTag('debug', false);\n\n analytics.captureException(error, {\n arguments: JSON.stringify({ installDir: '/test' }),\n step: 'wizard-execution',\n });\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n 'test-uuid',\n {\n team: 'growth',\n integration: 'nextjs',\n forceInstall: true,\n debug: false,\n arguments: JSON.stringify({ installDir: '/test' }),\n step: 'wizard-execution',\n },\n );\n });\n\n it('should work correctly with setDistinctId and captureException', () => {\n const error = new Error('Test error');\n const distinctId = 'user-456';\n\n analytics.setDistinctId(distinctId);\n analytics.setTag('integration', 'svelte');\n analytics.captureException(error);\n\n expect(mockPostHogInstance.captureException).toHaveBeenCalledWith(\n error,\n distinctId,\n {\n team: 'growth',\n integration: 'svelte',\n },\n );\n });\n });\n});\n"]}
|
|
@@ -30,13 +30,11 @@ class Analytics {
|
|
|
30
30
|
setTag(key, value) {
|
|
31
31
|
this.tags[key] = value;
|
|
32
32
|
}
|
|
33
|
-
captureException(error, properties) {
|
|
33
|
+
captureException(error, properties = {}) {
|
|
34
34
|
this.client.captureException(error, this.distinctId ?? this.anonymousId, {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
...properties,
|
|
39
|
-
},
|
|
35
|
+
team: 'growth',
|
|
36
|
+
...this.tags,
|
|
37
|
+
...properties,
|
|
40
38
|
});
|
|
41
39
|
}
|
|
42
40
|
capture(eventName, properties) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../../src/utils/analytics.ts"],"names":[],"mappings":";;;AAAA,+CAAuC;AACvC,gDAG0B;AAC1B,+BAAoC;AACpC,MAAa,SAAS;IACZ,MAAM,CAAU;IAChB,IAAI,GACV,EAAE,CAAC;IACG,UAAU,CAAU;IACpB,WAAW,CAAS;IAE5B;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,sBAAO,CAAC,sDAA0C,EAAE;YACpE,IAAI,EAAE,8BAAkB;YACxB,OAAO,EAAE,CAAC;YACV,aAAa,EAAE,CAAC;YAChB,0BAA0B,EAAE,IAAI;SACjC,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QAEf,IAAI,CAAC,WAAW,GAAG,IAAA,SAAM,GAAE,CAAC;QAE5B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAED,aAAa,CAAC,UAAkB;QAC9B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAChB,UAAU;YACV,KAAK,EAAE,IAAI,CAAC,WAAW;SACxB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,GAAW,EAAE,KAAmD;QACrE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,gBAAgB,CAAC,KAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../../src/utils/analytics.ts"],"names":[],"mappings":";;;AAAA,+CAAuC;AACvC,gDAG0B;AAC1B,+BAAoC;AACpC,MAAa,SAAS;IACZ,MAAM,CAAU;IAChB,IAAI,GACV,EAAE,CAAC;IACG,UAAU,CAAU;IACpB,WAAW,CAAS;IAE5B;QACE,IAAI,CAAC,MAAM,GAA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CAAC,EAAE,CAAC;YACxC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YAClB,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW;YAC/C,KAAK,EAAE,uBAAuB;YAC9B,UAAU,EAAE;gBACV,MAAM;gBACN,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB;SACF,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;CACF;AArED,8BAqEC;AAEY,QAAA,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC","sourcesContent":["import { PostHog } from 'posthog-node';\nimport {\n ANALYTICS_HOST_URL,\n ANALYTICS_POSTHOG_PUBLIC_PROJECT_WRITE_KEY,\n} from '../lib/constants';\nimport { v4 as uuidv4 } from 'uuid';\nexport class Analytics {\n private client: PostHog;\n private tags: Record<string, string | boolean | number | null | undefined> =\n {};\n private distinctId?: string;\n private anonymousId: string;\n\n constructor() {\n this.client = new PostHog(ANALYTICS_POSTHOG_PUBLIC_PROJECT_WRITE_KEY, {\n host: ANALYTICS_HOST_URL,\n flushAt: 1,\n flushInterval: 0,\n enableExceptionAutocapture: true,\n });\n\n this.tags = {};\n\n this.anonymousId = uuidv4();\n\n this.distinctId = undefined;\n }\n\n setDistinctId(distinctId: string) {\n this.distinctId = distinctId;\n this.client.alias({\n distinctId,\n alias: this.anonymousId,\n });\n }\n\n setTag(key: string, value: string | boolean | number | null | undefined) {\n this.tags[key] = value;\n }\n\n captureException(error: Error, properties: Record<string, unknown> = {}) {\n this.client.captureException(error, this.distinctId ?? this.anonymousId, {\n team: 'growth',\n ...this.tags,\n ...properties,\n });\n }\n\n capture(eventName: string, properties?: Record<string, unknown>) {\n this.client.capture({\n distinctId: this.distinctId ?? this.anonymousId,\n event: eventName,\n properties: {\n ...this.tags,\n ...properties,\n },\n });\n }\n\n async shutdown(status: 'success' | 'error' | 'cancelled') {\n if (Object.keys(this.tags).length === 0) {\n return;\n }\n\n this.client.capture({\n distinctId: this.distinctId ?? this.anonymousId,\n event: 'setup wizard finished',\n properties: {\n status,\n tags: this.tags,\n },\n });\n\n await this.client.shutdown();\n }\n}\n\nexport const analytics = new Analytics();\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ZodSchema } from 'zod';
|
|
2
|
-
import type { CloudRegion } from './types';
|
|
3
|
-
export declare const query: <S>({ message, region, schema, wizardHash, }: {
|
|
2
|
+
import type { AIModel, CloudRegion } from './types';
|
|
3
|
+
export declare const query: <S>({ message, model, region, schema, wizardHash, }: {
|
|
4
4
|
message: string;
|
|
5
|
+
model?: AIModel;
|
|
5
6
|
region: CloudRegion;
|
|
6
7
|
schema: ZodSchema<S>;
|
|
7
8
|
wizardHash: string;
|
package/dist/src/utils/query.js
CHANGED
|
@@ -7,10 +7,11 @@ exports.query = void 0;
|
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
9
9
|
const urls_1 = require("./urls");
|
|
10
|
-
const query = async ({ message, region, schema, wizardHash, }) => {
|
|
10
|
+
const query = async ({ message, model = 'o4-mini', region, schema, wizardHash, }) => {
|
|
11
11
|
const jsonSchema = (0, zod_to_json_schema_1.zodToJsonSchema)(schema, 'schema').definitions;
|
|
12
12
|
const response = await axios_1.default.post(`${(0, urls_1.getCloudUrlFromRegion)(region)}/api/wizard/query`, {
|
|
13
13
|
message,
|
|
14
|
+
model,
|
|
14
15
|
json_schema: { ...jsonSchema, name: 'schema', strict: true },
|
|
15
16
|
}, {
|
|
16
17
|
headers: {
|
|
@@ -19,7 +20,7 @@ const query = async ({ message, region, schema, wizardHash, }) => {
|
|
|
19
20
|
});
|
|
20
21
|
const validation = schema.safeParse(response.data.data);
|
|
21
22
|
if (!validation.success) {
|
|
22
|
-
throw new Error(`Invalid response from wizard: ${validation.error}`);
|
|
23
|
+
throw new Error(`Invalid response from wizard: ${validation.error.message}`);
|
|
23
24
|
}
|
|
24
25
|
return validation.data;
|
|
25
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/utils/query.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,2DAAqD;AAErD,iCAA+C;AAExC,MAAM,KAAK,GAAG,KAAK,EAAK,EAC7B,OAAO,EACP,MAAM,EACN,MAAM,EACN,UAAU,
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/utils/query.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,2DAAqD;AAErD,iCAA+C;AAExC,MAAM,KAAK,GAAG,KAAK,EAAK,EAC7B,OAAO,EACP,KAAK,GAAG,SAAS,EACjB,MAAM,EACN,MAAM,EACN,UAAU,GAOX,EAAc,EAAE;IACf,MAAM,UAAU,GAAG,IAAA,oCAAe,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,WAAW,CAAC;IAEjE,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,GAAG,IAAA,4BAAqB,EAAC,MAAM,CAAC,mBAAmB,EACnD;QACE,OAAO;QACP,KAAK;QACL,WAAW,EAAE,EAAE,GAAG,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;KAC7D,EACD;QACE,OAAO,EAAE;YACP,uBAAuB,EAAE,UAAU;SACpC;KACF,CACF,CAAC;IAEF,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAExD,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,iCAAiC,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,CAC5D,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC;AACzB,CAAC,CAAC;AAtCW,QAAA,KAAK,SAsChB","sourcesContent":["import axios from 'axios';\nimport type { ZodSchema } from 'zod';\nimport { zodToJsonSchema } from 'zod-to-json-schema';\nimport type { AIModel, CloudRegion } from './types';\nimport { getCloudUrlFromRegion } from './urls';\n\nexport const query = async <S>({\n message,\n model = 'o4-mini',\n region,\n schema,\n wizardHash,\n}: {\n message: string;\n model?: AIModel;\n region: CloudRegion;\n schema: ZodSchema<S>;\n wizardHash: string;\n}): Promise<S> => {\n const jsonSchema = zodToJsonSchema(schema, 'schema').definitions;\n\n const response = await axios.post<{ data: unknown }>(\n `${getCloudUrlFromRegion(region)}/api/wizard/query`,\n {\n message,\n model,\n json_schema: { ...jsonSchema, name: 'schema', strict: true },\n },\n {\n headers: {\n 'X-PostHog-Wizard-Hash': wizardHash,\n },\n },\n );\n\n const validation = schema.safeParse(response.data.data);\n\n if (!validation.success) {\n throw new Error(\n `Invalid response from wizard: ${validation.error.message}`,\n );\n }\n\n return validation.data;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["export type PostHogProjectData = Record<string, unknown>;\n\nexport type PreselectedProject = {\n project: PostHogProjectData;\n authToken: string;\n};\n\nexport type WizardOptions = {\n /**\n * Whether to enable debug mode.\n */\n debug: boolean;\n\n /**\n * Whether to force install the SDK package to continue with the installation in case\n * any package manager checks are failing (e.g. peer dependency versions).\n *\n * Use with caution and only if you know what you're doing.\n *\n * Does not apply to all wizard flows (currently NPM only)\n */\n forceInstall: boolean;\n\n /**\n * The directory to run the wizard in.\n */\n installDir: string;\n\n /**\n * The cloud region to use.\n */\n cloudRegion?: CloudRegion;\n\n /**\n * Whether to select the default option for all questions automatically.\n */\n default: boolean;\n\n /**\n * Whether to create a new PostHog account during setup.\n */\n signup: boolean;\n};\n\nexport interface Feature {\n id: string;\n prompt: string;\n enabledHint?: string;\n disabledHint?: string;\n}\n\nexport type FileChange = {\n filePath: string;\n oldContent?: string;\n newContent: string;\n};\n\nexport type CloudRegion = 'us' | 'eu';\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["export type PostHogProjectData = Record<string, unknown>;\n\nexport type PreselectedProject = {\n project: PostHogProjectData;\n authToken: string;\n};\n\nexport type WizardOptions = {\n /**\n * Whether to enable debug mode.\n */\n debug: boolean;\n\n /**\n * Whether to force install the SDK package to continue with the installation in case\n * any package manager checks are failing (e.g. peer dependency versions).\n *\n * Use with caution and only if you know what you're doing.\n *\n * Does not apply to all wizard flows (currently NPM only)\n */\n forceInstall: boolean;\n\n /**\n * The directory to run the wizard in.\n */\n installDir: string;\n\n /**\n * The cloud region to use.\n */\n cloudRegion?: CloudRegion;\n\n /**\n * Whether to select the default option for all questions automatically.\n */\n default: boolean;\n\n /**\n * Whether to create a new PostHog account during setup.\n */\n signup: boolean;\n};\n\nexport interface Feature {\n id: string;\n prompt: string;\n enabledHint?: string;\n disabledHint?: string;\n}\n\nexport type FileChange = {\n filePath: string;\n oldContent?: string;\n newContent: string;\n};\n\nexport type CloudRegion = 'us' | 'eu';\n\nexport type AIModel = 'o4-mini' | 'gemini-2.5-flash' | 'gemini-2.5-pro';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@posthog/wizard",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"homepage": "https://github.com/posthog/wizard",
|
|
5
5
|
"repository": "https://github.com/posthog/wizard",
|
|
6
6
|
"description": "The PostHog wizard helps you to configure your project",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"rimraf": "^3.0.2",
|
|
80
80
|
"ts-jest": "^29.1.0",
|
|
81
81
|
"ts-node": "^10.9.1",
|
|
82
|
-
"tsx": "^
|
|
82
|
+
"tsx": "^4.20.3",
|
|
83
83
|
"typescript": "^5.0.4"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"fix:eslint": "eslint . --format stylish --fix",
|
|
138
138
|
"test": "pnpm build && jest",
|
|
139
139
|
"test:e2e": "pnpm build && ./e2e-tests/run.sh",
|
|
140
|
-
"try": "
|
|
140
|
+
"try": "tsx bin.ts",
|
|
141
141
|
"test:watch": "jest --watch"
|
|
142
142
|
}
|
|
143
143
|
}
|