Skip to content

Commit 545b3ae

Browse files
authored
Merge pull request #1 from ember-tooling/implementation
Get started
2 parents 34aa8d7 + f67aa76 commit 545b3ae

15 files changed

+2506
-2
lines changed

.github/workflows/ci.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore: # dont run when changes made to these folders
8+
- '.vscode/**'
9+
pull_request: {}
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ci-${{ github.head_ref || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
lint:
18+
name: Lint
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 5
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: wyvox/action-setup-pnpm@v3
24+
- run: pnpm prettier . --check
25+
26+
package:
27+
name: Package
28+
runs-on: ubuntu-20.04
29+
timeout-minutes: 10
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: wyvox/action-setup-pnpm@v3
33+
34+
- name: fetch all history and tags from all branches for gitversion
35+
run: git fetch --prune --unshallow
36+
37+
- name: DotNet Core SDK 3.1.0
38+
uses: actions/setup-dotnet@v1
39+
with:
40+
dotnet-version: 3.1.x
41+
42+
- name: install gitversion tool
43+
uses: gittools/actions/gitversion/setup@v0.9
44+
with:
45+
versionSpec: '5.5.x'
46+
env:
47+
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
48+
49+
- name: execute gitversion
50+
id: gitversion # step id used as reference for output values
51+
uses: gittools/actions/gitversion/execute@v0.9.7
52+
env:
53+
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
54+
55+
- name: print gitversion
56+
run: |
57+
echo "Major: ${{ steps.gitversion.outputs.major }}"
58+
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
59+
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
60+
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
61+
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
62+
63+
- name: update metadata in package.json
64+
uses: onlyutkarsh/patch-files-action@v1.0.1
65+
with:
66+
files: '${{github.workspace}}/package.json'
67+
patch-syntax: |
68+
= /version => "${{ steps.gitversion.outputs.majorMinorPatch }}"
69+
70+
- name: add version in CHANGELOG.md
71+
uses: cschleiden/replace-tokens@v1.0
72+
with:
73+
files: '${{github.workspace}}/CHANGELOG.md'
74+
env:
75+
VERSION: "${{ steps.gitversion.outputs.majorMinorPatch }}"
76+
77+
- name: compile and create vsix
78+
run: pnpm vs:package
79+
80+
- name: upload vsix as artifact
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: vscode-ember-${{steps.gitversion.outputs.majorMinorPatch}}.vsix
84+
path: ${{github.workspace}}/vscode-ember-${{steps.gitversion.outputs.majorMinorPatch}}.vsix
85+
86+
- name: create a release
87+
if: github.ref == 'refs/heads/main'
88+
continue-on-error: false
89+
uses: actions/create-release@v1
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
92+
with:
93+
tag_name: v${{ steps.gitversion.outputs.semVer }}
94+
release_name: v${{ steps.gitversion.outputs.semVer }}
95+
96+
- name: publish to marketplace VSCODE
97+
if: github.ref == 'refs/heads/main'
98+
env:
99+
VSCODE_TOKEN: ${{ secrets.VSCODE_TOKEN }}
100+
run: pnpm vs:publish:ci
101+
continue-on-error: true
102+
103+
- name: publish to marketplace OPEN VSX
104+
if: github.ref == 'refs/heads/main'
105+
env:
106+
OPENVSX_TOKEN: ${{ secrets.OPENVSX_TOKEN }}
107+
run: pnpm ov:publish:ci
108+
continue-on-error: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
*.vsix

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.yaml
2+
*.yml
3+
*.md

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,40 @@
1-
# snippets
2-
Preconfigured snippets for ember projects
1+
[![Installs](https://vsmarketplacebadges.dev/installs-short/ember-tooling.snippets.svg)](https://marketplace.visualstudio.com/items?itemName=ember-tooling.snippets)
2+
![Downloads](https://vsmarketplacebadges.dev/downloads-short/ember-tooling.snippets.svg)
3+
![Rating](https://vsmarketplacebadges.dev/rating-star/ember-tooling.snippets.svg)
4+
5+
# Snippets for GJS and GTS in VSCode and (neo)vim
6+
7+
Preconfigured snippets for ember projects following Polaris Patterns.
8+
9+
## Important
10+
11+
This extension is optimized for developers that use Ember Polaris patterns and features, which are supported back to ember-source 3.28.
12+
If you need Ember Octane (and earlier) snippets, this snippet pack is not for you.
13+
14+
## Usage
15+
16+
Many snippets will show up in auto-completion prompts as you're typing.
17+
For example,
18+
19+
- `@ser` will have a suggestion for `@service declare $name: $type;`
20+
- `@cach` will have a suggestion for a `@cached` getter.
21+
- `await render` will have a suggestion for the rendering tests' render boilerplate
22+
- etc
23+
24+
Whole file generating boilerplate, such as for tests are prefixed with `g-` for generate, similar to the ember-cli command's you'd use in the terminal to generate the same file contents.
25+
26+
- `g-rendering-test`, `g-application-test`, `g-unit-test`
27+
- `g-class-component`, `g-component`
28+
- `g-route`
29+
- `g-route-template`
30+
- `g-service`
31+
- etc
32+
33+
34+
## Debugging
35+
36+
- clone the repo
37+
- cd to the cloned repo
38+
- `pnpm i`
39+
- `pnpm build`
40+
- if using vscode, on the extensions panel, click "Install from VSIX" and select the vsix file generated from `pnpm build`

images/ember-e-circle-icon-4c.png

3.64 KB
Loading

images/ember-e-circle-icon-4c.svg

Lines changed: 6 additions & 0 deletions
Loading

package.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"name": "ember-snippets",
3+
"publisher": "EmberTooling",
4+
"displayName": "Ember Polaris Snippets - gjs, gts, tests, services, etc",
5+
"description": "Snippets for Ember projects for quickly generating boilerplate",
6+
"icon": "images/ember-e-circle-icon-4c.png",
7+
"license": "MIT",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/ember-tooling/snippets.git"
11+
},
12+
"bugs": {
13+
"url": "https://github.com/ember-tooling/snippets/issues"
14+
},
15+
"homepage": "https://github.com/ember-tooling/snippets#readme",
16+
"version": "0.0.0",
17+
"categories": [
18+
"Snippets"
19+
],
20+
"engines": {
21+
"vscode": ">=1.0.0"
22+
},
23+
"keywords": [
24+
"Ember",
25+
"TypeScript",
26+
"JavaScript",
27+
"Snippets",
28+
"Polaris",
29+
"Tests",
30+
"Testing",
31+
"Services",
32+
"Boilerplate",
33+
"HTML"
34+
],
35+
"contributes": {
36+
"snippets": [
37+
{
38+
"language": [
39+
"Glimmer JS",
40+
"javascript.glimmer",
41+
"Glimmer TS",
42+
"typescript.glimmer",
43+
"javascript",
44+
"typescript"
45+
],
46+
"path": "./snippets/all.json"
47+
},
48+
{
49+
"language": [
50+
"Glimmer JS",
51+
"javascript.glimmer",
52+
"Glimmer TS",
53+
"typescript.glimmer"
54+
],
55+
"path": "./snippets/all-template-tag.json"
56+
},
57+
{
58+
"language": [
59+
"Glimmer JS",
60+
"javascript.glimmer"
61+
],
62+
"path": "./snippets/javascript.glimmer.json"
63+
},
64+
{
65+
"language": [
66+
"Glimmer TS",
67+
"typescript.glimmer"
68+
],
69+
"path": "./snippets/typescript.glimmer.json"
70+
},
71+
{
72+
"language": "javascript",
73+
"path": "./snippets/javascript.json"
74+
},
75+
{
76+
"language": "typescript",
77+
"path": "./snippets/typescript.json"
78+
}
79+
]
80+
},
81+
"scripts": {
82+
"lint:fix": "prettier . --write",
83+
"build": "vsce pack",
84+
"vs:package": "vsce package",
85+
"vs:publish": "vsce publish",
86+
"vs:publish:ci": "vsce publish --pat $VSCODE_TOKEN",
87+
"ov:publish:ci": "ovsx publish --pat $OPENVSX_TOKEN"
88+
},
89+
"devDependencies": {
90+
"@vscode/vsce": "^3.3.2",
91+
"ovsx": "^0.10.1",
92+
"prettier": "^3.5.3"
93+
}
94+
}

0 commit comments

Comments
 (0)