Skip to content

Commit a60e3b5

Browse files
authored
Dev (#1)
* Start working on GH action * Prepare and test the GH action
1 parent 9505245 commit a60e3b5

File tree

4 files changed

+118
-5
lines changed

4 files changed

+118
-5
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish to VS Code Marketplace
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish-extension:
9+
runs-on: ubuntu-latest
10+
if: github.repository_owner == 'webredone' && github.event.release.target_commitish == 'main'
11+
12+
steps:
13+
- name: Check Out Repository
14+
uses: actions/checkout@v3
15+
16+
- name: Setup Node.js environment
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '20.10.0'
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
- name: Install Dependencies
23+
run: npm install
24+
25+
- name: Package Extension
26+
run: npx vsce package
27+
28+
- name: Publish Extension
29+
run: npx vsce publish -p ${{ secrets.VS_MARKETPLACE_PAT }}
30+
env:
31+
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_PAT }}

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ No known issues at this time. If you encounter any problems, please report them
2929

3030
Keep an eye on this section for updates and release notes for new versions of the extension.
3131

32-
### 1.0.0
32+
### 0.0.1
3333

3434
Initial release of theme-redone-snippets-wordpress.
3535

3636
---
3737

38+
### 0.0.2
39+
40+
Testing the automation via GitHub actions.
41+
42+
---
43+
3844
**Enjoy using theme-redone-snippets-wordpress for your Gutenberg WordPress development!**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "theme-redone-snippets-wordpress",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"displayName": "Theme Redone Snippets (WordPress)",
55
"description": "A VS Code extension providing efficient ThemeRedone snippets for rapid Gutenberg WordPress theme development.",
66
"homepage": "https://webredone.com/theme-redone/",

snippets/snippets.code-snippets

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
// Theme Redone WordPress snippets
2+
// Theme Redone snippets
33

44
"trb:text": {
55
"scope": "json",
@@ -244,7 +244,83 @@
244244
"\t}",
245245
"}"
246246
],
247-
"description": "This snippet of code will generate a Video Selector. The field name will be video_field_name, its label will be “Video” and by default, it won’t have a selected video."
247+
"description": "This snippet of code will generate a CTA control. The field name will be “link_field_name”, its label will be “Link” and it will be empty by default."
248+
},
249+
250+
"trb:objectselector": {
251+
"scope": "json",
252+
"prefix": "trbs:objectselector",
253+
"body": [
254+
"\"${1:object_field_name}\": {",
255+
"\t\"type\": \"object\",",
256+
"\t\"field_meta\": {",
257+
"\t\t\"object_type\": \"${2|post,term|}\",",
258+
"\t\t\"objects\": [\"${3:posts}\"],",
259+
"\t\t\"type\": \"object_selector\",",
260+
"\t\t\"label\": \"${4:Post}\"",
261+
"\t},",
262+
"\t\"default\": {",
263+
"\t\t\"id\": ${5:null},",
264+
"\t\t\"title\": \"${6}\"",
265+
"\t}",
266+
"}"
267+
],
268+
"description": "This snippet of code will generate an object_selector control. The field name will be “object_field_name”, its label will be “Post” and it will not have anything selected by default. This particular example will make it possible for us to search for, and select one post of the “post” post type."
248269
},
249270

250-
}
271+
"trb:repeater": {
272+
"scope": "json",
273+
"prefix": "trbs:repeater",
274+
"body": [
275+
"\"${1:repeater_field_name}\": {",
276+
"\t\"type\": \"array\",",
277+
"\t\"field_meta\": {",
278+
"\t\t\"type\": \"repeater\",",
279+
"\t\t\"label\": \"${2:Fields}\",",
280+
"\t\t\"subfields\": {",
281+
"\t\t\t\"title\": {",
282+
"\t\t\t\t\"type\": \"object\",",
283+
"\t\t\t\t\"field_meta\": {",
284+
"\t\t\t\t\t\"type\": \"text\",",
285+
"\t\t\t\t\t\"label\": \"Title\"",
286+
"\t\t\t\t},",
287+
"\t\t\t\t\"default\": {",
288+
"\t\t\t\t\t\"text\": \"\"",
289+
"\t\t\t\t}",
290+
"\t\t\t},",
291+
"\t\t\t\"cta\": {",
292+
"\t\t\t\t\"type\": \"object\",",
293+
"\t\t\t\t\"field_meta\": {",
294+
"\t\t\t\t\t\"type\": \"cta\",",
295+
"\t\t\t\t\t\"label\": \"CTA\"",
296+
"\t\t\t\t},",
297+
"\t\t\t\t\"default\": {",
298+
"\t\t\t\t\t\"title\": \"\",",
299+
"\t\t\t\t\t\"url\": \"\",",
300+
"\t\t\t\t\t\"target\": false",
301+
"\t\t\t\t}",
302+
"\t\t\t},",
303+
"\t\t\t\"image\": {",
304+
"\t\t\t\t\"type\": \"object\",",
305+
"\t\t\t\t\"field_meta\": {",
306+
"\t\t\t\t\t\"type\": \"image\",",
307+
"\t\t\t\t\t\"label\": \"Image\"",
308+
"\t\t\t\t},",
309+
"\t\t\t\t\"default\": {",
310+
"\t\t\t\t\t\"src\": \"\",",
311+
"\t\t\t\t\t\"id\": null",
312+
"\t\t\t\t}",
313+
"\t\t\t}",
314+
"\t\t}",
315+
"\t},",
316+
"\t\"default\": []",
317+
"}"
318+
],
319+
"description": "
320+
This snippet of code will generate a repeater control. The field name will be “repeater_field_name”, its label will be “Fields” and it will be empty by default. The repeater will have three subfields: title, cta and image. The title will be a text field, the cta will be a CTA control and the image will be an Image Selector. --- It is also possible to use repeater fields inside repeater fields. This way, we can create nested repeaters. This is useful for creating complex data structures. But, only one level deep."
321+
},
322+
323+
}
324+
325+
326+

0 commit comments

Comments
 (0)