Skip to content

Commit

Permalink
Merge branch 'master' into fix-386
Browse files Browse the repository at this point in the history
  • Loading branch information
StorytellerCZ authored May 7, 2023
2 parents 84b06c3 + 056cb4a commit 1b88531
Show file tree
Hide file tree
Showing 47 changed files with 1,650 additions and 237 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [StorytellerCZ]
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Issues include as much detail as possible:
- [ ] A descriptive title
- [ ] A description of the problem you're trying to solve, including *why* you think this is a problem
- [ ] An overview of the suggested solution (if you have an idea)
- [ ] If the feature changes current behavior, reasons why your solution is better
- [ ] Provide with an example of the publication and the mutation that you do
- [ ] Enabled "debug" inside the package and show us some meaningful logs
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
meteor: [1.12.2, 2.6.1, 2.7.3, 2.9.1]

steps:
- uses: actions/checkout@v3

- name: Setup Meteor
uses: meteorengineer/setup-meteor@v1
with:
meteor-release: ${{ matrix.meteor }}
- name: Setup tests
run: |
meteor create --release ${{ matrix.meteor }} --bare test
cd test
meteor npm i --save selenium-webdriver@3.6.0 chromedriver@2.36.0 simpl-schema@1.13.1 chai
- name: Test
working-directory: ./test
run: METEOR_PACKAGE_DIRS="../" TEST_BROWSER_DRIVER=chrome meteor test-packages --once --driver-package meteortesting:mocha ../
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.DS_Store
.DS_Store

.idea/
node_modules/
89 changes: 62 additions & 27 deletions .npm/package/npm-shrinkwrap.json

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

