keycloakify 11.6.1 → 11.7.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 (96) hide show
  1. package/bin/{653.index.js → 288.index.js} +221 -201
  2. package/bin/313.index.js +377 -0
  3. package/bin/{174.index.js → 33.index.js} +37 -2
  4. package/bin/{615.index.js → 355.index.js} +353 -102
  5. package/bin/363.index.js +1537 -0
  6. package/bin/453.index.js +6 -42
  7. package/bin/{503.index.js → 678.index.js} +577 -53
  8. package/bin/{921.index.js → 780.index.js} +54 -45
  9. package/bin/880.index.js +206 -21
  10. package/bin/9.index.js +850 -0
  11. package/bin/{525.index.js → 911.index.js} +1302 -2
  12. package/bin/930.index.js +164 -0
  13. package/bin/946.index.js +20 -0
  14. package/bin/{153.index.js → 947.index.js} +22 -797
  15. package/bin/main.js +61 -19
  16. package/bin/{eject-file.d.ts → own.d.ts} +2 -1
  17. package/bin/shared/{addPostinstallScriptIfNotPresent.d.ts → initializeSpa/addSyncExtensionsToPostinstallScript.d.ts} +1 -1
  18. package/bin/shared/initializeSpa/index.d.ts +1 -0
  19. package/bin/shared/initializeSpa/initializeSpa.d.ts +9 -0
  20. package/bin/{postinstall/uiModuleMeta.d.ts → sync-extensions/extensionModuleMeta.d.ts} +5 -5
  21. package/bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.d.ts +12 -0
  22. package/bin/sync-extensions/index.d.ts +1 -0
  23. package/bin/{postinstall/installUiModulesPeerDependencies.d.ts → sync-extensions/installExtensionModulesPeerDependencies.d.ts} +3 -3
  24. package/bin/{postinstall → sync-extensions}/managedGitignoreFile.d.ts +4 -4
  25. package/bin/tools/getInstalledModuleDirPath.d.ts +0 -1
  26. package/bin/tools/isKnownByGit.d.ts +3 -0
  27. package/bin/tools/isRootPath.d.ts +1 -0
  28. package/bin/tools/listInstalledModules.d.ts +0 -1
  29. package/package.json +41 -63
  30. package/src/bin/eject-page.ts +8 -84
  31. package/src/bin/initialize-account-theme/initialize-account-theme.ts +15 -14
  32. package/src/bin/initialize-admin-theme.ts +17 -124
  33. package/src/bin/initialize-email-theme.ts +10 -34
  34. package/src/bin/keycloakify/generateResources/generateResources.ts +49 -21
  35. package/src/bin/main.ts +61 -16
  36. package/src/bin/own.ts +208 -0
  37. package/src/bin/shared/{addPostinstallScriptIfNotPresent.ts → initializeSpa/addSyncExtensionsToPostinstallScript.ts} +4 -4
  38. package/src/bin/shared/initializeSpa/index.ts +1 -0
  39. package/src/bin/shared/initializeSpa/initializeSpa.ts +149 -0
  40. package/src/bin/{postinstall/uiModuleMeta.ts → sync-extensions/extensionModuleMeta.ts} +48 -43
  41. package/src/bin/{postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts → sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.ts} +32 -21
  42. package/src/bin/sync-extensions/index.ts +1 -0
  43. package/src/bin/{postinstall/installUiModulesPeerDependencies.ts → sync-extensions/installExtensionModulesPeerDependencies.ts} +15 -13
  44. package/src/bin/{postinstall → sync-extensions}/managedGitignoreFile.ts +18 -18
  45. package/src/bin/{postinstall/postinstall.ts → sync-extensions/sync-extension.ts} +14 -26
  46. package/src/bin/tools/getInstalledModuleDirPath.ts +24 -22
  47. package/src/bin/tools/isKnownByGit.ts +45 -0
  48. package/src/bin/tools/isRootPath.ts +22 -0
  49. package/src/bin/tools/listInstalledModules.ts +4 -6
  50. package/src/bin/tools/npmInstall.ts +1 -1
  51. package/src/bin/tools/untrackFromGit.ts +19 -3
  52. package/src/bin/tsconfig.json +1 -1
  53. package/bin/300.index.js +0 -770
  54. package/bin/375.index.js +0 -4089
  55. package/bin/490.index.js +0 -1108
  56. package/bin/568.index.js +0 -1867
  57. package/bin/735.index.js +0 -907
  58. package/bin/743.index.js +0 -69
  59. package/bin/854.index.js +0 -68
  60. package/bin/initialize-account-theme/copyBoilerplate.d.ts +0 -4
  61. package/bin/initialize-account-theme/initializeAccountTheme_multiPage.d.ts +0 -3
  62. package/bin/initialize-account-theme/initializeAccountTheme_singlePage.d.ts +0 -11
  63. package/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.d.ts +0 -12
  64. package/bin/postinstall/index.d.ts +0 -1
  65. package/bin/shared/getLatestsSemVersionedTag.d.ts +0 -15
  66. package/bin/shared/promptKeycloakVersion.d.ts +0 -10
  67. package/bin/tools/OptionalIfCanBeUndefined.d.ts +0 -14
  68. package/bin/tools/crc32.d.ts +0 -9
  69. package/bin/tools/deflate.d.ts +0 -24
  70. package/bin/tools/isTrackedByGit.d.ts +0 -3
  71. package/bin/tools/octokit-addons/getLatestsSemVersionedTag.d.ts +0 -15
  72. package/bin/tools/octokit-addons/listTags.d.ts +0 -13
  73. package/bin/tools/tee.d.ts +0 -3
  74. package/bin/tools/trimIndent.d.ts +0 -5
  75. package/src/bin/eject-file.ts +0 -68
  76. package/src/bin/initialize-account-theme/copyBoilerplate.ts +0 -32
  77. package/src/bin/initialize-account-theme/initializeAccountTheme_multiPage.ts +0 -21
  78. package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +0 -142
  79. package/src/bin/initialize-account-theme/src/single-page/KcContext.ts +0 -7
  80. package/src/bin/initialize-account-theme/src/single-page/KcPage.tsx +0 -11
  81. package/src/bin/postinstall/index.ts +0 -1
  82. package/src/bin/shared/getLatestsSemVersionedTag.ts +0 -201
  83. package/src/bin/shared/promptKeycloakVersion.ts +0 -72
  84. package/src/bin/tools/OptionalIfCanBeUndefined.ts +0 -12
  85. package/src/bin/tools/crc32.ts +0 -73
  86. package/src/bin/tools/deflate.ts +0 -61
  87. package/src/bin/tools/isTrackedByGit.ts +0 -29
  88. package/src/bin/tools/octokit-addons/getLatestsSemVersionedTag.ts +0 -47
  89. package/src/bin/tools/octokit-addons/listTags.ts +0 -60
  90. package/src/bin/tools/tee.ts +0 -39
  91. package/src/bin/tools/trimIndent.ts +0 -49
  92. /package/bin/{postinstall/postinstall.d.ts → sync-extensions/sync-extension.d.ts} +0 -0
  93. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcContext.ts +0 -0
  94. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcPage.tsx +0 -0
  95. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcPageStory.tsx +0 -0
  96. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/i18n.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { assert, type Equals, is } from "tsafe/assert";
