@mehdad67/create-apitogo 0.1.27 → 0.1.28
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/dist/index.js +1 -1
- package/dist/templates/index.ts +26 -0
- package/package.json +1 -1
package/dist/templates/index.ts
CHANGED
|
@@ -32,6 +32,27 @@ const resolveCoreApitogoPackageName = async (): Promise<string> => {
|
|
|
32
32
|
return createPackageJson.name.replace("/create-apitogo", "/apitogo");
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
+
const ensureRequiredApitogoModules = (
|
|
36
|
+
dependencies: Record<string, string>,
|
|
37
|
+
corePackageName: string,
|
|
38
|
+
version: string,
|
|
39
|
+
) => {
|
|
40
|
+
if (corePackageName.startsWith("@mehdad67/")) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const scope = corePackageName.slice(0, corePackageName.indexOf("/"));
|
|
45
|
+
const landing = `${scope}/apitogo-module-landing`;
|
|
46
|
+
const userPanel = `${scope}/apitogo-module-user-panel`;
|
|
47
|
+
|
|
48
|
+
if (!(landing in dependencies)) {
|
|
49
|
+
dependencies[landing] = version;
|
|
50
|
+
}
|
|
51
|
+
if (!(userPanel in dependencies)) {
|
|
52
|
+
dependencies[userPanel] = version;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
35
56
|
const ensureSecondaryApitogoAliases = (
|
|
36
57
|
dependencies: Record<string, string>,
|
|
37
58
|
corePackageName: string,
|
|
@@ -309,6 +330,11 @@ export const installTemplate = async ({
|
|
|
309
330
|
};
|
|
310
331
|
|
|
311
332
|
if (!resolvedZudokuDependency.startsWith("file:")) {
|
|
333
|
+
ensureRequiredApitogoModules(
|
|
334
|
+
packageJson.dependencies,
|
|
335
|
+
coreApitogoPackageName,
|
|
336
|
+
resolvedZudokuDependency,
|
|
337
|
+
);
|
|
312
338
|
ensureSecondaryApitogoAliases(
|
|
313
339
|
packageJson.dependencies,
|
|
314
340
|
coreApitogoPackageName,
|