Skip to content

Commit

Permalink
Merge branch 'master' into bugfix-a11y-header
Browse files Browse the repository at this point in the history
  • Loading branch information
MinThaMie authored May 23, 2022
2 parents db28365 + 7ceefdc commit aea21cb
Show file tree
Hide file tree
Showing 21 changed files with 51,258 additions and 9,738 deletions.
7 changes: 4 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: [
Expand All @@ -15,6 +16,7 @@ module.exports = {
browser: true
},
rules: {
'ember/no-jquery': 'error'
},
globals: {
Prism: true,
Expand All @@ -40,8 +42,7 @@ module.exports = {
'tests/dummy/app/**'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
sourceType: 'script'
},
env: {
browser: false,
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: CI

on:
push:
branches:
- master
- main
- "v*"
pull_request:

env:
NODE_VERSION: 10
FORCE_COLOR: 1

jobs:
lint:
name: Linting
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- run: npm i -g npm@7
- run: npm ci
- run: npm run lint

floating-dependencies:
name: Floating Dependencies
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- run: npm i -g npm@7
- run: npm install --no-package-lock
- run: npm test

test:
name: Tests
runs-on: ubuntu-latest
env:
PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_number }}
PERCY_PARALLEL_TOTAL: 1
PERCY_TOKEN: e01f89bea06d5ccd1207a5cd2799645e4942ecd0d8da739502a206d0fc7392fc
RUN_PERCY_TESTS: true


steps:
- uses: actions/checkout@v2
- uses: mansona/npm-lockfile-version@v1
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- run: npm i -g npm@7
- run: npm ci
- uses: percy/[email protected]
with:
custom-command: npm run test

try-scenarios:
name: "ember-try: ${{ matrix.ember-try-scenario }}"
runs-on: ubuntu-latest
needs: test

strategy:
matrix:
ember-try-scenario:
- 'ember-release'
- 'ember-beta'
- 'ember-canary'
- 'ember-default-with-jquery'

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- run: npm i -g npm@7
- run: npm ci
- name: test
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

/.changelog/
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/.env*
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.template-lintrc.js
/.travis.yml
Expand Down
66 changes: 0 additions & 66 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2.0.0 / 2021-05-06
==================

* Add support for "main" branches in edit URLs #77 from @jenweber
* BREAKING: Fix CI for ember-release and update minimum Ember version #78 from @mansona
* Migrated from Travis to GitHub Actions #57 from @ijlee2
* Updated links to the Ember Guides for filing an issue #49 from @ijlee2
* Fix typo in README #44 from @amyrlam
* don't include removal diff in copy-paste code, fix tests #32 from @jenweber
* Fill in README #34 from @jenweber
* [Fix] Basic Markdown path link #28 from @safirelauene

This Template now requires Ember 3.13 as a minimum version in the host app.

1.2.0 / 2019-05-06
==================
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

## Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint`
* `npm run lint:js -- --fix`

## Running tests

* `npm run test`
* `ember test` – Runs the test suite on the current Ember version
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions
Expand Down
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
[![This project uses GitHub Actions for continuous integration.](https://github.com/ember-learn/guidemaker-ember-template/workflows/CI/badge.svg)](https://github.com/ember-learn/guidemaker-ember-template/actions?query=workflow%3ACI)
[![This project uses Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/Ember/guidemaker-ember-template)

guidemaker-ember-template
==============================================================================

[Short description of the addon.]
This addon provides the general layout and some styles that are used for
[guides.emberjs.com](https://guides.emberjs.com/release).

Its responsibilities include:
- CSS for the sidebar
- HTML markup specifics (i.e. the classes that go on various divs in the text of the
guide itself)

## Related apps

Most aspects of the Guides are styled via
[ember-styleguide](https://github.com/ember-learn/ember-styleguide),
not this repository.

[guidemaker](https://github.com/empress/guidemaker) is what
assembles guides content into queryable records.

[guides-source](https://github.com/ember-learn/guides-source)
has the learning content itself.

Compatibility
------------------------------------------------------------------------------

* Ember.js v3.4 or above
* Ember.js v3.13 or above
* Ember CLI v2.13 or above
* Node.js v8 or above


Installation
Expand All @@ -22,14 +43,30 @@ ember install guidemaker-ember-template
Usage
------------------------------------------------------------------------------

[Longer description of how to use the addon in apps.]
See [guides-source](https://github.com/ember-learn/guides-source)
for an example of how to use this addon.


Contributing
------------------------------------------------------------------------------

See the [Contributing](CONTRIBUTING.md) guide for details.

Releases
------------------------------------------------------------------------------

To release a new version of this addon:

```
git checkout master
git pull origin master
npm install -g np
np
```

This command will run checks and tests, and ask you what version you want
to do the release as (major, minor, patch).

License
------------------------------------------------------------------------------

Expand Down
13 changes: 13 additions & 0 deletions addon/controllers/error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Controller from '@ember/controller';
import { computed } from '@ember/object';

export default Controller.extend({
hasErrors: computed('model.errors.0.status', function() {
if (!this.model || !Array.isArray(this.model.errors) || this.model.errors.length) {
// if there is no error field, skip this
return;
}
let errors = this.model.errors.firstObject.status;
return errors.contains("404") || errors.contains("403");
})
});
7 changes: 6 additions & 1 deletion addon/styles/_prism-overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ code > .diff-deletion {
}
}

code .diff-operator {
// don't include "removed" code when copy-pasting diffs
code .diff-operator,
code .diff-deletion {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}

Expand Down
1 change: 1 addition & 0 deletions app/controllers/error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'guidemaker-ember-template/controllers/error';
4 changes: 2 additions & 2 deletions app/templates/components/guides-article.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

{{#if guidemaker.sourceRepo}}
<a
href="{{guidemaker.sourceRepo}}/edit/master/guides/{{editVersion}}{{model.id}}.md"
href="{{guidemaker.sourceRepo}}/edit/{{or guidemaker.sourceBranch "master"}}/guides/{{editVersion}}{{model.id}}.md"
target="_blank"
class="edit-page icon-pencil"
rel="noopener"
Expand All @@ -24,4 +24,4 @@

{{markdown-to-html model.content extensions="showdown-section-groups"}}

{{chapter-links pages=pages}}
{{chapter-links pages=pages}}
6 changes: 3 additions & 3 deletions app/templates/error.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<article class="x404" data-test-error-page>
{{#if (contains model.errors.0.status (array "404" "403"))}}
{{#if this.hasErrors}}
<img src="/images/fishy.png" title="ACK! 404 FRIEND, YOU'RE IN THE WRONG PLACE" alt="A Tomster mascot holding a fish that has been outside in the sun too long!">
<h1 class="whoops" data-test-error-message>Ack! 404 friend, you're in the wrong place</h1>

<p>
This page wasn't found. If you were looking for documentation, please try
the <a href="http://guides.emberjs.com">Guides</a> section of the site. If you expected
something else to be here, please <a href="https://github.com/ember-learn/guides-app/issues">file a ticket</a>.
something else to be here, please <a href="https://github.com/ember-learn/guides-source/issues">file a ticket</a>.
</p>
{{else}}
<img src="/images/fishy.png" title="ACK! An unknown error has occured!" alt="A Tomster mascot holding a fish that has been outside in the sun too long!">
Expand All @@ -15,7 +15,7 @@
<p>
We're not quite sure what happened. If you were looking for documentation, please try
the <a href="http://guides.emberjs.com">Guides</a> section of the site. If you expected
something else to be here, please <a href="https://github.com/ember-learn/guides-app/issues">file a ticket</a>.
something else to be here, please <a href="https://github.com/ember-learn/guides-source/issues">file a ticket</a>.
</p>
{{/if}}
</article>
2 changes: 1 addition & 1 deletion app/templates/version.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ariaLabel=model.version
selected=model.version
options=versions
onchange=(action "selectVersion")
onChange=(action "selectVersion")
renderInPlace=true
as |version|
}}
Expand Down
15 changes: 15 additions & 0 deletions changelog.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{#each releases}}
x.x.x / {{isoDate}}
==================
{{#if merges}}
{{#each merges}}
* {{#if commit.breaking}}**Breaking change:** {{/if}}{{message}} #{{id}} from @{{githubIssue.user.login}}
{{/each}}
{{/if}}

{{#if fixes}}
{{#each fixes}}
* FIX: {{#if commit.breaking}}**Breaking change:** {{/if}}{{commit.subject}}{{#each fixes}} {{#if href}}[`#{{id}}`]({{href}}){{/if}}{{/each}}
{{/each}}
{{/if}}
{{/each}}
Loading

0 comments on commit aea21cb

Please sign in to comment.