@intelligentgraphics/ig.gfx.packager 3.0.27 → 3.1.0-alpha.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 (35) hide show
  1. package/build/bin.mjs +1 -1
  2. package/build/{cli-e279c41e.mjs → cli-CuiqZ39_.mjs} +52 -85
  3. package/build/cli-CuiqZ39_.mjs.map +1 -0
  4. package/build/{dependencies-9afff33c.mjs → dependencies-BiYItaVS.mjs} +2 -2
  5. package/build/{dependencies-9afff33c.mjs.map → dependencies-BiYItaVS.mjs.map} +1 -1
  6. package/build/{generateIndex-9864e722.mjs → generateIndex-hg6jRXQv.mjs} +97 -84
  7. package/build/generateIndex-hg6jRXQv.mjs.map +1 -0
  8. package/build/{generateParameterType-32abb018.mjs → generateParameterType-CDjqLM4J.mjs} +3 -4
  9. package/build/{generateParameterType-32abb018.mjs.map → generateParameterType-CDjqLM4J.mjs.map} +1 -1
  10. package/build/{index-a87a7800.mjs → index-B2kXo6K7.mjs} +301 -89
  11. package/build/index-B2kXo6K7.mjs.map +1 -0
  12. package/build/{index-56178e55.mjs → index-BoGrZubW.mjs} +27 -25
  13. package/build/index-BoGrZubW.mjs.map +1 -0
  14. package/build/{postinstall-472e0106.mjs → postinstall-CbMUz2zy.mjs} +3 -4
  15. package/build/{postinstall-472e0106.mjs.map → postinstall-CbMUz2zy.mjs.map} +1 -1
  16. package/build/{publishNpm-7d02c52b.mjs → publishNpm-CrnuTwss.mjs} +12 -11
  17. package/build/publishNpm-CrnuTwss.mjs.map +1 -0
  18. package/build/rollup-UR3DADp8.mjs +198 -0
  19. package/build/rollup-UR3DADp8.mjs.map +1 -0
  20. package/build/scripts-Bfojy_uD.mjs +48 -0
  21. package/build/scripts-Bfojy_uD.mjs.map +1 -0
  22. package/build/versionFile-DSqOw-XB.mjs +208 -0
  23. package/build/versionFile-DSqOw-XB.mjs.map +1 -0
  24. package/lib/lib.mjs +448 -359
  25. package/package.json +15 -10
  26. package/readme.md +91 -10
  27. package/build/cli-e279c41e.mjs.map +0 -1
  28. package/build/generateIndex-9864e722.mjs.map +0 -1
  29. package/build/index-56178e55.mjs.map +0 -1
  30. package/build/index-a87a7800.mjs.map +0 -1
  31. package/build/publishNpm-7d02c52b.mjs.map +0 -1
  32. package/build/scripts-7ed8dff6.mjs +0 -10
  33. package/build/scripts-7ed8dff6.mjs.map +0 -1
  34. package/build/versionFile-4b06435d.mjs +0 -384
  35. package/build/versionFile-4b06435d.mjs.map +0 -1
package/build/bin.mjs CHANGED
@@ -2,5 +2,5 @@
2
2
  import 'source-map-support/register.js';
3
3
  import 'v8-compile-cache';
4
4
 
5
- import('./cli-e279c41e.mjs').then(function (n) { return n.x; });
5
+ import('./cli-CuiqZ39_.mjs').then(function (n) { return n.x; });
6
6
  //# sourceMappingURL=bin.mjs.map
@@ -12,7 +12,6 @@ import 'node:path';
12
12
  import 'node:fs';
13
13
  import require$$0 from 'assert';
14
14
  import require$$2 from 'events';
15
- import 'core-js/modules/es.typed-array.set.js';
16
15
  import require$$6 from 'util';
17
16
  import axios, { AxiosError } from 'axios';
18
17
  import inquirer from 'inquirer';
@@ -80,13 +79,16 @@ const getCreatorIndexParameterPrimaryJSType = (type)=>{
80
79
  return "string";
81
80
  }
82
81
  };
