@intelligentgraphics/ig.gfx.packager 3.0.2 → 3.0.4

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 (68) hide show
  1. package/build/cli-5332deff.js +2486 -0
  2. package/build/cli-5332deff.js.map +1 -0
  3. package/build/{lib/dependencies.mjs → dependencies-227aca50.js} +62 -7
  4. package/build/dependencies-227aca50.js.map +1 -0
  5. package/build/{commands/generate.mjs → generate-a3a16031.js} +17 -3
  6. package/build/generate-a3a16031.js.map +1 -0
  7. package/build/{commands/publish/index.mjs → index-5d595f56.js} +199 -17
  8. package/build/index-5d595f56.js.map +1 -0
  9. package/build/{commands/build/index.mjs → index-92b6ba5c.js} +151 -8
  10. package/build/index-92b6ba5c.js.map +1 -0
  11. package/build/index.mjs +1 -1
  12. package/build/index.mjs.map +1 -1
  13. package/build/{commands/postinstall.mjs → postinstall-7e50da37.js} +19 -12
  14. package/build/postinstall-7e50da37.js.map +1 -0
  15. package/build/{commands/publishNpm.mjs → publishNpm-e2c8347f.js} +22 -10
  16. package/build/publishNpm-e2c8347f.js.map +1 -0
  17. package/build/versionFile-b3a65dc8.js +370 -0
  18. package/build/versionFile-b3a65dc8.js.map +1 -0
  19. package/package.json +8 -7
  20. package/readme.md +23 -3
  21. package/build/cli.mjs +0 -316
  22. package/build/cli.mjs.map +0 -1
  23. package/build/commands/build/docs.mjs +0 -34
  24. package/build/commands/build/docs.mjs.map +0 -1
  25. package/build/commands/build/index.mjs.map +0 -1
  26. package/build/commands/build/tsc.mjs +0 -84
  27. package/build/commands/build/tsc.mjs.map +0 -1
  28. package/build/commands/generate.mjs.map +0 -1
  29. package/build/commands/postinstall.mjs.map +0 -1
  30. package/build/commands/publish/index.mjs.map +0 -1
  31. package/build/commands/publish/zip.mjs +0 -168
  32. package/build/commands/publish/zip.mjs.map +0 -1
  33. package/build/commands/publishNpm.mjs.map +0 -1
  34. package/build/lib/assetService.mjs +0 -111
  35. package/build/lib/assetService.mjs.map +0 -1
  36. package/build/lib/banner.mjs +0 -20
  37. package/build/lib/banner.mjs.map +0 -1
  38. package/build/lib/dependencies.mjs.map +0 -1
  39. package/build/lib/error.mjs +0 -15
  40. package/build/lib/error.mjs.map +0 -1
  41. package/build/lib/fs.mjs +0 -19
  42. package/build/lib/fs.mjs.map +0 -1
  43. package/build/lib/git.mjs +0 -37
  44. package/build/lib/git.mjs.map +0 -1
  45. package/build/lib/log.mjs +0 -9
  46. package/build/lib/log.mjs.map +0 -1
  47. package/build/lib/npmPackage.mjs +0 -19
  48. package/build/lib/npmPackage.mjs.map +0 -1
  49. package/build/lib/package.mjs +0 -129
  50. package/build/lib/package.mjs.map +0 -1
  51. package/build/lib/packageVersion.mjs +0 -174
  52. package/build/lib/packageVersion.mjs.map +0 -1
  53. package/build/lib/parseVersion.mjs +0 -54
  54. package/build/lib/parseVersion.mjs.map +0 -1
  55. package/build/lib/prompter.mjs +0 -31
  56. package/build/lib/prompter.mjs.map +0 -1
  57. package/build/lib/publishedPackage.mjs +0 -66
  58. package/build/lib/publishedPackage.mjs.map +0 -1
  59. package/build/lib/scripts.mjs +0 -10
  60. package/build/lib/scripts.mjs.map +0 -1
  61. package/build/lib/stripUtf8Bom.mjs +0 -11
  62. package/build/lib/stripUtf8Bom.mjs.map +0 -1
  63. package/build/lib/toposort.mjs +0 -26
  64. package/build/lib/toposort.mjs.map +0 -1
  65. package/build/lib/versionFile.mjs +0 -78
  66. package/build/lib/versionFile.mjs.map +0 -1
  67. package/build/lib/workspace.mjs +0 -51
  68. package/build/lib/workspace.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependencies.mjs","sources":["../../src/lib/dependencies.ts"],"sourcesContent":["import { PackageJSON } from \"./packageJSON\";\nimport {\n\tdetectPublishedPackageFromPath,\n\tPublishedPackageLocation,\n\treadPublishedPackageNpmManifest,\n} from \"./publishedPackage\";\nimport { readWorkspaceNpmManifest, WorkspaceLocation } from \"./workspace\";\n\n// /**\n// * Determines the implicit dependencies of a an actual data workspace package.\n// *\n// * An implicit dependency is a dependency that is installed for the workspace and has the same runtime environment (evaluator, interactor) as the package.\n// *\n// * @param {WorkspaceLocation} workspace\n// * @param {CreatorPackage} creatorPackage\n// * @returns {PublishedPackageLocation[]}\n// */\n// export const determinePackageImplicitDependencies = (\n// \tworkspace: WorkspaceLocation,\n// \tcreatorPackage: CreatorPackage,\n// ): PublishedPackageLocation[] => {\n// \tconst libraries = determineWorkspaceIGLibraries(workspace);\n\n// \tconst results: PublishedPackageLocation[] = [];\n// \tfor (const librarylocation of libraries) {\n// \t\tconst libraryManifest =\n// \t\t\treadPublishedPackageCreatorManifest(librarylocation);\n\n// \t\tif (\n// \t\t\tlibraryManifest !== undefined &&\n// \t\t\t(libraryManifest.Type === \"Mixed\" ||\n// \t\t\t\tlibraryManifest.RunTime === creatorPackage.RunTime)\n// \t\t) {\n// \t\t\tresults.push(librarylocation);\n// \t\t}\n// \t}\n\n// \treturn results;\n// };\n\n/**\n * Recursively determines all installed ig libraries for a workspace.\n *\n * @param {WorkspaceLocation} workspace\n * @returns {PublishedPackageLocation[]}\n */\nexport const determineWorkspaceIGLibraries = (\n\tworkspace: WorkspaceLocation,\n): PublishedPackageLocation[] => {\n\tconst manifest = readWorkspaceNpmManifest(workspace);\n\n\tif (manifest === undefined) {\n\t\treturn [];\n\t}\n\n\tconst libraries = collectIGLibraries(workspace, manifest);\n\tconst results = new Map<string, PublishedPackageLocation>();\n\n\tfor (const location of libraries) {\n\t\tconst manifest = readPublishedPackageNpmManifest(location);\n\t\tif (!results.has(manifest.name)) {\n\t\t\tresults.set(manifest.name, location);\n\t\t}\n\t}\n\n\treturn Array.from(results.values());\n};\n\nconst collectIGLibraries = (\n\tworkspace: WorkspaceLocation,\n\tmanifest: PackageJSON,\n): PublishedPackageLocation[] => {\n\tif (!manifest.dependencies) {\n\t\treturn [];\n\t}\n\n\tconst runtimeDependencies = Object.getOwnPropertyNames(\n\t\tmanifest.dependencies,\n\t);\n\n\tconst result: PublishedPackageLocation[] = [];\n\n\tfor (const runtimeDependency of runtimeDependencies) {\n\t\tconst location = detectPublishedPackageFromPath(\n\t\t\tworkspace.path,\n\t\t\truntimeDependency,\n\t\t);\n\n\t\tconst runtimeManifest = readPublishedPackageNpmManifest(location);\n\n\t\t// packages need to explicitly be marked as ig scriptingLibraries\n\t\tif (runtimeManifest.ig?.scriptingLibrary) {\n\t\t\tresult.push(location);\n\t\t\tresult.push(...collectIGLibraries(workspace, runtimeManifest));\n\t\t}\n\t}\n\n\treturn result;\n};\n"],"names":["determineWorkspaceIGLibraries","workspace","manifest","readWorkspaceNpmManifest","undefined","libraries","collectIGLibraries","results","Map","location","readPublishedPackageNpmManifest","has","name","set","Array","from","values","dependencies","runtimeDependencies","Object","getOwnPropertyNames","result","runtimeDependency","detectPublishedPackageFromPath","path","runtimeManifest","ig","scriptingLibrary","push"],"mappings":";;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACaA,MAAAA,6BAA6B,GACzCC,SAA4B,IACI;AAChC,EAAA,MAAMC,QAAQ,GAAGC,wBAAwB,CAACF,SAAS,CAAC,CAAA;EAEpD,IAAIC,QAAQ,KAAKE,SAAS,EAAE;AAC3B,IAAA,OAAO,EAAE,CAAA;AACV,GAAA;AAEA,EAAA,MAAMC,SAAS,GAAGC,kBAAkB,CAACL,SAAS,EAAEC,QAAQ,CAAC,CAAA;AACzD,EAAA,MAAMK,OAAO,GAAG,IAAIC,GAAG,EAAoC,CAAA;AAE3D,EAAA,KAAK,MAAMC,QAAQ,IAAIJ,SAAS,EAAE;AACjC,IAAA,MAAMH,QAAQ,GAAGQ,+BAA+B,CAACD,QAAQ,CAAC,CAAA;IAC1D,IAAI,CAACF,OAAO,CAACI,GAAG,CAACT,QAAQ,CAACU,IAAI,CAAC,EAAE;MAChCL,OAAO,CAACM,GAAG,CAACX,QAAQ,CAACU,IAAI,EAAEH,QAAQ,CAAC,CAAA;AACrC,KAAA;AACD,GAAA;EAEA,OAAOK,KAAK,CAACC,IAAI,CAACR,OAAO,CAACS,MAAM,EAAE,CAAC,CAAA;AACpC,EAAC;AAED,MAAMV,kBAAkB,GAAG,CAC1BL,SAA4B,EAC5BC,QAAqB,KACW;AAChC,EAAA,IAAI,CAACA,QAAQ,CAACe,YAAY,EAAE;AAC3B,IAAA,OAAO,EAAE,CAAA;AACV,GAAA;EAEA,MAAMC,mBAAmB,GAAGC,MAAM,CAACC,mBAAmB,CACrDlB,QAAQ,CAACe,YAAY,CACrB,CAAA;EAED,MAAMI,MAAkC,GAAG,EAAE,CAAA;AAE7C,EAAA,KAAK,MAAMC,iBAAiB,IAAIJ,mBAAmB,EAAE;AAAA,IAAA,IAAA,mBAAA,CAAA;IACpD,MAAMT,QAAQ,GAAGc,8BAA8B,CAC9CtB,SAAS,CAACuB,IAAI,EACdF,iBAAiB,CACjB,CAAA;AAED,IAAA,MAAMG,eAAe,GAAGf,+BAA+B,CAACD,QAAQ,CAAC,CAAA;;AAEjE;AACA,IAAA,IAAA,CAAA,mBAAA,GAAIgB,eAAe,CAACC,EAAE,MAAlB,IAAA,IAAA,mBAAA,KAAA,KAAA,CAAA,IAAA,mBAAA,CAAoBC,gBAAgB,EAAE;AACzCN,MAAAA,MAAM,CAACO,IAAI,CAACnB,QAAQ,CAAC,CAAA;MACrBY,MAAM,CAACO,IAAI,CAAC,GAAGtB,kBAAkB,CAACL,SAAS,EAAEwB,eAAe,CAAC,CAAC,CAAA;AAC/D,KAAA;AACD,GAAA;AAEA,EAAA,OAAOJ,MAAM,CAAA;AACd,CAAC;;;;"}
