@imolko/ultra-ddd 1.0.14 → 1.0.15-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.
Files changed (55) hide show
  1. package/dist-browser/scripts/get-event/constants.d.ts +8 -0
  2. package/dist-browser/scripts/get-event/constants.d.ts.map +1 -0
  3. package/dist-browser/scripts/get-event/constants.js +8 -0
  4. package/dist-browser/scripts/get-event/constants.js.map +1 -0
  5. package/dist-browser/scripts/get-event/copy-tsconfig.d.ts +5 -0
  6. package/dist-browser/scripts/get-event/copy-tsconfig.d.ts.map +1 -0
  7. package/dist-browser/scripts/get-event/copy-tsconfig.js +11 -0
  8. package/dist-browser/scripts/get-event/copy-tsconfig.js.map +1 -0
  9. package/dist-browser/scripts/get-event/generate-track-events.d.ts.map +1 -1
  10. package/dist-browser/scripts/get-event/generate-track-events.js +5 -16
  11. package/dist-browser/scripts/get-event/generate-track-events.js.map +1 -1
  12. package/dist-browser/scripts/get-event/generate.d.ts +1 -0
  13. package/dist-browser/scripts/get-event/generate.d.ts.map +1 -1
  14. package/dist-browser/scripts/get-event/generate.js +9 -3
  15. package/dist-browser/scripts/get-event/generate.js.map +1 -1
  16. package/dist-browser/scripts/get-event/helpers/create-root-file.d.ts +8 -0
  17. package/dist-browser/scripts/get-event/helpers/create-root-file.d.ts.map +1 -0
  18. package/dist-browser/scripts/get-event/helpers/create-root-file.js +22 -0
  19. package/dist-browser/scripts/get-event/helpers/create-root-file.js.map +1 -0
  20. package/dist-browser/scripts/get-event/helpers/index.d.ts +1 -0
  21. package/dist-browser/scripts/get-event/helpers/index.d.ts.map +1 -1
  22. package/dist-browser/scripts/get-event/helpers/index.js +1 -0
  23. package/dist-browser/scripts/get-event/helpers/index.js.map +1 -1
  24. package/dist-node/scripts/get-event/constants.d.ts +8 -0
  25. package/dist-node/scripts/get-event/constants.d.ts.map +1 -0
  26. package/dist-node/scripts/get-event/constants.js +11 -0
  27. package/dist-node/scripts/get-event/constants.js.map +1 -0
  28. package/dist-node/scripts/get-event/copy-tsconfig.d.ts +5 -0
  29. package/dist-node/scripts/get-event/copy-tsconfig.d.ts.map +1 -0
  30. package/dist-node/scripts/get-event/copy-tsconfig.js +38 -0
  31. package/dist-node/scripts/get-event/copy-tsconfig.js.map +1 -0
  32. package/dist-node/scripts/get-event/generate-track-events.d.ts.map +1 -1
  33. package/dist-node/scripts/get-event/generate-track-events.js +7 -18
  34. package/dist-node/scripts/get-event/generate-track-events.js.map +1 -1
  35. package/dist-node/scripts/get-event/generate.d.ts +1 -0
  36. package/dist-node/scripts/get-event/generate.d.ts.map +1 -1
  37. package/dist-node/scripts/get-event/generate.js +9 -3
  38. package/dist-node/scripts/get-event/generate.js.map +1 -1
  39. package/dist-node/scripts/get-event/helpers/create-root-file.d.ts +8 -0
  40. package/dist-node/scripts/get-event/helpers/create-root-file.d.ts.map +1 -0
  41. package/dist-node/scripts/get-event/helpers/create-root-file.js +49 -0
  42. package/dist-node/scripts/get-event/helpers/create-root-file.js.map +1 -0
  43. package/dist-node/scripts/get-event/helpers/index.d.ts +1 -0
  44. package/dist-node/scripts/get-event/helpers/index.d.ts.map +1 -1
  45. package/dist-node/scripts/get-event/helpers/index.js +1 -0
  46. package/dist-node/scripts/get-event/helpers/index.js.map +1 -1
  47. package/package.json +1 -1
  48. package/dist-browser/scripts/get-event/helpers/copy-file.d.ts +0 -1
  49. package/dist-browser/scripts/get-event/helpers/copy-file.d.ts.map +0 -1
  50. package/dist-browser/scripts/get-event/helpers/copy-file.js +0 -2
  51. package/dist-browser/scripts/get-event/helpers/copy-file.js.map +0 -1
  52. package/dist-node/scripts/get-event/helpers/copy-file.d.ts +0 -1
  53. package/dist-node/scripts/get-event/helpers/copy-file.d.ts.map +0 -1
  54. package/dist-node/scripts/get-event/helpers/copy-file.js +0 -2
  55. package/dist-node/scripts/get-event/helpers/copy-file.js.map +0 -1
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Ruta de la raiz
3
+ */
4
+ export declare const DEFAULT_CONTEXT = "default";
5
+ export declare const ROOT_PATH = "./src";
6
+ export declare const DEFAULT_FOLDER = "events";
7
+ export declare const DEFAULT_PATH = "./src/events\"";
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,YAAY,mBAAoC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Ruta de la raiz
3
+ */
4
+ export const DEFAULT_CONTEXT = "default";
5
+ export const ROOT_PATH = "./src";
6
+ export const DEFAULT_FOLDER = "events";
7
+ export const DEFAULT_PATH = `${ROOT_PATH}/${DEFAULT_FOLDER}"`;
8
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AACzC,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,SAAS,IAAI,cAAc,GAAG,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Copia el archivo tsconfig
3
+ */
4
+ export declare function copyTsConfig(): Promise<void>;
5
+ //# sourceMappingURL=copy-tsconfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-tsconfig.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAsB,YAAY,kBAQjC"}
@@ -0,0 +1,11 @@
1
+ import * as path from "path";
2
+ import { createRootFile, getFile } from "./helpers";
3
+ /**
4
+ * Copia el archivo tsconfig
5
+ */
6
+ export async function copyTsConfig() {
7
+ const TSCONFIG_PATH = path.join(__dirname, "templates", "tsconfig.event-track.json");
8
+ const content = await getFile(TSCONFIG_PATH);
9
+ createRootFile("./", content, "tsconfig.event-track.json");
10
+ }
11
+ //# sourceMappingURL=copy-tsconfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-tsconfig.js","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAC7B,SAAS,EACT,WAAW,EACX,2BAA2B,CAC5B,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7C,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,2BAA2B,CAAC,CAAC;AAC7D,CAAC"}
@@ -1 +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"}
1
+ {"version":3,"file":"generate-track-events.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,GAAE,MAAqB,iBA4BnC"}
@@ -1,6 +1,6 @@
1
- import { addImports, getEventDomain, getFile, getNames } from "./helpers";
2
- import * as fs from "fs";
1
+ import { addImports, createRootFile, getEventDomain, getFile, getNames } from "./helpers";
3
2
  import * as path from 'path';
