@zimbra/zimlet-cli 15.1.0 → 16.0.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.
Files changed (46) hide show
  1. package/.eslintrc.js +15 -0
  2. package/dist/cli.js +9 -10
  3. package/dist/commands/create.js +39 -75
  4. package/dist/commands/package.js +9 -40
  5. package/dist/entry.js +5 -7
  6. package/dist/index.js +65 -89
  7. package/dist/lib/async-command.js +2 -6
  8. package/dist/lib/setup.js +3 -12
  9. package/dist/lib/webpack/transform-config.js +0 -11
  10. package/dist/shims/@apollo/client/index.js +1 -3
  11. package/dist/shims/@apollo/client/react/components/index.js +1 -3
  12. package/dist/shims/@apollo/client/react/hoc/index.js +1 -3
  13. package/dist/shims/@apollo/client/react/index.js +1 -3
  14. package/dist/shims/@zimbra-client/blocks/index.js +1 -3
  15. package/dist/shims/@zimbra-client/browser/index.js +1 -3
  16. package/dist/shims/@zimbra-client/components/index.js +1 -3
  17. package/dist/shims/@zimbra-client/constants/index.js +1 -3
  18. package/dist/shims/@zimbra-client/enhancers/index.js +1 -3
  19. package/dist/shims/@zimbra-client/errors/index.js +1 -3
  20. package/dist/shims/@zimbra-client/graphql/index.js +1 -3
  21. package/dist/shims/@zimbra-client/hooks/graphql/index.js +1 -3
  22. package/dist/shims/@zimbra-client/hooks/index.js +1 -3
  23. package/dist/shims/@zimbra-client/platform/index.js +1 -3
  24. package/dist/shims/@zimbra-client/util/contacts/index.js +1 -3
  25. package/dist/shims/@zimbra-client/util/index.js +1 -3
  26. package/dist/shims/@zimbra-client/util/redux/index.js +1 -3
  27. package/dist/shims/dompurify/index.js +1 -3
  28. package/dist/shims/index.js +3 -4
  29. package/dist/shims/moment/index.js +1 -3
  30. package/dist/shims/preact/compat/index.js +71 -65
  31. package/dist/shims/preact/hooks/index.js +18 -18
  32. package/dist/shims/preact/index.js +17 -19
  33. package/dist/shims/preact/jsx-runtime/index.js +25 -0
  34. package/dist/shims/preact-context-provider/index.js +1 -5
  35. package/dist/shims/preact-i18n/index.js +1 -5
  36. package/dist/shims/preact-pwa-install/index.js +1 -4
  37. package/dist/shims/preact-render-to-string/index.js +1 -3
  38. package/dist/shims/preact-router/index.js +1 -3
  39. package/dist/shims/preact-router/match/index.js +1 -3
  40. package/dist/shims/react-redux/index.js +6 -10
  41. package/dist/shims/recompose/index.js +1 -3
  42. package/dist/shims/redux-actions/index.js +1 -3
  43. package/dist/util.js +0 -15
  44. package/dist/zimlet-style-loader.js +2 -11
  45. package/package-lock.json +3644 -7386
  46. package/package.json +42 -46
@@ -3,26 +3,24 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useStore = exports.useSelector = exports.useDispatch = exports.shallowEqual = exports.default = exports.createStoreHook = exports.createSelectorHook = exports.createDispatchHook = exports.connectAdvanced = exports.connect = exports.batch = exports.ReactReduxContext = exports.Provider = void 0;
7
-
6
+ exports.useStore = exports.useSelector = exports.useDispatch = exports.shallowEqual = exports.default = exports.createStoreHook = exports.createSelectorHook = exports.createDispatchHook = exports.connect = exports.batch = exports.ReactReduxContext = exports.Provider = void 0;
8
7
  var _ = require("../");
9
-
10
8
  /** This file is an auto-generated shim, aliased in for "react-redux" in the webpack config.
11
9
  * When components import 'react-redux', we want to give them back the copy
12
10
  * Zimbra passed down when it called the factory provided to zimlet().
13
11
  */