83
- const parseCreatorPackageName = (manifest)=>{
82
+ function parseCreatorPackageName(manifest) {
84
83
  const [domain, subdomain] = manifest.Package.split(".");
84
+ if (subdomain === undefined) {
85
+ throw new Error(`Expected "Package" field of the _Package.json file to contain a value in the form of Domain.SubDomain`);
86
+ }
85
87
  return {
86
88
  domain,
87
89
  subdomain
88
90
  };
89
- };
91
+ }
90
92
  /**
91
93
  * Detects the package at the given directory.
92
94
  *
@@ -220,25 +222,11 @@ function* iterateWorkspacePackages(workspace) {
220
222
  }
221
223
  }
222
224
 
223
- var writeFileAtomicExports = {};
224
- var writeFileAtomic = {
225
- get exports () {
226
- return writeFileAtomicExports;
227
- },
228
- set exports (v){
229
- writeFileAtomicExports = v;
230
- }
231
- };
225
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
232
226
 
233
- var imurmurhashExports = {};
234
- var imurmurhash = {
235
- get exports () {
236
- return imurmurhashExports;
237
- },
238
- set exports (v){
239
- imurmurhashExports = v;
240
- }
241
- };
227
+ var writeFileAtomic = {exports: {}};
228
+
229
+ var imurmurhash = {exports: {}};
242
230
 
243
231
  (function(module) {
244
232
  (function() {
@@ -349,32 +337,15 @@ var imurmurhash = {
349
337
  }
350
338
  })();
351
339
  })(imurmurhash);
340
+ var imurmurhashExports = imurmurhash.exports;
352
341
 
353
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
342
+ var signalExit = {exports: {}};
354
343
 
355
- var signalExitExports = {};
356
- var signalExit = {
357
- get exports () {
358
- return signalExitExports;
359
- },
360
- set exports (v){
361
- signalExitExports = v;
362
- }
363
- };
364
-
365
- var signalsExports = {};
366
- var signals$1 = {
367
- get exports () {
368
- return signalsExports;
369
- },
370
- set exports (v){
371
- signalsExports = v;
372
- }
373
- };
344
+ var signals$1 = {exports: {}};
374
345
 
375
346
  var hasRequiredSignals;
376
347
  function requireSignals() {
377
- if (hasRequiredSignals) return signalsExports;
348
+ if (hasRequiredSignals) return signals$1.exports;
378
349
  hasRequiredSignals = 1;
379
350
  (function(module) {
380
351
  // This is not the set of all possible signals.
@@ -411,7 +382,7 @@ function requireSignals() {
411
382
  module.exports.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED');
412
383
  }
413
384
  })(signals$1);
414
- return signalsExports;
385
+ return signals$1.exports;
415
386
  }
416
387
 
417
388
  // Note: since nyc uses this module to output coverage, any lines
@@ -486,7 +457,7 @@ const processOk = function(process) {
486
457
  process$1.reallyExit = originalProcessReallyExit;
487
458
  emitter.count -= 1;
488
459
  };
489
- signalExitExports.unload = unload;
460
+ signalExit.exports.unload = unload;
490
461
  var emit = function emit(event, code, signal) {
491
462
  /* istanbul ignore if */ if (emitter.emitted[event]) {
492
463
  return;
@@ -519,7 +490,7 @@ const processOk = function(process) {
519
490
  }
520
491
  };
521
492
  });
