Skip to content

Commit 9c45f5b

Browse files
committed
add OpenVSX purl spec definition
1 parent 18fd3e3 commit 9c45f5b

File tree

5 files changed

+318
-33
lines changed

5 files changed

+318
-33
lines changed

purl-types-index.json

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,3 @@
11
[
2-
"alpm",
3-
"apk",
4-
"bitbucket",
5-
"bitnami",
6-
"cargo",
7-
"cocoapods",
8-
"composer",
9-
"conan",
10-
"conda",
11-
"cpan",
12-
"cran",
13-
"deb",
14-
"docker",
15-
"gem",
16-
"generic",
17-
"github",
18-
"golang",
19-
"hackage",
20-
"hex",
21-
"huggingface",
22-
"luarocks",
23-
"maven",
24-
"mlflow",
25-
"npm",
26-
"nuget",
27-
"oci",
28-
"pub",
29-
"pypi",
30-
"qpkg",
31-
"rpm",
32-
"swid",
33-
"swift"
2+
"openvsx"
343
]

tests/types/openvsx-test.json

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
{
2+
"$schema": "https://packageurl.org/schemas/purl-test.schema-1.0.json",
3+
"tests": [
4+
{
5+
"description": "Parse test for basic OpenVSX PURL with version",
6+
"test_group": "base",
7+
"test_type": "parse",
8+
"input": "pkg:openvsx/redhat/java@1.46.2025091308",
9+
"expected_output": {
10+
"type": "openvsx",
11+
"namespace": "redhat",
12+
"name": "java",
13+
"version": "1.46.2025091308",
14+
"qualifiers": null,
15+
"subpath": null
16+
},
17+
"expected_failure": false,
18+
"expected_failure_reason": null
19+
},
20+
{
21+
"description": "Roundtrip test for basic OpenVSX PURL with version",
22+
"test_group": "base",
23+
"test_type": "roundtrip",
24+
"input": "pkg:openvsx/redhat/java@1.46.2025091308",
25+
"expected_output": "pkg:openvsx/redhat/java@1.46.2025091308",
26+
"expected_failure": false,
27+
"expected_failure_reason": null
28+
},
29+
{
30+
"description": "Build test for basic OpenVSX PURL with version",
31+
"test_group": "base",
32+
"test_type": "build",
33+
"input": {
34+
"type": "openvsx",
35+
"namespace": "redhat",
36+
"name": "java",
37+
"version": "1.46.2025091308",
38+
"qualifiers": null,
39+
"subpath": null
40+
},
41+
"expected_output": "pkg:openvsx/redhat/java@1.46.2025091308",
42+
"expected_failure": false,
43+
"expected_failure_reason": null
44+
},
45+
{
46+
"description": "Parse test for OpenVSX PURL with platform qualifier",
47+
"test_group": "base",
48+
"test_type": "parse",
49+
"input": "pkg:openvsx/redhat/java@1.46.2025091308?platform=linux-x64",
50+
"expected_output": {
51+
"type": "openvsx",
52+
"namespace": "redhat",
53+
"name": "java",
54+
"version": "1.46.2025091308",
55+
"qualifiers": {
56+
"platform": "linux-x64"
57+
},
58+
"subpath": null
59+
},
60+
"expected_failure": false,
61+
"expected_failure_reason": null
62+
},
63+
{
64+
"description": "Roundtrip test for OpenVSX PURL with platform qualifier",
65+
"test_group": "base",
66+
"test_type": "roundtrip",
67+
"input": "pkg:openvsx/redhat/java@1.46.2025091308?platform=linux-x64",
68+
"expected_output": "pkg:openvsx/redhat/java@1.46.2025091308?platform=linux-x64",
69+
"expected_failure": false,
70+
"expected_failure_reason": null
71+
},
72+
{
73+
"description": "Build test for OpenVSX PURL with platform qualifier",
74+
"test_group": "base",
75+
"test_type": "build",
76+
"input": {
77+
"type": "openvsx",
78+
"namespace": "redhat",
79+
"name": "java",
80+
"version": "1.46.2025091308",
81+
"qualifiers": {
82+
"platform": "linux-x64"
83+
},
84+
"subpath": null
85+
},
86+
"expected_output": "pkg:openvsx/redhat/java@1.46.2025091308?platform=linux-x64",
87+
"expected_failure": false,
88+
"expected_failure_reason": null
89+
},
90+
{
91+
"description": "Parse test for OpenVSX PURL without version",
92+
"test_group": "base",
93+
"test_type": "parse",
94+
"input": "pkg:openvsx/ms-python/python",
95+
"expected_output": {
96+
"type": "openvsx",
97+
"namespace": "ms-python",
98+
"name": "python",
99+
"version": null,
100+
"qualifiers": null,
101+
"subpath": null
102+
},
103+
"expected_failure": false,
104+
"expected_failure_reason": null
105+
},
106+
{
107+
"description": "Roundtrip test for OpenVSX PURL without version",
108+
"test_group": "base",
109+
"test_type": "roundtrip",
110+
"input": "pkg:openvsx/ms-python/python",
111+
"expected_output": "pkg:openvsx/ms-python/python",
112+
"expected_failure": false,
113+
"expected_failure_reason": null
114+
},
115+
{
116+
"description": "Build test for OpenVSX PURL without version",
117+
"test_group": "base",
118+
"test_type": "build",
119+
"input": {
120+
"type": "openvsx",
121+
"namespace": "microsoft",
122+
"name": "python",
123+
"version": null,
124+
"qualifiers": null,
125+
"subpath": null
126+
},
127+
"expected_output": "pkg:openvsx/microsoft/python",
128+
"expected_failure": false,
129+
"expected_failure_reason": null
130+
},
131+
{
132+
"description": "Parse test for OpenVSX PURL with darwin-arm64 platform",
133+
"test_group": "base",
134+
"test_type": "parse",
135+
"input": "pkg:openvsx/microsoft/python@2024.10.0?platform=darwin-arm64",
136+
"expected_output": {
137+
"type": "openvsx",
138+
"namespace": "microsoft",
139+
"name": "python",
140+
"version": "2024.10.0",
141+
"qualifiers": {
142+
"platform": "darwin-arm64"
143+
},
144+
"subpath": null
145+
},
146+
"expected_failure": false,
147+
"expected_failure_reason": null
148+
},
149+
{
150+
"description": "Parse test for OpenVSX PURL with win32-x64 platform",
151+
"test_group": "base",
152+
"test_type": "parse",
153+
"input": "pkg:openvsx/golang/go@0.39.1?platform=win32-x64",
154+
"expected_output": {
155+
"type": "openvsx",
156+
"namespace": "golang",
157+
"name": "go",
158+
"version": "0.39.1",
159+
"qualifiers": {
160+
"platform": "win32-x64"
161+
},
162+
"subpath": null
163+
},
164+
"expected_failure": false,
165+
"expected_failure_reason": null
166+
},
167+
{
168+
"description": "Parse test for OpenVSX PURL without namespace should fail",
169+
"test_group": "base",
170+
"test_type": "parse",
171+
"input": "pkg:openvsx/java@1.46.2025091308",
172+
"expected_output": null,
173+
"expected_failure": true,
174+
"expected_failure_reason": "OpenVSX PURLs require a namespace (publisher)"
175+
},
176+
{
177+
"description": "Build test for OpenVSX PURL without namespace should fail",
178+
"test_group": "base",
179+
"test_type": "build",
180+
"input": {
181+
"type": "openvsx",
182+
"namespace": null,
183+
"name": "java",
184+
"version": "1.46.2025091308",
185+
"qualifiers": null,
186+
"subpath": null
187+
},
188+
"expected_output": null,
189+
"expected_failure": true,
190+
"expected_failure_reason": "OpenVSX PURLs require a namespace (publisher)"
191+
},
192+
{
193+
"description": "Parse test for OpenVSX PURL with platform=universal (default)",
194+
"test_group": "base",
195+
"test_type": "parse",
196+
"input": "pkg:openvsx/redhat/java@1.46.2025091308?platform=universal",
197+
"expected_output": {
198+
"type": "openvsx",
199+
"namespace": "redhat",
200+
"name": "java",
201+
"version": "1.46.2025091308",
202+
"qualifiers": {
203+
"platform": "universal"
204+
},
205+
"subpath": null
206+
},
207+
"expected_failure": false,
208+
"expected_failure_reason": null
209+
}
210+
]
211+
}