3
+ import { DEFAULT_FOLDER, DEFAULT_PATH } from "./constants";
4
4
  const TEMPLATE = `
5
5
  try {
6
6
  <Artifac>.NAME
@@ -8,9 +8,7 @@ const TEMPLATE = `
8
8
  console.error("Artifac <Artifac> not found")
9
9
  }
10
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';
11
+ const TEMPLATE_PATH = path.join(__dirname, 'templates', 'track.template.txt');
14
12
  /**
15
13
  * Agrega un elemento
16
14
  * @param {string} texto
@@ -40,16 +38,7 @@ export async function trackEvents(outputPath, contextName, eventFolder = DEFAULT
40
38
  templateContent = templateContent.replace("// flag", artifactTemplate);
41
39
  }
42
40
  // 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}`);
41
+ /** Crear archivo en la raiz */
42
+ createRootFile(outputPath, templateContent, 'track-events-script.ts');
54
43
  }
55
44
  //# sourceMappingURL=generate-track-events.js.map
@@ -1 +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,MA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ar y crear un json con
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,IAAI,kBAOzB"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate.ts"],"names":[],"mappings":";AAMA;;GAEG;AACH,wBAAsB,IAAI,kBASzB"}
@@ -1,13 +1,19 @@
1
+ #!/usr/bin/env node
2
+ import { DEFAULT_CONTEXT, DEFAULT_PATH, ROOT_PATH } from './constants';
3
+ import { copyTsConfig } from './copy-tsconfig';
1
4
  import { trackEvents } from './generate-track-events';