14
12
 
15
13
  /* eslint-disable camelcase, dot-notation */
16
- const wrap = _.warnOnMissingExport.bind(null, global.shims['react-redux'], 'react-redux');
17
14
 
15
+ const wrap = _.warnOnMissingExport.bind(null, global.shims['react-redux'], 'react-redux');
16
+ const batch = wrap('batch');
17
+ exports.batch = batch;
18
18
  const Provider = wrap('Provider');
19
19
  exports.Provider = Provider;
20
- const connectAdvanced = wrap('connectAdvanced');
21
- exports.connectAdvanced = connectAdvanced;
22
- const ReactReduxContext = wrap('ReactReduxContext');
23
- exports.ReactReduxContext = ReactReduxContext;
24
20
  const connect = wrap('connect');
25
21
  exports.connect = connect;
22
+ const ReactReduxContext = wrap('ReactReduxContext');
23
+ exports.ReactReduxContext = ReactReduxContext;
26
24
  const useDispatch = wrap('useDispatch');
27
25
  exports.useDispatch = useDispatch;
28
26
  const createDispatchHook = wrap('createDispatchHook');
@@ -37,7 +35,5 @@ const createStoreHook = wrap('createStoreHook');
37
35
  exports.createStoreHook = createStoreHook;
38
36
  const shallowEqual = wrap('shallowEqual');
39
37
  exports.shallowEqual = shallowEqual;
40
- const batch = wrap('batch');
41
- exports.batch = batch;
42
38
  var _default = global.shims['react-redux'];
43
39
  exports.default = _default;
@@ -4,17 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.wrapDisplayName = exports.withStateHandlers = exports.withState = exports.withReducer = exports.withPropsOnChange = exports.withProps = exports.withHandlers = exports.withContext = exports.toRenderProps = exports.toClass = exports.shouldUpdate = exports.shallowEqual = exports.setStatic = exports.setPropTypes = exports.setObservableConfig = exports.setDisplayName = exports.renderNothing = exports.renderComponent = exports.renameProps = exports.renameProp = exports.pure = exports.onlyUpdateForPropTypes = exports.onlyUpdateForKeys = exports.nest = exports.mapPropsStreamWithConfig = exports.mapPropsStream = exports.mapProps = exports.lifecycle = exports.isClassComponent = exports.hoistStatics = exports.getDisplayName = exports.getContext = exports.fromRenderProps = exports.flattenProp = exports.defaultProps = exports.default = exports.createSink = exports.createEventHandlerWithConfig = exports.createEventHandler = exports.compose = exports.componentFromStreamWithConfig = exports.componentFromStream = exports.componentFromProp = exports.branch = void 0;
7
-
8
7
  var _ = require("../");
9
-
10
8
  /** This file is an auto-generated shim, aliased in for "recompose" in the webpack config.
11
9
  * When components import 'recompose', we want to give them back the copy
12
10
  * Zimbra passed down when it called the factory provided to zimlet().
13
11
  */
14
12
 
15
13
  /* eslint-disable camelcase, dot-notation */
16
- const wrap = _.warnOnMissingExport.bind(null, global.shims['recompose'], 'recompose');
17
14
 
15
+ const wrap = _.warnOnMissingExport.bind(null, global.shims['recompose'], 'recompose');
18
16
  const mapProps = wrap('mapProps');
19
17
  exports.mapProps = mapProps;
20
18
  const withProps = wrap('withProps');
@@ -4,17 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.handleActions = exports.handleAction = exports.default = exports.createCurriedAction = exports.createActions = exports.createAction = exports.combineActions = void 0;
7
-
8
7
  var _ = require("../");
9
-
10
8
  /** This file is an auto-generated shim, aliased in for "redux-actions" in the webpack config.
11
9
  * When components import 'redux-actions', we want to give them back the copy
12
10
  * Zimbra passed down when it called the factory provided to zimlet().
13
11
  */
14
12
 
15
13
  /* eslint-disable camelcase, dot-notation */
