keycloakify 11.8.37 → 11.8.38

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/375.index.js CHANGED
@@ -2489,13 +2489,15 @@ async function runPrettier(params) {
2489
2489
  return sourceCode;
2490
2490
  }
2491
2491
  const config = await prettier.resolveConfig(filePath);
2492
- formattedSourceCode = await prettier.format(sourceCode, Object.assign(Object.assign({}, config), { filePath, parser: inferredParser }));
2492
+ formattedSourceCode = await prettier.format(typeof sourceCode === "string" ? sourceCode : sourceCode.toString("utf8"), Object.assign(Object.assign({}, config), { filePath, parser: inferredParser }));
2493
2493
  }
2494
2494
  catch (error) {
2495
2495
  console.log(chalk__WEBPACK_IMPORTED_MODULE_4___default().red(`You probably need to upgrade the version of prettier in your project`));
2496
2496
  throw error;
2497
2497
  }
2498
- return formattedSourceCode;
2498
+ return typeof sourceCode === "string"
2499
+ ? formattedSourceCode
2500
+ : Buffer.from(formattedSourceCode, "utf8");
2499
2501
  }
2500
2502
  //# sourceMappingURL=runPrettier.js.map
2501
2503
 
package/bin/712.index.js CHANGED
@@ -849,6 +849,7 @@ var isInside = __webpack_require__(90665);
849
849
 
850
850
 
851
851
 
852
+
852
853
 
853
854
  (0,assert/* assert */.h)();
854
855
  async function generateResources(params) {
@@ -910,12 +911,16 @@ async function generateResources(params) {
910
911
  });
911
912
  break apply_replacers_and_move_to_theme_resources;
912
913
  }
