Skip to content

Convert cli-guides to be a single repo project #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ insert_final_newline = true
indent_style = space
indent_size = 2

[*.md]
[*.hbs]
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions .ember-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
}
20 changes: 20 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
/node_modules/
42 changes: 42 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* eslint-env node */

module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
},
overrides: [
// node files
{
files: [
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
}
]
};
15 changes: 0 additions & 15 deletions .eslintrc.json

This file was deleted.

25 changes: 23 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
.DS_Store
node_modules
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/.sass-cache
/connect.lock
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
8 changes: 8 additions & 0 deletions .netlifyheaders
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*/
Cache-Control: public, max-age=3600

/content/*
Cache-Control: public, max-age=3600

/assets/*
Cache-Control: public, max-age=31536000
2 changes: 2 additions & 0 deletions .netlifyredirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/ /release/
/* /_empty.html 404
5 changes: 5 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
};
13 changes: 12 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
---
language: node_js
node_js:
- 6
- "6"

sudo: false
dist: trusty

addons:
chrome: stable

cache:
directories:
- $HOME/.npm

env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1

before_install:
- npm config set spin false
- npm i -g npm@6

script:
- set -o errexit
- npm run lint:md
- npm run lint:alex
- npm run lint:hbs
- npm run lint:js
- npm test
3 changes: 3 additions & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["tmp", "dist"]
}
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,23 @@ You will need the following things properly installed on your computer.
* [Node.js](https://nodejs.org/) (with npm)
* [Ember CLI](https://ember-cli.com/)
* [Google Chrome](https://google.com/chrome/)
* [npm](https://docs.npmjs.com/cli/install)

## Local Development

To see what a local copy of the Guides markdown looks like:
The Ember-Cli Guides is a normal Ember application so if you want to run it locally you follow the standard steps:

* Clone the [Ember CLI Guides](https://github.com/ember-learn/cli-guides-app) App repository
* link the `cli-guides-source` repository by running `npm link` inside this repository, then `npm link @ember-learn/cli-guides` in the guides-app
* `npm install` and `ember serve` in the guides app
* Clone this repository
* `cd cli-guides-source`
* `npm install`
* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).

If you follow this strategy above, as you save changes to
the markdown files of this repository, your locally served
app should update.
If you then edit the Markdown files located in the `guides/` folder your
application should live-update with the content changes.

To run the tests you can run `npm test` in your terminal, this will run any
Ember tests that have been setup but also some scripts that check the Markdown
files such as the link-checker.

### Adding more things to the table of contents

Expand Down
14 changes: 14 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Application from '@ember/application';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
});

loadInitializers(App, config.modulePrefix);

export default App;
24 changes: 24 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for "head"}}

<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/@ember-learn/cli-guides.css">

{{content-for "head-footer"}}
</head>
<body>
{{content-for "body"}}

<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/@ember-learn/cli-guides.js"></script>

{{content-for "body-footer"}}
</body>
</html>
3 changes: 3 additions & 0 deletions app/resolver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Resolver from 'ember-resolver';

export default Resolver;
12 changes: 12 additions & 0 deletions app/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import EmberRouter from '@ember/routing/router';
import config from './config/environment';

const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL
});

Router.map(function() {
});

export default Router;
File renamed without changes.
61 changes: 61 additions & 0 deletions config/environment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
'use strict';

module.exports = function(environment) {
let ENV = {
modulePrefix: '@ember-learn/cli-guides',
environment,
rootURL: '/',
locationType: 'trailing-history',
historySupportMiddleware: true,

EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false
}
},

APP: {
// Here you can pass flags/options to your application instance
// when it is created
},

'ember-meta': {
description: 'Ember CLI Guides'
},

guidemaker: {
title: 'Ember CLI Guides'
}
};

if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
// ENV.APP.LOG_ACTIVE_GENERATION = true;
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
// ENV.APP.LOG_VIEW_LOOKUPS = true;
}

if (environment === 'test') {
// Testem prefers this...
ENV.locationType = 'none';

// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;

ENV.APP.rootElement = '#ember-testing';
ENV.APP.autoboot = false;
}

if (environment === 'production') {
// here you can enable a production-specific feature
}

return ENV;
};
3 changes: 3 additions & 0 deletions config/optional-features.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"jquery-integration": true
}
18 changes: 18 additions & 0 deletions config/targets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
];

const isCI = !!process.env.CI;
const isProduction = process.env.EMBER_ENV === 'production';

if (isCI || isProduction) {
browsers.push('ie 11');
}

module.exports = {
browsers
};
26 changes: 26 additions & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
let app = new EmberApp(defaults, {
fingerprint: {
extensions: ['js', 'css', 'map']
}
});

// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.

return app.toTree();
};
1 change: 1 addition & 0 deletions test/link-checker.js → node-tests/link-checker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-env node, mocha */
const guidemakerLinkChecker = require('guidemaker-link-checker');

describe('check all links in markdown files', function () {
Expand Down
Loading