sanity-plugin-dashboard-widget-vercel 1.0.0 → 1.1.2

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
@@ -1,25 +1,48 @@
1
+ <!-- markdownlint-disable --><!-- textlint-disable -->
2
+
3
+ # 📓 Changelog
4
+
5
+ All notable changes to this project will be documented in this file. See
6
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
+
8
+ ## [1.1.2](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v1.1.1...v1.1.2) (2022-09-02)
9
+
10
+ ### Bug Fixes
11
+
12
+ - **deps and ci:** semver workflow ([#7](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/issues/7)) ([05fb9ef](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/05fb9ef1c5bcd4ede17f8b5923a35287a88cfae1))
13
+
1
14
  # Changelog
2
15
 
3
16
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
17
 
5
- ## [1.0.0](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v0.1.5...v1.0.0) (2021-03-24)
18
+ ### [1.1.1](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v1.1.0...v1.1.1) (2022-01-03)
6
19
 
20
+ ### Bug Fixes
7
21
 
8
- ### BREAKING CHANGES
22
+ - correctly namespace deployment target \_ids ([cd97cd3](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/cd97cd39bd35260efe728c796d8cbadf4d788aa6))
9
23
 
10
- * Deployment targets are now configured within sanity - please remove any vercel
11
- related configuration you may have stored inside your dashboard config file. Support for forcing
12
- small layout has also been (temporarily) dropped.
24
+ ## [1.1.0](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v1.0.0...v1.1.0) (2021-03-25)
13
25
 
14
26
  ### Features
15
27
 
16
- * store tokens in a namespaced sanity document, add support for multiple deploy targets ([a1a3446](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/a1a34464590934f1bf7adf3812f29acbef3ed314))
28
+ - use API-versioned client if available ([44ca27f](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/44ca27fbd0649be8c050aad8b7eecf67324ee65d))
29
+
30
+ ## [1.0.0](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v0.1.5...v1.0.0) (2021-03-24)
31
+
32
+ ### ⚠ BREAKING CHANGES
17
33
 
34
+ - Deployment targets are now configured within sanity - please remove any vercel
35
+ related configuration you may have stored inside your dashboard config file. Support for forcing
36
+ small layout has also been (temporarily) dropped.
37
+
38
+ ### Features
39
+
40
+ - store tokens in a namespaced sanity document, add support for multiple deploy targets ([a1a3446](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/a1a34464590934f1bf7adf3812f29acbef3ed314))
18
41
 
19
42
  ### Bug Fixes
20
43
 
21
- * add eventless transitions to deployment target list machine ([7a6d921](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/7a6d921e05c238adbb335331531999a31f680b14))
22
- * set correct form defaults, update input descriptions, include target name in deploy button ([bf10600](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/bf106000b1a69c9f127f517da98d901fbbbcd481))
44
+ - add eventless transitions to deployment target list machine ([7a6d921](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/7a6d921e05c238adbb335331531999a31f680b14))
45
+ - set correct form defaults, update input descriptions, include target name in deploy button ([bf10600](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/bf106000b1a69c9f127f517da98d901fbbbcd481))
23
46
 
24
47
  ### [0.1.5](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v0.1.4...v0.1.5) (2021-01-23)
25
48
 
@@ -27,70 +50,60 @@ small layout has also been (temporarily) dropped.
27
50
 
28
51
  ### [0.1.3](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v0.1.2...v0.1.3) (2020-11-23)
29
52
 
30
-
31
53
  ### Bug Fixes
32
54
 
33
- * add babel plugin-transform-runtime ([7a5ad89](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/7a5ad89b553387717017be01ee3778c641fca570))
55
+ - add babel plugin-transform-runtime ([7a5ad89](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/7a5ad89b553387717017be01ee3778c641fca570))
34
56
 
35
57
  ### [0.1.2](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v0.1.1...v0.1.2) (2020-11-23)
36
58
 
37
-
38
59
  ### Bug Fixes
39
60
 
40
- * don't return an empty array prior to aliases being fetched ([856be29](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/856be2981a9c02362d80212f6f773669a6fd7094))
61
+ - don't return an empty array prior to aliases being fetched ([856be29](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/856be2981a9c02362d80212f6f773669a6fd7094))
41
62
 
42
63
  ### [0.1.1](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v0.1.0...v0.1.1) (2020-11-21)
43
64
 
44
-
45
65
  ### Bug Fixes
46
66
 
47
- * add babel preset-env ([4da6993](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/4da69936e8158277fe9b9a77b491516e74dec4b3))
67
+ - add babel preset-env ([4da6993](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/4da69936e8158277fe9b9a77b491516e74dec4b3))
48
68
 
49
69
  ## [0.1.0](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v0.0.6...v0.1.0) (2020-11-21)
50
70
 
51
71
  ### [0.0.6](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v0.0.5...v0.0.6) (2020-11-21)
52
72
 
53
-
54
73
  ### Features
55
74
 
56
- * allow deployLimit to be user configurable, minor cleanup" ([d15f4a8](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/d15f4a8f0ffa1525cb106a2006ff61ef53c29401))
57
-
75
+ - allow deployLimit to be user configurable, minor cleanup" ([d15f4a8](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/d15f4a8f0ffa1525cb106a2006ff61ef53c29401))
58
76
 
59
77
  ### Bug Fixes
60
78
 
61
- * correctly show cancelled dot color ([5045a3d](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/5045a3d4c9e3ba94945a97d3f1dfd5b636cf184a))
79
+ - correctly show cancelled dot color ([5045a3d](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/5045a3d4c9e3ba94945a97d3f1dfd5b636cf184a))
62
80
 
63
81
  ### [0.0.5](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v0.0.4...v0.0.5) (2020-11-20)
64
82
 
65
-
66
83
  ### Features
67
84
 
68
- * make deployHook optional, show error snackbar on refresh error, add deployment skeleton" ([a24071e](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/a24071e7ab9d44f9b1a655cb260ee0680c698617))
85
+ - make deployHook optional, show error snackbar on refresh error, add deployment skeleton" ([a24071e](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/a24071e7ab9d44f9b1a655cb260ee0680c698617))
69
86
 
70
87
  ### [0.0.4](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v0.0.3...v0.0.4) (2020-11-20)
71
88
 
72
-
73
89
  ### Features
74
90
 
75
- * create dedicated cell components, force cell widths, minor cleanup ([fb4b36a](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/fb4b36a14332eb61f4f0f44484b2570a1b248418))
76
- * display configuration error message, store config error in machine context ([e8ce270](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/e8ce270cf74215f5419a1053426d2742d2d3eee3))
77
-
91
+ - create dedicated cell components, force cell widths, minor cleanup ([fb4b36a](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/fb4b36a14332eb61f4f0f44484b2570a1b248418))
92
+ - display configuration error message, store config error in machine context ([e8ce270](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/e8ce270cf74215f5419a1053426d2742d2d3eee3))
78
93
 
79
94
  ### Bug Fixes
80
95
 
81
- * add delay to DEPLOYED event before forcing refresh ([cd104fc](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/cd104fc8ba39ed601a39a7f139121106910dc3da))
96
+ - add delay to DEPLOYED event before forcing refresh ([cd104fc](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/cd104fc8ba39ed601a39a7f139121106910dc3da))
82
97
 
83
98
  ### [0.0.3](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/compare/v0.0.2...v0.0.3) (2020-11-19)
84
99
 
85
-
86
100
  ### Features
87
101
 
88
- * add initial xstate machines, use react-query ([ffff751](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/ffff751e0167a981a3d649ce991ca9ba06a048e6))
89
- * add xstate deploy machhine, pull config values from sanity, add run-time config checking" ([6c940cb](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/6c940cb64d57e708f022f06840c9b9796b1d4883))
102
+ - add initial xstate machines, use react-query ([ffff751](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/ffff751e0167a981a3d649ce991ca9ba06a048e6))
103
+ - add xstate deploy machhine, pull config values from sanity, add run-time config checking" ([6c940cb](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/6c940cb64d57e708f022f06840c9b9796b1d4883))
90
104
 
91
105
  ### 0.0.2 (2020-11-11)
92
106
 
93
-
94
107
  ### Features
95
108
 
96
- * add commitizen, standard-release and husky ([160646c](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/160646c73d140af6738e6ea8864e275a736a13f8))
109
+ - add commitizen, standard-release and husky ([160646c](https://github.com/robinpyon/sanity-plugin-dashboard-widget-vercel/commit/160646c73d140af6738e6ea8864e275a736a13f8))
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Robin Pyon
3
+ Copyright (c) 2022 Robin Pyon
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -105,7 +105,7 @@ The number of deployments to display and fetch.
105
105
 
106
106
  When setting up new deployment targets, you're asked to provide your Vercel account token. It's important to know that your Vercel token provides unrestricted API access to your entire Vercel account.
107
107
 
108
- Your Vercel token as well as all other deployment settings are stored Sanity under the namespaced document type `vercel.deploymentTarget` and by design, namespaced documents [are not publicly accessible](https://www.sanity.io/docs/ids), even with a public dataset.
108
+ Your Vercel token and all other deployment settings are stored in the `vercel` namespace and by design, these [are not publicly accessible](https://www.sanity.io/docs/ids), even with a public dataset.
109
109
 
110
110
  However, please note that this token is exposed to all _authenticated users_ in your Sanity studio.
111
111
 
package/lib/app.js CHANGED
@@ -19,12 +19,12 @@ var _react = require("@xstate/react");
19
19
 
20
20
  var _groq = _interopRequireDefault(require("groq"));
21
21
 
22
- var _client = _interopRequireDefault(require("part:@sanity/base/client"));
23
-
24
22
  var _react2 = _interopRequireDefault(require("react"));
25
23
 
26
24
  var _reactQuery = require("react-query");
27
25
 
26
+ var _client = require("./client");
27
+
28
28
  var _StateDebug = _interopRequireDefault(require("./components/StateDebug"));
29
29
 
30
30
  var _constants = require("./constants");
@@ -43,8 +43,8 @@ var Widget = function Widget() {
43
43
  // xstate
44
44
  var _useMachine = (0, _react.useMachine)(_deploymentTargetList["default"], {
45
45
  services: {
46
- fetchDataService: function fetchDataService(_context, _event) {
47
- return _client["default"].fetch((0, _groq["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["*[_type == \"", "\"] | order(name asc)"])), _constants.DEPLOYMENT_TARGET_DOCUMENT_TYPE)).then(function (result) {
46
+ fetchDataService: function fetchDataService() {
47
+ return _client.client.fetch((0, _groq["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["*[_type == \"", "\"] | order(name asc)"])), _constants.DEPLOYMENT_TARGET_DOCUMENT_TYPE)).then(function (result) {
48
48
  return result;
49
49
  });
50
50
  }
package/lib/client.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.client = void 0;
9
+
10
+ var _client = _interopRequireDefault(require("part:@sanity/base/client"));
11
+
12
+ var _constants = require("./constants");
13
+
14
+ var client = typeof _client["default"].withConfig === 'function' ? _client["default"].withConfig({
15
+ apiVersion: _constants.API_VERSION
16
+ }) : _client["default"];
17
+ exports.client = client;
@@ -39,7 +39,9 @@ var Deployment = function Deployment(props) {
39
39
  }
40
40
  }, /*#__PURE__*/_react["default"].createElement(_StatusDot["default"], {
41
41
  state: deployment.state
42
- })), targetUrl ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, deployment.alias && /*#__PURE__*/_react["default"].createElement(_icons.LinkIcon, null), /*#__PURE__*/_react["default"].createElement(_ui.Box, {
42
+ })), targetUrl ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, deployment.alias && /*#__PURE__*/_react["default"].createElement(_icons.LinkIcon, {
43
+ fr: true
44
+ }), /*#__PURE__*/_react["default"].createElement(_ui.Box, {
43
45
  marginLeft: deployment.alias ? 1 : 0
44
46
  }, /*#__PURE__*/_react["default"].createElement(_ui.Text, {
45
47
  muted: !(deployment.state === 'READY'),
@@ -21,9 +21,9 @@ var _yup = require("@hookform/resolvers/yup");
21
21
 
22
22
  var _ui = require("@sanity/ui");
23
23
 
24
- var _react = require("@xstate/react");
24
+ var _uuid = require("@sanity/uuid");
25
25
 
26
- var _client = _interopRequireDefault(require("part:@sanity/base/client"));
26
+ var _react = require("@xstate/react");
27
27
 
28
28
  var _react2 = _interopRequireDefault(require("react"));
29
29
 
@@ -31,6 +31,8 @@ var _reactHookForm = require("react-hook-form");
31
31
 
32
32
  var yup = _interopRequireWildcard(require("yup"));
33
33
 
34
+ var _client = require("../../client");
35
+
34
36
  var _constants = require("../../constants");
35
37
 
36
38
  var _form = _interopRequireDefault(require("../../machines/form"));
@@ -93,7 +95,8 @@ var DialogForm = function DialogForm(props) {
93
95
  case 0:
94
96
  _context3.prev = 0;
95
97
  _context3.next = 3;
96
- return _client["default"].create(_objectSpread({
98
+ return _client.client.create(_objectSpread({
99
+ _id: "vercel.".concat((0, _uuid.uuid)()),
97
100
  _type: _constants.DEPLOYMENT_TARGET_DOCUMENT_TYPE
98
101
  }, event.formData));
99
102
 
@@ -139,7 +142,7 @@ var DialogForm = function DialogForm(props) {
139
142
 
140
143
  _context4.prev = 1;
141
144
  _context4.next = 4;
142
- return _client["default"]["delete"](deploymentTarget._id);
145
+ return _client.client["delete"](deploymentTarget._id);
143
146
 
144
147
  case 4:
145
148
  if (onDelete) {
@@ -168,6 +171,7 @@ var DialogForm = function DialogForm(props) {
168
171
  return deleteDocumentService;
169
172
  }(),
170
173
  // TODO: refactor
174
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
171
175
  updateDocumentService: function () {
172
176
  var _updateDocumentService = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_context, event) {
173
177
  var document;
@@ -182,7 +186,7 @@ var DialogForm = function DialogForm(props) {
182
186
 
183
187
  _context5.prev = 1;
184
188
  _context5.next = 4;
185
- return _client["default"].patch(deploymentTarget._id).set(event.formData).commit();
189
+ return _client.client.patch(deploymentTarget._id).set(event.formData).commit();
186
190
 
187
191
  case 4:
188
192
  document = _context5.sent;
@@ -47,12 +47,15 @@ var FormFieldInputLabel = function FormFieldInputLabel(props) {
47
47
  }, /*#__PURE__*/_react["default"].createElement(StyledErrorOutlineIcon, {
48
48
  style: {
49
49
  marginRight: '0.1em'
50
- }
50
+ },
51
+ fr: true
51
52
  }), error.message)),
52
53
  fallbackPlacements: ['top', 'left'],
53
54
  placement: "right",
54
55
  portal: true
55
- }, /*#__PURE__*/_react["default"].createElement(StyledErrorOutlineIcon, null)))), description && /*#__PURE__*/_react["default"].createElement(_ui.Box, {
56
+ }, /*#__PURE__*/_react["default"].createElement(StyledErrorOutlineIcon, {
57
+ fr: true
58
+ })))), description && /*#__PURE__*/_react["default"].createElement(_ui.Box, {
56
59
  marginY: 3
57
60
  }, /*#__PURE__*/_react["default"].createElement(_ui.Text, {
58
61
  htmlFor: name,
@@ -42,7 +42,7 @@ var TableCell = function TableCell(props) {
42
42
  if (header) {
43
43
  return /*#__PURE__*/_react["default"].createElement(_ui.Box, {
44
44
  as: "th",
45
- colSpan: colSpan // @ts-ignore
45
+ colSpan: colSpan // @ts-expect-error types
46
46
  ,
47
47
  display: display,
48
48
  paddingX: 3,
@@ -59,7 +59,7 @@ var TableCell = function TableCell(props) {
59
59
  } else {
60
60
  return /*#__PURE__*/_react["default"].createElement(_ui.Box, {
61
61
  as: "td",
62
- colSpan: colSpan // @ts-ignore
62
+ colSpan: colSpan // @ts-expect-error types
63
63
  ,
64
64
  display: display,
65
65
  paddingX: 3,
package/lib/constants.js CHANGED
@@ -3,12 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Z_INDEX_TOAST_PROVIDER = exports.Z_INDEX_DIALOG = exports.WIDGET_NAME = exports.VERCEL_STATUS_COLORS = exports.DEPLOYMENT_TARGET_DOCUMENT_TYPE = exports.DEBUG_MODE = exports.API_ENDPOINT_ALIASES = exports.API_ENDPOINT_DEPLOYMENTS = void 0;
6
+ exports.Z_INDEX_TOAST_PROVIDER = exports.Z_INDEX_DIALOG = exports.WIDGET_NAME = exports.VERCEL_STATUS_COLORS = exports.DEPLOYMENT_TARGET_DOCUMENT_TYPE = exports.DEBUG_MODE = exports.API_VERSION = exports.API_ENDPOINT_ALIASES = exports.API_ENDPOINT_DEPLOYMENTS = void 0;
7
7
  // https://vercel.com/docs/platform/limits
8
8
  var API_ENDPOINT_DEPLOYMENTS = 'https://api.vercel.com/v5/now/deployments';
9
9
  exports.API_ENDPOINT_DEPLOYMENTS = API_ENDPOINT_DEPLOYMENTS;
10
- var API_ENDPOINT_ALIASES = 'https://api.vercel.com/v3/now/aliases';
10
+ var API_ENDPOINT_ALIASES = 'https://api.vercel.com/v3/now/aliases'; // Sanity API version
11
+
11
12
  exports.API_ENDPOINT_ALIASES = API_ENDPOINT_ALIASES;
13
+ var API_VERSION = '1';
14
+ exports.API_VERSION = API_VERSION;
12
15
  var DEBUG_MODE = false;
13
16
  exports.DEBUG_MODE = DEBUG_MODE;
14
17
  var DEPLOYMENT_TARGET_DOCUMENT_TYPE = 'vercel.deploymentTarget';
@@ -15,6 +15,7 @@ var _unfetch = _interopRequireDefault(require("unfetch"));
15
15
 
16
16
  var _xstate = require("xstate");
17
17
 
18
+ /* eslint-disable */
18
19
  var deployMachine = function deployMachine(deployHook) {
19
20
  return (0, _xstate.Machine)( // Machine
20
21
  {
@@ -42,18 +43,18 @@ var deployMachine = function deployMachine(deployHook) {
42
43
  },
43
44
  deploying: {
44
45
  entry: (0, _xstate.assign)({
45
- disabled: function disabled(_context, _event) {
46
+ disabled: function disabled() {
46
47
  return true;
47
48
  },
48
- label: function label(_context, _event) {
49
+ label: function label() {
49
50
  return 'Deploying';
50
51
  }
51
52
  }),
52
53
  exit: (0, _xstate.assign)({
53
- disabled: function disabled(_context, _event) {
54
+ disabled: function disabled() {
54
55
  return false;
55
56
  },
56
- label: function label(_context, _event) {
57
+ label: function label() {
57
58
  return 'Deploy';
58
59
  }
59
60
  }),
@@ -74,12 +75,12 @@ var deployMachine = function deployMachine(deployHook) {
74
75
  },
75
76
  success: {
76
77
  entry: [(0, _xstate.assign)({
77
- feedback: function feedback(_context, _event) {
78
+ feedback: function feedback() {
78
79
  return 'Succesfully started!';
79
80
  }
80
81
  })],
81
82
  exit: (0, _xstate.assign)({
82
- feedback: function feedback(_context, _event) {
83
+ feedback: function feedback() {
83
84
  return undefined;
84
85
  }
85
86
  }),
@@ -97,6 +98,7 @@ var deployMachine = function deployMachine(deployHook) {
97
98
  {
98
99
  services: {
99
100
  deploy: function deploy() {
101
+ // eslint-disable-next-line no-async-promise-executor
100
102
  return new Promise( /*#__PURE__*/function () {
101
103
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(resolve, reject) {
102
104
  var res, data, errorMessage;
@@ -13,6 +13,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
13
13
 
14
14
  var _xstate = require("xstate");
15
15
 
16
+ /* eslint-disable @typescript-eslint/no-explicit-any */
16
17
  var sortByTargetName = function sortByTargetName(items) {
17
18
  return items.sort(function (a, b) {
18
19
  if (a.name > b.name) {
@@ -7,6 +7,7 @@ exports["default"] = void 0;
7
7
 
8
8
  var _xstate = require("xstate");
9
9
 
10
+ /* eslint-disable @typescript-eslint/no-explicit-any */
10
11
  var dialogMachine = function dialogMachine() {
11
12
  return (0, _xstate.Machine)({
12
13
  context: {
@@ -16,7 +17,7 @@ var dialogMachine = function dialogMachine() {
16
17
  states: {
17
18
  idle: {
18
19
  entry: (0, _xstate.assign)({
19
- editDeploymentTarget: function editDeploymentTarget(_context, _event) {
20
+ editDeploymentTarget: function editDeploymentTarget() {
20
21
  return undefined;
21
22
  }
22
23
  }),
@@ -7,6 +7,7 @@ exports["default"] = void 0;
7
7
 
8
8
  var _xstate = require("xstate");
9
9
 
10
+ /* eslint-disable */
10
11
  var formMachine = (0, _xstate.Machine)({
11
12
  context: {
12
13
  formData: {},
@@ -7,6 +7,7 @@ exports["default"] = void 0;
7
7
 
8
8
  var _xstate = require("xstate");
9
9
 
10
+ /* eslint-disable */
10
11
  var refreshMachine = (0, _xstate.Machine)({
11
12
  initial: 'idle',
12
13
  states: {
@@ -12,6 +12,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
12
12
  // Recursively sanitize form data:
13
13
  // - convert empty strings, undefined values and empty arrays to null (to correctly unset / delete fields)
14
14
  // - trim whitespace on string fleids
15
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
16
  var sanitizeFormData = function sanitizeFormData(formData) {
16
17
  return Object.keys(formData).reduce(function (acc, key) {
17
18
  var val = formData[key]; // TODO: refactor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity-plugin-dashboard-widget-vercel",
3
- "version": "1.0.0",
3
+ "version": "1.1.2",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Robin Pyon",
@@ -27,20 +27,19 @@
27
27
  },
28
28
  "scripts": {
29
29
  "build": "npx babel src --out-dir lib --copy-files --delete-dir-on-start --extensions '.ts,.tsx'",
30
- "prepare": "npm run build",
31
- "release": "standard-version",
32
- "watch": "npm run build -- --watch"
30
+ "lint": "eslint .",
31
+ "prepare": "husky install",
32
+ "watch": "npm run build -- --watch",
33
+ "prepublishOnly": "npm run build"
33
34
  },
34
35
  "dependencies": {
35
36
  "@hookform/resolvers": "2.0.0-beta.3",
36
- "@sanity/client": "2.2.6",
37
- "@sanity/icons": "1.0.5",
38
- "@sanity/ui": ">=0.33.6",
37
+ "@sanity/icons": "^1.3.4",
38
+ "@sanity/ui": "^0.37.0",
39
+ "@sanity/uuid": "^3.0.1",
39
40
  "@xstate/react": "1.3.1",
40
- "groq": "2.2.6",
41
+ "groq": "^2.29.3",
41
42
  "object-hash": "2.1.1",
42
- "react": "16.14.0",
43
- "react-dom": ">=16.14.0",
44
43
  "react-hook-form": "6.15.5",
45
44
  "react-query": "3.13.0",
46
45
  "react-time-ago": "6.2.2",
@@ -58,38 +57,32 @@
58
57
  "@babel/preset-env": "7.13.10",
59
58
  "@babel/preset-react": "7.12.13",
60
59
  "@babel/preset-typescript": "7.13.0",
61
- "@commitlint/cli": "12.0.1",
62
- "@commitlint/config-conventional": "12.0.1",
60
+ "@commitlint/cli": "^17.1.2",
61
+ "@commitlint/config-conventional": "^17.1.0",
62
+ "@sanity/client": "2.7.0",
63
+ "@sanity/semantic-release-preset": "^2.0.1",
63
64
  "@types/node-fetch": "2.5.8",
64
65
  "@types/object-hash": "1.3.4",
65
66
  "@types/pluralize": "0.0.29",
66
- "@types/react": "17.0.3",
67
- "@types/react-dom": "17.0.3",
67
+ "@types/react": "^17.0.0",
68
+ "@types/react-dom": "^17.0.3",
68
69
  "@types/styled-components": "5.1.9",
69
- "@typescript-eslint/eslint-plugin": "4.19.0",
70
- "@typescript-eslint/parser": "4.19.0",
71
- "commitizen": "4.2.3",
72
- "cz-conventional-changelog": "3.3.0",
73
- "eslint": "7.22.0",
74
- "eslint-config-prettier": "8.1.0",
75
- "eslint-plugin-import": "2.22.1",
76
- "eslint-plugin-prettier": "3.3.1",
77
- "eslint-plugin-react": "7.23.0",
78
- "husky": "4.3.0",
79
- "prettier": "2.2.1",
80
- "standard-version": "9.1.1",
70
+ "@typescript-eslint/eslint-plugin": "^5.36.1",
71
+ "@typescript-eslint/parser": "^5.36.1",
72
+ "eslint": "8.22.0",
73
+ "eslint-config-prettier": "^8.5.0",
74
+ "eslint-plugin-import": "^2.26.0",
75
+ "eslint-plugin-prettier": "^4.2.1",
76
+ "eslint-plugin-react": "^7.31.1",
77
+ "husky": "^8.0.1",
78
+ "lint-staged": "^13.0.3",
79
+ "prettier": "^2.7.1",
81
80
  "typescript": "4.2.3"
82
81
  },
83
82
  "peerDependencies": {
84
- "@sanity/base": ">= 2.0.2",
85
- "@sanity/client": ">= 2.0.1",
86
- "react": ">= 16.9",
87
- "react-dom": ">=16.9"
88
- },
89
- "config": {
90
- "commitizen": {
91
- "path": "./node_modules/cz-conventional-changelog"
92
- }
83
+ "@sanity/base": "^2.20.1",
84
+ "react": "^17.0.0",
85
+ "react-dom": "^17.0.0"
93
86
  },
94
87
  "husky": {
95
88
  "hooks": {