Skip to content

Commit cad237e

Browse files
authored
Merge pull request #26: Prepare to release 1.0.0
2 parents 820c3e6 + e6f39db commit cad237e

14 files changed

+460
-156
lines changed

.github/workflows/coding-standards.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
on: # yamllint disable-line rule:truthy
44
pull_request:
55
branches:
6-
- master
6+
- 1.x
77
push:
88
branches:
9-
- master
9+
- 1.x
1010

1111
name: 🧹 Fix PHP coding standards
1212

.github/workflows/create-release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
on: # yamllint disable-line rule:truthy
88
push:
99
branches:
10-
- master
10+
- 1.x
1111

1212
name: 📦 Create release
1313

@@ -16,12 +16,12 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: 🎉 Create release
19-
uses: googleapis/release-please-action@v4.1.1
19+
uses: googleapis/release-please-action@v4
2020
id: release
2121
with:
2222
token: ${{ secrets.DLOAD_RELEASE_TOKEN }}
2323
config-file: .github/.release-please-config.json
2424
manifest-file: resources/version.json
25-
target-branch: master
25+
target-branch: 1.x
2626

2727
...

.github/workflows/testing.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ name: 🧪 Unit testing
55
on: # yamllint disable-line rule:truthy
66
pull_request:
77
branches:
8-
- master
8+
- 1.x
99
push:
1010
branches:
11-
- master
11+
- 1.x
1212

1313
jobs:
1414
code-coverage:

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ Create `dload.xml` in your project root:
111111

