@eventcatalog/create-eventcatalog 4.0.0 → 4.1.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.
- package/dist/index.js +7484 -231
- package/package.json +2 -2
- package/templates/analytics.ts +5 -5
- package/templates/index.ts +0 -17
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eventcatalog/create-eventcatalog",
|
|
3
3
|
"description": "Create EventCatalog with one command",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.1.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-catalog": "./dist/index.js"
|
|
7
7
|
},
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"cross-spawn": "6.0.5",
|
|
35
35
|
"fast-glob": "^3.3.2",
|
|
36
36
|
"got": "^14.0.0",
|
|
37
|
+
"ora": "^5.4.1",
|
|
37
38
|
"prompts": "2.1.0",
|
|
38
39
|
"rimraf": "^5.0.7",
|
|
39
40
|
"tar": "^4.4.19",
|
|
@@ -44,7 +45,6 @@
|
|
|
44
45
|
},
|
|
45
46
|
"dependencies": {
|
|
46
47
|
"@changesets/cli": "^2.27.6",
|
|
47
|
-
"axios": "^1.7.7",
|
|
48
48
|
"uuid": "^10.0.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
package/templates/analytics.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
1
|
import os from 'os';
|
|
3
2
|
import pkg from '../package.json';
|
|
4
3
|
|
|
@@ -11,9 +10,6 @@ interface EventMetadata {
|
|
|
11
10
|
async function raiseEvent(eventData: EventMetadata): Promise<void> {
|
|
12
11
|
const url = "https://queue.simpleanalyticscdn.com/events";
|
|
13
12
|
const userAgent = `@eventcatalog/create-eventcatalog/${pkg.version} (${os.platform()}; ${os.arch()}; Node/${process.version})`;
|
|
14
|
-
const headers = {
|
|
15
|
-
"Content-Type": "application/json",
|
|
16
|
-
};
|
|
17
13
|
|
|
18
14
|
const payload = {
|
|
19
15
|
type: "event",
|
|
@@ -28,7 +24,11 @@ async function raiseEvent(eventData: EventMetadata): Promise<void> {
|
|
|
28
24
|
};
|
|
29
25
|
|
|
30
26
|
try {
|
|
31
|
-
await
|
|
27
|
+
await fetch(url, {
|
|
28
|
+
method: "POST",
|
|
29
|
+
headers: { "Content-Type": "application/json" },
|
|
30
|
+
body: JSON.stringify(payload),
|
|
31
|
+
});
|
|
32
32
|
} catch (error) {
|
|
33
33
|
// swallow the error
|
|
34
34
|
}
|
package/templates/index.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { install } from "../helpers/install";
|
|
|
4
4
|
import os from "os";
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import path from "path";
|
|
7
|
-
import chalk from "chalk";
|
|
8
7
|
import { v4 } from 'uuid'
|
|
9
8
|
|
|
10
9
|
import { GetTemplateFileArgs, InstallTemplateArgs } from "./types";
|
|
@@ -34,8 +33,6 @@ export const installTemplate = async ({
|
|
|
34
33
|
eslint,
|
|
35
34
|
organizationName
|
|
36
35
|
}: InstallTemplateArgs) => {
|
|
37
|
-
console.log(chalk.bold(`Using ${packageManager}.`));
|
|
38
|
-
|
|
39
36
|
/**
|
|
40
37
|
* Create a package.json for the new project
|
|
41
38
|
*/
|
|
@@ -106,30 +103,16 @@ export const installTemplate = async ({
|
|
|
106
103
|
* Install package.json dependencies if they exist.
|
|
107
104
|
*/
|
|
108
105
|
if (dependencies.length) {
|
|
109
|
-
console.log();
|
|
110
|
-
console.log("Installing dependencies:");
|
|
111
|
-
for (const dependency of dependencies) {
|
|
112
|
-
console.log(`- ${chalk.cyan(dependency)}`);
|
|
113
|
-
}
|
|
114
|
-
console.log();
|
|
115
|
-
|
|
116
106
|
await install(root, dependencies, installFlags);
|
|
117
107
|
}
|
|
118
108
|
|
|
119
109
|
if (devDependencies.length) {
|
|
120
|
-
console.log();
|
|
121
|
-
console.log("Installing devDependencies:");
|
|
122
|
-
for (const devDependency of devDependencies) {
|
|
123
|
-
// console.log(`- ${chalk.cyan(devDependency)}`);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
110
|
const devInstallFlags = { devDependencies: true, ...installFlags };
|
|
127
111
|
await install(root, devDependencies, devInstallFlags);
|
|
128
112
|
}
|
|
129
113
|
/**
|
|
130
114
|
* Copy the template files to the target directory.
|
|
131
115
|
*/
|
|
132
|
-
console.log("\nInitializing project with template:", template, "\n");
|
|
133
116
|
const templatePath = path.join(__dirname, "../templates", template);
|
|
134
117
|
// console.log("templatePath", templatePath, __dirname, template);
|
|
135
118
|
await copy("**", root, {
|