@keycloakify/angular 0.1.6 → 0.1.8

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/bin/108.index.js CHANGED
@@ -18,7 +18,7 @@ exports.modules = {
18
18
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
19
19
  /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(966);
20
20
  /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797);
21
- /* harmony import */ var _tools_runPrettier__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(199);
21
+ /* harmony import */ var _tools_runPrettier__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(685);
22
22
  /* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(316);
23
23
 
24
24
 
@@ -131,21 +131,14 @@ function getThisCodebaseRootDirPath() {
131
131
 
132
132
  /***/ }),
133
133
 
134
- /***/ 199:
134
+ /***/ 717:
135
135
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
136
136
 
137
-
138
- // EXPORTS
139
- __webpack_require__.d(__webpack_exports__, {
140
- L: () => (/* binding */ getIsPrettierAvailable),
141
- JS: () => (/* binding */ runPrettier)
142
- });
143
-
144
- // UNUSED EXPORTS: getPrettierAndConfig
145
-
146
- // EXTERNAL MODULE: external "path"
147
- var external_path_ = __webpack_require__(928);
148
- ;// CONCATENATED MODULE: ./dist/bin/tools/nodeModulesBinDirPath.js
137
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
138
+ /* harmony export */ p: () => (/* binding */ getNodeModulesBinDirPath)
139
+ /* harmony export */ });
140
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(928);
141
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
149
142
 
150
143
  let cache = undefined;
151
144
  function getNodeModulesBinDirPath() {
@@ -155,7 +148,7 @@ function getNodeModulesBinDirPath() {
155
148
  const binPath = process.argv[1];
156
149
  const segments = ['.bin'];
157
150
  let foundNodeModules = false;
158
- for (const segment of binPath.split(external_path_.sep).reverse()) {
151
+ for (const segment of binPath.split(path__WEBPACK_IMPORTED_MODULE_0__.sep).reverse()) {
159
152
  skip_segment: {
160
153
  if (foundNodeModules) {
161
154
  break skip_segment;
@@ -168,68 +161,139 @@ function getNodeModulesBinDirPath() {
168
161
  }
169
162
  segments.unshift(segment);
170
163
  }
171
- const nodeModulesBinDirPath = segments.join(external_path_.sep);
164
+ const nodeModulesBinDirPath = segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep);
172
165
  cache = nodeModulesBinDirPath;
173
166
  return nodeModulesBinDirPath;
174
167
  }
175
168
 
176
- // EXTERNAL MODULE: external "fs/promises"
177
- var promises_ = __webpack_require__(943);
178
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
179
- var id = __webpack_require__(94);
180
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
181
- var assert = __webpack_require__(966);
182
- // EXTERNAL MODULE: ./node_modules/chalk/source/index.js + 3 modules
183
- var source = __webpack_require__(797);
184
- ;// CONCATENATED MODULE: ./dist/bin/tools/runPrettier.js
169
+
170
+ /***/ }),
171
+
172
+ /***/ 86:
173
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
174
+
175
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
176
+ /* harmony export */ M: () => (/* binding */ readThisNpmPackageVersion)
177
+ /* harmony export */ });
178
+ /* harmony import */ var _getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(427);
179
+ /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(966);
180
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(896);
181
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
182
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(928);
183
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
185
184
 
186
185
 
187
186
 
188
187
 
188
+ let cache = undefined;
189
+ function readThisNpmPackageVersion() {
190
+ if (cache !== undefined) {
191
+ return cache;
192
+ }
193
+ const version = JSON.parse(fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync((0,path__WEBPACK_IMPORTED_MODULE_2__.join)((0,_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_3__/* .getThisCodebaseRootDirPath */ .J)(), 'package.json'))
194
+ .toString('utf8'))['version'];
195
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_0__/* .assert */ .v)(typeof version === 'string');
196
+ cache = version;
197
+ return version;
198
+ }
189
199
 
190
200
 
