Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

cli: name validated folders with the derived plugin publisher (#36296)

Neilce7ca7f9a0ce
diff --git a/src/cli/plugin-authoring/plugin-folder-validation.ts b/src/cli/plugin-authoring/plugin-folder-validation.ts
index b58f57c572b..282c30d2dca 100644
--- a/src/cli/plugin-authoring/plugin-folder-validation.ts
+++ b/src/cli/plugin-authoring/plugin-folder-validation.ts
@@ -14,6 +14,10 @@ import {
} from '../../shared/plugins/approval/plugin-cli-approval'
import { strictPluginArtifactErrors } from '../../shared/plugins/authoring/plugin-strict-artifact-checks'
import { validatePluginFile } from '../../shared/plugins/installation/plugin-file-validation'
+import {
+ localPluginPublisher,
+ withPluginPublisher
+} from '../../shared/plugins/installation/plugin-publisher-derivation'
import {
PLUGIN_MANIFEST_FILENAME,
parsePluginManifest,
@@ -114,7 +118,10 @@ export async function validatePluginTarget(target: string): Promise<PluginValida
valid: errors.length === 0,
errors,
plugin: {
- pluginKey: qualifiedPluginKey(manifest),
+ // Why derived: a folder loads under its declared publisher, else `local`, like dev discovery.
+ pluginKey: qualifiedPluginKey(
+ withPluginPublisher(manifest, localPluginPublisher(manifest.publisher))
+ ),
name: manifest.name,
version: manifest.version,
needsApproval: pluginNeedsCliApproval(manifest),
diff --git a/src/cli/plugin-authoring/plugin-templates.test.ts b/src/cli/plugin-authoring/plugin-templates.test.ts
index 301b48d5778..9083e595a5f 100644
--- a/src/cli/plugin-authoring/plugin-templates.test.ts
+++ b/src/cli/plugin-authoring/plugin-templates.test.ts
@@ -1,4 +1,4 @@
-import { mkdtemp, rm, writeFile } from 'node:fs/promises'
+import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { afterEach, describe, expect, it } from 'vitest'
@@ -64,6 +64,19 @@ describe('orca plugin validate', () => {
expect(report.errors.join('\n')).toContain('contributes.themes')
})
+ it('names a folder without a publisher the way Orca loads it', async () => {
+ const dir = join(await tempRoot(), 'nopub')
+ await createPluginFromTemplate({ dir, template: 'theme', publisher: 'acme' })
+ const manifestPath = join(dir, 'orca-plugin.json')
+ const manifest = JSON.parse(await readFile(manifestPath, 'utf8'))
+ delete manifest.publisher
+ manifest.engines.orca = '>=1.4.246'
+ await writeFile(manifestPath, JSON.stringify(manifest))
+ const report = await validatePluginTarget(dir)
+ expect(report.errors).toEqual([])
+ expect(report.plugin?.pluginKey).toBe('local.nopub')
+ })
+
it('reports a missing panel entry', async () => {
const dir = join(await tempRoot(), 'panel')
await createPluginFromTemplate({ dir, template: 'panel', publisher: 'acme' })