@servicetitan/startup 26.0.0 → 26.0.2-canary.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 (179) hide show
  1. package/dist/__mocks__/create-package.js +14 -5
  2. package/dist/__mocks__/index.js +31 -18
  3. package/dist/cli/commands/build.js +83 -34
  4. package/dist/cli/commands/bundle-package.js +91 -39
  5. package/dist/cli/commands/eslint.js +74 -31
  6. package/dist/cli/commands/get-command.js +16 -16
  7. package/dist/cli/commands/get-user-commands.js +9 -9
  8. package/dist/cli/commands/index.js +45 -32
  9. package/dist/cli/commands/init.js +93 -42
  10. package/dist/cli/commands/install.js +77 -32
  11. package/dist/cli/commands/kendo-ui-license.js +86 -39
  12. package/dist/cli/commands/mfe-publish.js +176 -79
  13. package/dist/cli/commands/prepare-package.js +84 -35
  14. package/dist/cli/commands/start.js +107 -58
  15. package/dist/cli/commands/styles-check.js +63 -35
  16. package/dist/cli/commands/tests.js +77 -32
  17. package/dist/cli/commands/types.d.ts +1 -1
  18. package/dist/cli/commands/types.js +3 -3
  19. package/dist/cli/index.js +23 -18
  20. package/dist/cli/utils/assets-copy.js +52 -23
  21. package/dist/cli/utils/bundle.js +130 -56
  22. package/dist/cli/utils/cli-git.js +4 -4
  23. package/dist/cli/utils/cli-npm.js +73 -27
  24. package/dist/cli/utils/cli-os.js +14 -15
  25. package/dist/cli/utils/compile-less.d.ts +1 -1
  26. package/dist/cli/utils/compile-less.js +42 -18
  27. package/dist/cli/utils/compile-sass.d.ts +1 -1
  28. package/dist/cli/utils/compile-sass.js +41 -17
  29. package/dist/cli/utils/eslint.js +70 -34
  30. package/dist/cli/utils/get-module-type.js +17 -11
  31. package/dist/cli/utils/index.js +42 -29
  32. package/dist/cli/utils/is-module-installed.d.ts +1 -1
  33. package/dist/cli/utils/is-module-installed.js +4 -5
  34. package/dist/cli/utils/lerna-exec.js +52 -20
  35. package/dist/cli/utils/maybe-create-git-folder.d.ts +1 -1
  36. package/dist/cli/utils/maybe-create-git-folder.js +9 -7
  37. package/dist/cli/utils/publish.d.ts +1 -1
  38. package/dist/cli/utils/publish.js +3 -3
  39. package/dist/cli/utils/set-node-options.js +28 -12
  40. package/dist/cli/utils/styles-copy.js +52 -23
  41. package/dist/cli/utils/tcm.js +60 -34
  42. package/dist/cli/utils/tsc.js +46 -18
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +1 -0
  46. package/dist/index.js.map +1 -1
  47. package/dist/jest/index.js +4 -4
  48. package/dist/utils/debug.d.ts +1 -1
  49. package/dist/utils/debug.js +9 -7
  50. package/dist/utils/find-packages.d.ts +1 -1
  51. package/dist/utils/find-packages.js +37 -20
  52. package/dist/utils/get-destination-folders.js +27 -22
  53. package/dist/utils/get-folders.js +15 -9
  54. package/dist/utils/get-jest-config.js +78 -36
  55. package/dist/utils/get-package-data.d.ts +5 -2
  56. package/dist/utils/get-package-data.js +14 -8
  57. package/dist/utils/get-package-name.d.ts +1 -1
  58. package/dist/utils/get-package-name.js +10 -8
  59. package/dist/utils/get-packages.js +37 -19
  60. package/dist/utils/get-startup-version.d.ts +1 -1
  61. package/dist/utils/get-startup-version.js +16 -9
  62. package/dist/utils/get-tsconfig.d.ts +1 -1
  63. package/dist/utils/get-tsconfig.js +13 -9
  64. package/dist/utils/index.js +44 -31
  65. package/dist/utils/load-shared-dependencies.d.ts +5 -2
  66. package/dist/utils/load-shared-dependencies.js +12 -6
  67. package/dist/utils/log.d.ts +5 -2
  68. package/dist/utils/log.js +13 -12
  69. package/dist/utils/read-json.d.ts +1 -1
  70. package/dist/utils/read-json.js +10 -9
  71. package/dist/utils/to-array.d.ts +1 -1
  72. package/dist/utils/to-array.js +3 -3
  73. package/dist/webpack/__mocks__/file-rules.d.ts +1 -1
  74. package/dist/webpack/__mocks__/file-rules.js +3 -3
  75. package/dist/webpack/__mocks__/index.d.ts +1 -1
  76. package/dist/webpack/__mocks__/index.js +32 -19
  77. package/dist/webpack/configs/amd-config.js +3 -3
  78. package/dist/webpack/configs/cache-config.js +5 -5
  79. package/dist/webpack/configs/dev-server-config.js +38 -20
  80. package/dist/webpack/configs/dev-server-config.js.map +1 -1
  81. package/dist/webpack/configs/devtool-config.js +4 -5
  82. package/dist/webpack/configs/entry.config.js +4 -4
  83. package/dist/webpack/configs/externals-config.js +9 -7
  84. package/dist/webpack/configs/index.js +43 -30
  85. package/dist/webpack/configs/loaders/css-loader.js +15 -9
  86. package/dist/webpack/configs/loaders/index.js +34 -21
  87. package/dist/webpack/configs/loaders/less-loader.d.ts +1 -1
  88. package/dist/webpack/configs/loaders/less-loader.js +3 -3
  89. package/dist/webpack/configs/loaders/style-loader.js +11 -8
  90. package/dist/webpack/configs/loaders/types.d.ts +1 -1
  91. package/dist/webpack/configs/loaders/types.js +3 -3
  92. package/dist/webpack/configs/module-config.js +4 -4
  93. package/dist/webpack/configs/optimization-config.js +3 -3
  94. package/dist/webpack/configs/output-config.js +20 -9
  95. package/dist/webpack/configs/plugins/assets-manifest-plugin.js +15 -10
  96. package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +10 -8
  97. package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +21 -14
  98. package/dist/webpack/configs/plugins/define-web-component-name-plugin.js +4 -4
  99. package/dist/webpack/configs/plugins/filter-warnings-plugin.js +3 -3
  100. package/dist/webpack/configs/plugins/html-plugin.js +43 -22
  101. package/dist/webpack/configs/plugins/ignore-plugin/check-resource.d.ts +1 -1
  102. package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js +5 -6
  103. package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +5 -5
  104. package/dist/webpack/configs/plugins/ignore-plugin/index.js +31 -18
  105. package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.d.ts +1 -1
  106. package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js +6 -4
  107. package/dist/webpack/configs/plugins/index.js +42 -29
  108. package/dist/webpack/configs/plugins/mini-css-extract-plugin.js +20 -11
  109. package/dist/webpack/configs/plugins/moment-locales-plugin.js +9 -7
  110. package/dist/webpack/configs/plugins/provide-react-plugin.js +4 -4
  111. package/dist/webpack/configs/plugins/ts-checker-plugin.js +31 -23
  112. package/dist/webpack/configs/plugins/virtual-modules-plugin.js +14 -10
  113. package/dist/webpack/configs/plugins-config.js +4 -4
  114. package/dist/webpack/configs/resolve-config.js +3 -3
  115. package/dist/webpack/configs/rules/css-rules.js +25 -16
  116. package/dist/webpack/configs/rules/font-rules.js +3 -3
  117. package/dist/webpack/configs/rules/image-rules.js +3 -3
  118. package/dist/webpack/configs/rules/index.js +38 -25
  119. package/dist/webpack/configs/rules/js-rules.js +3 -3
  120. package/dist/webpack/configs/rules/less-rules.js +9 -5
  121. package/dist/webpack/configs/rules/scss-rules.js +9 -5
  122. package/dist/webpack/configs/rules/svg-rules.js +3 -3
  123. package/dist/webpack/configs/rules/tsx-rules.js +3 -3
  124. package/dist/webpack/configs/rules-config.js +8 -6
  125. package/dist/webpack/configs/stats-config.js +3 -3
  126. package/dist/webpack/configs/types.js +3 -3
  127. package/dist/webpack/configs/utils/generate-metadata.js +21 -14
  128. package/dist/webpack/configs/utils/get-web-components-version.js +16 -9
  129. package/dist/webpack/configs/utils/index.js +31 -18
  130. package/dist/webpack/create-webpack-config.js +70 -30
  131. package/dist/webpack/index.js +32 -19
  132. package/dist/webpack/loaders/expose-loader/index.d.ts +1 -1
  133. package/dist/webpack/loaders/expose-loader/index.js +11 -5
  134. package/dist/webpack/loaders/expose-loader/runtime/get-global-this.d.ts +1 -1
  135. package/dist/webpack/loaders/expose-loader/runtime/get-global-this.js +3 -4
  136. package/dist/webpack/loaders/expose-loader/utils/contextify-request.d.ts +1 -1
  137. package/dist/webpack/loaders/expose-loader/utils/contextify-request.js +23 -21
  138. package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.d.ts +1 -1
  139. package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.js +18 -9
  140. package/dist/webpack/loaders/expose-loader/utils/index.d.ts +1 -1
  141. package/dist/webpack/loaders/expose-loader/utils/index.js +33 -20
  142. package/dist/webpack/loaders/expose-loader/utils/stringify-request.d.ts +1 -1
  143. package/dist/webpack/loaders/expose-loader/utils/stringify-request.js +23 -19
  144. package/dist/webpack/types.d.ts +1 -1
  145. package/dist/webpack/types.js +3 -3
  146. package/dist/webpack/utils/bundle.d.ts +1 -1
  147. package/dist/webpack/utils/bundle.js +3 -3
  148. package/dist/webpack/utils/feature-cohort.js +6 -6
  149. package/dist/webpack/utils/get-caller-filename.d.ts +1 -1
  150. package/dist/webpack/utils/get-caller-filename.js +4 -5
  151. package/dist/webpack/utils/hash-mod.d.ts +1 -1
  152. package/dist/webpack/utils/hash-mod.js +3 -3
  153. package/dist/webpack/utils/index.js +34 -21
  154. package/dist/webpack/utils/split-by-entry.d.ts +6 -2
  155. package/dist/webpack/utils/split-by-entry.js +4 -5
  156. package/dist/webpack/utils/testing/compile.d.ts +1 -1
  157. package/dist/webpack/utils/testing/compile.js +3 -3
  158. package/dist/webpack/utils/testing/execute.d.ts +11 -5
  159. package/dist/webpack/utils/testing/execute.js +17 -10
  160. package/dist/webpack/utils/testing/get-compiler.d.ts +4 -2
  161. package/dist/webpack/utils/testing/get-compiler.js +37 -30
  162. package/dist/webpack/utils/testing/get-errors.d.ts +1 -1
  163. package/dist/webpack/utils/testing/get-errors.js +4 -4
  164. package/dist/webpack/utils/testing/get-module-source.d.ts +1 -1
  165. package/dist/webpack/utils/testing/get-module-source.js +9 -4
  166. package/dist/webpack/utils/testing/get-warnings.d.ts +1 -1
  167. package/dist/webpack/utils/testing/get-warnings.js +4 -4
  168. package/dist/webpack/utils/testing/index.d.ts +16 -6
  169. package/dist/webpack/utils/testing/index.js +12 -12
  170. package/dist/webpack/utils/testing/normalize-errors.d.ts +1 -1
  171. package/dist/webpack/utils/testing/normalize-errors.js +3 -3
  172. package/dist/webpack/utils/testing/read-asset.d.ts +1 -1
  173. package/dist/webpack/utils/testing/read-asset.js +12 -10
  174. package/dist/webpack/utils/testing/read-assets.d.ts +1 -1
  175. package/dist/webpack/utils/testing/read-assets.js +4 -4
  176. package/package.json +7 -8
  177. package/src/index.ts +1 -0
  178. package/src/webpack/__tests__/create-webpack-config.test.ts +4 -0
  179. package/src/webpack/configs/dev-server-config.ts +6 -1
