diff --git a/extensions/lib/add-remotes.ts b/extensions/lib/add-remotes.ts index 89bc50518e..1c69a5455d 100644 --- a/extensions/lib/add-remotes.ts +++ b/extensions/lib/add-remotes.ts @@ -13,7 +13,7 @@ import { try { await execGitCommand(`git remote add ${MULTI_TEMPLATE_NAME} ${MULTI_TEMPLATE_URL}`); } catch (e) { - if (e.toString().includes(ERROR_STRINGS.multiRemoteExists)) + if (e.toString().toLowerCase().includes(ERROR_STRINGS.multiRemoteExists.toLowerCase())) console.log(`Remote ${MULTI_TEMPLATE_NAME} already exists. This is likely not a problem.`); else { console.error(`Error on adding remote ${MULTI_TEMPLATE_NAME}: ${e}`); @@ -25,7 +25,7 @@ import { try { await execGitCommand(`git remote add ${SINGLE_TEMPLATE_NAME} ${SINGLE_TEMPLATE_URL}`); } catch (e) { - if (e.toString().includes(ERROR_STRINGS.singleRemoteExists)) + if (e.toString().toLowerCase().includes(ERROR_STRINGS.singleRemoteExists.toLowerCase())) console.log(`Remote ${SINGLE_TEMPLATE_NAME} already exists. This is likely not a problem.`); else { console.error(`Error on adding remote ${SINGLE_TEMPLATE_NAME}: ${e}`); diff --git a/extensions/lib/update-from-templates.ts b/extensions/lib/update-from-templates.ts index d9a6b74380..2ea3c9dfe5 100644 --- a/extensions/lib/update-from-templates.ts +++ b/extensions/lib/update-from-templates.ts @@ -65,7 +65,9 @@ import { ExtensionInfo, getExtensions, subtreeRootFolder } from '../webpack/webp e .toString() .toLowerCase() - .includes(ERROR_STRINGS.subtreeNeverAdded.replace('{0}', ext.dirPathOSIndependent)) + .includes( + ERROR_STRINGS.subtreeNeverAdded.replace('{0}', ext.dirPathOSIndependent).toLowerCase(), + ) ) // If this folder isn't a subtree, it may be intentionally not based on the template. Continue console.warn( diff --git a/extensions/src/hello-someone/contributions/projectSettings.json b/extensions/src/hello-someone/contributions/projectSettings.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/extensions/src/hello-someone/contributions/projectSettings.json @@ -0,0 +1 @@ +[] diff --git a/extensions/src/hello-someone/contributions/settings.json b/extensions/src/hello-someone/contributions/settings.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/extensions/src/hello-someone/contributions/settings.json @@ -0,0 +1 @@ +[] diff --git a/extensions/src/hello-someone/manifest.json b/extensions/src/hello-someone/manifest.json index 0fdac68ba1..3bb73e6a5f 100644 --- a/extensions/src/hello-someone/manifest.json +++ b/extensions/src/hello-someone/manifest.json @@ -6,6 +6,9 @@ "license": "MIT", "main": "src/main.ts", "types": "src/types/hello-someone.d.ts", + "menus": "contributions/menus.json", + "settings": "contributions/settings.json", + "projectSettings": "contributions/projectSettings.json", "activationEvents": [ "onCommand:helloSomeone.helloSomeone", "onCommand:helloSomeone.echoSomeoneRenderer" diff --git a/extensions/src/hello-world/contributions/projectSettings.json b/extensions/src/hello-world/contributions/projectSettings.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/extensions/src/hello-world/contributions/projectSettings.json @@ -0,0 +1 @@ +[] diff --git a/extensions/src/hello-world/contributions/settings.json b/extensions/src/hello-world/contributions/settings.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/extensions/src/hello-world/contributions/settings.json @@ -0,0 +1 @@ +[] diff --git a/extensions/src/hello-world/manifest.json b/extensions/src/hello-world/manifest.json index 526d1ba749..8f7bf6a78b 100644 --- a/extensions/src/hello-world/manifest.json +++ b/extensions/src/hello-world/manifest.json @@ -6,5 +6,8 @@ "license": "MIT", "main": "src/main.ts", "types": "src/types/hello-world.d.ts", + "menus": "contributions/menus.json", + "settings": "contributions/settings.json", + "projectSettings": "contributions/projectSettings.json", "activationEvents": ["onCommand:helloWorld.helloWorld", "onCommand:helloWorld.helloException"] } diff --git a/extensions/src/quick-verse/contributions/projectSettings.json b/extensions/src/quick-verse/contributions/projectSettings.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/extensions/src/quick-verse/contributions/projectSettings.json @@ -0,0 +1 @@ +[] diff --git a/extensions/src/quick-verse/contributions/settings.json b/extensions/src/quick-verse/contributions/settings.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/extensions/src/quick-verse/contributions/settings.json @@ -0,0 +1 @@ +[] diff --git a/extensions/src/quick-verse/manifest.json b/extensions/src/quick-verse/manifest.json index aaab8ab7ba..0f60f4815a 100644 --- a/extensions/src/quick-verse/manifest.json +++ b/extensions/src/quick-verse/manifest.json @@ -6,5 +6,8 @@ "license": "MIT", "main": "src/main.ts", "types": "src/types/quick-verse.d.ts", + "menus": "contributions/menus.json", + "settings": "contributions/settings.json", + "projectSettings": "contributions/projectSettings.json", "activationEvents": [] } diff --git a/extensions/src/resource-viewer/contributions/projectSettings.json b/extensions/src/resource-viewer/contributions/projectSettings.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/extensions/src/resource-viewer/contributions/projectSettings.json @@ -0,0 +1 @@ +[] diff --git a/extensions/src/resource-viewer/contributions/settings.json b/extensions/src/resource-viewer/contributions/settings.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/extensions/src/resource-viewer/contributions/settings.json @@ -0,0 +1 @@ +[] diff --git a/extensions/src/resource-viewer/manifest.json b/extensions/src/resource-viewer/manifest.json index 8c9437c00b..60d5624abc 100644 --- a/extensions/src/resource-viewer/manifest.json +++ b/extensions/src/resource-viewer/manifest.json @@ -6,5 +6,8 @@ "license": "MIT", "main": "src/main.ts", "types": "src/types/resource-viewer.d.ts", + "menus": "contributions/menus.json", + "settings": "contributions/settings.json", + "projectSettings": "contributions/projectSettings.json", "activationEvents": [] } diff --git a/extensions/webpack/webpack.util.ts b/extensions/webpack/webpack.util.ts index 4f3b0e376d..d06b510406 100644 --- a/extensions/webpack/webpack.util.ts +++ b/extensions/webpack/webpack.util.ts @@ -137,6 +137,10 @@ const staticFiles: { { from: '', noErrorOnMissing: true }, // Copy the menu JSON file into the output folder based on its listing in `manifest.menus` { from: '', noErrorOnMissing: true }, + // Copy the settings JSON file into the output folder based on its listing in `manifest.settings` + { from: '', noErrorOnMissing: true }, + // Copy the project settings JSON file into the output folder based on its listing in `manifest.projectSettings` + { from: '', noErrorOnMissing: true }, ]; /** Get the actual static file name from the template static file name */ @@ -144,7 +148,9 @@ function getStaticFileName(staticFile: string, extensionInfo: ExtensionInfo) { return staticFile .replace(//g, extensionInfo.name) .replace(//g, extensionInfo.types ?? '') - .replace(//g, extensionInfo.menus ?? ''); + .replace(//g, extensionInfo.menus ?? '') + .replace(//g, extensionInfo.menus ?? '') + .replace(//g, extensionInfo.menus ?? ''); } /** Get CopyFile plugin patterns for copying static files for an extension */ @@ -286,6 +292,10 @@ type ExtensionManifest = { types?: string; /** Path to the JSON file that defines the menu items this extension is adding. */ menus?: string; + /** Path to the JSON file that defines the settings this extension is adding. */ + settings?: string; + /** Path to the JSON file that defines the project settings this extension is adding. */ + projectSettings?: string; activationEvents: string[]; }; diff --git a/lib/papi-dts/papi.d.ts b/lib/papi-dts/papi.d.ts index bb0a789de9..090036ef98 100644 --- a/lib/papi-dts/papi.d.ts +++ b/lib/papi-dts/papi.d.ts @@ -4190,6 +4190,12 @@ declare module 'extension-host/extension-types/extension-manifest.model' { * for more information about extension type declaration files. */ types?: string; + /** Path to the JSON file that defines the menu items this extension is adding. */ + menus?: string; + /** Path to the JSON file that defines the settings this extension is adding. */ + settings?: string; + /** Path to the JSON file that defines the project settings this extension is adding. */ + projectSettings?: string; /** * List of events that occur that should cause this extension to be activated. Not yet * implemented. diff --git a/src/extension-host/extension-types/extension-manifest.model.ts b/src/extension-host/extension-types/extension-manifest.model.ts index 1a5c73b49b..3f0b4624d2 100644 --- a/src/extension-host/extension-types/extension-manifest.model.ts +++ b/src/extension-host/extension-types/extension-manifest.model.ts @@ -32,6 +32,10 @@ export type ExtensionManifest = { types?: string; /** Path to the JSON file that defines the menu items this extension is adding. */ menus?: string; + /** Path to the JSON file that defines the settings this extension is adding. */ + settings?: string; + /** Path to the JSON file that defines the project settings this extension is adding. */ + projectSettings?: string; /** * List of events that occur that should cause this extension to be activated. Not yet * implemented.