522
- signalExitExports.signals = function() {
493
+ signalExit.exports.signals = function() {
523
494
  return signals;
524
495
  };
525
496
  var loaded = false;
@@ -544,7 +515,7 @@ const processOk = function(process) {
544
515
  process$1.emit = processEmit;
545
516
  process$1.reallyExit = processReallyExit;
546
517
  };
547
- signalExitExports.load = load;
518
+ signalExit.exports.load = load;
548
519
  var originalProcessReallyExit = process$1.reallyExit;
549
520
  var processReallyExit = function processReallyExit(code) {
550
521
  /* istanbul ignore if */ if (!processOk(commonjsGlobal.process)) {
@@ -570,6 +541,7 @@ const processOk = function(process) {
570
541
  }
571
542
  };
572
543
  }
544
+ var signalExitExports = signalExit.exports;
573
545
 
574
546
  var isTypedarray = isTypedArray$2;
575
547
  isTypedArray$2.strict = isStrictTypedArray;
@@ -613,17 +585,17 @@ var typedarrayToBuffer = function typedarrayToBuffer(arr) {
613
585
  };
614
586
 
615
587
  writeFileAtomic.exports = writeFile;
616
- writeFileAtomicExports.sync = writeFileSync;
617
- writeFileAtomicExports._getTmpname = getTmpname // for testing
588
+ writeFileAtomic.exports.sync = writeFileSync;
589
+ writeFileAtomic.exports._getTmpname = getTmpname // for testing
618
590
  ;
619
- writeFileAtomicExports._cleanupOnExit = cleanupOnExit;
591
+ writeFileAtomic.exports._cleanupOnExit = cleanupOnExit;
620
592
  const fs = fs__default;
621
593
  const MurmurHash3 = imurmurhashExports;
622
594
  const onExit = signalExitExports;
623
595
  const path = path__default;
624
596
  const isTypedArray = isTypedarray;
625
597
  const typedArrayToBuffer = typedarrayToBuffer;
626
- const { promisify } = require$$6;
598
+ const { promisify } = require$$6;
627
599
  const activeFiles = {};
628
600
  // if we run inside of a worker_thread, `process.pid` is not unique
629
601
  /* istanbul ignore next */ const threadId = function getId() {
@@ -651,10 +623,8 @@ function serializeActiveFile(absoluteName) {
651
623
  return new Promise((resolve)=>{
652
624
  // make a queue if it doesn't already exist
653
625
  if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [];
654
- activeFiles[absoluteName].push(resolve) // add this job to the queue
655
- ;
656
- if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one
657
- ;
626
+ activeFiles[absoluteName].push(resolve); // add this job to the queue
627
+ if (activeFiles[absoluteName].length === 1) resolve(); // kick off the first one
658
628
  });
659
629
  }
660
630
  // https://github.com/isaacs/node-graceful-fs/blob/master/polyfills.js#L315-L342
@@ -738,11 +708,9 @@ async function writeFileAsync(filename, data, options = {}) {
738
708
  }
739
709
  removeOnExitHandler();
740
710
  await promisify(fs.unlink)(tmpfile).catch(()=>{});
741
- activeFiles[absoluteName].shift() // remove the element added by serializeSameFile
742
- ;
711
+ activeFiles[absoluteName].shift(); // remove the element added by serializeSameFile
743
712
  if (activeFiles[absoluteName].length > 0) {
744
- activeFiles[absoluteName][0]() // start next job if one is pending
745
- ;
713
+ activeFiles[absoluteName][0](); // start next job if one is pending
746
714
  } else delete activeFiles[absoluteName];
747
715
  }
748
716
  }
