Skip to content

Commit 9b3fa65

Browse files
authored
Merge pull request #87 from Automattic/vscode-package-hygiene
Add VS Code package hygiene
2 parents 764efb9 + 78f6667 commit 9b3fa65

4 files changed

Lines changed: 42 additions & 0 deletions

File tree

plugins/vscode/LICENSE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
This VS Code extension package is part of Build with WordPress.
2+
3+
The package is licensed under the GNU General Public License v2.0 or later.
4+
5+
See the Build with WordPress source repository for the full project license and source:
6+
https://github.com/Automattic/build-with-wordpress

plugins/vscode/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
"url": "https://github.com/Automattic/build-with-wordpress.git"
1414
},
1515
"license": "GPL-2.0-or-later",
16+
"files": [
17+
"extension.js",
18+
"mcp.json",
19+
"README.md",
20+
"LICENSE",
21+
"skills/**"
22+
],
1623
"engines": {
1724
"vscode": "^1.95.0"
1825
},

scripts/build-plugins.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,13 @@ const vsCodeExtensionManifest = {
356356
url: "https://github.com/Automattic/build-with-wordpress.git",
357357
},
358358
license: "GPL-2.0-or-later",
359+
files: [
360+
"extension.js",
361+
"mcp.json",
362+
"README.md",
363+
"LICENSE",
364+
"skills/**",
365+
],
359366
engines: {
360367
vscode: "^1.95.0",
361368
},
@@ -567,6 +574,16 @@ ${skillList}
567574
`;
568575
}
569576

577+
function buildVsCodeLicense() {
578+
return `This VS Code extension package is part of Build with WordPress.
579+
580+
The package is licensed under the GNU General Public License v2.0 or later.
581+
582+
See the Build with WordPress source repository for the full project license and source:
583+
https://github.com/Automattic/build-with-wordpress
584+
`;
585+
}
586+
570587
function buildContinueReadme() {
571588
return `# WordPress.com for Continue
572589
@@ -2258,6 +2275,11 @@ Before submitting or updating the Cursor listing, confirm the exported standalon
22582275
buildVsCodeReadme({ skillNames }),
22592276
"utf8",
22602277
);
2278+
await writeFile(
2279+
path.join(pluginDir, "LICENSE"),
2280+
buildVsCodeLicense(),
2281+
"utf8",
2282+
);
22612283
},
22622284
},
22632285
{

scripts/verify-plugins.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ async function verifyVsCodePlugin(skillNames) {
579579
await access(path.join(vsCodePluginDir, "package.json"));
580580
await access(path.join(vsCodePluginDir, "extension.js"));
581581
await access(path.join(vsCodePluginDir, "README.md"));
582+
await access(path.join(vsCodePluginDir, "LICENSE"));
582583
await verifySharedSkillSet(vsCodePluginDir, skillNames);
583584
await verifyMcpConfig(vsCodePluginDir, "VS Code plugin", "mcp.json");
584585
await verifyTelemetryScript(vsCodePluginDir, "VS Code");
@@ -605,6 +606,12 @@ async function verifyVsCodePlugin(skillNames) {
605606
throw new Error("VS Code extension manifest is missing the runtime entrypoint");
606607
}
607608

609+
for (const packagedFile of ["extension.js", "mcp.json", "README.md", "LICENSE", "skills/**"]) {
610+
if (!manifest.files?.includes(packagedFile)) {
611+
throw new Error(`VS Code extension manifest files list is missing ${packagedFile}`);
612+
}
613+
}
614+
608615
if (!manifest.engines?.vscode) {
609616
throw new Error("VS Code extension manifest is missing engines.vscode");
610617
}

0 commit comments

Comments
 (0)