Skip to content

Commit

Permalink
📝 #26 adding ember-cli-addon-docs; deploying first cut.
Browse files Browse the repository at this point in the history
  • Loading branch information
nadnoslen committed Oct 26, 2019
1 parent c145cd6 commit 7de4e13
Show file tree
Hide file tree
Showing 14 changed files with 2,469 additions and 90 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
/config/addon-docs.js
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.
};
32 changes: 32 additions & 0 deletions config/deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* eslint-env node */
'use strict';

module.exports = function(deployTarget) {
let ENV = {
build: {},
git: {
commitMessage: '[ci skip]'
}
// 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 @@ -55,8 +55,14 @@
"broccoli-asset-rev": "^3.0.0",
"codeclimate-test-reporter": "^0.5.1",
"ember-cli": "~3.13.1",
"ember-cli-addon-docs": "^0.6.15",
"ember-cli-addon-docs-yuidoc": "^0.2.1",
"ember-cli-code-coverage": "^1.0.0-beta.8",
"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-inline-precompile": "^3.0.0",
"ember-cli-inject-live-reload": "^2.0.1",
Expand Down Expand Up @@ -84,5 +90,6 @@
},
"ember-addon": {
"configPath": "tests/dummy/config"
}
},
"homepage": "https://cybertooth-io.github.io/ember-simple-auth-aws-amplify"
}
10 changes: 7 additions & 3 deletions tests/dummy/app/router.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
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('usage');
});
this.route('not-found', { path: '/*path' });
});

export default Router;
13 changes: 13 additions & 0 deletions tests/dummy/app/styles/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
:root {
--brand-primary: #0095DA;
}

/* HACK until release: https://github.com/ember-learn/ember-cli-addon-docs/issues/407 */

.docs-bg-brand {
background-color: #0095DA !important;
}

.docs-text-brand {
color: #0095DA !important;
}
2 changes: 1 addition & 1 deletion tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<h2 id="title">Welcome to Ember</h2>
{{docs-header prefix="Ember Simple Auth" name="AWS Amplify"}}

{{outlet}}
10 changes: 10 additions & 0 deletions tests/dummy/app/templates/docs.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{#docs-viewer as |viewer|}}
{{#viewer.nav as |nav|}}
{{nav.item "Introduction" "docs.index"}}
{{nav.item "Usage" "docs.usage"}}
{{/viewer.nav}}

{{#viewer.main}}
{{outlet}}
{{/viewer.main}}
{{/docs-viewer}}
3 changes: 3 additions & 0 deletions tests/dummy/app/templates/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Index

Index content
3 changes: 3 additions & 0 deletions tests/dummy/app/templates/docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Usage

Usage content
9 changes: 9 additions & 0 deletions tests/dummy/app/templates/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{docs-hero prefix="Ember Simple Auth" heading="AWS Amplify"}}

<div class="container">
{{#docs-demo as |demo|}}
{{#demo.example name="my-demo.hbs"}}
<p>Make sure to read up on the DocsDemo component before building out this page.</p>
{{/demo.example}}
{{/docs-demo}}
</div>
4 changes: 4 additions & 0 deletions tests/dummy/app/templates/not-found.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="container">
<h1>Not found</h1>
<p>This page doesn't exist. {{#docs-link "index"}}Head home?{{/docs-link}}</p>
</div>
2 changes: 2 additions & 0 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ module.exports = function(environment) {
}

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

Expand Down
Loading

0 comments on commit 7de4e13

Please sign in to comment.