@@ -1,15 +0,0 @@
1
- const getNodeErrorCode = error => {
2
- if (error !== null && typeof error === "object" && error.code !== undefined) {
3
- return error.code;
4
- }
5
- };
6
-
7
- /**
8
- * No such file or directory: Commonly raised by fs operations to indicate that a component of the specified pathname does not exist. No entity (file or directory) could be found by the given path.
9
- *
10
- * @param {unknown} error
11
- */
12
- const isErrorENOENT = error => getNodeErrorCode(error) === "ENOENT";
13
-
14
- export { getNodeErrorCode, isErrorENOENT };
15
- //# sourceMappingURL=error.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.mjs","sources":["../../src/lib/error.ts"],"sourcesContent":["interface NodeError extends Error {\n\tcode: string;\n}\n\nexport const getNodeErrorCode = (error: unknown) => {\n\tif (\n\t\terror !== null &&\n\t\ttypeof error === \"object\" &&\n\t\t(error as NodeError).code !== undefined\n\t) {\n\t\treturn (error as NodeError).code;\n\t}\n};\n\n/**\n * Permission denied: An attempt was made to access a file in a way forbidden by its file access permissions.\n *\n * @param {unknown} error\n */\nexport const isErrorEACCES = (error: unknown) =>\n\tgetNodeErrorCode(error) === \"EACCES\";\n\n/**\n * No such file or directory: Commonly raised by fs operations to indicate that a component of the specified pathname does not exist. No entity (file or directory) could be found by the given path.\n *\n * @param {unknown} error\n */\nexport const isErrorENOENT = (error: unknown) =>\n\tgetNodeErrorCode(error) === \"ENOENT\";\n"],"names":["getNodeErrorCode","error","code","undefined","isErrorENOENT"],"mappings":"AAIaA,MAAAA,gBAAgB,GAAIC,KAAc,IAAK;AACnD,EAAA,IACCA,KAAK,KAAK,IAAI,IACd,OAAOA,KAAK,KAAK,QAAQ,IACxBA,KAAK,CAAeC,IAAI,KAAKC,SAAS,EACtC;IACD,OAAQF,KAAK,CAAeC,IAAI,CAAA;AACjC,GAAA;AACD,EAAC;;AAUD;AACA;AACA;AACA;AACA;AACO,MAAME,aAAa,GAAIH,KAAc,IAC3CD,gBAAgB,CAACC,KAAK,CAAC,KAAK;;;;"}
package/build/lib/fs.mjs DELETED
@@ -1,19 +0,0 @@
1
- import * as fs from 'fs';
2
- import { isErrorENOENT } from './error.mjs';
3
-
4
- const readStringFromFile = filePath => fs.readFileSync(filePath, {
5
- encoding: "utf8"
6
- });
7
- const readStringFromFileOrUndefined = filePath => {
8
- try {
9
- return readStringFromFile(filePath);
10
- } catch (err) {
11
- if (!isErrorENOENT(err)) {
12
- throw err;
13
- }
14
- return undefined;
15
- }
16
- };
17
-
18
- export { readStringFromFile, readStringFromFileOrUndefined };
19
- //# sourceMappingURL=fs.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fs.mjs","sources":["../../src/lib/fs.ts"],"sourcesContent":["import * as fs from \"fs\";\n\nimport { isErrorENOENT } from \"./error\";\n\nexport const readStringFromFile = (filePath: string): string =>\n\tfs.readFileSync(filePath, { encoding: \"utf8\" });\n\nexport const readStringFromFileOrUndefined = (\n\tfilePath: string,\n): string | undefined => {\n\ttry {\n\t\treturn readStringFromFile(filePath);\n\t} catch (err) {\n\t\tif (!isErrorENOENT(err)) {\n\t\t\tthrow err;\n\t\t}\n\t\treturn undefined;\n\t}\n};\n"],"names":["readStringFromFile","filePath","fs","readFileSync","encoding","readStringFromFileOrUndefined","err","isErrorENOENT","undefined"],"mappings":";;;AAIO,MAAMA,kBAAkB,GAAIC,QAAgB,IAClDC,EAAE,CAACC,YAAY,CAACF,QAAQ,EAAE;AAAEG,EAAAA,QAAQ,EAAE,MAAA;AAAO,CAAC,EAAC;AAEnCC,MAAAA,6BAA6B,GACzCJ,QAAgB,IACQ;EACxB,IAAI;IACH,OAAOD,kBAAkB,CAACC,QAAQ,CAAC,CAAA;GACnC,CAAC,OAAOK,GAAG,EAAE;AACb,IAAA,IAAI,CAACC,aAAa,CAACD,GAAG,CAAC,EAAE;AACxB,MAAA,MAAMA,GAAG,CAAA;AACV,KAAA;AACA,IAAA,OAAOE,SAAS,CAAA;AACjB,GAAA;AACD;;;;"}
package/build/lib/git.mjs DELETED
@@ -1,37 +0,0 @@
1
- import simpleGit from 'simple-git';
2
- import * as path from 'path';
3
-
4
- const getVersionInformationFromGit = async (workspaceLocation, packageLocation) => {
5
- try {
6
- var _log$latest, _log$latest2;
7
- const git = simpleGit({
8
- baseDir: workspaceLocation.path
9
- });
10
-
11
- // check wether the files for a folder are changed
12
- // if so, mark as dirty
13
- const diff = await git.diffSummary();
14
- const dirty = diff.files.some(file => {
15
- if (file.file.toLowerCase().includes("releases") || file.file.toLowerCase().endsWith("version.ts") || file.file.toLowerCase().endsWith("package.json")) {
16
- return false;
17
- }
18
- const fullPath = path.resolve(workspaceLocation.path, file.file);
19
- const relativePath = path.relative(packageLocation.path, fullPath);
20
- return !relativePath.startsWith("..");
21
- });
22
- const log = await git.log({
23
- maxCount: 1
24
- });
25
- const commit = !((_log$latest = log.latest) !== null && _log$latest !== void 0 && _log$latest.hash) ? undefined : log.latest.hash.substring(0, 7);
26
- return {
27
- commit,
28
- dirty,
29
- commitDate: (_log$latest2 = log.latest) === null || _log$latest2 === void 0 ? void 0 : _log$latest2.date
30
- };
31
- } catch (err) {
32
- return {};
33
- }
34
- };
35
-
36
- export { getVersionInformationFromGit };
37
- //# sourceMappingURL=git.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git.mjs","sources":["../../src/lib/git.ts"],"sourcesContent":["import simpleGit from \"simple-git\";\nimport * as path from \"path\";\n\nimport { WorkspaceLocation } from \"./workspace\";\nimport { PackageLocation } from \"./package\";\n\nexport const getVersionInformationFromGit = async (\n\tworkspaceLocation: WorkspaceLocation,\n\tpackageLocation: PackageLocation,\n) => {\n\ttry {\n\t\tconst git = simpleGit({\n\t\t\tbaseDir: workspaceLocation.path,\n\t\t});\n\n\t\t// check wether the files for a folder are changed\n\t\t// if so, mark as dirty\n\t\tconst diff = await git.diffSummary();\n\n\t\tconst dirty = diff.files.some((file) => {\n\t\t\tif (\n\t\t\t\tfile.file.toLowerCase().includes(\"releases\") ||\n\t\t\t\tfile.file.toLowerCase().endsWith(\"version.ts\") ||\n\t\t\t\tfile.file.toLowerCase().endsWith(\"package.json\")\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst fullPath = path.resolve(workspaceLocation.path, file.file);\n\t\t\tconst relativePath = path.relative(packageLocation.path, fullPath);\n\n\t\t\treturn !relativePath.startsWith(\"..\");\n\t\t});\n\n\t\tconst log = await git.log({ maxCount: 1 });\n\t\tconst commit = !log.latest?.hash\n\t\t\t? undefined\n\t\t\t: log.latest.hash.substring(0, 7);\n\n\t\treturn {\n\t\t\tcommit,\n\t\t\tdirty,\n\t\t\tcommitDate: log.latest?.date,\n\t\t};\n\t} catch (err) {\n\t\treturn {};\n\t}\n};\n"],"names":["getVersionInformationFromGit","workspaceLocation","packageLocation","git","simpleGit","baseDir","path","diff","diffSummary","dirty","files","some","file","toLowerCase","includes","endsWith","fullPath","resolve","relativePath","relative","startsWith","log","maxCount","commit","latest","hash","undefined","substring","commitDate","date","err"],"mappings":";;;MAMaA,4BAA4B,GAAG,OAC3CC,iBAAoC,EACpCC,eAAgC,KAC5B;EACJ,IAAI;AAAA,IAAA,IAAA,WAAA,EAAA,YAAA,CAAA;IACH,MAAMC,GAAG,GAAGC,SAAS,CAAC;MACrBC,OAAO,EAAEJ,iBAAiB,CAACK,IAAAA;AAC5B,KAAC,CAAC,CAAA;;AAEF;AACA;AACA,IAAA,MAAMC,IAAI,GAAG,MAAMJ,GAAG,CAACK,WAAW,EAAE,CAAA;IAEpC,MAAMC,KAAK,GAAGF,IAAI,CAACG,KAAK,CAACC,IAAI,CAAEC,IAAI,IAAK;AACvC,MAAA,IACCA,IAAI,CAACA,IAAI,CAACC,WAAW,EAAE,CAACC,QAAQ,CAAC,UAAU,CAAC,IAC5CF,IAAI,CAACA,IAAI,CAACC,WAAW,EAAE,CAACE,QAAQ,CAAC,YAAY,CAAC,IAC9CH,IAAI,CAACA,IAAI,CAACC,WAAW,EAAE,CAACE,QAAQ,CAAC,cAAc,CAAC,EAC/C;AACD,QAAA,OAAO,KAAK,CAAA;AACb,OAAA;AAEA,MAAA,MAAMC,QAAQ,GAAGV,IAAI,CAACW,OAAO,CAAChB,iBAAiB,CAACK,IAAI,EAAEM,IAAI,CAACA,IAAI,CAAC,CAAA;MAChE,MAAMM,YAAY,GAAGZ,IAAI,CAACa,QAAQ,CAACjB,eAAe,CAACI,IAAI,EAAEU,QAAQ,CAAC,CAAA;AAElE,MAAA,OAAO,CAACE,YAAY,CAACE,UAAU,CAAC,IAAI,CAAC,CAAA;AACtC,KAAC,CAAC,CAAA;AAEF,IAAA,MAAMC,GAAG,GAAG,MAAMlB,GAAG,CAACkB,GAAG,CAAC;AAAEC,MAAAA,QAAQ,EAAE,CAAA;AAAE,KAAC,CAAC,CAAA;IAC1C,MAAMC,MAAM,GAAG,EAACF,CAAAA,WAAAA,GAAAA,GAAG,CAACG,MAAM,MAAA,IAAA,IAAA,WAAA,KAAA,KAAA,CAAA,IAAV,WAAYC,CAAAA,IAAI,CAC7BC,GAAAA,SAAS,GACTL,GAAG,CAACG,MAAM,CAACC,IAAI,CAACE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAElC,OAAO;MACNJ,MAAM;MACNd,KAAK;AACLmB,MAAAA,UAAU,EAAEP,CAAAA,YAAAA,GAAAA,GAAG,CAACG,MAAM,iDAAV,YAAYK,CAAAA,IAAAA;KACxB,CAAA;GACD,CAAC,OAAOC,GAAG,EAAE;AACb,IAAA,OAAO,EAAE,CAAA;AACV,GAAA;AACD;;;;"}
package/build/lib/log.mjs DELETED
@@ -1,9 +0,0 @@
1
- const logPackageMessage = (name, step, index, total) => {
2
- const numLength = total === undefined ? undefined : total.toString().length;
3
- const indexString = total === undefined || total < 2 ? "" : `${index.toString().padStart(numLength, "0")}/${total} `;
4
- const identifierString = `${indexString}${name.padEnd(15)}`;
5
- console.log(`${identifierString} >> ${step}`);
6
- };
7
-
8
- export { logPackageMessage };
9
- //# sourceMappingURL=log.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.mjs","sources":["../../src/lib/log.ts"],"sourcesContent":["export const logPackageMessage = (\n\tname: string,\n\tstep: string,\n\tindex?: number,\n\ttotal?: number,\n) => {\n\tconst numLength = total === undefined ? undefined : total.toString().length;\n\n\tconst indexString =\n\t\ttotal === undefined || total < 2\n\t\t\t? \"\"\n\t\t\t: `${index!.toString().padStart(numLength!, \"0\")}/${total} `;\n\n\tconst identifierString = `${indexString}${name.padEnd(15)}`;\n\n\tconsole.log(`${identifierString} >> ${step}`);\n};\n"],"names":["logPackageMessage","name","step","index","total","numLength","undefined","toString","length","indexString","padStart","identifierString","padEnd","console","log"],"mappings":"AAAO,MAAMA,iBAAiB,GAAG,CAChCC,IAAY,EACZC,IAAY,EACZC,KAAc,EACdC,KAAc,KACV;AACJ,EAAA,MAAMC,SAAS,GAAGD,KAAK,KAAKE,SAAS,GAAGA,SAAS,GAAGF,KAAK,CAACG,QAAQ,EAAE,CAACC,MAAM,CAAA;EAE3E,MAAMC,WAAW,GAChBL,KAAK,KAAKE,SAAS,IAAIF,KAAK,GAAG,CAAC,GAC7B,EAAE,GACD,CAAA,EAAED,KAAK,CAAEI,QAAQ,EAAE,CAACG,QAAQ,CAACL,SAAS,EAAG,GAAG,CAAE,CAAGD,CAAAA,EAAAA,KAAM,CAAE,CAAA,CAAA,CAAA;EAE9D,MAAMO,gBAAgB,GAAI,CAAA,EAAEF,WAAY,CAAA,EAAER,IAAI,CAACW,MAAM,CAAC,EAAE,CAAE,CAAC,CAAA,CAAA;EAE3DC,OAAO,CAACC,GAAG,CAAE,CAAA,EAAEH,gBAAiB,CAAMT,IAAAA,EAAAA,IAAK,EAAC,CAAC,CAAA;AAC9C;;;;"}
@@ -1,19 +0,0 @@
1
- import * as fs from 'fs';
2
- import * as path from 'path';
3
- import { writePackageSync } from 'write-pkg';
4
- import { stripUtf8Bom } from './stripUtf8Bom.mjs';
5
-
6
- const readNpmManifest = directory => {
7
- const packageJsonPath = path.join(directory, "package.json");
8
- const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {
9
- encoding: "utf8"
10
- }));
11
- return JSON.parse(packageJson);
12
- };
13
- const writeNpmManifest = (directory, packageJson) => {
14
- const packageJsonPath = path.join(directory, "package.json");
15
- writePackageSync(packageJsonPath, packageJson);
16
- };
17
-
18
- export { readNpmManifest, writeNpmManifest };
19
- //# sourceMappingURL=npmPackage.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"npmPackage.mjs","sources":["../../src/lib/npmPackage.ts"],"sourcesContent":["import * as fs from \"fs\";\nimport * as path from \"path\";\nimport { writePackageSync } from \"write-pkg\";\n\nimport { PackageJSON } from \"./packageJSON\";\nimport { stripUtf8Bom } from \"./stripUtf8Bom\";\n\nexport const readNpmManifest = <T extends PackageJSON>(\n\tdirectory: string,\n): T => {\n\tconst packageJsonPath = path.join(directory, \"package.json\");\n\tconst packageJson = stripUtf8Bom(\n\t\tfs.readFileSync(packageJsonPath, {\n\t\t\tencoding: \"utf8\",\n\t\t}),\n\t);\n\treturn JSON.parse(packageJson);\n};\n\nexport const writeNpmManifest = <T extends PackageJSON>(\n\tdirectory: string,\n\tpackageJson: T,\n) => {\n\tconst packageJsonPath = path.join(directory, \"package.json\");\n\twritePackageSync(packageJsonPath, packageJson);\n};\n"],"names":["readNpmManifest","directory","packageJsonPath","path","join","packageJson","stripUtf8Bom","fs","readFileSync","encoding","JSON","parse","writeNpmManifest","writePackageSync"],"mappings":";;;;;AAOaA,MAAAA,eAAe,GAC3BC,SAAiB,IACV;EACP,MAAMC,eAAe,GAAGC,IAAI,CAACC,IAAI,CAACH,SAAS,EAAE,cAAc,CAAC,CAAA;EAC5D,MAAMI,WAAW,GAAGC,YAAY,CAC/BC,EAAE,CAACC,YAAY,CAACN,eAAe,EAAE;AAChCO,IAAAA,QAAQ,EAAE,MAAA;AACX,GAAC,CAAC,CACF,CAAA;AACD,EAAA,OAAOC,IAAI,CAACC,KAAK,CAACN,WAAW,CAAC,CAAA;AAC/B,EAAC;MAEYO,gBAAgB,GAAG,CAC/BX,SAAiB,EACjBI,WAAc,KACV;EACJ,MAAMH,eAAe,GAAGC,IAAI,CAACC,IAAI,CAACH,SAAS,EAAE,cAAc,CAAC,CAAA;AAC5DY,EAAAA,gBAAgB,CAACX,eAAe,EAAEG,WAAW,CAAC,CAAA;AAC/C;;;;"}
@@ -1,129 +0,0 @@
1
- import * as path from 'path';
2
- import * as fs from 'fs';
3
- import { isErrorENOENT } from './error.mjs';
4
- import { readNpmManifest, writeNpmManifest } from './npmPackage.mjs';
5
- import { stripUtf8Bom } from './stripUtf8Bom.mjs';
6
-
7
- // Functionality related to working with a single package.
8
- const PACKAGE_FILE = "_Package.json";
9
- const INDEX_FILE = "_Index.json";
10
- const ANIMATION_FILE_SUFFIX = ".animation.json";
11
-
12
- /**
13
- * Describes the location of a single package.
14
- *
15
- * @export
16
- * @interface PackageLocation
17
- */
18
-
19
- const parseCreatorPackageName = manifest => {
20
- const [domain, ...subdomainParts] = manifest.Package.split(".");
21
- return {
22
- domain,
23
- subdomain: subdomainParts.join(".")
24
- };
25
- };
26
- /**
27
- * Detects the package at the given directory.
28
- *
29
- * @param {string} directory
30
- * @returns {PackageLocation}
31
- */
32
- const detectPackage = (workspace, directory) => {
33
- directory = path.resolve(workspace.path, directory);
34
- const scriptsPath = path.join(directory, "Scripts");
35
- const tsPath = path.join(directory, "ts");
36
- let location;
37
- if (fs.existsSync(scriptsPath)) {
38
- location = {
39
- _kind: "PackageLocation",
40
- path: directory,
41
- scriptsDir: scriptsPath,
42
- manifestDir: scriptsPath
43
- };
44
- } else if (fs.existsSync(tsPath)) {
45
- location = {
46
- _kind: "PackageLocation",
47
- path: directory,
48
- scriptsDir: tsPath,
49
- manifestDir: directory
50
- };
51
- } else {
52
- location = {
53
- _kind: "PackageLocation",
54
- path: directory,
55
- scriptsDir: directory,
56
- manifestDir: directory
57
- };
58
- }
59
- try {
60
- readPackageCreatorManifest(location);
61
- } catch (err) {
62
- if (isErrorENOENT(err)) {
63
- throw new Error(`No _Package.json found in ${location.manifestDir}`);
64
- }
65
- throw err;
66
- }
67
- return location;
68
- };
69
- const readPackageCreatorManifest = location => {
70
- const packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);
71
- const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {
72
- encoding: "utf8"
73
- }));
74
- const result = JSON.parse(packageJson);
75
- return {
76
- ...result,
77
- Scope: result.Scope || result.Package
78
- };
79
- };
80
- const writePackageCreatorManifest = (location, creatorPackage) => {
81
- const packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);
82
- fs.writeFileSync(packageJsonPath, JSON.stringify(creatorPackage, null, "\t") + "\n");
83
- };
84
- const readPackageCreatorIndex = location => {
85
- try {
86
- const indexPath = path.join(location.manifestDir, INDEX_FILE);
87
- const index = stripUtf8Bom(fs.readFileSync(indexPath, {
88
- encoding: "utf8"
89
- }));
90
- return JSON.parse(index);
91
- } catch (err) {
92
- if (isErrorENOENT(err)) {
93
- return undefined;
94
- }
95
- throw err;
96
- }
97
- };
98
- const writePackageCreatorIndex = (location, index) => {
99
- const packageJsonPath = path.join(location.manifestDir, INDEX_FILE);
100
- fs.writeFileSync(packageJsonPath, JSON.stringify(index, null, "\t") + "\n");
101
- };
102
- const readPackageNpmManifest = location => {
103
- try {
104
- return readNpmManifest(location.manifestDir);
105
- } catch (err) {
106
- if (isErrorENOENT(err)) {
107
- return undefined;
108
- }
109
- throw err;
110
- }
111
- };
112
- const writePackageNpmManifest = (location, packageJson) => {
113
- writeNpmManifest(location.manifestDir, packageJson);
114
- };
115
- const readPackageAnimationList = location => {
116
- const directoryContent = fs.readdirSync(location.manifestDir);
117
- const animationPathList = [];
118
- for (const entry of directoryContent) {
119
- if (entry.endsWith(ANIMATION_FILE_SUFFIX)) {
120
- const animationPath = path.join(location.manifestDir, entry);
121
- animationPathList.push(animationPath);
122
- }
123
- }
124
- return animationPathList;
125
- };
126
- const getPackageReleasesDirectory = location => path.join(location.path, "Releases");
127
-
128
- export { INDEX_FILE, PACKAGE_FILE, detectPackage, getPackageReleasesDirectory, parseCreatorPackageName, readPackageAnimationList, readPackageCreatorIndex, readPackageCreatorManifest, readPackageNpmManifest, writePackageCreatorIndex, writePackageCreatorManifest, writePackageNpmManifest };
129
- //# sourceMappingURL=package.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.mjs","sources":["../../src/lib/package.ts"],"sourcesContent":["// Functionality related to working with a single package.\n\nimport * as path from \"path\";\nimport * as fs from \"fs\";\n\nimport { isErrorENOENT } from \"./error\";\nimport { WorkspaceLocation } from \"./workspace\";\nimport { readNpmManifest, writeNpmManifest } from \"./npmPackage\";\nimport { PackageJSON } from \"./packageJSON\";\nimport { stripUtf8Bom } from \"./stripUtf8Bom\";\n\nexport const PACKAGE_FILE = \"_Package.json\";\nexport const INDEX_FILE = \"_Index.json\";\nconst ANIMATION_FILE_SUFFIX = \".animation.json\";\n\n/**\n * Describes the location of a single package.\n *\n * @export\n * @interface PackageLocation\n */\nexport interface PackageLocation {\n\t_kind: \"PackageLocation\";\n\t/**\n\t * Main directory of a package\n\t *\n\t * @type {string}\n\t */\n\tpath: string;\n\t/**\n\t * Directory containing the typescript files\n\t *\n\t * @type {string}\n\t */\n\tscriptsDir: string;\n\t/**\n\t * Diretory containing the _Package.json, _Index.json, package.json and animation.json files\n\t *\n\t * @type {string}\n\t */\n\tmanifestDir: string;\n}\n\nexport interface CreatorPackage {\n\tScope: string;\n\tPackage: string;\n\tRunTime: boolean;\n\tType: \"Interactor\" | \"Mixed\" | \"Core\" | \"Context\" | \"Evaluator\";\n}\n\nexport type CreatorIndex = CreatorIndexEntry[];\n\nexport interface CreatorIndexEntry {\n\tName: string;\n\tDescription?: string;\n\tType: \"Interactor\" | \"Evaluator\";\n\tParameters: CreatorIndexParameter[];\n}\n\nexport interface CreatorIndexParameter {\n\tName: string;\n\tType: CreatorIndexParameterType;\n\tDescription?: string;\n\tDefault?: unknown;\n\tDisplayIndex: number;\n}\n\nexport type CreatorIndexParameterType =\n\t| \"String\"\n\t| \"LengthM\"\n\t| \"Material\"\n\t| \"Boolean\"\n\t| \"Bool\"\n\t| \"ArcDEG\"\n\t| \"Integer\"\n\t| \"Int\"\n\t| \"Float\";\n\nexport const parseCreatorPackageName = (manifest: CreatorPackage) => {\n\tconst [domain, ...subdomainParts] = manifest.Package.split(\".\");\n\treturn {\n\t\tdomain,\n\t\tsubdomain: subdomainParts.join(\".\"),\n\t};\n};\n\nexport interface PackageNpmManifest extends PackageJSON {\n\tig?: {\n\t\tscriptingLibrary?: boolean;\n\t};\n}\n\n/**\n * Detects the package at the given directory.\n *\n * @param {string} directory\n * @returns {PackageLocation}\n */\nexport const detectPackage = (\n\tworkspace: WorkspaceLocation,\n\tdirectory: string,\n): PackageLocation => {\n\tdirectory = path.resolve(workspace.path, directory);\n\n\tconst scriptsPath = path.join(directory, \"Scripts\");\n\tconst tsPath = path.join(directory, \"ts\");\n\n\tlet location: PackageLocation;\n\n\tif (fs.existsSync(scriptsPath)) {\n\t\tlocation = {\n\t\t\t_kind: \"PackageLocation\",\n\t\t\tpath: directory,\n\t\t\tscriptsDir: scriptsPath,\n\t\t\tmanifestDir: scriptsPath,\n\t\t};\n\t} else if (fs.existsSync(tsPath)) {\n\t\tlocation = {\n\t\t\t_kind: \"PackageLocation\",\n\t\t\tpath: directory,\n\t\t\tscriptsDir: tsPath,\n\t\t\tmanifestDir: directory,\n\t\t};\n\t} else {\n\t\tlocation = {\n\t\t\t_kind: \"PackageLocation\",\n\t\t\tpath: directory,\n\t\t\tscriptsDir: directory,\n\t\t\tmanifestDir: directory,\n\t\t};\n\t}\n\n\ttry {\n\t\treadPackageCreatorManifest(location);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\tthrow new Error(\n\t\t\t\t`No _Package.json found in ${location.manifestDir}`,\n\t\t\t);\n\t\t}\n\t\tthrow err;\n\t}\n\n\treturn location;\n};\n\nexport const readPackageCreatorManifest = (\n\tlocation: PackageLocation,\n): CreatorPackage => {\n\tconst packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\n\tconst packageJson = stripUtf8Bom(\n\t\tfs.readFileSync(packageJsonPath, { encoding: \"utf8\" }),\n\t);\n\tconst result: Omit<CreatorPackage, \"Scope\"> & { Scope?: string } =\n\t\tJSON.parse(packageJson);\n\treturn {\n\t\t...result,\n\t\tScope: result.Scope || result.Package,\n\t};\n};\n\nexport const writePackageCreatorManifest = (\n\tlocation: PackageLocation,\n\tcreatorPackage: CreatorPackage,\n) => {\n\tconst packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\n\tfs.writeFileSync(\n\t\tpackageJsonPath,\n\t\tJSON.stringify(creatorPackage, null, \"\\t\") + \"\\n\",\n\t);\n};\n\nexport const readPackageCreatorIndex = (\n\tlocation: PackageLocation,\n): CreatorIndex | undefined => {\n\ttry {\n\t\tconst indexPath = path.join(location.manifestDir, INDEX_FILE);\n\t\tconst index = stripUtf8Bom(\n\t\t\tfs.readFileSync(indexPath, { encoding: \"utf8\" }),\n\t\t);\n\t\treturn JSON.parse(index);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthrow err;\n\t}\n};\n\nexport const writePackageCreatorIndex = (\n\tlocation: PackageLocation,\n\tindex: CreatorIndex,\n) => {\n\tconst packageJsonPath = path.join(location.manifestDir, INDEX_FILE);\n\tfs.writeFileSync(packageJsonPath, JSON.stringify(index, null, \"\\t\") + \"\\n\");\n};\n\nexport const readPackageNpmManifest = (\n\tlocation: PackageLocation,\n): PackageNpmManifest | undefined => {\n\ttry {\n\t\treturn readNpmManifest(location.manifestDir);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthrow err;\n\t}\n};\n\nexport const writePackageNpmManifest = (\n\tlocation: PackageLocation,\n\tpackageJson: PackageNpmManifest,\n) => {\n\twriteNpmManifest(location.manifestDir, packageJson);\n};\n\nexport const readPackageAnimationList = (location: PackageLocation) => {\n\tconst directoryContent = fs.readdirSync(location.manifestDir);\n\tconst animationPathList: string[] = [];\n\n\tfor (const entry of directoryContent) {\n\t\tif (entry.endsWith(ANIMATION_FILE_SUFFIX)) {\n\t\t\tconst animationPath = path.join(location.manifestDir, entry);\n\t\t\tanimationPathList.push(animationPath);\n\t\t}\n\t}\n\n\treturn animationPathList;\n};\n\nexport const getPackageReleasesDirectory = (location: PackageLocation) =>\n\tpath.join(location.path, \"Releases\");\n\nexport const arePackageLocationsEqual = (\n\ta: PackageLocation,\n\tb: PackageLocation,\n) => a.path === b.path;\n"],"names":["PACKAGE_FILE","INDEX_FILE","ANIMATION_FILE_SUFFIX","parseCreatorPackageName","manifest","domain","subdomainParts","Package","split","subdomain","join","detectPackage","workspace","directory","path","resolve","scriptsPath","tsPath","location","fs","existsSync","_kind","scriptsDir","manifestDir","readPackageCreatorManifest","err","isErrorENOENT","Error","packageJsonPath","packageJson","stripUtf8Bom","readFileSync","encoding","result","JSON","parse","Scope","writePackageCreatorManifest","creatorPackage","writeFileSync","stringify","readPackageCreatorIndex","indexPath","index","undefined","writePackageCreatorIndex","readPackageNpmManifest","readNpmManifest","writePackageNpmManifest","writeNpmManifest","readPackageAnimationList","directoryContent","readdirSync","animationPathList","entry","endsWith","animationPath","push","getPackageReleasesDirectory"],"mappings":";;;;;;AAAA;AAWO,MAAMA,YAAY,GAAG,gBAAe;AACpC,MAAMC,UAAU,GAAG,cAAa;AACvC,MAAMC,qBAAqB,GAAG,iBAAiB,CAAA;;AAE/C;AACA;AACA;AACA;AACA;AACA;;AA0DaC,MAAAA,uBAAuB,GAAIC,QAAwB,IAAK;AACpE,EAAA,MAAM,CAACC,MAAM,EAAE,GAAGC,cAAc,CAAC,GAAGF,QAAQ,CAACG,OAAO,CAACC,KAAK,CAAC,GAAG,CAAC,CAAA;EAC/D,OAAO;IACNH,MAAM;AACNI,IAAAA,SAAS,EAAEH,cAAc,CAACI,IAAI,CAAC,GAAG,CAAA;GAClC,CAAA;AACF,EAAC;AAQD;AACA;AACA;AACA;AACA;AACA;MACaC,aAAa,GAAG,CAC5BC,SAA4B,EAC5BC,SAAiB,KACI;EACrBA,SAAS,GAAGC,IAAI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CAACK,WAAW,EAAE+B,KAAK,CAAC,CAAA;AAC5DD,MAAAA,iBAAiB,CAACI,IAAI,CAACD,aAAa,CAAC,CAAA;AACtC,KAAA;AACD,GAAA;AAEA,EAAA,OAAOH,iBAAiB,CAAA;AACzB,EAAC;AAEYK,MAAAA,2BAA2B,GAAIxC,QAAyB,IACpEJ,IAAI,CAACJ,IAAI,CAACQ,QAAQ,CAACJ,IAAI,EAAE,UAAU;;;;"}
@@ -1,174 +0,0 @@
1
- // Stolen from ig.tools.core
2
-
3
- class PackageVersion {
4
- // https://regex101.com/r/90PEY9/1
5
- static fullTextMatcher = /(\d+)(\.(\d+)(\.(\d+)(\.(\d+))?(-([^\.]+)\.(\d+))?)?)?/;
6
- static lineMatcher = /^(\d+)(\.(\d+)(\.(\d+)(\.(\d+))?(-([^\.]+)\.(\d+))?)?)?$/;
7
- static extractFromText(input, description) {
8
- if (input === undefined) {
9
- throw new Error(`Can not parse version from undefined`);
10
- }
11
- const match = input.match(PackageVersion.fullTextMatcher);
12
- if (!match) {
13
- throw new Error(`Could not extract a version from input: ${input}`);
14
- }
15
- return PackageVersion.fromMatch(match, description);
16
- }
17
- static extractFromLine(input, description) {
18
- if (input === undefined) {
19
- throw new Error(`Can not parse version from undefined`);
20
- }
21
- const match = input.match(PackageVersion.lineMatcher);
22
- if (!match) {
23
- throw new Error(`Could not parse version from input: ${input}`);
24
- }
25
- return PackageVersion.fromMatch(match, description);
26
- }
27
- static equals(a, b, checkPrerelease = false) {
28
- if (a.major !== b.major || a.minor !== b.minor || a.patch !== b.patch) {
29
- return false;
30
- }
31
- if (checkPrerelease === false) {
32
- return true;
33
- }
34
- if (a.preRelease === b.preRelease) {
35
- return true;
36
- }
37
- if (a.preRelease === undefined || b.preRelease === undefined) {
38
- return false;
39
- }
40
- return a.preRelease.type === b.preRelease.type && a.preRelease.version === b.preRelease.version;
41
- }
42
- static fromMatch([, major,, minor = "0",, patch = "0",, build,, preReleaseType, preReleaseNumber], description) {
43
- let preRelease = undefined;
44
- let buildNumber = 100;
45
- if (preReleaseType && preReleaseNumber) {
46
- preRelease = {
47
- type: preReleaseType,
48
- version: parseInt(preReleaseNumber)
49
- };
50
- }
51
- if (build) {
52
- buildNumber = Number(build);
53
- } else if (description) {
54
- const descriptionMatch = description.match(/(\d+)\)$/);
55
- if (descriptionMatch) {
56
- buildNumber = parseInt(descriptionMatch[1]);
57
- }
58
- }
59
- return new PackageVersion(parseInt(major), parseInt(minor), parseInt(patch), preRelease, buildNumber);
60
- }
61
- static sort(a, b, ascending = true) {
62
- const createSortResult = (a, b) => ascending ? a - b : b - a;
63
- if (a.major !== b.major) {
64
- return createSortResult(a.major, b.major);
65
- }
66
- if (a.minor !== b.minor) {
67
- return createSortResult(a.minor, b.minor);
68
- }
69
- if (a.patch !== b.patch) {
70
- return createSortResult(a.patch, b.patch);
71
- }
72
- return createSortResult(a.preRelease ? a.preRelease.version : 0, b.preRelease ? b.preRelease.version : 0);
73
- }
74
- static toNumber(version) {
75
- return ((version.major * 1000 + version.minor) * 1000 + version.patch) * 1000 + version.buildNumber;
76
- }
77
- constructor(major, minor, patch, preRelease, buildNumber) {
78
- this.major = major;
79
- this.minor = minor;
80
- this.patch = patch;
81
- this.preRelease = preRelease;
82
- this.buildNumber = buildNumber;
83
- }
84
- isPreRelease() {
85
- return this.preRelease !== undefined;
86
- }
87
- clone() {
88
- return new PackageVersion(this.major, this.minor, this.patch, this.preRelease ? {
89
- ...this.preRelease
90
- } : undefined, this.buildNumber);
91
- }
92
- incrementMajor() {
93
- this.preRelease = undefined;
94
- this.patch = 0;
95
- this.minor = 0;
96
- this.major++;
97
- }
98
- incrementMinor() {
99
- this.preRelease = undefined;
100
- this.patch = 0;
101
- this.minor++;
102
- }
103
- incrementPatch() {
104
- this.preRelease = undefined;
105
- this.patch++;
106
- }
107
- createPreRelease(type) {
108
- if (!this.preRelease) {
109
- this.buildNumber = 1;
110
- } else {
111
- this.buildNumber++;
112
- }
113
- if (this.preRelease && type === this.preRelease.type) {
114
- this.preRelease.version++;
115
- return;
116
- }
117
- this.preRelease = {
118
- version: 0,
119
- type
120
- };
121
- }
122
- createRelease() {
123
- this.preRelease = undefined;
124
- this.buildNumber = 100;
125
- }
126
- toVersionString({
127
- buildNumber
128
- } = {}) {
129
- let version = [this.major, this.minor, this.patch].join(".");
130
- if (buildNumber) {
131
- version += "." + this.buildNumber;
132
- }
133
- if (this.preRelease) {
134
- version += `-${this.preRelease.type}.${this.preRelease.version}`;
135
- }
136
- return version;
137
- }
138
- toDescriptionString(packageName) {
139
- const base = [this.major, this.minor, this.patch].join(".");
140
- const parts = [packageName, base];
141
- if (this.preRelease) {
142
- parts.push(upperCaseFirst(this.preRelease.type));
143
- parts.push(this.preRelease.version);
144
- }
145
- parts.push(`(${base}.${this.buildNumber})`);
146
- return parts.join(" ");
147
- }
148
-
149
- /**
150
- * Determines wether the version is lesser than the input version
151
- *
152
- * @param {PackageVersion} version
153
- * @returns
154
- */
155
- isLesserThan(version) {
156
- return PackageVersion.toNumber(this) < PackageVersion.toNumber(version);
157
- }
158
-
159
- /**
160
- * Determines wether the version is greater than the input version
161
- *
162
- * @param {PackageVersion} version
163
- * @returns
164
- */
165
- isGreaterThan(version) {
166
- return PackageVersion.toNumber(this) > PackageVersion.toNumber(version);
167
- }
168
- }
169
- const upperCaseFirst = input => {
170
- return input.slice(0, 1).toUpperCase() + input.slice(1);
171
- };
172
-
173
- export { PackageVersion };
174
- //# sourceMappingURL=packageVersion.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"packageVersion.mjs","sources":["../../src/lib/packageVersion.ts"],"sourcesContent":["// Stolen from ig.tools.core\n\nexport interface PackageVersionToVersionStringParams {\n\tbuildNumber?: boolean;\n}\n\nexport class PackageVersion {\n\t// https://regex101.com/r/90PEY9/1\n\tpublic static fullTextMatcher =\n\t\t/(\\d+)(\\.(\\d+)(\\.(\\d+)(\\.(\\d+))?(-([^\\.]+)\\.(\\d+))?)?)?/;\n\tpublic static lineMatcher =\n\t\t/^(\\d+)(\\.(\\d+)(\\.(\\d+)(\\.(\\d+))?(-([^\\.]+)\\.(\\d+))?)?)?$/;\n\n\tpublic static extractFromText(input: string, description?: string) {\n\t\tif (input === undefined) {\n\t\t\tthrow new Error(`Can not parse version from undefined`);\n\t\t}\n\n\t\tconst match = input.match(PackageVersion.fullTextMatcher);\n\n\t\tif (!match) {\n\t\t\tthrow new Error(`Could not extract a version from input: ${input}`);\n\t\t}\n\n\t\treturn PackageVersion.fromMatch(match, description);\n\t}\n\n\tpublic static extractFromLine(input: string, description?: string) {\n\t\tif (input === undefined) {\n\t\t\tthrow new Error(`Can not parse version from undefined`);\n\t\t}\n\n\t\tconst match = input.match(PackageVersion.lineMatcher);\n\n\t\tif (!match) {\n\t\t\tthrow new Error(`Could not parse version from input: ${input}`);\n\t\t}\n\n\t\treturn PackageVersion.fromMatch(match, description);\n\t}\n\n\tpublic static equals(\n\t\ta: PackageVersion,\n\t\tb: PackageVersion,\n\t\tcheckPrerelease = false,\n\t) {\n\t\tif (a.major !== b.major || a.minor !== b.minor || a.patch !== b.patch) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (checkPrerelease === false) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (a.preRelease === b.preRelease) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (a.preRelease === undefined || b.preRelease === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\ta.preRelease.type === b.preRelease.type &&\n\t\t\ta.preRelease.version === b.preRelease.version\n\t\t);\n\t}\n\n\tprivate static fromMatch(\n\t\t[\n\t\t\t,\n\t\t\tmajor,\n\t\t\t,\n\t\t\tminor = \"0\",\n\t\t\t,\n\t\t\tpatch = \"0\",\n\t\t\t,\n\t\t\tbuild,\n\t\t\t,\n\t\t\tpreReleaseType,\n\t\t\tpreReleaseNumber,\n\t\t]: RegExpMatchArray,\n\t\tdescription?: string,\n\t) {\n\t\tlet preRelease: PackageVersion[\"preRelease\"] = undefined;\n\t\tlet buildNumber = 100;\n\n\t\tif (preReleaseType && preReleaseNumber) {\n\t\t\tpreRelease = {\n\t\t\t\ttype: preReleaseType,\n\t\t\t\tversion: parseInt(preReleaseNumber),\n\t\t\t};\n\t\t}\n\n\t\tif (build) {\n\t\t\tbuildNumber = Number(build);\n\t\t} else if (description) {\n\t\t\tconst descriptionMatch = description.match(/(\\d+)\\)$/);\n\n\t\t\tif (descriptionMatch) {\n\t\t\t\tbuildNumber = parseInt(descriptionMatch[1]);\n\t\t\t}\n\t\t}\n\n\t\treturn new PackageVersion(\n\t\t\tparseInt(major),\n\t\t\tparseInt(minor),\n\t\t\tparseInt(patch),\n\t\t\tpreRelease,\n\t\t\tbuildNumber,\n\t\t);\n\t}\n\n\tpublic static sort(\n\t\ta: PackageVersion,\n\t\tb: PackageVersion,\n\t\tascending: boolean = true,\n\t) {\n\t\tconst createSortResult = (a: number, b: number) =>\n\t\t\tascending ? a - b : b - a;\n\n\t\tif (a.major !== b.major) {\n\t\t\treturn createSortResult(a.major, b.major);\n\t\t}\n\n\t\tif (a.minor !== b.minor) {\n\t\t\treturn createSortResult(a.minor, b.minor);\n\t\t}\n\n\t\tif (a.patch !== b.patch) {\n\t\t\treturn createSortResult(a.patch, b.patch);\n\t\t}\n\n\t\treturn createSortResult(\n\t\t\ta.preRelease ? a.preRelease.version : 0,\n\t\t\tb.preRelease ? b.preRelease.version : 0,\n\t\t);\n\t}\n\n\tprivate static toNumber(version: PackageVersion) {\n\t\treturn (\n\t\t\t((version.major * 1000 + version.minor) * 1000 + version.patch) *\n\t\t\t\t1000 +\n\t\t\tversion.buildNumber\n\t\t);\n\t}\n\n\tconstructor(\n\t\tpublic major: number,\n\t\tpublic minor: number,\n\t\tpublic patch: number,\n\t\tpublic preRelease: { type: string; version: number } | undefined,\n\t\tpublic buildNumber: number,\n\t) {}\n\n\tpublic isPreRelease() {\n\t\treturn this.preRelease !== undefined;\n\t}\n\n\tpublic clone() {\n\t\treturn new PackageVersion(\n\t\t\tthis.major,\n\t\t\tthis.minor,\n\t\t\tthis.patch,\n\t\t\tthis.preRelease ? { ...this.preRelease } : undefined,\n\t\t\tthis.buildNumber,\n\t\t);\n\t}\n\n\tpublic incrementMajor() {\n\t\tthis.preRelease = undefined;\n\t\tthis.patch = 0;\n\t\tthis.minor = 0;\n\t\tthis.major++;\n\t}\n\n\tpublic incrementMinor() {\n\t\tthis.preRelease = undefined;\n\t\tthis.patch = 0;\n\t\tthis.minor++;\n\t}\n\n\tpublic incrementPatch() {\n\t\tthis.preRelease = undefined;\n\t\tthis.patch++;\n\t}\n\n\tpublic createPreRelease(type: string) {\n\t\tif (!this.preRelease) {\n\t\t\tthis.buildNumber = 1;\n\t\t} else {\n\t\t\tthis.buildNumber++;\n\t\t}\n\n\t\tif (this.preRelease && type === this.preRelease.type) {\n\t\t\tthis.preRelease.version++;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.preRelease = {\n\t\t\tversion: 0,\n\t\t\ttype,\n\t\t};\n\t}\n\n\tpublic createRelease() {\n\t\tthis.preRelease = undefined;\n\t\tthis.buildNumber = 100;\n\t}\n\n\tpublic toVersionString({\n\t\tbuildNumber,\n\t}: PackageVersionToVersionStringParams = {}) {\n\t\tlet version = [this.major, this.minor, this.patch].join(\".\");\n\n\t\tif (buildNumber) {\n\t\t\tversion += \".\" + this.buildNumber;\n\t\t}\n\n\t\tif (this.preRelease) {\n\t\t\tversion += `-${this.preRelease.type}.${this.preRelease.version}`;\n\t\t}\n\n\t\treturn version;\n\t}\n\n\tpublic toDescriptionString(packageName: string) {\n\t\tconst base = [this.major, this.minor, this.patch].join(\".\");\n\t\tconst parts: (number | string)[] = [packageName, base];\n\n\t\tif (this.preRelease) {\n\t\t\tparts.push(upperCaseFirst(this.preRelease.type));\n\t\t\tparts.push(this.preRelease.version);\n\t\t}\n\n\t\tparts.push(`(${base}.${this.buildNumber})`);\n\n\t\treturn parts.join(\" \");\n\t}\n\n\t/**\n\t * Determines wether the version is lesser than the input version\n\t *\n\t * @param {PackageVersion} version\n\t * @returns\n\t */\n\tpublic isLesserThan(version: PackageVersion) {\n\t\treturn PackageVersion.toNumber(this) < PackageVersion.toNumber(version);\n\t}\n\n\t/**\n\t * Determines wether the version is greater than the input version\n\t *\n\t * @param {PackageVersion} version\n\t * @returns\n\t */\n\tpublic isGreaterThan(version: PackageVersion) {\n\t\treturn PackageVersion.toNumber(this) > PackageVersion.toNumber(version);\n\t}\n}\n\nconst upperCaseFirst = (input: string) => {\n\treturn input.slice(0, 1).toUpperCase() + input.slice(1);\n};\n"],"names":["PackageVersion","fullTextMatcher","lineMatcher","extractFromText","input","description","undefined","Error","match","fromMatch","extractFromLine","equals","a","b","checkPrerelease","major","minor","patch","preRelease","type","version","build","preReleaseType","preReleaseNumber","buildNumber","parseInt","Number","descriptionMatch","sort","ascending","createSortResult","toNumber","constructor","isPreRelease","clone","incrementMajor","incrementMinor","incrementPatch","createPreRelease","createRelease","toVersionString","join","toDescriptionString","packageName","base","parts","push","upperCaseFirst","isLesserThan","isGreaterThan","slice","toUpperCase"],"mappings":"AAAA;;AAMO,MAAMA,cAAc,CAAC;AAC3B;EACA,OAAcC,eAAe,GAC5B,wDAAwD,CAAA;EACzD,OAAcC,WAAW,GACxB,0DAA0D,CAAA;AAE3D,EAAA,OAAcC,eAAe,CAACC,KAAa,EAAEC,WAAoB,EAAE;IAClE,IAAID,KAAK,KAAKE,SAAS,EAAE;AACxB,MAAA,MAAM,IAAIC,KAAK,CAAE,CAAA,oCAAA,CAAqC,CAAC,CAAA;AACxD,KAAA;IAEA,MAAMC,KAAK,GAAGJ,KAAK,CAACI,KAAK,CAACR,cAAc,CAACC,eAAe,CAAC,CAAA;IAEzD,IAAI,CAACO,KAAK,EAAE;AACX,MAAA,MAAM,IAAID,KAAK,CAAE,CAA0CH,wCAAAA,EAAAA,KAAM,EAAC,CAAC,CAAA;AACpE,KAAA;AAEA,IAAA,OAAOJ,cAAc,CAACS,SAAS,CAACD,KAAK,EAAEH,WAAW,CAAC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E,CAAGF,CAAAA,EAAAA,IAAK,IAAG,IAAI,CAACpB,WAAY,CAAA,CAAA,CAAE,CAAC,CAAA;AAE3C,IAAA,OAAOqB,KAAK,CAACJ,IAAI,CAAC,GAAG,CAAC,CAAA;AACvB,GAAA;;AAEA;AACD;AACA;AACA;AACA;AACA;EACQO,YAAY,CAAC5B,OAAuB,EAAE;AAC5C,IAAA,OAAOpB,cAAc,CAAC+B,QAAQ,CAAC,IAAI,CAAC,GAAG/B,cAAc,CAAC+B,QAAQ,CAACX,OAAO,CAAC,CAAA;AACxE,GAAA;;AAEA;AACD;AACA;AACA;AACA;AACA;EACQ6B,aAAa,CAAC7B,OAAuB,EAAE;AAC7C,IAAA,OAAOpB,cAAc,CAAC+B,QAAQ,CAAC,IAAI,CAAC,GAAG/B,cAAc,CAAC+B,QAAQ,CAACX,OAAO,CAAC,CAAA;AACxE,GAAA;AACD,CAAA;AAEA,MAAM2B,cAAc,GAAI3C,KAAa,IAAK;AACzC,EAAA,OAAOA,KAAK,CAAC8C,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAACC,WAAW,EAAE,GAAG/C,KAAK,CAAC8C,KAAK,CAAC,CAAC,CAAC,CAAA;AACxD,CAAC;;;;"}
@@ -1,54 +0,0 @@
1
- import { PackageVersion } from './packageVersion.mjs';
2
-
3
- const parseVersionFromString = input => {
4
- if (input === undefined) {
5
- throw new Error(`Can not parse version from undefined`);
6
- }
7
- let match;
8
- let major;
9
- let minor;
10
- let patch;
11
- let build;
12
- let preReleaseType;
13
- let preReleaseNumber;
14
- if (
15
- // first try to find a full match with build number
16
- (match = input.match(/(\d+)\.(\d+)\.(\d+)\.(\d+)(-([^\.]+)\.(\d+))?/)) !== null) {
17
- [, major, minor, patch, build, preReleaseType, preReleaseNumber] = match;
18
- } else if ((match = input.match(/(\d+)\.(\d+)\.(\d+)(-([^\.]+)\.(\d+))?/)) !== null) {
19
- [, major, minor, patch,, preReleaseType, preReleaseNumber] = match;
20
- }
21
- if (match === null) {
22
- throw new Error(`Could not parse version from input: ${input}`);
23
- }
24
- let preRelease = undefined;
25
- let buildNumber = 100;
26
- if (preReleaseType && preReleaseNumber) {
27
- preRelease = {
28
- type: preReleaseType,
29
- version: parseInt(preReleaseNumber)
30
- };
31
- }
32
- if (build) {
33
- buildNumber = Number(build);
34
- } else if (input) {
35
- const descriptionMatch = input.match(/(\d+)\)$/);
36
- if (descriptionMatch) {
37
- buildNumber = parseInt(descriptionMatch[1]);
38
- }
39
- }
40
- return new PackageVersion(parseInt(major), parseInt(minor), parseInt(patch), preRelease, buildNumber);
41
- };
42
-
43
- // 1000001001 -> 1.0.1.1
44
- // 1002017001 -> 1.2.17.1
45
- const parseVersionFromNumericVersion = version => {
46
- const major = Math.floor(version / 1000000000);
47
- const minor = Math.floor(version % 1000000000 / 1000000);
48
- const patch = Math.floor(version % 1000000 / 1000);
49
- const buildNumber = version % 1000;
50
- return new PackageVersion(major, minor, patch, undefined, buildNumber);
51
- };
52
-
53
- export { parseVersionFromNumericVersion, parseVersionFromString };
54
- //# sourceMappingURL=parseVersion.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseVersion.mjs","sources":["../../src/lib/parseVersion.ts"],"sourcesContent":["import { PackageVersion } from \"./packageVersion\";\n\nexport const parseVersionFromString = (input: string) => {\n\tif (input === undefined) {\n\t\tthrow new Error(`Can not parse version from undefined`);\n\t}\n\n\tlet match: RegExpMatchArray | null;\n\n\tlet major!: string;\n\tlet minor!: string;\n\tlet patch!: string;\n\tlet build: string | undefined;\n\tlet preReleaseType: string | undefined;\n\tlet preReleaseNumber: string | undefined;\n\n\tif (\n\t\t// first try to find a full match with build number\n\t\t(match = input.match(\n\t\t\t/(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)(-([^\\.]+)\\.(\\d+))?/,\n\t\t)) !== null\n\t) {\n\t\t[, major, minor, patch, build, preReleaseType, preReleaseNumber] =\n\t\t\tmatch;\n\t} else if (\n\t\t(match = input.match(/(\\d+)\\.(\\d+)\\.(\\d+)(-([^\\.]+)\\.(\\d+))?/)) !== null\n\t) {\n\t\t[, major, minor, patch, , preReleaseType, preReleaseNumber] = match;\n\t}\n\n\tif (match === null) {\n\t\tthrow new Error(`Could not parse version from input: ${input}`);\n\t}\n\n\tlet preRelease: PackageVersion[\"preRelease\"] = undefined;\n\tlet buildNumber = 100;\n\n\tif (preReleaseType && preReleaseNumber) {\n\t\tpreRelease = {\n\t\t\ttype: preReleaseType,\n\t\t\tversion: parseInt(preReleaseNumber),\n\t\t};\n\t}\n\n\tif (build) {\n\t\tbuildNumber = Number(build);\n\t} else if (input) {\n\t\tconst descriptionMatch = input.match(/(\\d+)\\)$/);\n\n\t\tif (descriptionMatch) {\n\t\t\tbuildNumber = parseInt(descriptionMatch[1]);\n\t\t}\n\t}\n\n\treturn new PackageVersion(\n\t\tparseInt(major),\n\t\tparseInt(minor),\n\t\tparseInt(patch),\n\t\tpreRelease,\n\t\tbuildNumber,\n\t);\n};\n\n// 1000001001 -> 1.0.1.1\n// 1002017001 -> 1.2.17.1\nexport const parseVersionFromNumericVersion = (\n\tversion: number,\n): PackageVersion => {\n\tconst major = Math.floor(version / 1000000000);\n\tconst minor = Math.floor((version % 1000000000) / 1000000);\n\tconst patch = Math.floor((version % 1000000) / 1000);\n\tconst buildNumber = version % 1000;\n\n\treturn new PackageVersion(major, minor, patch, undefined, buildNumber);\n};\n"],"names":["parseVersionFromString","input","undefined","Error","match","major","minor","patch","build","preReleaseType","preReleaseNumber","preRelease","buildNumber","type","version","parseInt","Number","descriptionMatch","PackageVersion","parseVersionFromNumericVersion","Math","floor"],"mappings":";;AAEaA,MAAAA,sBAAsB,GAAIC,KAAa,IAAK;EACxD,IAAIA,KAAK,KAAKC,SAAS,EAAE;AACxB,IAAA,MAAM,IAAIC,KAAK,CAAE,CAAA,oCAAA,CAAqC,CAAC,CAAA;AACxD,GAAA;AAEA,EAAA,IAAIC,KAA8B,CAAA;AAElC,EAAA,IAAIC,KAAc,CAAA;A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AAQ,CAACE,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;AAC5C,KAAA;AACD,GAAA;EAEA,OAAO,IAAIC,cAAc,CACxBH,QAAQ,CAACV,KAAK,CAAC,EACfU,QAAQ,CAACT,KAAK,CAAC,EACfS,QAAQ,CAACR,KAAK,CAAC,EACfI,UAAU,EACVC,WAAW,CACX,CAAA;AACF,EAAC;;AAED;AACA;AACaO,MAAAA,8BAA8B,GAC1CL,OAAe,IACK;EACpB,MAAMT,KAAK,GAAGe,IAAI,CAACC,KAAK,CAACP,OAAO,GAAG,UAAU,CAAC,CAAA;EAC9C,MAAMR,KAAK,GAAGc,IAAI,CAACC,KAAK,CAAEP,OAAO,GAAG,UAAU,GAAI,OAAO,CAAC,CAAA;EAC1D,MAAMP,KAAK,GAAGa,IAAI,CAACC,KAAK,CAAEP,OAAO,GAAG,OAAO,GAAI,IAAI,CAAC,CAAA;AACpD,EAAA,MAAMF,WAAW,GAAGE,OAAO,GAAG,IAAI,CAAA;AAElC,EAAA,OAAO,IAAII,cAAc,CAACb,KAAK,EAAEC,KAAK,EAAEC,KAAK,EAAEL,SAAS,EAAEU,WAAW,CAAC,CAAA;AACvE;;;;"}
@@ -1,31 +0,0 @@
1
- import inquirer from 'inquirer';
2
-
3
- const createDefaultPrompter = () => {
4
- return {
5
- confirm: async message => {
6
- const {
7
- confirm
8
- } = await inquirer.prompt([{
9
- type: "confirm",
10
- message,
11
- name: "confirm"
12
- }]);
13
- return confirm;
14
- },
15
- ask: async question => {
16
- const {
17
- answer
18
- } = await inquirer.prompt([{
19
- type: "list",
20
- message: question.message,
21
- name: "answer",
22
- choices: question.options,
23
- default: question.default
24
- }]);
25
- return answer;
26
- }
27
- };
28
- };
29
-
30
- export { createDefaultPrompter };
31
- //# sourceMappingURL=prompter.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompter.mjs","sources":["../../src/lib/prompter.ts"],"sourcesContent":["import inquirer from \"inquirer\";\n\nexport interface PrompterQuestion {\n\tmessage: string;\n\toptions: string[];\n\tdefault?: string;\n}\n\nexport interface Prompter {\n\tconfirm(message: string): Promise<boolean>;\n\n\task(question: PrompterQuestion): Promise<string>;\n}\n\nexport const createDefaultPrompter = (): Prompter => {\n\treturn {\n\t\tconfirm: async (message) => {\n\t\t\tconst { confirm } = await inquirer.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\tmessage,\n\t\t\t\t\tname: \"confirm\",\n\t\t\t\t},\n\t\t\t]);\n\t\t\treturn confirm as boolean;\n\t\t},\n\n\t\task: async (question) => {\n\t\t\tconst { answer } = await inquirer.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: \"list\",\n\t\t\t\t\tmessage: question.message,\n\t\t\t\t\tname: \"answer\",\n\t\t\t\t\tchoices: question.options,\n\t\t\t\t\tdefault: question.default,\n\t\t\t\t},\n\t\t\t]);\n\t\t\treturn answer as string;\n\t\t},\n\t};\n};\n"],"names":["createDefaultPrompter","confirm","message","inquirer","prompt","type","name","ask","question","answer","choices","options","default"],"mappings":";;AAcO,MAAMA,qBAAqB,GAAG,MAAgB;EACpD,OAAO;IACNC,OAAO,EAAE,MAAOC,OAAO,IAAK;MAC3B,MAAM;AAAED,QAAAA,OAAAA;AAAQ,OAAC,GAAG,MAAME,QAAQ,CAACC,MAAM,CAAC,CACzC;AACCC,QAAAA,IAAI,EAAE,SAAS;QACfH,OAAO;AACPI,QAAAA,IAAI,EAAE,SAAA;AACP,OAAC,CACD,CAAC,CAAA;AACF,MAAA,OAAOL,OAAO,CAAA;KACd;IAEDM,GAAG,EAAE,MAAOC,QAAQ,IAAK;MACxB,MAAM;AAAEC,QAAAA,MAAAA;AAAO,OAAC,GAAG,MAAMN,QAAQ,CAACC,MAAM,CAAC,CACxC;AACCC,QAAAA,IAAI,EAAE,MAAM;QACZH,OAAO,EAAEM,QAAQ,CAACN,OAAO;AACzBI,QAAAA,IAAI,EAAE,QAAQ;QACdI,OAAO,EAAEF,QAAQ,CAACG,OAAO;QACzBC,OAAO,EAAEJ,QAAQ,CAACI,OAAAA;AACnB,OAAC,CACD,CAAC,CAAA;AACF,MAAA,OAAOH,MAAM,CAAA;AACd,KAAA;GACA,CAAA;AACF;;;;"}