@@ -1,37 +1,67 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __rest = (this && this.__rest) || function (s, e) {
12
- var t = {};
13
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
- t[p] = s[p];
15
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
- t[p[i]] = s[p[i]];
1
+ 'use strict';
2
+ var __awaiter =
3
+ (this && this.__awaiter) ||
4
+ function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) {
6
+ return value instanceof P
7
+ ? value
8
+ : new P(function (resolve) {
9
+ resolve(value);
10
+ });
19
11
  }
20
- return t;
21
- };
22
- var __importDefault = (this && this.__importDefault) || function (mod) {
23
- return (mod && mod.__esModule) ? mod : { "default": mod };
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.bundleWatch = exports.bundle = exports.webpackProdConfigFileName = exports.webpackDevConfigFileName = void 0;
27
- const fs_1 = __importDefault(require("fs"));
28
- const path_1 = __importDefault(require("path"));
29
- const crypto_1 = __importDefault(require("crypto"));
30
- const portfinder_1 = require("portfinder");
31
- const webpack_1 = __importDefault(require("webpack"));
32
- const webpack_dev_server_1 = __importDefault(require("webpack-dev-server"));
33
- const utils_1 = require("../../utils");
34
- const webpack_2 = require("../../webpack");
12
+ return new (P || (P = Promise))(function (resolve, reject) {
13
+ function fulfilled(value) {
14
+ try {
15
+ step(generator.next(value));
16
+ } catch (e) {
17
+ reject(e);
18
+ }
19
+ }
20
+ function rejected(value) {
21
+ try {
22
+ step(generator['throw'](value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }
27
+ function step(result) {
28
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
29
+ }
30
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
31
+ });
32
+ };
33
+ var __rest =
34
+ (this && this.__rest) ||
35
+ function (s, e) {
36
+ var t = {};
37
+ for (var p in s)
38
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
39
+ if (s != null && typeof Object.getOwnPropertySymbols === 'function')
40
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
41
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
42
+ t[p[i]] = s[p[i]];
43
+ }
44
+ return t;
45
+ };
46
+ var __importDefault =
47
+ (this && this.__importDefault) ||
48
+ function (mod) {
49
+ return mod && mod.__esModule ? mod : { default: mod };
50
+ };
51
+ Object.defineProperty(exports, '__esModule', { value: true });
52
+ exports.bundleWatch =
53
+ exports.bundle =
54
+ exports.webpackProdConfigFileName =
55
+ exports.webpackDevConfigFileName =
56
+ void 0;
57
+ const fs_1 = __importDefault(require('fs'));
58
+ const path_1 = __importDefault(require('path'));
59
+ const crypto_1 = __importDefault(require('crypto'));
60
+ const portfinder_1 = require('portfinder');
61
+ const webpack_1 = __importDefault(require('webpack'));
62
+ const webpack_dev_server_1 = __importDefault(require('webpack-dev-server'));
63
+ const utils_1 = require('../../utils');
64
+ const webpack_2 = require('../../webpack');
35
65
  function getName() {
36
66
  const packageName = (0, utils_1.getPackageName)()
37
67
  .replace(/\//g, '-')
@@ -52,15 +82,30 @@ function bundle() {
52
82
  const webpackOptions = { name, buildStat, codeCoverage, esbuild, experimentalBundlers };
53
83
  if ((0, utils_1.isWebComponent)()) {
54
84
  const webpackConfig = {
55
- configuration: Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.configuration), { mode }),
85
+ configuration: Object.assign(
86
+ Object.assign(
87
+ {},
88
+ config === null || config === void 0 ? void 0 : config.configuration
89
+ ),
90
+ { mode }
91
+ ),
56
92
  plugins: config === null || config === void 0 ? void 0 : config.plugins,
57
93
  };
58
94
  return Promise.all([
59
- run((0, webpack_2.createWebpackConfig)(webpackConfig, Object.assign({ embed: true }, webpackOptions))),
95
+ run(
96
+ (0, webpack_2.createWebpackConfig)(
97
+ webpackConfig,
98
+ Object.assign({ embed: true }, webpackOptions)
99
+ )
100
+ ),
60
101
  run((0, webpack_2.createWebpackConfig)(webpackConfig, webpackOptions)),
61
102
  ]);
62
103
  }
63
- return run(config !== null && config !== void 0 ? config : (0, webpack_2.createWebpackConfig)({ configuration: { mode } }, webpackOptions));
104
+ return run(
105
+ config !== null && config !== void 0
106
+ ? config
107
+ : (0, webpack_2.createWebpackConfig)({ configuration: { mode } }, webpackOptions)
108
+ );
64
109
  });
65
110
  }
