@ukhomeoffice/cop-react-form-renderer 7.3.1 → 7.3.2-alpha.3

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/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  [![Build and test](https://github.com/UKHomeOffice/cop-react-form-renderer/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/UKHomeOffice/cop-react-form-renderer/actions/workflows/build-and-test.yml)
2
2
  [![Publish cop-react-form-renderer to npm](https://github.com/UKHomeOffice/cop-react-form-renderer/actions/workflows/publish-cop-react-form-renderer-to-npm.yml/badge.svg)](https://github.com/UKHomeOffice/cop-react-form-renderer/actions/workflows/publish-cop-react-form-renderer-to-npm.yml)
3
3
  [![Deploy Storybook](https://github.com/UKHomeOffice/cop-react-form-renderer/actions/workflows/deploy-storybook.yml/badge.svg)](https://github.com/UKHomeOffice/cop-react-form-renderer/actions/workflows/deploy-storybook.yml)
4
+
5
+ TODO:
6
+
7
+ * Remove all ESLint rule exceptions
8
+
4
9
  # Getting Started with COP React Form Renderer
5
10
 
6
11
  The COP React Form Renderer is a library that renders a form on the basis of a supplied JSON.
@@ -41,6 +46,12 @@ The build is minified and the filenames include the hashes.
41
46
 
42
47
  Runs Storybook on [http://localhost:6007](http://localhost:6007), which showcases the components within this library.
43
48
 
49
+ ### `yarn clean-storybook`
50
+
51
+ Clears local caches for modules (like cop-react-components) and starts the local storybook server.
52
+
53
+ Without this, yalc updates may not propagate locally into this app
54
+
44
55
  ### `yarn build-storybook`
45
56
 
46
57
  Builds Storybook for production to the `storybook-static` folder.
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _VisuallyHidden = _interopRequireDefault(require("@ukhomeoffice/cop-react-components/dist/VisuallyHidden"));
9
+ var _copReactComponents = require("@ukhomeoffice/cop-react-components");
10
10
  var _FormComponent = _interopRequireDefault(require("../FormComponent"));
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -25,7 +25,7 @@ const Answer = _ref => {
25
25
  } = _ref;
26
26
  if (!value) {
27
27
  const placeholderValue = Object.prototype.hasOwnProperty.call(component || {}, 'cyaPlaceholder') ? component === null || component === void 0 ? void 0 : component.cyaPlaceholder : placeholder;
28
- return placeholderValue || /*#__PURE__*/(0, _jsxRuntime.jsx)(_VisuallyHidden.default, {
28
+ return placeholderValue || /*#__PURE__*/(0, _jsxRuntime.jsx)(_copReactComponents.VisuallyHidden, {
29
29
  children: "No answer"
30
30
  });
31
31
  }
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _Readonly = require("@ukhomeoffice/cop-react-components/dist/Readonly");
4
- var _react = _interopRequireDefault(require("react"));
5
3
  var _setupTests = require("../../setupTests");
6
4
  var _Answer = _interopRequireDefault(require("./Answer"));
7
5
  var _jsxRuntime = require("react/jsx-runtime");
@@ -52,7 +50,7 @@ describe('components', () => {
52
50
  }));
53
51
  const answer = container.childNodes[0];
54
52
  expect(answer.tagName).toEqual('DIV');
55
- expect(answer.classList).toContain(_Readonly.DEFAULT_CLASS);
53
+ expect(answer.classList).toContain('hods-readonly');
56
54
  expect(answer.textContent).toEqual(VALUE);
57
55
  });
58
56
  it('should show a placeholder value for components without a value', async () => {
@@ -136,7 +134,7 @@ describe('components', () => {
136
134
  }));
137
135
  const answer = container.childNodes[0];
138
136
  expect(answer.tagName).toEqual('DIV');
139
- expect(answer.classList).toContain(_Readonly.DEFAULT_CLASS);
137
+ expect(answer.classList).toContain('hods-readonly');
140
138
  expect(answer.textContent).toEqual('hardcoded delta');
141
139
  });
142
140
  });
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "7.3.1",
3
+ "version": "7.3.2-alpha.3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "build-storybook": "storybook build",
7
- "clean": "rimraf dist",
7
+ "clean": "rimraf dist && rimraf node_modules/.cache",
8
8
  "compile": "yarn clean && cross-env NODE_ENV=production babel src --out-dir dist --copy-files && yarn post-compile",
9
9
  "compile-with-maps": "yarn clean && cross-env NODE_ENV=production babel src --out-dir dist --source-maps true --copy-files && yarn post-compile",
10
10
  "dev": "vite",
11
11
  "lint": "eslint --ext .js,.jsx src",
12
12
  "lint-fix": "eslint --ext .js,.jsx src --fix",
13
13
  "post-compile": "rimraf dist/*.test.* dist/**/*.test.* dist/**/*.stories.* dist/docs dist/assets",
14
+ "clean-storybook": "yarn clean && yarn storybook",
14
15
  "storybook": "storybook dev -p 6007",
15
16
  "test": "jest --silent=false --noStackTrace",
16
17
  "test-coverage": "jest --coverage --watchAll=false",
@@ -18,10 +19,13 @@
18
19
  "yalc-publish": "yarn compile-with-maps && cp -r src dist/src && yalc publish --push"
19
20
  },
20
21
  "dependencies": {
21
- "@ukhomeoffice/cop-react-components": "5.1.2",
22
+ "@ukhomeoffice/cop-react-components": "5.1.3-alpha.7",
22
23
  "axios": "0.30.0",
24
+ "babel-plugin-macros": "^3.1.0",
23
25
  "dayjs": "^1.11.0",
26
+ "eslint-import-resolver-typescript": "^4.4.4",
24
27
  "govuk-frontend": "5.10.2",
28
+ "storybook-addon-react-docgen": "^1.2.44",
25
29
  "uuid": "11.1.0",
26
30
  "web-vitals": "^1.0.1"
27
31
  },