@posthog/wizard 0.6.0 → 0.7.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.
Files changed (106) hide show
  1. package/package.json +1 -1
  2. package/dist/bin.d.ts +0 -2
  3. package/dist/bin.js +0 -28
  4. package/dist/bin.js.map +0 -1
  5. package/dist/src/lib/config.d.ts +0 -49
  6. package/dist/src/lib/config.js +0 -85
  7. package/dist/src/lib/config.js.map +0 -1
  8. package/dist/src/lib/constants.d.ts +0 -24
  9. package/dist/src/lib/constants.js +0 -46
  10. package/dist/src/lib/constants.js.map +0 -1
  11. package/dist/src/lib/messages.d.ts +0 -10
  12. package/dist/src/lib/messages.js +0 -37
  13. package/dist/src/lib/messages.js.map +0 -1
  14. package/dist/src/lib/prompts.d.ts +0 -16
  15. package/dist/src/lib/prompts.js +0 -83
  16. package/dist/src/lib/prompts.js.map +0 -1
  17. package/dist/src/nextjs/docs.d.ts +0 -8
  18. package/dist/src/nextjs/docs.js +0 -257
  19. package/dist/src/nextjs/docs.js.map +0 -1
  20. package/dist/src/nextjs/nextjs-wizard.d.ts +0 -2
  21. package/dist/src/nextjs/nextjs-wizard.js +0 -121
  22. package/dist/src/nextjs/nextjs-wizard.js.map +0 -1
  23. package/dist/src/nextjs/utils.d.ts +0 -9
  24. package/dist/src/nextjs/utils.js +0 -83
  25. package/dist/src/nextjs/utils.js.map +0 -1
  26. package/dist/src/react/docs.d.ts +0 -4
  27. package/dist/src/react/docs.js +0 -46
  28. package/dist/src/react/docs.js.map +0 -1
  29. package/dist/src/react/react-wizard.d.ts +0 -2
  30. package/dist/src/react/react-wizard.js +0 -105
  31. package/dist/src/react/react-wizard.js.map +0 -1
  32. package/dist/src/react-native/docs.d.ts +0 -5
  33. package/dist/src/react-native/docs.js +0 -31
  34. package/dist/src/react-native/docs.js.map +0 -1
  35. package/dist/src/react-native/react-native-wizard.d.ts +0 -2
  36. package/dist/src/react-native/react-native-wizard.js +0 -123
  37. package/dist/src/react-native/react-native-wizard.js.map +0 -1
  38. package/dist/src/run.d.ts +0 -13
  39. package/dist/src/run.js +0 -83
  40. package/dist/src/run.js.map +0 -1
  41. package/dist/src/svelte/docs.d.ts +0 -3
  42. package/dist/src/svelte/docs.js +0 -110
  43. package/dist/src/svelte/docs.js.map +0 -1
  44. package/dist/src/svelte/svelte-wizard.d.ts +0 -2
  45. package/dist/src/svelte/svelte-wizard.js +0 -113
  46. package/dist/src/svelte/svelte-wizard.js.map +0 -1
  47. package/dist/src/telemetry.d.ts +0 -2
  48. package/dist/src/telemetry.js +0 -13
  49. package/dist/src/telemetry.js.map +0 -1
  50. package/dist/src/utils/analytics.d.ts +0 -12
  51. package/dist/src/utils/analytics.js +0 -59
  52. package/dist/src/utils/analytics.js.map +0 -1
  53. package/dist/src/utils/bash.d.ts +0 -2
  54. package/dist/src/utils/bash.js +0 -54
  55. package/dist/src/utils/bash.js.map +0 -1
  56. package/dist/src/utils/clack-utils.d.ts +0 -184
  57. package/dist/src/utils/clack-utils.js +0 -683
  58. package/dist/src/utils/clack-utils.js.map +0 -1
  59. package/dist/src/utils/clack.d.ts +0 -2
  60. package/dist/src/utils/clack.js +0 -9
  61. package/dist/src/utils/clack.js.map +0 -1
  62. package/dist/src/utils/debug.d.ts +0 -2
  63. package/dist/src/utils/debug.js +0 -22
  64. package/dist/src/utils/debug.js.map +0 -1
  65. package/dist/src/utils/environment.d.ts +0 -9
  66. package/dist/src/utils/environment.js +0 -164
  67. package/dist/src/utils/environment.js.map +0 -1
  68. package/dist/src/utils/file-utils.d.ts +0 -29
  69. package/dist/src/utils/file-utils.js +0 -177
  70. package/dist/src/utils/file-utils.js.map +0 -1
  71. package/dist/src/utils/logging.d.ts +0 -9
  72. package/dist/src/utils/logging.js +0 -50
  73. package/dist/src/utils/logging.js.map +0 -1
  74. package/dist/src/utils/package-json.d.ts +0 -25
  75. package/dist/src/utils/package-json.js +0 -27
  76. package/dist/src/utils/package-json.js.map +0 -1
  77. package/dist/src/utils/package-manager.d.ts +0 -21
  78. package/dist/src/utils/package-manager.js +0 -208
  79. package/dist/src/utils/package-manager.js.map +0 -1
  80. package/dist/src/utils/query.d.ts +0 -8
  81. package/dist/src/utils/query.js +0 -27
  82. package/dist/src/utils/query.js.map +0 -1
  83. package/dist/src/utils/rules/add-editor-rules.d.ts +0 -9
  84. package/dist/src/utils/rules/add-editor-rules.js +0 -90
  85. package/dist/src/utils/rules/add-editor-rules.js.map +0 -1
  86. package/dist/src/utils/rules/add-editor-rules.ts +0 -86
  87. package/dist/src/utils/rules/next-rules.md +0 -9
  88. package/dist/src/utils/rules/react-native-rules.md +0 -7
  89. package/dist/src/utils/rules/react-rules.md +0 -7
  90. package/dist/src/utils/rules/svelte-rules.md +0 -7
  91. package/dist/src/utils/rules/universal.md +0 -20
  92. package/dist/src/utils/semver.d.ts +0 -5
  93. package/dist/src/utils/semver.js +0 -25
  94. package/dist/src/utils/semver.js.map +0 -1
  95. package/dist/src/utils/string.d.ts +0 -1
  96. package/dist/src/utils/string.js +0 -9
  97. package/dist/src/utils/string.js.map +0 -1
  98. package/dist/src/utils/types.d.ts +0 -48
  99. package/dist/src/utils/types.js +0 -3
  100. package/dist/src/utils/types.js.map +0 -1
  101. package/dist/src/utils/urls.d.ts +0 -4
  102. package/dist/src/utils/urls.js +0 -35
  103. package/dist/src/utils/urls.js.map +0 -1
  104. package/dist/src/utils/vendor/is-unicorn-supported.d.ts +0 -1
  105. package/dist/src/utils/vendor/is-unicorn-supported.js +0 -24
  106. package/dist/src/utils/vendor/is-unicorn-supported.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/wizard",
