mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge branch 'devel' into tracker-firstRunPromise
This commit is contained in:
@@ -1,69 +1,101 @@
|
||||
# Meteor Project Code of Conduct
|
||||
# Meteor Code of Conduct
|
||||
|
||||
### Community and Diversity
|
||||
Meteor Software and its member projects use [Contributor Covenant v2.0](https://contributor-covenant.org/version/2/0/code_of_conduct) as their code of conduct. The full text is included below in English, and [translations](https://www.contributor-covenant.org/translations) are available on the Contributor Covenant website.
|
||||
|
||||
We want to build a productive, happy and agile community that welcomes new ideas, constantly looks for areas to improve, and fosters collaboration.
|
||||
## Commitment
|
||||
|
||||
The project gains strength from a diversity of backgrounds and perspectives in our contributor community, and we actively seek participation from those who enhance it. This code of conduct exists to lay some ground rules that ensure we can collaborate and communicate effectively, despite our diversity. The code applies equally to founders, team members and those seeking help and guidance.
|
||||
All recipients of reports commit to maintain the confidentiality with regard to the reporter and victim of an incident.
|
||||
|
||||
### Using This Code
|
||||
## Report an issue
|
||||
|
||||
This isn’t an exhaustive list of things that you can’t do. Rather, it’s a guide for participation in the community that outlines how each of us can work to keep Meteor a positive, successful, and growing project.
|
||||
To report an issue in one of the projects listed below, please send an email to code-of-conduct@meteor.com.
|
||||
|
||||
This code of conduct applies to all spaces managed by the Meteor project or company. This includes Slack, GitHub issues, and any other forums created by the Meteor team which the community uses for communication. Breaches of this code outside these spaces may affect a person's ability to participate within them. We expect it to be honored by everyone who represents or participates in the project, whether officially or informally.
|
||||
* [OSS Meteor Projects](https://github.com/meteor)
|
||||
* [Meteor Forum](https://forums.meteor.com/)
|
||||
|
||||
If you believe someone is violating the code of conduct, please report it by emailing [community@meteor.com](mailto:community@meteor.com).
|
||||
## Code of Conduct panel
|
||||
|
||||
### We Strive To:
|
||||
The Code of Conduct panel is a moderation team that handle code of conduct issues. The makeup of this team is as follows:
|
||||
|
||||
- **Be open, patient, and welcoming**
|
||||
* CEO at Meteor Software - Frederico Maia Arantes
|
||||
* DevRel Manager at Meteor Software - Tatiana Barros
|
||||
* Software Engineer at Meteor Software - Denilson Silva
|
||||
* CEO at High Impact Tech - Alim S. Gafar
|
||||
|
||||
Members of this community are open to collaboration, whether it's on PRs, issues, or problems. We're receptive to constructive comment and criticism, as we value what the experiences and skill sets of contributors bring to the project. We're accepting of all who wish to get involved, and find ways for anyone to participate in a way that best matches their strengths.
|
||||
|
||||
- **Be considerate**
|
||||
Members of the CoCP team will be added for a 1-year term and will be re-confirmed on a yearly basis.
|
||||
|
||||
We are considerate of our peers: other Meteor users and contributors. We’re thoughtful when addressing others’ efforts, keeping in mind that work is often undertaken for the benefit of the community. We also value others’ time and appreciate that not every issue or comment will be responded to immediately. We strive to be mindful in our communications, whether in person or online, and we're tactful when approaching views that are different from our own.
|
||||
|
||||
- **Be respectful**
|
||||
## Our Pledge
|
||||
|
||||
As a community of professionals, we are professional in our handling of disagreements, and don’t allow frustration to turn into a personal attack. We work together to resolve conflict, assume good intentions and do our best to act in an empathic fashion.
|
||||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
We do not tolerate harassment or exclusionary behavior. This includes, but is not limited to:
|
||||
- Violent threats or language directed against another person.
|
||||
- Discriminatory jokes and language.
|
||||
- Posting sexually explicit or sexualized content.
|
||||
- Posting content depicting or encouraging violence.
|
||||
- Posting (or threatening to post) other people's personally identifying information ("doxing").
|
||||
- Personal insults, especially those using racist or sexist terms.
|
||||
- Unwelcome sexual attention.
|
||||
- Advocating for, or encouraging, any of the above behavior.
|
||||
- Repeated harassment of others. In general, if someone asks you to stop, then stop.
|
||||
|
||||
- **Take responsibility for our words and our actions**
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
||||
|
||||
We can all make mistakes; when we do, we take responsibility for them. If someone has been harmed or offended, we listen carefully and respectfully. We are also considerate of others’ attempts to amend their mistakes.
|
||||
|
||||
- **Be collaborative**
|
||||
## Our Standards
|
||||
|
||||
The work we produce is (and is part of) an ecosystem containing several parallel efforts working towards a similar goal. Collaboration between teams and individuals that each have their own goal and vision is essential to reduce redundancy and improve the quality of our work.
|
||||
|
||||
Internally and externally, we celebrate good collaboration. Wherever possible, we work closely with upstream projects and others in the free software community to coordinate our efforts. We prefer to work transparently and involve interested parties as early as possible.
|
||||
|
||||
- **Ask for help when in doubt**
|
||||
Examples of behavior that contributes to a positive environment for our community include:
|
||||
|
||||
Nobody is expected to be perfect in this community. Asking questions early avoids many problems later, so questions are encouraged, though they may be directed to the appropriate forum. Those who are asked should be responsive and helpful.
|
||||
|
||||
- **Take initiative**
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility apologizing to those affected by our mistakes, and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall community
|
||||
|
||||
We encourage new participants to feel empowered to lead, to take action, and to experiment when they feel innovation could improve the project. If we have an idea for a new tool, or how an existing tool can be improved, we speak up and take ownership of that work when possible.
|
||||
|
||||
### Attribution
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
Sections of this Code of Conduct were inspired in by the following Codes from other open source projects and resources we admire:
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others’ private information, such as a physical or email address, without their explicit permission
|
||||
* Other conduct that could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
- [The Contributor Covenant](https://www.contributor-covenant.org/version/1/4/code-of-conduct/)
|
||||
- [Python](https://www.python.org/psf/codeofconduct/)
|
||||
- [Ubuntu](https://ubuntu.com/community/code-of-conduct)
|
||||
- [Django](https://www.djangoproject.com/conduct/)
|
||||
## Enforcement Responsibilities
|
||||
|
||||
*This Meteor Code of Conduct is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/) license. This Code was last updated on August 28, 2017.*
|
||||
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct and will communicate reasons for moderation decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at the email addresses listed above in the Reporting section. All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact:** Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence:** A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact:** A violation through a single incident or series of actions.
|
||||
|
||||
**Consequence:** A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period. This includes avoiding interactions in community space and external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact:** A serious violation of community standards, including sustained inappropriate behavior.
|
||||
|
||||
**Consequence:** A temporary ban from anf interaction or public communication with the community for a specified period. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact:** Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from public interaction within the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at https://www.contributor-covenant.org/version/2/0/code\_of\_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [OpenJS's code of conduct](https://github.com/openjs-foundation/cross-project-council/blob/main/CODE_OF_CONDUCT.md) enforcement ladder.
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
|
||||
|
||||
@@ -29,8 +29,8 @@ versioned-netlify-redirects:
|
||||
netlify_site_id: meteor-docs
|
||||
|
||||
logo:
|
||||
title:
|
||||
subtitle: Docs
|
||||
title: Meteor
|
||||
subtitle: API Docs
|
||||
|
||||
sidebar_categories:
|
||||
null:
|
||||
|
||||
626
docs/package-lock.json
generated
626
docs/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -17,8 +17,8 @@
|
||||
"hexo-server": "1.0.0",
|
||||
"hexo-versioned-netlify-redirects": "1.1.0",
|
||||
"jsdoc": "3.5.5",
|
||||
"@meteorjs/meteor-hexo-config": "1.0.13",
|
||||
"@meteorjs/meteor-theme-hexo": "2.0.7",
|
||||
"@meteorjs/meteor-hexo-config": "1.0.14",
|
||||
"@meteorjs/meteor-theme-hexo": "2.0.8",
|
||||
"showdown": "1.9.1",
|
||||
"underscore": "1.13.1"
|
||||
},
|
||||
|
||||
@@ -346,3 +346,7 @@ of legitimate users by attempting all possible passwords.
|
||||
These rate limiting rules can be removed by calling
|
||||
`Accounts.removeDefaultRateLimit()`. Please see the
|
||||
[`DDPRateLimiter`](#ddpratelimiter) docs for more information.
|
||||
|
||||
{% apibox "AccountsServer#addDefaultRateLimit" %}
|
||||
|
||||
{% apibox "AccountsServer#removeDefaultRateLimit" %}
|
||||
|
||||
@@ -81,45 +81,33 @@ is automatically stopped and won't be rerun.
|
||||
|
||||
### Tracker.autorun and async callbacks
|
||||
`Tracker.autorun` can accept an `async` callback function.
|
||||
However, to make the async call reactive, you should wrap your async function in
|
||||
a `Tracker.withComputation` call.
|
||||
|
||||
```javascript
|
||||
Tracker.autorun(async function example1(computation) {
|
||||
let asyncData = await asyncDataFunction();
|
||||
let users =
|
||||
await Tracker.withComputation(computation, () => Meteor.users.find({}).fetch());
|
||||
});
|
||||
```
|
||||
> If you want to get computation in other way you can use `Tracker.currentComputation`
|
||||
|
||||
To preserve reactivity for the reactive variables inside the async callback function, you must use a `Tracker.withComputation` call as described below:
|
||||
|
||||
{% apibox "Tracker.withComputation" %}
|
||||
|
||||
In general, the rules to use `Tracker.withComputation` like this:
|
||||
1. `async` function *before the first* `await` if just like a sync one.
|
||||
2. `async` function *after the first* `await` looses the `Tracker.currentComputation`
|
||||
but it can be restored using `Tracker.withComputation`, *but only within the callback*.
|
||||
|
||||
If you have for example:
|
||||
|
||||
```javascript
|
||||
Tracker.autorun(async function (computation) {
|
||||
let asyncData = await someAsyncCall();
|
||||
let links = await LinksCollection.find({}).fetch();
|
||||
// code above will not trigger reruns.
|
||||
Tracker.autorun(async function example1(computation) {
|
||||
// Code before the first await will stay reactive.
|
||||
reactiveVar1.get(); // This will trigger a rerun.
|
||||
|
||||
let links = await LinksCollection.findAsync({}).fetch(); // First async call will stay reactive.
|
||||
|
||||
// Code after the first await looses Tracker.currentComputation: no reactivity.
|
||||
reactiveVar2.get(); // This won't trigger a rerun.
|
||||
|
||||
// You can bring back reactivity with the Tracker.withCompuation wrapper:
|
||||
let users = await Tracker.withComputation(computation, () => Meteor.users.findAsync({}).fetch());
|
||||
|
||||
// Code below will again not be reactive, so you will need another Tracker.withComputation.
|
||||
const value = Tracker.withComputation(computation, () => reactiveVar3.get()); // This will trigger a rerun.
|
||||
});
|
||||
```
|
||||
You can make this example reactive by wrapping the `Meteor.users.find` call in a `Tracker.withComputation` call:
|
||||
|
||||
```javascript
|
||||
Tracker.autorun(async function (computation) {
|
||||
let asyncData = await someAsyncCall();
|
||||
let users =
|
||||
await Tracker.withComputation(computation, () => Meteor.users.find({}).fetch());
|
||||
// code above will trigger reruns.
|
||||
});
|
||||
```
|
||||
As a rule of thumb, you are okay with wrapping all reactive statements inside a `Tracker.withComputation` to preserve current computation.
|
||||
But it comes at a performance cost - it should be used only where needed.
|
||||
|
||||
Reason behind is, that an await implicitly *"moves"* the code below in a Promise resolved function. When this function runs (after it has been fetched from the micro task queue), `Tracker.withComputation` preserves the reference to the computation of the `Tracker.autorun`.
|
||||
|
||||
The `react-meteor-data` package uses `Tracker.withComputation` to make the `useTracker` accept async callbacks.
|
||||
More can be seen [here](https://github.com/meteor/react-packages/tree/master/packages/react-meteor-data#maintaining-the-reactive-context)
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
title: Docs
|
||||
---
|
||||
|
||||
> Meteor 2.x runs on a deprecated Node.js version (14). Meteor 3.0 is in progress, and it will run on the latest Node.js version. For more information, please consult our [migration guide](https://guide.meteor.com/3.0-migration.html).
|
||||
|
||||
<!-- XXX: note that this content is somewhat duplicated on the guide, and should be updated in parallel -->
|
||||
<h2 id="what-is-meteor">What is Meteor?</h2>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ You need to install the Meteor command line tool to create, run, and manage your
|
||||
|
||||
<h3 id="prereqs-node">Node.js version</h3>
|
||||
|
||||
> Meteor 2.x runs on a deprecated Node.js version (14). Meteor 3.0 is in progress, and it will run on the latest Node.js version. For more information, please consult our [migration guide](https://guide.meteor.com/3.0-migration.html).
|
||||
|
||||
- Node.js version >= 10 and <= 14 is required.
|
||||
- We recommend you using [nvm](https://github.com/nvm-sh/nvm) or [Volta](https://volta.sh/) for managing Node.js versions.
|
||||
|
||||
@@ -28,7 +30,7 @@ You need to install the Meteor command line tool to create, run, and manage your
|
||||
|
||||
Install the latest official version of Meteor.js from your terminal by running one of the commands below. You can check our [changelog](https://docs.meteor.com/changelog.html) for the release notes.
|
||||
|
||||
> Run `node -v` to ensure you are using Node.js 14.
|
||||
> Run `node -v` to ensure you are using Node.js 14. Meteor 3.0 is in progress, and it will run on the latest Node.js version.
|
||||
|
||||
For Windows, Linux and OS X, you can run the following command:
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ versioned-netlify-redirects:
|
||||
netlify_site_id: meteor-guide
|
||||
|
||||
logo:
|
||||
title:
|
||||
title: Meteor
|
||||
subtitle: Guide
|
||||
|
||||
sidebar_categories:
|
||||
@@ -43,6 +43,7 @@ sidebar_categories:
|
||||
- code-style
|
||||
- structure
|
||||
- 2.13-migration
|
||||
- 3.0-migration
|
||||
- prepare-meteor-3.0
|
||||
Data:
|
||||
- collections
|
||||
|
||||
2010
guide/package-lock.json
generated
2010
guide/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -14,8 +14,8 @@
|
||||
"hexo-renderer-marked": "2.0.0",
|
||||
"hexo-server": "1.0.0",
|
||||
"hexo-versioned-netlify-redirects": "1.1.0",
|
||||
"@meteorjs/meteor-hexo-config": "1.0.13",
|
||||
"@meteorjs/meteor-theme-hexo": "2.0.7"
|
||||
"@meteorjs/meteor-hexo-config": "1.0.14",
|
||||
"@meteorjs/meteor-theme-hexo": "2.0.8"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "chexo @meteorjs/meteor-hexo-config -- generate",
|
||||
|
||||
@@ -14,6 +14,8 @@ If you are using [Meteor Cloud](https://www.meteor.com/cloud) default base image
|
||||
|
||||
<h3 id="known-issues"> Known Issues in Meteor 2.13 </h3>
|
||||
|
||||
> This issue was solved in Meteor 2.13.3.
|
||||
|
||||
When migrating to Meteor 2.13, some users might encounter the following error when updating:
|
||||
|
||||
```shell
|
||||
@@ -28,18 +30,16 @@ Error: incorrect data check
|
||||
|
||||
```
|
||||
|
||||
In those cases, the workaround while our developers are working on this issue is as follows:
|
||||
<h3 id="solution"> Solution </h3>
|
||||
|
||||
Running the following command in your terminal:
|
||||
The solution for this issue is running the following command in your terminal:
|
||||
|
||||
```shell
|
||||
|
||||
curl https://install.meteor.com/\?release\=2.12 | sh
|
||||
curl https://install.meteor.com/\?release\=2.13.3 | sh
|
||||
|
||||
```
|
||||
|
||||
For more information, check our [known issues section](https://docs.meteor.com/known-issues).
|
||||
|
||||
<h2 id="older-versions">Migrating from a version older than 2.12?</h2>
|
||||
|
||||
If you're migrating from a version of Meteor older than Meteor 2.12, there may
|
||||
|
||||
43
guide/source/3.0-migration.md
Normal file
43
guide/source/3.0-migration.md
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
title: Migrating to Meteor 3.0
|
||||
description: How to migrate your application to Meteor 3.0.
|
||||
---
|
||||
|
||||
> **This guide will be created as we get closer to the Meteor 3.0 beta release.** We are also evaluating new documentation platforms to improve the experience of our users.
|
||||
|
||||
## What's the status of version 3.0?
|
||||
|
||||
**Latest version:** `3.0-alpha.18` <br/>
|
||||
**Node.js version:** `20.9.0 LTS`
|
||||
|
||||
Meteor 3.0 is in alpha and not recommended for production. You can check the "[Release 3.0 Pull Request](https://github.com/meteor/meteor/pull/12359)" to see what is being changed.
|
||||
|
||||
## How to prepare for version 3.0?
|
||||
|
||||
You can follow the guide "[How to migrate to Meteor Async in Meteor 2.x](/prepare-meteor-3.0.html)" to help you prepare your application for the new version by starting to use async methods.
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
### How to test Meteor 3.0?
|
||||
|
||||
You can create a new Meteor 3.0 project by running the command below:
|
||||
|
||||
```bash
|
||||
meteor create my-new-project --release 3.0.0-alpha.18
|
||||
```
|
||||
|
||||
### How to update from version 2?
|
||||
|
||||
You can update your Meteor 2.x project by running the command below inside your project folder:
|
||||
|
||||
```bash
|
||||
meteor update --release 3.0.0-alpha.18
|
||||
```
|
||||
|
||||
### How to follow the progress on version 3?
|
||||
|
||||
The best way to follow the progress is by checking the "[What's left until an official Meteor 3.0?](https://github.com/meteor/meteor/discussions/12865)" discussion. We have also been sharing constant updates on [this topic](https://forums.meteor.com/t/fibers-public-roadmap-and-meteor-3-0/59627/84) in our forum.
|
||||
|
||||
### When will Meteor 3.0 be ready?
|
||||
|
||||
Our plan is to release the beta version by the end of Q4 2023. An official version will depend a lot on user feedback, but we are aiming to release by the end of Q1 2024.
|
||||
@@ -280,7 +280,7 @@ For more details about the data stored in the user database, read the section be
|
||||
|
||||
Now that you have the access token, you need to actually make a request to the appropriate API. Here you have two options:
|
||||
|
||||
1. Use the [`http` package](http://docs.meteor.com/#/full/http) to access the service's API directly. You'll probably need to pass the access token from above in a header. For details you'll need to search the API documentation for the service.
|
||||
1. Use the [`fetch` package](https://docs.meteor.com/packages/fetch.html) to access the service's API directly. You'll probably need to pass the access token from above in a header. For details you'll need to search the API documentation for the service.
|
||||
2. Use a package from Atmosphere or npm that wraps the API into a nice JavaScript interface. For example, if you're trying to load data from Facebook you could use the [fbgraph](https://www.npmjs.com/package/fbgraph) npm package. Read more about how to use npm with your app in the [Build System article](build-tool.html#npm).
|
||||
|
||||
<h2 id="displaying-user-data">Loading and displaying user data</h2>
|
||||
|
||||
@@ -3,6 +3,8 @@ title: Introduction
|
||||
description: This is the guide for using Meteor, a full-stack JavaScript platform for developing modern web and mobile applications.
|
||||
---
|
||||
|
||||
> Meteor 2.x runs on a deprecated Node.js version (14). Meteor 3.0 is in progress, and it will run on the latest Node.js version. For more information, please consult our [migration guide](https://guide.meteor.com/3.0-migration.html).
|
||||
|
||||
<!-- XXX: note that this content is somewhat duplicated on the docs, and should be updated in parallel -->
|
||||
<h2 id="what-is-meteor">What is Meteor?</h2>
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ This is similar to test mode, with key differences:
|
||||
|
||||
This means that the entirety of your application (including for instance the web server and client side router) is loaded and will run as normal. This enables you to write much more [complex integration tests](#full-app-integration-test) and also load additional files for [acceptance tests](#acceptance-testing).
|
||||
|
||||
Note that there is another test command in the Meteor tool; `meteor test-packages` is a way of testing Atmosphere packages, which is discussed in the [Writing Packages article](writing-packages.html#testing).
|
||||
Note that there is another test command in the Meteor tool; `meteor test-packages` is a way of testing Atmosphere packages, which is discussed in the [Writing Packages article](https://guide.meteor.com/writing-atmosphere-packages.html).
|
||||
|
||||
<h3 id="driver-packages">Driver packages</h3>
|
||||
|
||||
|
||||
@@ -264,14 +264,20 @@ Read more about using Cordova in the [mobile guide](mobile.html).
|
||||
|
||||
<h2 id="testing">Testing packages</h2>
|
||||
|
||||
Meteor has a test mode for packages called `meteor test-packages`. If you are in a package's directory, you can run
|
||||
Meteor has a test mode for packages invoked with the `meteor test-packages` command. Navigate to your package's directory and then use the command to run a special app containing only a "test" version of your package.
|
||||
|
||||
If you are using [Tinytest](https://github.com/meteor/meteor/tree/devel/packages/tinytest) for your package's tests, you can run:
|
||||
|
||||
```bash
|
||||
meteor test-packages ./
|
||||
```
|
||||
|
||||
If you are using a different testing framework for your package's tests, you'll need to specify a `driver-package`. For example, if you are using Mocha, run the following to start the Mocha [test driver package](testing.html#driver-packages):
|
||||
|
||||
```bash
|
||||
meteor test-packages ./ --driver-package meteortesting:mocha
|
||||
```
|
||||
|
||||
This will run a special app containing only a "test" version of your package and start a Mocha [test driver package](testing.html#driver-packages).
|
||||
|
||||
When your package starts in test mode, rather than loading the `onUse` block, Meteor loads the `onTest` block:
|
||||
|
||||
```js
|
||||
@@ -294,7 +300,7 @@ You can read more about testing in Meteor in the [Testing article](testing.html)
|
||||
|
||||
<h2 id="publishing-atmosphere">Publishing your package</h2>
|
||||
|
||||
To publish your package to Atmosphere, run [`meteor publish`](http://docs.meteor.com/#/full/meteorpublish) from the package directory. To publish a package the package name must follow the format of `username:my-package` and the package must contain a [SemVer version number](#version-constraints).
|
||||
To publish your package to Atmosphere for the first time, run [`meteor publish --create`](http://docs.meteor.com/#/full/meteorpublish) from the package directory. The package name must follow the format of `username:my-package` and the package must contain a [SemVer version number](#version-constraints). When you want to publish an update to your package, change the version number in `package.js` and then run `meteor publish`.
|
||||
|
||||
> Note that if you have a local `node_modules` directory in your package, remove it before running `meteor publish`. While local `node_modules` directories are allowed in Meteor packages, their paths can collide with the paths of `Npm.depends` dependencies when published.
|
||||
|
||||
|
||||
@@ -1364,15 +1364,23 @@ export class AccountsServer extends AccountsCommon {
|
||||
}
|
||||
};
|
||||
|
||||
// Removes default rate limiting rule
|
||||
/**
|
||||
* @summary Removes default rate limiting rule
|
||||
* @locus Server
|
||||
* @importFromPackage accounts-base
|
||||
*/
|
||||
removeDefaultRateLimit() {
|
||||
const resp = DDPRateLimiter.removeRule(this.defaultRateLimiterRuleId);
|
||||
this.defaultRateLimiterRuleId = null;
|
||||
return resp;
|
||||
};
|
||||
|
||||
// Add a default rule of limiting logins, creating new users and password reset
|
||||
// to 5 times every 10 seconds per connection.
|
||||
/**
|
||||
* @summary Add a default rule of limiting logins, creating new users and password reset
|
||||
* to 5 times every 10 seconds per connection.
|
||||
* @locus Server
|
||||
* @importFromPackage accounts-base
|
||||
*/
|
||||
addDefaultRateLimit() {
|
||||
if (!this.defaultRateLimiterRuleId) {
|
||||
this.defaultRateLimiterRuleId = DDPRateLimiter.addRule({
|
||||
|
||||
Reference in New Issue
Block a user