913
- {
914
- const dirPath = (0,external_path_.join)(buildContext.projectBuildDirPath, constants/* WELL_KNOWN_DIRECTORY_BASE_NAME.KEYCLOAKIFY_DEV_RESOURCES */.Ju.KEYCLOAKIFY_DEV_RESOURCES);
914
+ for (const directoryBasename of [
915
+ constants/* KEYCLOAK_THEME */.PC,
916
+ // NOTE: This is legacy and should eventually be removed
917
+ constants/* WELL_KNOWN_DIRECTORY_BASE_NAME.KEYCLOAKIFY_DEV_RESOURCES */.Ju.KEYCLOAKIFY_DEV_RESOURCES
918
+ ]) {
919
+ const dirPath = (0,external_path_.join)(buildContext.projectBuildDirPath, directoryBasename);
915
920
  if (external_fs_default().existsSync(dirPath)) {
916
921
  (0,assert/* assert */.h)(buildContext.bundler === "webpack");
917
922
  throw new Error([
918
- `Keycloakify build error: The ${constants/* WELL_KNOWN_DIRECTORY_BASE_NAME.KEYCLOAKIFY_DEV_RESOURCES */.Ju.KEYCLOAKIFY_DEV_RESOURCES} directory shouldn't exist in your build directory.`,
923
+ `Keycloakify build error: The ${directoryBasename} directory shouldn't exist in your build directory.`,
919
924
  `(${(0,external_path_.relative)(process.cwd(), dirPath)}).\n`,
920
925
  `Theses assets are only required for local development with Storybook.",
921
926
  "Please remove this directory as an additional step of your command.\n`,
@@ -1176,6 +1181,7 @@ async function generateResources(params) {
1176
1181
  });
1177
1182
  };
1178
1183
  }
1184
+ // NOTE: Legacy
1179
1185
  keycloak_static_resources: {
1180
1186
  if (isNative) {
1181
1187
  break keycloak_static_resources;
@@ -1183,11 +1189,28 @@ async function generateResources(params) {
1183
1189
  if (isSpa) {
1184
1190
  break keycloak_static_resources;
1185
1191
  }
1192
+ // TODO: Implement a check to skip that.
1186
1193
  (0,transformCodebase/* transformCodebase */.N)({
1187
1194
  srcDirPath: (0,external_path_.join)((0,getThisCodebaseRootDirPath/* getThisCodebaseRootDirPath */.e)(), "res", "public", constants/* WELL_KNOWN_DIRECTORY_BASE_NAME.KEYCLOAKIFY_DEV_RESOURCES */.Ju.KEYCLOAKIFY_DEV_RESOURCES, themeType),
1188
1195
  destDirPath: (0,external_path_.join)(themeTypeDirPath, "resources")
1189
1196
  });
1190
1197
  }
1198
+ extensions_static_resources: {
1199
+ if (isNative) {
1200
+ break extensions_static_resources;
1201
+ }
1202
+ if (isSpa) {
1203
+ break extensions_static_resources;
1204
+ }
1205
+ const dirPath = (0,external_path_.join)(buildContext.publicDirPath, constants/* KEYCLOAK_THEME */.PC, themeType);
1206
+ if (!external_fs_default().existsSync(dirPath)) {
1207
+ break extensions_static_resources;
1208
+ }
1209
+ (0,transformCodebase/* transformCodebase */.N)({
1210
+ srcDirPath: dirPath,
1211
+ destDirPath: (0,external_path_.join)(themeTypeDirPath, "resources", constants/* WELL_KNOWN_DIRECTORY_BASE_NAME.DIST */.Ju.DIST, constants/* KEYCLOAK_THEME */.PC, themeType)
1212
+ });
1213
+ }
1191
1214
  bring_in_account_v1: {
1192
1215
  if (isNative) {
1193
1216
  break bring_in_account_v1;
package/bin/786.index.js CHANGED
@@ -413,13 +413,15 @@ async function runPrettier(params) {
413
413
  return sourceCode;
414
414
  }
415
415
  const config = await prettier.resolveConfig(filePath);
416
- formattedSourceCode = await prettier.format(sourceCode, Object.assign(Object.assign({}, config), { filePath, parser: inferredParser }));
416
+ formattedSourceCode = await prettier.format(typeof sourceCode === "string" ? sourceCode : sourceCode.toString("utf8"), Object.assign(Object.assign({}, config), { filePath, parser: inferredParser }));
417
417
  }
418
418
  catch (error) {
419
419
  console.log(chalk__WEBPACK_IMPORTED_MODULE_4___default().red(`You probably need to upgrade the version of prettier in your project`));
420
420
  throw error;
421
421
  }
422
- return formattedSourceCode;
422
+ return typeof sourceCode === "string"
423
+ ? formattedSourceCode
424
+ : Buffer.from(formattedSourceCode, "utf8");
423
425
  }
424
426
  //# sourceMappingURL=runPrettier.js.map
425
427
 
package/bin/84.index.js CHANGED
@@ -605,13 +605,15 @@ async function runPrettier(params) {
605
605
  return sourceCode;
606
606
  }
607
607
  const config = await prettier.resolveConfig(filePath);
608
- formattedSourceCode = await prettier.format(sourceCode, Object.assign(Object.assign({}, config), { filePath, parser: inferredParser }));
608
+ formattedSourceCode = await prettier.format(typeof sourceCode === "string" ? sourceCode : sourceCode.toString("utf8"), Object.assign(Object.assign({}, config), { filePath, parser: inferredParser }));
609
609
  }
610
610
  catch (error) {
611
611
  console.log(chalk__WEBPACK_IMPORTED_MODULE_4___default().red(`You probably need to upgrade the version of prettier in your project`));
612
612
  throw error;
613
613
  }
614
- return formattedSourceCode;
614
+ return typeof sourceCode === "string"
615
+ ? formattedSourceCode
616
+ : Buffer.from(formattedSourceCode, "utf8");
615
617
  }
616
618
  //# sourceMappingURL=runPrettier.js.map
617
619
 
package/bin/930.index.js CHANGED
@@ -12,7 +12,7 @@ __webpack_require__.r(__webpack_exports__);
12
12
  /* harmony export */ });
13
13
  /* harmony import */ var _sync_extensions_getExtensionModuleFileSourceCodeReadyToBeCopied__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2237);
14
14
  /* harmony import */ var _sync_extensions_sync_extension__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(91097);
15
- /* harmony import */ var _sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69674);
15
+ /* harmony import */ var _sync_extensions_managedGitignoreFiles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(86087);
16
16
  /* harmony import */ var _sync_extensions_extensionModuleMeta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77372);
17
17
  /* harmony import */ var _tools_getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84794);
