Skip to content

Commit

Permalink
Merge pull request #404 from rwwagner90/addon-docs
Browse files Browse the repository at this point in the history
docs: Use ember-cli-addon-docs for docs
  • Loading branch information
Ben Demboski committed Nov 6, 2019
2 parents cdf9636 + 1caf0c2 commit 1de0b6f
Show file tree
Hide file tree
Showing 25 changed files with 4,406 additions and 98 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
/config/addon-docs.js
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

9 changes: 9 additions & 0 deletions config/addon-docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-env node */
'use strict';

const AddonDocsConfig = require('ember-cli-addon-docs/lib/config');

module.exports = class extends AddonDocsConfig {
// See https://ember-learn.github.io/ember-cli-addon-docs/docs/deploying
// for details on configuration you can override here.
};
29 changes: 29 additions & 0 deletions config/deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* eslint-env node */
'use strict';

module.exports = function(deployTarget) {
let ENV = {
build: {}
// include other plugin configuration that applies to all deploy targets here
};

if (deployTarget === 'development') {
ENV.build.environment = 'development';
// configure other plugins for development deploy target here
}

if (deployTarget === 'staging') {
ENV.build.environment = 'production';
// configure other plugins for staging deploy target here
}

if (deployTarget === 'production') {
ENV.build.environment = 'production';
// configure other plugins for production deploy target here
}

// Note: if you need to build some configuration asynchronously, you can return
// a promise that resolves with the ENV object instead of returning the
// ENV object synchronously.
return ENV;
};
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@
"electron-compile": "^6.4.3",
"electron-prebuilt-compile": "1.4.15",
"ember-cli": "~3.12.0",
"ember-cli-addon-docs": "^0.6.15",
"ember-cli-addon-docs-yuidoc": "^0.2.1",
"ember-cli-dependency-checker": "^3.1.0",
"ember-cli-deploy": "^1.0.2",
"ember-cli-deploy-build": "^2.0.0",
"ember-cli-deploy-git": "^1.3.4",
"ember-cli-deploy-git-ci": "^1.0.1",
"ember-cli-eslint": "^5.1.0",
"ember-cli-htmlbars": "^3.0.1",
"ember-cli-htmlbars-inline-precompile": "^2.1.0",
Expand Down Expand Up @@ -138,5 +144,6 @@
},
"config": {
"forge": "./ember-electron/electron-forge-config.js"
}
},
"homepage": "https://adopted-ember-addons.github.io/ember-electron"
}
25 changes: 22 additions & 3 deletions tests/dummy/app/router.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
import EmberRouter from '@ember/routing/router';
import AddonDocsRouter, { docsRoute } from 'ember-cli-addon-docs/router';
import config from './config/environment';

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

Router.map(function() {
docsRoute(this, function() {
this.route('faq', function() {
this.route('common-issues');
this.route('security');
this.route('structure');
this.route('test-runner-deprecation');
});

this.route('guides', function() {
this.route('build-pipeline');
this.route('ci');
this.route('configuration');
this.route('installation');
this.route('packaging');
this.route('testing');
this.route('upgrade');
this.route('usage');
});
});
});

export default Router;
5 changes: 5 additions & 0 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{docs-header}}

{{outlet}}