2
2
  import type { BuildContext } from "../shared/buildContext";
3
- import type { UiModuleMeta } from "./uiModuleMeta";
3
+ import type { ExtensionModuleMeta } from "./extensionModuleMeta";
4
4
  import { z } from "zod";
5
5
  import { id } from "tsafe/id";
6
6
  import * as fsPr from "fs/promises";
@@ -16,29 +16,29 @@ export type BuildContextLike = {
16
16
 
17
17
  assert<BuildContext extends BuildContextLike ? true : false>();
18
18
 
19
- export type UiModuleMetaLike = {
19
+ export type ExtensionModuleMetaLike = {
20
20
  moduleName: string;
21
21
  peerDependencies: Record<string, string>;
22
22
  };
23
23
 
24
- assert<UiModuleMeta extends UiModuleMetaLike ? true : false>();
24
+ assert<ExtensionModuleMeta extends ExtensionModuleMetaLike ? true : false>();
25
25
 
26
- export async function installUiModulesPeerDependencies(params: {
26
+ export async function installExtensionModulesPeerDependencies(params: {
27
27
  buildContext: BuildContextLike;
28
- uiModuleMetas: UiModuleMetaLike[];
28
+ extensionModuleMetas: ExtensionModuleMetaLike[];
29
29
  }): Promise<void | never> {
30
- const { buildContext, uiModuleMetas } = params;
30
+ const { buildContext, extensionModuleMetas } = params;
31
31
 
32
- const { uiModulesPerDependencies } = (() => {
33
- const uiModulesPerDependencies: Record<string, string> = {};
32
+ const { extensionModulesPerDependencies } = (() => {
33
+ const extensionModulesPerDependencies: Record<string, string> = {};
34
34
 
35
- for (const { peerDependencies } of uiModuleMetas) {
35
+ for (const { peerDependencies } of extensionModuleMetas) {
36
36
  for (const [peerDependencyName, versionRange_candidate] of Object.entries(
37
37
  peerDependencies
38
38
  )) {
39
39
  const versionRange = (() => {
40
40
  const versionRange_current =
41
- uiModulesPerDependencies[peerDependencyName];
41
+ extensionModulesPerDependencies[peerDependencyName];
42
42
 
43
43
  if (versionRange_current === undefined) {
44
44
  return versionRange_candidate;
@@ -76,11 +76,11 @@ export async function installUiModulesPeerDependencies(params: {
76
76
  return versionRange;
77
77
  })();
78
78
 
79
- uiModulesPerDependencies[peerDependencyName] = versionRange;
79
+ extensionModulesPerDependencies[peerDependencyName] = versionRange;
80
80
  }
81
81
  }
82
82
 
83
- return { uiModulesPerDependencies };
83
+ return { extensionModulesPerDependencies };
84
84
  })();
85
85
 
86
86
  const parsedPackageJson = await (async () => {
@@ -117,7 +117,9 @@ export async function installUiModulesPeerDependencies(params: {
117
117
 
118
118
  const parsedPackageJson_before = JSON.parse(JSON.stringify(parsedPackageJson));
119
119
 
120
- for (const [moduleName, versionRange] of Object.entries(uiModulesPerDependencies)) {
120
+ for (const [moduleName, versionRange] of Object.entries(
121
+ extensionModulesPerDependencies
122
+ )) {
121
123
  if (moduleName.startsWith("@types/")) {
122
124
  (parsedPackageJson.devDependencies ??= {})[moduleName] = versionRange;
123
125
  continue;
@@ -7,7 +7,7 @@ import {
7
7
  } from "path";
8
8
  import { assert } from "tsafe/assert";
9
9
  import type { BuildContext } from "../shared/buildContext";
10
- import type { UiModuleMeta } from "./uiModuleMeta";
10
+ import type { ExtensionModuleMeta } from "./extensionModuleMeta";
11
11
  import { existsAsync } from "../tools/fs.existsAsync";
12
12
  import { getAbsoluteAndInOsFormatPath } from "../tools/getAbsoluteAndInOsFormatPath";
13
13
 
@@ -17,17 +17,17 @@ export type BuildContextLike = {
17
17
 
18
18
  assert<BuildContext extends BuildContextLike ? true : false>();
19
19
 
20
- const DELIMITER_START = `# === Ejected files start ===`;
21
- const DELIMITER_END = `# === Ejected files end =====`;
20
+ const DELIMITER_START = `# === Owned files start ===`;
21
+ const DELIMITER_END = `# === Owned files end =====`;
22
22
 
23
23
  export async function writeManagedGitignoreFile(params: {
24
24
  buildContext: BuildContextLike;
25
- uiModuleMetas: UiModuleMeta[];
26
- ejectedFilesRelativePaths: string[];
25
+ extensionModuleMetas: ExtensionModuleMeta[];
26
+ ownedFilesRelativePaths: string[];
27
27
  }): Promise<void> {
28
- const { buildContext, uiModuleMetas, ejectedFilesRelativePaths } = params;
28
+ const { buildContext, extensionModuleMetas, ownedFilesRelativePaths } = params;
29
29
 
30
- if (uiModuleMetas.length === 0) {
30
+ if (extensionModuleMetas.length === 0) {
31
31
  return;
32
32
  }
33
33
 
@@ -38,19 +38,19 @@ export async function writeManagedGitignoreFile(params: {
38
38
  `# This file is managed by Keycloakify, do not edit it manually.`,
39
39
  ``,
40
40
  DELIMITER_START,
41
- ...ejectedFilesRelativePaths
41
+ ...ownedFilesRelativePaths
42
42
  .map(fileRelativePath => fileRelativePath.split(pathSep).join("/"))
43
43
  .map(line => `# ${line}`),
44
44
  DELIMITER_END,
45
45
  ``,
46
- ...uiModuleMetas
47
- .map(uiModuleMeta => [
48
- `# === ${uiModuleMeta.moduleName} v${uiModuleMeta.version} ===`,
49
- ...uiModuleMeta.files
46
+ ...extensionModuleMetas
47
+ .map(extensionModuleMeta => [
48
+ `# === ${extensionModuleMeta.moduleName} v${extensionModuleMeta.version} ===`,
49
+ ...extensionModuleMeta.files
50
50
  .map(({ fileRelativePath }) => fileRelativePath)
51
51
  .filter(
52
52
  fileRelativePath =>
53
- !ejectedFilesRelativePaths.includes(fileRelativePath)
53
+ !ownedFilesRelativePaths.includes(fileRelativePath)
54
54
  )
55
55
  .map(
56
56
  fileRelativePath =>
@@ -92,14 +92,14 @@ export async function writeManagedGitignoreFile(params: {
92
92
  export async function readManagedGitignoreFile(params: {
93
93
  buildContext: BuildContextLike;
94
94
  }): Promise<{
95
- ejectedFilesRelativePaths: string[];
95
+ ownedFilesRelativePaths: string[];
96
96
  }> {
97
97
  const { buildContext } = params;
98
98
 
99
99
  const filePath = pathJoin(buildContext.themeSrcDirPath, ".gitignore");
100
100
 
101
101
  if (!(await existsAsync(filePath))) {
102
- return { ejectedFilesRelativePaths: [] };
102
+ return { ownedFilesRelativePaths: [] };
103
103
  }
104
104
 
105
105
  const contentStr = (await fsPr.readFile(filePath)).toString("utf8");
@@ -116,10 +116,10 @@ export async function readManagedGitignoreFile(params: {
116
116
  })();
117
117
 
118
118
  if (payload === undefined) {
119
- return { ejectedFilesRelativePaths: [] };
119
+ return { ownedFilesRelativePaths: [] };
120
120
  }
121
121
 
122
- const ejectedFilesRelativePaths = payload
122
+ const ownedFilesRelativePaths = payload
123
123
  .split("\n")
124
124
  .map(line => line.trim())
125
125
  .map(line => line.replace(/^# /, ""))
@@ -132,5 +132,5 @@ export async function readManagedGitignoreFile(params: {
132
132
  )
133
133
  .map(filePath => pathRelative(buildContext.themeSrcDirPath, filePath));
134
134
 
135
- return { ejectedFilesRelativePaths };
135
+ return { ownedFilesRelativePaths };
136
136
  }
@@ -1,6 +1,6 @@
1
1
  import type { BuildContext } from "../shared/buildContext";
2
- import { getUiModuleMetas, computeHash } from "./uiModuleMeta";
3
- import { installUiModulesPeerDependencies } from "./installUiModulesPeerDependencies";
2
+ import { getExtensionModuleMetas, computeHash } from "./extensionModuleMeta";
3
+ import { installExtensionModulesPeerDependencies } from "./installExtensionModulesPeerDependencies";
4
4
  import {
5
5
  readManagedGitignoreFile,
6
6
  writeManagedGitignoreFile
@@ -9,36 +9,36 @@ import { dirname as pathDirname } from "path";
9
9
  import { join as pathJoin } from "path";
10
10
  import { existsAsync } from "../tools/fs.existsAsync";
11
11
  import * as fsPr from "fs/promises";
12
- import { getIsTrackedByGit } from "../tools/isTrackedByGit";
12
+ import { getIsKnownByGit } from "../tools/isKnownByGit";
13
13
  import { untrackFromGit } from "../tools/untrackFromGit";
14
14
 
15
15
  export async function command(params: { buildContext: BuildContext }) {
16
16
  const { buildContext } = params;
17
17
 
18
- const uiModuleMetas = await getUiModuleMetas({ buildContext });
18
+ const extensionModuleMetas = await getExtensionModuleMetas({ buildContext });
19
19
 
20
- await installUiModulesPeerDependencies({
20
+ await installExtensionModulesPeerDependencies({
21
21
  buildContext,
22
- uiModuleMetas
22
+ extensionModuleMetas
23
23
  });
24
24
 
25
- const { ejectedFilesRelativePaths } = await readManagedGitignoreFile({
25
+ const { ownedFilesRelativePaths } = await readManagedGitignoreFile({
26
26
  buildContext
27
27
  });
28
28
 
29
29
  await writeManagedGitignoreFile({
30
30
  buildContext,
31
- ejectedFilesRelativePaths,
32
- uiModuleMetas
31
+ ownedFilesRelativePaths,
32
+ extensionModuleMetas
33
33
  });
34
34
 
35
35
  await Promise.all(
36
- uiModuleMetas
37
- .map(uiModuleMeta =>
36
+ extensionModuleMetas
37
+ .map(extensionModuleMeta =>
38
38
  Promise.all(
39
- uiModuleMeta.files.map(
39
+ extensionModuleMeta.files.map(
40
40
  async ({ fileRelativePath, copyableFilePath, hash }) => {
41
- if (ejectedFilesRelativePaths.includes(fileRelativePath)) {
41
+ if (ownedFilesRelativePaths.includes(fileRelativePath)) {
42
42
  return;
43
43
  }
44
44
 
@@ -65,19 +65,7 @@ export async function command(params: { buildContext: BuildContext }) {
65
65
  return;
66
66
  }
67
67
 
68
- git_untrack: {
69
- if (!doesFileExist) {
70
- break git_untrack;
71
- }
72
-
73
- const isTracked = await getIsTrackedByGit({
74
- filePath: destFilePath
75
- });
76
-
77
- if (!isTracked) {
78
- break git_untrack;
79
- }
80
-
68
+ if (await getIsKnownByGit({ filePath: destFilePath })) {
81
69
  await untrackFromGit({
82
70
  filePath: destFilePath
83
71
  });
@@ -2,40 +2,42 @@ import { join as pathJoin } from "path";
2
2
  import { existsAsync } from "./fs.existsAsync";
3
3
  import * as child_process from "child_process";
4
4
  import { assert } from "tsafe/assert";
5
+ import { getIsRootPath } from "../tools/isRootPath";
5
6
 
6
7
  export async function getInstalledModuleDirPath(params: {
7
8
  moduleName: string;
8
9
  packageJsonDirPath: string;
9
- projectDirPath: string;
10
10
  }) {
11
- const { moduleName, packageJsonDirPath, projectDirPath } = params;
11
+ const { moduleName, packageJsonDirPath } = params;
12
12
 
13
- common_case: {
14
- const dirPath = pathJoin(
15
- ...[packageJsonDirPath, "node_modules", ...moduleName.split("/")]
16
- );
13
+ {
14
+ let dirPath = packageJsonDirPath;
17
15
 
18
- if (!(await existsAsync(dirPath))) {
19
- break common_case;
20
- }
16
+ while (true) {
17
+ const dirPath_candidate = pathJoin(
18
+ dirPath,
19
+ "node_modules",
20
+ ...moduleName.split("/")
21
+ );
21
22
 
22
- return dirPath;
23
- }
23
+ let doesExist: boolean;
24
24
 
25
- node_modules_at_root_case: {
26
- if (projectDirPath === packageJsonDirPath) {
27
- break node_modules_at_root_case;
28
- }
25
+ try {
26
+ doesExist = await existsAsync(dirPath_candidate);
27
+ } catch {
28
+ doesExist = false;
29
+ }
29
30
 
30
- const dirPath = pathJoin(
31
- ...[projectDirPath, "node_modules", ...moduleName.split("/")]
32
- );
31
+ if (doesExist) {
32
+ return dirPath_candidate;
33
+ }
33
34
 
34
- if (!(await existsAsync(dirPath))) {
35
- break node_modules_at_root_case;
36
- }
35
+ if (getIsRootPath(dirPath)) {
36
+ break;
37
+ }
37
38
 
38
- return dirPath;
39
+ dirPath = pathJoin(dirPath, "..");
40
+ }
39
41
  }
40
42
 
41
43
  const dirPath = child_process
@@ -0,0 +1,45 @@
1
+ import * as child_process from "child_process";
2
+ import {
3
+ dirname as pathDirname,
4
+ basename as pathBasename,
5
+ join as pathJoin,
6
+ sep as pathSep
7
+ } from "path";
8
+ import { Deferred } from "evt/tools/Deferred";
9
+ import * as fs from "fs";
10
+
11
+ export function getIsKnownByGit(params: { filePath: string }): Promise<boolean> {
12
+ const { filePath } = params;
13
+
14
+ const dIsKnownByGit = new Deferred<boolean>();
15
+
16
+ let relativePath = pathBasename(filePath);
17
+
18
+ let dirPath = pathDirname(filePath);
19
+
20
+ while (!fs.existsSync(dirPath)) {
21
+ relativePath = pathJoin(pathBasename(dirPath), relativePath);
22
+
23
+ dirPath = pathDirname(dirPath);
24
+ }
25
+
26
+ child_process.exec(
27
+ `git ls-files --error-unmatch '${relativePath.split(pathSep).join("/")}'`,
28
+ { cwd: dirPath },
29
+ error => {
30
+ if (error === null) {
31
+ dIsKnownByGit.resolve(true);
32
+ return;
33
+ }
34
+
35
+ if (error.code === 1) {
36
+ dIsKnownByGit.resolve(false);
37
+ return;
38
+ }
39
+
40
+ dIsKnownByGit.reject(error);
41
+ }
42
+ );
43
+
44
+ return dIsKnownByGit.pr;
45
+ }
@@ -0,0 +1,22 @@
1
+ import { normalize as pathNormalize } from "path";
2
+
3
+ export function getIsRootPath(filePath: string): boolean {
4
+ const path_normalized = pathNormalize(filePath);
5
+
6
+ // Unix-like root ("/")
7
+ if (path_normalized === "/") {
8
+ return true;
9
+ }
10
+
11
+ // Check for Windows drive root (e.g., "C:\\")
12
+ if (/^[a-zA-Z]:\\$/.test(path_normalized)) {
13
+ return true;
14
+ }
15
+
16
+ // Check for UNC root (e.g., "\\server\share")
17
+ if (/^\\\\[^\\]+\\[^\\]+\\?$/.test(path_normalized)) {
18
+ return true;
19
+ }
20
+
21
+ return false;
22
+ }
@@ -8,7 +8,6 @@ import { exclude } from "tsafe/exclude";
8
8
 
9
9
  export async function listInstalledModules(params: {
10
10
  packageJsonFilePath: string;
11
- projectDirPath: string;
12
11
  filter: (params: { moduleName: string }) => boolean;
13
12
  }): Promise<
14
13
  {
@@ -18,13 +17,13 @@ export async function listInstalledModules(params: {
18
17
  peerDependencies: Record<string, string>;
19
18
  }[]
20
19
  > {
21
- const { packageJsonFilePath, projectDirPath, filter } = params;
20
+ const { packageJsonFilePath, filter } = params;
22
21
 
23
22
  const parsedPackageJson = await readPackageJsonDependencies({
24
23
  packageJsonFilePath
25
24
  });
26
25
 
27
- const uiModuleNames = (
26
+ const extensionModuleNames = (
28
27
  [parsedPackageJson.dependencies, parsedPackageJson.devDependencies] as const
29
28
  )
30
29
  .filter(exclude(undefined))
@@ -33,11 +32,10 @@ export async function listInstalledModules(params: {
33
32
  .filter(moduleName => filter({ moduleName }));
34
33
 
35
34
  const result = await Promise.all(
36
- uiModuleNames.map(async moduleName => {
35
+ extensionModuleNames.map(async moduleName => {
37
36
  const dirPath = await getInstalledModuleDirPath({
38
37
  moduleName,
39
- packageJsonDirPath: pathDirname(packageJsonFilePath),
40
- projectDirPath
38
+ packageJsonDirPath: pathDirname(packageJsonFilePath)
41
39
  });
42
40
 
43
41
  const { version, peerDependencies } =
@@ -108,7 +108,7 @@ async function runPackageManagerInstall(params: {
108
108
  child.stdout.on("data", data => process.stdout.write(data));
109
109
 
110
110
  child.stderr.on("data", data => {
111
- if (data.toString("utf8").includes("has unmet peer dependency")) {
111
+ if (data.toString("utf8").includes("peer dependency")) {
112
112
  return;
113
113
  }
114
114
 
@@ -1,15 +1,31 @@
1
1
  import * as child_process from "child_process";
2
- import { dirname as pathDirname, basename as pathBasename } from "path";
2
+ import {
3
+ dirname as pathDirname,
4
+ basename as pathBasename,
5
+ join as pathJoin,
6
+ sep as pathSep
7
+ } from "path";
3
8
  import { Deferred } from "evt/tools/Deferred";
9
+ import { existsAsync } from "./fs.existsAsync";
4
10
 
5
11
  export async function untrackFromGit(params: { filePath: string }): Promise<void> {
6
12
  const { filePath } = params;
7
13
 
8
14
  const dDone = new Deferred<void>();
9
15
 
16
+ let relativePath = pathBasename(filePath);
17
+
18
+ let dirPath = pathDirname(filePath);
19
+
20
+ while (!(await existsAsync(dirPath))) {
21
+ relativePath = pathJoin(pathBasename(dirPath), relativePath);
22
+
23
+ dirPath = pathDirname(dirPath);
24
+ }
25
+
10
26
  child_process.exec(
11
- `git rm --cached ${pathBasename(filePath)}`,
12
- { cwd: pathDirname(filePath) },
27
+ `git rm --cached '${relativePath.split(pathSep).join("/")}'`,
28
+ { cwd: dirPath },
13
29
  error => {
14
30
  if (error !== null) {
15
31
  dDone.reject(error);
@@ -10,5 +10,5 @@
10
10
  "rootDir": "."
11
11
  },
12
12
  "include": ["**/*.ts", "**/*.tsx"],
13
- "exclude": ["initialize-account-theme/src"]
13
+ "exclude": ["initialize-account-theme/multi-page-boilerplate"]
14
14
  }