Skip to content
This repository was archived by the owner on Oct 24, 2021. It is now read-only.

Commit 3de06c2

Browse files
committed
Merge branch 'master' into feature/email-2.2
2 parents 3c25000 + 9624e61 commit 3de06c2

File tree

13 files changed

+240
-18
lines changed

13 files changed

+240
-18
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,37 @@ To generate the api boxes, the site uses a file `data/data.js` which is generate
3131
#### Starting hexo
3232

3333
Ensure you've run `npm install`. Then simply `npm start`.
34+
35+
### Developing with local meteor source
36+
37+
When developing jsdoc documentation within the meteor code you will
38+
need to make some local modifications to get the documentation to work locally for testing.
39+
40+
1. Modify `url` in `_config.yml` so links within `localhost:4000` will not jump out to `https://docs.meteor.com`
41+
```diff
42+
- url: http://docs.meteor.com/
43+
+ url: http://localhost:4000/
44+
```
45+
2. reconnect the meteor submodule in `/code` to your local meteor folder.
46+
```bash
47+
# REMOVE submodule
48+
# Remove the submodule entry from .git/config
49+
git submodule deinit -f code
50+
51+
# Remove the submodule directory from the superproject's
52+
# .git/modules directory
53+
rm -rf .git/modules/code
54+
55+
# Remove the entry in .gitmodules and remove the submodule directory
56+
# located at path/to/submodule
57+
git rm -f code
58+
59+
# ADD your local meteor submodule
60+
git submodule add /path/to/local/meteor code
61+
```
62+
63+
3. Hexo builds if you are just changing md files in sources then
64+
hexo will watch for changes and update. If you are making changes
65+
in the `/code` folder then you will need to `npm clean && npm start`.
66+
67+
Of course, do not commit any of these changes.

_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
title: Meteor API Docs
22
subtitle: API Docs
33
versions:
4+
- '2.4'
45
- '2.3'
56
- '2.2'
67
- '2.1'
@@ -26,6 +27,7 @@ sidebar_categories:
2627
null:
2728
- index
2829
- changelog
30+
- install
2931
API:
3032
- api/core
3133
- api/pubsub
@@ -49,6 +51,7 @@ sidebar_categories:
4951
- api/assets
5052
- api/packagejs
5153
- api/mobile-config
54+
- api/environment
5255
Packages:
5356
- packages/accounts-ui
5457
- packages/appcache

jsdoc/docdata-jsdoc-template/publish.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
if (entry.meta && entry.meta.path) {
4949
var packagesFolder = 'packages/';
5050
var index = entry.meta.path.indexOf(packagesFolder);
51-
if (index != -1) {
51+
if (index != -1 && !entry.isprototype) {
5252
var fullFilePath = entry.meta.path.substr(index + packagesFolder.length) + '/' + entry.meta.filename;
5353
entry.filepath = fullFilePath;
5454
entry.lineno = entry.meta.lineno;

package-lock.json

Lines changed: 3 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/api-box.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ var importName = function(doc) {
156156
const noImportNeeded = !doc.module
157157
|| doc.scope === 'instance'
158158
|| doc.ishelper
159+
|| doc.isprototype
159160
|| doc.istemplate;
160161

161162
// override the above we've explicitly decided to (i.e. Template.foo.X)

source/api/core.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ title: Core
33
description: Documentation of core Meteor functions.
44
---
55

6+
If you prefer to watch the video, click below.
7+
8+
{% youtube 6RRVU0-Vvm8 %}
9+
610
{% apibox "Meteor.isClient" %}
711
{% apibox "Meteor.isServer" %}
812

source/api/environment.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Environment
3+
description: Documentation of how to use Meteor.EnvironmentVariable
4+
---
5+
6+
Meteor runs most app code within Fibers, which allows keeping track of the context a function is running in. `Meteor.EnvironmentVariable` works with `Meteor.bindEnvironment`, promises, and many other Meteor API's to preserve the context in async code. Some examples of how it is used in Meteor are to store the current user in methods, and record which arguments have been checked when using `audit-argument-checks`.
7+
8+
```js
9+
const currentRequest = new Meteor.EnvironmentVariable();
10+
11+
function log(message) {
12+
const requestId = currentRequest.get() || 'None';
13+
console.log(`[${requestId}]`, message);
14+
}
15+
16+
17+
currentRequest.withValue('12345', () => {
18+
log('Handling request'); // Logs: [12345] Handling request
19+
});
20+
21+
```
22+
23+
{% apibox "Meteor.EnvironmentVariable" %}
24+
25+
{% apibox "Meteor.EnvironmentVariable.get" %}
26+
27+
{% apibox "Meteor.EnvironmentVariable.withValue" %}
28+
29+
{% apibox "Meteor.bindEnvironment" %}

source/api/methods.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ description: Documentation of Meteor's Method (Remote Procedure Call) API.
55

66
Methods are remote functions that Meteor clients can invoke with [`Meteor.call`](#Meteor-call).
77

8-
If you prefer video watch [Meteor Methods 101](https://www.youtube.com/watch?v=2uoeBq8SF9E) in our [YouTube Channel](https://www.youtube.com/channel/UC3fBiJrFFMhKlsWM46AsAYw).
8+
If you prefer to watch the video, click below.
9+
10+
{% youtube 2uoeBq8SF9E %}
911

1012
{% apibox "Meteor.methods" %}
1113

source/api/pubsub.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ description: Documentation of Meteor's publication and subscription API.
66
These functions control how Meteor servers publish sets of records and
77
how clients can subscribe to those sets.
88

9+
If you prefer to watch the video, click below.
10+
11+
{% youtube RH2RxKgkPJY %}
12+
913
{% apibox "Meteor.publish" %}
1014

1115
To publish records to clients, call `Meteor.publish` on the server with

source/commandline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ required.
3333
This is the default command. Simply running `meteor` is the
3434
same as `meteor run`.
3535

36-
To pass additional options to Node.js use the `SERVER_NODE_OPTIONS` environment variable.
37-
For example: `SERVER_NODE_OPTIONS='--inspect'` or `SERVER_NODE_OPTIONS='--inspect-brk'`
36+
To pass additional options to Node.js use the `SERVER_NODE_OPTIONS` environment variable. E.g. for Windows PowerShell:
37+
`$env:SERVER_NODE_OPTIONS = '--inspect' | meteor run`. Or for Linux: `SERVER_NODE_OPTIONS=--inspect-brk meteor run`.
3838

3939
To specify a port to listen on (instead of the default 3000), use `--port [PORT]`.
4040
(The development server also uses port `N+1` for the default MongoDB instance)

0 commit comments

Comments
 (0)