Skip to content

Commit 0abbb04

Browse files
committed
Created an Ember Octane app
1 parent 69579fe commit 0abbb04

File tree

117 files changed

+20554
-774
lines changed

Some content is hidden

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

117 files changed

+20554
-774
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ charset = utf-8
1111
trim_trailing_whitespace = true
1212
insert_final_newline = true
1313
indent_style = space
14-
indent_size = 2
14+
indent_size = 4
1515

1616
[*.hbs]
1717
insert_final_newline = false

.ember-cli

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
/**
3+
Ember CLI sends analytics information by default. The data is completely
4+
anonymous, but there are times when you might want to disable this behavior.
5+
6+
Setting `disableAnalytics` to true will prevent any data from being sent.
7+
*/
8+
"disableAnalytics": false
9+
}

.eslintignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
/vendor/
4+
5+
# compiled output
6+
/dist/
7+
/tmp/
8+
9+
# dependencies
10+
/bower_components/
11+
/node_modules/
12+
13+
# misc
14+
/coverage/
15+
!.*
16+
17+
# ember-try
18+
/.node_modules.ember-try/
19+
/bower.json.ember-try
20+
/package.json.ember-try

.eslintrc.js

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
module.exports = {
2+
root: true,
3+
parser: 'babel-eslint',
4+
parserOptions: {
5+
ecmaVersion: 2018,
6+
sourceType: 'module',
7+
ecmaFeatures: {
8+
legacyDecorators: true
9+
}
10+
},
11+
plugins: [
12+
'ember'
13+
],
14+
extends: [
15+
'eslint:recommended',
16+
'plugin:ember/recommended'
17+
],
18+
env: {
19+
browser: true
20+
},
21+
rules: {
22+
'ember/no-jquery': 'error',
23+
24+
// AirBnB style
25+
'array-bracket-spacing': [
26+
'error',
27+
'never',
28+
{
29+
'arraysInArrays': false,
30+
'objectsInArrays': false
31+
}
32+
],
33+
'arrow-spacing': [
34+
'error',
35+
{
36+
'before': true,
37+
'after': true
38+
}
39+
],
40+
'brace-style': [
41+
'error',
42+
'1tbs',
43+
{
44+
'allowSingleLine': true
45+
}
46+
],
47+
'comma-spacing': [
48+
'error', {
49+
'before': false,
50+
'after': true
51+
}
52+
],
53+
'indent': [
54+
'error',
55+
4,
56+
{
57+
'SwitchCase': 1
58+
}
59+
],
60+
'key-spacing': [
61+
'error',
62+
{
63+
'beforeColon': false,
64+
'afterColon': true
65+
}
66+
],
67+
'keyword-spacing': [
68+
'error',
69+
{
70+
'before': true,
71+
'after': true
72+
}
73+
],
74+
'max-len': [
75+
'error',
76+
{
77+
code: 160,
78+
comments: 160,
79+
ignoreUrls: true,
80+
ignoreTemplateLiterals: true,
81+
ignoreRegExpLiterals: true
82+
}
83+
],
84+
'no-mixed-spaces-and-tabs': ['error'],
85+
'no-multi-spaces': [
86+
'error', {
87+
'exceptions': {
88+
'Property': true
89+
}
90+
}
91+
],
92+
'no-tabs': ['error'],
93+
'no-trailing-spaces': ['error'],
94+
'no-var': ['error'],
95+
'object-curly-spacing': [
96+
'error',
97+
'always'
98+
],
99+
'one-var': [
100+
'error',
101+
'never'
102+
],
103+
'quotes': [
104+
'error',
105+
'single',
106+
{
107+
'allowTemplateLiterals': true
108+
}
109+
],
110+
'require-yield': 0,
111+
'semi': [
112+
'error',
113+
'always'
114+
],
115+
'space-before-blocks': [
116+
'error',
117+
'always'
118+
],
119+
'space-before-function-paren': [
120+
'error',
121+
'never'
122+
],
123+
'space-infix-ops': ['error']
124+
},
125+
overrides: [
126+
// node files
127+
{
128+
files: [
129+
'.eslintrc.js',
130+
'.template-lintrc.js',
131+
'ember-cli-build.js',
132+
'testem.js',
133+
'blueprints/*/index.js',
134+
'config/**/*.js',
135+
'lib/*/index.js',
136+
'server/**/*.js'
137+
],
138+
parserOptions: {
139+
sourceType: 'script'
140+
},
141+
env: {
142+
browser: false,
143+
node: true
144+
},
145+
plugins: ['node'],
146+
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
147+
// add your custom rules and overrides for node files here
148+
149+
// this can be removed once the following is fixed
150+
// https://github.com/mysticatea/eslint-plugin-node/issues/77
151+
'node/no-unpublished-require': 'off'
152+
})
153+
}
154+
]
155+
};

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist/
5+
/tmp/
6+
7+
# dependencies
8+
/bower_components/
9+
/node_modules/
10+
11+
# misc
12+
/.env*
13+
/.pnp*
14+
/.sass-cache
15+
/connect.lock
16+
/coverage/
17+
/libpeerconnection.log
18+
/npm-debug.log*
19+
/testem.log
20+
/yarn-error.log
21+
22+
# ember-try
23+
/.node_modules.ember-try/
24+
/bower.json.ember-try
25+
/package.json.ember-try

