-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
298 lines (298 loc) · 9.84 KB
/
package.json
File metadata and controls
298 lines (298 loc) · 9.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
{
"name": "posthog-vscode",
"displayName": "PostHog for VSCode",
"description": "PostHog extension for VSCode",
"version": "0.7.1",
"license": "MIT",
"publisher": "PostHog",
"icon": "resources/icons/ph-logo2.png",
"repository": {
"type": "git",
"url": "https://github.com/PostHog/posthog-vscode"
},
"engines": {
"vscode": "^1.93.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onStartupFinished"
],
"main": "./dist/extension.js",
"contributes": {
"authentication": [
{
"id": "posthog",
"label": "PostHog"
}
],
"viewsContainers": {
"activitybar": [
{
"id": "posthog-explorer",
"title": "PostHog",
"icon": "resources/icons/codehog.svg"
}
]
},
"views": {
"posthog-explorer": [
{
"type": "webview",
"id": "posthog-sidebar",
"name": "PostHog"
},
{
"id": "posthog-stale-flags",
"name": "Stale Flags",
"when": "posthog.isAuthenticated",
"visibility": "collapsed",
"initialSize": 0
},
{
"type": "webview",
"id": "posthog-feedback-v2",
"name": "Feedback",
"when": "posthog.isAuthenticated",
"visibility": "collapsed",
"initialSize": 0
},
{
"id": "posthog-debug-v2",
"name": "Debug",
"when": "posthog.isDevelopment && posthog.isAuthenticated",
"visibility": "collapsed"
}
]
},
"commands": [
{
"command": "posthog.signIn",
"title": "PostHog: Sign In"
},
{
"command": "posthog.signOut",
"title": "PostHog: Sign Out"
},
{
"command": "posthog.selectProject",
"title": "PostHog: Select Project"
},
{
"command": "posthog.refreshFeatureFlags",
"title": "PostHog: Refresh Feature Flags"
},
{
"command": "posthog.copyFlagKey",
"title": "PostHog: Copy Flag Key"
},
{
"command": "posthog.openFlagInBrowser",
"title": "PostHog: Open in PostHog"
},
{
"command": "posthog.createFlag",
"title": "PostHog: Create Feature Flag"
},
{
"command": "posthog.showFlagDetail",
"title": "PostHog: Show Flag Detail"
},
{
"command": "posthog.showExperimentDetail",
"title": "PostHog: Show Experiment Detail"
},
{
"command": "posthog.scanStaleFlags",
"title": "PostHog: Scan for Stale Flags",
"icon": "$(search)"
},
{
"command": "posthog.cleanupStaleFlag",
"title": "PostHog: Clean Up Stale Flag",
"icon": "$(trash)"
},
{
"command": "posthog.showSessions",
"title": "PostHog: Watch Sessions"
},
{
"command": "posthog.generateFlagTypes",
"title": "PostHog: Generate Flag Types"
},
{
"command": "posthog.generateType",
"title": "PostHog: Generate Type"
},
{
"command": "posthog.findFlagReferences",
"title": "PostHog: Find Flag References",
"icon": "$(search)"
},
{
"command": "posthog.runWizard",
"title": "PostHog: Run Setup Wizard"
}
],
"menus": {
"editor/context": [
{
"command": "posthog.generateType",
"when": "posthog.isAuthenticated && editorTextFocus",
"group": "PostHog"
}
],
"view/title": [
{
"command": "posthog.scanStaleFlags",
"when": "view == posthog-stale-flags",
"group": "navigation"
}
],
"view/item/context": [
{
"command": "posthog.cleanupStaleFlag",
"when": "view == posthog-stale-flags && viewItem == staleFlag",
"group": "inline"
},
{
"command": "posthog.openFlagInBrowser",
"when": "view == posthog-stale-flags && viewItem == staleFlagWithId",
"group": "1_actions"
},
{
"command": "posthog.findFlagReferences",
"when": "view == posthog-stale-flags && viewItem =~ /staleFlag/",
"group": "1_actions"
}
]
},
"viewsWelcome": [
{
"view": "posthog-stale-flags",
"contents": "$(pass) All clear! No stale flags found in your codebase.\n\nYour feature flag usage looks healthy. Run another scan anytime to check for newly stale flags.\n[$(search) Scan Again](command:posthog.scanStaleFlags)",
"when": "posthog.isAuthenticated && posthog.hasScannedForStaleFlags && !posthog.hasStaleFlagResults"
},
{
"view": "posthog-stale-flags",
"contents": "Scan your codebase for feature flags that can be cleaned up.\n[$(search) Scan for Stale Flags](command:posthog.scanStaleFlags)\nThis will find flags that are:\n$(warning) Not in PostHog — keys not found in your project\n$(circle-slash) Inactive — flags that are turned off\n$(beaker) Experiment complete — linked experiment has ended\n$(check-all) Fully rolled out — 100% rollout, no conditions\n\nEvery flag check is a billed API call — cleaning up stale flags saves costs.\n[$(gear) Configure Settings](command:workbench.action.openSettings?%5B%22posthog.staleFlag%22%5D)\n[$(book) Feature Flags Docs](https://posthog.com/docs/feature-flags)",
"when": "posthog.isAuthenticated && !posthog.hasScannedForStaleFlags"
}
],
"configuration": {
"title": "PostHog",
"properties": {
"posthog.additionalClientNames": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Extra variable names to recognize as PostHog clients (e.g. `toolbarPosthogJS`, `telemetry`, `posthoganalytics`)."
},
"posthog.additionalFlagFunctions": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Bare function names that accept a feature flag key as the first argument (e.g. `useFeatureFlag`)."
},
"posthog.detectNestedClients": {
"type": "boolean",
"default": true,
"markdownDescription": "Detect PostHog calls through nested member expressions like `window.posthog?.capture()`."
},
"posthog.showInlineDecorations": {
"type": "boolean",
"default": true,
"markdownDescription": "Show inline flag status and event volume decorations in the editor."
},
"posthog.inlineHintsMode": {
"type": "string",
"enum": [
"always",
"currentLine"
],
"default": "always",
"enumDescriptions": [
"Show inline hints on all lines with PostHog calls",
"Show inline hints only on the line where the cursor is currently located"
],
"markdownDescription": "When to display inline hints for feature flags and events."
},
"posthog.useWorkspaceConfig": {
"type": "boolean",
"default": true,
"markdownDescription": "Automatically load team settings from `.posthog.json` in the workspace root."
},
"posthog.multiProjectNotifications": {
"type": "boolean",
"default": true,
"markdownDescription": "Show a notification when opening a file from a workspace folder configured for a different PostHog project."
},
"posthog.staleFlagAgeDays": {
"type": "number",
"default": 30,
"markdownDescription": "Minimum age in days before a fully-rolled-out flag is considered stale. Flags rolled out more recently than this are not flagged."
},
"posthog.staleFlagExcludePatterns": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Additional glob patterns to exclude from stale flag scanning (e.g. `**/tests/**`, `**/fixtures/**`)."
}
}
}
},
"scripts": {
"compile": "pnpm run fetch-grammars && webpack",
"watch": "pnpm run fetch-grammars && webpack --watch",
"package": "webpack --mode production --devtool hidden-source-map",
"fetch-grammars": "node scripts/fetch-grammars.js",
"compile-tests": "tsc -p . --outDir out",
"watch-tests": "tsc -p . -w --outDir out",
"pretest": "pnpm run compile-tests && pnpm run compile && pnpm run lint",
"lint": "eslint src",
"test": "vscode-test",
"test:coverage": "vscode-test --coverage",
"changeset": "changeset",
"release:version": "changeset version",
"release:package": "pnpm run fetch-grammars && pnpm run package && vsce package --no-dependencies -o codehog.vsix",
"release:publish:vscode": "vsce publish --no-dependencies --packagePath codehog.vsix",
"release:publish:ovsx": "ovsx publish codehog.vsix"
},
"devDependencies": {
"@changesets/cli": "^2.29.0",
"@types/mocha": "^10.0.10",
"@types/node": "22.x",
"@types/vscode": "^1.93.0",
"@vscode/test-cli": "^0.0.12",
"@vscode/test-electron": "^2.5.2",
"@vscode/vsce": "^3.3.2",
"c8": "^11.0.0",
"copy-webpack-plugin": "^12.0.2",
"eslint": "^9.39.3",
"fast-check": "^4.6.0",
"ovsx": "^0.10.1",
"tree-sitter-cli": "^0.26.6",
"ts-loader": "^9.5.4",
"typescript": "^5.9.3",
"typescript-eslint": "^8.56.1",
"webpack": "^5.105.3",
"webpack-cli": "^6.0.1"
},
"dependencies": {
"posthog-node": "^5.28.9",
"web-tree-sitter": "^0.24.7"
},
"pnpm": {
"onlyBuiltDependencies": [
"tree-sitter-cli"
]
},
"packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0"
}