16
- const wrap = _.warnOnMissingExport.bind(null, global.shims['redux-actions'], 'redux-actions');
17
14
 
15
+ const wrap = _.warnOnMissingExport.bind(null, global.shims['redux-actions'], 'redux-actions');
18
16
  const combineActions = wrap('combineActions');
19
17
  exports.combineActions = combineActions;
20
18
  const createAction = wrap('createAction');
package/dist/util.js CHANGED
@@ -11,56 +11,41 @@ exports.isDir = isDir;
11
11
  exports.success = success;
12
12
  exports.trim = trim;
13
13
  exports.warn = warn;
14
-
15
14
  var _chalk = _interopRequireDefault(require("chalk"));
16
-
17
15
  var _fs = require("fs");
18
-
19
16
  var _logSymbols = _interopRequireDefault(require("log-symbols"));
20
-
21
17
  var _which = _interopRequireDefault(require("which"));
22
-
23
18
  var _path = _interopRequireDefault(require("path"));
24
-
25
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
-
27
20
  function crossPlatformPathRegex(regexp) {
28
21
  if (_path.default.sep === '\\') {
29
22
  regexp = new RegExp(regexp.source.replace(/(^|[^\\])\\\//g, '$1\\\\'), regexp.flags);
30
23
  }
31
-
32
24
  return regexp;
33
25
  }
34
-
35
26
  function isDir(str) {
36
27
  return (0, _fs.existsSync)(str) && (0, _fs.statSync)(str).isDirectory();
37
28
  }
38
-
39
29
  function hasCommand(str) {
40
30
  return !!_which.default.sync(str, {
41
31
  nothrow: true
42
32
  });
43
33
  }
44
-
45
34
  function trim(str) {
46
35
  return str.trim().replace(/^\t+/gm, '');
47
36
  }
48
-
49
37
  function success(text, code) {
50
38
  process.stderr.write(_logSymbols.default.success + ' ' + text + '\n');
51
39
  code && process.exit(code);
52
40
  }
53
-
54
41
  function info(text, code) {
55
42
  process.stderr.write(_logSymbols.default.info + _chalk.default.blue(' INFO ') + text + '\n');
56
43
  code && process.exit(code);
57
44
  }
58
-
59
45
  function warn(text, code) {
60
46
  process.stdout.write(_logSymbols.default.warning + _chalk.default.yellow(' WARN ') + text + '\n');
61
47
  code && process.exit(code);
62
48
  }
63
-
64
49
  function error(text, code) {
65
50
  process.stderr.write(_logSymbols.default.error + _chalk.default.red(' ERROR ') + text + '\n');
66
51
  code && process.exit(code);
@@ -4,29 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = ZimletStyleLoader;
7
-
8
- var _loaderUtils = _interopRequireDefault(require("loader-utils"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
7
  /** zimlet-style-loader is a replacement for style-loader.
13
8
  * Instead of injecting CSS stylesheets into the a style tag in the document,
14
9
  * this loader injects them into a global array called `ZIMLET_STYLES`.
15
10
  * That array of string stylesheets is automatically passed to `styles.add()` by zimlet-cli's entrypoint.
16
11
  */
17
12
  function ZimletStyleLoader() {}
18
-
19
13
  ZimletStyleLoader.pitch = function (request) {
20
- if (this.cacheable) this.cacheable();
21
-
22
- const stringified = _loaderUtils.default.stringifyRequest(this, '!!' + request); // Add the styles to global.ZIMLET_STYLES and then return the generated classnames.
23
-
14
+ const stringified = JSON.stringify(this.utils.contextify(this.context || this.rootContext, '!!' + request));
24
15
 
16
+ // Add the styles to global.ZIMLET_STYLES and then return the generated classnames.
25
17
  return `
26
18
  var styles = require(${stringified}).default;
27
19
  ZIMLET_STYLES.push(styles);
28
20
  module.exports = styles.locals;
29
21
  `;
30
22
  };
31
-
32
23
  module.exports = exports.default;