3
- "version": "0.6.0",
3
+ "version": "0.7.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",
package/dist/bin.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/dist/bin.js DELETED
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const semver_1 = require("semver");
8
- const logging_1 = require("./src/utils/logging");
9
- const yargs_1 = __importDefault(require("yargs"));
10
- const helpers_1 = require("yargs/helpers");
11
- const NODE_VERSION_RANGE = '>=18.20.0';
12
- // Have to run this above the other imports because they are importing clack that
13
- // has the problematic imports.
14
- if (!(0, semver_1.satisfies)(process.version, NODE_VERSION_RANGE)) {
15
- (0, logging_1.red)(`PostHog Wizard requires Node.js ${NODE_VERSION_RANGE}. You are using Node.js ${process.version}. Please upgrade your Node.js version.`);
16
- process.exit(1);
17
- }
18
- const run_1 = require("./src/run");
19
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
20
- const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)).options({
21
- debug: {
22
- default: false,
23
- describe: 'Enable verbose logging\nenv: POSTHOG_WIZARD_DEBUG',
24
- type: 'boolean',
25
- },
26
- }).argv;
27
- void (0, run_1.run)(argv);
28
- //# sourceMappingURL=bin.js.map
package/dist/bin.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../bin.ts"],"names":[],"mappings":";;;;;;AACA,mCAAmC;AACnC,iDAA0C;AAE1C,kDAA0B;AAC1B,2CAAwC;AAExC,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAEvC,iFAAiF;AACjF,+BAA+B;AAC/B,IAAI,CAAC,IAAA,kBAAS,EAAC,OAAO,CAAC,OAAO,EAAE,kBAAkB,CAAC,EAAE,CAAC;IACpD,IAAA,aAAG,EACD,mCAAmC,kBAAkB,2BAA2B,OAAO,CAAC,OAAO,wCAAwC,CACxI,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AACD,mCAAgC;AAEhC,kJAAkJ;AAClJ,MAAM,IAAI,GAAG,IAAA,eAAK,EAAC,IAAA,iBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,KAAK,EAAE;QACL,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,mDAAmD;QAC7D,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CAAC,IAAI,CAAC;AAER,KAAK,IAAA,SAAG,EAAC,IAAI,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { satisfies } from 'semver';\nimport { red } from './src/utils/logging';\n\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\n\nconst NODE_VERSION_RANGE = '>=18.20.0';\n\n// Have to run this above the other imports because they are importing clack that\n// has the problematic imports.\nif (!satisfies(process.version, NODE_VERSION_RANGE)) {\n red(\n `PostHog Wizard requires Node.js ${NODE_VERSION_RANGE}. You are using Node.js ${process.version}. Please upgrade your Node.js version.`,\n );\n process.exit(1);\n}\nimport { run } from './src/run';\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\nconst argv = yargs(hideBin(process.argv)).options({\n debug: {\n default: false,\n describe: 'Enable verbose logging\\nenv: POSTHOG_WIZARD_DEBUG',\n type: 'boolean',\n },\n}).argv;\n\nvoid run(argv);\n"]}
@@ -1,49 +0,0 @@
1
- import type { WizardOptions } from '../utils/types';
2
- import { Integration } from './constants';
3
- export declare const INTEGRATION_CONFIG: {
4
- readonly nextjs: {
5
- readonly name: "Next.js";
6
- readonly filterPatterns: ["**/*.{tsx,ts,jsx,js,mjs,cjs}"];
7
- readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static", "next-env.d.*"];
8
- readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
9
- readonly generateFilesRules: "";
10
- readonly filterFilesRules: "";
11
- readonly docsUrl: "https://posthog.com/docs/libraries/next-js";
12
- readonly changes: "• Installed posthog-js & posthog-node packages\n• Initialized PostHog, and added pageview tracking\n• Created a PostHogClient to use PostHog server-side\n• Setup a reverse proxy to avoid ad blockers blocking analytics requests\n• Added your Project API key to your .env/.env.local file";
13
- readonly nextSteps: "• Call posthog.identify() when a user signs into your app\n• Call posthog.capture() to capture custom events in your app\n• Upload environment variables to your production environment";
14
- };
15
- readonly react: {
16
- readonly name: "React";
17
- readonly filterPatterns: ["**/*.{tsx,ts,jsx,js}"];
18
- readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static", "assets"];
19
- readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
20
- readonly generateFilesRules: "";
21
- readonly filterFilesRules: "";
22
- readonly docsUrl: "https://posthog.com/docs/libraries/react";
23
- readonly changes: "• Installed posthog-js package\n• Added PostHogProvider to the root of the app, to initialize PostHog and enable autocapture\n• Added your Project API key to your .env/.env.local file";
24
- readonly nextSteps: "• Call posthog.identify() when a user signs into your app\n• Call posthog.capture() to capture custom events in your app\n• Upload environment variables to your production environment";
25
- };
26
- readonly svelte: {
27
- readonly name: "Svelte";
28
- readonly filterPatterns: ["**/*.{svelte,ts,js,jsx,tsx}"];
29
- readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static"];
30
- readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
31
- readonly generateFilesRules: "";
32
- readonly filterFilesRules: "";
33
- readonly docsUrl: "https://posthog.com/docs/libraries/svelte";
34
- readonly changes: "• Installed posthog-js & posthog-node packages\n• Added PostHog initialization to your Svelte app\n• Setup pageview & pageleave tracking\n• Setup event auto - capture to capture events as users interact with your app\n• Added a getPostHogClient() function to use PostHog server-side\n• Added your Project API key to your .env/.env.local file";
35
- readonly nextSteps: "• Call posthog.identify() when a user signs into your app\n• Use getPostHogClient() to start capturing events server - side\n• Upload environment variables to your production environment";
36
- };
37
- readonly "react-native": {
38
- readonly name: "React Native";
39
- readonly filterPatterns: ["**/*.{ts,js,jsx,tsx}"];
40
- readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static"];
41
- readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
42
- readonly generateFilesRules: "";
43
- readonly filterFilesRules: "";
44
- readonly docsUrl: "https://posthog.com/docs/libraries/react-native";
45
- readonly changes: "• Installed required packages\n• Added PostHogProvider to the root of the app\n• Enabled autocapture and session replay";
46
- readonly nextSteps: "• Call posthog.identify() when a user signs into your app\n• Call posthog.capture() to capture custom events in your app";
47
- };
48
- };
49
- export declare const INTEGRATION_ORDER: readonly [Integration.nextjs, Integration.svelte, Integration.reactNative, Integration.react];
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INTEGRATION_ORDER = exports.INTEGRATION_CONFIG = void 0;
4
- const clack_utils_1 = require("../utils/clack-utils");
5
- const package_json_1 = require("../utils/package-json");
6
- const constants_1 = require("./constants");
7
- exports.INTEGRATION_CONFIG = {
8
- [constants_1.Integration.nextjs]: {
9
- name: 'Next.js',
10
- filterPatterns: ['**/*.{tsx,ts,jsx,js,mjs,cjs}'],
11
- ignorePatterns: [
12
- 'node_modules',
13
- 'dist',
14
- 'build',
15
- 'public',
16
- 'static',
17
- 'next-env.d.*',
18
- ],
19
- detect: async (options) => {
20
- const packageJson = await (0, clack_utils_1.getPackageDotJson)(options);
21
- return (0, package_json_1.hasPackageInstalled)('next', packageJson);
22
- },
23
- generateFilesRules: '',
24
- filterFilesRules: '',
25
- docsUrl: 'https://posthog.com/docs/libraries/next-js',
26
- changes: '• Installed posthog-js & posthog-node packages\n• Initialized PostHog, and added pageview tracking\n• Created a PostHogClient to use PostHog server-side\n• Setup a reverse proxy to avoid ad blockers blocking analytics requests\n• Added your Project API key to your .env/.env.local file',
27
- nextSteps: '• Call posthog.identify() when a user signs into your app\n• Call posthog.capture() to capture custom events in your app\n• Upload environment variables to your production environment',
28
- },
29
- [constants_1.Integration.react]: {
30
- name: 'React',
31
- filterPatterns: ['**/*.{tsx,ts,jsx,js}'],
32
- ignorePatterns: [
33
- 'node_modules',
34
- 'dist',
35
- 'build',
36
- 'public',
37
- 'static',
38
- 'assets',
39
- ],
40
- detect: async (options) => {
41
- const packageJson = await (0, clack_utils_1.getPackageDotJson)(options);
42
- return (0, package_json_1.hasPackageInstalled)('react', packageJson);
43
- },
44
- generateFilesRules: '',
45
- filterFilesRules: '',
46
- docsUrl: 'https://posthog.com/docs/libraries/react',
47
- changes: '• Installed posthog-js package\n• Added PostHogProvider to the root of the app, to initialize PostHog and enable autocapture\n• Added your Project API key to your .env/.env.local file',
48
- nextSteps: '• Call posthog.identify() when a user signs into your app\n• Call posthog.capture() to capture custom events in your app\n• Upload environment variables to your production environment',
49
- },
50
- [constants_1.Integration.svelte]: {
51
- name: 'Svelte',
52
- filterPatterns: ['**/*.{svelte,ts,js,jsx,tsx}'],
53
- ignorePatterns: ['node_modules', 'dist', 'build', 'public', 'static'],
54
- detect: async (options) => {
55
- const packageJson = await (0, clack_utils_1.getPackageDotJson)(options);
56
- return (0, package_json_1.hasPackageInstalled)('@sveltejs/kit', packageJson);
57
- },
58
- generateFilesRules: '',
59
- filterFilesRules: '',
60
- docsUrl: 'https://posthog.com/docs/libraries/svelte',
61
- changes: '• Installed posthog-js & posthog-node packages\n• Added PostHog initialization to your Svelte app\n• Setup pageview & pageleave tracking\n• Setup event auto - capture to capture events as users interact with your app\n• Added a getPostHogClient() function to use PostHog server-side\n• Added your Project API key to your .env/.env.local file',
62
- nextSteps: '• Call posthog.identify() when a user signs into your app\n• Use getPostHogClient() to start capturing events server - side\n• Upload environment variables to your production environment',
63
- },
64
- [constants_1.Integration.reactNative]: {
65
- name: 'React Native',
66
- filterPatterns: ['**/*.{ts,js,jsx,tsx}'],
67
- ignorePatterns: ['node_modules', 'dist', 'build', 'public', 'static'],
68
- detect: async (options) => {
69
- const packageJson = await (0, clack_utils_1.getPackageDotJson)(options);
70
- return (0, package_json_1.hasPackageInstalled)('react-native', packageJson);
71
- },
72
- generateFilesRules: '',
73
- filterFilesRules: '',
74
- docsUrl: 'https://posthog.com/docs/libraries/react-native',
75
- changes: '• Installed required packages\n• Added PostHogProvider to the root of the app\n• Enabled autocapture and session replay',
76
- nextSteps: '• Call posthog.identify() when a user signs into your app\n• Call posthog.capture() to capture custom events in your app',
77
- },
78
- };
79
- exports.INTEGRATION_ORDER = [
80
- constants_1.Integration.nextjs,
81
- constants_1.Integration.svelte,
82
- constants_1.Integration.reactNative,
83
- constants_1.Integration.react,
84
- ];
85
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":";;;AAAA,sDAAyD;AACzD,wDAA4D;AAE5D,2CAA0C;AAc7B,QAAA,kBAAkB,GAAG;IAChC,CAAC,uBAAW,CAAC,MAAM,CAAC,EAAE;QACpB,IAAI,EAAE,SAAS;QACf,cAAc,EAAE,CAAC,8BAA8B,CAAC;QAChD,cAAc,EAAE;YACd,cAAc;YACd,MAAM;YACN,OAAO;YACP,QAAQ;YACR,QAAQ;YACR,cAAc;SACf;QACD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YACxB,MAAM,WAAW,GAAG,MAAM,IAAA,+BAAiB,EAAC,OAAO,CAAC,CAAC;YACrD,OAAO,IAAA,kCAAmB,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAClD,CAAC;QACD,kBAAkB,EAAE,EAAE;QACtB,gBAAgB,EAAE,EAAE;QACpB,OAAO,EAAE,4CAA4C;QACrD,OAAO,EACL,+RAA+R;QACjS,SAAS,EACP,yLAAyL;KAC5L;IACD,CAAC,uBAAW,CAAC,KAAK,CAAC,EAAE;QACnB,IAAI,EAAE,OAAO;QACb,cAAc,EAAE,CAAC,sBAAsB,CAAC;QACxC,cAAc,EAAE;YACd,cAAc;YACd,MAAM;YACN,OAAO;YACP,QAAQ;YACR,QAAQ;YACR,QAAQ;SACT;QACD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YACxB,MAAM,WAAW,GAAG,MAAM,IAAA,+BAAiB,EAAC,OAAO,CAAC,CAAC;YACrD,OAAO,IAAA,kCAAmB,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACnD,CAAC;QACD,kBAAkB,EAAE,EAAE;QACtB,gBAAgB,EAAE,EAAE;QACpB,OAAO,EAAE,0CAA0C;QACnD,OAAO,EACL,yLAAyL;QAC3L,SAAS,EACP,yLAAyL;KAC5L;IACD,CAAC,uBAAW,CAAC,MAAM,CAAC,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE,CAAC,6BAA6B,CAAC;QAC/C,cAAc,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;QACrE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YACxB,MAAM,WAAW,GAAG,MAAM,IAAA,+BAAiB,EAAC,OAAO,CAAC,CAAC;YACrD,OAAO,IAAA,kCAAmB,EAAC,eAAe,EAAE,WAAW,CAAC,CAAC;QAC3D,CAAC;QACD,kBAAkB,EAAE,EAAE;QACtB,gBAAgB,EAAE,EAAE;QACpB,OAAO,EAAE,2CAA2C;QACpD,OAAO,EACL,uVAAuV;QACzV,SAAS,EACP,4LAA4L;KAC/L;IACD,CAAC,uBAAW,CAAC,WAAW,CAAC,EAAE;QACzB,IAAI,EAAE,cAAc;QACpB,cAAc,EAAE,CAAC,sBAAsB,CAAC;QACxC,cAAc,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;QACrE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YACxB,MAAM,WAAW,GAAG,MAAM,IAAA,+BAAiB,EAAC,OAAO,CAAC,CAAC;YACrD,OAAO,IAAA,kCAAmB,EAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QAC1D,CAAC;QACD,kBAAkB,EAAE,EAAE;QACtB,gBAAgB,EAAE,EAAE;QACpB,OAAO,EAAE,iDAAiD;QAC1D,OAAO,EACL,yHAAyH;QAC3H,SAAS,EACP,0HAA0H;KAC7H;CACwD,CAAC;AAE/C,QAAA,iBAAiB,GAAG;IAC/B,uBAAW,CAAC,MAAM;IAClB,uBAAW,CAAC,MAAM;IAClB,uBAAW,CAAC,WAAW;IACvB,uBAAW,CAAC,KAAK;CACT,CAAC","sourcesContent":["import { getPackageDotJson } from '../utils/clack-utils';\nimport { hasPackageInstalled } from '../utils/package-json';\nimport type { WizardOptions } from '../utils/types';\nimport { Integration } from './constants';\n\ntype IntegrationConfig = {\n name: string;\n filterPatterns: string[];\n ignorePatterns: string[];\n detect: (options: Pick<WizardOptions, 'installDir'>) => Promise<boolean>;\n generateFilesRules: string;\n filterFilesRules: string;\n docsUrl: string;\n changes: string;\n nextSteps: string;\n};\n\nexport const INTEGRATION_CONFIG = {\n [Integration.nextjs]: {\n name: 'Next.js',\n filterPatterns: ['**/*.{tsx,ts,jsx,js,mjs,cjs}'],\n ignorePatterns: [\n 'node_modules',\n 'dist',\n 'build',\n 'public',\n 'static',\n 'next-env.d.*',\n ],\n detect: async (options) => {\n const packageJson = await getPackageDotJson(options);\n return hasPackageInstalled('next', packageJson);\n },\n generateFilesRules: '',\n filterFilesRules: '',\n docsUrl: 'https://posthog.com/docs/libraries/next-js',\n changes:\n '• Installed posthog-js & posthog-node packages\\n• Initialized PostHog, and added pageview tracking\\n• Created a PostHogClient to use PostHog server-side\\n• Setup a reverse proxy to avoid ad blockers blocking analytics requests\\n• Added your Project API key to your .env/.env.local file',\n nextSteps:\n '• Call posthog.identify() when a user signs into your app\\n• Call posthog.capture() to capture custom events in your app\\n• Upload environment variables to your production environment',\n },\n [Integration.react]: {\n name: 'React',\n filterPatterns: ['**/*.{tsx,ts,jsx,js}'],\n ignorePatterns: [\n 'node_modules',\n 'dist',\n 'build',\n 'public',\n 'static',\n 'assets',\n ],\n detect: async (options) => {\n const packageJson = await getPackageDotJson(options);\n return hasPackageInstalled('react', packageJson);\n },\n generateFilesRules: '',\n filterFilesRules: '',\n docsUrl: 'https://posthog.com/docs/libraries/react',\n changes:\n '• Installed posthog-js package\\n• Added PostHogProvider to the root of the app, to initialize PostHog and enable autocapture\\n• Added your Project API key to your .env/.env.local file',\n nextSteps:\n '• Call posthog.identify() when a user signs into your app\\n• Call posthog.capture() to capture custom events in your app\\n• Upload environment variables to your production environment',\n },\n [Integration.svelte]: {\n name: 'Svelte',\n filterPatterns: ['**/*.{svelte,ts,js,jsx,tsx}'],\n ignorePatterns: ['node_modules', 'dist', 'build', 'public', 'static'],\n detect: async (options) => {\n const packageJson = await getPackageDotJson(options);\n return hasPackageInstalled('@sveltejs/kit', packageJson);\n },\n generateFilesRules: '',\n filterFilesRules: '',\n docsUrl: 'https://posthog.com/docs/libraries/svelte',\n changes:\n '• Installed posthog-js & posthog-node packages\\n• Added PostHog initialization to your Svelte app\\n• Setup pageview & pageleave tracking\\n• Setup event auto - capture to capture events as users interact with your app\\n• Added a getPostHogClient() function to use PostHog server-side\\n• Added your Project API key to your .env/.env.local file',\n nextSteps:\n '• Call posthog.identify() when a user signs into your app\\n• Use getPostHogClient() to start capturing events server - side\\n• Upload environment variables to your production environment',\n },\n [Integration.reactNative]: {\n name: 'React Native',\n filterPatterns: ['**/*.{ts,js,jsx,tsx}'],\n ignorePatterns: ['node_modules', 'dist', 'build', 'public', 'static'],\n detect: async (options) => {\n const packageJson = await getPackageDotJson(options);\n return hasPackageInstalled('react-native', packageJson);\n },\n generateFilesRules: '',\n filterFilesRules: '',\n docsUrl: 'https://posthog.com/docs/libraries/react-native',\n changes:\n '• Installed required packages\\n• Added PostHogProvider to the root of the app\\n• Enabled autocapture and session replay',\n nextSteps:\n '• Call posthog.identify() when a user signs into your app\\n• Call posthog.capture() to capture custom events in your app',\n },\n} as const satisfies Record<Integration, IntegrationConfig>;\n\nexport const INTEGRATION_ORDER = [\n Integration.nextjs,\n Integration.svelte,\n Integration.reactNative,\n Integration.react,\n] as const;\n"]}
@@ -1,24 +0,0 @@
1
- export declare enum Integration {
2
- nextjs = "nextjs",
3
- react = "react",
4
- svelte = "svelte",
5
- reactNative = "react-native"
6
- }
7
- export declare function getIntegrationDescription(type: string): string;
8
- type IntegrationChoice = {
9
- name: string;
10
- value: string;
11
- };
12
- export declare function getIntegrationChoices(): IntegrationChoice[];
13
- export interface Args {
14
- debug: boolean;
15
- integration: Integration;
16
- }
17
- export declare const IS_DEV = false;
18
- export declare const DEFAULT_URL: string;
19
- export declare const ISSUES_URL = "https://github.com/posthog/wizard/issues";
20
- export declare const DEFAULT_HOST_URL: string;
21
- export declare const ANALYTICS_POSTHOG_PUBLIC_PROJECT_WRITE_KEY = "sTMFPsFhdP1Ssg";
22
- export declare const ANALYTICS_HOST_URL: string;
23
- export declare const DUMMY_PROJECT_API_KEY = "_YOUR_POSTHOG_PROJECT_API_KEY_";
24
- export {};
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DUMMY_PROJECT_API_KEY = exports.ANALYTICS_HOST_URL = exports.ANALYTICS_POSTHOG_PUBLIC_PROJECT_WRITE_KEY = exports.DEFAULT_HOST_URL = exports.ISSUES_URL = exports.DEFAULT_URL = exports.IS_DEV = exports.Integration = void 0;
4
- exports.getIntegrationDescription = getIntegrationDescription;
5
- exports.getIntegrationChoices = getIntegrationChoices;
6
- var Integration;
7
- (function (Integration) {
8
- Integration["nextjs"] = "nextjs";
9
- Integration["react"] = "react";
10
- Integration["svelte"] = "svelte";
11
- Integration["reactNative"] = "react-native";
12
- })(Integration || (exports.Integration = Integration = {}));
13
- function getIntegrationDescription(type) {
14
- switch (type) {
15
- case Integration.nextjs:
16
- return 'Next.js';
17
- case Integration.react:
18
- return 'React';
19
- case Integration.reactNative:
20
- return 'React Native';
21
- case Integration.svelte:
22
- return 'Svelte';
23
- default:
24
- throw new Error(`Unknown integration ${type}`);
25
- }
26
- }
27
- function getIntegrationChoices() {
28
- return Object.keys(Integration).map((type) => ({
29
- name: getIntegrationDescription(type),
30
- value: type,
31
- }));
32
- }
33
- exports.IS_DEV = false;
34
- exports.DEFAULT_URL = exports.IS_DEV
35
- ? 'http://localhost:8010'
36
- : 'https://us.posthog.com';
37
- exports.ISSUES_URL = 'https://github.com/posthog/wizard/issues';
38
- exports.DEFAULT_HOST_URL = exports.IS_DEV
39
- ? 'http://localhost:8010'
40
- : 'https://us.i.posthog.com';
41
- exports.ANALYTICS_POSTHOG_PUBLIC_PROJECT_WRITE_KEY = 'sTMFPsFhdP1Ssg';
42
- exports.ANALYTICS_HOST_URL = exports.IS_DEV
43
- ? 'http://localhost:8010'
44
- : 'https://internal-t.posthog.com';
45
- exports.DUMMY_PROJECT_API_KEY = '_YOUR_POSTHOG_PROJECT_API_KEY_';
46
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":";;;AAOA,8DAaC;AAOD,sDAKC;AAhCD,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,gCAAiB,CAAA;IACjB,2CAA4B,CAAA;AAC9B,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,SAAgB,yBAAyB,CAAC,IAAY;IACpD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,WAAW,CAAC,MAAM;YACrB,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW,CAAC,KAAK;YACpB,OAAO,OAAO,CAAC;QACjB,KAAK,WAAW,CAAC,WAAW;YAC1B,OAAO,cAAc,CAAC;QACxB,KAAK,WAAW,CAAC,MAAM;YACrB,OAAO,QAAQ,CAAC;QAClB;YACE,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC;AACH,CAAC;AAOD,SAAgB,qBAAqB;IACnC,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC;QACrD,IAAI,EAAE,yBAAyB,CAAC,IAAI,CAAC;QACrC,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC,CAAC;AACN,CAAC;AAOY,QAAA,MAAM,GAAG,KAAK,CAAC;AAEf,QAAA,WAAW,GAAG,cAAM;IAC/B,CAAC,CAAC,uBAAuB;IACzB,CAAC,CAAC,wBAAwB,CAAC;AAChB,QAAA,UAAU,GAAG,0CAA0C,CAAC;AACxD,QAAA,gBAAgB,GAAG,cAAM;IACpC,CAAC,CAAC,uBAAuB;IACzB,CAAC,CAAC,0BAA0B,CAAC;AAClB,QAAA,0CAA0C,GAAG,gBAAgB,CAAC;AAC9D,QAAA,kBAAkB,GAAG,cAAM;IACtC,CAAC,CAAC,uBAAuB;IACzB,CAAC,CAAC,gCAAgC,CAAC;AACxB,QAAA,qBAAqB,GAAG,gCAAgC,CAAC","sourcesContent":["export enum Integration {\n nextjs = 'nextjs',\n react = 'react',\n svelte = 'svelte',\n reactNative = 'react-native',\n}\n\nexport function getIntegrationDescription(type: string): string {\n switch (type) {\n case Integration.nextjs:\n return 'Next.js';\n case Integration.react:\n return 'React';\n case Integration.reactNative:\n return 'React Native';\n case Integration.svelte:\n return 'Svelte';\n default:\n throw new Error(`Unknown integration ${type}`);\n }\n}\n\ntype IntegrationChoice = {\n name: string;\n value: string;\n};\n\nexport function getIntegrationChoices(): IntegrationChoice[] {\n return Object.keys(Integration).map((type: string) => ({\n name: getIntegrationDescription(type),\n value: type,\n }));\n}\n\nexport interface Args {\n debug: boolean;\n integration: Integration;\n}\n\nexport const IS_DEV = false;\n\nexport const DEFAULT_URL = IS_DEV\n ? 'http://localhost:8010'\n : 'https://us.posthog.com';\nexport const ISSUES_URL = 'https://github.com/posthog/wizard/issues';\nexport const DEFAULT_HOST_URL = IS_DEV\n ? 'http://localhost:8010'\n : 'https://us.i.posthog.com';\nexport const ANALYTICS_POSTHOG_PUBLIC_PROJECT_WRITE_KEY = 'sTMFPsFhdP1Ssg';\nexport const ANALYTICS_HOST_URL = IS_DEV\n ? 'http://localhost:8010'\n : 'https://internal-t.posthog.com';\nexport const DUMMY_PROJECT_API_KEY = '_YOUR_POSTHOG_PROJECT_API_KEY_';\n"]}
@@ -1,10 +0,0 @@
1
- import type { CloudRegion, WizardOptions } from '../utils/types';
2
- import type { PackageManager } from '../utils/package-manager';
3
- import { Integration } from './constants';
4
- export declare const getOutroMessage: ({ options, integration, cloudRegion, addedEditorRules, packageManager, }: {
5
- options: WizardOptions;
6
- integration: Integration;
7
- cloudRegion: CloudRegion;
8
- addedEditorRules: boolean;
9
- packageManager?: PackageManager;
10
- }) => string;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getOutroMessage = void 0;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const urls_1 = require("../utils/urls");
9
- const constants_1 = require("./constants");
10
- const config_1 = require("./config");
11
- const getOutroMessage = ({ options, integration, cloudRegion, addedEditorRules, packageManager, }) => {
12
- const continueUrl = options.signup
13
- ? `${(0, urls_1.getCloudUrlFromRegion)(cloudRegion)}/products?source=wizard`
14
- : undefined;
15
- const integrationConfig = config_1.INTEGRATION_CONFIG[integration];
16
- return `
17
- ${chalk_1.default.green('Successfully installed PostHog!')}
18
-
19
- ${chalk_1.default.cyan('Changes made:')}
20
- ${integrationConfig.changes}
21
- ${addedEditorRules ? `• Added Cursor rules for PostHog` : ''}
22
-
23
- ${chalk_1.default.yellow('Next steps:')}
24
- ${integrationConfig.nextSteps}
25
-
26
- Learn more about PostHog + ${integrationConfig.name}: ${chalk_1.default.cyan(integrationConfig.docsUrl)}
27
- ${continueUrl ? `\nContinue onboarding: ${chalk_1.default.cyan(continueUrl)}\n` : ``}
28
- Note: This uses experimental AI to setup your project. It might have got it wrong, please check!
29
-
30
- You should validate your setup by (re)starting your dev environment${packageManager
31
- ? ` (e.g. ${chalk_1.default.cyan(`${packageManager.runScriptCommand} dev`)}).`
32
- : `.`}
33
-
34
- ${chalk_1.default.dim(`If you encounter any issues, let us know here: ${constants_1.ISSUES_URL}`)}`;
35
- };
36
- exports.getOutroMessage = getOutroMessage;
37
- //# sourceMappingURL=messages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/lib/messages.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,wCAAsD;AAEtD,2CAAsD;AACtD,qCAA8C;AAEvC,MAAM,eAAe,GAAG,CAAC,EAC9B,OAAO,EACP,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,cAAc,GAOf,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM;QAChC,CAAC,CAAC,GAAG,IAAA,4BAAqB,EAAC,WAAW,CAAC,yBAAyB;QAChE,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,iBAAiB,GAAG,2BAAkB,CAAC,WAAW,CAAC,CAAC;IAE1D,OAAO;EACP,eAAK,CAAC,KAAK,CAAC,iCAAiC,CAAC;;EAE9C,eAAK,CAAC,IAAI,CAAC,eAAe,CAAC;EAC3B,iBAAiB,CAAC,OAAO;EACzB,gBAAgB,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,EAAE;;EAE1D,eAAK,CAAC,MAAM,CAAC,aAAa,CAAC;EAC3B,iBAAiB,CAAC,SAAS;;6BAEA,iBAAiB,CAAC,IAAI,KAAK,eAAK,CAAC,IAAI,CAC9D,iBAAiB,CAAC,OAAO,CAC1B;EACD,WAAW,CAAC,CAAC,CAAC,0BAA0B,eAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;;;qEAItE,cAAc;QACZ,CAAC,CAAC,UAAU,eAAK,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,gBAAgB,MAAM,CAAC,IAAI;QACpE,CAAC,CAAC,GACN;;EAEA,eAAK,CAAC,GAAG,CAAC,kDAAkD,sBAAU,EAAE,CAAC,EAAE,CAAC;AAC9E,CAAC,CAAC;AA1CW,QAAA,eAAe,mBA0C1B","sourcesContent":["import chalk from 'chalk';\nimport type { CloudRegion, WizardOptions } from '../utils/types';\nimport { getCloudUrlFromRegion } from '../utils/urls';\nimport type { PackageManager } from '../utils/package-manager';\nimport { ISSUES_URL, Integration } from './constants';\nimport { INTEGRATION_CONFIG } from './config';\n\nexport const getOutroMessage = ({\n options,\n integration,\n cloudRegion,\n addedEditorRules,\n packageManager,\n}: {\n options: WizardOptions;\n integration: Integration;\n cloudRegion: CloudRegion;\n addedEditorRules: boolean;\n packageManager?: PackageManager;\n}) => {\n const continueUrl = options.signup\n ? `${getCloudUrlFromRegion(cloudRegion)}/products?source=wizard`\n : undefined;\n\n const integrationConfig = INTEGRATION_CONFIG[integration];\n\n return `\n${chalk.green('Successfully installed PostHog!')} \n \n${chalk.cyan('Changes made:')}\n${integrationConfig.changes}\n${addedEditorRules ? `• Added Cursor rules for PostHog` : ''}\n \n${chalk.yellow('Next steps:')}\n${integrationConfig.nextSteps}\n\nLearn more about PostHog + ${integrationConfig.name}: ${chalk.cyan(\n integrationConfig.docsUrl,\n )}\n${continueUrl ? `\\nContinue onboarding: ${chalk.cyan(continueUrl)}\\n` : ``}\nNote: This uses experimental AI to setup your project. It might have got it wrong, please check!\n\nYou should validate your setup by (re)starting your dev environment${\n packageManager\n ? ` (e.g. ${chalk.cyan(`${packageManager.runScriptCommand} dev`)}).`\n : `.`\n }\n\n${chalk.dim(`If you encounter any issues, let us know here: ${ISSUES_URL}`)}`;\n};\n"]}
@@ -1,16 +0,0 @@
1
- import { PromptTemplate } from '@langchain/core/prompts';
2
- export declare const baseFilterFilesPromptTemplate: PromptTemplate<{
3
- documentation: any;
4
- file_list: any;
5
- integration_name: any;
6
- integration_rules: any;
7
- }, any>;
8
- export declare const baseGenerateFileChangesPromptTemplate: PromptTemplate<{
9
- documentation: any;
10
- integration_name: any;
11
- integration_rules: any;
12
- file_content: any;
13
- file_path: any;
14
- changed_files: any;
15
- unchanged_files: any;
16
- }, any>;
@@ -1,83 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.baseGenerateFileChangesPromptTemplate = exports.baseFilterFilesPromptTemplate = void 0;
4
- const prompts_1 = require("@langchain/core/prompts");
5
- exports.baseFilterFilesPromptTemplate = new prompts_1.PromptTemplate({
6
- inputVariables: [
7
- 'documentation',
8
- 'file_list',
9
- 'integration_name',
10
- 'integration_rules',
11
- ],
12
- template: `You are a PostHog installation wizard, a master AI programming assistant that implements PostHog for {integration_name} projects.
13
- Given the following list of file paths from a project, determine which files are likely to require modifications
14
- to integrate PostHog. Use the installation documentation as a reference for what files might need modifications, do not include files that are unlikely to require modification based on the documentation.
15
-
16
- - If you would like to create a new file, you can include the file path in your response.
17
- - If you would like to modify an existing file, you can include the file path in your response.
18
-
19
- You should return all files that you think will be required to look at or modify to integrate PostHog. You should return them in the order you would like to see them processed, with new files first, followed by the files that you want to update to integrate PostHog.
20
-
21
- Rules:
22
- - Only return files that you think will be required to look at or modify to integrate PostHog.
23
- - Do not return files that are unlikely to require modification based on the documentation.
24
- - If you are unsure, return the file, since it's better to have more files than less.
25
- - If two files might include the content you need to edit, return both.
26
- - If you create a new file, it should not conflict with any existing files.
27
- - If the user is using TypeScript, you should return .ts and .tsx files.
28
- - The file structure of the project may be different than the documentation, you should follow the file structure of the project. e.g. if there is an existing file containing providers, you should edit that file instead of creating a new one.
29
- {integration_rules}
30
- - Look for existing files that contain providers, components, hooks, etc. and edit those files instead of creating new ones if appropriate.
31
-
32
- Installation documentation:
33
- {documentation}
34
-
35
- All current files in the repository:
36
-
37
- {file_list}`,
38
- });
39
- exports.baseGenerateFileChangesPromptTemplate = new prompts_1.PromptTemplate({
40
- inputVariables: [
41
- 'file_content',
42
- 'documentation',
43
- 'file_path',
44
- 'changed_files',
45
- 'unchanged_files',
46
- 'integration_name',
47
- 'integration_rules',
48
- ],
49
- template: `You are a PostHog installation wizard, a master AI programming assistant that implements PostHog for {integration_name} projects.
50
-
51
- Your task is to update the file to integrate PostHog according to the documentation.
52
- Do not return a diff — you should return the complete updated file content.
53
-
54
- Rules:
55
- - Preserve the existing code formatting and style.
56
- - Only make the changes required by the documentation.
57
- - If no changes are needed, return the file as-is.
58
- - If the current file is empty, and you think it should be created, you can add the contents of the new file.
59
- - The file structure of the project may be different than the documentation, you should follow the file structure of the project.
60
- - Use relative imports if you are unsure what the project import paths are.
61
- - It's okay not to edit a file if it's not needed (e.g. if you have already edited another one or this one is not needed).
62
- {integration_rules}
63
-
64
-
65
- CONTEXT
66
- ---
67
-
68
- Documentation for integrating PostHog with {integration_name}:
69
- {documentation}
70
-
71
- The file you are updating is:
72
- {file_path}
73
-
74
- Here are the changes you have already made to the project:
75
- {changed_files}
76
-
77
- Here are the files that have not been changed yet:
78
- {unchanged_files}
79
-
80
- Below is the current file contents:
81
- {file_content}`,
82
- });
83
- //# sourceMappingURL=prompts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/lib/prompts.ts"],"names":[],"mappings":";;;AAAA,qDAAyD;AAE5C,QAAA,6BAA6B,GAAG,IAAI,wBAAc,CAAC;IAC9D,cAAc,EAAE;QACd,eAAe;QACf,WAAW;QACX,kBAAkB;QAClB,mBAAmB;KACpB;IACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;YAyBA;CACX,CAAC,CAAC;AAEU,QAAA,qCAAqC,GAAG,IAAI,wBAAc,CAAC;IACtE,cAAc,EAAE;QACd,cAAc;QACd,eAAe;QACf,WAAW;QACX,eAAe;QACf,iBAAiB;QACjB,kBAAkB;QAClB,mBAAmB;KACpB;IACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAgCG;CACd,CAAC,CAAC","sourcesContent":["import { PromptTemplate } from '@langchain/core/prompts';\n\nexport const baseFilterFilesPromptTemplate = new PromptTemplate({\n inputVariables: [\n 'documentation',\n 'file_list',\n 'integration_name',\n 'integration_rules',\n ],\n template: `You are a PostHog installation wizard, a master AI programming assistant that implements PostHog for {integration_name} projects.\nGiven the following list of file paths from a project, determine which files are likely to require modifications \nto integrate PostHog. Use the installation documentation as a reference for what files might need modifications, do not include files that are unlikely to require modification based on the documentation.\n\n- If you would like to create a new file, you can include the file path in your response.\n- If you would like to modify an existing file, you can include the file path in your response.\n\nYou should return all files that you think will be required to look at or modify to integrate PostHog. You should return them in the order you would like to see them processed, with new files first, followed by the files that you want to update to integrate PostHog.\n\nRules:\n- Only return files that you think will be required to look at or modify to integrate PostHog.\n- Do not return files that are unlikely to require modification based on the documentation.\n- If you are unsure, return the file, since it's better to have more files than less.\n- If two files might include the content you need to edit, return both.\n- If you create a new file, it should not conflict with any existing files.\n- If the user is using TypeScript, you should return .ts and .tsx files.\n- The file structure of the project may be different than the documentation, you should follow the file structure of the project. e.g. if there is an existing file containing providers, you should edit that file instead of creating a new one.\n{integration_rules}\n- Look for existing files that contain providers, components, hooks, etc. and edit those files instead of creating new ones if appropriate.\n\nInstallation documentation:\n{documentation}\n\nAll current files in the repository:\n\n{file_list}`,\n});\n\nexport const baseGenerateFileChangesPromptTemplate = new PromptTemplate({\n inputVariables: [\n 'file_content',\n 'documentation',\n 'file_path',\n 'changed_files',\n 'unchanged_files',\n 'integration_name',\n 'integration_rules',\n ],\n template: `You are a PostHog installation wizard, a master AI programming assistant that implements PostHog for {integration_name} projects.\n\nYour task is to update the file to integrate PostHog according to the documentation.\nDo not return a diff — you should return the complete updated file content.\n\nRules:\n- Preserve the existing code formatting and style.\n- Only make the changes required by the documentation.\n- If no changes are needed, return the file as-is.\n- If the current file is empty, and you think it should be created, you can add the contents of the new file.\n- The file structure of the project may be different than the documentation, you should follow the file structure of the project.\n- Use relative imports if you are unsure what the project import paths are.\n- It's okay not to edit a file if it's not needed (e.g. if you have already edited another one or this one is not needed).\n{integration_rules}\n\n\nCONTEXT\n---\n\nDocumentation for integrating PostHog with {integration_name}:\n{documentation}\n\nThe file you are updating is:\n{file_path}\n\nHere are the changes you have already made to the project:\n{changed_files}\n\nHere are the files that have not been changed yet:\n{unchanged_files}\n\nBelow is the current file contents:\n{file_content}`,\n});\n"]}
@@ -1,8 +0,0 @@
1
- export declare const getNextjsAppRouterDocs: ({ host, language, }: {
2
- host: string;
3
- language: "typescript" | "javascript";
4
- }) => string;
5
- export declare const getNextjsPagesRouterDocs: ({ host, language, }: {
6
- host: string;
7
- language: "typescript" | "javascript";
8
- }) => string;