@spur.us/monocle-react 0.0.13 → 0.0.18

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.
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Monocle } from "@spur.us/monocle";
2
+ import { Monocle } from "@spur.us/monocle-types";
3
3
  interface MonocoleProviderProps {
4
4
  children: React.ReactNode;
5
5
  instance?: Monocle;
@@ -1 +1 @@
1
- {"version":3,"file":"MonocleProvider.js","sourceRoot":"","sources":["../src/MonocleProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAQvC,IAAM,eAAe,GAAG,UAAC,EAA6C;QAA3C,QAAQ,cAAA,EAAE,QAAQ,cAAA;IAC3C,SAAS,CAAC,QAAQ,EAAE,sDAAsD,CAAC,CAAC;IAC5E,OAAO,CACL,oBAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,IAAI,IAAI,GAAI,CACzE,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"MonocleProvider.js","sourceRoot":"","sources":["../src/MonocleProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAQvC,IAAM,eAAe,GAAG,UAAC,EAA6C;QAA3C,QAAQ,cAAA,EAAE,QAAQ,cAAA;IAC3C,SAAS,CAAC,QAAQ,EAAE,sDAAsD,CAAC,CAAC;IAC5E,OAAO,CACL,oBAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,IAAI,IAAI,GAAI,CACzE,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
package/dist/hooks.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { Monocle } from "@spur.us/monocle";
1
+ import { Monocle } from "@spur.us/monocle-types";
2
2
  export declare const useMonocle: () => Monocle;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import { describe, expect, test, it } from "@jest/globals";
2
+ import * as MonocleReact from "./index";
3
+ describe("Monocle React Library", function () {
4
+ test("Library is loadable", function () {
5
+ expect(MonocleReact).not.toBeUndefined();
6
+ });
7
+ test("Core library is exported when initialized", function () {
8
+ expect(MonocleReact.MonocleConsumer).toBeDefined();
9
+ expect(MonocleReact.MonocleContext).toBeDefined();
10
+ expect(MonocleReact.MonocleProvider).toBeDefined();
11
+ expect(MonocleReact.useMonocle).toBeDefined();
12
+ expect(MonocleReact.withMonocle).toBeDefined();
13
+ });
14
+ });
15
+ describe("Monocle React hooks", function () {
16
+ it.todo("useMonocle return null when unavailable");
17
+ it.todo("useMonocle should return our monocle instanace when available");
18
+ it.todo("withMonocle return null when unavailable");
19
+ it.todo("withMonocle should return our monocle instanace when available");
20
+ });
21
+ describe("Monocle React components", function () {
22
+ it.todo("MonocleContext should be loadable");
23
+ it.todo("MonocleContext should fail gracefully");
24
+ it.todo("MonocleProvider should be loadable");
25
+ it.todo("MonocleProvider should fail gracefully");
26
+ });
27
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,YAAY,MAAM,SAAS,CAAC;AAExC,QAAQ,CAAC,uBAAuB,EAAE;IAChC,IAAI,CAAC,qBAAqB,EAAE;QAC1B,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,2CAA2C,EAAE;QAChD,MAAM,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,WAAW,EAAE,CAAC;QACnD,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,WAAW,EAAE,CAAC;QAClD,MAAM,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,WAAW,EAAE,CAAC;QACnD,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,qBAAqB,EAAE;IAC9B,EAAE,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;IACnD,EAAE,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;IACzE,EAAE,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;IACpD,EAAE,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;AAC5E,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,0BAA0B,EAAE;IACnC,EAAE,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IAC7C,EAAE,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IACjD,EAAE,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;IAC9C,EAAE,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spur.us/monocle-react",
3
- "version": "0.0.13",
3
+ "version": "0.0.18",
4
4
  "description": "",
5
5
  "author": "Spur <support@spur.us> (https://spur.us/)",
6
6
  "main": "./dist/index.js",
@@ -19,13 +19,14 @@
19
19
  "typings": "dist/index.d.ts",
20
20
  "scripts": {
21
21
  "build": "tsc",
22
- "lint": "eslint ./src --ext .ts"
22
+ "lint": "eslint ./src --ext .ts",
23
+ "test": "jest"
23
24
  },
24
25
  "peerDependencies": {
25
- "react": ">=16",
26
- "@spur.us/monocle": "^0.0.10"
26
+ "react": ">=16"
27
27
  },
28
28
  "dependencies": {
29
+ "@spur.us/monocle-types": "^1.0.0",
29
30
  "hoist-non-react-statics": "^3.3.2",
30
31
  "tiny-invariant": "^1.2.0"
31
32
  },
@@ -39,7 +40,9 @@
39
40
  "eslint-plugin-import": "^2.25.3",
40
41
  "eslint-plugin-unused-imports": "^2.0.0",
41
42
  "eslint-webpack-plugin": "^3.1.1",
43
+ "jest": "^27.5.1",
42
44
  "terser-webpack-plugin": "^5.2.5",
45
+ "ts-jest": "^27.1.4",
43
46
  "ts-loader": "^9.2.6",
44
47
  "ts-node": "^10.4.0",
45
48
  "typescript": "^4.5.2",
@@ -57,5 +60,28 @@
57
60
  "last 1 firefox version",
58
61
  "last 1 safari version"
59
62
  ]
63
+ },
64
+ "jest": {
65
+ "preset": "ts-jest",
66
+ "testEnvironment": "jsdom",
67
+ "globals": {
68
+ "MCL_CORE_URL": "https://localhost:8443/d/mcl.js",
69
+ "MCL_LDR_VERSION": "jest",
70
+ "MCL_TYPE": "jest-jsldr"
71
+ },
72
+ "transform": {
73
+ "^.+\\.ts?$": "ts-jest"
74
+ },
75
+ "testRegex": "(\\.test)\\.(jsx?|tsx?)$",
76
+ "testPathIgnorePatterns": [
77
+ "/node_modules/"
78
+ ],
79
+ "moduleFileExtensions": [
80
+ "js",
81
+ "jsx",
82
+ "ts",
83
+ "tsx"
84
+ ],
85
+ "collectCoverage": true
60
86
  }
61
87
  }