@intelligentgraphics/ig.gfx.packager 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/build/bin.js +2 -1
  2. package/build/bin.js.map +1 -1
  3. package/build/{build-kkMVBBJL.js → build-C3qEWyu4.js} +1 -1
  4. package/build/{build-kkMVBBJL.js.map → build-C3qEWyu4.js.map} +1 -1
  5. package/build/{build-CMbCj7x-.js → build-C4Q_eL6j.js} +74 -26
  6. package/build/build-C4Q_eL6j.js.map +1 -0
  7. package/build/{cli-Co1DhAmx.js → cli-DRb54rk4.js} +12 -12
  8. package/build/{cli-Co1DhAmx.js.map → cli-DRb54rk4.js.map} +1 -1
  9. package/build/{docs-BkGeoYY2.js → docs-BavUNetY.js} +2 -3
  10. package/build/{docs-BkGeoYY2.js.map → docs-BavUNetY.js.map} +1 -1
  11. package/build/{generateIndex-C_DxQ2R4.js → generateIndex-2UM_uDm9.js} +4 -4
  12. package/build/generateIndex-2UM_uDm9.js.map +1 -0
  13. package/build/{generateParameterType-CdCi5BWM.js → generateParameterType-so7HPAmb.js} +2 -2
  14. package/build/{generateParameterType-CdCi5BWM.js.map → generateParameterType-so7HPAmb.js.map} +1 -1
  15. package/build/package-pKTRlkgE.js +2 -0
  16. package/build/{postinstall-DHTlEmNr.js → postinstall-CUmC5zLp.js} +4 -4
  17. package/build/{postinstall-DHTlEmNr.js.map → postinstall-CUmC5zLp.js.map} +1 -1
  18. package/build/{prompter-DONgUlzS.js → prompter-BNJwlQhM.js} +1 -1
  19. package/build/{prompter-DONgUlzS.js.map → prompter-BNJwlQhM.js.map} +1 -1
  20. package/build/{publish-E5zcQAo0.js → publish-Bd15xplt.js} +8 -9
  21. package/build/{publish-E5zcQAo0.js.map → publish-Bd15xplt.js.map} +1 -1
  22. package/build/{publishNpm-CBT1819u.js → publishNpm-C2uLIAWs.js} +6 -7
  23. package/build/{publishNpm-CBT1819u.js.map → publishNpm-C2uLIAWs.js.map} +1 -1
  24. package/build/publishedPackage-pKTRlkgE.js +2 -0
  25. package/build/{rollup-Csyght27.js → rollup-Ci1pp5NO.js} +3 -4
  26. package/build/{rollup-Csyght27.js.map → rollup-Ci1pp5NO.js.map} +1 -1
  27. package/build/{scripts-CBblHIL1.js → scripts-D5xp5cJY.js} +2 -1
  28. package/build/{scripts-CBblHIL1.js.map → scripts-D5xp5cJY.js.map} +1 -1
  29. package/build/{versionFile-DViDwgCa.js → versionFile-K8Qq2b1u.js} +3 -3
  30. package/build/{versionFile-DViDwgCa.js.map → versionFile-K8Qq2b1u.js.map} +1 -1
  31. package/build/workspace-pKTRlkgE.js +2 -0
  32. package/lib/lib.js +70 -22
  33. package/package.json +7 -5
  34. package/readme.md +7 -0
  35. package/build/build-CMbCj7x-.js.map +0 -1
  36. package/build/generateIndex-C_DxQ2R4.js.map +0 -1
  37. package/build/package-DHx2bvVO.js +0 -1
  38. package/build/publishedPackage-D-KiU0FG.js +0 -1
  39. package/build/workspace-D0XY2EMu.js +0 -1
@@ -1,7 +1,7 @@
1
- import { d as readWorkspaceNpmManifest, f as writeWorkspaceNpmManifest, s as detectWorkspace, t as assetService_exports, v as detectPackage, w as readPackageCreatorManifest, x as parseCreatorPackageName } from "./build-kkMVBBJL.js";
2
- import "./package-DHx2bvVO.js";
3
- import "./workspace-D0XY2EMu.js";
4
- import { t as createDefaultPrompter } from "./prompter-DONgUlzS.js";
1
+ import { d as readWorkspaceNpmManifest, f as writeWorkspaceNpmManifest, s as detectWorkspace, t as assetService_exports, v as detectPackage, w as readPackageCreatorManifest, x as parseCreatorPackageName } from "./build-C3qEWyu4.js";
2
+ import "./package-pKTRlkgE.js";
3
+ import "./workspace-pKTRlkgE.js";
4
+ import { t as createDefaultPrompter } from "./prompter-BNJwlQhM.js";
5
5
  import updateNotifier from "update-notifier";
6
6
  import * as fs from "node:fs";
7
7
  import * as path from "node:path";
@@ -10,7 +10,7 @@ import { fileURLToPath } from "node:url";
10
10
  import * as glob from "glob";
11
11
  //#region src/cli.ts
12
12
  const docsHandler = async (location, declarationFile, outFolder, name) => {
13
- const { generateDocs } = await import("./docs-BkGeoYY2.js");
13
+ const { generateDocs } = await import("./docs-BavUNetY.js");
14
14
  return await generateDocs(location, declarationFile, outFolder, name);
15
15
  };
16
16
  const __filename = fileURLToPath(import.meta.url);