18
18
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71017);
@@ -21,8 +21,13 @@ __webpack_require__.r(__webpack_exports__);
21
21
  /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(73292);
22
22
  /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_7__);
23
23
  /* harmony import */ var _tools_isInside__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90665);
24
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(78818);
25
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_9__);
24
+ /* harmony import */ var _shared_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(173);
25
+ /* harmony import */ var evt_tools_inDepth_same__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(33805);
26
+ /* harmony import */ var evt_tools_inDepth_same__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(evt_tools_inDepth_same__WEBPACK_IMPORTED_MODULE_10__);
27
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(78818);
28
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_11__);
29
+
30
+
26
31
 
27
32
 
28
33
 
@@ -37,20 +42,26 @@ async function command(params) {
37
42
  const { buildContext, cliCommandOptions } = params;
38
43
  const extensionModuleMetas = await (0,_sync_extensions_extensionModuleMeta__WEBPACK_IMPORTED_MODULE_3__/* .getExtensionModuleMetas */ .f)({ buildContext });
39
44
  const { targetFileRelativePathsByExtensionModuleMeta } = await (async () => {
40
- const fileOrDirectoryRelativePath = (0,path__WEBPACK_IMPORTED_MODULE_5__.relative)(buildContext.themeSrcDirPath, (0,_tools_getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_4__/* .getAbsoluteAndInOsFormatPath */ .c)({
41
- cwd: buildContext.themeSrcDirPath,
42
- pathIsh: cliCommandOptions.path
43
- }));
45
+ const fileOrDirectoryRelativePath = (() => {
46
+ const dirPath_ctx = cliCommandOptions.isPublic
47
+ ? (0,path__WEBPACK_IMPORTED_MODULE_5__.join)(buildContext.publicDirPath, _shared_constants__WEBPACK_IMPORTED_MODULE_9__/* .KEYCLOAK_THEME */ .PC)
48
+ : buildContext.themeSrcDirPath;
49
+ return (0,path__WEBPACK_IMPORTED_MODULE_5__.relative)(dirPath_ctx, (0,_tools_getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_4__/* .getAbsoluteAndInOsFormatPath */ .c)({
50
+ cwd: dirPath_ctx,
51
+ pathIsh: cliCommandOptions.path
52
+ }));
53
+ })();
44
54
  const arr = extensionModuleMetas
45
55
  .map(extensionModuleMeta => ({
46
56
  extensionModuleMeta,
47
57
  fileRelativePaths: extensionModuleMeta.files
58
+ .filter(({ fileRelativePath, isPublic }) => cliCommandOptions.isPublic === isPublic &&
59
+ (fileRelativePath === fileOrDirectoryRelativePath ||
60
+ (0,_tools_isInside__WEBPACK_IMPORTED_MODULE_8__/* .isInside */ .V)({
61
+ dirPath: fileOrDirectoryRelativePath,
62
+ filePath: fileRelativePath
63
+ })))
48
64
  .map(({ fileRelativePath }) => fileRelativePath)
49
- .filter(fileRelativePath => fileRelativePath === fileOrDirectoryRelativePath ||
50
- (0,_tools_isInside__WEBPACK_IMPORTED_MODULE_8__/* .isInside */ .V)({
51
- dirPath: fileOrDirectoryRelativePath,
52
- filePath: fileRelativePath
53
- }))
54
65
  }))
55
66
  .filter(({ fileRelativePaths }) => fileRelativePaths.length !== 0);
56
67
  const targetFileRelativePathsByExtensionModuleMeta = new Map();
@@ -60,29 +71,31 @@ async function command(params) {
60
71
  return { targetFileRelativePathsByExtensionModuleMeta };
61
72
  })();
62
73
  if (targetFileRelativePathsByExtensionModuleMeta.size === 0) {
63
- console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().yellow("There is no Keycloakify extension modules files matching the provided path."));
74
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_11___default().yellow("There is no Keycloakify extension modules files matching the provided path."));
64
75
  process.exit(1);
65
76
  }