5
+ import { updateGitignore } from './helpers';
2
6
  /**
3
7
  * Metodo para listar y crear un json con
4
8
  */
5
9
  export async function main() {
6
10
  let [, , outputPath, contextName, eventFolder] = process.argv;
7
- outputPath = outputPath ? outputPath : "./src";
8
- contextName = contextName ? contextName : "default";
9
- eventFolder = eventFolder ? eventFolder : "./src/events";
11
+ outputPath = outputPath ? outputPath : ROOT_PATH;
12
+ contextName = contextName ? contextName : DEFAULT_CONTEXT;
13
+ eventFolder = eventFolder ? eventFolder : DEFAULT_PATH;
10
14
  await trackEvents(outputPath, contextName, eventFolder);
15
+ await copyTsConfig();
16
+ updateGitignore();
11
17
  }
12
18
  main();
13
19
  //# sourceMappingURL=generate.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/scripts/get-event/generate.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C;;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,SAAS,CAAC;IACjD,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC;IAC1D,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC;IACvD,MAAM,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IACxD,MAAM,YAAY,EAAE,CAAC;IACrB,eAAe,EAAE,CAAC;AACpB,CAAC;AACD,IAAI,EAAE,CAAA"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Crear archivo en la raiz del proyecto
3
+ * @param {string} outputPath ruta de salida
4
+ * @param {string} content Contenido
5
+ * @param {string} fileName Nombre del archivo
6
+ */
7
+ export declare function createRootFile(outputPath: string, content: string, fileName: string): void;
8
+ //# sourceMappingURL=create-root-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-root-file.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/create-root-file.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAanF"}
@@ -0,0 +1,22 @@
1
+ import * as fs from "fs";
2
+ import * as path from "path";
3
+ /**
4
+ * Crear archivo en la raiz del proyecto
5
+ * @param {string} outputPath ruta de salida
6
+ * @param {string} content Contenido
7
+ * @param {string} fileName Nombre del archivo
8
+ */
9
+ export function createRootFile(outputPath, content, fileName) {
10
+ // Usar process.cwd() para obtener la raíz del proyecto
11
+ const srcFolderPath = process.cwd();
12
+ // Crear la carpeta dentro de src si no existe
13
+ const schemasFolderPath = path.join(srcFolderPath, outputPath);
14
+ if (!fs.existsSync(schemasFolderPath)) {
15
+ fs.mkdirSync(schemasFolderPath);
16
+ console.log(`\nFolder created: ${schemasFolderPath}`);
17
+ }
18
+ const filePath = path.join(schemasFolderPath, fileName);
19
+ fs.writeFileSync(filePath, content, "utf8");
20
+ console.log(`\nFile created in: ${filePath}`);
21
+ }
22
+ //# sourceMappingURL=create-root-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-root-file.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/create-root-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,UAAkB,EAAE,OAAe,EAAE,QAAgB;IAClF,uDAAuD;IACvD,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAEpC,8CAA8C;IAC9C,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,qBAAqB,iBAAiB,EAAE,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACxD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,sBAAsB,QAAQ,EAAE,CAAC,CAAC;AAChD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './add-import';
2
+ export * from './create-root-file';
2
3
  export * from './exists-file';
3
4
  export * from './get-directories';
4
5
  export * from './get-event-domain';
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './add-import';
2
+ export * from './create-root-file';
2
3
  export * from './exists-file';
3
4
  export * from './get-directories';
4
5
  export * from './get-event-domain';