191
- getIsPrettierAvailable.cache = (0,id.id)(undefined);
201
+ /***/ }),
202
+
203
+ /***/ 685:
204
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
205
+
206
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
207
+ /* harmony export */ JS: () => (/* binding */ runPrettier),
208
+ /* harmony export */ L: () => (/* binding */ getIsPrettierAvailable)
209
+ /* harmony export */ });
210
+ /* unused harmony export getPrettier */
211
+ /* harmony import */ var _nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(717);
212
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(928);
213
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
214
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(943);
215
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_1__);
216
+ /* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94);
217
+ /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(966);
218
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(797);
219
+ /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(982);
220
+ /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_3__);
221
+ /* harmony import */ var tsafe_is__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(289);
222
+ /* harmony import */ var tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(886);
223
+ /* harmony import */ var _readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(86);
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+ getIsPrettierAvailable.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_5__.id)(undefined);
192
235
  async function getIsPrettierAvailable() {
193
236
  var _a;
194
237
  if (getIsPrettierAvailable.cache !== undefined) {
195
238
  return getIsPrettierAvailable.cache;
196
239
  }
197
- const nodeModulesBinDirPath = getNodeModulesBinDirPath();
198
- const prettierBinPath = (0,external_path_.join)(nodeModulesBinDirPath, 'prettier');
199
- const stats = await promises_.stat(prettierBinPath).catch(() => undefined);
240
+ const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getNodeModulesBinDirPath */ .p)();
241
+ const prettierBinPath = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(nodeModulesBinDirPath, 'prettier');
242
+ const stats = await fs_promises__WEBPACK_IMPORTED_MODULE_1__.stat(prettierBinPath).catch(() => undefined);
200
243
  const isPrettierAvailable = (_a = stats === null || stats === void 0 ? void 0 : stats.isFile()) !== null && _a !== void 0 ? _a : false;
201
244
  getIsPrettierAvailable.cache = isPrettierAvailable;
202
245
  return isPrettierAvailable;
203
246
  }
204
- getPrettierAndConfig.cache = (0,id.id)(undefined);
205
- async function getPrettierAndConfig() {
206
- (0,assert/* assert */.v)(getIsPrettierAvailable());
207
- if (getPrettierAndConfig.cache !== undefined) {
208
- return getPrettierAndConfig.cache;
247
+ getPrettier.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_5__.id)(undefined);
248
+ async function getPrettier() {
249
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .v)(getIsPrettierAvailable());
250
+ if (getPrettier.cache !== undefined) {
251
+ return getPrettier.cache;
252
+ }
253
+ let prettier = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_5__.id)(undefined);
254
+ import_prettier: {
255
+ // NOTE: When module is linked we want to make sure we import the correct version
256
+ // of prettier, that is the one of the project, not the one of this repo.
257
+ // So we do a sketchy eval to bypass ncc.
258
+ // We make sure to only do that when linking, otherwise we import properly.
259
+ if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_7__/* .readThisNpmPackageVersion */ .M)().startsWith('0.0.0')) {
260
+ eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__/* .symToStr */ .I)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_0__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_0__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'))}")`);
261
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .v)(!(0,tsafe_is__WEBPACK_IMPORTED_MODULE_4__.is)(prettier));
262
+ break import_prettier;
263
+ }
264
+ prettier = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 824, 23));
209
265
  }
210
- const prettier = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 824, 23));
266
+ const configHash = await (async () => {
267
+ const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_0__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getNodeModulesBinDirPath */ .p)(), '..'));
268
+ if (configFilePath === null) {
269
+ return '';
270
+ }
271
+ const data = await fs_promises__WEBPACK_IMPORTED_MODULE_1__.readFile(configFilePath);
272
+ return crypto__WEBPACK_IMPORTED_MODULE_3__.createHash('sha256').update(data).digest('hex');
273
+ })();
211
274
  const prettierAndConfig = {
212
275
  prettier,
213
- config: await prettier.resolveConfig((0,external_path_.join)(getNodeModulesBinDirPath(), '..'))
276
+ configHash
214
277
  };
215
- getPrettierAndConfig.cache = prettierAndConfig;
278
+ getPrettier.cache = prettierAndConfig;
216
279
  return prettierAndConfig;
217
280
  }
218
281
  async function runPrettier(params) {
219
282
  const { sourceCode, filePath } = params;
220
283
  let formattedSourceCode;
221
284
  try {
222
- const { prettier, config } = await getPrettierAndConfig();
285
+ const { prettier } = await getPrettier();
223
286
  const { ignored, inferredParser } = await prettier.getFileInfo(filePath, {
224
287
  resolveConfig: true
225
288
  });
226
289
  if (ignored) {
227
290
  return sourceCode;
228
291
  }
292
+ const config = await prettier.resolveConfig(filePath);
229
293
  formattedSourceCode = await prettier.format(sourceCode, Object.assign(Object.assign({}, config), { filePath, parser: inferredParser !== null && inferredParser !== void 0 ? inferredParser : undefined }));
230
294
  }
231
295
  catch (error) {
232
- console.log(source/* default */.Ay.red(`You probably need to upgrade the version of prettier in your project`));
296
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Ay.red(`You probably need to upgrade the version of prettier in your project`));
233
297
  throw error;
234
298
  }