66
- const { ownedFilesRelativePaths: ownedFilesRelativePaths_current } = await (0,_sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__/* .readManagedGitignoreFile */ .w)({
77
+ const { ownedFilesRelativePaths: ownedFilesRelativePaths_current } = await (0,_sync_extensions_managedGitignoreFiles__WEBPACK_IMPORTED_MODULE_2__/* .readManagedGitignoresFile */ .P)({
67
78
  buildContext
68
79
  });
69
80
  await (cliCommandOptions.isRevert ? command_revert : command_own)({
70
81
  extensionModuleMetas,
82
+ isPublic: cliCommandOptions.isPublic,
71
83
  targetFileRelativePathsByExtensionModuleMeta,
72
84
  ownedFilesRelativePaths_current,
73
85
  buildContext
74
86
  });
75
87
  }
76
88
  async function command_own(params) {
77
- const { extensionModuleMetas, targetFileRelativePathsByExtensionModuleMeta, ownedFilesRelativePaths_current, buildContext } = params;
78
- await (0,_sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__/* .writeManagedGitignoreFile */ .Y)({
89
+ const { extensionModuleMetas, isPublic, targetFileRelativePathsByExtensionModuleMeta, ownedFilesRelativePaths_current, buildContext } = params;
90
+ await (0,_sync_extensions_managedGitignoreFiles__WEBPACK_IMPORTED_MODULE_2__/* .writeManagedGitignoreFiles */ .F)({
79
91
  buildContext,
80
92
  extensionModuleMetas,
81
93
  ownedFilesRelativePaths: [
82
94
  ...ownedFilesRelativePaths_current,
83
95
  ...Array.from(targetFileRelativePathsByExtensionModuleMeta.values())
84
96
  .flat()
85
- .filter(fileRelativePath => !ownedFilesRelativePaths_current.includes(fileRelativePath))
97
+ .filter(fileRelativePath => !ownedFilesRelativePaths_current.some(entry => (0,evt_tools_inDepth_same__WEBPACK_IMPORTED_MODULE_10__.same)(entry, { isPublic, fileRelativePath })))
98
+ .map(fileRelativePath => ({ isPublic, fileRelativePath }))
86
99
  ]
87
100
  });
88
101
  const writeActions = [];
@@ -92,50 +105,53 @@ async function command_own(params) {
92
105
  packageJsonDirPath: (0,path__WEBPACK_IMPORTED_MODULE_5__.dirname)(buildContext.packageJsonFilePath)
93
106
  });
94
107
  for (const fileRelativePath of fileRelativePaths) {
95
- if (ownedFilesRelativePaths_current.includes(fileRelativePath)) {
96
- console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().grey(`You already have ownership over '${fileRelativePath}'.`));
108
+ if (ownedFilesRelativePaths_current.some(entry => (0,evt_tools_inDepth_same__WEBPACK_IMPORTED_MODULE_10__.same)(entry, { isPublic, fileRelativePath }))) {
109
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_11___default().grey(`You already have ownership over '${fileRelativePath}'.`));
97
110
  continue;
98
111
  }
99
112
  writeActions.push(async () => {
100
113
  const sourceCode = await (0,_sync_extensions_getExtensionModuleFileSourceCodeReadyToBeCopied__WEBPACK_IMPORTED_MODULE_0__/* .getExtensionModuleFileSourceCodeReadyToBeCopied */ .p)({
101
114
  buildContext,
115
+ isPublic,
102
116
  fileRelativePath,
103
117
  isOwnershipAction: true,
104
118
  extensionModuleName: extensionModuleMeta.moduleName,
105
119
  extensionModuleDirPath,
106
120
  extensionModuleVersion: extensionModuleMeta.version
107
121
  });
108
- await fs_promises__WEBPACK_IMPORTED_MODULE_7__.writeFile((0,path__WEBPACK_IMPORTED_MODULE_5__.join)(buildContext.themeSrcDirPath, fileRelativePath), sourceCode);
109
- console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().green(`Ownership over '${fileRelativePath}' claimed.`));
122
+ await fs_promises__WEBPACK_IMPORTED_MODULE_7__.writeFile((0,path__WEBPACK_IMPORTED_MODULE_5__.join)(isPublic
123
+ ? (0,path__WEBPACK_IMPORTED_MODULE_5__.join)(buildContext.publicDirPath, _shared_constants__WEBPACK_IMPORTED_MODULE_9__/* .KEYCLOAK_THEME */ .PC)
124
+ : buildContext.themeSrcDirPath, fileRelativePath), sourceCode);
125
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_11___default().green(`Ownership over '${fileRelativePath}' claimed.`));
110
126
  });
111
127
  }
