@intelligentgraphics/ig.gfx.packager 3.0.17 → 3.0.19

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 (25) hide show
  1. package/build/bin.mjs +1 -1
  2. package/build/{cli-69a2e2f1.mjs → cli-4b4eb819.mjs} +9 -9
  3. package/build/cli-4b4eb819.mjs.map +1 -0
  4. package/build/{dependencies-4e6ba0ea.mjs → dependencies-7b889e67.mjs} +2 -2
  5. package/build/{dependencies-4e6ba0ea.mjs.map → dependencies-7b889e67.mjs.map} +1 -1
  6. package/build/{generateIndex-e1304f50.mjs → generateIndex-1c76f3b7.mjs} +2 -2
  7. package/build/{generateIndex-e1304f50.mjs.map → generateIndex-1c76f3b7.mjs.map} +1 -1
  8. package/build/{generateParameterType-a547b489.mjs → generateParameterType-ecd8f4b2.mjs} +2 -2
  9. package/build/{generateParameterType-a547b489.mjs.map → generateParameterType-ecd8f4b2.mjs.map} +1 -1
  10. package/build/{index-aecc36ad.mjs → index-14f27618.mjs} +336 -10
  11. package/build/index-14f27618.mjs.map +1 -0
  12. package/build/{index-ce491f2d.mjs → index-4dd728d6.mjs} +7 -7
  13. package/build/index-4dd728d6.mjs.map +1 -0
  14. package/build/{postinstall-6366aa29.mjs → postinstall-dce685cf.mjs} +3 -3
  15. package/build/{postinstall-6366aa29.mjs.map → postinstall-dce685cf.mjs.map} +1 -1
  16. package/build/{publishNpm-7fe8b8ec.mjs → publishNpm-0bfe5bda.mjs} +4 -4
  17. package/build/{publishNpm-7fe8b8ec.mjs.map → publishNpm-0bfe5bda.mjs.map} +1 -1
  18. package/build/{versionFile-28e7ec79.mjs → versionFile-041c0e79.mjs} +2 -2
  19. package/build/{versionFile-28e7ec79.mjs.map → versionFile-041c0e79.mjs.map} +1 -1
  20. package/lib/lib.mjs +337 -11
  21. package/package.json +2 -2
  22. package/readme.md +8 -0
  23. package/build/cli-69a2e2f1.mjs.map +0 -1
  24. package/build/index-aecc36ad.mjs.map +0 -1
  25. package/build/index-ce491f2d.mjs.map +0 -1
package/lib/lib.mjs CHANGED
@@ -56,10 +56,10 @@ const PACKAGE_FILE = "_Package.json";
56
56
  const INDEX_FILE = "_Index.json";
57
57
  const ANIMATION_FILE_SUFFIX = ".animation.json";
58
58
  const parseCreatorPackageName = (manifest)=>{
59
- const [domain, ...subdomainParts] = manifest.Package.split(".");
59
+ const [domain, subdomain] = manifest.Package.split(".");
60
60
  return {
61
61
  domain,
62
- subdomain: subdomainParts.join(".")
62
+ subdomain
63
63
  };
64
64
  };