.template-lintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
module.exports = {
4+
extends: 'octane',
5+
rules: {
6+
'block-indentation': 4
7+
}
8+
};

.travis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
language: node_js
3+
node_js:
4+
- "8"
5+
6+
sudo: false
7+
dist: trusty
8+
9+
addons:
10+
chrome: stable
11+
12+
cache:
13+
directories:
14+
- $HOME/.npm
15+
16+
env:
17+
global:
18+
# See https://git.io/vdao3 for details.
19+
- JOBS=1
20+
21+
branches:
22+
only:
23+
- master
24+
25+
script:
26+
- npm run lint:hbs
27+
- npm run lint:js
28+
- npm test

.watchmanconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ignore_dirs": ["tmp", "dist"]
3+
}

CONTRIBUTING.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# How to Contribute
2+
3+
Contributions are welcome!
4+
5+
**You can easily make changes** because we follow a naming convention.
6+
7+
Advanced strategies should be PR'ed directly to the [Ember.js Guides](https://github.com/ember-learn/guides-source/pulls), since a goal of this project is to be short and sweet.
8+
9+
10+
## Deploying
11+
12+
This site is deployed to [GitHub Pages](https://pages.github.com/) automatically from the `master` branch.
13+
14+
15+
## How It's Made
16+
17+
### 1. Model hook
18+
19+
First, Have a look at `app/routes/application.js`.
20+
21+
The `model` hook returns an array of `section` objects. Each section can further define an array of `subsection` objects.
22+
23+
**We use sections and subsections to organize this guide.**
24+
25+
### 2. Ember Intl
26+
27+
Next, We want to explain to the reader what a section or subsection is about.
28+
29+
We store titles and descriptions in `translations/en-us.yaml`. A description can contain HTML elements like hyperlinks.
30+
31+
**The translation keys match the section and subsection IDs.**
32+
33+
### 3. Ember Code Snippet
34+
35+
Finally, we want to show code examples to the reader.
36+
37+
We store code snippets in `snippets` folder. Afterwards, we update the `model` hook by listing the files.
38+
39+
**Subfolder names match the subsection IDs.**
40+
41+
42+
## How It's Made (Recap)
43+
44+
You can find the text in `translations/en-us.yaml`, the code in `snippets`, and the app structure in `app/routes/application.js`! 💖

LICENSE

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

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
# Ember Octane vs Classic Cheat Sheet
22

3-
Check out [the deployed app](https://ember-learn.github.io/ember-octane-vs-classic-cheat-sheet/)!
3+
Check out [the deployed app](https://ember-learn.github.io/ember-octane-vs-classic-cheat-sheet/). Yep, it uses Ember Octane!
44

5-
See side-by-side examples of Classic Ember vs [Octane Edition](https://emberjs.com/editions).
5+
You can see side-by-side examples of [Ember Octane](https://emberjs.com/editions/octane) and Ember Classic.
66

7-
This uses [Prism](https://prismjs.com/) code hightlighting with the [file highlight](https://prismjs.com/plugins/file-highlight/) plugin.
87

9-
Inspired by [YouMightNotNeedJQuery](http://youmightnotneedjquery.com/).
8+
## Running Locally
109

11-
## Running locally
10+
This is an Ember app, so the usual steps follow:
1211

13-
This is a vanilla JavaScript application. You must serve the files locally in order for the JavaScript and CSS to load in the browser. For example:
12+
1. Clone this repo.
13+
```bash
14+
git clone [email protected]:ember-learn/ember-octane-vs-classic-cheat-sheet.git
15+
```
16+
1. Change directory.
17+
```bash
18+
cd ember-octane-vs-classic-cheat-sheet
19+
```
20+
1. Install packages.
21+
```bash
22+
npm install
23+
```
24+
1. Run the app.
25+
```bash
26+
ember serve
27+
```
28+
1. Visit your app at [http://localhost:4200](http://localhost:4200).
1429

15-
```
16-
npm install http-server -g
17-
http-server .
18-
```
1930

20-
Visit http://localhost:8080 to see the results.
21-
If you make changes, restart the server.
22-
You might have to clear the cache to see your changes. (In Chrome, open the dev tools, then right click on the browser's main refresh arrow and choose Empty Cache and Hard Reload, or configure your dev tools to not keep a cache in the first place.)
31+
## How to Contribute
2332

24-
## Contributing
33+
Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
2534

26-
Contributions are welcome!
27-
Simple examples can be added to this cheat sheet.
28-
Copy and paste a `<section>` block in `index.html`.
29-
Create the code sample files in the `code` directory, change the `data` tag of the `<pre>`, and you're done!
30-
Try to follow the same file naming scheme as is used elsewhere, and make sure to name any `.hbs` files `.handlebars` instead or the formatting won't get applied.
3135

32-
Advanced strategies should be PR'd directly to the [Ember.js Guides](https://github.com/ember-learn/guides-source/pulls), since the goal of this project is to keep it as short and sweet as possible.
33-
34-
## Deploying
35-
36-
This site is deployed to [GitHub Pages](https://pages.github.com/) automatically from the `master` branch.
36+
## Credits
3737

38+
This app was inspired by [You might not need jQuery](http://youmightnotneedjquery.com/).

0 commit comments

Comments
 (0)