keycloakify 11.8.37-rc.1 → 11.8.37

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/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_managedGitignoreFiles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(86087);
15
+ /* harmony import */ var _sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69674);
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,13 +21,8 @@ __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 _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
-
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__);
31
26
 
32
27
 
33
28
 
@@ -42,26 +37,20 @@ async function command(params) {
42
37
  const { buildContext, cliCommandOptions } = params;
43
38
  const extensionModuleMetas = await (0,_sync_extensions_extensionModuleMeta__WEBPACK_IMPORTED_MODULE_3__/* .getExtensionModuleMetas */ .f)({ buildContext });
44
39
  const { targetFileRelativePathsByExtensionModuleMeta } = await (async () => {
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
- })();
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
+ }));
54
44
  const arr = extensionModuleMetas
55
45
  .map(extensionModuleMeta => ({
56
46
  extensionModuleMeta,
57
47
  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
- })))
64
48
  .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
+ }))
65
54
  }))
66
55
  .filter(({ fileRelativePaths }) => fileRelativePaths.length !== 0);
67
56
  const targetFileRelativePathsByExtensionModuleMeta = new Map();
@@ -71,31 +60,29 @@ async function command(params) {
71
60
  return { targetFileRelativePathsByExtensionModuleMeta };
72
61
  })();
73
62
  if (targetFileRelativePathsByExtensionModuleMeta.size === 0) {
74
- console.log(chalk__WEBPACK_IMPORTED_MODULE_11___default().yellow("There is no Keycloakify extension modules files matching the provided path."));
63
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().yellow("There is no Keycloakify extension modules files matching the provided path."));
75
64
  process.exit(1);
76
65
  }
77
- const { ownedFilesRelativePaths: ownedFilesRelativePaths_current } = await (0,_sync_extensions_managedGitignoreFiles__WEBPACK_IMPORTED_MODULE_2__/* .readManagedGitignoresFile */ .P)({
66
+ const { ownedFilesRelativePaths: ownedFilesRelativePaths_current } = await (0,_sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__/* .readManagedGitignoreFile */ .w)({
78
67
  buildContext
79
68
  });
80
69
  await (cliCommandOptions.isRevert ? command_revert : command_own)({
81
70
  extensionModuleMetas,
82
- isPublic: cliCommandOptions.isPublic,
83
71
  targetFileRelativePathsByExtensionModuleMeta,
84
72
  ownedFilesRelativePaths_current,
85
73
  buildContext
86
74
  });
87
75
  }
88
76
  async function command_own(params) {
89
- const { extensionModuleMetas, isPublic, targetFileRelativePathsByExtensionModuleMeta, ownedFilesRelativePaths_current, buildContext } = params;
90
- await (0,_sync_extensions_managedGitignoreFiles__WEBPACK_IMPORTED_MODULE_2__/* .writeManagedGitignoreFiles */ .F)({
77
+ const { extensionModuleMetas, targetFileRelativePathsByExtensionModuleMeta, ownedFilesRelativePaths_current, buildContext } = params;
78
+ await (0,_sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__/* .writeManagedGitignoreFile */ .Y)({
91
79
  buildContext,
92
80
  extensionModuleMetas,
93
81
  ownedFilesRelativePaths: [
94
82
  ...ownedFilesRelativePaths_current,
95
83
  ...Array.from(targetFileRelativePathsByExtensionModuleMeta.values())
96
84
  .flat()
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 }))
85
+ .filter(fileRelativePath => !ownedFilesRelativePaths_current.includes(fileRelativePath))
99
86
  ]
100
87
  });
101
88
  const writeActions = [];
@@ -105,53 +92,50 @@ async function command_own(params) {
105
92
  packageJsonDirPath: (0,path__WEBPACK_IMPORTED_MODULE_5__.dirname)(buildContext.packageJsonFilePath)
106
93
  });
107
94
  for (const fileRelativePath of fileRelativePaths) {
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}'.`));
95
+ if (ownedFilesRelativePaths_current.includes(fileRelativePath)) {
96
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().grey(`You already have ownership over '${fileRelativePath}'.`));
110
97
  continue;