235
299
  return formattedSourceCode;
package/bin/338.index.js CHANGED
@@ -175,21 +175,14 @@ function getThisCodebaseRootDirPath() {
175
175
 
176
176
  /***/ }),
177
177
 
178
- /***/ 199:
178
+ /***/ 717:
179
179
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
180
180
 
181
-
182
- // EXPORTS
183
- __webpack_require__.d(__webpack_exports__, {
184
- L: () => (/* binding */ getIsPrettierAvailable),
185
- JS: () => (/* binding */ runPrettier)
186
- });
187
-
188
- // UNUSED EXPORTS: getPrettierAndConfig
189
-
190
- // EXTERNAL MODULE: external "path"
191
- var external_path_ = __webpack_require__(928);
192
- ;// CONCATENATED MODULE: ./dist/bin/tools/nodeModulesBinDirPath.js
181
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
182
+ /* harmony export */ p: () => (/* binding */ getNodeModulesBinDirPath)
183
+ /* harmony export */ });
184
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(928);
185
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
193
186
 
194
187
  let cache = undefined;
195
188
  function getNodeModulesBinDirPath() {
@@ -199,7 +192,7 @@ function getNodeModulesBinDirPath() {
199
192
  const binPath = process.argv[1];
200
193
  const segments = ['.bin'];
201
194
  let foundNodeModules = false;
202
- for (const segment of binPath.split(external_path_.sep).reverse()) {
195
+ for (const segment of binPath.split(path__WEBPACK_IMPORTED_MODULE_0__.sep).reverse()) {
203
196
  skip_segment: {
204
197
  if (foundNodeModules) {
205
198
  break skip_segment;
@@ -212,68 +205,139 @@ function getNodeModulesBinDirPath() {
212
205
  }
213
206
  segments.unshift(segment);
214
207
  }
215
- const nodeModulesBinDirPath = segments.join(external_path_.sep);
208
+ const nodeModulesBinDirPath = segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep);
216
209
  cache = nodeModulesBinDirPath;
217
210
  return nodeModulesBinDirPath;
218
211
  }
219
212
 
220
- // EXTERNAL MODULE: external "fs/promises"
221
- var promises_ = __webpack_require__(943);
222
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
223
- var id = __webpack_require__(94);
224
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
225
- var assert = __webpack_require__(966);
226
- // EXTERNAL MODULE: ./node_modules/chalk/source/index.js + 3 modules
227
- var source = __webpack_require__(797);
228
- ;// CONCATENATED MODULE: ./dist/bin/tools/runPrettier.js
229
213
 
214
+ /***/ }),
215
+
216
+ /***/ 86:
217
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
230
218
 
219
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
220
+ /* harmony export */ M: () => (/* binding */ readThisNpmPackageVersion)
221
+ /* harmony export */ });
222
+ /* harmony import */ var _getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(427);
223
+ /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(966);
224
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(896);
225
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
226
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(928);
227
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
231
228
 
232
229
 
233
230
 
234
231
 
