Skip to content

Get started #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Apr 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: CI

on:
push:
branches:
- main
paths-ignore: # dont run when changes made to these folders
- '.vscode/**'
pull_request: {}
workflow_dispatch:

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm prettier . --check

package:
name: Package
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3

- name: fetch all history and tags from all branches for gitversion
run: git fetch --prune --unshallow

- name: DotNet Core SDK 3.1.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: install gitversion tool
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.5.x'
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'

- name: execute gitversion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'

- name: print gitversion
run: |
echo "Major: ${{ steps.gitversion.outputs.major }}"
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"

- name: update metadata in package.json
uses: onlyutkarsh/[email protected]
with:
files: '${{github.workspace}}/package.json'
patch-syntax: |
= /version => "${{ steps.gitversion.outputs.majorMinorPatch }}"

- name: add version in CHANGELOG.md
uses: cschleiden/[email protected]
with:
files: '${{github.workspace}}/CHANGELOG.md'
env:
VERSION: "${{ steps.gitversion.outputs.majorMinorPatch }}"

- name: compile and create vsix
run: pnpm vs:package

- name: upload vsix as artifact
uses: actions/upload-artifact@v4
with:
name: vscode-ember-${{steps.gitversion.outputs.majorMinorPatch}}.vsix
path: ${{github.workspace}}/vscode-ember-${{steps.gitversion.outputs.majorMinorPatch}}.vsix

- name: create a release
if: github.ref == 'refs/heads/main'
continue-on-error: false
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v${{ steps.gitversion.outputs.semVer }}
release_name: v${{ steps.gitversion.outputs.semVer }}

- name: publish to marketplace VSCODE
if: github.ref == 'refs/heads/main'
env:
VSCODE_TOKEN: ${{ secrets.VSCODE_TOKEN }}
run: pnpm vs:publish:ci
continue-on-error: true

- name: publish to marketplace OPEN VSX
if: github.ref == 'refs/heads/main'
env:
OPENVSX_TOKEN: ${{ secrets.OPENVSX_TOKEN }}
run: pnpm ov:publish:ci
continue-on-error: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
*.vsix
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.yaml
*.yml
*.md
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,40 @@
# snippets
Preconfigured snippets for ember projects
[![Installs](https://vsmarketplacebadges.dev/installs-short/ember-tooling.snippets.svg)](https://marketplace.visualstudio.com/items?itemName=ember-tooling.snippets)
![Downloads](https://vsmarketplacebadges.dev/downloads-short/ember-tooling.snippets.svg)
![Rating](https://vsmarketplacebadges.dev/rating-star/ember-tooling.snippets.svg)

# Snippets for GJS and GTS in VSCode and (neo)vim

Preconfigured snippets for ember projects following Polaris Patterns.

## Important

This extension is optimized for developers that use Ember Polaris patterns and features, which are supported back to ember-source 3.28.
If you need Ember Octane (and earlier) snippets, this snippet pack is not for you.

## Usage

Many snippets will show up in auto-completion prompts as you're typing.
For example,

- `@ser` will have a suggestion for `@service declare $name: $type;`
- `@cach` will have a suggestion for a `@cached` getter.
- `await render` will have a suggestion for the rendering tests' render boilerplate
- etc

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.

- `g-rendering-test`, `g-application-test`, `g-unit-test`
- `g-class-component`, `g-component`
- `g-route`
- `g-route-template`
- `g-service`
- etc


## Debugging

- clone the repo
- cd to the cloned repo
- `pnpm i`
- `pnpm build`
- if using vscode, on the extensions panel, click "Install from VSIX" and select the vsix file generated from `pnpm build`
Binary file added images/ember-e-circle-icon-4c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions images/ember-e-circle-icon-4c.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"name": "ember-snippets",
"publisher": "EmberTooling",
"displayName": "Ember Polaris Snippets - gjs, gts, tests, services, etc",
"description": "Snippets for Ember projects for quickly generating boilerplate",
"icon": "images/ember-e-circle-icon-4c.png",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/ember-tooling/snippets.git"
},
"bugs": {
"url": "https://github.com/ember-tooling/snippets/issues"
},
"homepage": "https://github.com/ember-tooling/snippets#readme",
"version": "0.0.0",
"categories": [
"Snippets"
],
"engines": {
"vscode": ">=1.0.0"
},
"keywords": [
"Ember",
"TypeScript",
"JavaScript",
"Snippets",
"Polaris",
"Tests",
"Testing",
"Services",
"Boilerplate",
"HTML"
],
"contributes": {
"snippets": [
{
"language": [
"Glimmer JS",
"javascript.glimmer",
"Glimmer TS",
"typescript.glimmer",
"javascript",
"typescript"
],
"path": "./snippets/all.json"
},
{
"language": [
"Glimmer JS",
"javascript.glimmer",
"Glimmer TS",
"typescript.glimmer"
],
"path": "./snippets/all-template-tag.json"
},
{
"language": [
"Glimmer JS",
"javascript.glimmer"
],
"path": "./snippets/javascript.glimmer.json"
},
{
"language": [
"Glimmer TS",
"typescript.glimmer"
],
"path": "./snippets/typescript.glimmer.json"
},
{
"language": "javascript",
"path": "./snippets/javascript.json"
},
{
"language": "typescript",
"path": "./snippets/typescript.json"
}
]
},
"scripts": {
"lint:fix": "prettier . --write",
"build": "vsce pack",
"vs:package": "vsce package",
"vs:publish": "vsce publish",
"vs:publish:ci": "vsce publish --pat $VSCODE_TOKEN",
"ov:publish:ci": "ovsx publish --pat $OPENVSX_TOKEN"
},
"devDependencies": {
"@vscode/vsce": "^3.3.2",
"ovsx": "^0.10.1",
"prettier": "^3.5.3"
}
}
Loading
Loading