66
111
  exports.bundle = bundle;
@@ -69,30 +114,51 @@ function bundleWatch() {
69
114
  utils_1.log.info('Bundling the package...');
70
115
  const name = getName();
71
116
  const mode = 'development';
72
- const config = readWebpackConfig(Object.assign(Object.assign({}, options), { fallback: `./${exports.webpackDevConfigFileName}` }));
117
+ const config = readWebpackConfig(
118
+ Object.assign(Object.assign({}, options), {
119
+ fallback: `./${exports.webpackDevConfigFileName}`,
120
+ })
121
+ );
73
122
  const { codeCoverage, esbuild, experimentalBundlers } = options;
74
123
  if ((0, utils_1.isWebComponent)()) {
75
124
  const webpackConfig = {
76
- configuration: Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.configuration), { mode }),
125
+ configuration: Object.assign(
126
+ Object.assign(
127
+ {},
128
+ config === null || config === void 0 ? void 0 : config.configuration
129
+ ),
130
+ { mode }
131
+ ),
77
132
  plugins: config === null || config === void 0 ? void 0 : config.plugins,
78
133
  };
79
134
  return Promise.all([
80
- runWatch((0, webpack_2.createWebpackConfig)(webpackConfig, {
81
- codeCoverage,
82
- embed: true,
83
- name,
84
- esbuild,
85
- experimentalBundlers,
86
- })),
87
- runServe((0, webpack_2.createWebpackConfig)(webpackConfig, {
88
- name,
89
- codeCoverage,
90
- esbuild,
91
- experimentalBundlers,
92
- })),
135
+ runWatch(
136
+ (0, webpack_2.createWebpackConfig)(webpackConfig, {
137
+ codeCoverage,
138
+ embed: true,
139
+ name,
140
+ esbuild,
141
+ experimentalBundlers,
142
+ })
143
+ ),
144
+ runServe(
145
+ (0, webpack_2.createWebpackConfig)(webpackConfig, {
146
+ name,
147
+ codeCoverage,
148
+ esbuild,
149
+ experimentalBundlers,
150
+ })
151
+ ),
93
152
  ]);