112112
```xml
113113
<?xml version="1.0"?>
114-
<dload
115-
temp-dir="./runtime"
114+
<dload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
115+
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/php-internal/dload/refs/heads/1.x/dload.xsd"
116+
temp-dir="./runtime"
116117
>
117118
<actions>
118119
<download software="rr" version="^2.12.0" />
@@ -166,7 +167,9 @@ Create your own software definitions:
166167

167168
```xml
168169
<?xml version="1.0"?>
169-
<dload>
170+
<dload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
171+
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/php-internal/dload/refs/heads/1.x/dload.xsd"
172+
>
170173
<registry overwrite="false">
171174
<!-- Binary software example -->
172175
<software name="RoadRunner" alias="rr"
@@ -283,7 +286,9 @@ steps:
283286
Configure once, use everywhere:
284287
285288
```xml
286-
<dload>
289+
<dload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
290+
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/php-internal/dload/refs/heads/1.x/dload.xsd"
291+
>
287292
<actions>
288293
<download software="rr" version="^2.12.0" />
289294
<download software="temporal" />

composer.lock

+12-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dload.xml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0"?>
22
<!-- Example -->
33
<dload
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="dload.xsd"
46
temp-dir="./runtime"
57
>
68
<actions>

dload.xsd

+166
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
3+
<!-- Root element -->
4+
<xs:element name="dload">
5+
<xs:annotation>
6+
<xs:documentation>DLoad configuration for downloading and managing binary artifacts</xs:documentation>
7+
</xs:annotation>
8+
<xs:complexType>
9+
<xs:sequence>
10+
<!-- Actions container -->
11+
<xs:element name="actions" minOccurs="0" maxOccurs="1">
12+
<xs:annotation>
13+
<xs:documentation>Container for download actions</xs:documentation>
14+
</xs:annotation>
15+
<xs:complexType>
16+
<xs:sequence>
17+
<xs:element name="download" minOccurs="0" maxOccurs="unbounded">
18+
<xs:annotation>
19+
<xs:documentation>Defines a software package to download</xs:documentation>
20+
</xs:annotation>
21+
<xs:complexType>
22+
<xs:attribute name="software" type="xs:string" use="required">
23+
<xs:annotation>
24+
<xs:documentation>Software identifier to download</xs:documentation>
25+
</xs:annotation>
26+
</xs:attribute>
27+
<xs:attribute name="version" type="xs:string">
28+
<xs:annotation>
29+
<xs:documentation>Version constraint (composer-style)</xs:documentation>
30+
</xs:annotation>
31+
</xs:attribute>
32+
<xs:attribute name="version-path" type="xs:string">
33+
<xs:annotation>
34+
<xs:documentation>Path to extract version from (e.g. [email protected]/name)</xs:documentation>
35+
</xs:annotation>
36+
</xs:attribute>
37+
<xs:attribute name="extract-path" type="xs:string">
38+
<xs:annotation>
39+
<xs:documentation>Custom path where to unpack downloaded asset</xs:documentation>
40+
</xs:annotation>
41+
</xs:attribute>
42+
</xs:complexType>
43+
</xs:element>
44+
</xs:sequence>
45+
</xs:complexType>
46+
</xs:element>
47+
48+
<!-- Registry container -->
49+
<xs:element name="registry" minOccurs="0" maxOccurs="1">
50+
<xs:annotation>
51+
<xs:documentation>Custom software registry configuration</xs:documentation>
52+
</xs:annotation>
53+
<xs:complexType>
54+
<xs:sequence>
55+
<xs:element name="software" minOccurs="0" maxOccurs="unbounded">
56+
<xs:annotation>
57+
<xs:documentation>Software configuration entity</xs:documentation>
58+
</xs:annotation>
59+
<xs:complexType>
60+
<xs:sequence>
61+
<xs:element name="repository" minOccurs="0" maxOccurs="unbounded">
62+
<xs:annotation>
63+
<xs:documentation>Repository configuration</xs:documentation>
64+
</xs:annotation>
65+
<xs:complexType>
66+
<xs:attribute name="type" type="xs:string" default="github">
67+
<xs:annotation>
68+
<xs:documentation>Repository type identifier</xs:documentation>
69+
</xs:annotation>
70+
</xs:attribute>
71+
<xs:attribute name="uri" type="xs:string" use="required">
72+
<xs:annotation>
73+
<xs:documentation>Repository URI identifier</xs:documentation>
74+
</xs:annotation>
75+
</xs:attribute>
76+
<xs:attribute name="asset-pattern" type="xs:string" default="/^.*$/">
77+
<xs:annotation>
78+
<xs:documentation>Regular expression pattern to match assets</xs:documentation>
79+
</xs:annotation>
80+
</xs:attribute>
81+
</xs:complexType>
82+
</xs:element>
83+
<xs:element name="binary" minOccurs="0" maxOccurs="unbounded">
84+
<xs:annotation>
85+
<xs:documentation>Binary configuration</xs:documentation>
86+
</xs:annotation>
87+
<xs:complexType>
88+
<xs:attribute name="name" type="xs:string" use="required">
89+
<xs:annotation>
90+
<xs:documentation>Binary executable name</xs:documentation>
91+
</xs:annotation>
92+
</xs:attribute>
93+
<xs:attribute name="pattern" type="xs:string">
94+
<xs:annotation>
95+
<xs:documentation>Regular expression pattern to match binary file during extraction</xs:documentation>
96+
</xs:annotation>
97+
</xs:attribute>
98+
<xs:attribute name="version-command" type="xs:string">
99+
<xs:annotation>
100+
<xs:documentation>Command argument to check binary version (e.g. "--version")</xs:documentation>
101+
</xs:annotation>
102+
</xs:attribute>
103+
</xs:complexType>
104+
</xs:element>
105+
<xs:element name="file" minOccurs="0" maxOccurs="unbounded">
106+
<xs:annotation>
107+
<xs:documentation>File configuration</xs:documentation>
108+
</xs:annotation>
109+
<xs:complexType>
110+
<xs:attribute name="pattern" type="xs:string" default="/^.*$/">
111+
<xs:annotation>
112+
<xs:documentation>Regular expression pattern to match files</xs:documentation>
113+
</xs:annotation>
114+
</xs:attribute>
115+
<xs:attribute name="rename" type="xs:string">
116+
<xs:annotation>
117+
<xs:documentation>Rename found file to this value with the same extension</xs:documentation>
118+
</xs:annotation>
119+
</xs:attribute>
120+
<xs:attribute name="extract-path" type="xs:string">
121+
<xs:annotation>
122+
<xs:documentation>Directory where to extract files</xs:documentation>
123+
</xs:annotation>
124+
</xs:attribute>
125+
</xs:complexType>
126+
</xs:element>
127+
</xs:sequence>
128+
<xs:attribute name="name" type="xs:string" use="required">
129+
<xs:annotation>
130+
<xs:documentation>Software package name</xs:documentation>
131+
</xs:annotation>
132+
</xs:attribute>
133+
<xs:attribute name="alias" type="xs:string">
134+
<xs:annotation>
135+
<xs:documentation>CLI command alias</xs:documentation>
136+
</xs:annotation>
137+
</xs:attribute>
138+
<xs:attribute name="homepage" type="xs:string">
139+
<xs:annotation>
140+
<xs:documentation>Official software homepage URL</xs:documentation>
141+
</xs:annotation>
142+
</xs:attribute>
143+
<xs:attribute name="description" type="xs:string">
144+
<xs:annotation>
145+
<xs:documentation>Short description of the software</xs:documentation>
146+
</xs:annotation>
147+
</xs:attribute>
148+
</xs:complexType>
149+
</xs:element>
150+
</xs:sequence>
151+
<xs:attribute name="overwrite" type="xs:boolean" default="false">
152+
<xs:annotation>
153+
<xs:documentation>Replace the built-in software collection with custom ones</xs:documentation>
154+
</xs:annotation>
155+
</xs:attribute>
156+
</xs:complexType>
157+
</xs:element>
158+
</xs:sequence>
159+
<xs:attribute name="temp-dir" type="xs:string">
160+
<xs:annotation>
161+
<xs:documentation>Temporary directory for downloads</xs:documentation>
162+
</xs:annotation>
163+
</xs:attribute>
164+
</xs:complexType>
165+
</xs:element>
166+
</xs:schema>

psalm-baseline.xml

-4
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,8 @@
219219
<code><![CDATA[$softwareArray]]></code>
220220
</MixedArgument>
221221
<MixedAssignment>
222-
<code><![CDATA[$json]]></code>
223222
<code><![CDATA[$softwareArray]]></code>
224223
</MixedAssignment>
225-
<PossiblyFalseArgument>
226-
<code><![CDATA[\file_get_contents(Info::ROOT_DIR . '/resources/software.json')]]></code>
227-
</PossiblyFalseArgument>
228224
</file>
229225
<file src="src/Module/Repository/Collection/CompositeRepository.php">
230226
<InvalidArgument>

resources/prompts.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ $schema: 'https://raw.githubusercontent.com/context-hub/generator/refs/heads/mai
44

55
import:
66
- path: ./prompts/cover-class-by-docs.yaml
7+
- path: ./prompts/xml-json-schema-update.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
3+
$schema: 'https://raw.githubusercontent.com/context-hub/generator/refs/heads/main/json-schema.json'
4+
5+
prompts:
6+
- id: xml-json-schema-update
7+
description: Update XML and JSON schema for DLOAD config files
8+
messages:
9+
- role: user
10+
content: |
11+
Look at `dload.xml`. It's an example of a DLOAD XML config file.
12+
13+
1. Need to sync `dload.xsd` wit the `dload.xml` file and configs from `src/Module/Common/Config` folder.
14+
Read all of them and update the `dload.xsd` file.
15+
2. If there are any changes in the XML schema, update the `resources/software.schema.json` that
16+
describes the `software` section of the DLOAD XML config file but for json format.

0 commit comments

Comments
 (0)