111
98
  }
112
99
  writeActions.push(async () => {
113
100
  const sourceCode = await (0,_sync_extensions_getExtensionModuleFileSourceCodeReadyToBeCopied__WEBPACK_IMPORTED_MODULE_0__/* .getExtensionModuleFileSourceCodeReadyToBeCopied */ .p)({
114
101
  buildContext,
115
- isPublic,
116
102
  fileRelativePath,
117
103
  isOwnershipAction: true,
118
104
  extensionModuleName: extensionModuleMeta.moduleName,
119
105
  extensionModuleDirPath,
120
106
  extensionModuleVersion: extensionModuleMeta.version
121
107
  });
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.`));
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.`));
126
110
  });
127
111
  }
128
112
  }
129
113
  if (writeActions.length === 0) {
130
- console.log(chalk__WEBPACK_IMPORTED_MODULE_11___default().yellow("No new file claimed."));
114
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().yellow("No new file claimed."));
131
115
  return;
132
116
  }
133
117
  await Promise.all(writeActions.map(action => action()));
134
118
  }
135
119
  async function command_revert(params) {
136
- const { extensionModuleMetas, isPublic, targetFileRelativePathsByExtensionModuleMeta, ownedFilesRelativePaths_current, buildContext } = params;
120
+ const { extensionModuleMetas, targetFileRelativePathsByExtensionModuleMeta, ownedFilesRelativePaths_current, buildContext } = params;
137
121
  const ownedFilesRelativePaths_toRemove = Array.from(targetFileRelativePathsByExtensionModuleMeta.values())
138
122
  .flat()
139
123
  .filter(fileRelativePath => {
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.`));
124
+ if (!ownedFilesRelativePaths_current.includes(fileRelativePath)) {
125
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().grey(`Ownership over '${fileRelativePath}' wasn't claimed.`));
142
126
  return false;
143
127
  }
144
- console.log(chalk__WEBPACK_IMPORTED_MODULE_11___default().green(`Ownership over '${fileRelativePath}' relinquished.`));
128
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().green(`Ownership over '${fileRelativePath}' relinquished.`));
145
129
  return true;
146
130
  });
147
131
  if (ownedFilesRelativePaths_toRemove.length === 0) {
148
- console.log(chalk__WEBPACK_IMPORTED_MODULE_11___default().yellow("No file relinquished."));
132
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().yellow("No file relinquished."));
149
133
  return;
150
134
  }