@@ -792,7 +760,7 @@ function writeFileSync(filename, data, options) {
792
760
  const removeOnExitHandler = onExit(cleanup);
793
761
  let threw = true;
794
762
  try {
795
- fd = fs.openSync(tmpfile, 'w', options.mode || 0o666);
763
+ fd = fs.openSync(tmpfile, 'w', options.mode || 438);
796
764
  if (options.tmpfileCreated) {
797
765
  options.tmpfileCreated(tmpfile);
798
766
  }
@@ -850,7 +818,7 @@ const PLUGIN_ID = "0feba3a0-b6d1-11e6-9598-0800200c9a66";
850
818
  *
851
819
  * @param {SessionStartParams} params
852
820
  * @returns
853
- */ const startSession = async ({ url , authentication , ...params })=>{
821
+ */ const startSession = async ({ url, authentication, ...params })=>{
854
822
  const payload = {
855
823
  ...params,
856
824
  user: undefined,
@@ -864,7 +832,7 @@ const PLUGIN_ID = "0feba3a0-b6d1-11e6-9598-0800200c9a66";
864
832
  } else if (authentication.type === "license") {
865
833
  payload.license = authentication.license;
866
834
  }
867
- const { data: { session: sessionId , state , response } } = await axios.post(`Session/Start2`, JSON.stringify(payload), {
835
+ const { data: { session: sessionId, state, response } } = await axios.post(`Session/Start2`, JSON.stringify(payload), {
868
836
  baseURL: url
869
837
  });
870
838
  if (state !== "SUCCESS") {
@@ -887,7 +855,7 @@ const closeSession = async (session)=>{
887
855
  baseURL: session.url
888
856
  });
889
857
  };
890
- const uploadPackageFromBuffer = async (session, { name , version }, buffer)=>{
858
+ const uploadPackageFromBuffer = async (session, { name, version }, buffer)=>{
891
859
  try {
892
860
  await uploadPackageToUrl(session.url, `UploadPackage/${session.sessionId}/${name}_${version}`, buffer);
893
861
  } catch (err) {
@@ -903,7 +871,7 @@ const uploadPackageFromBuffer = async (session, { name , version }, buffer)=>{
903
871
  }
904
872
  };
905
873
  const uploadPackageToUrl = async (url, path, buffer)=>{
906
- const { data , status } = await axios.post(path, buffer, {
874
+ const { data, status } = await axios.post(path, buffer, {
907
875
  baseURL: url
908
876
  });
909
877
  let objectBody;
@@ -938,7 +906,7 @@ const uploadPackageToUrl = async (url, path, buffer)=>{
938
906
  return data;
939
907
  };
940
908
  const getExistingPackages = async (session)=>{
941
- const { data } = await axios.get(`Script/GetInformation/${session.sessionId}`, {
909
+ const { data } = await axios.get(`Script/GetInformation/${session.sessionId}`, {
942
910
  baseURL: session.url,
943
911
  validateStatus: (status)=>status === 404 || status === 200
944
912
  }).catch((err)=>{
@@ -950,7 +918,7 @@ const getExistingPackages = async (session)=>{
950
918
  const createDefaultPrompter = ()=>{
951
919
  return {
952
920
  confirm: async (message)=>{
953
- const { confirm } = await inquirer.prompt([
921
+ const { confirm } = await inquirer.prompt([
954
922
  {
955
923
  type: "confirm",
956
924
  message,
@@ -960,7 +928,7 @@ const createDefaultPrompter = ()=>{
960
928
  return confirm;
961
929
  },
962
930
  ask: async (question)=>{
963
- const { answer } = await inquirer.prompt([
931
+ const { answer } = await inquirer.prompt([
964
932
  {
965
933
  type: "list",
966
934
  message: question.message,
@@ -975,8 +943,8 @@ const createDefaultPrompter = ()=>{
975
943
  };
976
944
 
977
945
  const __filename$1 = fileURLToPath(import.meta.url);
978
- const __dirname = path$1.dirname(__filename$1);
979
- const pjson = JSON.parse(fs$1.readFileSync(path$1.join(__dirname, "..", "package.json"), "utf8"));
946
+ const __dirname$1 = path$1.dirname(__filename$1);
947
+ const pjson = JSON.parse(fs$1.readFileSync(path$1.join(__dirname$1, "..", "package.json"), "utf8"));
980
948
  const captureError = (err)=>{
981
949
  console.log("");
982
950
  if (process.env.NODE_ENV !== "production") {
@@ -1014,10 +982,9 @@ const buildOptions = {
1014
982
  }
1015
983
  };
1016
984
  const preCommandCheck = async (workspaceLocation)=>{
1017
- var _repositoryPackage_dependencies, _repositoryPackage_devDependencies;
1018
985
  const executedLocalPackager = __filename$1.startsWith(workspaceLocation.path);
1019
986
  const repositoryPackage = readWorkspaceNpmManifest(workspaceLocation);
1020
- if ((repositoryPackage == null ? void 0 : (_repositoryPackage_dependencies = repositoryPackage.dependencies) == null ? void 0 : _repositoryPackage_dependencies["@intelligentgraphics/ig.gfx.packager"]) || (repositoryPackage == null ? void 0 : (_repositoryPackage_devDependencies = repositoryPackage.devDependencies) == null ? void 0 : _repositoryPackage_devDependencies["@intelligentgraphics/ig.gfx.packager"])) {
987
+ if (repositoryPackage?.dependencies?.["@intelligentgraphics/ig.gfx.packager"] || repositoryPackage?.devDependencies?.["@intelligentgraphics/ig.gfx.packager"]) {
1021
988
  const parts = [
1022
989
  "Detected locally installed ig.gfx.packager."
1023
990
  ];
@@ -1072,14 +1039,14 @@ yargsInstance.command("build [directories...]", "Builds the specified directorie
1072
1039
  type: "boolean",
1073
1040
  default: false
1074
1041
  }
1075
- }), async ({ directories =[] , watch , ...options })=>{
1042
+ }), async ({ directories = [], watch, ...options })=>{
1076
1043
  const workspace = detectWorkspace(options.cwd);
1077
1044
  const folders = resolvePackagesFromMaybePatterns(directories, workspace);
1078
1045
  await preCommandCheck(workspace);
1079
1046
  if (folders.length === 0) {
1080
1047
  return console.log("No build targets found. Please check wether a folder with the provided name exists and wether it has _Package.json.");
1081
1048
  }
1082
- const { buildFolders , buildFoldersWatch } = await import('./index-a87a7800.mjs').then(function (n) { return n.i; });
1049
+ const { buildFolders, buildFoldersWatch } = await import('./index-B2kXo6K7.mjs').then(function (n) { return n.i; });
1083
1050
  if (watch) {
1084
1051
  await buildFoldersWatch({
1085
1052
  ...options,
@@ -1156,7 +1123,7 @@ yargsInstance.command("publish [directory]", "Publishes the specified directory"
1156
1123
  default: false,
1157
1124
  description: "Skip dependency checks"
1158
1125
  }
1159
- }), async ({ directory , user , password , service , license , ...options })=>{
1126
+ }), async ({ directory, user, password, service, license, ...options })=>{
1160
1127
  const workspace = detectWorkspace(options.cwd);
1161
1128
  const folder = detectPackage(workspace, directory);
1162
1129
  await preCommandCheck(workspace);
@@ -1186,7 +1153,7 @@ yargsInstance.command("publish [directory]", "Publishes the specified directory"
1186
1153
  license: content.toString("base64")
1187
1154
  };
1188
1155
  } catch (err) {
1189
- if ((err == null ? void 0 : err.code) === "ENOENT") {
1156
+ if (err?.code === "ENOENT") {
1190
1157
  captureError(new Error(`Expected to find a license file at path: ${fullLicensePath}`));
1191
1158
  return;
1192
1159
  }
@@ -1201,7 +1168,7 @@ yargsInstance.command("publish [directory]", "Publishes the specified directory"
1201
1168
  password
1202
1169
  };
1203
1170
  }
1204
- const { releaseFolder } = await import('./index-56178e55.mjs');
1171
+ const { releaseFolder } = await import('./index-BoGrZubW.mjs');
1205
1172
  const prompter = createDefaultPrompter();
1206
1173
  const fullOptions = {
1207
1174
  ...options,
@@ -1250,7 +1217,7 @@ yargsInstance.command("testConnection [directory]", "Tests connection to asset s
1250
1217
  description: "Path to a license file",
1251
1218
  default: process.env.IG_GFX_LICENSE
1252
1219
  }
1253
- }), async ({ user , password , service , license , subdomain , domain , address , directory })=>{
1220
+ }), async ({ user, password, service, license, subdomain, domain, address, directory })=>{
1254
1221
  if (!service) {
1255
1222
  captureError(new Error('The IG.Asset.Server url has to either be provided using the option --service or through the "IG_GFX_ASSET_SERVICE" environment variable'));
1256
1223
  return;
@@ -1275,7 +1242,7 @@ yargsInstance.command("testConnection [directory]", "Tests connection to asset s
1275
1242
  license: content.toString("base64")
1276
1243
  };
1277
1244
  } catch (err) {
1278
- if ((err == null ? void 0 : err.code) === "ENOENT") {
1245
+ if (err?.code === "ENOENT") {
1279
1246
  captureError(new Error(`Expected to find a license file at path: ${fullLicensePath}`));
1280
1247
  return;
1281
1248
  }
@@ -1329,10 +1296,10 @@ yargsInstance.command({
1329
1296
  default: false,
1330
1297
  description: "Marks non optional parameter object properties as required"
1331
1298
  }),
1332
- handler: async ({ directory , ignore , strictOptional })=>{
1299
+ handler: async ({ directory, ignore, strictOptional })=>{
1333
1300
  const workspace = detectWorkspace(process.cwd());
1334
1301
  await preCommandCheck(workspace);
1335
- const { generateIndex } = await import('./generateIndex-9864e722.mjs');
1302
+ const { generateIndex } = await import('./generateIndex-hg6jRXQv.mjs');
1336
1303
  const location = detectPackage(workspace, directory);
1337
1304
  generateIndex({
1338
1305
  location,
@@ -1344,10 +1311,10 @@ yargsInstance.command({
1344
1311
  });
1345
1312
  yargsInstance.command({
1346
1313
  command: "generateParameterType [directory] [name]",
1347
- handler: async ({ directory , name })=>{
1314
+ handler: async ({ directory, name })=>{
1348
1315
  const workspace = detectWorkspace(process.cwd());
1349
1316
  await preCommandCheck(workspace);
1350
- const { generateParameterType } = await import('./generateParameterType-32abb018.mjs');
1317
+ const { generateParameterType } = await import('./generateParameterType-CDjqLM4J.mjs');
1351
1318
  const location = detectPackage(workspace, directory);
1352
1319
  generateParameterType({
1353
1320
  location,
@@ -1360,7 +1327,7 @@ yargsInstance.command({
1360
1327
  command: "postinstall",
1361
1328
  builder: (argv)=>argv,
1362
1329
  handler: async ()=>{
1363
- const { executePostInstall } = await import('./postinstall-472e0106.mjs');
1330
+ const { executePostInstall } = await import('./postinstall-CbMUz2zy.mjs');
1364
1331
  executePostInstall(detectWorkspace(process.cwd()));
1365
1332
  },
1366
1333
  describe: "Runs postinstall tasks"
@@ -1378,9 +1345,9 @@ yargsInstance.command({
1378
1345
  type: "boolean"
1379
1346
  }
1380
1347
  }),
1381
- handler: async ({ directory , newVersion , dryRun })=>{
1348
+ handler: async ({ directory, newVersion, dryRun })=>{
1382
1349
  const workspace = detectWorkspace(process.cwd());
1383
- const { publishToNpm } = await import('./publishNpm-7d02c52b.mjs');
1350
+ const { publishToNpm } = await import('./publishNpm-CrnuTwss.mjs');
1384
1351
  await publishToNpm({
1385
1352
  workspace,
1386
1353
  location: detectPackage(workspace, directory),
@@ -1397,4 +1364,4 @@ var cli = /*#__PURE__*/Object.freeze({
1397
1364
  });
1398
1365
 
1399
1366
  export { INDEX_FILE as I, PACKAGE_FILE as P, readPackageCreatorIndex as a, readWorkspaceNpmManifest as b, closeSession as c, getWorkspaceOutputPath as d, readPackageAnimationList as e, isErrorEACCES as f, getExistingPackages as g, isErrorEPERM as h, isErrorENOENT as i, getPackageReleasesDirectory as j, writePackageCreatorIndex as k, getCreatorIndexParameterPrimaryJSType as l, getWorkspaceLibPath as m, readNpmManifest as n, stripUtf8Bom as o, parseCreatorPackageName as p, readPackageNpmManifest as q, readPackageCreatorManifest as r, startSession as s, writePackageNpmManifest as t, uploadPackageFromBuffer as u, iterateWorkspacePackages as v, writePackageCreatorManifest as w, cli as x };
1400
- //# sourceMappingURL=cli-e279c41e.mjs.map
1367
+ //# sourceMappingURL=cli-CuiqZ39_.mjs.map