Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 4 #379

Merged
merged 55 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
92ca887
Export collections for direct access
StorytellerCZ Aug 17, 2021
5b4a479
Merge remote-tracking branch 'Meteor-Community-Packages/master' into …
StorytellerCZ May 7, 2023
1b30560
Merge branch 'master' into feature/export-collections
StorytellerCZ Jul 8, 2023
e35a2a9
Switch collection assignment order
StorytellerCZ Jul 8, 2023
7ba9286
Update versions
StorytellerCZ Jul 8, 2023
9896d70
Use new collection variables in index creations
StorytellerCZ Jul 8, 2023
8b6283a
Merge branch 'master' into feature/export-collections
StorytellerCZ Jul 15, 2023
e41a14a
Account for the new index creation method
StorytellerCZ Jul 15, 2023
5390b7e
Add to history
StorytellerCZ Jul 15, 2023
a934d0e
UI helpers console logs to debugs
StorytellerCZ Aug 24, 2023
2d57e39
Prep package.js for v4
StorytellerCZ Aug 24, 2023
4bcccf2
Merge branch 'master' into v4
StorytellerCZ Aug 24, 2023
57357c9
Merge branch 'master' into v4
jankapunkt Dec 22, 2023
a62f7de
Merge branch 'master' into v4
StorytellerCZ Dec 23, 2023
ce207e0
Merge branch 'master' into v4
StorytellerCZ Mar 7, 2024
d9adc15
Export collections
StorytellerCZ Apr 8, 2024
ab55827
Sync functions only on client
StorytellerCZ Apr 8, 2024
5f3485b
Fix lint tests
StorytellerCZ Apr 8, 2024
a5614b9
Add Meteor 3.0-beta.7 to the test suite
StorytellerCZ Apr 8, 2024
ee76581
Remove sync tests from package.js
StorytellerCZ Apr 8, 2024
d371fed
Fix missing _getParentRoleNames in async common
StorytellerCZ Apr 8, 2024
9ea1ea0
_addUserToRole async fix
StorytellerCZ Apr 8, 2024
87dd82b
Fix _removeUserFromRole async version in tests
StorytellerCZ Apr 8, 2024
8c479ec
Published alanning:[email protected]
StorytellerCZ Apr 8, 2024
ac92c9b
Add missing ddp dependency
StorytellerCZ May 4, 2024
c70d787
4.0-alpha.2 release prep
StorytellerCZ May 4, 2024
54130f4
Published alanning:[email protected]
StorytellerCZ May 4, 2024
be61b3d
Merge branch 'v4' into feature/export-collections
StorytellerCZ May 4, 2024
a29d818
Update test suite to use 3.0-rc.0
StorytellerCZ May 4, 2024
72c343b
Use collections directly internally
StorytellerCZ May 6, 2024
167b14c
Merge pull request #344 from Meteor-Community-Packages/feature/export…
StorytellerCZ May 14, 2024
d7cffee
Merge branch 'master' into v4
StorytellerCZ Jun 8, 2024
bd27146
Update Blaze dependency & Published alanning:[email protected]
StorytellerCZ Jun 8, 2024
560a265
Update for Meteor 3 release
StorytellerCZ Jul 16, 2024
c5d049c
Published alanning:[email protected]
StorytellerCZ Jul 22, 2024
d8aea7c
Update to final Blaze 3 release
StorytellerCZ Jul 22, 2024
675c0b3
Lint fix
StorytellerCZ Jul 22, 2024
4bb9684
Update test suite versions
StorytellerCZ Jul 22, 2024
75355be
Replace countAsync with countDocuments in userIsInRoleAsync
StorytellerCZ Jul 22, 2024
e355dd0
Small modernization
StorytellerCZ Aug 29, 2024
995467b
Revert to using Meteor for collection access
StorytellerCZ Aug 29, 2024
a2142fb
Fix Standard lint issue
StorytellerCZ Aug 29, 2024
4d6a803
Update testapp to Meteor v2.16
StorytellerCZ Aug 29, 2024
c9334f3
Published alanning:[email protected]
StorytellerCZ Aug 29, 2024
93686e5
Update meteortesting:mocha version number
StorytellerCZ Aug 30, 2024
d136e8c
Split testing suite
StorytellerCZ Aug 31, 2024
82d6f65
Fix lint test
StorytellerCZ Aug 31, 2024
7a7e852
Fixed fetch in tests
StorytellerCZ Aug 31, 2024
ea42be8
Fix insert issue with async client tests
StorytellerCZ Sep 5, 2024
c46b2e6
Removed deprecated publication of legacy role assignments
StorytellerCZ Sep 5, 2024
2a0fb72
Fix async client tests
StorytellerCZ Sep 5, 2024
e011833
Handle number in _normalizeOptions
StorytellerCZ Sep 5, 2024
e792f72
Fix backward compatibility for allow rules in tests
StorytellerCZ Sep 5, 2024
5ac1f31
Quick lint fix
StorytellerCZ Sep 5, 2024
02e54a9
Fix typo in Meteor 2 test setup
StorytellerCZ Sep 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ 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

Expand All @@ -36,8 +36,9 @@ jobs:
strategy:
matrix:
meteorRelease:
- '2.8.0'
- '2.14'
- '2.8.1'
- '2.16'
- '3.0'
jankapunkt marked this conversation as resolved.
Show resolved Hide resolved
# Latest version
steps:
- name: Checkout code
Expand All @@ -46,7 +47,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- name: Setup meteor ${{ matrix.meteorRelease }}
uses: meteorengineer/setup-meteor@v1
Expand All @@ -57,8 +58,8 @@ jobs:
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 test
8 changes: 8 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## v4.0.0

* BREAKING: Synchronous functions are now available only on client side
* BREAKING: Migration functions for past versions are no longer available
* 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.

15 changes: 7 additions & 8 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.2',
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,13 +21,13 @@ 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([
Expand All @@ -45,7 +45,7 @@ Package.onTest(function (api) {
'meteortesting:[email protected]'
])

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

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

Expand All @@ -57,7 +57,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
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
Loading