{{docs-keyboard-shortcuts}}
29 changes: 29 additions & 0 deletions tests/dummy/app/templates/docs.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{#docs-viewer as |viewer|}}
{{#viewer.nav as |nav|}}
{{nav.section "Getting Started"}}

{{nav.section "Guides"}}
{{nav.item "Installation" "docs.guides.installation"}}
{{nav.item "Usage" "docs.guides.usage"}}
{{nav.item "Configuration" "docs.guides.configuration"}}
{{nav.item "Packaging" "docs.guides.packaging"}}
{{nav.item "Testing" "docs.guides.testing"}}
{{nav.item "Upgrade" "docs.guides.upgrade"}}
{{nav.item "CI" "docs.guides.ci"}}
{{nav.item "Build Pipeline" "docs.guides.build-pipeline"}}

{{nav.section "FAQ"}}
{{nav.item "Common Issues" "docs.faq.common-issues"}}
{{nav.item "Security" "docs.faq.security"}}
{{nav.item "Structure" "docs.faq.structure"}}
{{nav.item "Test Runner Deprecation" "docs.faq.test-runner-deprecation"}}
{{/viewer.nav}}

{{#viewer.main}}
<div class="docs-container">
<div class="docs-section">
{{outlet}}
</div>
</div>
{{/viewer.main}}
{{/docs-viewer}}
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
68 changes: 68 additions & 0 deletions tests/dummy/app/templates/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<p align="center"><img src="https://github.com/adopted-ember-addons/ember-electron/raw/gh-pages/assets/logo-github%402x.png" alt="Ember-Electron logo showing an electron orbiting a flame" width="300" height="250"></p>

# Ember-Electron

![Latest release on NPM](https://img.shields.io/npm/v/ember-electron.svg) [![Build status](https://ci.appveyor.com/api/projects/status/5rhwhar361uad07v?svg=true)](https://ci.appveyor.com/project/adopted-ember-addons/ember-electron)
![Travis CI Build Status](https://secure.travis-ci.org/adopted-ember-addons/ember-electron.svg?branch=master) ![Code Climate](https://codeclimate.com/github/adopted-ember-addons/ember-electron.svg)

An Ember addon to turn Ember apps into cross-platform desktop applications, taking care of development, tests, compilation, and installer creation.

* `ember electron` - Run app in Electron with live-reload server
* `ember electron:test` - Test the app using Electron
* `ember electron:test --server` - Test with Electron in development server mode
* `ember electron:package` - Create binaries (.app, .exe, etc)
* `ember electron:make` - Generate platform specific distributables (installers, distribution packages, etc)
* `ember electron:build` - Build out Ember app with Electron instrumentation (useful for optimizing multi-platform builds)
* `ember electron:assemble` - Assemble Electron application project (useful for debugging builds)

To see a real world example, check out [Ghost Desktop](https://github.com/tryghost/Ghost-Desktop).



## Documentation

### Basics
- [Installation](docs/guides/installation.md)
- [Usage](docs/guides/usage.md)
- [Configuration](docs/guides/configuration.md)
- [Testing](docs/guides/testing.md)
- [Packaging](docs/guides/packaging.md)

### Advanced Guides
- [Upgrading from ember-electron 1.x to 2.x](docs/guides/upgrade.md)
- [Testing on CI (Travis, AppVeyor, CircleCI, etc)](docs/guides/ci.md)
- [Build pipeline](docs/guides/build-pipeline.md)

### FAQ

- [Common issues](docs/faq/common-issues.md)
- [File structure](docs/faq/structure.md)
- [Security concerns](docs/faq/security.md)

Somethings missing? Contributions to our docs are welcome!


## Support

Ember-Electron is a small open source project. Use [GitHub Issues](https://github.com/adopted-ember-addons/ember-electron/issues) to report bugs and errors within the addon.

If you need help *using* the addon with your application, may we recommend the excellent Ember community? You can the [various places to get help here](https://www.emberjs.com/community/). If you have questions regarding Electron, their [Slack and forum](https://electron.atom.io/contact/) will be helpful as well.


## Development

`ember-electron` uses [Semantic Release](https://github.com/semantic-release/semantic-release) to
automate the whole release process. In order to have a PR merged, please ensure that your PR
follows the commit guidelines so that our robots can understand your change. This repository uses
the [`conventional-changelog` rules from the `eslint` repository](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint).


## Authors

Ember-Electron builds on prior work done by @brzpegasus (author of [`ember-cli-nwjs`](https://github.com/brzpegasus/ember-cli-nwjs)) and @joostdevries (author of [`ember-cli-remote-inspector`](https://github.com/joostdevries/ember-cli-remote-inspector)). Our gratitude to both of them for their amazing work.

* Felix Rieseberg ([@felixrieseberg](https://github.com/felixriesberg))
* Aidan Nulman ([@anulman](https://github.com/anulman))
* Florian Pichler ([@pichfl](https://github.com/pichfl))
* Ben Demboski ([@bendemboski](https://github.com/bendemboski))
* [...and many other contributors](https://github.com/adopted-ember-addons/ember-electron/graphs/contributors)
1 change: 1 addition & 0 deletions tests/dummy/app/templates/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{docs-hero}}
9 changes: 5 additions & 4 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ module.exports = function(environment) {
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false,
},
Date: false
}
},

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

if (environment === 'development') {
Expand All @@ -44,7 +44,8 @@ module.exports = function(environment) {
}

if (environment === 'production') {
// here you can enable a production-specific feature
// Allow ember-cli-addon-docs to update the rootURL in compiled assets
ENV.rootURL = 'ADDON_DOCS_ROOT_URL';
}

return ENV;
Expand Down

0 comments on commit 1de0b6f

Please sign in to comment.