This repository has been archived by the owner on Sep 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Add standard snippets for html import and polymer element definitions #36
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import {ElementSnippet} from './editor-service'; | ||
|
||
const snippets: ElementSnippet[] = [ | ||
{ | ||
'tagname': 'html-import', | ||
'description': 'Template definition of an HTML import.', | ||
'prefix': 'hi', | ||
'expandTo': '<link rel="import" href="bower_components/.html">', | ||
'expandToSnippet': '<link rel="import" href="${1:bower_components}/${2}/${2}.html">' | ||
}, | ||
{ | ||
'tagname': 'tdd-test', | ||
'description': 'Template definition for a TDD test suite', | ||
'prefix': 'tdd-test', | ||
'expandTo': '', | ||
'expandToSnippet': ` | ||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> | ||
<title>$\{1:my-element}</title> | ||
<script src="\${2:bower_components}/webcomponentsjs/webcomponents-lite.js"></script> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a lot of this could be based off the element tagname. i.e. <title>${1:my-element}</title>
...
<link rel="import" href="./$1.html">
...
<test-fixture id="basic">
<template>
<$1></$1>
</template>
</test-fixture>
...
<script>
suite('$1 tests', function() {
...
});
</script> |
||
<script src="\${2:bower_components}/web-component-tester/browser.js"></script> | ||
<link rel="import" href="$3/$\{1:my-element}.html"> | ||
</head> | ||
<body> | ||
<test-fixture id="basic"> | ||
<template> | ||
<$\{1:my-element}><$\{1:my-element}> | ||
</template> | ||
</test-fixture> | ||
<script> | ||
suite('$\{1:my-element} tests', function() { | ||
var element; | ||
setup(function() { | ||
element = fixture('basic'); | ||
}); | ||
test('$6', function() { | ||
$0 | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> | ||
` | ||
} | ||
]; | ||
|
||
export {snippets}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tricky. If it's an app then they'll want
bower_components/
or similar, but if it's a standalone element it should be../
.We really need a signal that lets us tell whether some code is an app or a standalone component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes agreed, shall I extract an issue for that in the CLI? I think adding a line to the
bower.json
stating the type is the cleanest solution?