types-doc/cpan-definition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The structure of a PURL for this package type is:
2222

2323
- **Requirement:** Required
2424
- **Native Label:** CPAN ID of the author/publisher
25-
- **Note:** `It MUST be written uppercase and is required.`
25+
- **Note:** `It MUST be written uppercase and is required`
2626

2727
## Name definition
2828

types-doc/openvsx-definition.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!-- NOTE: Auto-generated from the JSON PURL type definition.
2+
Do not manually edit this file. Edit the JSON type definition instead. -->
3+
4+
# PURL Type Definition: openvsx
5+
6+
- **Type Name:** OpenVSX
7+
- **Description:** OpenVSX registry for VS Code extensions
8+
- **Schema ID:** `https://packageurl.org/types/openvsx-definition.json`
9+
10+
## PURL Syntax
11+
12+
The structure of a PURL for this package type is:
13+
14+
pkg:openvsx/<namespace>/<name>@<version>?<qualifiers>#<subpath>
15+
16+
## Repository Information
17+
18+
- **Use Repository:** No
19+
- **Note:** OpenVSX packages are only available from the official OpenVSX registry at https://open-vsx.org
20+
21+
## Namespace definition
22+
23+
- **Requirement:** Required
24+
- **Native Label:** publisher
25+
- **Note:** `The namespace is the publisher or vendor of the extension (e.g., 'redhat', 'microsoft')`
26+
27+
## Name definition
28+
29+
- **Requirement:** Required
30+
- **Native Label:** extension
31+
- **Note:** `The name is the extension identifier`
32+
33+
## Version definition
34+
35+
- **Requirement:** Optional
36+
- **Native Label:** version
37+
- **Note:** `The semantic version of the extension`
38+
39+
## Qualifiers Definition
40+
41+
| Key | Requirement | Native name | Default Value | Description |
42+
|------|-------------|-------------|---------------|-------------|
43+
| platform | Optional | targetPlatform | universal | The target platform for the extension. Common values include 'universal', 'linux-x64', 'linux-arm64', 'darwin-x64', 'darwin-arm64', 'win32-x64', 'win32-arm64', etc. |
44+
45+
## Examples
46+
47+
- `pkg:openvsx/redhat/java@1.46.2025091308`
48+
- `pkg:openvsx/redhat/java@1.46.2025091308?platform=linux-x64`
49+
- `pkg:openvsx/my-python/python@2024.10.0?platform=darwin-arm64`
50+
- `pkg:openvsx/golang/go@0.39.1?platform=win32-x64`
51+
52+
## Reference URLs
53+
54+
- `https://open-vsx.org/`
55+
- `https://github.com/eclipse/openvsx`
56+
- `https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions`