65
65
  const readPackageCreatorManifest = (location)=>{
@@ -496,16 +496,342 @@ const toposort = (packages)=>{
496
496
  return result;
497
497
  };
498
498
 
499
+ var animationSchema = {
500
+ $schema: "http://json-schema.org/draft-07/schema",
501
+ $id: "https://archive.intelligentgraphics.biz/schemas/gfx/animation.json",
502
+ $comment: "Version 2023-02-17, Source: ig.data.gfx/Specs/animation.json",
503
+ title: "Animation description format",
504
+ additionalProperties: false,
505
+ type: "object",
506
+ properties: {
507
+ $schema: {
508
+ type: "string"
509
+ },
510
+ Id: {
511
+ type: "string",
512
+ description: "Animation id, to be unique in the project scope. Needs to be a valid JavaScript identifier."
513
+ },
514
+ Animations: {
515
+ type: "array",
516
+ description: "Declaration of animation states for gfx objects",
517
+ items: {
518
+ type: "object",
519
+ additionalProperties: false,
520
+ properties: {
521
+ _: {
522
+ type: "string",
523
+ description: "Comment"
524
+ },
525
+ Path: {
526
+ $ref: "#/definitions/igxcPath"
527
+ },
528
+ States: {
529
+ type: "object",
530
+ additionalProperties: {
531
+ type: "object",
532
+ additionalProperties: false,
533
+ properties: {
534
+ Position: {
535
+ $ref: "#/definitions/vec3"
536
+ },
537
+ Rotation: {
538
+ $ref: "#/definitions/rotation"
539
+ },
540
+ Scaling: {
541
+ $ref: "#/definitions/vec3"
542
+ },
543
+ Visibility: {
544
+ type: "boolean"
545
+ },
546
+ Deformation: {
547
+ anyOf: [
548
+ {
549
+ type: "number"
550
+ },
551
+ {
552
+ type: "string"
553
+ }
554
+ ]
555
+ }
556
+ }
557
+ }
558
+ }
559
+ }
560
+ }
561
+ },
562
+ Kinematics: {
563
+ oneOf: [
564
+ {
565
+ $ref: "#/definitions/kinematicChain"
566
+ },
567
+ {
568
+ type: "array",
569
+ items: {
570
+ $ref: "#/definitions/kinematicChain"
571
+ }
572
+ }
573
+ ]
574
+ },
575
+ LinkedPoints: {
576
+ type: "object",
577
+ additionalProperties: {
578
+ type: "array",
579
+ items: {
580
+ type: "string"
581
+ }
582
+ }
583
+ },
584
+ _: {
585
+ type: "string",
586
+ description: "Comment"
587
+ }
588
+ },
589
+ definitions: {
590
+ vec3: {
591
+ type: "object",
592
+ additionalProperties: false,
593
+ properties: {
594
+ X: {
595
+ anyOf: [
596
+ {
597
+ type: "number"
598
+ },
599
+ {
600
+ type: "string"
601
+ }
602
+ ]
603
+ },
604
+ Y: {
605
+ anyOf: [
606
+ {
607
+ type: "number"
608
+ },
609
+ {
610
+ type: "string"
611
+ }
612
+ ]
613
+ },
614
+ Z: {
615
+ anyOf: [
616
+ {
617
+ type: "number"
618
+ },
619
+ {
620
+ type: "string"
621
+ }
622
+ ]
623
+ },
624
+ _: {
625
+ type: "string",
626
+ description: "Comment"
627
+ }
628
+ }
629
+ },
630
+ rotation: {
631
+ type: "object",
632
+ additionalProperties: false,
633
+ properties: {
634
+ Q: {
635
+ description: "If true, the rotation is considered to be a Quaternion. Otherwise, it's interpreted as Euler arcs and W will be ignored.",
636
+ type: "boolean"
637
+ },
638
+ X: {
639
+ anyOf: [
640
+ {
641
+ type: "number"
642
+ },
643
+ {
644
+ type: "string"
645
+ }
646
+ ]
647
+ },
648
+ Y: {
649
+ anyOf: [
650
+ {
651
+ type: "number"
652
+ },
653
+ {
654
+ type: "string"
655
+ }
656
+ ]
657
+ },
658
+ Z: {
659
+ anyOf: [
660
+ {
661
+ type: "number"
662
+ },
663
+ {
664
+ type: "string"
665
+ }
666
+ ]
667
+ },
668
+ W: {
669
+ anyOf: [
670
+ {
671
+ type: "number"
672
+ },
673
+ {
674
+ type: "string"
675
+ }
676
+ ]
677
+ },
678
+ _: {
679
+ type: "string",
680
+ description: "Comment"
681
+ }
682
+ }
683
+ },
684
+ igxcPath: {
685
+ type: "string",
686
+ description: "Relative path of the target object",
687
+ pattern: "^((o|e)\\d+(\\.(o|e)\\d+)*|\\.)$"
688
+ },
689
+ param: {
690
+ type: "string",
691
+ pattern: "^Param\\d+$"
692
+ },
693
+ kinematicChain: {
694
+ type: "object",
695
+ additionalProperties: false,
696
+ properties: {
697
+ GeometryBase: {
698
+ type: "string"
699
+ },
700
+ Joints: {
701
+ type: "array",
702
+ items: {
703
+ type: "object",
704
+ additionalProperties: false,
705
+ properties: {
706
+ Name: {
707
+ oneOf: [
708
+ {
709
+ $ref: "#/definitions/param"
710
+ },
711
+ {
712
+ type: "string"
713
+ }
714
+ ]
715
+ },
716
+ HeadX: {
717
+ oneOf: [
718
+ {
719
+ $ref: "#/definitions/param"
720
+ },
721
+ {
722
+ $ref: "#/definitions/igxcPath"
723
+ }
724
+ ]
725
+ },
726
+ HeadY: {
727
+ oneOf: [
728
+ {
729
+ $ref: "#/definitions/param"
730
+ },
731
+ {
732
+ $ref: "#/definitions/igxcPath"
733
+ }
734
+ ]
735
+ },
736
+ HeadZ: {
737
+ oneOf: [
738
+ {
739
+ $ref: "#/definitions/param"
740
+ },
741
+ {
742
+ $ref: "#/definitions/igxcPath"
743
+ }
744
+ ]
745
+ },
746
+ Tail: {
747
+ oneOf: [
748
+ {
749
+ $ref: "#/definitions/param"
750
+ },
751
+ {
752
+ $ref: "#/definitions/igxcPath"
753
+ }
754
+ ]
755
+ },
756
+ LimitLeft: {
757
+ type: "number"
758
+ },
759
+ LimitRight: {
760
+ type: "number"
761
+ },
762
+ LimitUp: {
763
+ type: "number"
764
+ },
765
+ LimitDown: {
766
+ type: "number"
767
+ },
768
+ FollowJointNode: {
769
+ $ref: "#/definitions/igxcPath"
770
+ },
771
+ _TargetNodeForFollow: {
772
+ type: "string"
773
+ }
774
+ }
775
+ }
776
+ },
777
+ Target: {
778
+ oneOf: [
779
+ {
780
+ $ref: "#/definitions/igxcPath"
781
+ },
782
+ {
783
+ $ref: "#/definitions/param"
784
+ },
785
+ {
786
+ type: "string",
787
+ enum: [
788
+ "subbase"
789
+ ]
790
+ }
791
+ ]
792
+ },
793
+ Parent: {
794
+ oneOf: [
795
+ {
796
+ $ref: "#/definitions/igxcPath"
797
+ },
798
+ {
799
+ type: "string",
800
+ enum: [
801
+ "root"
802
+ ]
803
+ }
804
+ ]
805
+ },
806
+ Tolerance: {
807
+ type: "number"
808
+ },
809
+ MaxIterations: {
810
+ type: "integer"
811
+ },
812
+ _: {
813
+ type: "string",
814
+ description: "Comment"
815
+ },
816
+ __: {
817
+ type: "string",
818
+ description: "Super Comment"
819
+ }
820
+ }
821
+ }
822
+ }
823
+ };
824
+
499
825
  let validateAnimationJson;
500
826
  const getAnimationJsonValidation = async ()=>{
501
827
  if (validateAnimationJson === undefined) {
502
- validateAnimationJson = await axios.get("https://archive.intelligentgraphics.biz/schemas/gfx/animation.json").then(({ data })=>new Ajv({
503
- coerceTypes: true,
504
- allErrors: true,
505
- removeAdditional: true,
506
- useDefaults: "empty",
507
- validateSchema: "log"
508
- }).compile(data));
828
+ validateAnimationJson = new Ajv({
829
+ coerceTypes: true,
830
+ allErrors: true,
831
+ removeAdditional: true,
832
+ useDefaults: "empty",
833
+ validateSchema: "log"
834
+ }).compile(animationSchema);
509
835
  }
510
836
  return validateAnimationJson;
511
837
  };
@@ -1095,14 +1421,14 @@ const notRuntimeScripts = [
1095
1421
  "Evaluator"
1096
1422
  ];
1097
1423
  const buildArchiveFromPackage = async (packageLocation, data, binDir)=>{
1098
- const { domain , subdomain } = parseCreatorPackageName(data);
1424
+ const { domain } = parseCreatorPackageName(data);
1099
1425
  const logStep = (step)=>logPackageMessage(data.Package, step);
1100
1426
  const libFilePath = path.join(binDir, `${data.Package}.min.js`);
1101
1427
  const scriptDirectories = [
1102
1428
  packageLocation.path,
1103
1429
  packageLocation.scriptsDir
1104
1430
  ];
1105
- if (subdomain === "GFX.Standard") {
1431
+ if (data.Package === "IG.GFX.Standard") {
1106
1432
  logStep(`Including Images folder`);
1107
1433
  scriptDirectories.push(path.join(packageLocation.path, "Images"));
1108
1434
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@intelligentgraphics/ig.gfx.packager",
3
- "version": "3.0.17",
4
- "description": "IG.GFX.Packager 3.0.17 (3.0.17.100)",
3
+ "version": "3.0.19",
4
+ "description": "IG.GFX.Packager 3.0.19 (3.0.19.100)",
5
5
  "author": "Michael Beier <mb@intelligentgraphics.biz>",
6
6
  "main": "lib/lib.mjs",
7
7
  "types": "lib/lib.d.ts",
package/readme.md CHANGED
@@ -470,6 +470,14 @@ Afterwards you may need to reload your editor in order for the installed files t
470
470
 
471
471
  ## History
472
472
 
473
+ **IG.GFX.Packager 3.0.19**
474
+
475
+ - when parsing the package name as upload domain and sub domain, only use the first two parts that are separated by dots and ignore the rest -> IG.GFX.Standard -> Domain IG, SubDomain GFX
476
+
477
+ **IG.GFX.Packager 3.0.18**
478
+
479
+ - add animation json schema to own files and no longer load it from archive
480
+
473
481
  **IG.GFX.Packager 3.0.17**
474
482
 
475
483
  - use provided bin dir