Skip to content

Commit 3e6cf4e

Browse files
authored
Sync with guidemaker-ember-template (#9)
* Sync with guidemaker-ember-template. WIP * Add volta * Show TOC open by default * put groupings back in * Fix dependencies and tests * update node versions * update travis.yml * linting fixes * Update error template * Simplify error page * update ember-composable-helpers
1 parent 87fa6ea commit 3e6cf4e

59 files changed

Lines changed: 13012 additions & 8143 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ language: node_js
33
node_js:
44
# we recommend testing addons with the same minimum supported node version as Ember CLI
55
# so that your addon works for all apps
6-
- "6"
6+
- "10"
77

88
sudo: false
99
dist: trusty
@@ -15,10 +15,17 @@ cache:
1515
directories:
1616
- $HOME/.npm
1717

18+
branches:
19+
only:
20+
- master
21+
# npm version tags
22+
- /^v\d+\.\d+\.\d+/
23+
1824
env:
1925
global:
2026
# See https://git.io/vdao3 for details.
2127
- JOBS=1
28+
- PERCY_ENABLE=0 # disable percy by default
2229

2330
branches:
2431
only:
@@ -36,26 +43,24 @@ jobs:
3643

3744
- stage: "Tests"
3845
name: "Tests"
46+
env:
47+
- RUN_PERCY_TESTS=true
48+
- PERCY_ENABLE=1
3949
script:
50+
- npm run lint:hbs
4051
- npm run lint:js
4152
- npm test
4253

4354
# we recommend new addons test the current and previous LTS
4455
# as well as latest stable release (bonus points to beta/canary)
4556
- stage: "Additional Tests"
46-
env: EMBER_TRY_SCENARIO=ember-lts-2.12
47-
- env: EMBER_TRY_SCENARIO=ember-lts-2.16
48-
- env: EMBER_TRY_SCENARIO=ember-lts-2.18
49-
- env: EMBER_TRY_SCENARIO=ember-lts-3.4
57+
env: EMBER_TRY_SCENARIO=ember-lts-3.4
58+
- env: EMBER_TRY_SCENARIO=ember-lts-3.8
59+
- env: EMBER_TRY_SCENARIO=ember-lts-3.12
5060
- env: EMBER_TRY_SCENARIO=ember-release
5161
- env: EMBER_TRY_SCENARIO=ember-beta
5262
- env: EMBER_TRY_SCENARIO=ember-canary
5363
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
5464

55-
before_install:
56-
- npm config set spin false
57-
- npm install -g npm@4
58-
- npm --version
59-
6065
script:
61-
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
66+
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO

addon/components/info-banner.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Component from '@ember/component';
2+
import layout from '../templates/components/info-banner';
3+
4+
import { getOwner } from '@ember/application';
5+
6+
export default Component.extend({
7+
layout,
8+
tagName: '',
9+
init() {
10+
this._super(...arguments);
11+
const config = getOwner(this).resolveRegistration('config:environment');
12+
this.config = config[this.configName];
13+
},
14+
});

addon/helpers/html-safe.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { helper } from '@ember/component/helper';
2+
import { htmlSafe } from '@ember/string';
3+
4+
export function htmlSafeHelper(params) {
5+
return htmlSafe(params.join(''))
6+
}
7+
8+
export default helper(htmlSafeHelper);

addon/helpers/includes.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { helper } from "@ember/component/helper";
2+
3+
export function includes([collection, item] /*, hash*/) {
4+
return (collection || []).includes(item);
5+
}
6+
7+
export default helper(includes);

addon/initializers/regiser-showdown-extenions.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

addon/styles/_info-banner.scss

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
$dusty-blue: #1e719b;
2+
$white: #fdfdfd;
3+
4+
.info-banner-wrapper {
5+
background-color: $dusty-blue;
6+
color: $white;
7+
text-align: center;
8+
line-height: 1.5;
9+
padding-top: 10px;
10+
padding-bottom: 10px;
11+
font-size: 100%;
12+
border-bottom: 1px solid #e5dbd6;
13+
strong {
14+
font-weight: bold;
15+
}
16+
a {
17+
text-decoration: underline;
18+
color: $white;
19+
}
20+
21+
&.hidden {
22+
display: none;
23+
}
24+
25+
p {
26+
margin: 0;
27+
}
28+
}
29+
.info-banner-container {
30+
width: 960px;
31+
margin: auto;
32+
}
33+
34+
@media (max-width: 53.75rem) {
35+
.info-banner-container {
36+
width: inherit;
37+
line-height: 1.5;
38+
padding: 0.8rem 1rem;
39+
}
40+
}

addon/styles/addon.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ article.x404 img {
13351335
@import 'table-of-contents';
13361336

13371337
.old-version-warning {
1338-
background-color: #dd6a58;
1338+
background-color: #333;
13391339
color: $white;
13401340
padding: 0.5em;
13411341
border-radius: 3px;
@@ -1348,7 +1348,7 @@ article.x404 img {
13481348
font-size: 12px;
13491349
color: $white;
13501350
padding: 0.3em 0.8em;
1351-
background-color: #e69082;
1351+
background-color: #555;
13521352
border-radius: 3px;
13531353
}
13541354

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{#if config}}
2+
<div class="info-banner-wrapper">
3+
<div class="info-banner-container">
4+
{{markdown-to-html config.content}}
5+
</div>
6+
</div>
7+
{{/if}}

addon/templates/components/search-input.hbs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{#if searchFunction}}
1+
{{!-- {{#if searchFunction}}
22
<input
33
id='search-input'
44
type='search'
@@ -8,7 +8,6 @@
88
autocomplete="off"
99
>
1010
11-
{{!-- Search results dropdown --}}
1211
{{#ember-tether
1312
target='#search-input'
1413
targetAttachment='bottom right'
@@ -39,4 +38,4 @@
3938
</span>
4039
{{/if}}
4140
{{/ember-tether}}
42-
{{/if}}
41+
{{/if}} --}}

app/components/chapter-links.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
11
import Component from '@ember/component';
2-
import { get, computed } from '@ember/object';
32
import { inject as service } from '@ember/service';
43

54
export default Component.extend({
65
tagName: 'footer',
76

87
page: service(),
9-
10-
nextSectionPage: computed('page.nextSection.pages.[]', function() {
11-
let pages = get(this, 'page.nextSection.pages');
12-
13-
if(pages && pages.length) {
14-
return pages[0];
15-
}
16-
}),
17-
previousSectionPage: computed('page.previousSection.pages.[]', function() {
18-
let pages = get(this, 'page.previousSection.pages');
19-
20-
if(pages && pages.length) {
21-
return pages[pages.length - 1];
22-
}
23-
})
248
});

0 commit comments

Comments
 (0)