112
128
  }
113
129
  if (writeActions.length === 0) {
114
- console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().yellow("No new file claimed."));
130
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_11___default().yellow("No new file claimed."));
115
131
  return;
116
132
  }
117
133
  await Promise.all(writeActions.map(action => action()));
118
134
  }
119
135
  async function command_revert(params) {
120
- const { extensionModuleMetas, targetFileRelativePathsByExtensionModuleMeta, ownedFilesRelativePaths_current, buildContext } = params;
136
+ const { extensionModuleMetas, isPublic, targetFileRelativePathsByExtensionModuleMeta, ownedFilesRelativePaths_current, buildContext } = params;
121
137
  const ownedFilesRelativePaths_toRemove = Array.from(targetFileRelativePathsByExtensionModuleMeta.values())
122
138
  .flat()
123
139
  .filter(fileRelativePath => {
124
- if (!ownedFilesRelativePaths_current.includes(fileRelativePath)) {
125
- console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().grey(`Ownership over '${fileRelativePath}' wasn't claimed.`));
140
+ if (!ownedFilesRelativePaths_current.some(entry => (0,evt_tools_inDepth_same__WEBPACK_IMPORTED_MODULE_10__.same)(entry, { isPublic, fileRelativePath }))) {
141
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_11___default().grey(`Ownership over '${fileRelativePath}' wasn't claimed.`));
126
142
  return false;
127
143
  }
128
- console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().green(`Ownership over '${fileRelativePath}' relinquished.`));
144
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_11___default().green(`Ownership over '${fileRelativePath}' relinquished.`));
129
145
  return true;
130
146
  });
131
147
  if (ownedFilesRelativePaths_toRemove.length === 0) {
132
- console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().yellow("No file relinquished."));
148
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_11___default().yellow("No file relinquished."));
133
149
  return;
134
150
  }
135
- await (0,_sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__/* .writeManagedGitignoreFile */ .Y)({
151
+ await (0,_sync_extensions_managedGitignoreFiles__WEBPACK_IMPORTED_MODULE_2__/* .writeManagedGitignoreFiles */ .F)({
136
152
  buildContext,
137
153
  extensionModuleMetas,
138
- ownedFilesRelativePaths: ownedFilesRelativePaths_current.filter(fileRelativePath => !ownedFilesRelativePaths_toRemove.includes(fileRelativePath))
154
+ ownedFilesRelativePaths: ownedFilesRelativePaths_current.filter(entry => !ownedFilesRelativePaths_toRemove.some(fileRelativePath => (0,evt_tools_inDepth_same__WEBPACK_IMPORTED_MODULE_10__.same)(entry, { isPublic, fileRelativePath })))
139
155
  });
140
156
  await (0,_sync_extensions_sync_extension__WEBPACK_IMPORTED_MODULE_1__/* .command */ .W)({ buildContext });
141
157
  }
package/bin/949.index.js CHANGED
@@ -429,13 +429,15 @@ async function runPrettier(params) {
429
429
  return sourceCode;
430
430
  }
431
431
  const config = await prettier.resolveConfig(filePath);
432
- formattedSourceCode = await prettier.format(sourceCode, Object.assign(Object.assign({}, config), { filePath, parser: inferredParser }));
432
+ formattedSourceCode = await prettier.format(typeof sourceCode === "string" ? sourceCode : sourceCode.toString("utf8"), Object.assign(Object.assign({}, config), { filePath, parser: inferredParser }));
433
433
  }
434
434
  catch (error) {
435
435
  console.log(chalk__WEBPACK_IMPORTED_MODULE_4___default().red(`You probably need to upgrade the version of prettier in your project`));
436
436
  throw error;
437
437
  }
438
- return formattedSourceCode;
438
+ return typeof sourceCode === "string"
439
+ ? formattedSourceCode
440
+ : Buffer.from(formattedSourceCode, "utf8");
439
441
  }
440
442
  //# sourceMappingURL=runPrettier.js.map
441
443