@@ -1 +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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,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
+ /**
2
+ * Ruta de la raiz
3
+ */
4
+ export declare const DEFAULT_CONTEXT = "default";
5
+ export declare const ROOT_PATH = "./src";
6
+ export declare const DEFAULT_FOLDER = "events";
7
+ export declare const DEFAULT_PATH = "./src/events\"";
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,YAAY,mBAAoC,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_PATH = exports.DEFAULT_FOLDER = exports.ROOT_PATH = exports.DEFAULT_CONTEXT = void 0;
4
+ /**
5
+ * Ruta de la raiz
6
+ */
7
+ exports.DEFAULT_CONTEXT = "default";
8
+ exports.ROOT_PATH = "./src";
9
+ exports.DEFAULT_FOLDER = "events";
10
+ exports.DEFAULT_PATH = `${exports.ROOT_PATH}/${exports.DEFAULT_FOLDER}"`;
11
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,eAAe,GAAG,SAAS,CAAC;AAC5B,QAAA,SAAS,GAAG,OAAO,CAAC;AACpB,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,YAAY,GAAG,GAAG,iBAAS,IAAI,sBAAc,GAAG,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Copia el archivo tsconfig
3
+ */
4
+ export declare function copyTsConfig(): Promise<void>;
5
+ //# sourceMappingURL=copy-tsconfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-tsconfig.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAsB,YAAY,kBAQjC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.copyTsConfig = void 0;
27
+ const path = __importStar(require("path"));
28
+ const helpers_1 = require("./helpers");
29
+ /**
30
+ * Copia el archivo tsconfig
31
+ */
32
+ async function copyTsConfig() {
33
+ const TSCONFIG_PATH = path.join(__dirname, "templates", "tsconfig.event-track.json");
34
+ const content = await (0, helpers_1.getFile)(TSCONFIG_PATH);
35
+ (0, helpers_1.createRootFile)("./", content, "tsconfig.event-track.json");
36
+ }
37
+ exports.copyTsConfig = copyTsConfig;
38
+ //# sourceMappingURL=copy-tsconfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-tsconfig.js","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,uCAAoD;AAEpD;;GAEG;AACI,KAAK,UAAU,YAAY;IAChC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAC7B,SAAS,EACT,WAAW,EACX,2BAA2B,CAC5B,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,IAAA,iBAAO,EAAC,aAAa,CAAC,CAAC;IAC7C,IAAA,wBAAc,EAAC,IAAI,EAAE,OAAO,EAAE,2BAA2B,CAAC,CAAC;AAC7D,CAAC;AARD,oCAQC"}
@@ -1 +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"}
1
+ {"version":3,"file":"generate-track-events.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,GAAE,MAAqB,iBA4BnC"}
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.trackEvents = void 0;
27
27
  const helpers_1 = require("./helpers");
28
- const fs = __importStar(require("fs"));
29
28
  const path = __importStar(require("path"));
29
+ const constants_1 = require("./constants");
30
30
  const TEMPLATE = `
31
31
  try {
32
32
  <Artifac>.NAME
@@ -34,9 +34,7 @@ const TEMPLATE = `
34
34
  console.error("Artifac <Artifac> not found")
35
35
  }
36
36
  // flag`;
37
- const DEFAULT_PATH = "./src/events";
38
- const DEFAULT_FOLDER = "events";
39
- const TEMPLATE_PATH = 'src/scripts/get-event/templates/track.template.txt';
37
+ const TEMPLATE_PATH = path.join(__dirname, 'templates', 'track.template.txt');
40
38
  /**
41
39
  * Agrega un elemento
42
40
  * @param {string} texto
@@ -54,29 +52,20 @@ function addArtifacts(texto, artifacName, folder) {
54
52
  * @param {string} contextName Nombre del contexto
55
53
  * @param {string} eventFolder Carpeta en donde se alojan los eventos
56
54
  */
