Skip to content

Commit ec8983d

Browse files
committed
docs: Documentation!
1 parent 69e7511 commit ec8983d

21 files changed

+348
-356
lines changed

blueprints/ember-electron/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const writeFile = denodeify(fs.writeFile);
1414
const YAWN = require('yawn-yaml/cjs');
1515
const SilentError = require('silent-error');
1616
const {
17-
upgradeUrl,
17+
upgradingUrl,
1818
ciUrl
1919
} = require('../../lib/utils/documentation-urls');
2020

@@ -44,7 +44,7 @@ module.exports = class EmberElectronBlueprint extends Blueprint {
4444
this.ui.writeLine(chalk.yellow([
4545
`\n'ember-electron' directory detected -- this looks like an ember-electron`,
4646
`v2 project. Setting up an updated project will not be destructive, but you`,
47-
`should read the upgrade documentation at ${upgradeUrl}.\n`
47+
`should read the upgrading documentation at ${upgradingUrl}.\n`
4848
].join(' ')));
4949
}
5050
}

lib/commands/base.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const YarnOrNpmTask = require('../tasks/yarn-or-npm');
88
const Win = require('ember-cli/lib/utilities/windows-admin');
99
const fs = require('fs');
1010
const { electronProjectPath } = require('../utils/build-paths');
11-
const { upgradeUrl } = require('../utils/documentation-urls');
11+
const { upgradingUrl } = require('../utils/documentation-urls');
1212
const SilentError = require('silent-error');
1313

1414
module.exports = Command.extend({
@@ -30,7 +30,7 @@ module.exports = Command.extend({
3030
`contain an electron-forge project. It should have been generated by`,
3131
`ember-electron's blueprint when you first ran 'ember install`,
3232
`ember-electron'. If you are upgrading from ember-electron v2, you`,
33-
`should read the upgrade documentation at ${upgradeUrl}.`,
33+
`should read the upgrading documentation at ${upgradingUrl}.`,
3434
].join(' '))
3535
);
3636
}

lib/utils/documentation-urls.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const baseUrl = 'https://adopted-ember-addons.github.io/ember-electron/docs/';
22
const guidesUrl = `${baseUrl}guides/`;
3-
const upgradeUrl = `${guidesUrl}upgrade`;
3+
const upgradingUrl = `${guidesUrl}upgrading`;
44
const ciUrl = `${guidesUrl}ci`;
55

66
module.exports = {
7-
upgradeUrl,
7+
upgradingUrl,
88
ciUrl
99
};

tests/dummy/app/router.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,16 @@ Router.map(function() {
1111
this.route('faq', function() {
1212
this.route('common-issues');
1313
this.route('security');
14-
this.route('structure');
15-
this.route('test-runner-deprecation');
1614
});
1715

1816
this.route('guides', function() {
19-
this.route('build-pipeline');
2017
this.route('ci');
21-
this.route('configuration');
18+
this.route('common-issues');
19+
this.route('development-and-debugging');
2220
this.route('installation');
23-
this.route('packaging');
24-
this.route('testing');
25-
this.route('upgrade');
21+
this.route('security');
22+
this.route('structure');
23+
this.route('upgrading');
2624
this.route('usage');
2725
});
2826
});

tests/dummy/app/templates/docs.hbs

+3-7
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@
55
{{nav.section "Guides"}}
66
{{nav.item "Installation" "docs.guides.installation"}}
77
{{nav.item "Usage" "docs.guides.usage"}}
8-
{{nav.item "Configuration" "docs.guides.configuration"}}
9-
{{nav.item "Packaging" "docs.guides.packaging"}}
10-
{{nav.item "Testing" "docs.guides.testing"}}
11-
{{nav.item "Upgrade" "docs.guides.upgrade"}}
8+
{{nav.item "Structure" "docs.guides.structure"}}
9+
{{nav.item "Upgrading" "docs.guides.upgrading"}}
10+
{{nav.item "Development and Debugging" "docs.guides.development-and-debugging"}}
1211
{{nav.item "CI" "docs.guides.ci"}}
13-
{{nav.item "Build Pipeline" "docs.guides.build-pipeline"}}
1412

