Skip to content

Commit

Permalink
chore: add handlebars linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-north committed Nov 11, 2018
1 parent 88873da commit 06c53c9
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 64 deletions.
67 changes: 31 additions & 36 deletions .travis.yml
Expand Up @@ -2,13 +2,8 @@ language: node_js
node_js:
- 8

sudo: required
sudo: false
dist: trusty
addons:
chrome: stable
before_script:
- 'sudo chown root /opt/google/chrome/chrome-sandbox'
- 'sudo chmod 4755 /opt/google/chrome/chrome-sandbox'

cache:
yarn: true
Expand All @@ -18,34 +13,6 @@ env:
# See https://git.io/vdao3 for details.
- JOBS=1

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH

install:
- yarn install --no-lockfile --non-interactive --skip-optional
- yarn global add codecov
script:
- yarn lint:ts
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO & yarn travis-deploy-once "yarn semantic-release"

branches:
except:
- /^v\d+\.\d+\.\d+$/

stages:
- basic test
- additional tests

before_script:
- 'sudo chown root /opt/google/chrome/chrome-sandbox'
- 'sudo chmod 4755 /opt/google/chrome/chrome-sandbox'

after_script:
- codecov

jobs:
fail_fast: true
allow_failures:
Expand All @@ -58,15 +25,43 @@ jobs:
name: 'Tests'
install:
- yarn install --non-interactive
script:
- yarn lint:ts
- yarn lint:hbs
- ember test

- name: 'Floating Dependencies'
script:
- ember test

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- stage: 'Additional Tests'
node_js: 10
env: EMBER_TRY_SCENARIO=ember-lts-2.16
env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
- stage: 'Canary Tests'
script:
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
env: EMBER_TRY_SCENARIO=ember-canary

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH

install:
- yarn install --no-lockfile --non-interactive
- npm install -g codecov

before_script:
- 'sudo chown root /opt/google/chrome/chrome-sandbox'
- 'sudo chmod 4755 /opt/google/chrome/chrome-sandbox'

script:
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO && yarn travis-deploy-once "yarn semantic-release"

