Skip to content

Commit 8ef6606

Browse files
committed
Fleshed out monitor and logging docs (#78, #27)
1 parent 935aa52 commit 8ef6606

File tree

16 files changed

+288
-64
lines changed

16 files changed

+288
-64
lines changed

.docs/generate.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,26 @@ const renderSourceDocs = async (sources) => {
3636
}
3737

3838
const defaults = {
39-
"files": "packages/**/lib/*.js",
39+
"files": "packages/**/*.js",
4040
"heading-depth": 2,
4141
"name-format": true,
4242
"separators": true,
4343
"partial": [
4444
".docs/partials/class-members.hbs",
4545
".docs/partials/inline-see.hbs"
4646
],
47-
"helper": [".docs/helpers/helpers.js"],
47+
"helper": [
48+
".docs/helpers/helpers.js"
49+
],
4850
"module-index-format": "list",
4951
"global-index-format": "list",
5052
"param-index-format": "list",
5153
"property-index-format": "list",
5254
"member-index-format": "grouped"
5355
};
5456

57+
await renderDocs({...defaults, templatePath: 'packages/launchpad/.docs/hooks.hbs', outputPath: 'packages/launchpad/docs/hooks.md', "heading-depth": 3});
58+
await renderDocs({...defaults, templatePath: 'packages/launchpad/.docs/logging.hbs', outputPath: 'packages/launchpad/docs/logging.md', "heading-depth": 3});
5559
await renderDocs({...defaults, templatePath: 'packages/content/README.hbs', outputPath: 'packages/content/README.md'});
5660
await renderDocs({...defaults, templatePath: 'packages/monitor/README.hbs', outputPath: 'packages/monitor/README.md', "heading-depth": 3});
5761
await renderSourceDocs(['airtable', 'contentful', 'json', 'sanity', 'strapi']);

.docs/partials/class-members.hbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
{{#class name=name}}
33
{{>heading-indent}} {{name}}
44
{{#if description}}{{~{escape description}~}}{{/if}}
5+
6+
{{>inline-see}}
7+
58
| Property | Type | Default | Description |
69
| - | - | - | - |
710
{{#children inherited=undefined ~}}| <a name="{{{anchorName}}}">{{#if virtual}}*{{/if}}{{#with (parentObject)}}{{#if virtual}}*{{/if~}}{{/with~}}
@@ -15,6 +18,6 @@
1518
{{#if @suffix}} {{@suffix}}{{/if~}}
1619
{{{@depClose}~}}
1720
{{~/sig}}{{/if~}}
18-
{{#if virtual}}*{{/if}}{{#with (parentObject)}}{{#if virtual}}*{{/if~}}{{/with~}} | {{#unless (equal defaultvalue undefined)}} {{#linebreaks-to-br}}<code>{{~{escape defaultvalue}}}</code>{{/linebreaks-to-br}} {{/unless}} | {{#linebreaks-to-br}}{{~{escape description}~}}{{/linebreaks-to-br}}{{#if see~}}<br><br>{{>inline-see}}{{/if}} |
21+
{{#if virtual}}*{{/if}}{{#with (parentObject)}}{{#if virtual}}*{{/if~}}{{/with~}} | {{#unless (equal defaultvalue undefined)}} {{#linebreaks-to-br}}<code>{{~{escape defaultvalue}~}}</code>{{/linebreaks-to-br}} {{/unless}} | {{#linebreaks-to-br}}{{~{escape description}~}}{{/linebreaks-to-br}}{{#if see~}}<br><br>{{>inline-see}}{{/if}} |
1922
{{/children~}}
2023
{{/class}}

.docs/partials/inline-see.hbs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{{#if see~}}
22

3-
{{#if (equal see.length 1)~}}
4-
See: {{{inlineLinks see.[0]}}}
5-
{{else~}}
6-
See
3+
{{#if (equal see.length 1)~}}See: {{{inlineLinks see.[0]}}}{{else~}}
4+
See: {{#each see}} {{{inlineLinks this}}}{{#unless @last}},{{/unless}}{{/each~}}.{{/if~}}
75

8-
{{#each see}}- {{{inlineLinks this}}}
9-
{{/each}}
10-
11-
{{/if~}}
126
{{/if~}}

packages/content/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ Once content is downloaded it can be processed to transform text and images. For
105105

106106
## ContentOptions
107107
Options for all content and media downloads. Each of these settings can also be configured per `ContentSource`.
108+
109+
108110
| Property | Type | Default | Description |
109111
| - | - | - | - |
110112
| <a name="module_launchpad-content/content-options.ContentOptions+sources">`sources`</a> | <code>Array.&lt;SourceOptions&gt;</code>| <code>[]</code> | A list of content source options. This defines which content is downloaded from where. |

packages/content/docs/airtable-source.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
## AirtableOptions
55
Options for AirtableSource
6+
7+
68
| Property | Type | Default | Description |
79
| - | - | - | - |
810
| <a name="module_airtable-source.AirtableOptions+baseId">`baseId`</a> | <code>string</code>| | Airtable base ID. @see https://help.appsheet.com/en/articles/1785063-using-data-from-airtable#:~:text=To%20obtain%20the%20ID%20of,API%20page%20of%20the%20base. |

packages/content/docs/contentful-source.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
Configuration options for the Contentful ContentSource.
66

77
Also supports all fields of the Contentful SDK's config.
8+
9+
See: 'Configuration' under https://contentful.github.io/contentful.js/contentful/9.1.7/
810
| Property | Type | Default | Description |
911
| - | - | - | - |
1012
| <a name="module_contentful-source.ContentfulOptions+space">`space`</a> | <code>string</code>| <code>''</code> | Your Contentful space ID. Note that credentials.json will require an accessToken in addition to this |
1113
| <a name="module_contentful-source.ContentfulOptions+locale">`locale`</a> | <code>string</code>| <code>'en-US'</code> | Optional. Used to pull localized images. |
1214
| <a name="module_contentful-source.ContentfulOptions+filename">`filename`</a> | <code>string</code>| <code>'content.json'</code> | Optional. The filename you want to use for where all content (entries and assets metadata) will be stored. |
1315
| <a name="module_contentful-source.ContentfulOptions+contentTypes">`contentTypes`</a> | <code>Array.&lt;string&gt;</code>| | Optionally limit queries to these content types.<br>This will also apply to linked assets.<br>Types that link to other types will include up to 10 levels of child content.<br>E.g. filtering by Story, might also include Chapters and Images.<br>Uses `searchParams['sys.contentType.sys.id[in]']` under the hood. |
1416
| <a name="module_contentful-source.ContentfulOptions+searchParams">`searchParams`</a> | <code>Object</code>| | Optional. Supports anything from https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters |
15-
| <a name="module_contentful-source.ContentfulOptions+imageParams">`imageParams`</a> | <code>Object</code>| | Optional. Applies to all images. Defaults to empty object.<br>\*\*IMPORTANT:\*\* If you change the parameters, you will have to delete all cached images since the modified date of the original image will not have changed.<br><br>See: https://www.contentful.com/developers/docs/references/images-api/#/reference/resizing-&-cropping/specify-focus-area
16-
|
17+
| <a name="module_contentful-source.ContentfulOptions+imageParams">`imageParams`</a> | <code>Object</code>| | Optional. Applies to all images. Defaults to empty object.<br>\*\*IMPORTANT:\*\* If you change the parameters, you will have to delete all cached images since the modified date of the original image will not have changed.<br><br>See: https://www.contentful.com/developers/docs/references/images-api/#/reference/resizing-&-cropping/specify-focus-area |
1718
| <a name="module_contentful-source.ContentfulOptions+protocol">`protocol`</a> | <code>string</code>| <code>'https'</code> | Optional |
1819
| <a name="module_contentful-source.ContentfulOptions+host">`host`</a> | <code>string</code>| <code>'cdn.contentful.com'</code> | Optional |
1920
| <a name="module_contentful-source.ContentfulOptions+usePreviewApi">`usePreviewApi`</a> | <code>boolean</code>| <code>false</code> | Optional. Set to true if you want to use the preview API instead of the production version to view draft content. |

packages/content/docs/json-source.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ All images contained in these json files will be downloaded while retaining the
3030

3131
## JsonOptions
3232

33+
34+
3335
| Property | Type | Default | Description |
3436
| - | - | - | - |
3537
| <a name="module_json-source.JsonOptions+mediaPattern">`mediaPattern`</a> | <code>RegExp</code>| <code>(/.+(\.jpg\|\.jpeg\|\.png)/gi\|/.+(\.avi\|\.mov\|\.mp4\|\.mpg\|\.mpeg)/gi)</code> | Regex for media files that should be downloaded from json sources |

packages/content/docs/sanity-source.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
## SanityOptions
55
Options for SanitySource
6+
7+
68
| Property | Type | Default | Description |
79
| - | - | - | - |
810
| <a name="module_sanity-source.SanityOptions+apiVersion">`apiVersion`</a> | <code>string</code>| <code>'v2021-10-21'</code> | API Version |

packages/content/docs/strapi-source.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
## StrapiOptions
55
Options for StrapiSource
6+
7+
68
| Property | Type | Default | Description |
79
| - | - | - | - |
810
| <a name="module_strapi-source.StrapiOptions+version">`version`</a> | <code>string</code>| <code>'3'</code> | Only version `'3'` is supported currently. |

packages/launchpad/.docs/hooks.hbs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Event Hooks
2+
3+
You can configure Launchpad to execute custom scripts before or after any of the central commands.
4+
5+
## Example
6+
7+
Hooks can be configured in `launchpad.json`. For example:
8+
9+
```json
10+
{
11+
"hooks": {
12+
"post-update-content": ["npm run build"],
13+
"pre-start-apps": ["taskkill /im chrome.exe /f"]
14+
}
15+
}
16+
```
17+
18+
Multiple hooks can be passed per event:
19+
20+
```json
21+
"post-update-content": ["echo one", "echo two"]
22+
```
23+
24+
## Available Hooks
25+
26+
| Order | Command | Hook | Description |
27+
| - | - | - | - |
28+
| 1. | `startup` | `pre-startup` | Before content is updated and apps are launched (config and logger will already be initialized by then). |
29+
| 2. | `update-content` | `pre-update-content` | Before any content is updated. |
30+
| 3. | `update-content` | `post-update-content` | After all content has been updated. |
31+
| 4. | `start-apps` | `pre-start-apps` | Before any app is started. |
32+
| 5. | `start-apps` | `post-start-apps` | After all apps have been started. |
33+
| 6. | `startup` | `post-startup` | After content has been updated and apps have been started. |
34+
| 7. | `shutdown` | `pre-shutdown` | Before launchpad is shut down. |
35+
| 8. | `stop-apps` | `pre-stop-apps` | Before any apps are stopped. |
36+
| 9. | `stop-apps` | `post-stop-apps` | After all apps were stopped. |
37+
| 10. | `shutdown` | `post-shutdown` | After all apps have been stopped and just before launchpad will shutdown. |
38+

0 commit comments

Comments
 (0)