@bagaar/ember-graphql-mocking 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,32 @@
3
3
 
4
4
 
5
5
 
6
+
7
+
8
+ ## v0.8.0 (2023-07-06)
9
+
10
+ #### :boom: Breaking Change
11
+ * [#143](https://github.com/Bagaar/ember-graphql-mocking/pull/143) Drop support for Ember versions below v4.4 and Node v14 ([@bertdeblock](https://github.com/bertdeblock))
12
+
13
+ #### Committers: 1
14
+ - Bert De Block ([@bertdeblock](https://github.com/bertdeblock))
15
+
16
+ ## v0.7.0 (2023-02-22)
17
+
18
+ #### :boom: Breaking Change
19
+ * [#104](https://github.com/Bagaar/ember-graphql-mocking/pull/104) Update `msw` to v1 and make it a peer dependency ([@gvdp](https://github.com/gvdp))
20
+
21
+ #### :rocket: Enhancement
22
+ * [#104](https://github.com/Bagaar/ember-graphql-mocking/pull/104) Update `msw` to v1 and make it a peer dependency ([@gvdp](https://github.com/gvdp))
23
+ * [#100](https://github.com/Bagaar/ember-graphql-mocking/pull/100) Speed up requiring `index.js` file ([@bertdeblock](https://github.com/bertdeblock))
24
+
25
+ #### :memo: Documentation
26
+ * [#106](https://github.com/Bagaar/ember-graphql-mocking/pull/106) Update compatibility and installation section ([@bertdeblock](https://github.com/bertdeblock))
27
+
28
+ #### Committers: 2
29
+ - Bert De Block ([@bertdeblock](https://github.com/bertdeblock))
30
+ - [@gvdp](https://github.com/gvdp)
31
+
6
32
  ## v0.6.0 (2022-09-05)
7
33
 
8
34
  #### :boom: Breaking Change
package/README.md CHANGED
@@ -8,14 +8,23 @@ Ember addon for mocking GraphQL requests using [Mock Service Worker (MSW)](https
8
8
 
9
9
  ## Compatibility
10
10
 
11
- - Ember.js v3.28 or above
12
- - Ember CLI v3.28 or above
13
- - Node.js v14 or above
11
+ - Ember.js v4.4 or above
12
+ - Ember CLI v4.4 or above
13
+ - Node.js v16 or above
14
+ - MSW v1 or above
14
15
 
15
16
  ## Installation
16
17
 
17
18
  ```shell
18
- ember install @bagaar/ember-graphql-mocking
19
+ npm install -D @bagaar/ember-graphql-mocking msw
20
+ ```
21
+
22
+ ```shell
23
+ pnpm add -D @bagaar/ember-graphql-mocking msw
24
+ ```
25
+
26
+ ```shell
27
+ yarn add -D @bagaar/ember-graphql-mocking msw
19
28
  ```
20
29
 
21
30
  ## Usage
@@ -60,10 +60,11 @@ function createWorker() {
60
60
  function createGraphqlOperationHandler(schemaDocument) {
61
61
  const schema = buildASTSchema(schemaDocument);
62
62
  const graphqlOperation = mswGraphql.operation(async (req, res, ctx) => {
63
+ const { query } = await req.json();
63
64
  const queryResult = await graphql({
64
65
  rootValue: root,
65
66
  schema,
66
- source: req.body.query,
67
+ source: query,
67
68
  variableValues: req.variables,
68
69
  });
69
70
 
package/index.js CHANGED
@@ -1,8 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const funnel = require('broccoli-funnel');
4
- const mergeTrees = require('broccoli-merge-trees');
5
-
6
3
  module.exports = {
7
4
  name: require('./package').name,
8
5
 
@@ -14,6 +11,9 @@ module.exports = {
14
11
  return;
15
12
  }
16
13
 
14
+ const funnel = require('broccoli-funnel');
15
+ const mergeTrees = require('broccoli-merge-trees');
16
+
17
17
  return mergeTrees([tree, funnel(host.trees.public)], {
18
18
  overwrite: true,
19
19
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bagaar/ember-graphql-mocking",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Ember addon for mocking GraphQL requests using Mock Service Worker (MSW).",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -14,15 +14,17 @@
14
14
  },
15
15
  "scripts": {
16
16
  "build": "ember build --environment=production",
17
- "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
18
- "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
17
+ "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
18
+ "lint:css": "stylelint \"**/*.css\"",
19
+ "lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
20
+ "lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
19
21
  "lint:hbs": "ember-template-lint .",
20
22
  "lint:hbs:fix": "ember-template-lint . --fix",
21
23
  "lint:js": "eslint . --cache",
22
24
  "lint:js:fix": "eslint . --fix",
23
25
  "prepare": "husky install",
24
26
  "start": "ember serve",
25
- "test": "npm-run-all lint test:*",
27
+ "test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
26
28
  "test:ember": "ember test",
27
29
  "test:ember-compatibility": "ember try:each"
28
30
  },
@@ -34,57 +36,66 @@
34
36
  "dependencies": {
35
37
  "broccoli-funnel": "^3.0.5",
36
38
  "broccoli-merge-trees": "^4.2.0",
37
- "ember-auto-import": "^2.4.2",
39
+ "ember-auto-import": "^2.6.3",
38
40
  "ember-cli-babel": "^7.26.11",
39
- "graphql": "^16.6.0",
40
- "lodash.merge": "^4.6.2",
41
- "msw": "^0.47.0"
41
+ "graphql": "^16.7.1",
42
+ "lodash.merge": "^4.6.2"
42
43
  },
43
44
  "devDependencies": {
44
- "@commitlint/cli": "^17.1.2",
45
- "@commitlint/config-conventional": "^17.1.0",
45
+ "@babel/eslint-parser": "^7.22.5",
46
+ "@babel/plugin-proposal-decorators": "^7.22.5",
47
+ "@commitlint/cli": "^17.6.6",
48
+ "@commitlint/config-conventional": "^17.6.6",
46
49
  "@ember/optional-features": "^2.0.0",
47
- "@ember/test-helpers": "^2.8.1",
48
- "@embroider/test-setup": "^1.8.3",
50
+ "@ember/string": "^3.1.1",
51
+ "@ember/test-helpers": "^3.1.0",
52
+ "@embroider/test-setup": "^3.0.1",
49
53
  "@glimmer/component": "^1.1.2",
50
54
  "@glimmer/tracking": "^1.1.2",
51
55
  "@release-it-plugins/lerna-changelog": "^5.0.0",
52
- "babel-eslint": "^10.1.0",
53
56
  "broccoli-asset-rev": "^3.0.0",
54
- "ember-apollo-client": "^4.1.0",
55
- "ember-cli": "~4.6.0",
56
- "ember-cli-dependency-checker": "^3.3.1",
57
- "ember-cli-htmlbars": "^6.1.0",
57
+ "concurrently": "^8.2.0",
58
+ "ember-apollo-client": "^4.1.1",
59
+ "ember-cli": "~5.1.0",
60
+ "ember-cli-clean-css": "^2.0.0",
61
+ "ember-cli-dependency-checker": "^3.3.2",
62
+ "ember-cli-htmlbars": "^6.2.0",
58
63
  "ember-cli-inject-live-reload": "^2.1.0",
59
64
  "ember-cli-sri": "^2.1.1",
60
65
  "ember-cli-terser": "^4.0.2",
61
- "ember-disable-prototype-extensions": "^1.1.3",
62
66
  "ember-fetch": "^8.1.2",
63
67
  "ember-load-initializers": "^2.1.2",
64
68
  "ember-page-title": "^7.0.0",
65
- "ember-qunit": "^5.1.5",
66
- "ember-resolver": "^8.0.3",
67
- "ember-source": "~4.6.0",
69
+ "ember-qunit": "^7.0.0",
70
+ "ember-resolver": "^10.1.1",
71
+ "ember-source": "~5.1.1",
68
72
  "ember-source-channel-url": "^3.0.0",
69
- "ember-template-lint": "^4.14.0",
73
+ "ember-template-lint": "^5.11.0",
70
74
  "ember-try": "^2.0.0",
71
- "eslint": "^7.32.0",
72
- "eslint-config-prettier": "^8.5.0",
73
- "eslint-plugin-ember": "^11.0.2",
74
- "eslint-plugin-node": "^11.1.0",
75
+ "eslint": "^8.43.0",
76
+ "eslint-config-prettier": "^8.8.0",
77
+ "eslint-plugin-ember": "^11.9.0",
78
+ "eslint-plugin-n": "^16.0.1",
75
79
  "eslint-plugin-prettier": "^4.2.1",
76
- "eslint-plugin-qunit": "^7.3.1",
77
- "husky": "^8.0.1",
80
+ "eslint-plugin-qunit": "^8.0.0",
81
+ "husky": "^8.0.3",
78
82
  "loader.js": "^4.7.0",
79
- "npm-run-all": "^4.1.5",
80
- "prettier": "^2.7.1",
81
- "qunit": "^2.19.1",
83
+ "msw": "^1.2.2",
84
+ "prettier": "^2.8.8",
85
+ "qunit": "^2.19.4",
82
86
  "qunit-dom": "^2.0.0",
83
- "release-it": "^15.4.1",
84
- "webpack": "^5.74.0"
87
+ "release-it": "^15.11.0",
88
+ "stylelint": "^15.9.0",
89
+ "stylelint-config-standard": "^34.0.0",
90
+ "stylelint-prettier": "^3.0.0",
91
+ "webpack": "^5.88.1"
92
+ },
93
+ "peerDependencies": {
94
+ "ember-source": "^4.4.0 || ^5.0.0",
95
+ "msw": "^1.0.1"
85
96
  },
86
97
  "engines": {
87
- "node": "14.* || >= 16"
98
+ "node": "16.* || >= 18"
88
99
  },
89
100
  "publishConfig": {
90
101
  "access": "public",
@@ -2,13 +2,13 @@
2
2
  /* tslint:disable */
3
3
 
4
4
  /**
5
- * Mock Service Worker (0.47.0).
5
+ * Mock Service Worker (1.2.2).
6
6
  * @see https://github.com/mswjs/msw
7
7
  * - Please do NOT modify this file.
8
8
  * - Please do NOT serve this file on production.
9
9
  */
10
10
 
11
- const INTEGRITY_CHECKSUM = 'b3066ef78c2f9090b4ce87e874965995'
11
+ const INTEGRITY_CHECKSUM = '3d6b9f06410d179a7f7404d4bf4c3c70'
12
12
  const activeClientIds = new Set()
13
13
 
14
14
  self.addEventListener('install', function () {
@@ -174,7 +174,7 @@ async function handleRequest(event, requestId) {
174
174
  async function resolveMainClient(event) {
175
175
  const client = await self.clients.get(event.clientId)
176
176
 
177
- if (client.frameType === 'top-level') {
177
+ if (client?.frameType === 'top-level') {
178
178
  return client
179
179
  }
180
180
 
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = function (/* environment, appConfig */) {
4
- return {};
5
- };