94
153
  }
95
- return runServe(config !== null && config !== void 0 ? config : (0, webpack_2.createWebpackConfig)({ configuration: { mode } }, { name, codeCoverage, esbuild, experimentalBundlers }));
154
+ return runServe(
155
+ config !== null && config !== void 0
156
+ ? config
157
+ : (0, webpack_2.createWebpackConfig)(
158
+ { configuration: { mode } },
159
+ { name, codeCoverage, esbuild, experimentalBundlers }
160
+ )
161
+ );
96
162
  });
97
163
  }
98
164
  exports.bundleWatch = bundleWatch;
@@ -111,7 +177,11 @@ function run(config) {
111
177
  const stats = yield new Promise((resolve, reject) => {
112
178
  compiler.run((error, stats) => {
113
179
  if (!stats || error) {
114
- return reject(error !== null && error !== void 0 ? error : new Error('Something went wrong.'));
180
+ return reject(
181
+ error !== null && error !== void 0
182
+ ? error
183
+ : new Error('Something went wrong.')
184
+ );
115
185
  }
116
186
  if (stats.hasErrors()) {
117
187
  return reject(stats.toString('errors-only'));
@@ -125,7 +195,8 @@ function run(config) {
125
195
  function runServe(_a) {
126
196
  return __awaiter(this, void 0, void 0, function* () {
127
197
  var _b;
128
- var { devServer = {} } = _a, config = __rest(_a, ["devServer"]);
198
+ var { devServer = {} } = _a,
199
+ config = __rest(_a, ['devServer']);
129
200
  const compiler = (0, webpack_1.default)(config);
130
201
  const host = (_b = devServer.host) !== null && _b !== void 0 ? _b : 'localhost';
131
202
  const port = yield (0, portfinder_1.getPortPromise)({
@@ -133,7 +204,10 @@ function runServe(_a) {
133
204
  host,
134
205
  });
135
206
  return new Promise((_0, reject) => {
136
- const server = new webpack_dev_server_1.default(Object.assign(Object.assign({}, devServer), { host, port }), compiler);
207
+ const server = new webpack_dev_server_1.default(
208
+ Object.assign(Object.assign({}, devServer), { host, port }),
209
+ compiler
210
+ );
137
211
  server.startCallback(e => {
138
212
  if (e) {
139
213
  server.stopCallback(() => {
@@ -158,4 +232,4 @@ function runWatch(config) {
158
232
  });
159
233
  });
160
234
  }
161
- //# sourceMappingURL=bundle.js.map
235
+ //# sourceMappingURL=bundle.js.map
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.gitGetCommitHash = exports.gitGetBranch = void 0;
4
- const cli_os_1 = require("./cli-os");
4
+ const cli_os_1 = require('./cli-os');
5
5
  const gitGetBranch = () => {
6
6
  return (0, cli_os_1.runCommandOutput)('git rev-parse --abbrev-ref HEAD').trim();
7
7
  };
@@ -10,4 +10,4 @@ const gitGetCommitHash = () => {
10
10
  return (0, cli_os_1.runCommandOutput)('git rev-parse --short HEAD').trim();
11
11
  };
12
12
  exports.gitGetCommitHash = gitGetCommitHash;
13
- //# sourceMappingURL=cli-git.js.map
13
+ //# sourceMappingURL=cli-git.js.map
@@ -1,42 +1,79 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.npmTagVersion = exports.npmPackageSet = exports.npmPublish = exports.npmPublishDry = exports.npmUnpublish = exports.npmGetPackageVersionDates = exports.npmGetPackageVersions = void 0;
13
- const cli_os_1 = require("./cli-os");
1
+ 'use strict';
2
+ var __awaiter =
3
+ (this && this.__awaiter) ||
4
+ function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) {
6
+ return value instanceof P
7
+ ? value
8
+ : new P(function (resolve) {
9
+ resolve(value);
10
+ });
11
+ }
12
+ return new (P || (P = Promise))(function (resolve, reject) {
13
+ function fulfilled(value) {
14
+ try {
15
+ step(generator.next(value));
16
+ } catch (e) {
17
+ reject(e);
18
+ }
19
+ }
20
+ function rejected(value) {
21
+ try {
22
+ step(generator['throw'](value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }
27
+ function step(result) {
28
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
29
+ }
30
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
31
+ });
32
+ };
33
+ Object.defineProperty(exports, '__esModule', { value: true });
34
+ exports.npmTagVersion =
35
+ exports.npmPackageSet =
36
+ exports.npmPublish =
37
+ exports.npmPublishDry =
38
+ exports.npmUnpublish =
39
+ exports.npmGetPackageVersionDates =
40
+ exports.npmGetPackageVersions =
41
+ void 0;
42
+ const cli_os_1 = require('./cli-os');
14
43
  function npmGetPackageVersions(registry, packageName) {
15
44
  try {
16
- const v = (0, cli_os_1.runCommandOutput)(`npm show ${packageName} versions --registry ${registry} --json`, { timeout: 10000 });
45
+ const v = (0, cli_os_1.runCommandOutput)(
46
+ `npm show ${packageName} versions --registry ${registry} --json`,
47
+ { timeout: 10000 }
48
+ );
17
49
  return JSON.parse(v);
18
- }
19
- catch (_a) {
50
+ } catch (_a) {
20
51
  return [];
21
52
  }
22
53
  }
23
54
  exports.npmGetPackageVersions = npmGetPackageVersions;
24
55
  function npmGetPackageVersionDates(registry, packageName) {
25
56
  try {
26
- const v = (0, cli_os_1.runCommandOutput)(`npm view ${packageName} time --registry ${registry} --json`, {
27
- timeout: 10000,
28
- });
57
+ const v = (0, cli_os_1.runCommandOutput)(
58
+ `npm view ${packageName} time --registry ${registry} --json`,
59
+ {
60
+ timeout: 10000,
61
+ }
62
+ );
29
63
  const map = JSON.parse(v);
30
- return Object.keys(map).reduce((out, version) => [...out, [version, new Date(map[version])]], []);
31
- }
32
- catch (_a) {
64
+ return Object.keys(map).reduce(
65
+ (out, version) => [...out, [version, new Date(map[version])]],
66
+ []
67
+ );
68
+ } catch (_a) {
33
69
  return [];
34
70
  }
35
71
  }
36
72
  exports.npmGetPackageVersionDates = npmGetPackageVersionDates;
37
73
  function npmUnpublish(registry, packageName, packageVersion) {
38
74
  return __awaiter(this, void 0, void 0, function* () {
39
- yield (0, cli_os_1.runCommand)(`npm unpublish ${packageName}@${packageVersion} --registry ${registry}`, {
75
+ yield (0,
76
+ cli_os_1.runCommand)(`npm unpublish ${packageName}@${packageVersion} --registry ${registry}`, {
40
77
  timeout: 10000,
41
78
  });
42
79
  });
@@ -61,9 +98,18 @@ function npmPackageSet(key, value) {
61
98
  }
62
99
  exports.npmPackageSet = npmPackageSet;
63
100
  function npmTagVersion(_a) {
64
- return __awaiter(this, arguments, void 0, function* ({ packageName, packageVersion, registry, tag, }) {
65
- yield (0, cli_os_1.runCommand)(`npm dist-tag ${registry ? `--registry=${registry} ` : ''}add ${packageName}@${packageVersion} ${tag}`);
66
- });
101
+ return __awaiter(
102
+ this,
103
+ arguments,
104
+ void 0,
105
+ function* ({ packageName, packageVersion, registry, tag }) {
106
+ yield (0, cli_os_1.runCommand)(
107
+ `npm dist-tag ${
108
+ registry ? `--registry=${registry} ` : ''
109
+ }add ${packageName}@${packageVersion} ${tag}`
110
+ );
111
+ }
112
+ );
67
113
  }
68
114
  exports.npmTagVersion = npmTagVersion;
69
- //# sourceMappingURL=cli-npm.js.map
115
+ //# sourceMappingURL=cli-npm.js.map
@@ -1,16 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.runCommandOutput = exports.runCommand = void 0;
4
- const child_process_1 = require("child_process");
5
- const utils_1 = require("../../utils");
4
+ const child_process_1 = require('child_process');
5
+ const utils_1 = require('../../utils');
6
6
  const runCommand = (command, opts) => {
7
7
  return new Promise((resolve, reject) => {
8
8
  const commandArray = Array.isArray(command)
9
9
  ? command
10
- .filter(c => !!c)
11
- .map(c => c.toString())
12
- .join(' ')
13
- .split(' ')
10
+ .filter(c => !!c)
11
+ .map(c => c.toString())
12
+ .join(' ')
13
+ .split(' ')
14
14
  : command.split(' ');
15
15
  const fullCommand = commandArray.join(' ');
16
16
  const commandName = commandArray.shift();
@@ -26,8 +26,7 @@ const runCommand = (command, opts) => {
26
26
  utils_1.log.info(`command finished with code ${code}`, fullCommand);
27
27
  if (code) {
28
28
  reject();
29
- }
30
- else {
29
+ } else {
31
30
  resolve();
32
31
  }
33
32
  });
@@ -37,10 +36,10 @@ exports.runCommand = runCommand;
37
36
  const runCommandOutput = (command, options) => {
38
37
  const commandArray = Array.isArray(command)
39
38
  ? command
40
- .filter(c => !!c)
41
- .map(c => c.toString())
42
- .join(' ')
43
- .split(' ')
39
+ .filter(c => !!c)
40
+ .map(c => c.toString())
41
+ .join(' ')
42
+ .split(' ')
44
43
  : command.split(' ');
45
44
  const fullCommand = commandArray.join(' ');
46
45
  const commandName = commandArray.shift();
@@ -53,4 +52,4 @@ const runCommandOutput = (command, options) => {
53
52
  return result;
54
53
  };
55
54
  exports.runCommandOutput = runCommandOutput;
56
- //# sourceMappingURL=cli-os.js.map
55
+ //# sourceMappingURL=cli-os.js.map
@@ -1,2 +1,2 @@
1
1
  export declare function compileLess(filePath: string): Promise<string>;
2
- //# sourceMappingURL=compile-less.d.ts.map
2
+ //# sourceMappingURL=compile-less.d.ts.map
@@ -1,21 +1,45 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ var __awaiter =
3
+ (this && this.__awaiter) ||
4
+ function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) {
6
+ return value instanceof P
7
+ ? value
8
+ : new P(function (resolve) {
9
+ resolve(value);
10
+ });
11
+ }
12
+ return new (P || (P = Promise))(function (resolve, reject) {
13
+ function fulfilled(value) {
14
+ try {
15
+ step(generator.next(value));
16
+ } catch (e) {
17
+ reject(e);
18
+ }
19
+ }
20
+ function rejected(value) {
21
+ try {
22
+ step(generator['throw'](value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }
27
+ function step(result) {
28
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
29
+ }
30
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
31
+ });
32
+ };
33
+ var __importDefault =
34
+ (this && this.__importDefault) ||
35
+ function (mod) {
36
+ return mod && mod.__esModule ? mod : { default: mod };
37
+ };
38
+ Object.defineProperty(exports, '__esModule', { value: true });
15
39
  exports.compileLess = void 0;
16
- const fs_1 = __importDefault(require("fs"));
17
- const path_1 = __importDefault(require("path"));
18
- const less_1 = __importDefault(require("less"));
40
+ const fs_1 = __importDefault(require('fs'));
41
+ const path_1 = __importDefault(require('path'));
42
+ const less_1 = __importDefault(require('less'));
19
43
  const lessPackageImporter = require('less-plugin-npm-import');
20
44
  function compileLess(filePath) {
21
45
  return __awaiter(this, void 0, void 0, function* () {
@@ -28,4 +52,4 @@ function compileLess(filePath) {
28
52
  });
29
53
  }
30
54
  exports.compileLess = compileLess;
31
- //# sourceMappingURL=compile-less.js.map
55
+ //# sourceMappingURL=compile-less.js.map
@@ -1,2 +1,2 @@
1
1
  export declare function compileSass(filePath: string): Promise<string>;
2
- //# sourceMappingURL=compile-sass.d.ts.map
2
+ //# sourceMappingURL=compile-sass.d.ts.map
@@ -1,20 +1,44 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ var __awaiter =
3
+ (this && this.__awaiter) ||
4
+ function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) {
6
+ return value instanceof P
7
+ ? value
8
+ : new P(function (resolve) {
9
+ resolve(value);
10
+ });
11
+ }
12
+ return new (P || (P = Promise))(function (resolve, reject) {
13
+ function fulfilled(value) {
14
+ try {
15
+ step(generator.next(value));
16
+ } catch (e) {
17
+ reject(e);
18
+ }
19
+ }
20
+ function rejected(value) {
21
+ try {
22
+ step(generator['throw'](value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }
27
+ function step(result) {
28
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
29
+ }
30
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
31
+ });
32
+ };
33
+ var __importDefault =
34
+ (this && this.__importDefault) ||
35
+ function (mod) {
36
+ return mod && mod.__esModule ? mod : { default: mod };
37
+ };
38
+ Object.defineProperty(exports, '__esModule', { value: true });
15
39
  exports.compileSass = void 0;
16
- const path_1 = __importDefault(require("path"));
17
- const sass_1 = __importDefault(require("sass"));
40
+ const path_1 = __importDefault(require('path'));
41
+ const sass_1 = __importDefault(require('sass'));
18
42
  function compileSass(filePath) {
19
43
  return __awaiter(this, void 0, void 0, function* () {
20
44
  const loadPaths = [path_1.default.dirname(filePath), '../../node_modules', 'node_modules'];
@@ -23,4 +47,4 @@ function compileSass(filePath) {
23
47
  });
24
48
  }
25
49
  exports.compileSass = compileSass;
26
- //# sourceMappingURL=compile-sass.js.map
50
+ //# sourceMappingURL=compile-sass.js.map