34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
allow-deny@1.1.1
babel-compiler@7.10.1
babel-runtime@1.5.1
base64@1.0.12
binary-heap@1.0.11
boilerplate-generator@1.7.1
caching-compiler@1.2.2
callback-hook@1.4.0
check@1.3.2
coffeescript@2.4.1
coffeescript-compiler@2.4.1
cultofcoders:grapher@1.4.1
dburles:mongo-collection-instances@0.3.5
ddp@1.4.1
ddp-client@2.6.1
ddp-common@1.4.0
ddp-server@2.6.0
diff-sequence@1.1.2
dynamic-import@0.7.2
ecmascript@0.16.4
ecmascript-runtime@0.8.0
ecmascript-runtime-client@0.12.1
ecmascript-runtime-server@0.11.0
ejson@1.1.3
fetch@0.1.2
geojson-utils@1.0.11
herteby:denormalize@0.6.6
id-map@1.1.1
inter-process-messaging@0.1.1
lai:collection-extensions@0.2.1_1
local-test:cultofcoders:grapher@1.4.1
logging@1.3.1
matb33:collection-hooks@1.1.2
meteor@1.10.3
meteortesting:browser-tests@0.1.2
meteortesting:mocha@0.4.4
minimongo@1.9.1
modern-browsers@0.1.9
modules@0.19.0
modules-runtime@0.13.1
mongo@1.16.3
mongo-decimal@0.1.3
mongo-dev-server@1.1.0
mongo-id@1.0.8
npm-mongo@4.12.1
ordered-dict@1.1.0
peerlibrary:extend-publish@0.6.0
peerlibrary:subscription-scope@0.5.0
practicalmeteor:mocha-core@1.0.1
promise@0.12.2
random@1.2.1
react-fast-refresh@0.2.3
reactive-var@1.0.12
reload@1.3.1
retry@1.1.0
reywood:publish-composite@1.7.3
routepolicy@1.1.1
socket-stream-client@0.5.0
tracker@1.2.1
underscore@1.0.11
webapp@1.13.2
webapp-hashing@1.1.1
27 changes: 26 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
## 1.4.1
- Fix reactive counters when filtering on dates [@vparpoil](https://github.com/vparpoil) [PR](https://github.com/cult-of-coders/grapher/pull/402)
- Fix for storeOneResults when handling already processed results [@bhunjadi](https://github.com/bhunjadi) [PR](https://github.com/cult-of-coders/grapher/pull/405)
- Replace `_.isArray` with native `Array.isArray` [@storytellercz](https://github.com/sponsors/StorytellerCZ)
- Remove unnecessary applyProps call [@Floriferous](https://github.com/Floriferous) [PR](https://github.com/cult-of-coders/grapher/pull/419)
- Add tests for Meteor 2.9.1 [@storytellercz](https://github.com/sponsors/StorytellerCZ)

## 1.4.0
- Add tests for Meteor 2.6 & 2.7.3
- Migrate TravisCI test to GitHub Actions
- Fix failed queries in Meteor 2.6 due to custom aggregate function
- Updated for mongo 5 support
- Added compose file for testing

## 1.3.21
- Update `matb33:collection-hooks` to v1.1.2

## 1.3.20
- Omit `$expr` operator from projected field names
- Improve fetchOne to only return 1 result
- Fix add support for input types to `getArgs`
- Fix global exposure function body usage
- Corrects error messages thrown by linkMany
- Updated dependencies for Meteor 2.3+

## 1.3
- Added link caching
- Added named query results caching
Expand Down Expand Up @@ -124,4 +149,4 @@ Simplified subscription and decided to keep "linkStorageFields" in the response.
Bug fixes + Updated documentation

## 1.0.0
First release.
First release.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Grapher 1.3
## Introducing BlueLibs

[![Build Status](https://api.travis-ci.org/cult-of-coders/grapher.svg?branch=master)](https://travis-ci.org/cult-of-coders/grapher)
- [GitHub BlueLibs Monorepo](https://github.com/bluelibs/bluelibs)
- Following the same bold vision of Meteor, but with a modern twist. www.bluelibs.com
- Read more about our approach coming from Meteor: https://www.bluelibs.com/blog/2021/11/26/the-meteor-of-2022
- We've implemented [Grapher aka Nova](https://www.bluelibs.com/products/nova) as a standalone npm package compatible to native MongoDB drivers (including Meteor), it is not as feature-rich (no meta links, no pubsub functionality) but is more advanced.

# Grapher 1.4.1

_Grapher_ is a Data Fetching Layer on top of Meteor and MongoDB. It is production ready and battle tested. Brought to you by [Cult of Coders](https://www.cultofcoders.com) — Web & Mobile Development Company.

Expand All @@ -17,8 +22,6 @@ Main features:
It marks a stepping stone into evolution of data, enabling developers to write complex and secure code,
while maintaining the code base easy to understand.

Grapher 1.3 is LTS until 2024

[Read more about the GraphQL Bridge](docs/graphql.md)

## Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Let's learn Grapher. It's quite easy and it's time to change the way you think about your data.

Before we dive into Grapher you need to know to fundamentals of Meteor, but not mandatory, you can
Before we dive into Grapher you need to know the fundamentals of Meteor, but not mandatory, you can
learn the principles either way.

* http://www.meteor-tuts.com/chapters/1/intro.html
Expand Down
27 changes: 15 additions & 12 deletions lib/aggregate.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { Promise } from 'meteor/promise';
import { Meteor } from 'meteor/meteor';
import { Mongo, MongoInternals } from 'meteor/mongo';

Mongo.Collection.prototype.aggregate = function(pipelines, options = {}) {
const coll = this.rawCollection();
if (!Mongo.Collection.prototype.aggregate) {
Mongo.Collection.prototype.aggregate = function (pipelines, options) {
const Collection = this.rawCollection();

let result = Meteor.wrapAsync(coll.aggregate, coll)(pipelines, options);
if (MongoInternals.NpmModules.mongodb.version[0] === '3') {
const cursor = Meteor.wrapAsync(Collection.aggregate, Collection)(pipelines, options);
return Meteor.wrapAsync(cursor.toArray, cursor)();
} else if (MongoInternals.NpmModules.mongodb.version[0] === '4') {
const cursor = Collection.aggregate(pipelines, options);
return Meteor.wrapAsync(cursor.toArray, cursor)();
}

// We need to check If it's an AggregationCursor
// The reason we do this was because of the upgrade to 1.7 which involved a mongodb driver update
if (Array.isArray(result)) {
return result;
} else {
return Promise.await(result.toArray());
}
};
return Meteor.wrapAsync(Collection.aggregate.bind(Collection))(pipelines, options);
};
}
4 changes: 2 additions & 2 deletions lib/exposure/exposure.config.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ExposureSchema = {
publication: Match.Maybe(Boolean),
method: Match.Maybe(Boolean),
blocking: Match.Maybe(Boolean),
body: Match.Maybe(Object),
body: Match.Maybe(Match.OneOf(Object, Function)),
restrictedFields: Match.Maybe([String]),
restrictLinks: Match.Maybe(
Match.OneOf(Function, [String])
Expand All @@ -29,4 +29,4 @@ export function validateBody(collection, body) {
} catch (e) {
throw new Meteor.Error('invalid-body', 'We could not build a valid graph when trying to create your exposure: ' + e.toString())
}
}
}
Loading

0 comments on commit 1b88531

Please sign in to comment.