151
- await (0,_sync_extensions_managedGitignoreFiles__WEBPACK_IMPORTED_MODULE_2__/* .writeManagedGitignoreFiles */ .F)({
135
+ await (0,_sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__/* .writeManagedGitignoreFile */ .Y)({
152
136
  buildContext,
153
137
  extensionModuleMetas,
154
- ownedFilesRelativePaths: ownedFilesRelativePaths_current.filter(entry => !ownedFilesRelativePaths_toRemove.some(fileRelativePath => (0,evt_tools_inDepth_same__WEBPACK_IMPORTED_MODULE_10__.same)(entry, { isPublic, fileRelativePath })))
138
+ ownedFilesRelativePaths: ownedFilesRelativePaths_current.filter(fileRelativePath => !ownedFilesRelativePaths_toRemove.includes(fileRelativePath))
155
139
  });
156
140
  await (0,_sync_extensions_sync_extension__WEBPACK_IMPORTED_MODULE_1__/* .command */ .W)({ buildContext });
157
141
  }
package/bin/97.index.js CHANGED
@@ -185,7 +185,6 @@ const zExtensionModuleMeta = (() => {
185
185
  moduleName: lib.z.string(),
186
186
  version: lib.z.string(),
187
187
  files: lib.z.array(lib.z.object({
188
- isPublic: lib.z.boolean(),
189
188
  fileRelativePath: lib.z.string(),
190
189
  hash: lib.z.string(),
191
190
  copyableFilePath: lib.z.string()
@@ -290,40 +289,37 @@ async function getExtensionModuleMetas(params) {
290
289
  return extensionModuleMeta_cache;
291
290
  }
292
291
  const files = [];
293
- await crawlAsync({
294
- dirPath: (0,external_path_.join)(dirPath, constants/* KEYCLOAK_THEME */.PC),
295
- returnedPathsType: "relative to dirPath",
296
- onFileFound: async (fileRelativePath) => {
297
- const isPublic = fileRelativePath.startsWith(`public${external_path_.sep}`);
298
- const fileRelativePath_contextual = isPublic
299
- ? (0,external_path_.relative)("public", fileRelativePath)
300
- : fileRelativePath;
301
- const sourceCode = await (0,getExtensionModuleFileSourceCodeReadyToBeCopied/* getExtensionModuleFileSourceCodeReadyToBeCopied */.p)({
302
- buildContext,
303
- isPublic,
304
- fileRelativePath: fileRelativePath_contextual,
305
- isOwnershipAction: false,
306
- extensionModuleDirPath: dirPath,
307
- extensionModuleName: moduleName,
308
- extensionModuleVersion: version
309
- });
310
- const hash = computeHash(sourceCode);
311
- const copyableFilePath = (0,external_path_.join)((0,external_path_.dirname)(cacheFilePath), constants/* KEYCLOAK_THEME */.PC, fileRelativePath);
312
- {
313
- const dirPath = (0,external_path_.dirname)(copyableFilePath);
314
- if (!(await (0,fs_existsAsync/* existsAsync */.o)(dirPath))) {
315
- await promises_.mkdir(dirPath, { recursive: true });
292
+ {
293
+ const srcDirPath = (0,external_path_.join)(dirPath, constants/* KEYCLOAK_THEME */.PC);
294
+ await crawlAsync({
295
+ dirPath: srcDirPath,
296
+ returnedPathsType: "relative to dirPath",
297
+ onFileFound: async (fileRelativePath) => {
298
+ const sourceCode = await (0,getExtensionModuleFileSourceCodeReadyToBeCopied/* getExtensionModuleFileSourceCodeReadyToBeCopied */.p)({
299
+ buildContext,
300
+ fileRelativePath,
301
+ isOwnershipAction: false,
302
+ extensionModuleDirPath: dirPath,
303
+ extensionModuleName: moduleName,
304
+ extensionModuleVersion: version
305
+ });
306
+ const hash = computeHash(sourceCode);
307
+ const copyableFilePath = (0,external_path_.join)((0,external_path_.dirname)(cacheFilePath), constants/* KEYCLOAK_THEME */.PC, fileRelativePath);
308
+ {
309
+ const dirPath = (0,external_path_.dirname)(copyableFilePath);
310
+ if (!(await (0,fs_existsAsync/* existsAsync */.o)(dirPath))) {
311
+ await promises_.mkdir(dirPath, { recursive: true });
312
+ }
316
313
  }
314
+ promises_.writeFile(copyableFilePath, sourceCode);
315
+ files.push({
316
+ fileRelativePath,
317
+ hash,
318
+ copyableFilePath
319
+ });
317
320
  }
318
- promises_.writeFile(copyableFilePath, sourceCode);
319
- files.push({
320
- isPublic,
321
- fileRelativePath: fileRelativePath_contextual,
322
- hash,
323
- copyableFilePath
324
- });
325
- }
326
- });
321
+ });
322
+ }
327
323
  return (0,id.id)({
328
324
  moduleName,
329
325
  version,
@@ -380,7 +376,7 @@ function computeHash(data) {
380
376
 
381
377
  (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .h)();
382
378
  async function getExtensionModuleFileSourceCodeReadyToBeCopied(params) {
383
- const { buildContext, extensionModuleDirPath, isPublic, fileRelativePath, isOwnershipAction, extensionModuleName, extensionModuleVersion } = params;
379
+ const { buildContext, extensionModuleDirPath, fileRelativePath, isOwnershipAction, extensionModuleName, extensionModuleVersion } = params;
384
380
  let sourceCode = (await fs_promises__WEBPACK_IMPORTED_MODULE_1__.readFile((0,path__WEBPACK_IMPORTED_MODULE_2__.join)(extensionModuleDirPath, _shared_constants__WEBPACK_IMPORTED_MODULE_4__/* .KEYCLOAK_THEME */ .PC, fileRelativePath))).toString("utf8");
385
381
  add_eslint_disable: {
386
382
  if (isOwnershipAction) {
@@ -404,21 +400,19 @@ async function getExtensionModuleFileSourceCodeReadyToBeCopied(params) {
404
400
  `This file has been claimed for ownership from ${extensionModuleName} version ${extensionModuleVersion}.`,
405
401
  `To relinquish ownership and restore this file to its original content, run the following command:`,
406
402
  ``,
407
- `$ npx keycloakify own --path "${path}"${isPublic ? " --public " : ""}--revert`
403
+ `$ npx keycloakify own --path "${path}" --revert`
408
404
  ]
409
405
  : [
410
406
  `WARNING: Before modifying this file, run the following command:`,
411
407
  ``,
412
- `$ npx keycloakify own --path "${path}"${isPublic ? " --public" : ""}`,
408
+ `$ npx keycloakify own --path "${path}"`,
413
409
  ``,
414
410
  `This file is provided by ${extensionModuleName} version ${extensionModuleVersion}.`,
415
411
  `It was copied into your repository by the postinstall script: \`keycloakify sync-extensions\`.`
416
412
  ];
417
413
  })()
418
414
  });
419
- const destFilePath = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(isPublic
420
- ? (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(buildContext.publicDirPath, _shared_constants__WEBPACK_IMPORTED_MODULE_4__/* .KEYCLOAK_THEME */ .PC)
421
- : buildContext.themeSrcDirPath, fileRelativePath);
415
+ const destFilePath = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(buildContext.themeSrcDirPath, fileRelativePath);
422
416
  format: {
423
417
  if (!(await (0,_tools_runPrettier__WEBPACK_IMPORTED_MODULE_0__/* .getIsPrettierAvailable */ .MT)())) {
424
418
  break format;
@@ -480,12 +474,12 @@ function addCommentToSourceCode(params) {
480
474
 
481
475
  /***/ }),
482
476
 
483
- /***/ 86087:
477
+ /***/ 69674:
484
478
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
485
479
 
486
480
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
487
- /* harmony export */ "F": () => (/* binding */ writeManagedGitignoreFiles),
488
- /* harmony export */ "P": () => (/* binding */ readManagedGitignoresFile)
481
+ /* harmony export */ "Y": () => (/* binding */ writeManagedGitignoreFile),
482
+ /* harmony export */ "w": () => (/* binding */ readManagedGitignoreFile)
489
483
  /* harmony export */ });
490
484
  /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
491
485
  /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
@@ -494,114 +488,89 @@ function addCommentToSourceCode(params) {
494
488
  /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29041);
495
489
  /* harmony import */ var _tools_fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43765);
496
490
  /* harmony import */ var _tools_getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84794);
497
- /* harmony import */ var _shared_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(173);
498
-
499
491
 
500
492
 
501
493
 
502
494
 
503
495
 
504
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .h)();
505
496
  (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .h)();
506
497
  const DELIMITER_START = `# === Owned files start ===`;
507
498
  const DELIMITER_END = `# === Owned files end =====`;
508
- async function writeManagedGitignoreFiles(params) {
509
- const { buildContext } = params;
510
- for (const isPublicIteration of [false, true]) {
511
- const extensionModuleMetas_ctx = params.extensionModuleMetas
512
- .map(extensionModuleMeta => (Object.assign(Object.assign({}, extensionModuleMeta), { files: extensionModuleMeta.files.filter(({ isPublic }) => isPublic === isPublicIteration) })))
513
- .filter(extensionModuleMeta => extensionModuleMeta.files.length !== 0);
514
- if (extensionModuleMetas_ctx.length === 0) {
515
- continue;
516
- }
517
- const ownedFilesRelativePaths_ctx = params.ownedFilesRelativePaths.filter(({ isPublic }) => isPublic === isPublicIteration);
518
- const filePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(isPublicIteration
519
- ? (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(buildContext.publicDirPath, _shared_constants__WEBPACK_IMPORTED_MODULE_5__/* .KEYCLOAK_THEME */ .PC)
520
- : buildContext.themeSrcDirPath, ".gitignore");
521
- const content_new = Buffer.from([
522
- `# This file is managed by Keycloakify, do not edit it manually.`,
523
- ``,
524
- DELIMITER_START,
525
- ...ownedFilesRelativePaths_ctx
499
+ async function writeManagedGitignoreFile(params) {
500
+ const { buildContext, extensionModuleMetas, ownedFilesRelativePaths } = params;
501
+ if (extensionModuleMetas.length === 0) {
502
+ return;
503
+ }
504
+ const filePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(buildContext.themeSrcDirPath, ".gitignore");
505
+ const content_new = Buffer.from([
506
+ `# This file is managed by Keycloakify, do not edit it manually.`,
507
+ ``,
508
+ DELIMITER_START,
509
+ ...ownedFilesRelativePaths
510
+ .map(fileRelativePath => fileRelativePath.split(path__WEBPACK_IMPORTED_MODULE_1__.sep).join("/"))
511
+ .map(line => `# ${line}`),
512
+ DELIMITER_END,
513
+ ``,
514
+ ...extensionModuleMetas
515
+ .map(extensionModuleMeta => [
516
+ `# === ${extensionModuleMeta.moduleName} v${extensionModuleMeta.version} ===`,
517
+ ...extensionModuleMeta.files
526
518
  .map(({ fileRelativePath }) => fileRelativePath)
527
- .map(fileRelativePath => fileRelativePath.split(path__WEBPACK_IMPORTED_MODULE_1__.sep).join("/"))
528
- .map(line => `# ${line}`),
529
- DELIMITER_END,
530
- ``,
531
- ...extensionModuleMetas_ctx
532
- .map(extensionModuleMeta => [
533
- `# === ${extensionModuleMeta.moduleName} v${extensionModuleMeta.version} ===`,
534
- ...extensionModuleMeta.files
535
- .map(({ fileRelativePath }) => fileRelativePath)
536
- .filter(fileRelativePath => !ownedFilesRelativePaths_ctx
537
- .map(({ fileRelativePath }) => fileRelativePath)
538
- .includes(fileRelativePath))
539
- .map(fileRelativePath => `/${fileRelativePath.split(path__WEBPACK_IMPORTED_MODULE_1__.sep).join("/").replace(/^\.\//, "")}`),
540
- ``
541
- ])
542
- .flat()
543
- ].join("\n"), "utf8");
544
- const content_current = await (async () => {
545
- if (!(await (0,_tools_fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__/* .existsAsync */ .o)(filePath))) {
546
- return undefined;
547
- }
548
- return await fs_promises__WEBPACK_IMPORTED_MODULE_0__.readFile(filePath);
549
- })();
550
- if (content_current !== undefined && content_current.equals(content_new)) {
551
- continue;
519
+ .filter(fileRelativePath => !ownedFilesRelativePaths.includes(fileRelativePath))
520
+ .map(fileRelativePath => `/${fileRelativePath.split(path__WEBPACK_IMPORTED_MODULE_1__.sep).join("/").replace(/^\.\//, "")}`),
521
+ ``
522
+ ])
523
+ .flat()
524
+ ].join("\n"), "utf8");
525
+ const content_current = await (async () => {
526
+ if (!(await (0,_tools_fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__/* .existsAsync */ .o)(filePath))) {
527
+ return undefined;
552
528
  }
553
- create_dir: {
554
- const dirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.dirname)(filePath);
555
- if (await (0,_tools_fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__/* .existsAsync */ .o)(dirPath)) {
556
- break create_dir;
557
- }
558
- await fs_promises__WEBPACK_IMPORTED_MODULE_0__.mkdir(dirPath, { recursive: true });
529
+ return await fs_promises__WEBPACK_IMPORTED_MODULE_0__.readFile(filePath);
530
+ })();
531
+ if (content_current !== undefined && content_current.equals(content_new)) {
532
+ return;
533
+ }
534
+ create_dir: {
535
+ const dirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.dirname)(filePath);
536
+ if (await (0,_tools_fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__/* .existsAsync */ .o)(dirPath)) {
537
+ break create_dir;
559
538
  }
560
- await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(filePath, content_new);
539
+ await fs_promises__WEBPACK_IMPORTED_MODULE_0__.mkdir(dirPath, { recursive: true });
561
540
  }
541
+ await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(filePath, content_new);
562
542
  }
563
- async function readManagedGitignoresFile(params) {
543
+ async function readManagedGitignoreFile(params) {
564
544
  const { buildContext } = params;
565
- const ownedFilesRelativePaths = [];
566
- for (const isPublicIteration of [false, true]) {
567
- const filePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(isPublicIteration
568
- ? (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(buildContext.publicDirPath, _shared_constants__WEBPACK_IMPORTED_MODULE_5__/* .KEYCLOAK_THEME */ .PC)
569
- : buildContext.themeSrcDirPath, ".gitignore");
570
- if (!(await (0,_tools_fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__/* .existsAsync */ .o)(filePath))) {
571
- continue;
572
- }
573
- const contentStr = (await fs_promises__WEBPACK_IMPORTED_MODULE_0__.readFile(filePath)).toString("utf8");
574
- const payload = (() => {
575
- const index_start = contentStr.indexOf(DELIMITER_START);
576
- const index_end = contentStr.indexOf(DELIMITER_END);
577
- if (index_start === -1 || index_end === -1) {
578
- return undefined;
579
- }
580
- return contentStr
581
- .slice(index_start + DELIMITER_START.length, index_end)
582
- .trim();
583
- })();
584
- if (payload === undefined) {
585
- continue;
545
+ const filePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(buildContext.themeSrcDirPath, ".gitignore");
546
+ if (!(await (0,_tools_fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__/* .existsAsync */ .o)(filePath))) {
547
+ return { ownedFilesRelativePaths: [] };
548
+ }
549
+ const contentStr = (await fs_promises__WEBPACK_IMPORTED_MODULE_0__.readFile(filePath)).toString("utf8");
550
+ const payload = (() => {
551
+ const index_start = contentStr.indexOf(DELIMITER_START);
552
+ const index_end = contentStr.indexOf(DELIMITER_END);
553
+ if (index_start === -1 || index_end === -1) {
554
+ return undefined;
586
555
  }
587
- payload
588
- .split("\n")
589
- .map(line => line.trim())
590
- .map(line => line.replace(/^# /, ""))
591
- .filter(line => line !== "")
592
- .map(line => (0,_tools_getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_4__/* .getAbsoluteAndInOsFormatPath */ .c)({
593
- cwd: buildContext.themeSrcDirPath,
594
- pathIsh: line
595
- }))
596
- .map(filePath => (0,path__WEBPACK_IMPORTED_MODULE_1__.relative)(buildContext.themeSrcDirPath, filePath))
597
- .forEach(fileRelativePath => ownedFilesRelativePaths.push({
598
- isPublic: isPublicIteration,
599
- fileRelativePath
600
- }));
556
+ return contentStr.slice(index_start + DELIMITER_START.length, index_end).trim();
557
+ })();
558
+ if (payload === undefined) {
559
+ return { ownedFilesRelativePaths: [] };
601
560
  }
561
+ const ownedFilesRelativePaths = payload
562
+ .split("\n")
563
+ .map(line => line.trim())
564
+ .map(line => line.replace(/^# /, ""))
565
+ .filter(line => line !== "")
566
+ .map(line => (0,_tools_getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_4__/* .getAbsoluteAndInOsFormatPath */ .c)({
567
+ cwd: buildContext.themeSrcDirPath,
568
+ pathIsh: line
569
+ }))
570
+ .map(filePath => (0,path__WEBPACK_IMPORTED_MODULE_1__.relative)(buildContext.themeSrcDirPath, filePath));
602
571
  return { ownedFilesRelativePaths };
603
572
  }
604
- //# sourceMappingURL=managedGitignoreFiles.js.map
573
+ //# sourceMappingURL=managedGitignoreFile.js.map
605
574
 
606
575
  /***/ }),
607
576
 
@@ -731,8 +700,8 @@ async function installExtensionModulesPeerDependencies(params) {
731
700
  process.exit(0);
732
701
  }
733
702
  //# sourceMappingURL=installExtensionModulesPeerDependencies.js.map
734
- // EXTERNAL MODULE: ./dist/bin/sync-extensions/managedGitignoreFiles.js
735
- var managedGitignoreFiles = __webpack_require__(86087);
703
+ // EXTERNAL MODULE: ./dist/bin/sync-extensions/managedGitignoreFile.js
704
+ var managedGitignoreFile = __webpack_require__(69674);
736
705
  // EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
737
706
  var fs_existsAsync = __webpack_require__(43765);
738
707
  // EXTERNAL MODULE: external "child_process"
@@ -796,8 +765,6 @@ const untrackFromGit = runExclusive.build(groupRef, async (params) => {
796
765
  var update_kc_gen = __webpack_require__(10786);
797
766
  // EXTERNAL MODULE: ./dist/bin/shared/buildContext.js + 3 modules
798
767
  var shared_buildContext = __webpack_require__(85400);
799
- // EXTERNAL MODULE: ./dist/bin/shared/constants.js
800
- var constants = __webpack_require__(173);
801
768
  ;// CONCATENATED MODULE: ./dist/bin/sync-extensions/sync-extension.js
802
769
 
803
770
 
@@ -809,8 +776,6 @@ var constants = __webpack_require__(173);
809
776
 
810
777
 
811
778
 
812
-
813
-
814
779
  async function command(params) {
815
780
  const { buildContext } = params;
816
781
  const extensionModuleMetas = await (0,sync_extensions_extensionModuleMeta/* getExtensionModuleMetas */.f)({ buildContext });
@@ -818,22 +783,20 @@ async function command(params) {
818
783
  buildContext,
819
784
  extensionModuleMetas
820
785
  });
821
- const { ownedFilesRelativePaths } = await (0,managedGitignoreFiles/* readManagedGitignoresFile */.P)({
786
+ const { ownedFilesRelativePaths } = await (0,managedGitignoreFile/* readManagedGitignoreFile */.w)({
822
787
  buildContext
823
788
  });
824
- await (0,managedGitignoreFiles/* writeManagedGitignoreFiles */.F)({
789
+ await (0,managedGitignoreFile/* writeManagedGitignoreFile */.Y)({
825
790
  buildContext,
826
791
  ownedFilesRelativePaths,
827
792
  extensionModuleMetas
828
793
  });
829
794
  await Promise.all(extensionModuleMetas
830
- .map(extensionModuleMeta => Promise.all(extensionModuleMeta.files.map(async ({ isPublic, fileRelativePath, copyableFilePath, hash }) => {
831
- if (ownedFilesRelativePaths.some(entry => (0,same.same)(entry, { isPublic, fileRelativePath }))) {
795
+ .map(extensionModuleMeta => Promise.all(extensionModuleMeta.files.map(async ({ fileRelativePath, copyableFilePath, hash }) => {
796
+ if (ownedFilesRelativePaths.includes(fileRelativePath)) {
832
797
  return;
833
798
  }
834
- const destFilePath = (0,external_path_.join)(isPublic
835
- ? (0,external_path_.join)(buildContext.publicDirPath, constants/* KEYCLOAK_THEME */.PC)
836
- : buildContext.themeSrcDirPath, fileRelativePath);
799
+ const destFilePath = (0,external_path_.join)(buildContext.themeSrcDirPath, fileRelativePath);
837
800
  const doesFileExist = await (0,fs_existsAsync/* existsAsync */.o)(destFilePath);
838
801
  skip_condition: {
839
802
  if (!doesFileExist) {
@@ -6,7 +6,6 @@ export type BuildContextLike = BuildContextLike_kcContextExclusionsFtlCode & Bui
6
6
  extraThemeProperties: string[] | undefined;
7
7
  projectDirPath: string;
8
8
  projectBuildDirPath: string;
9
- publicDirPath: string;
10
9
  environmentVariables: {
11
10
  name: string;
12
11
  default: string;
package/bin/main.js CHANGED
@@ -16217,7 +16217,7 @@ program
16217
16217
  .task({
16218
16218
  skip,
16219
16219
  handler: async ({ projectDirPath }) => {
16220
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(783), __nccwpck_require__.e(712)]).then(__nccwpck_require__.bind(__nccwpck_require__, 35712));
16220
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(864), __nccwpck_require__.e(712)]).then(__nccwpck_require__.bind(__nccwpck_require__, 35712));
16221
16221
  await command({ buildContext: (0,buildContext/* getBuildContext */.s)({ projectDirPath }) });
16222
16222
  }
16223
16223
  });
@@ -16435,28 +16435,14 @@ program
16435
16435
  "removing your ownership claim and reverting any modifications."
16436
16436
  ].join(" "),
16437
16437
  defaultValue: false
16438
- })
16439
- .option({
16440
- key: "public",
16441
- name: (() => {
16442
- const long = "public";
16443
- const short = "p";
16444
- optionsKeys.push(long, short);
16445
- return { long, short };
16446
- })(),
16447
- description: [
16448
- "Flag to use when targeting a file or directory in the public directory",
16449
- "instead of the src"
16450
- ].join(" "),
16451
- defaultValue: false
16452
16438
  })
16453
16439
  .task({
16454
16440
  skip,
16455
- handler: async ({ projectDirPath, path, revert, public: public_params }) => {
16441
+ handler: async ({ projectDirPath, path, revert }) => {
16456
16442
  const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(69), __nccwpck_require__.e(84), __nccwpck_require__.e(97), __nccwpck_require__.e(930)]).then(__nccwpck_require__.bind(__nccwpck_require__, 71930));
16457
16443
  await command({
16458
16444
  buildContext: (0,buildContext/* getBuildContext */.s)({ projectDirPath }),
16459
- cliCommandOptions: { path, isRevert: revert, isPublic: public_params }
16445
+ cliCommandOptions: { path, isRevert: revert }
16460
16446
  });
16461
16447
  }
16462
16448
  });
package/bin/own.d.ts CHANGED
@@ -4,6 +4,5 @@ export declare function command(params: {
4
4
  cliCommandOptions: {
5
5
  path: string;
6
6
  isRevert: boolean;
7
- isPublic: boolean;
8
7
  };
9
8
  }): Promise<void>;
@@ -4,7 +4,6 @@ export type ExtensionModuleMeta = {
4
4
  moduleName: string;
5
5
  version: string;
6
6
  files: {
7
- isPublic: boolean;
8
7
  fileRelativePath: string;
9
8
  hash: string;
10
9
  copyableFilePath: string;
@@ -1,11 +1,9 @@
1
1
  /// <reference types="node" />
2
2
  export type BuildContextLike = {
3
3
  themeSrcDirPath: string;
4
- publicDirPath: string;
5
4
  };
6
5
  export declare function getExtensionModuleFileSourceCodeReadyToBeCopied(params: {
7
6
  buildContext: BuildContextLike;
8
- isPublic: boolean;
9
7
  fileRelativePath: string;
10
8
  isOwnershipAction: boolean;
11
9
  extensionModuleDirPath: string;
@@ -0,0 +1,14 @@
1
+ import type { ExtensionModuleMeta } from "./extensionModuleMeta";
2
+ export type BuildContextLike = {
3
+ themeSrcDirPath: string;
4
+ };
5
+ export declare function writeManagedGitignoreFile(params: {
6
+ buildContext: BuildContextLike;
7
+ extensionModuleMetas: ExtensionModuleMeta[];
8
+ ownedFilesRelativePaths: string[];
9
+ }): Promise<void>;
10
+ export declare function readManagedGitignoreFile(params: {
11
+ buildContext: BuildContextLike;
12
+ }): Promise<{
13
+ ownedFilesRelativePaths: string[];
14
+ }>;