@posthog/wizard 0.4.1 → 0.6.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 (53) hide show
  1. package/README.md +21 -15
  2. package/dist/src/lib/config.d.ts +29 -1
  3. package/dist/src/lib/config.js +36 -0
  4. package/dist/src/lib/config.js.map +1 -1
  5. package/dist/src/lib/constants.d.ts +3 -1
  6. package/dist/src/lib/constants.js +6 -0
  7. package/dist/src/lib/constants.js.map +1 -1
  8. package/dist/src/lib/messages.d.ts +10 -0
  9. package/dist/src/lib/messages.js +37 -0
  10. package/dist/src/lib/messages.js.map +1 -0
  11. package/dist/src/lib/prompts.js +4 -1
  12. package/dist/src/lib/prompts.js.map +1 -1
  13. package/dist/src/nextjs/docs.js +4 -2
  14. package/dist/src/nextjs/docs.js.map +1 -1
  15. package/dist/src/nextjs/nextjs-wizard.js +18 -8
  16. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  17. package/dist/src/react/docs.d.ts +1 -2
  18. package/dist/src/react/docs.js +9 -3
  19. package/dist/src/react/docs.js.map +1 -1
  20. package/dist/src/react/react-wizard.js +17 -8
  21. package/dist/src/react/react-wizard.js.map +1 -1
  22. package/dist/src/react-native/docs.d.ts +5 -0
  23. package/dist/src/react-native/docs.js +31 -0
  24. package/dist/src/react-native/docs.js.map +1 -0
  25. package/dist/src/react-native/react-native-wizard.d.ts +2 -0
  26. package/dist/src/react-native/react-native-wizard.js +123 -0
  27. package/dist/src/react-native/react-native-wizard.js.map +1 -0
  28. package/dist/src/run.d.ts +1 -0
  29. package/dist/src/run.js +11 -0
  30. package/dist/src/run.js.map +1 -1
  31. package/dist/src/svelte/docs.d.ts +3 -0
  32. package/dist/src/svelte/docs.js +110 -0
  33. package/dist/src/svelte/docs.js.map +1 -0
  34. package/dist/src/svelte/svelte-wizard.d.ts +2 -0
  35. package/dist/src/svelte/svelte-wizard.js +113 -0
  36. package/dist/src/svelte/svelte-wizard.js.map +1 -0
  37. package/dist/src/utils/clack-utils.js +10 -5
  38. package/dist/src/utils/clack-utils.js.map +1 -1
  39. package/dist/src/utils/package-manager.d.ts +1 -0
  40. package/dist/src/utils/package-manager.js +23 -2
  41. package/dist/src/utils/package-manager.js.map +1 -1
  42. package/dist/src/utils/rules/add-editor-rules.d.ts +9 -0
  43. package/dist/src/utils/rules/add-editor-rules.js +90 -0
  44. package/dist/src/utils/rules/add-editor-rules.js.map +1 -0
  45. package/dist/src/utils/rules/add-editor-rules.ts +86 -0
  46. package/dist/src/utils/rules/next-rules.md +9 -0
  47. package/dist/src/utils/rules/react-native-rules.md +7 -0
  48. package/dist/src/utils/rules/react-rules.md +7 -0
  49. package/dist/src/utils/rules/svelte-rules.md +7 -0
  50. package/dist/src/utils/rules/universal.md +20 -0
  51. package/dist/src/utils/types.d.ts +4 -0
  52. package/dist/src/utils/types.js.map +1 -1
  53. package/package.json +2 -2
@@ -0,0 +1,20 @@
1
+ Never hallucinate an API key. Instead, always use the API key populated in the .env file.
2
+
3
+ # Feature flags
4
+
5
+ A given feature flag should be used in as few places as possible. Do not increase the risk of undefined behavior by scattering the same feature flag across multiple areas of code. If the same feature flag needs to be introduced at multiple callsites, flag this for the developer to inspect carefully.
6
+
7
+ If a job requires creating new feature flag names, make them as clear and descriptive as possible.
8
+
9
+ If using TypeScript, use an enum to store flag names. If using JavaScript, store flag names as strings to an object declared as a constant, to simulate an enum. Use a consistent naming convention for this storage. enum/const object members should be written UPPERCASE_WITH_UNDERSCORE.
10
+
11
+ Gate flag-dependent code on a check that verifies the flag's values are valid and expected.
12
+
13
+ # Custom properties
14
+
15
+ If a custom property for a person or event is at any point referenced in two or more files or two or more callsites in the same file, use an enum or const object, as above in feature flags.
16
+
17
+ # Naming
18
+
19
+ Before creating any new event or property names, consult with the developer for any existing naming convention. Consistency in naming is essential, and additional context may exist outside this project. Similarly, be careful about any changes to existing event and property names, as this may break reporting and distort data for the project.
20
+
@@ -29,6 +29,10 @@ export type WizardOptions = {
29
29
  * Whether to select the default option for all questions automatically.
30
30
  */
31
31
  default: boolean;
32
+ /**
33
+ * Whether to create a new PostHog account during setup.
34
+ */
35
+ signup: boolean;
32
36
  };
33
37
  export interface Feature {
34
38
  id: string;
@@ -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\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/wizard",
3
- "version": "0.4.1",
3
+ "version": "0.6.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",
@@ -123,7 +123,7 @@
123
123
  "prebuild": "pnpm clean",
124
124
  "build:watch": "pnpm tsc -w",
125
125
  "build": "pnpm tsc",
126
- "postbuild": "chmod +x ./dist/bin.js && cp -r scripts/** dist",
126
+ "postbuild": "chmod +x ./dist/bin.js && cp -r scripts/** dist && cp -r src/utils/rules dist/src/utils",
127
127
  "lint": "pnpm lint:prettier && pnpm lint:eslint",
128
128
  "lint:prettier": "prettier --check \"{lib,src,test}/**/*.ts\"",
129
129
  "lint:eslint": "eslint . --cache --format stylish",