after_script:
- codecov
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -9,8 +9,9 @@
"scripts": {
"build": "ember build",
"lint:ts": "tslint --project .",
"lint:hbs": "ember-template-lint .",
"start": "ember server",
"test": "ember try:each",
"test": "ember test",
"travis-deploy-once": "travis-deploy-once",
"semantic-release": "semantic-release",
"prepublishOnly": "ember ts:precompile",
Expand Down Expand Up @@ -60,6 +61,7 @@
"ember-resolver": "5.0.1",
"ember-source": "3.5.1",
"ember-source-channel-url": "1.1.0",
"ember-cli-template-lint": "^1.0.0-beta.1",
"ember-try": "1.1.0",
"husky": "1.1.3",
"json-typescript": "1.1.0",
Expand Down
9 changes: 8 additions & 1 deletion tests/dummy/app/templates/application.hbs
Expand Up @@ -4,7 +4,14 @@
<h2 id="title">Ember api actions</h2>
</div>
<div class="col m4 s12">
<a href="https://github.com/truenorth/ember-api-actions" class="btn btn-flat black white-text m-t-40" target="_blank">Go to Github</a>
<a
rel="noopener"
href="https://github.com/truenorth/ember-api-actions"
class="btn btn-flat black white-text m-t-40"
target="_blank"
>
Go to Github
</a>
</div>
</div>

Expand Down
69 changes: 45 additions & 24 deletions tests/dummy/app/templates/index.hbs
Expand Up @@ -2,37 +2,58 @@
<div class="col m6 s12">
<h4>API actions on an individual resource</h4>
{{#each model as |fruit|}}
<p class='fruit-thing' id='{{fruit.name}}'>
{{#x-btn class='ripen-instance-button yellow' click=(action 'ripenFruit' fruit)}}Ripen{{/x-btn}} {{#x-btn
class='info-instance-button
indigo white-text' click=(action 'fruitInfo' fruit)}}Info{{/x-btn}}
<p class="fruit-thing" id={{fruit.name}}>
{{#x-btn
class="ripen-instance-button yellow"
click=(action "ripenFruit" fruit)
}}
Ripen
{{/x-btn}}
{{#x-btn
class="info-instance-button indigo white-text"
click=(action "fruitInfo" fruit)
}}
Info
{{/x-btn}}

<div data-test-fruit-name={{fruit.name}}>
{{fruit.name}}
</div>
<div data-test-fruit-name={{fruit.name}}>
{{fruit.name}}
</div>

{{#x-btn class='eat-instance-button yellow' click=(action 'eatFruit' fruit)}}Eat{{/x-btn}}
</p>
{{#x-btn class="eat-instance-button yellow" click=(action "eatFruit" fruit)}}Eat{{/x-btn}}
</p>
{{/each}}
<h4>API action on a collection of resources</h4>
<p class='all-fruit'>
<p class="all-fruit">
{{content.constructor.modelName}}
{{#x-btn class='ripen-type-button yellow'
click=(action 'ripenAllFruit' (first-in-array
(or content model)))}}
Ripen All
{{#x-btn
class="ripen-type-button yellow"
click=(action "ripenAllFruit" (first-in-array (or content model)))
}}
Ripen All
{{/x-btn}}
{{#x-btn class='fresh-type-button indigo white-text' click=(action 'getAllFreshFruit'
(first-in-array (or content model))) }}
Get Fresh
{{#x-btn
class="fresh-type-button indigo white-text"
click=(action "getAllFreshFruit"
(first-in-array (or content model)))
}}
Get Fresh
{{/x-btn}}
{{#x-btn class='fresh-type-button indigo white-text' click=(action 'juiceAllFruit'
(first-in-array (or content model))) }}
Juice Everything
{{#x-btn
class="fresh-type-button indigo white-text"
click=(action "juiceAllFruit"
(first-in-array (or content model)))
}}
Juice Everything
{{/x-btn}}

{{#x-btn class='eat-all-button indigo white-text' click=(action 'eatAll'
(first-in-array (or content model))) }}Eat all{{/x-btn}}
{{#x-btn
class="eat-all-button indigo white-text"
click=(action "eatAll"
(first-in-array (or content model)))
}}
Eat all
{{/x-btn}}
</p>
</div>
<div class="col m6 s12">
Expand All @@ -45,8 +66,8 @@
<div class="row">
<div class="col s12">
<b>app/models/fruit.js</b>
{{code-snippet name='fruit-model.js'}}
{{code-snippet name="fruit-model.js"}}
<b>app/controllers/index.js</b>
{{code-snippet name='controller.js'}}
{{code-snippet name="controller.js"}}
</div>
</div>
107 changes: 105 additions & 2 deletions yarn.lock
Expand Up @@ -905,18 +905,57 @@
camelcase "^5.0.0"
prettier "^1.13.7"

"@glimmer/compiler@^0.36.2":
version "0.36.5"
resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.36.5.tgz#ea2ac9aa1a5c3ada7f8d93cd295fdc14f1c1ccc4"
integrity sha512-C6fs3uejZwxB32c+XSmMvu3r4oesLILETRQcd+LKazY9YdCUy8S4QfnSdCW/gnfEmtB0qgLTxyMiHqMpzT9KHw==
dependencies:
"@glimmer/interfaces" "^0.36.5"
"@glimmer/syntax" "^0.36.5"
"@glimmer/util" "^0.36.5"
"@glimmer/wire-format" "^0.36.5"

"@glimmer/di@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@glimmer/di/-/di-0.2.0.tgz#73bfd4a6ee4148a80bf092e8a5d29bcac9d4ce7e"
integrity sha1-c7/Upu5BSKgL8JLopdKbysnUzn4=

"@glimmer/interfaces@^0.36.5":
version "0.36.5"
resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.36.5.tgz#b9ef4a6756745dc41927ab01d6c23cdf7ece4158"
integrity sha512-IhoGEP0Awe9bTOMcLF9dUgEV3xguI6m2vFer7SHYX1vuugthA6NEJb83hqUe9FqOd1cNxJE8nAsX0JInx8gn+A==
dependencies:
"@glimmer/wire-format" "^0.36.5"

"@glimmer/resolver@^0.4.1":
version "0.4.2"
resolved "https://registry.yarnpkg.com/@glimmer/resolver/-/resolver-0.4.2.tgz#60c9b492e90bc3956ac82b3134649bd337e1651c"
integrity sha512-OYOSn2qKPMWRTrInu4W7Ilx2q4+mFfeKS8o8SCWdGN6q/9LnRUvN3vfiAEEfpgoMSvEr8TSGw6/b2WSLWoYAAA==
dependencies:
"@glimmer/di" "^0.2.0"

"@glimmer/syntax@^0.36.5":
version "0.36.5"
resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.36.5.tgz#603099a0bf2019dc497e3b858eb6fc84abda805a"
integrity sha512-62BcnXtej4oBEMYSCBezSCOvlZ+1gLAJ/zVXwDgTmin56wKUL2bChScw332OeIL+brvcExAlwZ/hB1UoldMgwQ==
dependencies:
"@glimmer/interfaces" "^0.36.5"
"@glimmer/util" "^0.36.5"
handlebars "^4.0.6"
simple-html-tokenizer "^0.5.6"

"@glimmer/util@^0.36.5":
version "0.36.5"
resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.36.5.tgz#829f393ef0bf791df5b287f104f0fd76e456182c"
integrity sha512-RcDsxxuKGnIc6Ro6wZGFMUZ/E8L3Rbcd5E5F2WOSa59RYHel146fhQtctGrpGxQUZwfxMEMs91GJIaKeukd84g==

"@glimmer/wire-format@^0.36.5":
version "0.36.5"
resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.36.5.tgz#6713c95fbdc23c2e4dcc946e16452ded5cc17447"
integrity sha512-wt+H4iNsGPkW/b/POP21DmTM4cYYYcDmaI54RkEgtMRoeBP6hyi7Y4awbRPMWal6QKIxFepMUY4vnbq345m00w==
dependencies:
"@glimmer/util" "^0.36.5"

"@marionebl/sander@^0.6.0":
version "0.6.1"
resolved "https://registry.yarnpkg.com/@marionebl/sander/-/sander-0.6.1.tgz#1958965874f24bc51be48875feb50d642fc41f7b"
Expand Down Expand Up @@ -2713,6 +2752,24 @@ broccoli-concat@^3.5.1:
lodash.uniq "^4.2.0"
walk-sync "^0.3.2"

broccoli-concat@^3.7.1:
version "3.7.3"
resolved "https://registry.yarnpkg.com/broccoli-concat/-/broccoli-concat-3.7.3.tgz#0dca01311567ffb13180e6b4eb111824628e4885"
integrity sha512-2Ma9h81EJ0PRb9n4sW0i8KZlcnpTQfKxcj87zvi5DFe1fd8CTDEdseHDotK2beuA2l+LbgVPfd8EHaBJKm/Y8g==
dependencies:
broccoli-debug "^0.6.5"
broccoli-kitchen-sink-helpers "^0.3.1"
broccoli-plugin "^1.3.0"
ensure-posix-path "^1.0.2"
fast-sourcemap-concat "^1.4.0"
find-index "^1.1.0"
fs-extra "^4.0.3"
fs-tree-diff "^0.5.7"
lodash.merge "^4.3.1"
lodash.omit "^4.1.0"
lodash.uniq "^4.2.0"
walk-sync "^0.3.2"

broccoli-config-loader@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/broccoli-config-loader/-/broccoli-config-loader-1.0.1.tgz#d10aaf8ebc0cb45c1da5baa82720e1d88d28c80a"
Expand Down Expand Up @@ -4585,6 +4642,23 @@ ember-cli-string-utils@^1.0.0, ember-cli-string-utils@^1.1.0:
resolved "https://registry.yarnpkg.com/ember-cli-string-utils/-/ember-cli-string-utils-1.1.0.tgz#39b677fc2805f55173735376fcef278eaa4452a1"
integrity sha1-ObZ3/CgF9VFzc1N2/O8njqpEUqE=

ember-cli-template-lint@^1.0.0-beta.1:
version "1.0.0-beta.2"
resolved "https://registry.yarnpkg.com/ember-cli-template-lint/-/ember-cli-template-lint-1.0.0-beta.2.tgz#0ebd2f8c1f9ca47f9ee3b42755d66262440c14f6"
integrity sha512-i37mJhz+dll7eP/Y3Yh8oLw5aRqfdnIiutqdLsrvTSLb4VphDXbujXCO8XravvZtGeGBVYKXGsjTxobbPXgsgw==
dependencies:
aot-test-generators "^0.1.0"
broccoli-concat "^3.7.1"
broccoli-persistent-filter "^1.4.3"
chalk "^2.4.1"
debug "^3.1.0"
ember-cli-version-checker "^2.1.2"
ember-template-lint "^1.0.0-beta.5"
json-stable-stringify "^1.0.1"
md5-hex "^2.0.0"
strip-ansi "^4.0.0"
walk-sync "^0.3.3"

ember-cli-test-info@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/ember-cli-test-info/-/ember-cli-test-info-1.0.0.tgz#ed4e960f249e97523cf891e4aed2072ce84577b4"
Expand Down Expand Up @@ -4934,6 +5008,18 @@ ember-source@3.5.1:
jquery "^3.3.1"
resolve "^1.6.0"

ember-template-lint@^1.0.0-beta.5:
version "1.0.0-beta.6"
resolved "https://registry.yarnpkg.com/ember-template-lint/-/ember-template-lint-1.0.0-beta.6.tgz#a49d6a37beb3fd7bdae17472efc8ec298d739aa9"
integrity sha512-QeP0GB0oFLvtZXszCTHILlHO5RdVybkdhFdoXSST7IdJHdSIourYjhtgkVVdpw9SOP2SV4xLLTev/tXfNyNZXQ==
dependencies:
"@glimmer/compiler" "^0.36.2"
chalk "^2.0.0"
globby "^8.0.1"
minimatch "^3.0.4"
resolve "^1.1.3"
strip-bom "^3.0.0"

ember-try-config@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ember-try-config/-/ember-try-config-3.0.0.tgz#012d8c90cae9eb624e2b62040bf7e76a1aa58edc"
Expand Down Expand Up @@ -6265,7 +6351,7 @@ growly@^1.3.0:
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=

handlebars@^4.0.11:
handlebars@^4.0.11, handlebars@^4.0.6:
version "4.0.12"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5"
integrity sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==
Expand Down Expand Up @@ -8311,6 +8397,18 @@ matcher-collection@^1.0.0, matcher-collection@^1.0.4, matcher-collection@^1.0.5:
dependencies:
minimatch "^3.0.2"

md5-hex@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-2.0.0.tgz#d0588e9f1c74954492ecd24ac0ac6ce997d92e33"
integrity sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=
dependencies:
md5-o-matic "^0.1.1"

md5-o-matic@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3"
integrity sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=

mdurl@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"
Expand Down Expand Up @@ -10436,7 +10534,7 @@ resolve@1.5.0:
dependencies:
path-parse "^1.0.5"

resolve@^1.1.6, resolve@^1.2.0, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.6.0, resolve@^1.8.1:
resolve@^1.1.3, resolve@^1.1.6, resolve@^1.2.0, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.6.0, resolve@^1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26"
integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==
Expand Down Expand Up @@ -10899,6 +10997,11 @@ silent-error@^1.0.0, silent-error@^1.0.1, silent-error@^1.1.0:
dependencies:
debug "^2.2.0"

simple-html-tokenizer@^0.5.6:
version "0.5.7"
resolved "https://registry.yarnpkg.com/simple-html-tokenizer/-/simple-html-tokenizer-0.5.7.tgz#8eca336ecfbe2b3c6166cbb31b2682088de79f40"
integrity sha512-APW9iYbkJ5cijjX4Ljhf3VG8SwYPUJT5gZrwci/wieMabQxWFiV5VwsrP5c6GMRvXKEQMGkAB1d9dvW66dTqpg==

slash@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
Expand Down

0 comments on commit 06c53c9

Please sign in to comment.