1513
{{nav.section "FAQ"}}
1614
{{nav.item "Common Issues" "docs.faq.common-issues"}}
1715
{{nav.item "Security" "docs.faq.security"}}
18-
{{nav.item "Structure" "docs.faq.structure"}}
19-
{{nav.item "Test Runner Deprecation" "docs.faq.test-runner-deprecation"}}
2016
{{/viewer.nav}}
2117

2218
{{#viewer.main}}

tests/dummy/app/templates/docs/faq/common-issues.md

-9
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,3 @@ In your ember-electron/main.js file, find the `BrowserWindow` that is being used
4444
const myWindow = new BrowserWindow({});
4545
myWindow.webContents.openDevTools();
4646
```
47-
48-
49-
## `ember-welcome-page` does not show in production mode
50-
51-
If you try out Ember-Electron for the first time on a brand new Ember project generated with `ember init`, you may find that the welcome page you see when running `ember electron` does no longer show up when you run an application packaged with `ember electron:package`.
52-
53-
While this might be a little confusing, it is the default behavior of the `ember-welcome-page` addon, which simply removes itself when run with the environment flag `--env=production`, which is our default while packaging applications.
54-
55-
Since you probably don't need that page anyway, you can safely follow it's own instructions and remove it from your `package.json` as well as the template tag `{{welcome-page}}` from your `app/templates/application.hbs`.

tests/dummy/app/templates/docs/faq/security.md

+17
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,20 @@ and the MDN [Web security landing page](https://developer.mozilla.org/en-US/docs
4343
e.g. `Refused to load...because it violates the following Content Security Policy directive:...`
4444
* If there are no problems then you are done.
4545
Otherwise, you'll need to examine the code in violation and either make it compliant or adjust the policy to allow it.
46+
47+
## Why do I see "Electron Security Warning (Insecure Resources)" when running tests?
48+
49+
To aid users in keeping their applications secure, Electron warns about any scripts
50+
or other resources loaded out of `index.html` without encryption (using `http:`
51+
rather than `https:`). When running tests, the renderer process has to load some
52+
resources from the local express server to allow it to communicate with testem, which
53+
manages the test run, and this cannot easily be done over `https:`. The expected list
54+
of URLs is:
55+
56+
```
57+
- http://testemserver/testem.js
58+
- http://testemserver/testem/connection.html
59+
```
60+
61+
We leave the security warnings enabled when running tests so you can see if it's warning
62+
about any other insecure content, besides the URLs listed about, loaded during tests.

tests/dummy/app/templates/docs/faq/structure.md

-42
This file was deleted.

tests/dummy/app/templates/docs/faq/test-runner-deprecation.md

-39
This file was deleted.

tests/dummy/app/templates/docs/guides/build-pipeline.md

-54
This file was deleted.

tests/dummy/app/templates/docs/guides/ci.md

+3-13
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,18 @@ You can test your application using Electron with the `ember electron:test` comm
44

55
* Install [`xvfb`](https://en.wikipedia.org/wiki/Xvfb). It's a virtual framebuffer, implementing the X11 display server protocol - it performs all graphical operations in memory without showing any screen output, which is exactly what we need. A [Jenkins addon is available](https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin).
66
* Create a virtual `xvfb` screen and export an environment variable called `DISPLAY` that points to it. Electron will automatically pick it up.
7-
* Install a recent C++ compiler (e.g. gcc). This is to enable the CI server to build native modules for Node.js.
8-
* Finally, ensure that `npm test` actually calls `ember electron:test`. You can configure what command `npm test executes` by changing it in your `package.json`.
7+
* Finally, ensure that `npm test` or `yarn test` actually calls `ember electron:test`. You can configure what command `npm test executes` by changing it in your `package.json`.
98

10-
On Travis, the configuration should look like this:
9+
When you first install `ember-electron`, the blueprint will update your .travis.yml, but if it fails or you need to do it manually for some reason, your configuration should include the following:
1110

1211
```yaml
13-
env:
14-
- CXX=g++-4.8
15-
1612
addons:
1713
apt:
18-
sources:
19-
- ubuntu-toolchain-r-test
2014
packages:
2115
- xvfb
22-
- g++-4.8
23-
24-
before_install:
25-
- "npm config set spin false"
2616

2717
install:
28-
- npm install
18+
- <npm or yarn install>
2919
- export DISPLAY=':99.0'
3020
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
3121
```

0 commit comments

Comments
 (0)