@imolko/ultra-ddd 1.0.13-beta → 1.0.14-beta
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-browser/index.d.ts +1 -0
- package/dist-browser/index.d.ts.map +1 -1
- package/dist-browser/index.js +1 -0
- package/dist-browser/index.js.map +1 -1
- package/dist-browser/scripts/get-event/generate-track-events.d.ts +8 -0
- package/dist-browser/scripts/get-event/generate-track-events.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/generate-track-events.js +55 -0
- package/dist-browser/scripts/get-event/generate-track-events.js.map +1 -0
- package/dist-browser/scripts/get-event/generate.d.ts +5 -0
- package/dist-browser/scripts/get-event/generate.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/generate.js +13 -0
- package/dist-browser/scripts/get-event/generate.js.map +1 -0
- package/dist-browser/scripts/get-event/helpers/add-import.d.ts +10 -0
- package/dist-browser/scripts/get-event/helpers/add-import.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/helpers/add-import.js +35 -0
- package/dist-browser/scripts/get-event/helpers/add-import.js.map +1 -0
- package/dist-browser/scripts/get-event/helpers/copy-file.d.ts +1 -0
- package/dist-browser/scripts/get-event/helpers/copy-file.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/helpers/copy-file.js +2 -0
- package/dist-browser/scripts/get-event/helpers/copy-file.js.map +1 -0
- package/dist-browser/scripts/get-event/helpers/exists-file.d.ts +9 -0
- package/dist-browser/scripts/get-event/helpers/exists-file.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/helpers/exists-file.js +10 -0
- package/dist-browser/scripts/get-event/helpers/exists-file.js.map +1 -0
- package/dist-browser/scripts/get-event/helpers/get-directories.d.ts +9 -0
- package/dist-browser/scripts/get-event/helpers/get-directories.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/helpers/get-directories.js +12 -0
- package/dist-browser/scripts/get-event/helpers/get-directories.js.map +1 -0
- package/dist-browser/scripts/get-event/helpers/get-event-domain.d.ts +13 -0
- package/dist-browser/scripts/get-event/helpers/get-event-domain.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/helpers/get-event-domain.js +32 -0
- package/dist-browser/scripts/get-event/helpers/get-event-domain.js.map +1 -0
- package/dist-browser/scripts/get-event/helpers/get-file.d.ts +2 -0
- package/dist-browser/scripts/get-event/helpers/get-file.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/helpers/get-file.js +21 -0
- package/dist-browser/scripts/get-event/helpers/get-file.js.map +1 -0
- package/dist-browser/scripts/get-event/helpers/get-names.d.ts +19 -0
- package/dist-browser/scripts/get-event/helpers/get-names.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/helpers/get-names.js +60 -0
- package/dist-browser/scripts/get-event/helpers/get-names.js.map +1 -0
- package/dist-browser/scripts/get-event/helpers/index.d.ts +8 -0
- package/dist-browser/scripts/get-event/helpers/index.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/helpers/index.js +8 -0
- package/dist-browser/scripts/get-event/helpers/index.js.map +1 -0
- package/dist-browser/scripts/get-event/helpers/update-gitignore.d.ts +2 -0
- package/dist-browser/scripts/get-event/helpers/update-gitignore.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/helpers/update-gitignore.js +38 -0
- package/dist-browser/scripts/get-event/helpers/update-gitignore.js.map +1 -0
- package/dist-browser/scripts/get-event/index.d.ts +4 -0
- package/dist-browser/scripts/get-event/index.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/index.js +4 -0
- package/dist-browser/scripts/get-event/index.js.map +1 -0
- package/dist-browser/scripts/index.d.ts +2 -0
- package/dist-browser/scripts/index.d.ts.map +1 -0
- package/dist-browser/scripts/index.js +2 -0
- package/dist-browser/scripts/index.js.map +1 -0
- package/dist-node/index.d.ts +1 -0
- package/dist-node/index.d.ts.map +1 -1
- package/dist-node/index.js +1 -0
- package/dist-node/index.js.map +1 -1
- package/dist-node/scripts/get-event/generate-track-events.d.ts +8 -0
- package/dist-node/scripts/get-event/generate-track-events.d.ts.map +1 -0
- package/dist-node/scripts/get-event/generate-track-events.js +82 -0
- package/dist-node/scripts/get-event/generate-track-events.js.map +1 -0
- package/dist-node/scripts/get-event/generate.d.ts +5 -0
- package/dist-node/scripts/get-event/generate.d.ts.map +1 -0
- package/dist-node/scripts/get-event/generate.js +17 -0
- package/dist-node/scripts/get-event/generate.js.map +1 -0
- package/dist-node/scripts/get-event/helpers/add-import.d.ts +10 -0
- package/dist-node/scripts/get-event/helpers/add-import.d.ts.map +1 -0
- package/dist-node/scripts/get-event/helpers/add-import.js +39 -0
- package/dist-node/scripts/get-event/helpers/add-import.js.map +1 -0
- package/dist-node/scripts/get-event/helpers/copy-file.d.ts +1 -0
- package/dist-node/scripts/get-event/helpers/copy-file.d.ts.map +1 -0
- package/dist-node/scripts/get-event/helpers/copy-file.js +2 -0
- package/dist-node/scripts/get-event/helpers/copy-file.js.map +1 -0
- package/dist-node/scripts/get-event/helpers/exists-file.d.ts +9 -0
- package/dist-node/scripts/get-event/helpers/exists-file.d.ts.map +1 -0
- package/dist-node/scripts/get-event/helpers/exists-file.js +14 -0
- package/dist-node/scripts/get-event/helpers/exists-file.js.map +1 -0
- package/dist-node/scripts/get-event/helpers/get-directories.d.ts +9 -0
- package/dist-node/scripts/get-event/helpers/get-directories.d.ts.map +1 -0
- package/dist-node/scripts/get-event/helpers/get-directories.js +16 -0
- package/dist-node/scripts/get-event/helpers/get-directories.js.map +1 -0
- package/dist-node/scripts/get-event/helpers/get-event-domain.d.ts +13 -0
- package/dist-node/scripts/get-event/helpers/get-event-domain.d.ts.map +1 -0
- package/dist-node/scripts/get-event/helpers/get-event-domain.js +36 -0
- package/dist-node/scripts/get-event/helpers/get-event-domain.js.map +1 -0
- package/dist-node/scripts/get-event/helpers/get-file.d.ts +2 -0
- package/dist-node/scripts/get-event/helpers/get-file.d.ts.map +1 -0
- package/dist-node/scripts/get-event/helpers/get-file.js +25 -0
- package/dist-node/scripts/get-event/helpers/get-file.js.map +1 -0
- package/dist-node/scripts/get-event/helpers/get-names.d.ts +19 -0
- package/dist-node/scripts/get-event/helpers/get-names.d.ts.map +1 -0
- package/dist-node/scripts/get-event/helpers/get-names.js +64 -0
- package/dist-node/scripts/get-event/helpers/get-names.js.map +1 -0
- package/dist-node/scripts/get-event/helpers/index.d.ts +8 -0
- package/dist-node/scripts/get-event/helpers/index.d.ts.map +1 -0
- package/dist-node/scripts/get-event/helpers/index.js +24 -0
- package/dist-node/scripts/get-event/helpers/index.js.map +1 -0
- package/dist-node/scripts/get-event/helpers/update-gitignore.d.ts +2 -0
- package/dist-node/scripts/get-event/helpers/update-gitignore.d.ts.map +1 -0
- package/dist-node/scripts/get-event/helpers/update-gitignore.js +65 -0
- package/dist-node/scripts/get-event/helpers/update-gitignore.js.map +1 -0
- package/dist-node/scripts/get-event/index.d.ts +4 -0
- package/dist-node/scripts/get-event/index.d.ts.map +1 -0
- package/dist-node/scripts/get-event/index.js +20 -0
- package/dist-node/scripts/get-event/index.js.map +1 -0
- package/dist-node/scripts/index.d.ts +2 -0
- package/dist-node/scripts/index.d.ts.map +1 -0
- package/dist-node/scripts/index.js +18 -0
- package/dist-node/scripts/index.js.map +1 -0
- package/package.json +4 -1
package/dist-browser/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
|
package/dist-browser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Traquear eventos
|
|
3
|
+
* @param {string} outputPath Carpeta de salida
|
|
4
|
+
* @param {string} contextName Nombre del contexto
|
|
5
|
+
* @param {string} eventFolder Carpeta en donde se alojan los eventos
|
|
6
|
+
*/
|
|
7
|
+
export declare function trackEvents(outputPath: string, contextName: string, eventFolder?: string): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=generate-track-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-track-events.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"AAkCA;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,GAAE,MAAqB,iBAsCnC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { addImports, getEventDomain, getFile, getNames } from "./helpers";
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
const TEMPLATE = `
|
|
5
|
+
try {
|
|
6
|
+
<Artifac>.NAME
|
|
7
|
+
} catch (err) {
|
|
8
|
+
console.error("Artifac <Artifac> not found")
|
|
9
|
+
}
|
|
10
|
+
// flag`;
|
|
11
|
+
const DEFAULT_PATH = "./src/events";
|
|
12
|
+
const DEFAULT_FOLDER = "events";
|
|
13
|
+
const TEMPLATE_PATH = 'src/scripts/get-event/templates/track.template.txt';
|
|
14
|
+
/**
|
|
15
|
+
* Agrega un elemento
|
|
16
|
+
* @param {string} texto
|
|
17
|
+
* @param {string} artifacName
|
|
18
|
+
* @param {string} folder
|
|
19
|
+
* @returns {string}
|
|
20
|
+
*/
|
|
21
|
+
function addArtifacts(texto, artifacName, folder) {
|
|
22
|
+
const ruta = `'${artifacName}': '/${folder}/${artifacName}',`;
|
|
23
|
+
return texto.replace("// event-path-flag", `${ruta}\n // event-path-flag`);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Traquear eventos
|
|
27
|
+
* @param {string} outputPath Carpeta de salida
|
|
28
|
+
* @param {string} contextName Nombre del contexto
|
|
29
|
+
* @param {string} eventFolder Carpeta en donde se alojan los eventos
|
|
30
|
+
*/
|
|
31
|
+
export async function trackEvents(outputPath, contextName, eventFolder = DEFAULT_PATH) {
|
|
32
|
+
const artifacts = getEventDomain(eventFolder);
|
|
33
|
+
let templateContent = await getFile(TEMPLATE_PATH);
|
|
34
|
+
templateContent = templateContent.replace("<%= context-name %>", contextName.trim());
|
|
35
|
+
for (const artifac of artifacts) {
|
|
36
|
+
const artifacNames = getNames(artifac.name);
|
|
37
|
+
templateContent = addImports(templateContent, [`${artifacNames.className}`], `./${DEFAULT_FOLDER}/${artifac.name}`);
|
|
38
|
+
let artifactTemplate = TEMPLATE.replace(/<Artifac>/g, `${artifacNames.className}`);
|
|
39
|
+
templateContent = addArtifacts(templateContent, artifac.name, DEFAULT_FOLDER);
|
|
40
|
+
templateContent = templateContent.replace("// flag", artifactTemplate);
|
|
41
|
+
}
|
|
42
|
+
// console.log("\ntemplateContent", templateContent);
|
|
43
|
+
// Obtener la ruta del directorio src
|
|
44
|
+
const srcFolderPath = path.resolve(__dirname, '..', '..'); // Subir un nivel desde event-schemes
|
|
45
|
+
// Crear la carpeta schemas dentro de src si no existe
|
|
46
|
+
const schemasFolderPath = path.join(srcFolderPath, outputPath);
|
|
47
|
+
if (!fs.existsSync(schemasFolderPath)) {
|
|
48
|
+
fs.mkdirSync(schemasFolderPath);
|
|
49
|
+
console.log(`\nCarpeta 'schemes' creada en: ${schemasFolderPath}`);
|
|
50
|
+
}
|
|
51
|
+
const filePath = path.join(schemasFolderPath, 'track-events-script.ts');
|
|
52
|
+
fs.writeFileSync(filePath, templateContent, "utf8");
|
|
53
|
+
console.log(`Track file created in: ${filePath}`);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=generate-track-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-track-events.js","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAA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C,CAAC;IACzE,CAAC;IACD,qDAAqD;IAErD,qCAAqC;IACrC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,qCAAqC;IAEhG,sDAAsD;IACtD,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAC/D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACtC,EAAE,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,kCAAkC,iBAAiB,EAAE,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,wBAAwB,CAAC,CAAC;IACxE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,IAAI,kBAOzB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { trackEvents } from './generate-track-events';
|
|
2
|
+
/**
|
|
3
|
+
* Metodo para listar y crear un json con
|
|
4
|
+
*/
|
|
5
|
+
export async function main() {
|
|
6
|
+
let [, , outputPath, contextName, eventFolder] = process.argv;
|
|
7
|
+
outputPath = outputPath ? outputPath : "./src";
|
|
8
|
+
contextName = contextName ? contextName : "default";
|
|
9
|
+
eventFolder = eventFolder ? eventFolder : "./src/events";
|
|
10
|
+
await trackEvents(outputPath, contextName, eventFolder);
|
|
11
|
+
}
|
|
12
|
+
main();
|
|
13
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/scripts/get-event/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,IAAI,CAAC,EAAE,AAAD,EAAG,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAE9D,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/C,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;IACpD,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC;IACzD,MAAM,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AAC1D,CAAC;AACD,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds imports to a string of code if they don't already exist.
|
|
3
|
+
*
|
|
4
|
+
* @param content The code string to modify.
|
|
5
|
+
* @param elems The elements to import.
|
|
6
|
+
* @param source The source of the imports.
|
|
7
|
+
* @returns {string} The modified code string.
|
|
8
|
+
*/
|
|
9
|
+
export declare function addImports(content: string, elems: string[], source: string): string;
|
|
10
|
+
//# sourceMappingURL=add-import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-import.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/add-import.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAiCnF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const DOT_REPLACE_REGEX = /\./g;
|
|
2
|
+
const SLASH_REPLACE_REGEX = /\//g;
|
|
3
|
+
const EXISTING_IMPORT_REGEX_TEMPLATE = (elem, sourceSatanized) => `(import[\\s\\n]+\\{)([\\s\\n]*[a-zA-Z0-9,\\s\\n]*)(${elem})([a-zA-Z0-9,\\s\\n]*[\\s\\n]+)(\\}[\\s\\n]+from[\\s\\n]+['"]{1}${sourceSatanized}['"]{1})`;
|
|
4
|
+
const IMPORT_INSERTION_REGEX_TEMPLATE = (sourceSatanized) => `(import[\\s\\n]+\\{)([\\s\\n]+[a-zA-Z0-9,\\s\\n]+[\\s\\n]+)(\\}[\\s\\n]+from[\\s\\n]+['"]{1}${sourceSatanized}['"]{1})`;
|
|
5
|
+
/**
|
|
6
|
+
* Adds imports to a string of code if they don't already exist.
|
|
7
|
+
*
|
|
8
|
+
* @param content The code string to modify.
|
|
9
|
+
* @param elems The elements to import.
|
|
10
|
+
* @param source The source of the imports.
|
|
11
|
+
* @returns {string} The modified code string.
|
|
12
|
+
*/
|
|
13
|
+
export function addImports(content, elems, source) {
|
|
14
|
+
const sourceSatanized = source
|
|
15
|
+
.replace(DOT_REPLACE_REGEX, "\\.")
|
|
16
|
+
.replace(SLASH_REPLACE_REGEX, "\\/");
|
|
17
|
+
let newContent = content;
|
|
18
|
+
for (const elem of elems) {
|
|
19
|
+
const existingImportRegExp = new RegExp(EXISTING_IMPORT_REGEX_TEMPLATE(elem, sourceSatanized));
|
|
20
|
+
if (existingImportRegExp.test(newContent)) {
|
|
21
|
+
// Import already exists
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const importInsertionRegExp = new RegExp(IMPORT_INSERTION_REGEX_TEMPLATE(sourceSatanized));
|
|
25
|
+
const match = newContent.match(importInsertionRegExp);
|
|
26
|
+
if (match) {
|
|
27
|
+
newContent = newContent.replace(match[0], `${match[1]} ${elem}, ${match[2]}${match[3]}`);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
newContent = `import { ${elem} } from '${source}';\n${newContent}`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return newContent;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=add-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-import.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/add-import.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAChC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAClC,MAAM,8BAA8B,GAAG,CAAC,IAAY,EAAE,eAAuB,EAAE,EAAE,CAC/E,sDAAsD,IAAI,mEAAmE,eAAe,UAAU,CAAC;AACzJ,MAAM,+BAA+B,GAAG,CAAC,eAAuB,EAAE,EAAE,CAClE,+FAA+F,eAAe,UAAU,CAAC;AAE3H;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe,EAAE,KAAe,EAAE,MAAc;IACzE,MAAM,eAAe,GAAG,MAAM;SAC3B,OAAO,CAAC,iBAAiB,EAAE,KAAK,CAAC;SACjC,OAAO,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAEvC,IAAI,UAAU,GAAG,OAAO,CAAC;IAEzB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,oBAAoB,GAAG,IAAI,MAAM,CACrC,8BAA8B,CAAC,IAAI,EAAE,eAAe,CAAC,CACtD,CAAC;QAEF,IAAI,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC1C,wBAAwB;YACxB,SAAS;QACX,CAAC;QAED,MAAM,qBAAqB,GAAG,IAAI,MAAM,CACtC,+BAA+B,CAAC,eAAe,CAAC,CACjD,CAAC;QACF,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAEtD,IAAI,KAAK,EAAE,CAAC;YACV,UAAU,GAAG,UAAU,CAAC,OAAO,CAC7B,KAAK,CAAC,CAAC,CAAC,EACR,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAC9C,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,UAAU,GAAG,YAAY,IAAI,YAAY,MAAM,OAAO,UAAU,EAAE,CAAC;QACrE,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=copy-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-file.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/copy-file.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-file.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/copy-file.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { PathLike } from 'fs';
|
|
3
|
+
/**
|
|
4
|
+
* Verifica si existe un archivo
|
|
5
|
+
* @param {PathLike} source
|
|
6
|
+
* @returns {boolean}
|
|
7
|
+
*/
|
|
8
|
+
export declare function existsFile(source: PathLike): boolean;
|
|
9
|
+
//# sourceMappingURL=exists-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists-file.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/exists-file.ts"],"names":[],"mappings":";AAAA,OAAO,EAAc,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAEpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists-file.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/exists-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,IAAI,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAgB;IACzC,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { PathLike } from 'fs';
|
|
3
|
+
/**
|
|
4
|
+
* Obtiene directorios
|
|
5
|
+
* @param {PathLike} source
|
|
6
|
+
* @returns {string[]}
|
|
7
|
+
*/
|
|
8
|
+
export declare function getDirectories(source: PathLike): string[];
|
|
9
|
+
//# sourceMappingURL=get-directories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-directories.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/get-directories.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAe,MAAM,IAAI,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,CAIzD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { readdirSync } from 'fs';
|
|
2
|
+
/**
|
|
3
|
+
* Obtiene directorios
|
|
4
|
+
* @param {PathLike} source
|
|
5
|
+
* @returns {string[]}
|
|
6
|
+
*/
|
|
7
|
+
export function getDirectories(source) {
|
|
8
|
+
return readdirSync(source, { withFileTypes: true })
|
|
9
|
+
.filter((dirent) => dirent.isDirectory())
|
|
10
|
+
.map((dirent) => dirent.name);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=get-directories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-directories.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/get-directories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,IAAI,CAAC;AAE3C;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,MAAgB;IAC7C,OAAO,WAAW,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;SAChD,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;SACxC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface AvailableEvent {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
category: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Obtiene eventos del dominio
|
|
8
|
+
* @param {string} source
|
|
9
|
+
* @returns {AvailableEvent[]}
|
|
10
|
+
*/
|
|
11
|
+
export declare function getEventDomain(source: string): AvailableEvent[];
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=get-event-domain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-event-domain.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/get-event-domain.ts"],"names":[],"mappings":"AAKA,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,EAAE,CA4B/D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { existsFile } from './exists-file';
|
|
2
|
+
import { getDirectories } from './get-directories';
|
|
3
|
+
import { getNames } from './get-names';
|
|
4
|
+
/** Directorios excluidos */
|
|
5
|
+
const excludeDirectories = [];
|
|
6
|
+
/**
|
|
7
|
+
* Obtiene eventos del dominio
|
|
8
|
+
* @param {string} source
|
|
9
|
+
* @returns {AvailableEvent[]}
|
|
10
|
+
*/
|
|
11
|
+
export function getEventDomain(source) {
|
|
12
|
+
let directories = getDirectories(`${source}`);
|
|
13
|
+
const availableArtifacts = [];
|
|
14
|
+
if (directories?.length > 0) {
|
|
15
|
+
directories = directories.filter((directory) => !excludeDirectories.includes(directory));
|
|
16
|
+
for (const dir of directories) {
|
|
17
|
+
const isEvent = existsFile(`${source}/${dir}/event.ts`);
|
|
18
|
+
const propertyNames = getNames(dir);
|
|
19
|
+
if (!isEvent) {
|
|
20
|
+
// No es un evento
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
availableArtifacts.push({
|
|
24
|
+
name: dir,
|
|
25
|
+
type: propertyNames.className,
|
|
26
|
+
category: "event",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return availableArtifacts;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=get-event-domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-event-domain.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/get-event-domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AASvC,4BAA4B;AAC5B,MAAM,kBAAkB,GAAa,EAAE,CAAC;AAExC;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,IAAI,WAAW,GAAG,cAAc,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC;IAE9C,MAAM,kBAAkB,GAAqB,EAAE,CAAC;IAEhD,IAAI,WAAW,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,WAAW,GAAG,WAAW,CAAC,MAAM,CAC9B,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC,CACvD,CAAC;QAEF,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC;YACxD,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;YAEpC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,kBAAkB;gBAClB,SAAS;YACX,CAAC;YAED,kBAAkB,CAAC,IAAI,CAAC;gBACtB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,aAAa,CAAC,SAAS;gBAC7B,QAAQ,EAAE,OAAO;aAClB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/get-file.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBrD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { access, constants, readFile } from 'fs';
|
|
2
|
+
export function getFile(path) {
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
access(path, constants.F_OK, (err) => {
|
|
5
|
+
if (err) {
|
|
6
|
+
console.warn(`[warn] Error accessing file ${path}`);
|
|
7
|
+
console.warn(`[warn] ${err}`);
|
|
8
|
+
return resolve("");
|
|
9
|
+
}
|
|
10
|
+
readFile(path, "utf8", (err, data) => {
|
|
11
|
+
if (err) {
|
|
12
|
+
console.warn(`[warn] Error reading file ${path}`);
|
|
13
|
+
console.warn(`[warn] ${err}`);
|
|
14
|
+
return resolve("");
|
|
15
|
+
}
|
|
16
|
+
resolve(data);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=get-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/get-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAEjD,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;YACnC,IAAI,GAAG,EAAE,CAAC;gBACR,OAAO,CAAC,IAAI,CAAC,+BAA+B,IAAI,EAAE,CAAC,CAAC;gBACpD,OAAO,CAAC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC;gBAC9B,OAAO,OAAO,CAAC,EAAE,CAAC,CAAC;YACrB,CAAC;YACD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;gBACnC,IAAI,GAAG,EAAE,CAAC;oBACR,OAAO,CAAC,IAAI,CAAC,6BAA6B,IAAI,EAAE,CAAC,CAAC;oBAClD,OAAO,CAAC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC;oBAC9B,OAAO,OAAO,CAAC,EAAE,CAAC,CAAC;gBACrB,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Util function to generate different strings based off the provided name.
|
|
3
|
+
*
|
|
4
|
+
* Examples:
|
|
5
|
+
*
|
|
6
|
+
* ```typescript
|
|
7
|
+
* names("my-name") // {name: 'my-name', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'}
|
|
8
|
+
* names("myName") // {name: 'myName', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'}
|
|
9
|
+
* ```
|
|
10
|
+
* @param name
|
|
11
|
+
*/
|
|
12
|
+
export declare function getNames(name: string): {
|
|
13
|
+
name: string;
|
|
14
|
+
className: string;
|
|
15
|
+
propertyName: string;
|
|
16
|
+
constantName: string;
|
|
17
|
+
fileName: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=get-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-names.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/get-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAQA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Util function to generate different strings based off the provided name.
|
|
3
|
+
*
|
|
4
|
+
* Examples:
|
|
5
|
+
*
|
|
6
|
+
* ```typescript
|
|
7
|
+
* names("my-name") // {name: 'my-name', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'}
|
|
8
|
+
* names("myName") // {name: 'myName', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'}
|
|
9
|
+
* ```
|
|
10
|
+
* @param name
|
|
11
|
+
*/
|
|
12
|
+
export function getNames(name) {
|
|
13
|
+
return {
|
|
14
|
+
name,
|
|
15
|
+
className: toClassName(name),
|
|
16
|
+
propertyName: toPropertyName(name),
|
|
17
|
+
constantName: toConstantName(name),
|
|
18
|
+
fileName: toFileName(name),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Hyphenated to UpperCamelCase
|
|
23
|
+
*/
|
|
24
|
+
function toClassName(str) {
|
|
25
|
+
return toCapitalCase(toPropertyName(str));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Hyphenated to lowerCamelCase
|
|
29
|
+
*/
|
|
30
|
+
function toPropertyName(s) {
|
|
31
|
+
return s
|
|
32
|
+
.replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) => chr ? chr.toUpperCase() : '')
|
|
33
|
+
.replace(/[^a-zA-Z\d]/g, '')
|
|
34
|
+
.replace(/^([A-Z])/, (m) => m.toLowerCase());
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Hyphenated to CONSTANT_CASE
|
|
38
|
+
*/
|
|
39
|
+
function toConstantName(s) {
|
|
40
|
+
const normalizedS = s.toUpperCase() === s ? s.toLowerCase() : s;
|
|
41
|
+
return toFileName(toPropertyName(normalizedS))
|
|
42
|
+
.replace(/([^a-zA-Z0-9])/g, '_')
|
|
43
|
+
.toUpperCase();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Upper camelCase to lowercase, hyphenated
|
|
47
|
+
*/
|
|
48
|
+
function toFileName(s) {
|
|
49
|
+
return s
|
|
50
|
+
.replace(/([a-z\d])([A-Z])/g, '$1_$2')
|
|
51
|
+
.toLowerCase()
|
|
52
|
+
.replace(/(?!^[_])[ _]/g, '-');
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Capitalizes the first letter of a string
|
|
56
|
+
*/
|
|
57
|
+
function toCapitalCase(s) {
|
|
58
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=get-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-names.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/get-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IAOnC,OAAO;QACL,IAA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AAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './add-import';
|
|
2
|
+
export * from './exists-file';
|
|
3
|
+
export * from './get-directories';
|
|
4
|
+
export * from './get-event-domain';
|
|
5
|
+
export * from './get-file';
|
|
6
|
+
export * from './get-names';
|
|
7
|
+
export * from './update-gitignore';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './add-import';
|
|
2
|
+
export * from './exists-file';
|
|
3
|
+
export * from './get-directories';
|
|
4
|
+
export * from './get-event-domain';
|
|
5
|
+
export * from './get-file';
|
|
6
|
+
export * from './get-names';
|
|
7
|
+
export * from './update-gitignore';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-gitignore.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/update-gitignore.ts"],"names":[],"mappings":"AAUA,wBAAgB,eAAe,SAiC9B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
// Constant list of folders and files to add to .gitignore
|
|
4
|
+
const pathsToIgnore = [
|
|
5
|
+
"**/event-schemes",
|
|
6
|
+
"**/schemes",
|
|
7
|
+
"track-events-script.ts"
|
|
8
|
+
];
|
|
9
|
+
// Function to update .gitignore
|
|
10
|
+
export function updateGitignore() {
|
|
11
|
+
const gitignorePath = path.join(process.cwd(), ".gitignore");
|
|
12
|
+
console.log(`Updating .gitignore in ${process.cwd()}...`);
|
|
13
|
+
// Check if .gitignore exists
|
|
14
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
15
|
+
console.error(".gitignore not found in the current project directory.");
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
// Read existing .gitignore content
|
|
19
|
+
let gitignoreContent = fs.readFileSync(gitignorePath, "utf-8");
|
|
20
|
+
const gitignoreLines = new Set(gitignoreContent.split("\n").map((line) => line.trim()));
|
|
21
|
+
// Add paths that are not already present
|
|
22
|
+
let addedAny = false;
|
|
23
|
+
pathsToIgnore.forEach((path) => {
|
|
24
|
+
if (!gitignoreLines.has(path)) {
|
|
25
|
+
gitignoreContent += `\n${path}`;
|
|
26
|
+
addedAny = true;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
// Write back to .gitignore if changes were made
|
|
30
|
+
if (addedAny) {
|
|
31
|
+
fs.writeFileSync(gitignorePath, gitignoreContent, "utf-8");
|
|
32
|
+
console.log("Updated .gitignore with the missing paths.");
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
console.log("All paths are already present in .gitignore.");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=update-gitignore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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E,CAAC;QACb,EAAE,CAAC,aAAa,CAAC,aAAa,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;IAC5D,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/scripts/get-event/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scripts/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scripts/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
package/dist-node/index.d.ts
CHANGED
package/dist-node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
|
package/dist-node/index.js
CHANGED
|
@@ -21,6 +21,7 @@ __exportStar(require("./domain-directory"), exports);
|
|
|
21
21
|
__exportStar(require("./entity"), exports);
|
|
22
22
|
__exportStar(require("./event"), exports);
|
|
23
23
|
__exportStar(require("./helpers"), exports);
|
|
24
|
+
__exportStar(require("./scripts"), exports);
|
|
24
25
|
__exportStar(require("./service"), exports);
|
|
25
26
|
__exportStar(require("./use-case"), exports);
|
|
26
27
|
__exportStar(require("./value-object"), exports);
|
package/dist-node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,+CAA6B;AAC7B,sDAAoC;AACpC,qDAAmC;AACnC,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,4CAA0B;AAC1B,6CAA2B;AAC3B,iDAA+B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,+CAA6B;AAC7B,sDAAoC;AACpC,qDAAmC;AACnC,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,6CAA2B;AAC3B,iDAA+B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Traquear eventos
|
|
3
|
+
* @param {string} outputPath Carpeta de salida
|
|
4
|
+
* @param {string} contextName Nombre del contexto
|
|
5
|
+
* @param {string} eventFolder Carpeta en donde se alojan los eventos
|
|
6
|
+
*/
|
|
7
|
+
export declare function trackEvents(outputPath: string, contextName: string, eventFolder?: string): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=generate-track-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-track-events.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"AAkCA;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,GAAE,MAAqB,iBAsCnC"}
|