Skip to content

Commit b97c93b

Browse files
authored
Merge pull request #183 from Meteor-Community-Packages/feature/meteor-3
Meteor 3
2 parents d61bf53 + fd5ec99 commit b97c93b

18 files changed

Lines changed: 920 additions & 835 deletions

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ jobs:
1111
name: Javascript standard lint
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-node@v3
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 18
17+
node-version: 20
1818
- name: cache dependencies
19-
uses: actions/cache@v3
19+
uses: actions/cache@v4
2020
with:
2121
path: ~/.npm
22-
key: ${{ runner.os }}-node-18-${{ hashFiles('**/package-lock.json') }}
22+
key: ${{ runner.os }}-node-20-${{ hashFiles('**/package-lock.json') }}
2323
restore-keys: |
24-
${{ runner.os }}-node-18-
24+
${{ runner.os }}-node-20-
2525
- name: Install dependencies
2626
run: npm ci
2727
- name: Run lint

.github/workflows/testsuite.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# the test suite runs the tests (headless, server+client) for multiple Meteor releases
1+
# the test suite runs the tests (headless, server+client) for Meteor 3
22
name: Test suite
33
on:
44
push:
@@ -10,20 +10,18 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
strategy:
13+
fail-fast: false
1314
matrix:
1415
meteorRelease:
15-
- "--release 2.7"
16-
- "--release 2.8.1"
17-
- "--release 2.15"
18-
# Latest version
16+
- "--release 3.0"
1917
steps:
2018
- name: Checkout code
2119
uses: actions/checkout@v4
2220

2321
- name: Install Node.js
2422
uses: actions/setup-node@v4
2523
with:
26-
node-version: "14.x"
24+
node-version: "20.x"
2725

2826
- name: Install Dependencies
2927
run: |

Contributing.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ In order to `meteor publish`, you will need to be added as a maintainer to this
1414
meteor admin maintainers mizzao:user-status --list
1515
```
1616

17-
# Travis CI
17+
# GitHub Actions
1818

19-
To be written.
19+
Continuous integration runs with GitHub Actions:
20+
21+
- lint checks run in `.github/workflows/lint.yml`
22+
- package tests run in `.github/workflows/testsuite.yml`
23+
- CodeQL analysis runs in `.github/workflows/codeql.yml`
2024

21-
See https://travis-ci.org/Meteor-Community-Packages/meteor-user-status
25+
See https://github.com/Meteor-Community-Packages/meteor-user-status/actions
2226

2327
# Pushing a demo
2428

2529
To be written.
2630

2731
We host the demo at https://user-status.meteorapp.com.
28-

History.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
## vNEXT
22

3-
## v1.1.1
3+
## v2.0.0
44
* Add newer Meteor versions to `versionsFrom`
5+
* Minimum Meteor version is 3.0
6+
* onStartup add defer and default query [PR](https://github.com/Meteor-Community-Packages/meteor-user-status/pull/163) [@Sergeant61](https://github.com/Sergeant61)
7+
* Completed async/Fibers compatibility work for Meteor 3
8+
* Updated to eslint v9
9+
* Updated `mizzao:timesync` compatibility to use the stable Meteor 3 `1.0.0` release
10+
* Published release candidate `2.0.0-rc.3`
11+
* Published release candidate `2.0.0-rc.4` targeting Meteor 3 only
12+
* Removed remaining legacy CI documentation and completed the move to GitHub Actions
513

614
## v1.1.0
715

@@ -24,7 +32,7 @@
2432
* Upgraded timesync to 0.5.1
2533
* Formatted all JS, CSS, and HTML files to jsbeautify specs
2634
* Updated all references of github.com/mizzao to github.com/Meteor-Community-Packages
27-
* Changed TravisCI to use Node 8.15.1 and added lint checks
35+
* Updated CI to use Node 8.15.1 and added lint checks
2836
* Added Visual Studio Code settings.json
2937
* Changed all tabs to 2 spaces
3038
* Minimum meteor requirement now 1.7.0.5

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ Install using Meteor:
2424
$ meteor add mizzao:user-status
2525
```
2626

27+
### Compatibility
28+
29+
The `2.0.0` release candidates target Meteor 3.0 and newer, and use the stable
30+
`mizzao:timesync@1.0.0` package. Meteor 2.x applications should stay on the
31+
`1.x` line of this package until the application is ready to migrate to Meteor 3.
32+
2733
Additionally, note that to read client IP addresses properly, you must set the
2834
`HTTP_FORWARDED_COUNT` environment variable for your app, and make sure that IP
2935
address headers are forwarded for any reverse proxy installed in front of the
@@ -117,7 +123,9 @@ The `UserStatus.connections` (in-memory) collection contains information for all
117123

118124
#### startupQuerySelector (Optional)
119125

120-
On startup `meteor-user-status` automatically resets all users to `offline` and then marks each `online` as connections are reestablished.
126+
On startup `meteor-user-status` automatically resets online users to `offline`
127+
using the default selector `{ "status.online": true }`, then marks users
128+
`online` again as connections are reestablished.
121129

122130
To customize this functionality you can use the `startupQuerySelector` [Meteor package option](https://docs.meteor.com/api/packagejs.html#options) like this:
123131
```javascript
@@ -199,8 +207,9 @@ The `UserStatus.events` object is an `EventEmitter` on which you can listen for
199207
Check out https://github.com/mizzao/meteor-accounts-testing for a simple accounts drop-in that you can use to test your app - this is also used in the demo.
200208

201209
#### Startup selector
202-
By default, the startup selector for resetting user status is `{}`.
203-
If you want to change that you can set the default selector in your settings.json file:
210+
By default, the startup selector for resetting user status is
211+
`{ "status.online": true }`. If you want to change that you can set the default
212+
selector in your settings.json file:
204213

205214
```json
206215
{

client/monitor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ export const MonitorInternals = {
6565
},
6666

6767
reportIdle(time) {
68-
return Meteor.call('user-status-idle', time);
68+
return Meteor.callAsync('user-status-idle', time);
6969
},
7070

7171
reportActive(time) {
72-
return Meteor.call('user-status-active', time);
72+
return Meteor.callAsync('user-status-active', time);
7373
}
7474

7575
};

eslint.config.mjs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import globals from 'globals';
2+
import babelParser from '@babel/eslint-parser';
3+
import path from 'node:path';
4+
import { fileURLToPath } from 'node:url';
5+
import js from '@eslint/js';
6+
import { FlatCompat } from '@eslint/eslintrc';
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const compat = new FlatCompat({
11+
baseDirectory: __dirname,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all
14+
});
15+
16+
export default [{
17+
ignores: ["node_modules/*", "packages/*", "**/phantom_runner.js", "**/start_test.js", "**/eslint.config.mjs"],
18+
}, ...compat.extends("eslint:recommended"), {
19+
languageOptions: {
20+
globals: {
21+
...globals.node,
22+
...globals.commonjs,
23+
Atomics: "readonly",
24+
SharedArrayBuffer: "readonly",
25+
},
26+
27+
parser: babelParser,
28+
ecmaVersion: 2018,
29+
sourceType: "module",
30+
31+
parserOptions: {
32+
allowImportExportEverywhere: true,
33+
requireConfigFile: false,
34+
},
35+
},
36+
37+
rules: {
38+
"linebreak-style": ["error", "unix"],
39+
quotes: ["error", "single"],
40+
semi: ["error", "always"],
41+
"no-console": "off",
42+
},
43+
}];

0 commit comments

Comments
 (0)