Skip to content

Commit

Permalink
Merge pull request #379 from Meteor-Community-Packages/v4
Browse files Browse the repository at this point in the history
Version 4
  • Loading branch information
jankapunkt authored Sep 5, 2024
2 parents 0a09132 + 02e54a9 commit f7827cf
Show file tree
Hide file tree
Showing 38 changed files with 7,825 additions and 3,656 deletions.
56 changes: 43 additions & 13 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,34 @@ jobs:
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- name: cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-16-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node-20-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-16-
${{ runner.os }}-node-20-
- run: cd testapp && npm ci && npm run setup && npm run lint
- run: cd testapp3 && npm ci && npm run setup && npm run lint

test:
name: Meteor package tests
test2:
name: Meteor package tests 2.16
needs: [lint]
runs-on: ubuntu-latest
strategy:
matrix:
meteorRelease:
- '2.8.0'
- '2.14'
# Latest version
- '2.16'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 14

- name: Setup meteor ${{ matrix.meteorRelease }}
uses: meteorengineer/setup-meteor@v1
Expand All @@ -57,8 +55,40 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-16-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node-14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-16-
${{ runner.os }}-node-14-
- run: cd testapp && npm ci && npm run setup && npm run test
- run: cd testapp2 && npm ci && npm run setup && npm run test

test3:
name: Meteor package tests 3.0.2
needs: [lint]
runs-on: ubuntu-latest
strategy:
matrix:
meteorRelease:
- '3.0.2'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup meteor ${{ matrix.meteorRelease }}
uses: meteorengineer/setup-meteor@v1
with:
meteor-release: ${{ matrix.meteorRelease }}

- name: cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-20-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-20-
- run: cd testapp3 && npm ci && npm run setup && npm run test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ docs/
node_modules/
.npm/
.coverage/

examples/react-teams/.meteor/local/build/programs/server/node_modules
126 changes: 64 additions & 62 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,62 +1,64 @@
[email protected]
alanning:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
lmieulet:[email protected]
lmieulet:[email protected]
local-test:alanning:[email protected]
[email protected]
[email protected]
[email protected]
meteortesting:[email protected]
meteortesting:[email protected]
meteortesting:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
zodern:[email protected]
[email protected]
alanning:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
lmieulet:[email protected]
lmieulet:[email protected]
local-test:alanning:[email protected]
[email protected]
[email protected]
[email protected]
meteortesting:[email protected]
meteortesting:[email protected]
meteortesting:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
zodern:[email protected]
9 changes: 9 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## v4.0.0

* BREAKING: Synchronous functions are now available only on client side
* BREAKING: Migration functions for past versions are no longer available
* Removed deprecated publication of legacy role assignments
* UI Helpers now use `console.debug` for debugging messages
* `RolesCollection` and `RoleAssignmentsCollection` can now be exported in addition to being accessed via `Meteor.roles` and `Meteor.roleAssignment`
* Support for Meteor 3

## v3.6.3

* Added missing dependency on the `ddp` package [@storytellercz](https://github.com/sponsors/StorytellerCZ)
Expand Down
5 changes: 5 additions & 0 deletions definitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@ declare namespace Roles {

} // module

// Exported collections
declare type RolesCollection = Mongo.Collection<Roles.Role>
declare type RoleAssignmentsCollection = Mongo.Collection<Roles.RoleAssignment>

// Additions to the Meteor object
declare module 'meteor/meteor' {
namespace Meteor {
const roles: Mongo.Collection<Roles.Role>
Expand Down
5 changes: 4 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 10 additions & 12 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

Package.describe({
summary: 'Authorization package for Meteor',
version: '3.6.3',
version: '4.0.0-rc.3',
git: 'https://github.com/Meteor-Community-Packages/meteor-roles.git',
name: 'alanning:roles'
})

Package.onUse(function (api) {
api.versionsFrom(['2.8.0'])
api.versionsFrom(['2.8.1', '3.0'])

const both = ['client', 'server']

Expand All @@ -21,31 +21,30 @@ Package.onUse(function (api) {
'ddp'
], both)

api.use('zodern:[email protected].11')
api.use('zodern:[email protected].13')

api.use(['[email protected]'], 'client', { weak: true })
api.use(['[email protected] || 3.0.0'], 'client', { weak: true })

api.export('Roles')
api.export(['Roles', 'RolesCollection', 'RoleAssignmentCollection'])

api.addFiles('roles/roles_common.js', both)
api.addFiles('roles/roles_client.js', 'client')
api.addFiles('roles/roles_common_async.js', both)
api.addFiles('roles/roles_server.js', 'server')
api.addFiles([
'roles/client/debug.js',
'roles/client/uiHelpers.js',
'roles/client/subscriptions.js'
'roles/client/uiHelpers.js'
], 'client')
})

Package.onTest(function (api) {
// Add code coverage
api.use([
'lmieulet:meteor-legacy-coverage',
'lmieulet:[email protected]',
'meteortesting:[email protected]'
'lmieulet:[email protected] || 5.0.0',
'meteortesting:[email protected] || 3.2.0'
])

api.versionsFrom(['2.3', '2.8.1'])
api.versionsFrom(['2.8.1', '3.0'])

const both = ['client', 'server']

Expand All @@ -57,7 +56,6 @@ Package.onTest(function (api) {
'mongo'
], both)

api.addFiles('roles/tests/server.js', 'server')
api.addFiles('roles/tests/serverAsync.js', 'server')
api.addFiles('roles/tests/client.js', 'client')
api.addFiles('roles/tests/clientAsync.js', 'client')
Expand Down
18 changes: 0 additions & 18 deletions roles/client/subscriptions.js

This file was deleted.

8 changes: 4 additions & 4 deletions roles/client/uiHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ Roles._uiHelpers = {
// Register UI helpers
//

if (Roles.debug && console.log) {
console.log('[roles] Roles.debug =', Roles.debug)
if (Roles.debug && console.debug) {
console.debug('[roles] Roles.debug =', Roles.debug)
}

if (typeof Package.blaze !== 'undefined' &&
typeof Package.blaze.Blaze !== 'undefined' &&
typeof Package.blaze.Blaze.registerHelper === 'function') {
Object.entries(Roles._uiHelpers).forEach(([name, func]) => {
if (Roles.debug && console.log) {
console.log('[roles] registering Blaze helper \'' + name + '\'')
if (Roles.debug && console.debug) {
console.debug('[roles] registering Blaze helper \'' + name + '\'')
}
Package.blaze.Blaze.registerHelper(name, func)
})
Expand Down
Loading

0 comments on commit f7827cf

Please sign in to comment.