235
- getIsPrettierAvailable.cache = (0,id.id)(undefined);
232
+ let cache = undefined;
233
+ function readThisNpmPackageVersion() {
234
+ if (cache !== undefined) {
235
+ return cache;
236
+ }
237
+ const version = JSON.parse(fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync((0,path__WEBPACK_IMPORTED_MODULE_2__.join)((0,_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_3__/* .getThisCodebaseRootDirPath */ .J)(), 'package.json'))
238
+ .toString('utf8'))['version'];
239
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_0__/* .assert */ .v)(typeof version === 'string');
240
+ cache = version;
241
+ return version;
242
+ }
243
+
244
+
245
+ /***/ }),
246
+
247
+ /***/ 685:
248
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
249
+
250
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
251
+ /* harmony export */ JS: () => (/* binding */ runPrettier),
252
+ /* harmony export */ L: () => (/* binding */ getIsPrettierAvailable)
253
+ /* harmony export */ });
254
+ /* unused harmony export getPrettier */
255
+ /* harmony import */ var _nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(717);
256
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(928);
257
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
258
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(943);
259
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_1__);
260
+ /* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94);
261
+ /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(966);
262
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(797);
263
+ /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(982);
264
+ /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_3__);
265
+ /* harmony import */ var tsafe_is__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(289);
266
+ /* harmony import */ var tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(886);
267
+ /* harmony import */ var _readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(86);
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+ getIsPrettierAvailable.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_5__.id)(undefined);
236
279
  async function getIsPrettierAvailable() {
237
280
  var _a;
238
281
  if (getIsPrettierAvailable.cache !== undefined) {
239
282
  return getIsPrettierAvailable.cache;
240
283
  }
241
- const nodeModulesBinDirPath = getNodeModulesBinDirPath();
242
- const prettierBinPath = (0,external_path_.join)(nodeModulesBinDirPath, 'prettier');
243
- const stats = await promises_.stat(prettierBinPath).catch(() => undefined);
284
+ const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getNodeModulesBinDirPath */ .p)();
285
+ const prettierBinPath = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(nodeModulesBinDirPath, 'prettier');
286
+ const stats = await fs_promises__WEBPACK_IMPORTED_MODULE_1__.stat(prettierBinPath).catch(() => undefined);
244
287
  const isPrettierAvailable = (_a = stats === null || stats === void 0 ? void 0 : stats.isFile()) !== null && _a !== void 0 ? _a : false;
245
288
  getIsPrettierAvailable.cache = isPrettierAvailable;
246
289
  return isPrettierAvailable;
247
290
  }
248
- getPrettierAndConfig.cache = (0,id.id)(undefined);
249
- async function getPrettierAndConfig() {
250
- (0,assert/* assert */.v)(getIsPrettierAvailable());
251
- if (getPrettierAndConfig.cache !== undefined) {
252
- return getPrettierAndConfig.cache;
291
+ getPrettier.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_5__.id)(undefined);
292
+ async function getPrettier() {
293
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .v)(getIsPrettierAvailable());
294
+ if (getPrettier.cache !== undefined) {
295
+ return getPrettier.cache;
253
296
  }
254
- const prettier = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 824, 23));
297
+ let prettier = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_5__.id)(undefined);
298
+ import_prettier: {
299
+ // NOTE: When module is linked we want to make sure we import the correct version
300
+ // of prettier, that is the one of the project, not the one of this repo.
301
+ // So we do a sketchy eval to bypass ncc.
302
+ // We make sure to only do that when linking, otherwise we import properly.
303
+ if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_7__/* .readThisNpmPackageVersion */ .M)().startsWith('0.0.0')) {
304
+ eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__/* .symToStr */ .I)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_0__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_0__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'))}")`);
305
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .v)(!(0,tsafe_is__WEBPACK_IMPORTED_MODULE_4__.is)(prettier));
306
+ break import_prettier;
307
+ }
308
+ prettier = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 824, 23));
309
+ }
310
+ const configHash = await (async () => {
311
+ const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_0__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getNodeModulesBinDirPath */ .p)(), '..'));
312
+ if (configFilePath === null) {
313
+ return '';
314
+ }
315
+ const data = await fs_promises__WEBPACK_IMPORTED_MODULE_1__.readFile(configFilePath);
316
+ return crypto__WEBPACK_IMPORTED_MODULE_3__.createHash('sha256').update(data).digest('hex');
317
+ })();
255
318
  const prettierAndConfig = {
256
319
  prettier,
257
- config: await prettier.resolveConfig((0,external_path_.join)(getNodeModulesBinDirPath(), '..'))
320
+ configHash
258
321
  };
259
- getPrettierAndConfig.cache = prettierAndConfig;
322
+ getPrettier.cache = prettierAndConfig;
260
323
  return prettierAndConfig;
261
324
  }
262
325
  async function runPrettier(params) {
263
326
  const { sourceCode, filePath } = params;
264
327
  let formattedSourceCode;
265
328
  try {
266
- const { prettier, config } = await getPrettierAndConfig();
329
+ const { prettier } = await getPrettier();
267
330
  const { ignored, inferredParser } = await prettier.getFileInfo(filePath, {
268
331
  resolveConfig: true
269
332
  });
270
333
  if (ignored) {
271
334
  return sourceCode;
272
335
  }
336
+ const config = await prettier.resolveConfig(filePath);
273
337
  formattedSourceCode = await prettier.format(sourceCode, Object.assign(Object.assign({}, config), { filePath, parser: inferredParser !== null && inferredParser !== void 0 ? inferredParser : undefined }));
274
338
  }
275
339
  catch (error) {
276
- console.log(source/* default */.Ay.red(`You probably need to upgrade the version of prettier in your project`));
340
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Ay.red(`You probably need to upgrade the version of prettier in your project`));
277
341
  throw error;
278
342
  }