@@ -103,7 +103,7 @@ yargsInstance.command("build [directories...]", "Builds the specified directorie
103
103
  const folders = resolvePackagesFromMaybePatterns(directories, workspace);
104
104
  await preCommandCheck(workspace);
105
105
  if (folders.length === 0) return console.log("No build targets found. Please check wether a folder with the provided name exists and wether it has _Package.json.");
106
- const { buildFolders, buildFoldersWatch } = await import("./build-CMbCj7x-.js");
106
+ const { buildFolders, buildFoldersWatch } = await import("./build-C4Q_eL6j.js");
107
107
  if (watch) {
108
108
  await buildFoldersWatch({
109
109
  ...options,
@@ -226,7 +226,7 @@ yargsInstance.command("publish [directory]", "Publishes the specified directory"
226
226
  password
227
227
  };
228
228
  }
229
- const { releaseFolder } = await import("./publish-E5zcQAo0.js");
229
+ const { releaseFolder } = await import("./publish-Bd15xplt.js");
230
230
  const prompter = createDefaultPrompter();
231
231
  await releaseFolder({
232
232
  ...options,
@@ -344,7 +344,7 @@ yargsInstance.command({
344
344
  handler: async ({ directory, ignore, strictOptional }) => {
345
345
  const workspace = detectWorkspace(process.cwd());
346
346
  await preCommandCheck(workspace);
347
- const { generateIndex } = await import("./generateIndex-C_DxQ2R4.js");
347
+ const { generateIndex } = await import("./generateIndex-2UM_uDm9.js");
348
348
  generateIndex({
349
349
  location: detectPackage(workspace, directory),
350
350
  ignore,
@@ -358,7 +358,7 @@ yargsInstance.command({
358
358
  handler: async ({ directory, name }) => {
359
359
  const workspace = detectWorkspace(process.cwd());
360
360
  await preCommandCheck(workspace);
361
- const { generateParameterType } = await import("./generateParameterType-CdCi5BWM.js");
361
+ const { generateParameterType } = await import("./generateParameterType-so7HPAmb.js");
362
362
  generateParameterType({
363
363
  location: detectPackage(workspace, directory),
364
364
  name
@@ -370,7 +370,7 @@ yargsInstance.command({
370
370
  command: "postinstall",
371
371
  builder: (argv) => argv,
372
372
  handler: async () => {
373
- const { executePostInstall } = await import("./postinstall-DHTlEmNr.js");
373
+ const { executePostInstall } = await import("./postinstall-CUmC5zLp.js");
374
374
  executePostInstall(detectWorkspace(process.cwd()));
375
375
  },
376
376
  describe: "Runs postinstall tasks"
@@ -388,7 +388,7 @@ yargsInstance.command({
388
388
  }),
389
389
  handler: async ({ directory, newVersion, dryRun }) => {
390
390
  const workspace = detectWorkspace(process.cwd());
391
- const { publishToNpm } = await import("./publishNpm-CBT1819u.js");
391
+ const { publishToNpm } = await import("./publishNpm-C2uLIAWs.js");
392
392
  await publishToNpm({
393
393
  workspace,
394
394
  location: detectPackage(workspace, directory),
@@ -402,4 +402,4 @@ yargsInstance.demandCommand().pkgConf("packager").showHelpOnFail(false).version(
402
402
  //#endregion
403
403
  export {};
404
404
 
405
- //# sourceMappingURL=cli-Co1DhAmx.js.map
405
+ //# sourceMappingURL=cli-DRb54rk4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-Co1DhAmx.js","names":["AssetService"],"sources":["../src/cli.ts"],"sourcesContent":["import updateNotifier from \"update-notifier\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport yargs from \"yargs/yargs\";\nimport { fileURLToPath } from \"node:url\";\nimport * as glob from \"glob\";\n\nimport { AssetService } from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nimport {\n\tdetectPackage,\n\ttype PackageLocation,\n\tparseCreatorPackageName,\n\treadPackageCreatorManifest,\n} from \"./lib/package\";\nimport {\n\tdetectWorkspace,\n\treadWorkspaceNpmManifest,\n\ttype WorkspaceLocation,\n\twriteWorkspaceNpmManifest,\n} from \"./lib/workspace\";\nimport type { ReleaseFolderOptions } from \"./commands/publish\";\nimport { createDefaultPrompter } from \"./lib/prompter\";\nimport type { PackageJSON } from \"./lib/packageJSON\";\nimport type { BuildFolderOptions } from \"./lib\";\n\nconst docsHandler: BuildFolderOptions[\"docsHandler\"] = async (\n\tlocation,\n\tdeclarationFile,\n\toutFolder,\n\tname,\n) => {\n\tconst { generateDocs } = await import(\"./lib/docs\");\n\treturn await generateDocs(location, declarationFile, outFolder, name);\n};\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst pjson: PackageJSON = JSON.parse(\n\tfs.readFileSync(path.join(__dirname, \"..\", \"package.json\"), \"utf8\"),\n);\n\nconst captureError = (err: Error) => {\n\tconsole.log(\"\");\n\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconsole.error(err);\n\t} else {\n\t\tconsole.error(\n\t\t\t\"Stopped execution because of the following error: \" + err.message,\n\t\t);\n\t}\n\n\tprocess.exit(1);\n};\n\nconst buildOptions = {\n\toutDir: {\n\t\tdescription: \"Output directory\",\n\t\ttype: \"string\",\n\t\tdefault: \"bin\",\n\t\tcoerce: (input: string | undefined | null) =>\n\t\t\tinput === undefined || input === null\n\t\t\t\t? undefined\n\t\t\t\t: path.resolve(process.cwd(), input),\n\t},\n\tminimize: {\n\t\tdescription: \"Minify output\",\n\t\ttype: \"boolean\",\n\t\tdefault: true,\n\t},\n\tcwd: {\n\t\tdescription: \"Working directory\",\n\t\ttype: \"string\",\n\t\tdefault: process.cwd(),\n\t},\n\tclean: {\n\t\tdescription: \"Empty output dir before compiling\",\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n\tdocs: {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n} as const;\n\nconst preCommandCheck = async (workspaceLocation: WorkspaceLocation) => {\n\tconst executedLocalPackager = __filename.startsWith(workspaceLocation.path);\n\tconst repositoryPackage = readWorkspaceNpmManifest(workspaceLocation);\n\n\tif (\n\t\trepositoryPackage?.dependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t] ||\n\t\trepositoryPackage?.devDependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t]\n\t) {\n\t\tconst parts = [\"Detected locally installed ig.gfx.packager.\"];\n\n\t\tif (executedLocalPackager) {\n\t\t\tparts.push(\n\t\t\t\t'Run \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.',\n\t\t\t);\n\t\t}\n\t\tparts.push(\n\t\t\t'Run \"npm uninstall @intelligentgraphics/ig.gfx.packager\" to remove the local version.',\n\t\t);\n\n\t\tconsole.error(parts.join(\"\\n\"));\n\t\tprocess.exit(1);\n\t}\n\n\tif (executedLocalPackager) {\n\t\tconsole.error(`Detected locally installed ig.gfx.packager.\nRun \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.\nRun \"npm install\" to get rid of the local packager version.`);\n\t\tprocess.exit(1);\n\t}\n\n\tconst notifier = updateNotifier({\n\t\tpkg: pjson,\n\t\tshouldNotifyInNpmScript: true,\n\t\tupdateCheckInterval: 1000 * 60,\n\t});\n\n\tnotifier.notify({\n\t\tisGlobal: true,\n\t\tdefer: true,\n\t});\n\n\tif (repositoryPackage === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Could not load package.json file in current directory\",\n\t\t);\n\t}\n\n\trepositoryPackage.scripts ??= {};\n\trepositoryPackage.scripts.postinstall = \"packager postinstall\";\n\n\twriteWorkspaceNpmManifest(workspaceLocation, repositoryPackage);\n};\n\nconst yargsInstance = yargs(process.argv.slice(2));\n\nconst resolvePackagesFromMaybePatterns = (\n\targs: string[] = [],\n\tworkspace: WorkspaceLocation,\n) => {\n\tconst folders = new Map<string, PackageLocation>();\n\n\tfor (const arg of args) {\n\t\tglob.sync(arg, { cwd: workspace.path, absolute: true }).forEach(\n\t\t\t(folder) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst location = detectPackage(workspace, folder);\n\n\t\t\t\t\tfolders.set(folder, location);\n\t\t\t\t} catch (err) {}\n\t\t\t},\n\t\t);\n\t}\n\n\treturn Array.from(folders.values());\n};\n\nyargsInstance.command(\n\t\"build [directories...]\",\n\t\"Builds the specified directories\",\n\t(argv) =>\n\t\targv.options({\n\t\t\t...buildOptions,\n\t\t\twatch: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t}),\n\tasync ({ directories = [], watch, ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folders = resolvePackagesFromMaybePatterns(\n\t\t\tdirectories as string[],\n\t\t\tworkspace,\n\t\t);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tif (folders.length === 0) {\n\t\t\treturn console.log(\n\t\t\t\t\"No build targets found. Please check wether a folder with the provided name exists and wether it has _Package.json.\",\n\t\t\t);\n\t\t}\n\n\t\tconst { buildFolders, buildFoldersWatch } =\n\t\t\tawait import(\"./commands/build\");\n\n\t\tif (watch) {\n\t\t\tawait buildFoldersWatch({\n\t\t\t\t...options,\n\t\t\t\tpackages: folders,\n\t\t\t\tworkspace,\n\t\t\t\tdocsHandler,\n\t\t\t}).catch(captureError);\n\t\t\treturn;\n\t\t}\n\n\t\tawait buildFolders({\n\t\t\t...options,\n\t\t\tpackages: folders,\n\t\t\tworkspace,\n\t\t\tdocsHandler,\n\t\t}).catch(captureError);\n\t},\n);\n\nyargsInstance.command(\n\t\"publish [directory]\",\n\t\"Publishes the specified directory\",\n\t(argv) =>\n\t\targv.options({\n\t\t\t...buildOptions,\n\t\t\tnoUpload: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Only zip built files and do not upload them\",\n\t\t\t},\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish domain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish subdomain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"The name of the new version\",\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\taddress: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Address\",\n\t\t\t\tdefault: \"localhost\",\n\t\t\t},\n\t\t\tservice: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"IG.Asset.Server url\",\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"User\",\n\t\t\t\tdefault: process.env.IG_GFX_USER,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Password\",\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\n\t\t\t},\n\t\t\tdocs: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Generate typedoc documentation\",\n\t\t\t},\n\t\t\tpushOnly: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t\"Try to upload an existing zip file without building and validating the version number\",\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Path to a license file\",\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t\tskipDependencies: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Skip dependency checks\",\n\t\t\t},\n\t\t}),\n\tasync ({ directory, user, password, service, license, ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folder = detectPackage(workspace, directory as string);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tif (!options.noUpload) {\n\t\t\tif (!service) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t'The IG.Asset.Server url has to either be provided using the option --service or through the \"IG_GFX_ASSET_SERVICE\" environment variable',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!license && (!user || !password)) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (license && !license.endsWith(\".iglic\")) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlet authentication: AssetService.Authentication | undefined;\n\n\t\tif (license) {\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\n\t\t\ttry {\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\n\t\t\t\tauthentication = {\n\t\t\t\t\ttype: \"license\",\n\t\t\t\t\tlicense: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (\n\t\t\t\t\ttypeof err === \"object\" &&\n\t\t\t\t\terr !== null &&\n\t\t\t\t\t\"code\" in err &&\n\t\t\t\t\terr?.code === \"ENOENT\"\n\t\t\t\t) {\n\t\t\t\t\tcaptureError(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Expected to find a license file at path: ${fullLicensePath}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to read license file at path: ${fullLicensePath}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (user && password) {\n\t\t\tconsole.log(\n\t\t\t\t`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`,\n\t\t\t);\n\t\t\tauthentication = {\n\t\t\t\ttype: \"credentials\",\n\t\t\t\tusername: user,\n\t\t\t\tpassword,\n\t\t\t};\n\t\t}\n\n\t\tconst { releaseFolder } = await import(\"./commands/publish\");\n\n\t\tconst prompter = createDefaultPrompter();\n\n\t\tconst fullOptions: ReleaseFolderOptions = {\n\t\t\t...options,\n\t\t\tauthentication,\n\t\t\tservice: service!,\n\t\t\tdirectory: folder,\n\t\t\tbanner: true,\n\t\t\tprompter,\n\t\t\tnewVersion: options.newVersion!,\n\t\t\tworkspace,\n\t\t\tdocsHandler,\n\t\t};\n\n\t\tawait releaseFolder(fullOptions).catch(captureError);\n\t},\n);\n\nyargsInstance.command(\n\t\"testConnection [directory]\",\n\t\"Tests connection to asset service\",\n\t(argv) =>\n\t\targv.options({\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish domain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish subdomain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\taddress: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Address\",\n\t\t\t\tdefault: \"localhost\",\n\t\t\t},\n\t\t\tservice: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"IG.Asset.Server url\",\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"User\",\n\t\t\t\tdefault: process.env.IG_GFX_USER,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Password\",\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Path to a license file\",\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t}),\n\tasync ({\n\t\tuser,\n\t\tpassword,\n\t\tservice,\n\t\tlicense,\n\t\tsubdomain,\n\t\tdomain,\n\t\taddress,\n\t\tdirectory,\n\t}) => {\n\t\tif (!service) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t'The IG.Asset.Server url has to either be provided using the option --service or through the \"IG_GFX_ASSET_SERVICE\" environment variable',\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!license && (!user || !password)) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif (license && !license.endsWith(\".iglic\")) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tlet authentication: AssetService.Authentication | undefined;\n\n\t\tif (license) {\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\n\t\t\ttry {\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\n\t\t\t\tauthentication = {\n\t\t\t\t\ttype: \"license\",\n\t\t\t\t\tlicense: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (\n\t\t\t\t\ttypeof err === \"object\" &&\n\t\t\t\t\terr !== null &&\n\t\t\t\t\t\"code\" in err &&\n\t\t\t\t\terr?.code === \"ENOENT\"\n\t\t\t\t) {\n\t\t\t\t\tcaptureError(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Expected to find a license file at path: ${fullLicensePath}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to read license file at path: ${fullLicensePath}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (user && password) {\n\t\t\tconsole.log(\n\t\t\t\t`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`,\n\t\t\t);\n\t\t\tauthentication = {\n\t\t\t\ttype: \"credentials\",\n\t\t\t\tusername: user,\n\t\t\t\tpassword,\n\t\t\t};\n\t\t}\n\n\t\tif (authentication === undefined) {\n\t\t\tthrow new Error(`Expected authentication to be available`);\n\t\t}\n\n\t\tif (typeof directory === \"string\") {\n\t\t\tconst workspace = detectWorkspace(process.cwd());\n\t\t\tconst folder = detectPackage(workspace, directory as string);\n\t\t\tconst manifest = readPackageCreatorManifest(folder);\n\t\t\tconst parsedName = parseCreatorPackageName(manifest);\n\n\t\t\tif (domain === undefined) {\n\t\t\t\tdomain = parsedName.domain;\n\t\t\t}\n\t\t\tif (subdomain === undefined) {\n\t\t\t\tsubdomain = parsedName.subdomain;\n\t\t\t}\n\t\t}\n\n\t\tif (domain === undefined || subdomain === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t`Expected either domain and subdomain to be provided through options or to be executed for a specific package directory`,\n\t\t\t);\n\t\t}\n\n\t\tconst session = await AssetService.startSession({\n\t\t\turl: service,\n\t\t\taddress,\n\t\t\tdomain,\n\t\t\tsubDomain: subdomain,\n\t\t\tauthentication,\n\t\t});\n\n\t\tawait AssetService.closeSession(session);\n\n\t\tconsole.log(`Asset service session successfully started and closed`);\n\t},\n);\n\nyargsInstance.command({\n\tcommand: \"generateIndex [directory]\",\n\tbuilder: (argv) =>\n\t\targv\n\t\t\t.option(\"ignore\", {\n\t\t\t\ttype: \"array\",\n\t\t\t\tdefault: [],\n\t\t\t\tdescription: \"Files to ignore while generating index\",\n\t\t\t})\n\t\t\t.option(\"strictOptional\", {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Marks non optional parameter object properties as required\",\n\t\t\t}),\n\thandler: async ({ directory, ignore, strictOptional }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { generateIndex } = await import(\"./commands/generateIndex\");\n\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\tgenerateIndex({\n\t\t\tlocation,\n\t\t\tignore: ignore as string[],\n\t\t\tstrictOptional,\n\t\t});\n\t},\n\tdescribe: \"Generates an index file for a package based on typescript types\",\n});\n\nyargsInstance.command({\n\tcommand: \"generateParameterType [directory] [name]\",\n\thandler: async ({ directory, name }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { generateParameterType } =\n\t\t\tawait import(\"./commands/generateParameterType\");\n\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\tgenerateParameterType({\n\t\t\tlocation,\n\t\t\tname,\n\t\t});\n\t},\n\tdescribe: \"Generates a parameter type for an interactor or evaluator\",\n});\n\nyargsInstance.command({\n\tcommand: \"postinstall\",\n\tbuilder: (argv) => argv,\n\thandler: async () => {\n\t\tconst { executePostInstall } = await import(\"./commands/postinstall\");\n\n\t\texecutePostInstall(detectWorkspace(process.cwd()));\n\t},\n\tdescribe: \"Runs postinstall tasks\",\n});\n\nyargsInstance.command({\n\tcommand: \"publishNpm [directory]\",\n\tbuilder: (argv) =>\n\t\targv.options({\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Name of the new version\",\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tdryRun: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t}),\n\thandler: async ({ directory, newVersion, dryRun }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tconst { publishToNpm } = await import(\"./commands/publishNpm\");\n\n\t\tawait publishToNpm({\n\t\t\tworkspace,\n\t\t\tlocation: detectPackage(workspace, directory as string),\n\t\t\tversion: newVersion,\n\t\t\tdryRun,\n\t\t}).catch(captureError);\n\t},\n\tdescribe: \"Publishes the package to npm\",\n});\n\nyargsInstance\n\t.demandCommand()\n\t.pkgConf(\"packager\")\n\t.showHelpOnFail(false)\n\t.version(pjson.version).argv;\n"],"mappings":";;;;;;;;;;;AA0BA,MAAM,cAAiD,OACtD,UACA,iBACA,WACA,SACI;CACJ,MAAM,EAAE,iBAAiB,MAAM,OAAO;AACtC,QAAO,MAAM,aAAa,UAAU,iBAAiB,WAAW,KAAK;;AAGtE,MAAM,aAAa,cAAc,OAAO,KAAK,IAAI;AACjD,MAAM,YAAY,KAAK,QAAQ,WAAW;AAE1C,MAAM,QAAqB,KAAK,MAC/B,GAAG,aAAa,KAAK,KAAK,WAAW,MAAM,eAAe,EAAE,OAAO,CACnE;AAED,MAAM,gBAAgB,QAAe;AACpC,SAAQ,IAAI,GAAG;AAEf,KAAI,QAAQ,IAAI,aAAa,aAC5B,SAAQ,MAAM,IAAI;KAElB,SAAQ,MACP,uDAAuD,IAAI,QAC3D;AAGF,SAAQ,KAAK,EAAE;;AAGhB,MAAM,eAAe;CACpB,QAAQ;EACP,aAAa;EACb,MAAM;EACN,SAAS;EACT,SAAS,UACR,UAAU,KAAA,KAAa,UAAU,OAC9B,KAAA,IACA,KAAK,QAAQ,QAAQ,KAAK,EAAE,MAAM;EACtC;CACD,UAAU;EACT,aAAa;EACb,MAAM;EACN,SAAS;EACT;CACD,KAAK;EACJ,aAAa;EACb,MAAM;EAC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AU,SACT,KAAK,QAAQ;EACZ,YAAY;GACX,MAAM;GACN,aAAa;GACb,SAAS,QAAQ,IAAI;GACrB,UAAU;GACV;EACD,QAAQ,EACP,MAAM,WACN;EACD,CAAC;CACH,SAAS,OAAO,EAAE,WAAW,YAAY,aAAa;EACrD,MAAM,YAAY,gBAAgB,QAAQ,KAAK,CAAC;EAEhD,MAAM,EAAE,iBAAiB,MAAM,OAAO;AAEtC,QAAM,aAAa;GAClB;GACA,UAAU,cAAc,WAAW,UAAoB;GACvD,SAAS;GACT;GACA,CAAC,CAAC,MAAM,aAAa;;CAEvB,UAAU;CACV,CAAC;AAEF,cACE,eAAe,CACf,QAAQ,WAAW,CACnB,eAAe,MAAM,CACrB,QAAQ,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"cli-DRb54rk4.js","names":["AssetService"],"sources":["../src/cli.ts"],"sourcesContent":["import updateNotifier from \"update-notifier\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport yargs from \"yargs/yargs\";\nimport { fileURLToPath } from \"node:url\";\nimport * as glob from \"glob\";\n\nimport { AssetService } from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nimport {\n\tdetectPackage,\n\ttype PackageLocation,\n\tparseCreatorPackageName,\n\treadPackageCreatorManifest,\n} from \"./lib/package\";\nimport {\n\tdetectWorkspace,\n\treadWorkspaceNpmManifest,\n\ttype WorkspaceLocation,\n\twriteWorkspaceNpmManifest,\n} from \"./lib/workspace\";\nimport type { ReleaseFolderOptions } from \"./commands/publish\";\nimport { createDefaultPrompter } from \"./lib/prompter\";\nimport type { PackageJSON } from \"./lib/packageJSON\";\nimport type { BuildFolderOptions } from \"./lib\";\n\nconst docsHandler: BuildFolderOptions[\"docsHandler\"] = async (\n\tlocation,\n\tdeclarationFile,\n\toutFolder,\n\tname,\n) => {\n\tconst { generateDocs } = await import(\"./lib/docs\");\n\treturn await generateDocs(location, declarationFile, outFolder, name);\n};\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst pjson: PackageJSON = JSON.parse(\n\tfs.readFileSync(path.join(__dirname, \"..\", \"package.json\"), \"utf8\"),\n);\n\nconst captureError = (err: Error) => {\n\tconsole.log(\"\");\n\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconsole.error(err);\n\t} else {\n\t\tconsole.error(\n\t\t\t\"Stopped execution because of the following error: \" + err.message,\n\t\t);\n\t}\n\n\tprocess.exit(1);\n};\n\nconst buildOptions = {\n\toutDir: {\n\t\tdescription: \"Output directory\",\n\t\ttype: \"string\",\n\t\tdefault: \"bin\",\n\t\tcoerce: (input: string | undefined | null) =>\n\t\t\tinput === undefined || input === null\n\t\t\t\t? undefined\n\t\t\t\t: path.resolve(process.cwd(), input),\n\t},\n\tminimize: {\n\t\tdescription: \"Minify output\",\n\t\ttype: \"boolean\",\n\t\tdefault: true,\n\t},\n\tcwd: {\n\t\tdescription: \"Working directory\",\n\t\ttype: \"string\",\n\t\tdefault: process.cwd(),\n\t},\n\tclean: {\n\t\tdescription: \"Empty output dir before compiling\",\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n\tdocs: {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n} as const;\n\nconst preCommandCheck = async (workspaceLocation: WorkspaceLocation) => {\n\tconst executedLocalPackager = __filename.startsWith(workspaceLocation.path);\n\tconst repositoryPackage = readWorkspaceNpmManifest(workspaceLocation);\n\n\tif (\n\t\trepositoryPackage?.dependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t] ||\n\t\trepositoryPackage?.devDependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t]\n\t) {\n\t\tconst parts = [\"Detected locally installed ig.gfx.packager.\"];\n\n\t\tif (executedLocalPackager) {\n\t\t\tparts.push(\n\t\t\t\t'Run \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.',\n\t\t\t);\n\t\t}\n\t\tparts.push(\n\t\t\t'Run \"npm uninstall @intelligentgraphics/ig.gfx.packager\" to remove the local version.',\n\t\t);\n\n\t\tconsole.error(parts.join(\"\\n\"));\n\t\tprocess.exit(1);\n\t}\n\n\tif (executedLocalPackager) {\n\t\tconsole.error(`Detected locally installed ig.gfx.packager.\nRun \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.\nRun \"npm install\" to get rid of the local packager version.`);\n\t\tprocess.exit(1);\n\t}\n\n\tconst notifier = updateNotifier({\n\t\tpkg: pjson,\n\t\tshouldNotifyInNpmScript: true,\n\t\tupdateCheckInterval: 1000 * 60,\n\t});\n\n\tnotifier.notify({\n\t\tisGlobal: true,\n\t\tdefer: true,\n\t});\n\n\tif (repositoryPackage === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Could not load package.json file in current directory\",\n\t\t);\n\t}\n\n\trepositoryPackage.scripts ??= {};\n\trepositoryPackage.scripts.postinstall = \"packager postinstall\";\n\n\twriteWorkspaceNpmManifest(workspaceLocation, repositoryPackage);\n};\n\nconst yargsInstance = yargs(process.argv.slice(2));\n\nconst resolvePackagesFromMaybePatterns = (\n\targs: string[] = [],\n\tworkspace: WorkspaceLocation,\n) => {\n\tconst folders = new Map<string, PackageLocation>();\n\n\tfor (const arg of args) {\n\t\tglob.sync(arg, { cwd: workspace.path, absolute: true }).forEach(\n\t\t\t(folder) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst location = detectPackage(workspace, folder);\n\n\t\t\t\t\tfolders.set(folder, location);\n\t\t\t\t} catch (err) {}\n\t\t\t},\n\t\t);\n\t}\n\n\treturn Array.from(folders.values());\n};\n\nyargsInstance.command(\n\t\"build [directories...]\",\n\t\"Builds the specified directories\",\n\t(argv) =>\n\t\targv.options({\n\t\t\t...buildOptions,\n\t\t\twatch: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t}),\n\tasync ({ directories = [], watch, ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folders = resolvePackagesFromMaybePatterns(\n\t\t\tdirectories as string[],\n\t\t\tworkspace,\n\t\t);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tif (folders.length === 0) {\n\t\t\treturn console.log(\n\t\t\t\t\"No build targets found. Please check wether a folder with the provided name exists and wether it has _Package.json.\",\n\t\t\t);\n\t\t}\n\n\t\tconst { buildFolders, buildFoldersWatch } =\n\t\t\tawait import(\"./commands/build\");\n\n\t\tif (watch) {\n\t\t\tawait buildFoldersWatch({\n\t\t\t\t...options,\n\t\t\t\tpackages: folders,\n\t\t\t\tworkspace,\n\t\t\t\tdocsHandler,\n\t\t\t}).catch(captureError);\n\t\t\treturn;\n\t\t}\n\n\t\tawait buildFolders({\n\t\t\t...options,\n\t\t\tpackages: folders,\n\t\t\tworkspace,\n\t\t\tdocsHandler,\n\t\t}).catch(captureError);\n\t},\n);\n\nyargsInstance.command(\n\t\"publish [directory]\",\n\t\"Publishes the specified directory\",\n\t(argv) =>\n\t\targv.options({\n\t\t\t...buildOptions,\n\t\t\tnoUpload: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Only zip built files and do not upload them\",\n\t\t\t},\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish domain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish subdomain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"The name of the new version\",\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\taddress: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Address\",\n\t\t\t\tdefault: \"localhost\",\n\t\t\t},\n\t\t\tservice: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"IG.Asset.Server url\",\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"User\",\n\t\t\t\tdefault: process.env.IG_GFX_USER,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Password\",\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\n\t\t\t},\n\t\t\tdocs: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Generate typedoc documentation\",\n\t\t\t},\n\t\t\tpushOnly: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t\"Try to upload an existing zip file without building and validating the version number\",\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Path to a license file\",\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t\tskipDependencies: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Skip dependency checks\",\n\t\t\t},\n\t\t}),\n\tasync ({ directory, user, password, service, license, ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folder = detectPackage(workspace, directory as string);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tif (!options.noUpload) {\n\t\t\tif (!service) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t'The IG.Asset.Server url has to either be provided using the option --service or through the \"IG_GFX_ASSET_SERVICE\" environment variable',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!license && (!user || !password)) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (license && !license.endsWith(\".iglic\")) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlet authentication: AssetService.Authentication | undefined;\n\n\t\tif (license) {\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\n\t\t\ttry {\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\n\t\t\t\tauthentication = {\n\t\t\t\t\ttype: \"license\",\n\t\t\t\t\tlicense: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (\n\t\t\t\t\ttypeof err === \"object\" &&\n\t\t\t\t\terr !== null &&\n\t\t\t\t\t\"code\" in err &&\n\t\t\t\t\terr?.code === \"ENOENT\"\n\t\t\t\t) {\n\t\t\t\t\tcaptureError(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Expected to find a license file at path: ${fullLicensePath}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to read license file at path: ${fullLicensePath}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (user && password) {\n\t\t\tconsole.log(\n\t\t\t\t`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`,\n\t\t\t);\n\t\t\tauthentication = {\n\t\t\t\ttype: \"credentials\",\n\t\t\t\tusername: user,\n\t\t\t\tpassword,\n\t\t\t};\n\t\t}\n\n\t\tconst { releaseFolder } = await import(\"./commands/publish\");\n\n\t\tconst prompter = createDefaultPrompter();\n\n\t\tconst fullOptions: ReleaseFolderOptions = {\n\t\t\t...options,\n\t\t\tauthentication,\n\t\t\tservice: service!,\n\t\t\tdirectory: folder,\n\t\t\tbanner: true,\n\t\t\tprompter,\n\t\t\tnewVersion: options.newVersion!,\n\t\t\tworkspace,\n\t\t\tdocsHandler,\n\t\t};\n\n\t\tawait releaseFolder(fullOptions).catch(captureError);\n\t},\n);\n\nyargsInstance.command(\n\t\"testConnection [directory]\",\n\t\"Tests connection to asset service\",\n\t(argv) =>\n\t\targv.options({\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish domain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish subdomain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\taddress: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Address\",\n\t\t\t\tdefault: \"localhost\",\n\t\t\t},\n\t\t\tservice: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"IG.Asset.Server url\",\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"User\",\n\t\t\t\tdefault: process.env.IG_GFX_USER,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Password\",\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Path to a license file\",\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t}),\n\tasync ({\n\t\tuser,\n\t\tpassword,\n\t\tservice,\n\t\tlicense,\n\t\tsubdomain,\n\t\tdomain,\n\t\taddress,\n\t\tdirectory,\n\t}) => {\n\t\tif (!service) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t'The IG.Asset.Server url has to either be provided using the option --service or through the \"IG_GFX_ASSET_SERVICE\" environment variable',\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!license && (!user || !password)) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif (license && !license.endsWith(\".iglic\")) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tlet authentication: AssetService.Authentication | undefined;\n\n\t\tif (license) {\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\n\t\t\ttry {\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\n\t\t\t\tauthentication = {\n\t\t\t\t\ttype: \"license\",\n\t\t\t\t\tlicense: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (\n\t\t\t\t\ttypeof err === \"object\" &&\n\t\t\t\t\terr !== null &&\n\t\t\t\t\t\"code\" in err &&\n\t\t\t\t\terr?.code === \"ENOENT\"\n\t\t\t\t) {\n\t\t\t\t\tcaptureError(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Expected to find a license file at path: ${fullLicensePath}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to read license file at path: ${fullLicensePath}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (user && password) {\n\t\t\tconsole.log(\n\t\t\t\t`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`,\n\t\t\t);\n\t\t\tauthentication = {\n\t\t\t\ttype: \"credentials\",\n\t\t\t\tusername: user,\n\t\t\t\tpassword,\n\t\t\t};\n\t\t}\n\n\t\tif (authentication === undefined) {\n\t\t\tthrow new Error(`Expected authentication to be available`);\n\t\t}\n\n\t\tif (typeof directory === \"string\") {\n\t\t\tconst workspace = detectWorkspace(process.cwd());\n\t\t\tconst folder = detectPackage(workspace, directory as string);\n\t\t\tconst manifest = readPackageCreatorManifest(folder);\n\t\t\tconst parsedName = parseCreatorPackageName(manifest);\n\n\t\t\tif (domain === undefined) {\n\t\t\t\tdomain = parsedName.domain;\n\t\t\t}\n\t\t\tif (subdomain === undefined) {\n\t\t\t\tsubdomain = parsedName.subdomain;\n\t\t\t}\n\t\t}\n\n\t\tif (domain === undefined || subdomain === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t`Expected either domain and subdomain to be provided through options or to be executed for a specific package directory`,\n\t\t\t);\n\t\t}\n\n\t\tconst session = await AssetService.startSession({\n\t\t\turl: service,\n\t\t\taddress,\n\t\t\tdomain,\n\t\t\tsubDomain: subdomain,\n\t\t\tauthentication,\n\t\t});\n\n\t\tawait AssetService.closeSession(session);\n\n\t\tconsole.log(`Asset service session successfully started and closed`);\n\t},\n);\n\nyargsInstance.command({\n\tcommand: \"generateIndex [directory]\",\n\tbuilder: (argv) =>\n\t\targv\n\t\t\t.option(\"ignore\", {\n\t\t\t\ttype: \"array\",\n\t\t\t\tdefault: [],\n\t\t\t\tdescription: \"Files to ignore while generating index\",\n\t\t\t})\n\t\t\t.option(\"strictOptional\", {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Marks non optional parameter object properties as required\",\n\t\t\t}),\n\thandler: async ({ directory, ignore, strictOptional }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { generateIndex } = await import(\"./commands/generateIndex\");\n\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\tgenerateIndex({\n\t\t\tlocation,\n\t\t\tignore: ignore as string[],\n\t\t\tstrictOptional,\n\t\t});\n\t},\n\tdescribe: \"Generates an index file for a package based on typescript types\",\n});\n\nyargsInstance.command({\n\tcommand: \"generateParameterType [directory] [name]\",\n\thandler: async ({ directory, name }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { generateParameterType } =\n\t\t\tawait import(\"./commands/generateParameterType\");\n\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\tgenerateParameterType({\n\t\t\tlocation,\n\t\t\tname,\n\t\t});\n\t},\n\tdescribe: \"Generates a parameter type for an interactor or evaluator\",\n});\n\nyargsInstance.command({\n\tcommand: \"postinstall\",\n\tbuilder: (argv) => argv,\n\thandler: async () => {\n\t\tconst { executePostInstall } = await import(\"./commands/postinstall\");\n\n\t\texecutePostInstall(detectWorkspace(process.cwd()));\n\t},\n\tdescribe: \"Runs postinstall tasks\",\n});\n\nyargsInstance.command({\n\tcommand: \"publishNpm [directory]\",\n\tbuilder: (argv) =>\n\t\targv.options({\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Name of the new version\",\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tdryRun: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t}),\n\thandler: async ({ directory, newVersion, dryRun }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tconst { publishToNpm } = await import(\"./commands/publishNpm\");\n\n\t\tawait publishToNpm({\n\t\t\tworkspace,\n\t\t\tlocation: detectPackage(workspace, directory as string),\n\t\t\tversion: newVersion,\n\t\t\tdryRun,\n\t\t}).catch(captureError);\n\t},\n\tdescribe: \"Publishes the package to npm\",\n});\n\nyargsInstance\n\t.demandCommand()\n\t.pkgConf(\"packager\")\n\t.showHelpOnFail(false)\n\t.version(pjson.version).argv;\n"],"mappings":";;;;;;;;;;;AA0BA,MAAM,cAAiD,OACtD,UACA,iBACA,WACA,SACI;CACJ,MAAM,EAAE,iBAAiB,MAAM,OAAO;CACtC,OAAO,MAAM,aAAa,UAAU,iBAAiB,WAAW,IAAI;AACrE;AAEA,MAAM,aAAa,cAAc,OAAO,KAAK,GAAG;AAChD,MAAM,YAAY,KAAK,QAAQ,UAAU;AAEzC,MAAM,QAAqB,KAAK,MAC/B,GAAG,aAAa,KAAK,KAAK,WAAW,MAAM,cAAc,GAAG,MAAM,CACnE;AAEA,MAAM,gBAAgB,QAAe;CACpC,QAAQ,IAAI,EAAE;CAEd,IAAI,QAAQ,IAAI,aAAa,cAC5B,QAAQ,MAAM,GAAG;MAEjB,QAAQ,MACP,uDAAuD,IAAI,OAC5D;CAGD,QAAQ,KAAK,CAAC;AACf;AAEA,MAAM,eAAe;CACpB,QAAQ;EACP,aAAa;EACb,MAAM;EACN,SAAS;EACT,SAAS,UACR,UAAU,KAAA,KAAa,UAAU,OAC9B,KAAA,IACA,KAAK,QAAQ,QAAQ,IAAI,GAAG,KAAK;CACtC;CACA,UAAU;EACT,aAAa;EACb,MAAM;EACN,SAAS;CACV;CACA,KAAK;EACJ,aAAa;EACb,MAAM;EACN,SAAS,QAAQ,IAAI;CACtB;CACA,OAAO;EACN,aAAa;EACb,MAAM;EACN,SAAS;CACV;CACA,MAAM;EACL,MAAM;EACN,SAAS;CACV;AACD;AAEA,MAAM,kBAAkB,OAAO,sBAAyC;CACvE,MAAM,wBAAwB,WAAW,WAAW,kBAAkB,IAAI;CAC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,QAAQ,IAAI;GACrB,UAAU;EACX;EACA,QAAQ,EACP,MAAM,UACP;CACD,CAAC;CACF,SAAS,OAAO,EAAE,WAAW,YAAY,aAAa;EACrD,MAAM,YAAY,gBAAgB,QAAQ,IAAI,CAAC;EAE/C,MAAM,EAAE,iBAAiB,MAAM,OAAO;EAEtC,MAAM,aAAa;GAClB;GACA,UAAU,cAAc,WAAW,SAAmB;GACtD,SAAS;GACT;EACD,CAAC,EAAE,MAAM,YAAY;CACtB;CACA,UAAU;AACX,CAAC;AAED,cACE,cAAc,EACd,QAAQ,UAAU,EAClB,eAAe,KAAK,EACpB,QAAQ,MAAM,OAAO,EAAE"}
@@ -1,5 +1,4 @@
1
- import "./build-kkMVBBJL.js";
2
- import "./package-DHx2bvVO.js";
1
+ import "./package-pKTRlkgE.js";
3
2
  import * as path from "node:path";
4
3
  import * as glob from "glob";
5
4
  import ts from "typescript";
@@ -27,4 +26,4 @@ async function generateDocs(location, declarationFile, outFolder, name) {
27
26
  //#endregion
28
27
  export { generateDocs };
29
28
 
30
- //# sourceMappingURL=docs-BkGeoYY2.js.map
29
+ //# sourceMappingURL=docs-BavUNetY.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs-BkGeoYY2.js","names":[],"sources":["../src/lib/docs.ts"],"sourcesContent":["import * as typedoc from \"typedoc\";\nimport * as glob from \"glob\";\nimport ts from \"typescript\";\nimport * as path from \"node:path\";\n\nimport { type PackageLocation } from \"./package\";\n\nexport async function generateDocs(\n\tlocation: PackageLocation,\n\tdeclarationFile: string,\n\toutFolder: string,\n\tname: string,\n) {\n\tconst mediaDir = path.join(location.manifestDir, \"Media\");\n\n\tconst app = await typedoc.Application.bootstrap({\n\t\tentryPoints: [\n\t\t\tpath\n\t\t\t\t.relative(process.cwd(), declarationFile)\n\t\t\t\t.split(path.sep)\n\t\t\t\t.join(\"/\"),\n\t\t],\n\t\tout: outFolder,\n\t\ttsconfig: path.join(location.scriptsDir, \"tsconfig.json\"),\n\t\tskipErrorChecking: true,\n\t\tbasePath: mediaDir,\n\t});\n\n\tapp.options.setCompilerOptions(\n\t\t[declarationFile],\n\t\t{\n\t\t\ttarget: ts.ScriptTarget.ES5,\n\t\t},\n\t\tundefined,\n\t);\n\n\tapp.options.setValue(\"name\", name);\n\n\tconst [readmePath] = glob.sync(\"**/readme.md\", {\n\t\tabsolute: true,\n\t\tcwd: location.manifestDir,\n\t});\n\n\tif (readmePath) {\n\t\tapp.options.setValue(\"readme\", readmePath);\n\t}\n\n\tconst project = await app.convert();\n\n\tif (project) {\n\t\tawait app.generateDocs(project, outFolder);\n\t}\n}\n"],"mappings":";;;;;;;AAOA,eAAsB,aACrB,UACA,iBACA,WACA,MACC;CACD,MAAM,WAAW,KAAK,KAAK,SAAS,aAAa,QAAQ;CAEzD,MAAM,MAAM,MAAM,QAAQ,YAAY,UAAU;EAC/C,aAAa,CACZ,KACE,SAAS,QAAQ,KAAK,EAAE,gBAAgB,CACxC,MAAM,KAAK,IAAI,CACf,KAAK,IAAI,CACX;EACD,KAAK;EACL,UAAU,KAAK,KAAK,SAAS,YAAY,gBAAgB;EACzD,mBAAmB;EACnB,UAAU;EACV,CAAC;AAEF,KAAI,QAAQ,mBACX,CAAC,gBAAgB,EACjB,EACC,QAAQ,GAAG,aAAa,KACxB,EACD,KAAA,EACA;AAED,KAAI,QAAQ,SAAS,QAAQ,KAAK;CAElC,MAAM,CAAC,cAAc,KAAK,KAAK,gBAAgB;EAC9C,UAAU;EACV,KAAK,SAAS;EACd,CAAC;AAEF,KAAI,WACH,KAAI,QAAQ,SAAS,UAAU,WAAW;CAG3C,MAAM,UAAU,MAAM,IAAI,SAAS;AAEnC,KAAI,QACH,OAAM,IAAI,aAAa,SAAS,UAAU"}
1
+ {"version":3,"file":"docs-BavUNetY.js","names":[],"sources":["../src/lib/docs.ts"],"sourcesContent":["import * as typedoc from \"typedoc\";\nimport * as glob from \"glob\";\nimport ts from \"typescript\";\nimport * as path from \"node:path\";\n\nimport { type PackageLocation } from \"./package\";\n\nexport async function generateDocs(\n\tlocation: PackageLocation,\n\tdeclarationFile: string,\n\toutFolder: string,\n\tname: string,\n) {\n\tconst mediaDir = path.join(location.manifestDir, \"Media\");\n\n\tconst app = await typedoc.Application.bootstrap({\n\t\tentryPoints: [\n\t\t\tpath\n\t\t\t\t.relative(process.cwd(), declarationFile)\n\t\t\t\t.split(path.sep)\n\t\t\t\t.join(\"/\"),\n\t\t],\n\t\tout: outFolder,\n\t\ttsconfig: path.join(location.scriptsDir, \"tsconfig.json\"),\n\t\tskipErrorChecking: true,\n\t\tbasePath: mediaDir,\n\t});\n\n\tapp.options.setCompilerOptions(\n\t\t[declarationFile],\n\t\t{\n\t\t\ttarget: ts.ScriptTarget.ES5,\n\t\t},\n\t\tundefined,\n\t);\n\n\tapp.options.setValue(\"name\", name);\n\n\tconst [readmePath] = glob.sync(\"**/readme.md\", {\n\t\tabsolute: true,\n\t\tcwd: location.manifestDir,\n\t});\n\n\tif (readmePath) {\n\t\tapp.options.setValue(\"readme\", readmePath);\n\t}\n\n\tconst project = await app.convert();\n\n\tif (project) {\n\t\tawait app.generateDocs(project, outFolder);\n\t}\n}\n"],"mappings":";;;;;;AAOA,eAAsB,aACrB,UACA,iBACA,WACA,MACC;CACD,MAAM,WAAW,KAAK,KAAK,SAAS,aAAa,OAAO;CAExD,MAAM,MAAM,MAAM,QAAQ,YAAY,UAAU;EAC/C,aAAa,CACZ,KACE,SAAS,QAAQ,IAAI,GAAG,eAAe,EACvC,MAAM,KAAK,GAAG,EACd,KAAK,GAAG,CACX;EACA,KAAK;EACL,UAAU,KAAK,KAAK,SAAS,YAAY,eAAe;EACxD,mBAAmB;EACnB,UAAU;CACX,CAAC;CAED,IAAI,QAAQ,mBACX,CAAC,eAAe,GAChB,EACC,QAAQ,GAAG,aAAa,IACzB,GACA,KAAA,CACD;CAEA,IAAI,QAAQ,SAAS,QAAQ,IAAI;CAEjC,MAAM,CAAC,cAAc,KAAK,KAAK,gBAAgB;EAC9C,UAAU;EACV,KAAK,SAAS;CACf,CAAC;CAED,IAAI,YACH,IAAI,QAAQ,SAAS,UAAU,UAAU;CAG1C,MAAM,UAAU,MAAM,IAAI,QAAQ;CAElC,IAAI,SACH,MAAM,IAAI,aAAa,SAAS,SAAS;AAE3C"}
@@ -1,6 +1,6 @@
1
- import { C as readPackageCreatorIndex, E as writePackageCreatorIndex, n as getPackageTypescriptFiles, w as readPackageCreatorManifest } from "./build-kkMVBBJL.js";
2
- import "./package-DHx2bvVO.js";
3
- import { n as readScriptPackageTSConfig, r as resolveScriptPackageEntryModule } from "./scripts-CBblHIL1.js";
1
+ import { C as readPackageCreatorIndex, E as writePackageCreatorIndex, n as getPackageTypescriptFiles, w as readPackageCreatorManifest } from "./build-C3qEWyu4.js";
2
+ import "./package-pKTRlkgE.js";
3
+ import { n as readScriptPackageTSConfig, r as resolveScriptPackageEntryModule } from "./scripts-D5xp5cJY.js";
4
4
  import ts from "typescript";
5
5
  import { findNamespaceByMemberSourceFile, resolveNamespaceFullName, resolveNamespaces } from "@intelligentgraphics/declarationbundler";
6
6
  //#region src/commands/generateIndex.ts
@@ -206,4 +206,4 @@ const detectScriptingClass = (node) => {
206
206
  //#endregion
207
207
  export { generateIndex };
208
208
 
209
- //# sourceMappingURL=generateIndex-C_DxQ2R4.js.map
209
+ //# sourceMappingURL=generateIndex-2UM_uDm9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateIndex-2UM_uDm9.js","names":["propertySignature"],"sources":["../src/commands/generateIndex.ts"],"sourcesContent":["import ts from \"typescript\";\n\nimport {\n\tresolveNamespaceFullName,\n\tresolveNamespaces,\n\ttype Namespace,\n\tfindNamespaceByMemberSourceFile,\n} from \"@intelligentgraphics/declarationbundler\";\n\nimport {\n\ttype PackageLocation,\n\twritePackageCreatorIndex,\n\treadPackageCreatorIndex,\n\treadPackageCreatorManifest,\n} from \"../lib/package\";\nimport {\n\tgetPackageTypescriptFiles,\n\treadScriptPackageTSConfig,\n\tresolveScriptPackageEntryModule,\n} from \"../lib/scripts\";\nimport type {\n\tCreatorIndexEntry,\n\tCreatorIndexParameter,\n\tCreatorIndexParameterType,\n} from \"../lib/package\";\n\nexport interface GenerateIndexOptions {\n\tignore?: string[];\n\tlocation: PackageLocation;\n\n\t/**\n\t * Marks non optional parameter object properties as required in the generated index\n\t *\n\t * @type {boolean}\n\t */\n\tstrictOptional?: boolean;\n}\n\n/**\n * Extracts and returns script array for _Index.json from a src folder\n *\n * @param folderPath path to a src folder\n */\nexport function generateIndex({\n\tlocation,\n\tignore = [],\n\tstrictOptional,\n}: GenerateIndexOptions) {\n\tconst arr: CreatorIndexEntry[] = [];\n\n\tconst existingIndex = readPackageCreatorIndex(location) ?? [];\n\tconst manifest = readPackageCreatorManifest(location);\n\n\tconst compilerOptions = readScriptPackageTSConfig(location).options;\n\n\tconst isModule =\n\t\tcompilerOptions.module === ts.ModuleKind.ES2015 ||\n\t\tcompilerOptions.module === ts.ModuleKind.ESNext;\n\n\tif (strictOptional === undefined) {\n\t\tstrictOptional =\n\t\t\tcompilerOptions.strict === true ||\n\t\t\tcompilerOptions.strictNullChecks === true;\n\t}\n\n\tconst files = getPackageTypescriptFiles(location).filter(\n\t\t(path) => !ignore.some((suffix) => path.endsWith(suffix)),\n\t);\n\n\tlet program: ts.Program;\n\tlet rootNamespace: Namespace | undefined;\n\n\tif (isModule) {\n\t\tconst entryFilePath = resolveScriptPackageEntryModule(\n\t\t\tlocation,\n\t\t\tmanifest,\n\t\t);\n\n\t\tif (entryFilePath === undefined) {\n\t\t\tthrow new Error(`Could not resolve entry module`);\n\t\t}\n\n\t\tconst host = ts.createCompilerHost({}, true);\n\t\tprogram = ts.createProgram(\n\t\t\t[entryFilePath],\n\t\t\t{ allowJs: true, ...compilerOptions },\n\t\t\thost,\n\t\t);\n\n\t\tconst entryFile = program.getSourceFile(entryFilePath);\n\n\t\tif (entryFile === undefined) {\n\t\t\tthrow new Error(`Failed to find entry module`);\n\t\t}\n\n\t\trootNamespace = resolveNamespaces(\n\t\t\tentryFile,\n\t\t\tprogram,\n\t\t\thost,\n\t\t\tprogram.getTypeChecker(),\n\t\t\tmanifest.Scope ?? manifest.Package,\n\t\t);\n\t} else {\n\t\tprogram = ts.createProgram(files, { allowJs: true });\n\t}\n\n\tconst typeChecker = program.getTypeChecker();\n\n\tfiles.forEach((file) => {\n\t\t// Create a Program to represent the project, then pull out the\n\t\t// source file to parse its AST.\n\t\tconst sourceFile = program.getSourceFile(file);\n\n\t\tif (sourceFile === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst namespace =\n\t\t\trootNamespace === undefined\n\t\t\t\t? undefined\n\t\t\t\t: findNamespaceByMemberSourceFile(rootNamespace, sourceFile);\n\t\t// Loop through the root AST nodes of the file\n\n\t\tfor (const scriptingClass of findScriptingClasses(sourceFile)) {\n\t\t\tif (scriptingClass.node.name === undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Expected ${scriptingClass.type} class to have a name`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet name: string;\n\n\t\t\tif (isModule && namespace !== undefined) {\n\t\t\t\tconst moduleNamespace = resolveNamespaceFullName(namespace);\n\t\t\t\tname = `${moduleNamespace}.${scriptingClass.node.name.text}`;\n\t\t\t} else {\n\t\t\t\tname = typeChecker.getFullyQualifiedName(\n\t\t\t\t\ttypeChecker.getSymbolAtLocation(scriptingClass.node.name)!,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst parameterDeclaration =\n\t\t\t\tgetScriptingClassParameterdeclaration(scriptingClass);\n\n\t\t\tconst parametersType =\n\t\t\t\tparameterDeclaration === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: typeChecker.getTypeAtLocation(parameterDeclaration);\n\n\t\t\tif (parametersType === undefined) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t`Failed to find parameters type declaration for ${scriptingClass.type} ${name}. Skipping parameter list generation`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst existingIndexEntry = existingIndex.find(\n\t\t\t\t(entry) => entry.Name === name,\n\t\t\t);\n\n\t\t\tconst obj: CreatorIndexEntry = {\n\t\t\t\tName: name,\n\t\t\t\tDescription: existingIndexEntry?.Description ?? name,\n\t\t\t\tType:\n\t\t\t\t\tscriptingClass.type === \"evaluator\"\n\t\t\t\t\t\t? \"Evaluator\"\n\t\t\t\t\t\t: \"Interactor\",\n\t\t\t\tParameters: [],\n\t\t\t};\n\n\t\t\tconst rawDocTags = ts.getJSDocTags(scriptingClass.node);\n\n\t\t\tconst dict = getTagDict(rawDocTags);\n\t\t\tif (dict.summary) {\n\t\t\t\tobj.Description = dict.summary;\n\t\t\t} else {\n\t\t\t\tconst comment = typeChecker\n\t\t\t\t\t.getTypeAtLocation(scriptingClass.node)\n\t\t\t\t\t.symbol.getDocumentationComment(typeChecker)\n\t\t\t\t\t.map((comment) => comment.text)\n\t\t\t\t\t.join(\" \");\n\n\t\t\t\tif (comment) {\n\t\t\t\t\tobj.Description = comment;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (parametersType !== undefined) {\n\t\t\t\tobj.Parameters = parseParametersList(\n\t\t\t\t\ttypeChecker.getPropertiesOfType(parametersType),\n\t\t\t\t\tstrictOptional,\n\t\t\t\t);\n\n\t\t\t\tif (\n\t\t\t\t\tobj.Parameters.length === 0 &&\n\t\t\t\t\tparametersType.getStringIndexType() !== undefined\n\t\t\t\t) {\n\t\t\t\t\tobj.Parameters = existingIndexEntry?.Parameters ?? [];\n\t\t\t\t}\n\t\t\t} else if (existingIndexEntry !== undefined) {\n\t\t\t\tobj.Parameters = existingIndexEntry.Parameters;\n\t\t\t}\n\n\t\t\tarr.push(obj);\n\t\t}\n\t});\n\n\tarr.sort((a, b) => a.Name.localeCompare(b.Name));\n\n\twritePackageCreatorIndex(location, arr);\n}\n\nfunction capitalizeFirstLetter(string: string) {\n\treturn string?.charAt(0).toUpperCase() + string?.slice(1);\n}\n\nconst parseDefault = (value: string, type: string) => {\n\tconst uType: CreatorIndexParameterType = capitalizeFirstLetter(\n\t\ttype,\n\t) as CreatorIndexParameterType;\n\tif (value === \"null\") return null;\n\tswitch (uType) {\n\t\tcase \"LengthM\":\n\t\tcase \"ArcDEG\":\n\t\tcase \"Float\":\n\t\t\treturn parseFloat(value);\n\t\tcase \"Integer\":\n\t\tcase \"Int\":\n\t\t\treturn parseInt(value);\n\t\tcase \"Boolean\":\n\t\tcase \"Bool\":\n\t\t\treturn value === \"true\";\n\t\tcase \"Material\":\n\t\tcase \"String\":\n\t\tcase \"Geometry\":\n\t\tdefault:\n\t\t\treturn value.replace(/^\"/, \"\").replace(/\"$/, \"\");\n\t}\n};\n\nconst parseTypeFromName = (\n\tname: string,\n): CreatorIndexParameterType | undefined => {\n\tconst parts = name.split(\".\");\n\tconst identifier = parts[parts.length - 1];\n\n\tswitch (identifier) {\n\t\tcase \"LengthM\":\n\t\tcase \"ArcDEG\":\n\t\tcase \"Float\":\n\t\tcase \"Integer\":\n\t\t\treturn identifier;\n\t\tcase \"GeometryReference\":\n\t\t\treturn \"Geometry\";\n\t\tcase \"MaterialReference\":\n\t\t\treturn \"Material\";\n\t\tcase \"AnimationReference\":\n\t\t\treturn \"Animation\";\n\t\tcase \"InteractorReference\":\n\t\t\treturn \"Interactor\";\n\t\tcase \"EvaluatorReference\":\n\t\t\treturn \"Evaluator\";\n\t\tcase \"String\":\n\t\tcase \"string\":\n\t\t\treturn \"String\";\n\t\tcase \"number\":\n\t\tcase \"Number\":\n\t\t\treturn \"Float\";\n\t\tcase \"boolean\":\n\t\tcase \"Boolean\":\n\t\t\treturn \"Boolean\";\n\t}\n};\n\nconst parseParametersList = (\n\tproperties: ts.Symbol[],\n\tstrictOptional: boolean,\n): CreatorIndexParameter[] => {\n\treturn properties.map((symbol, i) => {\n\t\tconst parameter: CreatorIndexParameter = {\n\t\t\tName: symbol.name,\n\t\t\tDescription: undefined,\n\t\t\tType: \"String\",\n\t\t\tDefault: undefined,\n\t\t\tDisplayIndex: i + 1,\n\t\t};\n\n\t\tif (parameter.Name.length > 45) {\n\t\t\tthrow new Error(`Parameter name length >45 '${parameter.Name}'`);\n\t\t}\n\n\t\tlet declaration: ts.Declaration | undefined =\n\t\t\tsymbol.getDeclarations()?.[0];\n\t\tlet documentationComment = symbol.getDocumentationComment(undefined);\n\n\t\tlet checkLinksSymbol: ts.Symbol | undefined = symbol;\n\n\t\twhile (checkLinksSymbol !== undefined && declaration === undefined) {\n\t\t\tconst links:\n\t\t\t\t| {\n\t\t\t\t\t\tmappedType?: ts.Type;\n\t\t\t\t\t\tsyntheticOrigin?: ts.Symbol;\n\t\t\t\t }\n\t\t\t\t| undefined = (\n\t\t\t\tcheckLinksSymbol as {\n\t\t\t\t\tlinks?: {\n\t\t\t\t\t\tmappedType?: ts.Type;\n\t\t\t\t\t\tsyntheticOrigin?: ts.Symbol;\n\t\t\t\t\t};\n\t\t\t\t} & ts.Symbol\n\t\t\t).links;\n\n\t\t\tif (links?.syntheticOrigin) {\n\t\t\t\tdeclaration = links.syntheticOrigin.getDeclarations()?.[0];\n\n\t\t\t\tif (documentationComment.length === 0) {\n\t\t\t\t\tdocumentationComment =\n\t\t\t\t\t\tlinks.syntheticOrigin.getDocumentationComment(\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcheckLinksSymbol = links.syntheticOrigin;\n\t\t\t}\n\t\t}\n\n\t\tif (declaration !== undefined) {\n\t\t\tconst rawDocTags = ts.getJSDocTags(declaration);\n\n\t\t\tconst dict = getTagDict(rawDocTags);\n\n\t\t\tif (dict.summary) {\n\t\t\t\tparameter.Description = dict.summary;\n\t\t\t} else {\n\t\t\t\tconst comment = documentationComment\n\t\t\t\t\t.map((comment) => comment.text)\n\t\t\t\t\t.join(\" \");\n\n\t\t\t\tif (comment) {\n\t\t\t\t\tparameter.Description = comment;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dict.creatorType) {\n\t\t\t\tparameter.Type = dict.creatorType as CreatorIndexParameterType;\n\t\t\t} else {\n\t\t\t\tconst propertySignature = declaration as ts.PropertySignature;\n\t\t\t\tif (propertySignature.type !== undefined) {\n\t\t\t\t\tconst parsedType = parseTypeFromName(\n\t\t\t\t\t\tpropertySignature.type.getText(),\n\t\t\t\t\t);\n\n\t\t\t\t\tif (parsedType !== undefined) {\n\t\t\t\t\t\tparameter.Type = parsedType;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (dict.default) {\n\t\t\t\tparameter.Default = parseDefault(dict.default, parameter.Type);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tstrictOptional &&\n\t\t\t\tdeclaration.kind === ts.SyntaxKind.PropertySignature\n\t\t\t) {\n\t\t\t\tconst propertySignature = declaration as ts.PropertySignature;\n\t\t\t\tif (propertySignature.questionToken === undefined) {\n\t\t\t\t\tparameter.Required = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parameter;\n\t});\n};\n\ninterface IDocTags {\n\tdefault?: string;\n\tcreatorType?: string;\n\tsummary?: string;\n}\n\nfunction getTagDict(tags: readonly ts.JSDocTag[]): IDocTags {\n\tconst dict: IDocTags = {};\n\n\tfor (const tag of tags) {\n\t\tdict[tag.tagName.text as keyof IDocTags] = tag.comment as string;\n\t}\n\n\treturn dict;\n}\n\nconst getScriptingClassParameterdeclaration = (\n\tscriptingClass: ScriptingClass,\n) => {\n\tfor (const member of scriptingClass.node.members) {\n\t\tif (ts.isMethodDeclaration(member)) {\n\t\t\tfor (let index = 0; index < member.parameters.length; index++) {\n\t\t\t\tconst parameter = member.parameters[index];\n\t\t\t\tif (\n\t\t\t\t\tisScriptingClassParameterDeclaration(\n\t\t\t\t\t\tscriptingClass,\n\t\t\t\t\t\tmember,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (ts.isConstructorDeclaration(member)) {\n\t\t\tfor (let index = 0; index < member.parameters.length; index++) {\n\t\t\t\tconst parameter = member.parameters[index];\n\t\t\t\tif (\n\t\t\t\t\tisScriptingClassParameterDeclaration(\n\t\t\t\t\t\tscriptingClass,\n\t\t\t\t\t\tmember,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst isScriptingClassParameterDeclaration = (\n\tscriptingClass: ScriptingClass,\n\tmemberNode: ts.ClassElement,\n\tparameterIndex: number,\n) => {\n\tif (scriptingClass.type === \"evaluator\") {\n\t\treturn memberNode?.name?.getText() == \"Create\" && parameterIndex === 2;\n\t}\n\tif (scriptingClass.type === \"interactor\") {\n\t\treturn (\n\t\t\tmemberNode.kind === ts.SyntaxKind.Constructor &&\n\t\t\tparameterIndex === 0\n\t\t);\n\t}\n\treturn false;\n};\n\ninterface ScriptingClass {\n\tnode: ts.ClassDeclaration;\n\ttype: \"interactor\" | \"evaluator\";\n}\n\n/**\n * Finds interactors and evaluators within a script file\n *\n * @param {ts.Node} node\n * @return {*}\n */\nfunction* findScriptingClasses(\n\tnode: ts.Node,\n): Generator<ScriptingClass, void, void> {\n\tfor (const child of node.getChildren()) {\n\t\tif (!ts.isClassDeclaration(child)) {\n\t\t\tyield* findScriptingClasses(child);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst scriptingClass = detectScriptingClass(child);\n\n\t\tif (scriptingClass !== undefined) {\n\t\t\tyield scriptingClass;\n\t\t}\n\t}\n}\n\nconst detectScriptingClass = (\n\tnode: ts.ClassDeclaration,\n): ScriptingClass | undefined => {\n\tconst isEvaluator = node.heritageClauses?.some((clause) => {\n\t\tif (\n\t\t\tclause.token !== ts.SyntaxKind.ExtendsKeyword &&\n\t\t\tclause.token !== ts.SyntaxKind.ImplementsKeyword\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn clause.types.some((type) =>\n\t\t\ttype.getText().includes(\"Evaluator\"),\n\t\t);\n\t});\n\n\tif (isEvaluator) {\n\t\treturn {\n\t\t\tnode,\n\t\t\ttype: \"evaluator\",\n\t\t};\n\t}\n\n\tconst isInteractor = node.heritageClauses?.some((clause) => {\n\t\tif (clause.token !== ts.SyntaxKind.ExtendsKeyword) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn clause.types.some((type) =>\n\t\t\ttype.getText().includes(\"Interactor\"),\n\t\t);\n\t});\n\n\tif (isInteractor) {\n\t\treturn {\n\t\t\tnode,\n\t\t\ttype: \"interactor\",\n\t\t};\n\t}\n};\n"],"mappings":";;;;;;;;;;;AA2CA,SAAgB,cAAc,EAC7B,UACA,SAAS,CAAC,GACV,kBACwB;CACxB,MAAM,MAA2B,CAAC;CAElC,MAAM,gBAAgB,wBAAwB,QAAQ,KAAK,CAAC;CAC5D,MAAM,WAAW,2BAA2B,QAAQ;CAEpD,MAAM,kBAAkB,0BAA0B,QAAQ,EAAE;CAE5D,MAAM,WACL,gBAAgB,WAAW,GAAG,WAAW,UACzC,gBAAgB,WAAW,GAAG,WAAW;CAE1C,IAAI,mBAAmB,KAAA,GACtB,iBACC,gBAAgB,WAAW,QAC3B,gBAAgB,qBAAqB;CAGvC,MAAM,QAAQ,0BAA0B,QAAQ,EAAE,QAChD,SAAS,CAAC,OAAO,MAAM,WAAW,KAAK,SAAS,MAAM,CAAC,CACzD;CAEA,IAAI;CACJ,IAAI;CAEJ,IAAI,UAAU;EACb,MAAM,gBAAgB,gCACrB,UACA,QACD;EAEA,IAAI,kBAAkB,KAAA,GACrB,MAAM,IAAI,MAAM,gCAAgC;EAGjD,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,IAAI;EAC3C,UAAU,GAAG,cACZ,CAAC,aAAa,GACd;GAAE,SAAS;GAAM,GAAG;EAAgB,GACpC,IACD;EAEA,MAAM,YAAY,QAAQ,cAAc,aAAa;EAErD,IAAI,cAAc,KAAA,GACjB,MAAM,IAAI,MAAM,6BAA6B;EAG9C,gBAAgB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B,KAAK,QAAQ,EAAE,SAAS,WAAW,CACpC;CACD,CAAC,GAGA,OAAO;EACN;EACA,MAAM;CACP;CAaD,IAVqB,KAAK,iBAAiB,MAAM,WAAW;EAC3D,IAAI,OAAO,UAAU,GAAG,WAAW,gBAClC,OAAO;EAGR,OAAO,OAAO,MAAM,MAAM,SACzB,KAAK,QAAQ,EAAE,SAAS,YAAY,CACrC;CACD,CAAC,GAGA,OAAO;EACN;EACA,MAAM;CACP;AAEF"}
@@ -1,4 +1,4 @@
1
- import { C as readPackageCreatorIndex, w as readPackageCreatorManifest, y as getCreatorIndexParameterPrimaryJSType } from "./build-kkMVBBJL.js";
1
+ import { C as readPackageCreatorIndex, w as readPackageCreatorManifest, y as getCreatorIndexParameterPrimaryJSType } from "./build-C3qEWyu4.js";
2
2
  import * as fs from "node:fs";
3
3
  import * as path from "node:path";
4
4
  import * as os from "node:os";
@@ -43,4 +43,4 @@ const generateParameterType = ({ location, name }) => {
43
43
  //#endregion
44
44
  export { generateParameterType };
45
45
 
46
- //# sourceMappingURL=generateParameterType-CdCi5BWM.js.map
46
+ //# sourceMappingURL=generateParameterType-so7HPAmb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateParameterType-CdCi5BWM.js","names":[],"sources":["../src/commands/generateParameterType.ts"],"sourcesContent":["import ts from \"typescript\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport * as os from \"node:os\";\n\nimport {\n\ttype PackageLocation,\n\tgetCreatorIndexParameterPrimaryJSType,\n\treadPackageCreatorIndex,\n\treadPackageCreatorManifest,\n} from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nexport interface GenerateParameterTypeOptions {\n\tlocation: PackageLocation;\n\tname: string;\n}\n\nexport const generateParameterType = ({\n\tlocation,\n\tname,\n}: GenerateParameterTypeOptions) => {\n\tconst index = readPackageCreatorIndex(location);\n\tconst manifest = readPackageCreatorManifest(location);\n\n\tif (index === undefined) {\n\t\tthrow new Error(`Could not find the _Index.json file`);\n\t}\n\n\tlet qualifiedName = name;\n\tlet className = name;\n\n\tconst scope = manifest.Scope ?? manifest.Package;\n\n\tif (name.startsWith(scope)) {\n\t\tclassName = name.slice(scope.length + 1);\n\t} else {\n\t\tqualifiedName = `${scope}.${name}`;\n\t}\n\n\tconst informations = index.find((item) => item.Name === qualifiedName);\n\n\tif (informations === undefined) {\n\t\tthrow new Error(`Could not find an index entry for ${name}`);\n\t}\n\n\tconst members: ts.TypeElement[] = [];\n\n\tif (informations.Parameters !== undefined) {\n\t\tconst sortedList = informations.Parameters.slice();\n\t\tsortedList.sort((a, b) => a.DisplayIndex - b.DisplayIndex);\n\n\t\tfor (const parameter of sortedList) {\n\t\t\tconst jsType = getCreatorIndexParameterPrimaryJSType(\n\t\t\t\tparameter.Type,\n\t\t\t);\n\n\t\t\tconst type =\n\t\t\t\tjsType === \"string\"\n\t\t\t\t\t? ts.factory.createTypeReferenceNode(\"string\")\n\t\t\t\t\t: ts.factory.createUnionTypeNode([\n\t\t\t\t\t\t\tts.factory.createTypeReferenceNode(jsType),\n\t\t\t\t\t\t\tts.factory.createTypeReferenceNode(\"string\"),\n\t\t\t\t\t\t]);\n\n\t\t\tlet propertySignature = ts.factory.createPropertySignature(\n\t\t\t\tundefined,\n\t\t\t\tparameter.Name,\n\t\t\t\tparameter.Required\n\t\t\t\t\t? undefined\n\t\t\t\t\t: ts.factory.createToken(ts.SyntaxKind.QuestionToken),\n\t\t\t\ttype,\n\t\t\t);\n\n\t\t\tconst jsdocParts: string[] = [];\n\n\t\t\tif (parameter.Description !== undefined) {\n\t\t\t\tjsdocParts.push(parameter.Description, \"\");\n\t\t\t}\n\n\t\t\tjsdocParts.push(`@creatorType ${parameter.Type}`);\n\n\t\t\tif (jsType === \"string\") {\n\t\t\t\tjsdocParts.push(`@default \"${parameter.Default}\"`);\n\t\t\t} else {\n\t\t\t\tjsdocParts.push(`@default ${parameter.Default}`);\n\t\t\t}\n\n\t\t\tconst jsdocContent = jsdocParts\n\t\t\t\t.map((part) => `* ${part}`)\n\t\t\t\t.join(os.EOL + \" \");\n\t\t\tpropertySignature = ts.addSyntheticLeadingComment(\n\t\t\t\tpropertySignature,\n\t\t\t\tts.SyntaxKind.MultiLineCommentTrivia,\n\t\t\t\t`*${os.EOL} ${jsdocContent}${os.EOL} `,\n\t\t\t\ttrue,\n\t\t\t);\n\n\t\t\tmembers.push(propertySignature);\n\t\t}\n\t}\n\n\tconst interfaceName = `${className}Params`;\n\n\tlet interfaceDeclaration = ts.factory.createInterfaceDeclaration(\n\t\tundefined,\n\t\tinterfaceName,\n\t\tundefined,\n\t\tundefined,\n\t\tmembers,\n\t);\n\n\tinterfaceDeclaration = ts.addSyntheticLeadingComment(\n\t\tinterfaceDeclaration,\n\t\tts.SyntaxKind.MultiLineCommentTrivia,\n\t\t`*${os.EOL} * Parameters for the ${className} class${os.EOL} `,\n\t\ttrue,\n\t);\n\n\tconst printer = ts.createPrinter({\n\t\tnewLine:\n\t\t\tos.EOL === \"\\n\"\n\t\t\t\t? ts.NewLineKind.LineFeed\n\t\t\t\t: ts.NewLineKind.CarriageReturnLineFeed,\n\t});\n\tconst content = printer\n\t\t.printNode(\n\t\t\tts.EmitHint.Unspecified,\n\t\t\tinterfaceDeclaration,\n\t\t\tts.createSourceFile(\"index.ts\", \"\", ts.ScriptTarget.Latest),\n\t\t)\n\t\t.replace(/ /g, \"\\t\");\n\n\tconst outFile = path.join(location.scriptsDir, `${interfaceName}.txt`);\n\n\tfs.writeFileSync(\n\t\toutFile,\n\t\t`Generated parameters interface for ${className}. Insert the interface declaration next to the class and use it as the type for the parameters. Afterwards you can delete this file.` +\n\t\t\tos.EOL +\n\t\t\tos.EOL +\n\t\t\tcontent,\n\t);\n};\n"],"mappings":";;;;;;AAiBA,MAAa,yBAAyB,EACrC,UACA,WACmC;CACnC,MAAM,QAAQ,wBAAwB,SAAS;CAC/C,MAAM,WAAW,2BAA2B,SAAS;AAErD,KAAI,UAAU,KAAA,EACb,OAAM,IAAI,MAAM,s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,IAAI,IACpC,KACA;AAED,WAAQ,KAAK,kBAAkB;;;CAIjC,MAAM,gBAAgB,GAAG,UAAU;CAEnC,IAAI,uBAAuB,GAAG,QAAQ,2BACrC,KAAA,GACA,eACA,KAAA,GACA,KAAA,GACA,QACA;AAED,wBAAuB,GAAG,2BACzB,sBACA,GAAG,WAAW,wBACd,IAAI,GAAG,IAAI,wBAAwB,UAAU,QAAQ,GAAG,IAAI,IAC5D,KACA;CAQD,MAAM,UANU,GAAG,cAAc,EAChC,SACC,GAAG,QAAQ,OACR,GAAG,YAAY,WACf,GAAG,YAAY,wBACnB,CAAC,CAEA,UACA,GAAG,SAAS,aACZ,sBACA,GAAG,iBAAiB,YAAY,IAAI,GAAG,aAAa,OAAO,CAC3D,CACA,QAAQ,SAAS,IAAK;CAExB,MAAM,UAAU,KAAK,KAAK,SAAS,YAAY,GAAG,cAAc,MAAM;AAEtE,IAAG,cACF,SACA,sCAAsC,UAAU,wIAC/C,GAAG,MACH,GAAG,MACH,QACD"}
1
+ {"version":3,"file":"generateParameterType-so7HPAmb.js","names":[],"sources":["../src/commands/generateParameterType.ts"],"sourcesContent":["import ts from \"typescript\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport * as os from \"node:os\";\n\nimport {\n\ttype PackageLocation,\n\tgetCreatorIndexParameterPrimaryJSType,\n\treadPackageCreatorIndex,\n\treadPackageCreatorManifest,\n} from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nexport interface GenerateParameterTypeOptions {\n\tlocation: PackageLocation;\n\tname: string;\n}\n\nexport const generateParameterType = ({\n\tlocation,\n\tname,\n}: GenerateParameterTypeOptions) => {\n\tconst index = readPackageCreatorIndex(location);\n\tconst manifest = readPackageCreatorManifest(location);\n\n\tif (index === undefined) {\n\t\tthrow new Error(`Could not find the _Index.json file`);\n\t}\n\n\tlet qualifiedName = name;\n\tlet className = name;\n\n\tconst scope = manifest.Scope ?? manifest.Package;\n\n\tif (name.startsWith(scope)) {\n\t\tclassName = name.slice(scope.length + 1);\n\t} else {\n\t\tqualifiedName = `${scope}.${name}`;\n\t}\n\n\tconst informations = index.find((item) => item.Name === qualifiedName);\n\n\tif (informations === undefined) {\n\t\tthrow new Error(`Could not find an index entry for ${name}`);\n\t}\n\n\tconst members: ts.TypeElement[] = [];\n\n\tif (informations.Parameters !== undefined) {\n\t\tconst sortedList = informations.Parameters.slice();\n\t\tsortedList.sort((a, b) => a.DisplayIndex - b.DisplayIndex);\n\n\t\tfor (const parameter of sortedList) {\n\t\t\tconst jsType = getCreatorIndexParameterPrimaryJSType(\n\t\t\t\tparameter.Type,\n\t\t\t);\n\n\t\t\tconst type =\n\t\t\t\tjsType === \"string\"\n\t\t\t\t\t? ts.factory.createTypeReferenceNode(\"string\")\n\t\t\t\t\t: ts.factory.createUnionTypeNode([\n\t\t\t\t\t\t\tts.factory.createTypeReferenceNode(jsType),\n\t\t\t\t\t\t\tts.factory.createTypeReferenceNode(\"string\"),\n\t\t\t\t\t\t]);\n\n\t\t\tlet propertySignature = ts.factory.createPropertySignature(\n\t\t\t\tundefined,\n\t\t\t\tparameter.Name,\n\t\t\t\tparameter.Required\n\t\t\t\t\t? undefined\n\t\t\t\t\t: ts.factory.createToken(ts.SyntaxKind.QuestionToken),\n\t\t\t\ttype,\n\t\t\t);\n\n\t\t\tconst jsdocParts: string[] = [];\n\n\t\t\tif (parameter.Description !== undefined) {\n\t\t\t\tjsdocParts.push(parameter.Description, \"\");\n\t\t\t}\n\n\t\t\tjsdocParts.push(`@creatorType ${parameter.Type}`);\n\n\t\t\tif (jsType === \"string\") {\n\t\t\t\tjsdocParts.push(`@default \"${parameter.Default}\"`);\n\t\t\t} else {\n\t\t\t\tjsdocParts.push(`@default ${parameter.Default}`);\n\t\t\t}\n\n\t\t\tconst jsdocContent = jsdocParts\n\t\t\t\t.map((part) => `* ${part}`)\n\t\t\t\t.join(os.EOL + \" \");\n\t\t\tpropertySignature = ts.addSyntheticLeadingComment(\n\t\t\t\tpropertySignature,\n\t\t\t\tts.SyntaxKind.MultiLineCommentTrivia,\n\t\t\t\t`*${os.EOL} ${jsdocContent}${os.EOL} `,\n\t\t\t\ttrue,\n\t\t\t);\n\n\t\t\tmembers.push(propertySignature);\n\t\t}\n\t}\n\n\tconst interfaceName = `${className}Params`;\n\n\tlet interfaceDeclaration = ts.factory.createInterfaceDeclaration(\n\t\tundefined,\n\t\tinterfaceName,\n\t\tundefined,\n\t\tundefined,\n\t\tmembers,\n\t);\n\n\tinterfaceDeclaration = ts.addSyntheticLeadingComment(\n\t\tinterfaceDeclaration,\n\t\tts.SyntaxKind.MultiLineCommentTrivia,\n\t\t`*${os.EOL} * Parameters for the ${className} class${os.EOL} `,\n\t\ttrue,\n\t);\n\n\tconst printer = ts.createPrinter({\n\t\tnewLine:\n\t\t\tos.EOL === \"\\n\"\n\t\t\t\t? ts.NewLineKind.LineFeed\n\t\t\t\t: ts.NewLineKind.CarriageReturnLineFeed,\n\t});\n\tconst content = printer\n\t\t.printNode(\n\t\t\tts.EmitHint.Unspecified,\n\t\t\tinterfaceDeclaration,\n\t\t\tts.createSourceFile(\"index.ts\", \"\", ts.ScriptTarget.Latest),\n\t\t)\n\t\t.replace(/ /g, \"\\t\");\n\n\tconst outFile = path.join(location.scriptsDir, `${interfaceName}.txt`);\n\n\tfs.writeFileSync(\n\t\toutFile,\n\t\t`Generated parameters interface for ${className}. Insert the interface declaration next to the class and use it as the type for the parameters. Afterwards you can delete this file.` +\n\t\t\tos.EOL +\n\t\t\tos.EOL +\n\t\t\tcontent,\n\t);\n};\n"],"mappings":";;;;;;AAiBA,MAAa,yBAAyB,EACrC,UACA,WACmC;CACnC,MAAM,QAAQ,wBAAwB,QAAQ;CAC9C,MAAM,WAAW,2BAA2B,QAAQ;CAEpD,IAAI,UAAU,KAAA,GACb,MAAM,IAAI,MAAM,qCAAqC;CAGtD,IAAI,gBAAgB;CACpB,IAAI,YAAY;CAEhB,MAAM,QAAQ,SAAS,SAAS,SAAS;CAEzC,IAAI,KA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,IAAI,uBAAuB,GAAG,QAAQ,2BACrC,KAAA,GACA,eACA,KAAA,GACA,KAAA,GACA,OACD;CAEA,uBAAuB,GAAG,2BACzB,sBACA,GAAG,WAAW,wBACd,IAAI,GAAG,IAAI,wBAAwB,UAAU,QAAQ,GAAG,IAAI,IAC5D,IACD;CAQA,MAAM,UANU,GAAG,cAAc,EAChC,SACC,GAAG,QAAQ,OACR,GAAG,YAAY,WACf,GAAG,YAAY,uBACpB,CACsB,EACpB,UACA,GAAG,SAAS,aACZ,sBACA,GAAG,iBAAiB,YAAY,IAAI,GAAG,aAAa,MAAM,CAC3D,EACC,QAAQ,SAAS,GAAI;CAEvB,MAAM,UAAU,KAAK,KAAK,SAAS,YAAY,GAAG,cAAc,KAAK;CAErE,GAAG,cACF,SACA,sCAAsC,UAAU,wIAC/C,GAAG,MACH,GAAG,MACH,OACF;AACD"}
@@ -0,0 +1,2 @@
1
+ import "./build-C3qEWyu4.js";
2
+ export {};
@@ -1,6 +1,6 @@
1
- import { c as getWorkspaceLibPath, d as readWorkspaceNpmManifest, h as readPublishedPackageNpmManifest, o as determineWorkspaceIGLibraries } from "./build-kkMVBBJL.js";
2
- import "./workspace-D0XY2EMu.js";
3
- import "./publishedPackage-D-KiU0FG.js";
1
+ import { c as getWorkspaceLibPath, d as readWorkspaceNpmManifest, h as readPublishedPackageNpmManifest, o as determineWorkspaceIGLibraries } from "./build-C3qEWyu4.js";
2
+ import "./workspace-pKTRlkgE.js";
3
+ import "./publishedPackage-pKTRlkgE.js";
4
4
  import * as fs from "node:fs";
5
5
  import * as path from "node:path";
6
6
  import * as glob from "glob";
@@ -32,4 +32,4 @@ const executePostInstall = (workspace) => {
32
32
  //#endregion
33
33
  export { executePostInstall };
34
34
 
35
- //# sourceMappingURL=postinstall-DHTlEmNr.js.map
35
+ //# sourceMappingURL=postinstall-CUmC5zLp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"postinstall-DHTlEmNr.js","names":[],"sources":["../src/commands/postinstall.ts"],"sourcesContent":["import * as path from \"node:path\";\nimport * as fs from \"node:fs\";\nimport * as glob from \"glob\";\nimport * as os from \"node:os\";\n\nimport {\n\tgetWorkspaceLibPath,\n\treadWorkspaceNpmManifest,\n\ttype WorkspaceLocation,\n} from \"../lib/workspace\";\nimport { readPublishedPackageNpmManifest } from \"../lib/publishedPackage\";\nimport { determineWorkspaceIGLibraries } from \"../lib/dependencies\";\n\nconst DEFINITION_FILE_HINT =\n\t\"// This file is automatically managed by the ig.gfx.packager.\";\n\nexport const executePostInstall = (workspace: WorkspaceLocation) => {\n\tconst manifest = readWorkspaceNpmManifest(workspace);\n\n\tconst libPath = getWorkspaceLibPath(workspace);\n\n\tfs.mkdirSync(libPath, { recursive: true });\n\n\tconst existingDefinitions = glob.sync(\"**/*.d.ts\", {\n\t\tcwd: libPath,\n\t\tabsolute: true,\n\t});\n\n\t// delete all existing definition files that are managed by the packager.\n\t// we'll recreate all needed definitions in the next step.\n\tfor (const existingDefinitionPath of existingDefinitions) {\n\t\tconst content = fs.readFileSync(existingDefinitionPath, {\n\t\t\tencoding: \"utf-8\",\n\t\t});\n\n\t\tif (content.startsWith(DEFINITION_FILE_HINT)) {\n\t\t\tfs.rmSync(existingDefinitionPath);\n\t\t}\n\t}\n\n\tconst libraryLocations = determineWorkspaceIGLibraries(workspace);\n\n\tfor (const location of libraryLocations) {\n\t\tconst manifest = readPublishedPackageNpmManifest(location);\n\n\t\tfor (const existingDefinitionPath of existingDefinitions) {\n\t\t\tconst basename = path.basename(existingDefinitionPath);\n\n\t\t\tif (basename === manifest.types) {\n\t\t\t\tfs.rmSync(existingDefinitionPath, { force: true });\n\t\t\t}\n\t\t}\n\n\t\t// add a hint to the top of the file so we know it's managed by the packager.\n\n\t\tconst content = [\n\t\t\tDEFINITION_FILE_HINT,\n\t\t\t`// This is a reference to version ${manifest.version}.`,\n\t\t\t`// Run \"npm install\" to install the types if they are missing or not up to date.`,\n\t\t\t`/// <reference types=\"${manifest.name}\" />`,\n\t\t].join(os.EOL);\n\n\t\tfs.writeFileSync(\n\t\t\tpath.join(getWorkspaceLibPath(workspace), manifest.types),\n\t\t\tcontent,\n\t\t\t{\n\t\t\t\tencoding: \"utf8\",\n\t\t\t},\n\t\t);\n\t}\n};\n"],"mappings":";;;;;;;;AAaA,MAAM,uBACL;AAED,MAAa,sBAAsB,cAAiC;AAClD,0BAAyB,UAAU;CAEpD,MAAM,UAAU,oBAAoB,UAAU;AAE9C,IAAG,UAAU,SAAS,EAAE,WAAW,MAAM,CAAC;CAE1C,MAAM,sBAAsB,KAAK,KAAK,aAAa;EAClD,KAAK;EACL,UAAU;EACV,CAAC;AAIF,MAAK,MAAM,0BAA0B,oBAKpC,KAJgB,GAAG,aAAa,wBAAwB,EACvD,UAAU,SACV,CAAC,CAEU,WAAW,qBAAqB,CAC3C,IAAG,OAAO,uBAAuB;CAInC,MAAM,mBAAmB,8BAA8B,UAAU;AAEjE,MAAK,MAAM,YAAY,kBAAkB;EACxC,MAAM,WAAW,gCAAgC,SAAS;AAE1D,OAAK,MAAM,0BAA0B,oBAGpC,KAFiB,KAAK,SAAS,uBAAuB,KAErC,SAAS,MACzB,IAAG,OAAO,wBAAwB,EAAE,OAAO,MAAM,CAAC;EAMpD,MAAM,UAAU;GACf;GACA,qCAAqC,SAAS,QAAQ;GACtD;GACA,yBAAyB,SAAS,KAAK;GACvC,CAAC,KAAK,GAAG,IAAI;AAEd,KAAG,cACF,KAAK,KAAK,oBAAoB,UAAU,EAAE,SAAS,MAAM,EACzD,SACA,EACC,UAAU,QACV,CACD"}
1
+ {"version":3,"file":"postinstall-CUmC5zLp.js","names":[],"sources":["../src/commands/postinstall.ts"],"sourcesContent":["import * as path from \"node:path\";\nimport * as fs from \"node:fs\";\nimport * as glob from \"glob\";\nimport * as os from \"node:os\";\n\nimport {\n\tgetWorkspaceLibPath,\n\treadWorkspaceNpmManifest,\n\ttype WorkspaceLocation,\n} from \"../lib/workspace\";\nimport { readPublishedPackageNpmManifest } from \"../lib/publishedPackage\";\nimport { determineWorkspaceIGLibraries } from \"../lib/dependencies\";\n\nconst DEFINITION_FILE_HINT =\n\t\"// This file is automatically managed by the ig.gfx.packager.\";\n\nexport const executePostInstall = (workspace: WorkspaceLocation) => {\n\tconst manifest = readWorkspaceNpmManifest(workspace);\n\n\tconst libPath = getWorkspaceLibPath(workspace);\n\n\tfs.mkdirSync(libPath, { recursive: true });\n\n\tconst existingDefinitions = glob.sync(\"**/*.d.ts\", {\n\t\tcwd: libPath,\n\t\tabsolute: true,\n\t});\n\n\t// delete all existing definition files that are managed by the packager.\n\t// we'll recreate all needed definitions in the next step.\n\tfor (const existingDefinitionPath of existingDefinitions) {\n\t\tconst content = fs.readFileSync(existingDefinitionPath, {\n\t\t\tencoding: \"utf-8\",\n\t\t});\n\n\t\tif (content.startsWith(DEFINITION_FILE_HINT)) {\n\t\t\tfs.rmSync(existingDefinitionPath);\n\t\t}\n\t}\n\n\tconst libraryLocations = determineWorkspaceIGLibraries(workspace);\n\n\tfor (const location of libraryLocations) {\n\t\tconst manifest = readPublishedPackageNpmManifest(location);\n\n\t\tfor (const existingDefinitionPath of existingDefinitions) {\n\t\t\tconst basename = path.basename(existingDefinitionPath);\n\n\t\t\tif (basename === manifest.types) {\n\t\t\t\tfs.rmSync(existingDefinitionPath, { force: true });\n\t\t\t}\n\t\t}\n\n\t\t// add a hint to the top of the file so we know it's managed by the packager.\n\n\t\tconst content = [\n\t\t\tDEFINITION_FILE_HINT,\n\t\t\t`// This is a reference to version ${manifest.version}.`,\n\t\t\t`// Run \"npm install\" to install the types if they are missing or not up to date.`,\n\t\t\t`/// <reference types=\"${manifest.name}\" />`,\n\t\t].join(os.EOL);\n\n\t\tfs.writeFileSync(\n\t\t\tpath.join(getWorkspaceLibPath(workspace), manifest.types),\n\t\t\tcontent,\n\t\t\t{\n\t\t\t\tencoding: \"utf8\",\n\t\t\t},\n\t\t);\n\t}\n};\n"],"mappings":";;;;;;;;AAaA,MAAM,uBACL;AAED,MAAa,sBAAsB,cAAiC;CAClD,yBAAyB,SAAS;CAEnD,MAAM,UAAU,oBAAoB,SAAS;CAE7C,GAAG,UAAU,SAAS,EAAE,WAAW,KAAK,CAAC;CAEzC,MAAM,sBAAsB,KAAK,KAAK,aAAa;EAClD,KAAK;EACL,UAAU;CACX,CAAC;CAID,KAAK,MAAM,0BAA0B,qBAKpC,IAJgB,GAAG,aAAa,wBAAwB,EACvD,UAAU,QACX,CAEU,EAAE,WAAW,oBAAoB,GAC1C,GAAG,OAAO,sBAAsB;CAIlC,MAAM,mBAAmB,8BAA8B,SAAS;CAEhE,KAAK,MAAM,YAAY,kBAAkB;EACxC,MAAM,WAAW,gCAAgC,QAAQ;EAEzD,KAAK,MAAM,0BAA0B,qBAGpC,IAFiB,KAAK,SAAS,sBAEpB,MAAM,SAAS,OACzB,GAAG,OAAO,wBAAwB,EAAE,OAAO,KAAK,CAAC;EAMnD,MAAM,UAAU;GACf;GACA,qCAAqC,SAAS,QAAQ;GACtD;GACA,yBAAyB,SAAS,KAAK;EACxC,EAAE,KAAK,GAAG,GAAG;EAEb,GAAG,cACF,KAAK,KAAK,oBAAoB,SAAS,GAAG,SAAS,KAAK,GACxD,SACA,EACC,UAAU,OACX,CACD;CACD;AACD"}
@@ -17,4 +17,4 @@ const createDefaultPrompter = () => {
17
17
  //#endregion
18
18
  export { createDefaultPrompter as t };
19
19
 
20
- //# sourceMappingURL=prompter-DONgUlzS.js.map
20
+ //# sourceMappingURL=prompter-BNJwlQhM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompter-DONgUlzS.js","names":[],"sources":["../src/lib/prompter.ts"],"sourcesContent":["import { confirm, select } from \"@inquirer/prompts\";\n\nexport interface PrompterOption {\n\tname: string;\n\tvalue: string;\n}\n\nexport interface PrompterQuestion {\n\tmessage: string;\n\toptions: PrompterOption[];\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 result = await confirm({\n\t\t\t\tmessage,\n\t\t\t});\n\t\t\treturn result;\n\t\t},\n\n\t\task: async (question) => {\n\t\t\tconst answer = await select({\n\t\t\t\tmessage: question.message,\n\t\t\t\tchoices: question.options,\n\t\t\t\tdefault: question.default,\n\t\t\t});\n\t\t\treturn answer;\n\t\t},\n\t};\n};\n"],"mappings":";;AAmBA,MAAa,8BAAwC;AACpD,QAAO;EACN,SAAS,OAAO,YAAY;AAI3B,UAHe,MAAM,QAAQ,EAC5B,SACA,CAAC;;EAIH,KAAK,OAAO,aAAa;AAMxB,UALe,MAAM,OAAO;IAC3B,SAAS,SAAS;IAClB,SAAS,SAAS;IAClB,SAAS,SAAS;IAClB,CAAC;;EAGH"}
1
+ {"version":3,"file":"prompter-BNJwlQhM.js","names":[],"sources":["../src/lib/prompter.ts"],"sourcesContent":["import { confirm, select } from \"@inquirer/prompts\";\n\nexport interface PrompterOption {\n\tname: string;\n\tvalue: string;\n}\n\nexport interface PrompterQuestion {\n\tmessage: string;\n\toptions: PrompterOption[];\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 result = await confirm({\n\t\t\t\tmessage,\n\t\t\t});\n\t\t\treturn result;\n\t\t},\n\n\t\task: async (question) => {\n\t\t\tconst answer = await select({\n\t\t\t\tmessage: question.message,\n\t\t\t\tchoices: question.options,\n\t\t\t\tdefault: question.default,\n\t\t\t});\n\t\t\treturn answer;\n\t\t},\n\t};\n};\n"],"mappings":";;AAmBA,MAAa,8BAAwC;CACpD,OAAO;EACN,SAAS,OAAO,YAAY;GAI3B,OAAO,MAHc,QAAQ,EAC5B,QACD,CAAC;EAEF;EAEA,KAAK,OAAO,aAAa;GAMxB,OAAO,MALc,OAAO;IAC3B,SAAS,SAAS;IAClB,SAAS,SAAS;IAClB,SAAS,SAAS;GACnB,CAAC;EAEF;CACD;AACD"}
@@ -1,11 +1,10 @@
1
- import { A as isErrorENOENT, C as readPackageCreatorIndex, D as writePackageCreatorManifest, S as readPackageAnimationList, _ as PACKAGE_FILE, b as getPackageReleasesDirectory, d as readWorkspaceNpmManifest, g as INDEX_FILE, h as readPublishedPackageNpmManifest, i as createPackageScopedReporter, j as isErrorEPERM, k as isErrorEACCES, l as getWorkspaceOutputPath, m as readPublishedPackageCreatorManifest, o as determineWorkspaceIGLibraries, p as readPublishedPackageCreatorIndex, r as consoleReporter, t as assetService_exports, w as readPackageCreatorManifest, x as parseCreatorPackageName } from "./build-kkMVBBJL.js";
2
- import "./package-DHx2bvVO.js";
3
- import "./workspace-D0XY2EMu.js";
4
- import "./prompter-DONgUlzS.js";
5
- import "./scripts-CBblHIL1.js";
6
- import { buildFolders, t as PackageVersion } from "./build-CMbCj7x-.js";
7
- import "./publishedPackage-D-KiU0FG.js";
8
- import { a as getVersionInformationFromGit, i as getWorkspaceBannerText, n as parseVersionFromNumericVersion, r as parseVersionFromString, t as getVersionFileHandler } from "./versionFile-DViDwgCa.js";
1
+ import { A as isErrorENOENT, C as readPackageCreatorIndex, D as writePackageCreatorManifest, S as readPackageAnimationList, _ as PACKAGE_FILE, b as getPackageReleasesDirectory, d as readWorkspaceNpmManifest, g as INDEX_FILE, h as readPublishedPackageNpmManifest, i as createPackageScopedReporter, j as isErrorEPERM, k as isErrorEACCES, l as getWorkspaceOutputPath, m as readPublishedPackageCreatorManifest, o as determineWorkspaceIGLibraries, p as readPublishedPackageCreatorIndex, r as consoleReporter, t as assetService_exports, w as readPackageCreatorManifest, x as parseCreatorPackageName } from "./build-C3qEWyu4.js";
2
+ import "./package-pKTRlkgE.js";
3
+ import "./workspace-pKTRlkgE.js";
4
+ import "./prompter-BNJwlQhM.js";
5
+ import { buildFolders, t as PackageVersion } from "./build-C4Q_eL6j.js";
6
+ import "./publishedPackage-pKTRlkgE.js";
7
+ import { a as getVersionInformationFromGit, i as getWorkspaceBannerText, n as parseVersionFromNumericVersion, r as parseVersionFromString, t as getVersionFileHandler } from "./versionFile-K8Qq2b1u.js";
9
8
  import * as fs$1 from "node:fs";
10
9
  import { createReadStream, createWriteStream } from "node:fs";
11
10
  import * as path from "node:path";
@@ -345,4 +344,4 @@ const releaseFolder = async (options) => {
345
344
  //#endregion
346
345
  export { releaseFolder };
347
346
 
348
- //# sourceMappingURL=publish-E5zcQAo0.js.map
347
+ //# sourceMappingURL=publish-Bd15xplt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"publish-E5zcQAo0.js","names":["fs","AssetService","AssetService","AssetService"],"sources":["../src/commands/publish/zip.ts","../src/lib/assetServiceSessionManager.ts","../src/lib/dependencySync.ts","../src/commands/publish/index.ts"],"sourcesContent":["import JSZip from \"jszip\";\nimport * as path from \"node:path\";\nimport * as fs from \"node:fs\";\n\nimport { isErrorENOENT } from \"../../lib/error\";\nimport {\n\ttype CreatorPackage,\n\treadPackageCreatorManifest,\n\twritePackageCreatorManifest,\n\treadPackageCreatorIndex,\n\tparseCreatorPackageName,\n\ttype PackageLocation,\n\ttype PackageNpmManifest,\n\tINDEX_FILE,\n\tPACKAGE_FILE,\n} from \"../../lib/package\";\nimport {\n\ttype PublishedPackageLocation,\n\treadPublishedPackageCreatorIndex,\n} from \"../../lib/publishedPackage\";\nimport type { Reporter } from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nexport const buildArchiveFromPublishedPackage = (\n\tlocation: PublishedPackageLocation,\n\tmanifest: PackageNpmManifest,\n\tcreatorPackage: CreatorPackage,\n) => {\n\tconst archive = new JSZip();\n\n\tarchive.file(PACKAGE_FILE, JSON.stringify(creatorPackage, null, 2));\n\n\tconst index = readPublishedPackageCreatorIndex(location);\n\n\tif (index !== undefined) {\n\t\tarchive.file(INDEX_FILE, JSON.stringify(index, null, 2));\n\t}\n\n\tarchive.file(\n\t\tmanifest.main,\n\t\tfs.createReadStream(path.join(location.path, manifest.main)),\n\t);\n\n\tif (creatorPackage.Package === \"IG.GFX.Standard\") {\n\t\tconst source = path.join(location.path, \"Images\");\n\n\t\tif (fs.existsSync(source)) {\n\t\t\tconst images = fs.readdirSync(source);\n\n\t\t\tfor (const file of images) {\n\t\t\t\tconst { ext } = path.parse(file);\n\n\t\t\t\tswitch (ext) {\n\t\t\t\t\tcase \".png\":\n\t\t\t\t\tcase \".jpeg\":\n\t\t\t\t\tcase \".jpg\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tarchive.file(\n\t\t\t\t\tfile,\n\t\t\t\t\tfs.createReadStream(path.join(source, file)),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn archive;\n};\n\nconst runtimeScripts: CreatorPackage[\"Type\"][] = [\n\t\"Interactor\",\n\t\"Core\",\n\t\"Mixed\",\n];\n\nconst notRuntimeScripts: CreatorPackage[\"Type\"][] = [\"Context\", \"Evaluator\"];\n\nexport const buildArchiveFromPackage = async (\n\treporter: Reporter,\n\tpackageLocation: PackageLocation,\n\tdata: CreatorPackage,\n\tbinDir: string,\n\tminified = true,\n) => {\n\tconst { domain } = parseCreatorPackageName(data);\n\n\tconst scriptDirectories: string[] = [\n\t\tpackageLocation.path,\n\t\tpackageLocation.scriptsDir,\n\t];\n\n\tif (data.Package === \"IG.GFX.Standard\") {\n\t\treporter.log(`Including Images folder`);\n\t\tscriptDirectories.push(path.join(packageLocation.path, \"Images\"));\n\t}\n\n\tconst manifest = readPackageCreatorManifest(packageLocation);\n\n\tif (manifest !== undefined) {\n\t\tif (manifest.RunTime && notRuntimeScripts.includes(manifest.Type)) {\n\t\t\treporter.log(\n\t\t\t\t\"Setting script RunTime to false because of script type\",\n\t\t\t);\n\t\t\twritePackageCreatorManifest(packageLocation, {\n\t\t\t\t...manifest,\n\t\t\t\tRunTime: false,\n\t\t\t});\n\t\t} else if (\n\t\t\t!manifest.RunTime &&\n\t\t\truntimeScripts.includes(manifest.Type)\n\t\t) {\n\t\t\treporter.log(\n\t\t\t\t\"Setting script RunTime to true because of script type\",\n\t\t\t);\n\t\t\twritePackageCreatorManifest(packageLocation, {\n\t\t\t\t...manifest,\n\t\t\t\tRunTime: true,\n\t\t\t});\n\t\t}\n\t}\n\n\tlet libFile: string | undefined;\n\n\ttry {\n\t\tconst libFilePath = minified\n\t\t\t? path.join(binDir, `${data.Package}.min.js`)\n\t\t\t: path.join(binDir, `${data.Package}.js`);\n\n\t\tlibFile = fs.readFileSync(libFilePath, {\n\t\t\tencoding: \"utf8\",\n\t\t});\n\t} catch (err) {\n\t\tif (!isErrorENOENT(err)) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\tconst archive = new JSZip();\n\n\tlet library: string = \"\";\n\n\tif (libFile) {\n\t\tlibrary = libFile;\n\t}\n\n\tif (!library) {\n\t\tconst date = new Date(Date.now());\n\t\tlibrary = `/* This file is part of the ${domain} Data Packages.\n\t\t* Copyright (C) ${date.getFullYear()} intelligentgraphics. All Rights Reserved. */`;\n\t}\n\n\tarchive.file(`${data.Package}.js`, library);\n\tarchive.file(PACKAGE_FILE, JSON.stringify(data, null, 2));\n\n\tconst creatorIndex = readPackageCreatorIndex(packageLocation);\n\n\tif (creatorIndex !== undefined) {\n\t\tarchive.file(INDEX_FILE, JSON.stringify(creatorIndex, null, 2));\n\t}\n\n\tfor (const directory of scriptDirectories) {\n\t\ttry {\n\t\t\tfor (const file of fs.readdirSync(directory)) {\n\t\t\t\tconst { ext } = path.parse(file);\n\n\t\t\t\tswitch (ext) {\n\t\t\t\t\tcase \".png\":\n\t\t\t\t\tcase \".jpeg\":\n\t\t\t\t\tcase \".jpg\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tarchive.file(\n\t\t\t\t\tfile,\n\t\t\t\t\tfs.createReadStream(path.join(directory, file)),\n\t\t\t\t);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\treporter.error(`Script directory \"${directory}\" does not exist`);\n\t\t}\n\t}\n\n\treturn archive;\n};\n","import { AssetService } from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nexport interface AssetServiceSessionManager {\n\tgetBasicsSession: () => Promise<AssetService.Session>;\n\tgetTargetSession: () => AssetService.Session;\n\tdestroy: () => Promise<void>;\n}\n\nexport const createAssetServiceSessionManager = async (\n\tparams: AssetService.SessionStartParams,\n): Promise<AssetServiceSessionManager> => {\n\tconst targetSession = await AssetService.startSession(params);\n\tlet basicsSession: AssetService.Session | undefined;\n\n\treturn {\n\t\tgetBasicsSession: async () => {\n\t\t\tif (targetSession.subDomain === \"Basics\") {\n\t\t\t\treturn targetSession;\n\t\t\t}\n\n\t\t\tif (basicsSession === undefined) {\n\t\t\t\tbasicsSession = await AssetService.startSession({\n\t\t\t\t\t...params,\n\t\t\t\t\tsubDomain: \"Basics\",\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn basicsSession;\n\t\t},\n\n\t\tgetTargetSession: () => targetSession,\n\n\t\tdestroy: async () => {\n\t\t\tawait AssetService.closeSession(targetSession);\n\n\t\t\tif (basicsSession !== undefined) {\n\t\t\t\tawait AssetService.closeSession(basicsSession);\n\t\t\t}\n\t\t},\n\t};\n};\n","import {\n\ttype WorkspaceLocation,\n\ttype CreatorPackage,\n\tAssetService,\n\tdetermineWorkspaceIGLibraries,\n\treadPublishedPackageNpmManifest,\n\treadPublishedPackageCreatorManifest,\n\ttype Reporter,\n} from \"@intelligentgraphics/ig.gfx.tools.core\";\nimport { buildArchiveFromPublishedPackage } from \"../commands/publish/zip\";\nimport { type AssetServiceSessionManager } from \"./assetServiceSessionManager\";\nimport { PackageVersion } from \"./packageVersion\";\nimport { parseVersionFromNumericVersion } from \"./parseVersion\";\nimport { type Prompter, type PrompterOption } from \"./prompter\";\n\nexport const synchronizeDependencies = async (\n\tworkspaceLocation: WorkspaceLocation,\n\tcreatorPackage: CreatorPackage | undefined,\n\tsessionManager: AssetServiceSessionManager,\n\tprompter: Prompter,\n\treporter: Reporter,\n\tlogUpToDate: boolean = false,\n) => {\n\tinterface UploadedPackage extends Omit<\n\t\tAssetService.ExistingPackage,\n\t\t\"version\"\n\t> {\n\t\tversion: PackageVersion;\n\t}\n\n\tconst libraries = determineWorkspaceIGLibraries(workspaceLocation);\n\n\t// If there are no libraries, we don't need to check for required versions\n\tif (libraries.length === 0) {\n\t\treturn true;\n\t}\n\n\tconst targetSession = sessionManager.getTargetSession();\n\n\tconst rawUploadedPackages =\n\t\tawait AssetService.getExistingPackages(targetSession);\n\n\tconst uploadedPackages = rawUploadedPackages.map(\n\t\t(entry): UploadedPackage => {\n\t\t\tlet version: PackageVersion;\n\n\t\t\ttry {\n\t\t\t\tversion = parseVersionFromNumericVersion(entry.numericVersion);\n\t\t\t} catch (err) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Encountered invalid format for version ${entry.numericVersion}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (version.buildNumber < 100) {\n\t\t\t\tversion.preRelease = {\n\t\t\t\t\ttype: \"beta\",\n\t\t\t\t\tversion: version.buildNumber,\n\t\t\t\t};\n\t\t\t} else if (version.buildNumber > 100) {\n\t\t\t\tversion.preRelease = {\n\t\t\t\t\ttype: \"patch\",\n\t\t\t\t\tversion: version.buildNumber - 100,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...entry,\n\t\t\t\tversion,\n\t\t\t};\n\t\t},\n\t);\n\n\tfor (const libraryLocation of libraries) {\n\t\tconst libraryManifest =\n\t\t\treadPublishedPackageNpmManifest(libraryLocation);\n\t\tconst libraryCreatorPackage =\n\t\t\treadPublishedPackageCreatorManifest(libraryLocation);\n\n\t\tif (\n\t\t\tlibraryCreatorPackage === undefined ||\n\t\t\tlibraryManifest.main === undefined ||\n\t\t\tlibraryCreatorPackage.Package === creatorPackage?.Package\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst libraryVersion = PackageVersion.extractFromLine(\n\t\t\tlibraryManifest.version,\n\t\t);\n\n\t\tif (libraryVersion.preRelease) {\n\t\t\tlibraryVersion.buildNumber = libraryVersion.preRelease.version;\n\t\t\tlibraryVersion.preRelease = undefined;\n\t\t} else {\n\t\t\tlibraryVersion.buildNumber = 100;\n\t\t}\n\n\t\tlet uploadedPackageInBasics: UploadedPackage | undefined;\n\t\tlet uploadedPackageInTarget: UploadedPackage | undefined;\n\n\t\tfor (const uploadedPackage of uploadedPackages) {\n\t\t\tif (uploadedPackage.scope === libraryCreatorPackage.Package) {\n\t\t\t\tif (uploadedPackage.support) {\n\t\t\t\t\tuploadedPackageInBasics = uploadedPackage;\n\t\t\t\t} else {\n\t\t\t\t\tuploadedPackageInTarget = uploadedPackage;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst validInBasics =\n\t\t\tuploadedPackageInBasics !== undefined &&\n\t\t\t!uploadedPackageInBasics.version.isLesserThan(libraryVersion);\n\t\tconst validInTarget =\n\t\t\tuploadedPackageInTarget !== undefined &&\n\t\t\t!uploadedPackageInTarget.version.isLesserThan(libraryVersion);\n\n\t\tif (validInBasics || validInTarget) {\n\t\t\tif (\n\t\t\t\ttargetSession.subDomain !== \"Basics\" &&\n\t\t\t\tuploadedPackageInBasics !== undefined &&\n\t\t\t\tuploadedPackageInTarget !== undefined\n\t\t\t) {\n\t\t\t\treporter.log(\n\t\t\t\t\t`Package ${libraryCreatorPackage.Package} is uploaded both for Basics and ${targetSession.subDomain}. The package within ${targetSession.subDomain} will be used.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (logUpToDate) {\n\t\t\t\treporter.log(\n\t\t\t\t\t`Package ${\n\t\t\t\t\t\tlibraryCreatorPackage.Package\n\t\t\t\t\t} is already uploaded with the required version ${libraryVersion.toVersionString(\n\t\t\t\t\t\t{},\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst possibleTargets: PrompterOption[] = [];\n\n\t\tif (uploadedPackageInBasics) {\n\t\t\tconst version = uploadedPackageInBasics.version.toVersionString({\n\t\t\t\tbuildNumber: true,\n\t\t\t});\n\n\t\t\tpossibleTargets.push({\n\t\t\t\tvalue: \"Basics\",\n\t\t\t\tname: `Basics (Current: ${version})`,\n\t\t\t});\n\t\t} else {\n\t\t\tpossibleTargets.push({\n\t\t\t\tvalue: \"Basics\",\n\t\t\t\tname: \"Basics (Current: None)\",\n\t\t\t});\n\t\t}\n\n\t\tif (targetSession.subDomain !== \"Basics\") {\n\t\t\tif (uploadedPackageInTarget) {\n\t\t\t\tconst version = uploadedPackageInTarget.version.toVersionString(\n\t\t\t\t\t{\n\t\t\t\t\t\tbuildNumber: true,\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tpossibleTargets.push({\n\t\t\t\t\tvalue: targetSession.subDomain,\n\t\t\t\t\tname: `${targetSession.subDomain} (Current: ${version})`,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tpossibleTargets.push({\n\t\t\t\t\tvalue: targetSession.subDomain,\n\t\t\t\t\tname: `${targetSession.subDomain} (Current: None)`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tconst libraryVersionString = libraryVersion.toVersionString({\n\t\t\tbuildNumber: true,\n\t\t});\n\n\t\tconst uploadTargetScope = await prompter.ask({\n\t\t\tmessage: `Version ${libraryVersionString} of dependency ${libraryCreatorPackage.Package} is required but not available. Please select a subdomain to upload the required dependency version to`,\n\t\t\toptions: [\n\t\t\t\t...possibleTargets,\n\t\t\t\t{ name: \"Skip upload\", value: \"Skip\" },\n\t\t\t],\n\t\t\tdefault: possibleTargets[0].value,\n\t\t});\n\n\t\tif (uploadTargetScope === \"Skip\") {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst archive = buildArchiveFromPublishedPackage(\n\t\t\tlibraryLocation,\n\t\t\tlibraryManifest,\n\t\t\tlibraryCreatorPackage,\n\t\t);\n\n\t\tconst newVersionString = libraryVersion.toVersionString({\n\t\t\tbuildNumber: true,\n\t\t});\n\n\t\tconst session =\n\t\t\tuploadTargetScope === \"Basics\"\n\t\t\t\t? await sessionManager.getBasicsSession()\n\t\t\t\t: targetSession;\n\n\t\treporter.log(\n\t\t\t`Uploading package ${libraryCreatorPackage.Package} with version ${newVersionString} to ${session.domain}.${session.subDomain}`,\n\t\t);\n\n\t\tawait AssetService.uploadPackageFromBuffer(\n\t\t\tsession,\n\t\t\t{\n\t\t\t\tname: libraryCreatorPackage.Package,\n\t\t\t\tversion: newVersionString,\n\t\t\t},\n\t\t\tawait archive.generateAsync({ type: \"nodebuffer\" }),\n\t\t);\n\t}\n};\n","import * as path from \"node:path\";\nimport * as fs from \"fs/promises\";\nimport { createReadStream, createWriteStream } from \"node:fs\";\nimport { pipeline } from \"node:stream/promises\";\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\nimport {\n\tAssetService,\n\tconsoleReporter,\n\tcreatePackageScopedReporter,\n\tisErrorEACCES,\n\tisErrorEPERM,\n\ttype Reporter,\n\twritePackageCreatorManifest,\n} from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nimport {\n\tgetPackageReleasesDirectory,\n\ttype PackageLocation,\n\tparseCreatorPackageName,\n\treadPackageAnimationList,\n\treadPackageCreatorManifest,\n} from \"../../lib/package\";\nimport {\n\tgetWorkspaceOutputPath,\n\treadWorkspaceNpmManifest,\n} from \"../../lib/workspace\";\nimport { getVersionInformationFromGit } from \"../../lib/git\";\nimport { getWorkspaceBannerText } from \"../../lib/banner\";\nimport { parseVersionFromString } from \"../../lib/parseVersion\";\nimport { getVersionFileHandler } from \"../../lib/versionFile\";\nimport { isErrorENOENT } from \"../../lib/error\";\nimport type { Prompter } from \"../../lib/prompter\";\nimport { PackageVersion } from \"../../lib/packageVersion\";\nimport { type BuildFoldersOptions, buildFolders } from \"../build\";\nimport { buildArchiveFromPackage } from \"./zip\";\nimport { createAssetServiceSessionManager } from \"../../lib/assetServiceSessionManager\";\nimport { synchronizeDependencies } from \"../../lib/dependencySync\";\nimport { buffer } from \"node:stream/consumers\";\n\nexport interface ReleaseFolderOptions extends Omit<\n\tBuildFoldersOptions,\n\t\"skipPackagesWithoutTsFiles\" | \"banner\" | \"packages\"\n> {\n\tdirectory: PackageLocation;\n\tnoUpload: boolean;\n\tnewVersion: string;\n\tdomain?: string;\n\tsubdomain?: string;\n\taddress?: string;\n\tservice: string;\n\tauthentication?: AssetService.Authentication;\n\tpushOnly: boolean;\n\tbanner?: boolean;\n\tprompter: Prompter;\n\tskipDependencies?: boolean;\n\treporter?: Reporter;\n}\n\nconst execAsync = promisify(exec);\n\nexport const releaseFolder = async (options: ReleaseFolderOptions) => {\n\tconst workspace = options.workspace;\n\tconst location = options.directory;\n\n\tconst versionFile = getVersionFileHandler(location);\n\n\tconst packageDescription = readPackageCreatorManifest(location);\n\tconst fullPackageName = packageDescription.Package;\n\n\tconst reporter =\n\t\toptions.reporter ??\n\t\tcreatePackageScopedReporter(\n\t\t\tconsoleReporter,\n\t\t\tpackageDescription.Package,\n\t\t);\n\n\tconst { domain, subdomain } = parseCreatorPackageName(packageDescription);\n\n\tconst publishDomain = options.domain ?? domain;\n\tconst publishSubdomain = options.subdomain ?? subdomain;\n\n\tconst sharedPackageJson = readWorkspaceNpmManifest(workspace);\n\n\tlet newVersion: PackageVersion;\n\ttry {\n\t\tnewVersion = parseVersionFromString(options.newVersion);\n\t} catch (err) {\n\t\tthrow new Error(`Please enter a version in this format 1.0.0.100`);\n\t}\n\n\tpackageDescription.Version = newVersion.toVersionString({\n\t\tbuildNumber: true,\n\t});\n\twritePackageCreatorManifest(location, packageDescription);\n\n\tif (newVersion.buildNumber < 100) {\n\t\tnewVersion.preRelease = {\n\t\t\ttype: \"beta\",\n\t\t\tversion: newVersion.buildNumber,\n\t\t};\n\t} else if (newVersion.buildNumber > 100) {\n\t\tnewVersion.preRelease = {\n\t\t\ttype: \"patch\",\n\t\t\tversion: newVersion.buildNumber - 100,\n\t\t};\n\t}\n\n\t// if (sharedPackageJson !== undefined) {\n\t// \treporter.log(\n\t// \t\t`Running npm install to make sure all dependencies are up to date`,\n\t// \t);\n\t// \tawait execAsync(`npm install`, {\n\t// \t\tencoding: \"utf-8\",\n\t// \t\tcwd: workspace.path,\n\t// \t});\n\t// }\n\n\tconst binDir = options.outDir ?? getWorkspaceOutputPath(workspace);\n\tawait fs.mkdir(binDir, { recursive: true });\n\n\tlet assetServerPackageDetails: AssetService.UploadPackageDetails;\n\n\tlet packageNameWithVersion: string;\n\n\t{\n\t\tconst versionWithoutPrelease = newVersion.clone();\n\t\tversionWithoutPrelease.preRelease = undefined;\n\t\tconst newVersionString = versionWithoutPrelease.toVersionString({\n\t\t\tbuildNumber: true,\n\t\t});\n\t\tpackageNameWithVersion = `${packageDescription.Package}_${newVersionString}`;\n\n\t\tassetServerPackageDetails = {\n\t\t\tname: packageDescription.Package,\n\t\t\tversion: newVersionString,\n\t\t};\n\t}\n\n\tlet zipFilePath = path.join(binDir, packageNameWithVersion + \".zip\");\n\tinterface Uploadable {\n\t\tgetStream: () => NodeJS.ReadableStream;\n\t}\n\n\tlet uploadable: Uploadable = {\n\t\tgetStream: () => createReadStream(zipFilePath),\n\t};\n\n\ttry {\n\t\tif (options.pushOnly) {\n\t\t\tconst zipFileExists = await fs.stat(zipFilePath).catch((err) => {\n\t\t\t\tif (isErrorENOENT(err)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn Promise.reject(err);\n\t\t\t});\n\n\t\t\tif (zipFileExists) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Expected a zip file to exist at path ${zipFilePath} since pushOnly is specified`,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tconst gitVersionInformation = await getVersionInformationFromGit(\n\t\t\t\tworkspace,\n\t\t\t\tlocation,\n\t\t\t);\n\n\t\t\tif (versionFile.exists) {\n\t\t\t\tversionFile.write(fullPackageName, newVersion);\n\t\t\t}\n\n\t\t\tconst bannerText =\n\t\t\t\tsharedPackageJson !== undefined\n\t\t\t\t\t? getWorkspaceBannerText(sharedPackageJson)\n\t\t\t\t\t: undefined;\n\n\t\t\tawait buildFolders({\n\t\t\t\t...options,\n\t\t\t\tpackages: [location],\n\t\t\t\tbanner: options.banner\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ttext: bannerText,\n\t\t\t\t\t\t\tcommit: gitVersionInformation.commit,\n\t\t\t\t\t\t\tcommitDirty: gitVersionInformation.dirty,\n\t\t\t\t\t\t\tversion: newVersion.toVersionString({\n\t\t\t\t\t\t\t\tbuildNumber: true,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tdate: new Date(Date.now()),\n\t\t\t\t\t\t\t// gitVersionInformation.commitDate\n\t\t\t\t\t\t\t// \t? new Date(gitVersionInformation.commitDate)\n\t\t\t\t\t\t\t// \t: new Date(Date.now()),\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined,\n\t\t\t\tpreparedReporter: reporter,\n\t\t\t});\n\n\t\t\tnewVersion.preRelease = undefined;\n\n\t\t\ttry {\n\t\t\t\tawait fs.rm(zipFilePath);\n\t\t\t} catch (err) {\n\t\t\t\tif (!isErrorENOENT(err)) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (readPackageAnimationList(location).length > 0) {\n\t\t\t\tconst workspaceManifest = readWorkspaceNpmManifest(workspace);\n\n\t\t\t\tif (\n\t\t\t\t\t!workspaceManifest.dependencies?.[\n\t\t\t\t\t\t\"@intelligentgraphics/3d.ig.gfx.standard\"\n\t\t\t\t\t]\n\t\t\t\t) {\n\t\t\t\t\tconst install = await options.prompter.confirm(\n\t\t\t\t\t\t`The IG.GFX.Standard package should be added as a dependency to provide the 'AnimationInteractor' used to display animations. Do you wish to add it now?`,\n\t\t\t\t\t);\n\n\t\t\t\t\tif (install) {\n\t\t\t\t\t\tawait execAsync(\n\t\t\t\t\t\t\t`npm install @intelligentgraphics/3d.ig.gfx.standard`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tencoding: \"utf-8\",\n\t\t\t\t\t\t\t\tcwd: workspace.path,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tawait execAsync(`npm run postinstall`, {\n\t\t\t\t\t\t\tcwd: workspace.path,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treporter.log(`Creating zip file`);\n\n\t\t\tconst archive = await buildArchiveFromPackage(\n\t\t\t\treporter,\n\t\t\t\tlocation,\n\t\t\t\tpackageDescription,\n\t\t\t\tbinDir,\n\t\t\t\toptions.minimize,\n\t\t\t);\n\n\t\t\ttry {\n\t\t\t\tconst zipOutputStream = createWriteStream(zipFilePath);\n\t\t\t\tawait pipeline(archive.generateNodeStream(), zipOutputStream);\n\t\t\t} catch (err) {\n\t\t\t\tif (isErrorEACCES(err) || isErrorEPERM(err)) {\n\t\t\t\t\treporter.log(\n\t\t\t\t\t\t`Could not create zip file in the bin directory because of a permissions error. Only using it in-memory`,\n\t\t\t\t\t);\n\t\t\t\t\tuploadable = {\n\t\t\t\t\t\tgetStream: () => archive.generateNodeStream(),\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!options.noUpload) {\n\t\t\tif (!options.authentication) {\n\t\t\t\tthrow new Error(`Expected authentication to be available`);\n\t\t\t}\n\n\t\t\treporter.log(`Opening connection to IG.Asset.Server`);\n\n\t\t\tconst sessionManager = await createAssetServiceSessionManager({\n\t\t\t\turl: options.service,\n\t\t\t\taddress: options.address,\n\t\t\t\tdomain: publishDomain,\n\t\t\t\tsubDomain: publishSubdomain,\n\t\t\t\tauthentication: options.authentication,\n\t\t\t});\n\n\t\t\ttry {\n\t\t\t\tif (!options.skipDependencies) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait synchronizeDependencies(\n\t\t\t\t\t\t\tworkspace,\n\t\t\t\t\t\t\tpackageDescription,\n\t\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\t\toptions.prompter,\n\t\t\t\t\t\t\treporter,\n\t\t\t\t\t\t);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\treporter.error(\n\t\t\t\t\t\t\t`Failed to synchronize dependencies for ${packageDescription.Package}`,\n\t\t\t\t\t\t\terr instanceof Error ? err : new Error(String(err)),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treporter.log(\n\t\t\t\t\t`Uploading package to ${publishDomain}.${publishSubdomain}`,\n\t\t\t\t);\n\n\t\t\t\tawait AssetService.uploadPackageFromBuffer(\n\t\t\t\t\tsessionManager.getTargetSession(),\n\t\t\t\t\tassetServerPackageDetails,\n\t\t\t\t\tawait buffer(uploadable.getStream()),\n\t\t\t\t);\n\t\t\t} finally {\n\t\t\t\tawait sessionManager.destroy().catch((err) => {\n\t\t\t\t\treporter.error(\n\t\t\t\t\t\t`Failed to close IG.Asset.Server session(s)`,\n\t\t\t\t\t\terr,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (err) {\n\t\tversionFile.reset();\n\t\tthrow err;\n\t}\n\n\tif (newVersion.buildNumber >= 100 && !options.pushOnly) {\n\t\treporter.error(\"Copying zip to releases folder\");\n\n\t\tconst zipFileName = `${packageNameWithVersion}.zip`;\n\t\tconst releasesPath = getPackageReleasesDirectory(location);\n\n\t\tawait fs.mkdir(releasesPath, { recursive: true });\n\t\tawait pipeline(\n\t\t\tuploadable.getStream(),\n\t\t\tcreateWriteStream(path.join(releasesPath, zipFileName)),\n\t\t);\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,MAAa,oCACZ,UACA,UACA,mBACI;CACJ,MAAM,UAAU,IAAI,OAAO;AAE3B,SAAQ,KAAK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;;;UAGI,KAAK;AACb,cAAY,OAAO;AACnB,QAAM;;AAGP,KAAI,WAAW,eAAe,OAAO,CAAC,QAAQ,UAAU;AACvD,WAAS,MAAM,iCAAiC;EAEhD,MAAM,cAAc,GAAG,uBAAuB;EAC9C,MAAM,eAAe,4BAA4B,SAAS;AAE1D,QAAM,GAAG,MAAM,cAAc,EAAE,WAAW,MAAM,CAAC;AACjD,QAAM,SACL,WAAW,WAAW,EACtB,kBAAkB,KAAK,KAAK,cAAc,YAAY,CAAC,CACvD"}
1
+ {"version":3,"file":"publish-Bd15xplt.js","names":["fs","AssetService","AssetService","AssetService"],"sources":["../src/commands/publish/zip.ts","../src/lib/assetServiceSessionManager.ts","../src/lib/dependencySync.ts","../src/commands/publish/index.ts"],"sourcesContent":["import JSZip from \"jszip\";\nimport * as path from \"node:path\";\nimport * as fs from \"node:fs\";\n\nimport { isErrorENOENT } from \"../../lib/error\";\nimport {\n\ttype CreatorPackage,\n\treadPackageCreatorManifest,\n\twritePackageCreatorManifest,\n\treadPackageCreatorIndex,\n\tparseCreatorPackageName,\n\ttype PackageLocation,\n\ttype PackageNpmManifest,\n\tINDEX_FILE,\n\tPACKAGE_FILE,\n} from \"../../lib/package\";\nimport {\n\ttype PublishedPackageLocation,\n\treadPublishedPackageCreatorIndex,\n} from \"../../lib/publishedPackage\";\nimport type { Reporter } from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nexport const buildArchiveFromPublishedPackage = (\n\tlocation: PublishedPackageLocation,\n\tmanifest: PackageNpmManifest,\n\tcreatorPackage: CreatorPackage,\n) => {\n\tconst archive = new JSZip();\n\n\tarchive.file(PACKAGE_FILE, JSON.stringify(creatorPackage, null, 2));\n\n\tconst index = readPublishedPackageCreatorIndex(location);\n\n\tif (index !== undefined) {\n\t\tarchive.file(INDEX_FILE, JSON.stringify(index, null, 2));\n\t}\n\n\tarchive.file(\n\t\tmanifest.main,\n\t\tfs.createReadStream(path.join(location.path, manifest.main)),\n\t);\n\n\tif (creatorPackage.Package === \"IG.GFX.Standard\") {\n\t\tconst source = path.join(location.path, \"Images\");\n\n\t\tif (fs.existsSync(source)) {\n\t\t\tconst images = fs.readdirSync(source);\n\n\t\t\tfor (const file of images) {\n\t\t\t\tconst { ext } = path.parse(file);\n\n\t\t\t\tswitch (ext) {\n\t\t\t\t\tcase \".png\":\n\t\t\t\t\tcase \".jpeg\":\n\t\t\t\t\tcase \".jpg\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tarchive.file(\n\t\t\t\t\tfile,\n\t\t\t\t\tfs.createReadStream(path.join(source, file)),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn archive;\n};\n\nconst runtimeScripts: CreatorPackage[\"Type\"][] = [\n\t\"Interactor\",\n\t\"Core\",\n\t\"Mixed\",\n];\n\nconst notRuntimeScripts: CreatorPackage[\"Type\"][] = [\"Context\", \"Evaluator\"];\n\nexport const buildArchiveFromPackage = async (\n\treporter: Reporter,\n\tpackageLocation: PackageLocation,\n\tdata: CreatorPackage,\n\tbinDir: string,\n\tminified = true,\n) => {\n\tconst { domain } = parseCreatorPackageName(data);\n\n\tconst scriptDirectories: string[] = [\n\t\tpackageLocation.path,\n\t\tpackageLocation.scriptsDir,\n\t];\n\n\tif (data.Package === \"IG.GFX.Standard\") {\n\t\treporter.log(`Including Images folder`);\n\t\tscriptDirectories.push(path.join(packageLocation.path, \"Images\"));\n\t}\n\n\tconst manifest = readPackageCreatorManifest(packageLocation);\n\n\tif (manifest !== undefined) {\n\t\tif (manifest.RunTime && notRuntimeScripts.includes(manifest.Type)) {\n\t\t\treporter.log(\n\t\t\t\t\"Setting script RunTime to false because of script type\",\n\t\t\t);\n\t\t\twritePackageCreatorManifest(packageLocation, {\n\t\t\t\t...manifest,\n\t\t\t\tRunTime: false,\n\t\t\t});\n\t\t} else if (\n\t\t\t!manifest.RunTime &&\n\t\t\truntimeScripts.includes(manifest.Type)\n\t\t) {\n\t\t\treporter.log(\n\t\t\t\t\"Setting script RunTime to true because of script type\",\n\t\t\t);\n\t\t\twritePackageCreatorManifest(packageLocation, {\n\t\t\t\t...manifest,\n\t\t\t\tRunTime: true,\n\t\t\t});\n\t\t}\n\t}\n\n\tlet libFile: string | undefined;\n\n\ttry {\n\t\tconst libFilePath = minified\n\t\t\t? path.join(binDir, `${data.Package}.min.js`)\n\t\t\t: path.join(binDir, `${data.Package}.js`);\n\n\t\tlibFile = fs.readFileSync(libFilePath, {\n\t\t\tencoding: \"utf8\",\n\t\t});\n\t} catch (err) {\n\t\tif (!isErrorENOENT(err)) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\tconst archive = new JSZip();\n\n\tlet library: string = \"\";\n\n\tif (libFile) {\n\t\tlibrary = libFile;\n\t}\n\n\tif (!library) {\n\t\tconst date = new Date(Date.now());\n\t\tlibrary = `/* This file is part of the ${domain} Data Packages.\n\t\t* Copyright (C) ${date.getFullYear()} intelligentgraphics. All Rights Reserved. */`;\n\t}\n\n\tarchive.file(`${data.Package}.js`, library);\n\tarchive.file(PACKAGE_FILE, JSON.stringify(data, null, 2));\n\n\tconst creatorIndex = readPackageCreatorIndex(packageLocation);\n\n\tif (creatorIndex !== undefined) {\n\t\tarchive.file(INDEX_FILE, JSON.stringify(creatorIndex, null, 2));\n\t}\n\n\tfor (const directory of scriptDirectories) {\n\t\ttry {\n\t\t\tfor (const file of fs.readdirSync(directory)) {\n\t\t\t\tconst { ext } = path.parse(file);\n\n\t\t\t\tswitch (ext) {\n\t\t\t\t\tcase \".png\":\n\t\t\t\t\tcase \".jpeg\":\n\t\t\t\t\tcase \".jpg\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tarchive.file(\n\t\t\t\t\tfile,\n\t\t\t\t\tfs.createReadStream(path.join(directory, file)),\n\t\t\t\t);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\treporter.error(`Script directory \"${directory}\" does not exist`);\n\t\t}\n\t}\n\n\treturn archive;\n};\n","import { AssetService } from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nexport interface AssetServiceSessionManager {\n\tgetBasicsSession: () => Promise<AssetService.Session>;\n\tgetTargetSession: () => AssetService.Session;\n\tdestroy: () => Promise<void>;\n}\n\nexport const createAssetServiceSessionManager = async (\n\tparams: AssetService.SessionStartParams,\n): Promise<AssetServiceSessionManager> => {\n\tconst targetSession = await AssetService.startSession(params);\n\tlet basicsSession: AssetService.Session | undefined;\n\n\treturn {\n\t\tgetBasicsSession: async () => {\n\t\t\tif (targetSession.subDomain === \"Basics\") {\n\t\t\t\treturn targetSession;\n\t\t\t}\n\n\t\t\tif (basicsSession === undefined) {\n\t\t\t\tbasicsSession = await AssetService.startSession({\n\t\t\t\t\t...params,\n\t\t\t\t\tsubDomain: \"Basics\",\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn basicsSession;\n\t\t},\n\n\t\tgetTargetSession: () => targetSession,\n\n\t\tdestroy: async () => {\n\t\t\tawait AssetService.closeSession(targetSession);\n\n\t\t\tif (basicsSession !== undefined) {\n\t\t\t\tawait AssetService.closeSession(basicsSession);\n\t\t\t}\n\t\t},\n\t};\n};\n","import {\n\ttype WorkspaceLocation,\n\ttype CreatorPackage,\n\tAssetService,\n\tdetermineWorkspaceIGLibraries,\n\treadPublishedPackageNpmManifest,\n\treadPublishedPackageCreatorManifest,\n\ttype Reporter,\n} from \"@intelligentgraphics/ig.gfx.tools.core\";\nimport { buildArchiveFromPublishedPackage } from \"../commands/publish/zip\";\nimport { type AssetServiceSessionManager } from \"./assetServiceSessionManager\";\nimport { PackageVersion } from \"./packageVersion\";\nimport { parseVersionFromNumericVersion } from \"./parseVersion\";\nimport { type Prompter, type PrompterOption } from \"./prompter\";\n\nexport const synchronizeDependencies = async (\n\tworkspaceLocation: WorkspaceLocation,\n\tcreatorPackage: CreatorPackage | undefined,\n\tsessionManager: AssetServiceSessionManager,\n\tprompter: Prompter,\n\treporter: Reporter,\n\tlogUpToDate: boolean = false,\n) => {\n\tinterface UploadedPackage extends Omit<\n\t\tAssetService.ExistingPackage,\n\t\t\"version\"\n\t> {\n\t\tversion: PackageVersion;\n\t}\n\n\tconst libraries = determineWorkspaceIGLibraries(workspaceLocation);\n\n\t// If there are no libraries, we don't need to check for required versions\n\tif (libraries.length === 0) {\n\t\treturn true;\n\t}\n\n\tconst targetSession = sessionManager.getTargetSession();\n\n\tconst rawUploadedPackages =\n\t\tawait AssetService.getExistingPackages(targetSession);\n\n\tconst uploadedPackages = rawUploadedPackages.map(\n\t\t(entry): UploadedPackage => {\n\t\t\tlet version: PackageVersion;\n\n\t\t\ttry {\n\t\t\t\tversion = parseVersionFromNumericVersion(entry.numericVersion);\n\t\t\t} catch (err) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Encountered invalid format for version ${entry.numericVersion}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (version.buildNumber < 100) {\n\t\t\t\tversion.preRelease = {\n\t\t\t\t\ttype: \"beta\",\n\t\t\t\t\tversion: version.buildNumber,\n\t\t\t\t};\n\t\t\t} else if (version.buildNumber > 100) {\n\t\t\t\tversion.preRelease = {\n\t\t\t\t\ttype: \"patch\",\n\t\t\t\t\tversion: version.buildNumber - 100,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...entry,\n\t\t\t\tversion,\n\t\t\t};\n\t\t},\n\t);\n\n\tfor (const libraryLocation of libraries) {\n\t\tconst libraryManifest =\n\t\t\treadPublishedPackageNpmManifest(libraryLocation);\n\t\tconst libraryCreatorPackage =\n\t\t\treadPublishedPackageCreatorManifest(libraryLocation);\n\n\t\tif (\n\t\t\tlibraryCreatorPackage === undefined ||\n\t\t\tlibraryManifest.main === undefined ||\n\t\t\tlibraryCreatorPackage.Package === creatorPackage?.Package\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst libraryVersion = PackageVersion.extractFromLine(\n\t\t\tlibraryManifest.version,\n\t\t);\n\n\t\tif (libraryVersion.preRelease) {\n\t\t\tlibraryVersion.buildNumber = libraryVersion.preRelease.version;\n\t\t\tlibraryVersion.preRelease = undefined;\n\t\t} else {\n\t\t\tlibraryVersion.buildNumber = 100;\n\t\t}\n\n\t\tlet uploadedPackageInBasics: UploadedPackage | undefined;\n\t\tlet uploadedPackageInTarget: UploadedPackage | undefined;\n\n\t\tfor (const uploadedPackage of uploadedPackages) {\n\t\t\tif (uploadedPackage.scope === libraryCreatorPackage.Package) {\n\t\t\t\tif (uploadedPackage.support) {\n\t\t\t\t\tuploadedPackageInBasics = uploadedPackage;\n\t\t\t\t} else {\n\t\t\t\t\tuploadedPackageInTarget = uploadedPackage;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst validInBasics =\n\t\t\tuploadedPackageInBasics !== undefined &&\n\t\t\t!uploadedPackageInBasics.version.isLesserThan(libraryVersion);\n\t\tconst validInTarget =\n\t\t\tuploadedPackageInTarget !== undefined &&\n\t\t\t!uploadedPackageInTarget.version.isLesserThan(libraryVersion);\n\n\t\tif (validInBasics || validInTarget) {\n\t\t\tif (\n\t\t\t\ttargetSession.subDomain !== \"Basics\" &&\n\t\t\t\tuploadedPackageInBasics !== undefined &&\n\t\t\t\tuploadedPackageInTarget !== undefined\n\t\t\t) {\n\t\t\t\treporter.log(\n\t\t\t\t\t`Package ${libraryCreatorPackage.Package} is uploaded both for Basics and ${targetSession.subDomain}. The package within ${targetSession.subDomain} will be used.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (logUpToDate) {\n\t\t\t\treporter.log(\n\t\t\t\t\t`Package ${\n\t\t\t\t\t\tlibraryCreatorPackage.Package\n\t\t\t\t\t} is already uploaded with the required version ${libraryVersion.toVersionString(\n\t\t\t\t\t\t{},\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst possibleTargets: PrompterOption[] = [];\n\n\t\tif (uploadedPackageInBasics) {\n\t\t\tconst version = uploadedPackageInBasics.version.toVersionString({\n\t\t\t\tbuildNumber: true,\n\t\t\t});\n\n\t\t\tpossibleTargets.push({\n\t\t\t\tvalue: \"Basics\",\n\t\t\t\tname: `Basics (Current: ${version})`,\n\t\t\t});\n\t\t} else {\n\t\t\tpossibleTargets.push({\n\t\t\t\tvalue: \"Basics\",\n\t\t\t\tname: \"Basics (Current: None)\",\n\t\t\t});\n\t\t}\n\n\t\tif (targetSession.subDomain !== \"Basics\") {\n\t\t\tif (uploadedPackageInTarget) {\n\t\t\t\tconst version = uploadedPackageInTarget.version.toVersionString(\n\t\t\t\t\t{\n\t\t\t\t\t\tbuildNumber: true,\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tpossibleTargets.push({\n\t\t\t\t\tvalue: targetSession.subDomain,\n\t\t\t\t\tname: `${targetSession.subDomain} (Current: ${version})`,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tpossibleTargets.push({\n\t\t\t\t\tvalue: targetSession.subDomain,\n\t\t\t\t\tname: `${targetSession.subDomain} (Current: None)`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tconst libraryVersionString = libraryVersion.toVersionString({\n\t\t\tbuildNumber: true,\n\t\t});\n\n\t\tconst uploadTargetScope = await prompter.ask({\n\t\t\tmessage: `Version ${libraryVersionString} of dependency ${libraryCreatorPackage.Package} is required but not available. Please select a subdomain to upload the required dependency version to`,\n\t\t\toptions: [\n\t\t\t\t...possibleTargets,\n\t\t\t\t{ name: \"Skip upload\", value: \"Skip\" },\n\t\t\t],\n\t\t\tdefault: possibleTargets[0].value,\n\t\t});\n\n\t\tif (uploadTargetScope === \"Skip\") {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst archive = buildArchiveFromPublishedPackage(\n\t\t\tlibraryLocation,\n\t\t\tlibraryManifest,\n\t\t\tlibraryCreatorPackage,\n\t\t);\n\n\t\tconst newVersionString = libraryVersion.toVersionString({\n\t\t\tbuildNumber: true,\n\t\t});\n\n\t\tconst session =\n\t\t\tuploadTargetScope === \"Basics\"\n\t\t\t\t? await sessionManager.getBasicsSession()\n\t\t\t\t: targetSession;\n\n\t\treporter.log(\n\t\t\t`Uploading package ${libraryCreatorPackage.Package} with version ${newVersionString} to ${session.domain}.${session.subDomain}`,\n\t\t);\n\n\t\tawait AssetService.uploadPackageFromBuffer(\n\t\t\tsession,\n\t\t\t{\n\t\t\t\tname: libraryCreatorPackage.Package,\n\t\t\t\tversion: newVersionString,\n\t\t\t},\n\t\t\tawait archive.generateAsync({ type: \"nodebuffer\" }),\n\t\t);\n\t}\n};\n","import * as path from \"node:path\";\nimport * as fs from \"fs/promises\";\nimport { createReadStream, createWriteStream } from \"node:fs\";\nimport { pipeline } from \"node:stream/promises\";\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\nimport {\n\tAssetService,\n\tconsoleReporter,\n\tcreatePackageScopedReporter,\n\tisErrorEACCES,\n\tisErrorEPERM,\n\ttype Reporter,\n\twritePackageCreatorManifest,\n} from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nimport {\n\tgetPackageReleasesDirectory,\n\ttype PackageLocation,\n\tparseCreatorPackageName,\n\treadPackageAnimationList,\n\treadPackageCreatorManifest,\n} from \"../../lib/package\";\nimport {\n\tgetWorkspaceOutputPath,\n\treadWorkspaceNpmManifest,\n} from \"../../lib/workspace\";\nimport { getVersionInformationFromGit } from \"../../lib/git\";\nimport { getWorkspaceBannerText } from \"../../lib/banner\";\nimport { parseVersionFromString } from \"../../lib/parseVersion\";\nimport { getVersionFileHandler } from \"../../lib/versionFile\";\nimport { isErrorENOENT } from \"../../lib/error\";\nimport type { Prompter } from \"../../lib/prompter\";\nimport { PackageVersion } from \"../../lib/packageVersion\";\nimport { type BuildFoldersOptions, buildFolders } from \"../build\";\nimport { buildArchiveFromPackage } from \"./zip\";\nimport { createAssetServiceSessionManager } from \"../../lib/assetServiceSessionManager\";\nimport { synchronizeDependencies } from \"../../lib/dependencySync\";\nimport { buffer } from \"node:stream/consumers\";\n\nexport interface ReleaseFolderOptions extends Omit<\n\tBuildFoldersOptions,\n\t\"skipPackagesWithoutTsFiles\" | \"banner\" | \"packages\"\n> {\n\tdirectory: PackageLocation;\n\tnoUpload: boolean;\n\tnewVersion: string;\n\tdomain?: string;\n\tsubdomain?: string;\n\taddress?: string;\n\tservice: string;\n\tauthentication?: AssetService.Authentication;\n\tpushOnly: boolean;\n\tbanner?: boolean;\n\tprompter: Prompter;\n\tskipDependencies?: boolean;\n\treporter?: Reporter;\n}\n\nconst execAsync = promisify(exec);\n\nexport const releaseFolder = async (options: ReleaseFolderOptions) => {\n\tconst workspace = options.workspace;\n\tconst location = options.directory;\n\n\tconst versionFile = getVersionFileHandler(location);\n\n\tconst packageDescription = readPackageCreatorManifest(location);\n\tconst fullPackageName = packageDescription.Package;\n\n\tconst reporter =\n\t\toptions.reporter ??\n\t\tcreatePackageScopedReporter(\n\t\t\tconsoleReporter,\n\t\t\tpackageDescription.Package,\n\t\t);\n\n\tconst { domain, subdomain } = parseCreatorPackageName(packageDescription);\n\n\tconst publishDomain = options.domain ?? domain;\n\tconst publishSubdomain = options.subdomain ?? subdomain;\n\n\tconst sharedPackageJson = readWorkspaceNpmManifest(workspace);\n\n\tlet newVersion: PackageVersion;\n\ttry {\n\t\tnewVersion = parseVersionFromString(options.newVersion);\n\t} catch (err) {\n\t\tthrow new Error(`Please enter a version in this format 1.0.0.100`);\n\t}\n\n\tpackageDescription.Version = newVersion.toVersionString({\n\t\tbuildNumber: true,\n\t});\n\twritePackageCreatorManifest(location, packageDescription);\n\n\tif (newVersion.buildNumber < 100) {\n\t\tnewVersion.preRelease = {\n\t\t\ttype: \"beta\",\n\t\t\tversion: newVersion.buildNumber,\n\t\t};\n\t} else if (newVersion.buildNumber > 100) {\n\t\tnewVersion.preRelease = {\n\t\t\ttype: \"patch\",\n\t\t\tversion: newVersion.buildNumber - 100,\n\t\t};\n\t}\n\n\t// if (sharedPackageJson !== undefined) {\n\t// \treporter.log(\n\t// \t\t`Running npm install to make sure all dependencies are up to date`,\n\t// \t);\n\t// \tawait execAsync(`npm install`, {\n\t// \t\tencoding: \"utf-8\",\n\t// \t\tcwd: workspace.path,\n\t// \t});\n\t// }\n\n\tconst binDir = options.outDir ?? getWorkspaceOutputPath(workspace);\n\tawait fs.mkdir(binDir, { recursive: true });\n\n\tlet assetServerPackageDetails: AssetService.UploadPackageDetails;\n\n\tlet packageNameWithVersion: string;\n\n\t{\n\t\tconst versionWithoutPrelease = newVersion.clone();\n\t\tversionWithoutPrelease.preRelease = undefined;\n\t\tconst newVersionString = versionWithoutPrelease.toVersionString({\n\t\t\tbuildNumber: true,\n\t\t});\n\t\tpackageNameWithVersion = `${packageDescription.Package}_${newVersionString}`;\n\n\t\tassetServerPackageDetails = {\n\t\t\tname: packageDescription.Package,\n\t\t\tversion: newVersionString,\n\t\t};\n\t}\n\n\tlet zipFilePath = path.join(binDir, packageNameWithVersion + \".zip\");\n\tinterface Uploadable {\n\t\tgetStream: () => NodeJS.ReadableStream;\n\t}\n\n\tlet uploadable: Uploadable = {\n\t\tgetStream: () => createReadStream(zipFilePath),\n\t};\n\n\ttry {\n\t\tif (options.pushOnly) {\n\t\t\tconst zipFileExists = await fs.stat(zipFilePath).catch((err) => {\n\t\t\t\tif (isErrorENOENT(err)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn Promise.reject(err);\n\t\t\t});\n\n\t\t\tif (zipFileExists) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Expected a zip file to exist at path ${zipFilePath} since pushOnly is specified`,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tconst gitVersionInformation = await getVersionInformationFromGit(\n\t\t\t\tworkspace,\n\t\t\t\tlocation,\n\t\t\t);\n\n\t\t\tif (versionFile.exists) {\n\t\t\t\tversionFile.write(fullPackageName, newVersion);\n\t\t\t}\n\n\t\t\tconst bannerText =\n\t\t\t\tsharedPackageJson !== undefined\n\t\t\t\t\t? getWorkspaceBannerText(sharedPackageJson)\n\t\t\t\t\t: undefined;\n\n\t\t\tawait buildFolders({\n\t\t\t\t...options,\n\t\t\t\tpackages: [location],\n\t\t\t\tbanner: options.banner\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ttext: bannerText,\n\t\t\t\t\t\t\tcommit: gitVersionInformation.commit,\n\t\t\t\t\t\t\tcommitDirty: gitVersionInformation.dirty,\n\t\t\t\t\t\t\tversion: newVersion.toVersionString({\n\t\t\t\t\t\t\t\tbuildNumber: true,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tdate: new Date(Date.now()),\n\t\t\t\t\t\t\t// gitVersionInformation.commitDate\n\t\t\t\t\t\t\t// \t? new Date(gitVersionInformation.commitDate)\n\t\t\t\t\t\t\t// \t: new Date(Date.now()),\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined,\n\t\t\t\tpreparedReporter: reporter,\n\t\t\t});\n\n\t\t\tnewVersion.preRelease = undefined;\n\n\t\t\ttry {\n\t\t\t\tawait fs.rm(zipFilePath);\n\t\t\t} catch (err) {\n\t\t\t\tif (!isErrorENOENT(err)) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (readPackageAnimationList(location).length > 0) {\n\t\t\t\tconst workspaceManifest = readWorkspaceNpmManifest(workspace);\n\n\t\t\t\tif (\n\t\t\t\t\t!workspaceManifest.dependencies?.[\n\t\t\t\t\t\t\"@intelligentgraphics/3d.ig.gfx.standard\"\n\t\t\t\t\t]\n\t\t\t\t) {\n\t\t\t\t\tconst install = await options.prompter.confirm(\n\t\t\t\t\t\t`The IG.GFX.Standard package should be added as a dependency to provide the 'AnimationInteractor' used to display animations. Do you wish to add it now?`,\n\t\t\t\t\t);\n\n\t\t\t\t\tif (install) {\n\t\t\t\t\t\tawait execAsync(\n\t\t\t\t\t\t\t`npm install @intelligentgraphics/3d.ig.gfx.standard`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tencoding: \"utf-8\",\n\t\t\t\t\t\t\t\tcwd: workspace.path,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tawait execAsync(`npm run postinstall`, {\n\t\t\t\t\t\t\tcwd: workspace.path,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treporter.log(`Creating zip file`);\n\n\t\t\tconst archive = await buildArchiveFromPackage(\n\t\t\t\treporter,\n\t\t\t\tlocation,\n\t\t\t\tpackageDescription,\n\t\t\t\tbinDir,\n\t\t\t\toptions.minimize,\n\t\t\t);\n\n\t\t\ttry {\n\t\t\t\tconst zipOutputStream = createWriteStream(zipFilePath);\n\t\t\t\tawait pipeline(archive.generateNodeStream(), zipOutputStream);\n\t\t\t} catch (err) {\n\t\t\t\tif (isErrorEACCES(err) || isErrorEPERM(err)) {\n\t\t\t\t\treporter.log(\n\t\t\t\t\t\t`Could not create zip file in the bin directory because of a permissions error. Only using it in-memory`,\n\t\t\t\t\t);\n\t\t\t\t\tuploadable = {\n\t\t\t\t\t\tgetStream: () => archive.generateNodeStream(),\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!options.noUpload) {\n\t\t\tif (!options.authentication) {\n\t\t\t\tthrow new Error(`Expected authentication to be available`);\n\t\t\t}\n\n\t\t\treporter.log(`Opening connection to IG.Asset.Server`);\n\n\t\t\tconst sessionManager = await createAssetServiceSessionManager({\n\t\t\t\turl: options.service,\n\t\t\t\taddress: options.address,\n\t\t\t\tdomain: publishDomain,\n\t\t\t\tsubDomain: publishSubdomain,\n\t\t\t\tauthentication: options.authentication,\n\t\t\t});\n\n\t\t\ttry {\n\t\t\t\tif (!options.skipDependencies) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait synchronizeDependencies(\n\t\t\t\t\t\t\tworkspace,\n\t\t\t\t\t\t\tpackageDescription,\n\t\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\t\toptions.prompter,\n\t\t\t\t\t\t\treporter,\n\t\t\t\t\t\t);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\treporter.error(\n\t\t\t\t\t\t\t`Failed to synchronize dependencies for ${packageDescription.Package}`,\n\t\t\t\t\t\t\terr instanceof Error ? err : new Error(String(err)),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treporter.log(\n\t\t\t\t\t`Uploading package to ${publishDomain}.${publishSubdomain}`,\n\t\t\t\t);\n\n\t\t\t\tawait AssetService.uploadPackageFromBuffer(\n\t\t\t\t\tsessionManager.getTargetSession(),\n\t\t\t\t\tassetServerPackageDetails,\n\t\t\t\t\tawait buffer(uploadable.getStream()),\n\t\t\t\t);\n\t\t\t} finally {\n\t\t\t\tawait sessionManager.destroy().catch((err) => {\n\t\t\t\t\treporter.error(\n\t\t\t\t\t\t`Failed to close IG.Asset.Server session(s)`,\n\t\t\t\t\t\terr,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (err) {\n\t\tversionFile.reset();\n\t\tthrow err;\n\t}\n\n\tif (newVersion.buildNumber >= 100 && !options.pushOnly) {\n\t\treporter.error(\"Copying zip to releases folder\");\n\n\t\tconst zipFileName = `${packageNameWithVersion}.zip`;\n\t\tconst releasesPath = getPackageReleasesDirectory(location);\n\n\t\tawait fs.mkdir(releasesPath, { recursive: true });\n\t\tawait pipeline(\n\t\t\tuploadable.getStream(),\n\t\t\tcreateWriteStream(path.join(releasesPath, zipFileName)),\n\t\t);\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,MAAa,oCACZ,UACA,UACA,mBACI;CACJ,MAAM,UAAU,IAAI,MAAM;CAE1B,QAAQ,KAAK,cAAc,KAAK,UAAU,gBAAgB,MAAM,CAAC,CAAC;CAElE,MAAM,QAAQ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