types/openvsx-definition.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"$schema": "https://packageurl.org/schemas/purl-type-definition.schema-1.0.json",
3+
"$id": "https://packageurl.org/types/openvsx-definition.json",
4+
"type": "openvsx",
5+
"type_name": "OpenVSX",
6+
"description": "OpenVSX registry for VS Code extensions",
7+
"repository": {
8+
"use_repository": false,
9+
"note": "OpenVSX packages are only available from the official OpenVSX registry at https://open-vsx.org"
10+
},
11+
"namespace_definition": {
12+
"requirement": "required",
13+
"case_sensitive": false,
14+
"native_name": "publisher",
15+
"note": "The namespace is the publisher or vendor of the extension (e.g., 'redhat', 'microsoft')"
16+
},
17+
"name_definition": {
18+
"requirement": "required",
19+
"case_sensitive": false,
20+
"native_name": "extension",
21+
"note": "The name is the extension identifier"
22+
},
23+
"version_definition": {
24+
"requirement": "optional",
25+
"case_sensitive": false,
26+
"native_name": "version",
27+
"note": "The semantic version of the extension"
28+
},
29+
"qualifiers_definition": [
30+
{
31+
"key": "platform",
32+
"requirement": "optional",
33+
"description": "The target platform for the extension. Common values include 'universal', 'linux-x64', 'linux-arm64', 'darwin-x64', 'darwin-arm64', 'win32-x64', 'win32-arm64', etc.",
34+
"default_value": "universal",
35+
"native_name": "targetPlatform"
36+
}
37+
],
38+
"examples": [
39+
"pkg:openvsx/redhat/java@1.46.2025091308",
40+
"pkg:openvsx/redhat/java@1.46.2025091308?platform=linux-x64",
41+
"pkg:openvsx/my-python/python@2024.10.0?platform=darwin-arm64",
42+
"pkg:openvsx/golang/go@0.39.1?platform=win32-x64"
43+
],
44+
"reference_urls": [
45+
"https://open-vsx.org/",
46+
"https://github.com/eclipse/openvsx",
47+
"https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions"
48+
]
49+
}

0 commit comments

Comments
 (0)