Skip to content

Commit

Permalink
Dev (#1)
Browse files Browse the repository at this point in the history
* Start working on GH action

* Prepare and test the GH action
  • Loading branch information
nikola-wd authored Dec 12, 2023
1 parent 9505245 commit a60e3b5
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 5 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish-to-marketplace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish to VS Code Marketplace

on:
release:
types: [created]

jobs:
publish-extension:
runs-on: ubuntu-latest
if: github.repository_owner == 'webredone' && github.event.release.target_commitish == 'main'

steps:
- name: Check Out Repository
uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '20.10.0'
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: npm install

- name: Package Extension
run: npx vsce package

- name: Publish Extension
run: npx vsce publish -p ${{ secrets.VS_MARKETPLACE_PAT }}
env:
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_PAT }}
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ No known issues at this time. If you encounter any problems, please report them

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

### 1.0.0
### 0.0.1

Initial release of theme-redone-snippets-wordpress.

---

### 0.0.2

Testing the automation via GitHub actions.

---

**Enjoy using theme-redone-snippets-wordpress for your Gutenberg WordPress development!**
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theme-redone-snippets-wordpress",
"version": "0.0.1",
"version": "0.0.2",
"displayName": "Theme Redone Snippets (WordPress)",
"description": "A VS Code extension providing efficient ThemeRedone snippets for rapid Gutenberg WordPress theme development.",
"homepage": "https://webredone.com/theme-redone/",
Expand Down
82 changes: 79 additions & 3 deletions snippets/snippets.code-snippets
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
// Theme Redone WordPress snippets
// Theme Redone snippets

"trb:text": {
"scope": "json",
Expand Down Expand Up @@ -244,7 +244,83 @@
"\t}",
"}"
],
"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."
"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."
},

"trb:objectselector": {
"scope": "json",
"prefix": "trbs:objectselector",
"body": [
"\"${1:object_field_name}\": {",
"\t\"type\": \"object\",",
"\t\"field_meta\": {",
"\t\t\"object_type\": \"${2|post,term|}\",",
"\t\t\"objects\": [\"${3:posts}\"],",
"\t\t\"type\": \"object_selector\",",
"\t\t\"label\": \"${4:Post}\"",
"\t},",
"\t\"default\": {",
"\t\t\"id\": ${5:null},",
"\t\t\"title\": \"${6}\"",
"\t}",
"}"
],
"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."
},

}
"trb:repeater": {
"scope": "json",
"prefix": "trbs:repeater",
"body": [
"\"${1:repeater_field_name}\": {",
"\t\"type\": \"array\",",
"\t\"field_meta\": {",
"\t\t\"type\": \"repeater\",",
"\t\t\"label\": \"${2:Fields}\",",
"\t\t\"subfields\": {",
"\t\t\t\"title\": {",
"\t\t\t\t\"type\": \"object\",",
"\t\t\t\t\"field_meta\": {",
"\t\t\t\t\t\"type\": \"text\",",
"\t\t\t\t\t\"label\": \"Title\"",
"\t\t\t\t},",
"\t\t\t\t\"default\": {",
"\t\t\t\t\t\"text\": \"\"",
"\t\t\t\t}",
"\t\t\t},",
"\t\t\t\"cta\": {",
"\t\t\t\t\"type\": \"object\",",
"\t\t\t\t\"field_meta\": {",
"\t\t\t\t\t\"type\": \"cta\",",
"\t\t\t\t\t\"label\": \"CTA\"",
"\t\t\t\t},",
"\t\t\t\t\"default\": {",
"\t\t\t\t\t\"title\": \"\",",
"\t\t\t\t\t\"url\": \"\",",
"\t\t\t\t\t\"target\": false",
"\t\t\t\t}",
"\t\t\t},",
"\t\t\t\"image\": {",
"\t\t\t\t\"type\": \"object\",",
"\t\t\t\t\"field_meta\": {",
"\t\t\t\t\t\"type\": \"image\",",
"\t\t\t\t\t\"label\": \"Image\"",
"\t\t\t\t},",
"\t\t\t\t\"default\": {",
"\t\t\t\t\t\"src\": \"\",",
"\t\t\t\t\t\"id\": null",
"\t\t\t\t}",
"\t\t\t}",
"\t\t}",
"\t},",
"\t\"default\": []",
"}"
],
"description": "
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."
},

}



0 comments on commit a60e3b5

Please sign in to comment.