279
343
  return formattedSourceCode;
@@ -292,7 +356,7 @@ async function runPrettier(params) {
292
356
  /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
293
357
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(928);
294
358
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
295
- /* harmony import */ var _tools_runPrettier__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(199);
359
+ /* harmony import */ var _tools_runPrettier__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(685);
296
360
  /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(982);
297
361
  /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_2__);
298
362
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 603;
3
- exports.ids = [603];
2
+ exports.id = 398;
3
+ exports.ids = [398];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 797:
@@ -711,6 +711,24 @@ function is(_value) {
711
711
  //# sourceMappingURL=is.mjs.map
712
712
 
713
713
 
714
+ /***/ }),
715
+
716
+ /***/ 886:
717
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
718
+
719
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
720
+ /* harmony export */ I: () => (/* binding */ symToStr)
721
+ /* harmony export */ });
722
+ /** @see <https://docs.tsafe.dev/main/symtostr> */
723
+ function symToStr(wrap) {
724
+ // @ts-expect-error: We know better
725
+ return Object.keys(wrap)[0];
726
+ }
727
+
728
+
729
+ //# sourceMappingURL=symToStr.mjs.map
730
+
731
+
714
732
  /***/ }),
715
733
 
716
734
  /***/ 383:
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 402;
3
- exports.ids = [402];
2
+ exports.id = 693;
3
+ exports.ids = [693];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 672:
@@ -1244,6 +1244,60 @@ const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});
1244
1244
  /* harmony default export */ const source = (chalk);
1245
1245
 
1246
1246
 
1247
+ /***/ }),
1248
+
1249
+ /***/ 289:
1250
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1251
+
1252
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1253
+ /* harmony export */ is: () => (/* binding */ is)
1254
+ /* harmony export */ });
1255
+ /* harmony import */ var _zz_internal_assertIsRefWrapper_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(208);
1256
+
1257
+
1258
+ /* eslint-disable @typescript-eslint/no-namespace */
1259
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1260
+ const errorMessage = [
1261
+ `Wrong usage of the ${is.name} function refer to`,
1262
+ `https://docs.tsafe.dev/${is.name.toLowerCase()}`,
1263
+ ].join(" ");
1264
+ function is(_value) {
1265
+ const ref = {};
1266
+ if (_zz_internal_assertIsRefWrapper_mjs__WEBPACK_IMPORTED_MODULE_0__/* .assertIsRefWrapper */ .Z.ref !== undefined) {
1267
+ _zz_internal_assertIsRefWrapper_mjs__WEBPACK_IMPORTED_MODULE_0__/* .assertIsRefWrapper */ .Z.ref = undefined;
1268
+ throw new Error(errorMessage);
1269
+ }
1270
+ _zz_internal_assertIsRefWrapper_mjs__WEBPACK_IMPORTED_MODULE_0__/* .assertIsRefWrapper */ .Z.ref = ref;
1271
+ Promise.resolve().then(() => {
1272
+ if (_zz_internal_assertIsRefWrapper_mjs__WEBPACK_IMPORTED_MODULE_0__/* .assertIsRefWrapper */ .Z.ref === ref) {
1273
+ throw new Error(errorMessage);
1274
+ }
1275
+ });
1276
+ return null;
1277
+ }
1278
+
1279
+
1280
+ //# sourceMappingURL=is.mjs.map
1281
+
1282
+
1283
+ /***/ }),
1284
+
1285
+ /***/ 886:
1286
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1287
+
1288
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1289
+ /* harmony export */ I: () => (/* binding */ symToStr)
1290
+ /* harmony export */ });
1291
+ /** @see <https://docs.tsafe.dev/main/symtostr> */
1292
+ function symToStr(wrap) {
1293
+ // @ts-expect-error: We know better
1294
+ return Object.keys(wrap)[0];
1295
+ }
1296
+
1297
+
1298
+ //# sourceMappingURL=symToStr.mjs.map
1299
+
1300
+
1247
1301
  /***/ })
1248
1302
 
1249
1303
  };