57
- async function trackEvents(outputPath, contextName, eventFolder = DEFAULT_PATH) {
55
+ async function trackEvents(outputPath, contextName, eventFolder = constants_1.DEFAULT_PATH) {
58
56
  const artifacts = (0, helpers_1.getEventDomain)(eventFolder);
59
57
  let templateContent = await (0, helpers_1.getFile)(TEMPLATE_PATH);
60
58
  templateContent = templateContent.replace("<%= context-name %>", contextName.trim());
61
59
  for (const artifac of artifacts) {
62
60
  const artifacNames = (0, helpers_1.getNames)(artifac.name);
63
- templateContent = (0, helpers_1.addImports)(templateContent, [`${artifacNames.className}`], `./${DEFAULT_FOLDER}/${artifac.name}`);
61
+ templateContent = (0, helpers_1.addImports)(templateContent, [`${artifacNames.className}`], `./${constants_1.DEFAULT_FOLDER}/${artifac.name}`);
64
62
  let artifactTemplate = TEMPLATE.replace(/<Artifac>/g, `${artifacNames.className}`);
65
- templateContent = addArtifacts(templateContent, artifac.name, DEFAULT_FOLDER);
63
+ templateContent = addArtifacts(templateContent, artifac.name, constants_1.DEFAULT_FOLDER);
66
64
  templateContent = templateContent.replace("// flag", artifactTemplate);
67
65
  }
68
66
  // console.log("\ntemplateContent", templateContent);
69
- // Obtener la ruta del directorio src
70
- const srcFolderPath = path.resolve(__dirname, '..', '..'); // Subir un nivel desde event-schemes
71
- // Crear la carpeta schemas dentro de src si no existe
72
- const schemasFolderPath = path.join(srcFolderPath, outputPath);
73
- if (!fs.existsSync(schemasFolderPath)) {
74
- fs.mkdirSync(schemasFolderPath);
75
- console.log(`\nCarpeta 'schemes' creada en: ${schemasFolderPath}`);
76
- }
77
- const filePath = path.join(schemasFolderPath, 'track-events-script.ts');
78
- fs.writeFileSync(filePath, templateContent, "utf8");
79
- console.log(`Track file created in: ${filePath}`);
67
+ /** Crear archivo en la raiz */
68
+ (0, helpers_1.createRootFile)(outputPath, templateContent, 'track-events-script.ts');
80
69
  }
81
70
  exports.trackEvents = trackEvents;
82
71
  //# sourceMappingURL=generate-track-events.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate-track-events.js","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA0E;AAC1E,uCAAyB;AACzB,2CAA6B;AAE7B,MAAM,QAAQ,GAAG;;;;;;UAMP,CAAC;AAEX,MAAM,YAAY,GAAG,cAAc,CAAC;AAEpC,MAAM,cAAc,GAAG,QAAQ,CAAC;AAEhC,MAAM,aAAa,GAAG,oDAAoD,CAAC;AAE3E;;;;;;GAMG;AACH,SAAS,YAAY,CACnB,KAAa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iBAAO,EAAC,aAAa,CAAC,CAAC;IAEnD,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,qBAAqB,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAErF,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;QAChC,MAAM,YAAY,GAAG,IAAA,kBAAQ,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC5C,eAAe,GAAG,IAAA,oBAAU,EAC1B,eAAe,EACf,CAAC,GAAG,YAAY,CAAC,SAAS,EAAE,CAAC,EAC7B,KAAK,0BAAc,IAAI,OAAO,CAAC,IAAI,EAAE,CACtC,CAAC;QAEF,IAAI,gBAAgB,GAAG,QAAQ,CAAC,OAAO,CACrC,YAAY,EACZ,GAAG,YAAY,CAAC,SAAS,EAAE,CAC5B,CAAC;QAEF,eAAe,GAAG,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,IAAI,EAAE,0BAAc,CAAC,CAAA;QAE7E,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IACzE,CAAC;IACD,qDAAqD;IAErD,+BAA+B;IAC/B,IAAA,wBAAc,EAAC,UAAU,EAAE,eAAe,EAAE,wBAAwB,CAAC,CAAC;AACxE,CAAC;AA/BD,kCA+BC"}
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  /**
2
3
  * Metodo para listar y crear un json con
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,IAAI,kBAOzB"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate.ts"],"names":[],"mappings":";AAMA;;GAEG;AACH,wBAAsB,IAAI,kBASzB"}
@@ -1,16 +1,22 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.main = void 0;
5
+ const constants_1 = require("./constants");
6
+ const copy_tsconfig_1 = require("./copy-tsconfig");
4
7
  const generate_track_events_1 = require("./generate-track-events");
8
+ const helpers_1 = require("./helpers");
5
9
  /**
6
10
  * Metodo para listar y crear un json con
7
11
  */
8
12
  async function main() {
9
13
  let [, , outputPath, contextName, eventFolder] = process.argv;
10
- outputPath = outputPath ? outputPath : "./src";
11
- contextName = contextName ? contextName : "default";
12
- eventFolder = eventFolder ? eventFolder : "./src/events";
14
+ outputPath = outputPath ? outputPath : constants_1.ROOT_PATH;
15
+ contextName = contextName ? contextName : constants_1.DEFAULT_CONTEXT;
16
+ eventFolder = eventFolder ? eventFolder : constants_1.DEFAULT_PATH;
13
17
  await (0, generate_track_events_1.trackEvents)(outputPath, contextName, eventFolder);
18
+ await (0, copy_tsconfig_1.copyTsConfig)();
19
+ (0, helpers_1.updateGitignore)();
14
20
  }
15
21
  exports.main = main;
16
22
  main();
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/scripts/get-event/generate.ts"],"names":[],"mappings":";;;AAAA,mEAAsD;AAEtD;;GAEG;AACI,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,IAAA,mCAAW,EAAC,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AAC1D,CAAC;AAPD,oBAOC;AACD,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/scripts/get-event/generate.ts"],"names":[],"mappings":";;;;AACA,2CAAuE;AACvE,mDAA+C;AAC/C,mEAAsD;AACtD,uCAA4C;AAE5C;;GAEG;AACI,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,qBAAS,CAAC;IACjD,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,2BAAe,CAAC;IAC1D,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,wBAAY,CAAC;IACvD,MAAM,IAAA,mCAAW,EAAC,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IACxD,MAAM,IAAA,4BAAY,GAAE,CAAC;IACrB,IAAA,yBAAe,GAAE,CAAC;AACpB,CAAC;AATD,oBASC;AACD,IAAI,EAAE,CAAA"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Crear archivo en la raiz del proyecto
3
+ * @param {string} outputPath ruta de salida
4
+ * @param {string} content Contenido
5
+ * @param {string} fileName Nombre del archivo
6
+ */
7
+ export declare function createRootFile(outputPath: string, content: string, fileName: string): void;
8
+ //# sourceMappingURL=create-root-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-root-file.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/create-root-file.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAanF"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.createRootFile = void 0;
27
+ const fs = __importStar(require("fs"));
28
+ const path = __importStar(require("path"));
29
+ /**
30
+ * Crear archivo en la raiz del proyecto
31
+ * @param {string} outputPath ruta de salida
32
+ * @param {string} content Contenido
33
+ * @param {string} fileName Nombre del archivo
34
+ */
35
+ function createRootFile(outputPath, content, fileName) {
36
+ // Usar process.cwd() para obtener la raíz del proyecto
37
+ const srcFolderPath = process.cwd();
38
+ // Crear la carpeta dentro de src si no existe
39
+ const schemasFolderPath = path.join(srcFolderPath, outputPath);
40
+ if (!fs.existsSync(schemasFolderPath)) {
41
+ fs.mkdirSync(schemasFolderPath);
42
+ console.log(`\nFolder created: ${schemasFolderPath}`);
43
+ }
44
+ const filePath = path.join(schemasFolderPath, fileName);
45
+ fs.writeFileSync(filePath, content, "utf8");
46
+ console.log(`\nFile created in: ${filePath}`);
47
+ }
48
+ exports.createRootFile = createRootFile;
49
+ //# sourceMappingURL=create-root-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-root-file.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/create-root-file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,UAAkB,EAAE,OAAe,EAAE,QAAgB;IAClF,uDAAuD;IACvD,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAEpC,8CAA8C;IAC9C,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,qBAAqB,iBAAiB,EAAE,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACxD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,sBAAsB,QAAQ,EAAE,CAAC,CAAC;AAChD,CAAC;AAbD,wCAaC"}
@@ -1,4 +1,5 @@
1
1
  export * from './add-import';
2
+ export * from './create-root-file';
2
3
  export * from './exists-file';
3
4
  export * from './get-directories';
4
5
  export * from './get-event-domain';
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./add-import"), exports);
18
+ __exportStar(require("./create-root-file"), exports);
18
19
  __exportStar(require("./exists-file"), exports);
19
20
  __exportStar(require("./get-directories"), exports);
20
21
  __exportStar(require("./get-event-domain"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,gDAA8B;AAC9B,oDAAkC;AAClC,qDAAmC;AACnC,6CAA2B;AAC3B,8CAA4B;AAC5B,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,qDAAmC;AACnC,gDAA8B;AAC9B,oDAAkC;AAClC,qDAAmC;AACnC,6CAA2B;AAC3B,8CAA4B;AAC5B,qDAAmC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imolko/ultra-ddd",
3
- "version": "1.0.14",
3
+ "version": "1.0.15-beta",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "results",
@@ -1 +0,0 @@
1
- //# sourceMappingURL=copy-file.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copy-file.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/copy-file.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=copy-file.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copy-file.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/copy-file.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=copy-file.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copy-file.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/copy-file.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=copy-file.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copy-file.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/helpers/copy-file.ts"],"names":[],"mappings":""}