-
Notifications
You must be signed in to change notification settings - Fork 53
/
package.json
551 lines (551 loc) · 19.5 KB
/
package.json
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
{
"name": "vscode-ps-rule",
"displayName": "PSRule",
"version": "0.0.1",
"publisher": "ps-rule",
"description": "Validate infrastructure as code (IaC) and DevOps repositories using PSRule.",
"author": {
"name": "Microsoft"
},
"engines": {
"vscode": "^1.96.0"
},
"channel": "stable",
"license": "SEE LICENSE IN LICENSE",
"homepage": "https://aka.ms/ps-rule",
"categories": [
"Programming Languages",
"Snippets"
],
"keywords": [
"PowerShell",
"json",
"yaml"
],
"galleryBanner": {
"color": "#0072c6",
"theme": "dark"
},
"icon": "media/icon256.png",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/PSRule.git"
},
"bugs": {
"url": "https://github.com/microsoft/PSRule/issues"
},
"private": true,
"preview": true,
"activationEvents": [
"onLanguage:powershell",
"onLanguage:yaml",
"workspaceContains:/ps-rule.yaml",
"workspaceContains:/ps-rule.lock.json",
"workspaceContains:**/ps-rule.yaml",
"workspaceContains:**/*.Rule.yaml",
"workspaceContains:**/*.Rule.yml",
"workspaceContains:**/*.Rule.json",
"workspaceContains:**/*.Rule.jsonc",
"workspaceContains:**/*.Rule.ps1",
"onCommand:workbench.action.tasks.runTask"
],
"main": "./out/dist/main.js",
"capabilities": {
"untrustedWorkspaces": {
"supported": "limited",
"description": "PSRule in untrusted mode."
}
},
"contributes": {
"commands": [
{
"command": "PSRule.createOrEditDocumentation",
"title": "Create or edit documentation",
"shortTitle": "Edit documentation",
"category": "PSRule"
},
{
"command": "PSRule.openOptionsFile",
"title": "Open options file",
"category": "PSRule"
},
{
"command": "PSRule.createOptionsFile",
"title": "Create options file",
"category": "PSRule"
},
{
"command": "PSRule.configureSettings",
"title": "Configure settings",
"category": "PSRule"
},
{
"$comment": "Only used by walkthrough.",
"command": "PSRule.walkthroughCopySnippet",
"title": "Copy walkthrough snippet",
"enablement": "false",
"category": "PSRule"
},
{
"command": "PSRule.runAnalysisTask",
"title": "Run analysis",
"category": "PSRule"
},
{
"command": "PSRule.showTasks",
"title": "Show tasks",
"enablement": "false",
"category": "PSRule"
},
{
"command": "PSRule.restore",
"title": "Restore modules",
"category": "PSRule"
},
{
"command": "PSRule.initLock",
"title": "Initialize lock file",
"category": "PSRule"
}
],
"configuration": [
{
"title": "PSRule",
"properties": {
"PSRule.codeLens.ruleDocumentationLinks": {
"type": "boolean",
"default": true,
"description": "Enables Code Lens that displays links to rule documentation.",
"scope": "application"
},
"PSRule.documentation.path": {
"type": "string",
"default": null,
"description": "The path to look for rule documentation. When not set, the path containing rules will be used.",
"scope": "window"
},
"PSRule.documentation.localePath": {
"type": "string",
"default": null,
"description": "The locale path to use for locating rule documentation. The VS Code locale will be used by default.",
"scope": "window"
},
"PSRule.documentation.customSnippetPath": {
"type": "string",
"default": null,
"description": "The path to a file containing a rule documentation snippet. When not set, built-in PSRule snippets will be used.",
"scope": "window"
},
"PSRule.documentation.snippet": {
"type": "string",
"default": "Rule Doc",
"markdownDescription": "The name of a snippet to use when creating new rule documentation. By default, the built-in `Rule Doc` snippet will be used.",
"scope": "window"
},
"PSRule.execution.ruleExcluded": {
"type": "string",
"default": "None",
"markdownDescription": "Determines how to handle [excluded rules](https://aka.ms/ps-rule/options#executionruleexcluded). When set to `None`, PSRule will use the default (`Ignore`), unless set by [PSRule options](https://aka.ms/ps-rule/options#executionruleexcluded).",
"markdownEnumDescriptions": [
"Excluded rules will not generate any notifications unless overridden.",
"Excluded rules will not generate any notifications.",
"Excluded rules will generate a warning.",
"Excluded rules will generate an error."
],
"enum": [
"None",
"Ignore",
"Warn",
"Error"
],
"scope": "application"
},
"PSRule.execution.ruleSuppressed": {
"type": "string",
"default": "None",
"markdownDescription": "Determines how to handle [suppressed rules](https://aka.ms/ps-rule/options#executionrulesuppressed). When set to `None`, PSRule will use the default (`Warn`), unless set by [PSRule options](https://aka.ms/ps-rule/options#executionrulesuppressed).",
"markdownEnumDescriptions": [
"Suppressed rules will generate a warning unless overridden.",
"Suppressed rules will not generate any notifications.",
"Suppressed rules will generate a warning.",
"Suppressed rules will generate an error."
],
"enum": [
"None",
"Ignore",
"Warn",
"Error"
],
"scope": "application"
},
"PSRule.execution.unprocessedObject": {
"type": "string",
"default": "None",
"markdownDescription": "Determines how to report objects that are [not processed by any rule](https://aka.ms/ps-rule/options#executionunprocessedobject). When set to `None`, PSRule will use the default (`Warn`), unless set by [PSRule options](https://aka.ms/ps-rule/options#executionunprocessedobject).",
"markdownEnumDescriptions": [
"Suppressed rules will generate a warning unless overridden.",
"Suppressed rules will not generate any notifications.",
"Suppressed rules will generate a warning.",
"Suppressed rules will generate an error."
],
"enum": [
"None",
"Ignore",
"Warn",
"Error"
],
"scope": "application"
},
"PSRule.experimental.enabled": {
"type": "boolean",
"default": false,
"description": "Enables experimental features in the PSRule extension.",
"scope": "application"
},
"PSRule.lock.restore": {
"type": "boolean",
"default": false,
"description": "Determines if workspace modules will automatically be restored during activation. Modules can be restored manually using the PSRule: Restore modules command.",
"markdownDescription": "Determines if workspace modules will automatically be restored during activation. Modules can be restored manually using the `PSRule: Restore modules` command.",
"scope": "window"
},
"PSRule.notifications.showChannelUpgrade": {
"type": "boolean",
"default": true,
"description": "Determines if a notification to switch to the stable channel is shown on activation.",
"scope": "application"
},
"PSRule.notifications.showModuleRestore": {
"type": "boolean",
"default": true,
"description": "Determines if a notification to restore modules is shown on activation.",
"scope": "application"
},
"PSRule.notifications.showPowerShellExtension": {
"type": "boolean",
"default": true,
"description": "Determines if a notification to install the PowerShell extension is shown on activation.",
"scope": "application"
},
"PSRule.options.path": {
"type": "string",
"default": null,
"description": "The path specifying a PSRule option file. When not set, the default ps-rule.yaml will be used from the current workspace.",
"markdownDescription": "The path specifying a PSRule option file. When not set, the default `ps-rule.yaml` will be used from the current workspace.",
"scope": "window"
},
"PSRule.output.as": {
"type": "string",
"default": "Summary",
"description": "Configures the output of analysis tasks, either summary or detailed.",
"enum": [
"Detail",
"Summary"
],
"scope": "window"
},
"PSRule.rule.baseline": {
"type": "string",
"default": null,
"description": "The name of the default baseline to use for executing rules. This setting can be overridden on individual PSRule tasks.",
"scope": "window"
},
"PSRule.trace.task": {
"type": "string",
"default": "Off",
"description": "Determines if verbose logging is enabled for task output.",
"enum": [
"Off",
"Verbose"
],
"scope": "application"
}
}
}
],
"taskDefinitions": [
{
"type": "PSRule",
"required": [],
"properties": {
"path": {
"type": "string",
"description": "The path containing rules.",
"default": "./.ps-rule/"
},
"inputPath": {
"type": "string",
"description": "The path PSRule will look for input files. Defaults to workspace root.",
"default": "."
},
"baseline": {
"type": "string",
"description": "The name of a PSRule baseline to use. Baselines can be used from modules or specified in a separate file. This option overrides the default baseline setting set for a workspace or user."
},
"modules": {
"type": "array",
"description": "The name of one or more modules to use."
},
"outcome": {
"type": "array",
"items": {
"enum": [
"Pass",
"Fail",
"Error"
]
},
"default": [
"Fail",
"Error"
]
}
}
}
],
"snippets": [
{
"language": "powershell",
"path": "./snippets/powershell.json"
},
{
"language": "markdown",
"path": "./snippets/markdown.json"
},
{
"language": "yaml",
"path": "./snippets/yaml.json"
},
{
"language": "yaml",
"path": "./snippets/github-snippets.json"
},
{
"language": "yaml",
"path": "./snippets/pipelines-snippets.json"
},
{
"language": "json",
"path": "./snippets/json.json"
},
{
"language": "jsonc",
"path": "./snippets/json.json"
}
],
"grammars": [
{
"path": "./syntaxes/comments.json",
"scopeName": "PSRule-powershell-comments",
"injectTo": [
"source.powershell"
]
},
{
"path": "./syntaxes/keywords.json",
"scopeName": "PSRule-powershell-keywords",
"injectTo": [
"source.powershell"
]
},
{
"path": "./syntaxes/rule.json",
"scopeName": "PSRule-powershell-rule",
"injectTo": [
"source.powershell"
]
},
{
"path": "./syntaxes/yaml-comments.json",
"scopeName": "PSRule-yaml-comments",
"injectTo": [
"source.yaml"
]
}
],
"yamlValidation": [
{
"fileMatch": "ps-rule.yaml",
"url": "./schemas/PSRule-options.schema.json"
},
{
"fileMatch": "ps-rule.yml",
"url": "./schemas/PSRule-options.schema.json"
},
{
"fileMatch": "psrule.yaml",
"url": "./schemas/PSRule-options.schema.json"
},
{
"fileMatch": "psrule.yml",
"url": "./schemas/PSRule-options.schema.json"
},
{
"fileMatch": "**/*.Rule.yaml",
"url": "./schemas/PSRule-language.schema.json"
},
{
"fileMatch": "**/*.Rule.yml",
"url": "./schemas/PSRule-language.schema.json"
}
],
"jsonValidation": [
{
"fileMatch": [
"*.Rule.json",
"*.Rule.jsonc"
],
"url": "./schemas/PSRule-resources.schema.json"
},
{
"fileMatch": "ps-rule.lock.json",
"url": "./schemas/PSRule-lock.schema.json"
}
],
"problemMatchers": [
{
"name": "PSRule",
"label": "PSRule",
"owner": "PSRule",
"source": "PSRule",
"severity": "error",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": [
{
"regexp": "^\\s+(FAIL)\\s+(.*)$",
"code": 2
},
{
"regexp": "^$"
},
{
"regexp": "^\\s+(.*)$",
"message": 1
},
{
"regexp": "^$"
},
{
"regexp": "^\\s+(.*): (.*):(\\d+):(\\d+)$",
"file": 2,
"line": 3,
"column": 4,
"loop": true
}
]
}
],
"walkthroughs": [
{
"id": "PSRule.getStarted",
"title": "Get Started with PSRule",
"description": "Learn about and start using PSRule with Visual Studio Code.",
"steps": [
{
"id": "configureOptions",
"title": "Configure an options file",
"description": "The options file **ps-rule.yaml** is used to initialize a workspace and configure features of PSRule.\n[Open an options file](command:PSRule.openOptionsFile)\n[Create an options file](command:PSRule.createOptionsFile)\nTip: [Close the side bar for more space](command:workbench.action.closeSidebar)",
"media": {
"markdown": "media/walkthroughs/getStarted/01_configureOptions.md"
},
"completionEvents": [
"onCommand:PSRule.openOptionsFile",
"onCommand:PSRule.createOptionsFile"
]
},
{
"id": "configureSettings",
"title": "Configure settings",
"description": "In addition to **ps-rule.yaml**, some settings that affect how PSRule runs within Visual Studio Code can be configured per user or per workspace.\n[Configure settings](command:PSRule.configureSettings)\nTip: __You can sync some of these settings across devices.__",
"media": {
"markdown": "media/walkthroughs/getStarted/02_configureSettings.md"
},
"completionEvents": [
"onCommand:PSRule.configureSettings"
]
},
{
"id": "runTasks",
"title": "Run analysis",
"description": "Tasks can be used to run analysis on files within your current Visual Studio Code workspace.\n[Show tasks](command:PSRule.showTasks)\nOr you can run the [analysis](command:PSRule.runAnalysisTask) task directly from the command palette.",
"media": {
"markdown": "media/walkthroughs/getStarted/03_runTasks.md"
},
"completionEvents": [
"command:PSRule.runAnalysisTask",
"command:PSRule.showTasks"
]
},
{
"id": "learnMore",
"title": "Learn more",
"description": "Check out our [PSRule documentation](https://aka.ms/ps-rule) to learn more about features and customization.",
"media": {
"markdown": "media/walkthroughs/getStarted/04_learnMore.md"
}
}
],
"featuredFor": [
"**/ps-rule.yaml",
"**/*.Rule.yaml",
"**/*.Rule.ps1",
"**/*.Rule.jsonc"
]
}
]
},
"scripts": {
"zzz_compile": "tsc -p ./ && dotnet build",
"zzz_watch": "tsc -watch -p ./",
"zzz_package": "vsce package --dependencies --pre-release --no-git-tag-version --no-update-package-json --githubBranch main --out out/package/",
"zzz_package:stable": "vsce package --dependencies --no-git-tag-version --no-update-package-json --githubBranch main --out out/package/",
"zzz_publish": "vsce publish --dependencies --pre-release --no-git-tag-version --no-update-package-json --githubBranch main --packagePath out/package/",
"zzz_publish:stable": "vsce publish --dependencies --no-git-tag-version --no-update-package-json --githubBranch main --packagePath out/package/",
"zzz_lint": "eslint . --ext .ts,.tsx",
"zzz_pretest": "npm run compile",
"zzz_vscode:prepublish": "npm run -S esbuild-base -- --minify && dotnet publish ./src/PSRule.EditorServices/ --output server/",
"zzz_esbuild-base": "esbuild ./src/vscode-ps-rule/main.ts --bundle --outfile=out/dist/main.js --external:vscode --format=cjs --platform=node",
"zzz_esbuild": "npm run -S esbuild-base -- --sourcemap",
"zzz_esbuild-watch": "npm run -S esbuild-base -- --sourcemap --watch",
"zzz_build": "tsc -p ./ && dotnet build && node build.mjs",
"zzz_check-types": "tsc --noEmit",
"zzz_pack": "npm run vscode:prepublish && npm run publish",
"build": "npm run build:dotnet && npm run build:esbuild && npm run build:pack",
"build:dotnet": "dotnet build ./src/PSRule.EditorServices/ --output server/",
"build:pack": "vsce package --dependencies --pre-release --no-git-tag-version --no-update-package-json --githubBranch main --out out/package/",
"build:esbuild": "node esbuild.mjs",
"package": "npm run package:dotnet && npm run package:esbuild && npm run package:pack",
"package:dotnet": "dotnet build ./src/PSRule.EditorServices/ --output server/",
"package:pack": "vsce package --dependencies --pre-release --no-git-tag-version --no-update-package-json --githubBranch main --out out/package/ --readme-path src/vscode-ps-rule/README.md --changelog-path docs/CHANGELOG-v3.md --baseImagesUrl https://raw.githubusercontent.com/microsoft/PSRule/refs/heads/main/",
"package:esbuild": "node esbuild.mjs",
"test": "npm run build:dotnet && npm run build:esbuild && vscode-test"
},
"dependencies": {
"fs-extra": "^11.2.0",
"vscode-languageclient": "^9.0.1"
},
"extensionDependencies": [
"vscode.powershell",
"redhat.vscode-yaml",
"ms-dotnettools.vscode-dotnet-runtime"
],
"devDependencies": {
"@types/fs-extra": "^11.0.4",
"@types/mocha": "^10.0.10",
"@types/node": "^22.10.2",
"@types/vscode": "1.96.0",
"@typescript-eslint/eslint-plugin": "^8.18.1",
"@typescript-eslint/parser": "^8.18.1",
"@vscode/test-cli": "^0.0.10",
"@vscode/test-electron": "^2.4.1",
"@vscode/vsce": "^3.2.1",
"esbuild": "^0.24.2",
"eslint": "^9.17.0",
"glob": "^11.0.0",
"mocha": "^11.0.1",
"typescript": "^5.7.2"
}
}