@intelligentgraphics/ig.gfx.packager 3.1.0-alpha.4 → 3.1.0-alpha.6

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 (33) hide show
  1. package/build/bin.mjs +1 -1
  2. package/build/{cli-DLGFANVF.mjs → cli-CRt1pnL8.mjs} +49 -639
  3. package/build/cli-CRt1pnL8.mjs.map +1 -0
  4. package/build/{dependencies-M5HDPf46.mjs → dependencies-DzwnAMHr.mjs} +2 -2
  5. package/build/{dependencies-M5HDPf46.mjs.map → dependencies-DzwnAMHr.mjs.map} +1 -1
  6. package/build/docs-BlCIta3Y.mjs +37 -0
  7. package/build/docs-BlCIta3Y.mjs.map +1 -0
  8. package/build/{generateIndex-DRNwzIyR.mjs → generateIndex-1_US73VT.mjs} +3 -8
  9. package/build/{generateIndex-DRNwzIyR.mjs.map → generateIndex-1_US73VT.mjs.map} +1 -1
  10. package/build/{generateParameterType-9-1z1US9.mjs → generateParameterType-DSWCBqzV.mjs} +2 -7
  11. package/build/{generateParameterType-9-1z1US9.mjs.map → generateParameterType-DSWCBqzV.mjs.map} +1 -1
  12. package/build/{index-DV88vk2r.mjs → index-BIqEoSQH.mjs} +7 -11
  13. package/build/{index-DV88vk2r.mjs.map → index-BIqEoSQH.mjs.map} +1 -1
  14. package/build/{index-8OmlN_-6.mjs → index-Sj6AX2Pu.mjs} +37 -44
  15. package/build/index-Sj6AX2Pu.mjs.map +1 -0
  16. package/build/{postinstall-DleNm8LR.mjs → postinstall-DLxLg3tD.mjs} +4 -9
  17. package/build/postinstall-DLxLg3tD.mjs.map +1 -0
  18. package/build/{publishNpm-BecgvGe3.mjs → publishNpm-ByIPsGI3.mjs} +6 -11
  19. package/build/{publishNpm-BecgvGe3.mjs.map → publishNpm-ByIPsGI3.mjs.map} +1 -1
  20. package/build/{rollup-DXNQ8zID.mjs → rollup-Dspsy6kv.mjs} +115 -19
  21. package/build/rollup-Dspsy6kv.mjs.map +1 -0
  22. package/build/{scripts-DOxdNSgU.mjs → scripts-BmQnbRem.mjs} +2 -5
  23. package/build/scripts-BmQnbRem.mjs.map +1 -0
  24. package/build/{versionFile-LnFvSbd9.mjs → versionFile-CK9FMt3L.mjs} +3 -5
  25. package/build/{versionFile-LnFvSbd9.mjs.map → versionFile-CK9FMt3L.mjs.map} +1 -1
  26. package/lib/lib.mjs +32 -37
  27. package/package.json +15 -17
  28. package/readme.md +185 -176
  29. package/build/cli-DLGFANVF.mjs.map +0 -1
  30. package/build/index-8OmlN_-6.mjs.map +0 -1
  31. package/build/postinstall-DleNm8LR.mjs.map +0 -1
  32. package/build/rollup-DXNQ8zID.mjs.map +0 -1
  33. package/build/scripts-DOxdNSgU.mjs.map +0 -1
package/lib/lib.mjs CHANGED
@@ -7,10 +7,9 @@ import * as fs from 'fs';
7
7
  import { createWriteStream, createReadStream } from 'fs';
8
8
  import resolve from 'resolve';
9
9
  import 'write-pkg';
10
- import glob from 'glob';
10
+ import * as glob from 'glob';
11
11
  import 'write-json-file';
12
12
  import axios, { AxiosError } from 'axios';
13
- import typedoc from 'typedoc';
14
13
  import EventEmitter from 'events';
15
14
  import { SourceMapGenerator, SourceMapConsumer } from 'source-map-js';
16
15
  import Ajv from 'ajv';
@@ -480,7 +479,7 @@ const createTSCBuildParticipant = (location, outputDir, skipDeclarations)=>(env)
480
479
  type: "success",
481
480
  artefacts: {
482
481
  js: js.replace(`//# sourceMappingURL=out.js.map`, ""),
483
- declarations: definitions,
482
+ declarations: getDeclarationFileReferences(location, program, outputDir) + definitions,
484
483
  sourceMap
485
484
  }
486
485
  });
@@ -573,7 +572,7 @@ const createTSCWatchBuildParticipant = (location, outputDir, skipDeclarations)=>
573
572
  type: "success",
574
573
  artefacts: {
575
574
  js: emitState.js.replace(`//# sourceMappingURL=out.js.map`, ""),
576
- declarations: emitState.definitions,
575
+ declarations: getDeclarationFileReferences(location, watchProgram.getProgram(), outputDir) + emitState.definitions,
577
576
  sourceMap: emitState.sourceMap
578
577
  }
579
578
  });
@@ -615,37 +614,26 @@ const getCompilerOptions = (location, outputDir, skipDeclarations)=>{
615
614
  };
616
615
  return compilerOptions;
617
616
  };
618
-
619
- const generateDocs = async (location, declarationFile, outFolder, name)=>{
620
- const app = new typedoc.Application();
621
- const mediaDir = path.join(location.manifestDir, "Media");
622
- app.bootstrap({
623
- entryPoints: [
624
- declarationFile
625
- ],
626
- media: mediaDir,
627
- out: outFolder,
628
- tsconfig: path.join(location.scriptsDir, "tsconfig.json"),
629
- skipErrorChecking: true
630
- });
631
- app.options.setCompilerOptions([
632
- declarationFile
633
- ], {
634
- target: ts.ScriptTarget.ES5
635
- }, undefined);
636
- app.options.setValue("name", name);
637
- const [readmePath] = glob.sync("**/readme.md", {
638
- absolute: true,
639
- cwd: location.manifestDir
640
- });
641
- if (readmePath) {
642
- app.options.setValue("readme", readmePath);
617
+ function getDeclarationFileReferences(location, program, outputDir) {
618
+ const references = new Set();
619
+ for (const file of program.getSourceFiles()){
620
+ for (const reference of file.referencedFiles){
621
+ if (reference.preserve) {
622
+ continue;
623
+ }
624
+ const dir = path.dirname(file.fileName);
625
+ const absolute = path.resolve(dir, reference.fileName);
626
+ if (!absolute.startsWith(location.scriptsDir)) {
627
+ references.add(absolute);
628
+ }
629
+ }
643
630
  }
644
- const project = app.convert();
645
- if (project) {
646
- await app.generateDocs(project, outFolder);
631
+ let referenceString = Array.from(references, (reference)=>`/// <reference path="${path.relative(outputDir, reference)}" />`).join(EOL);
632
+ if (referenceString) {
633
+ referenceString += EOL;
647
634
  }
648
- };
635
+ return referenceString;
636
+ }
649
637
 
650
638
  // Stolen from ig.tools.core
651
639
  const toposort = (packages)=>{
@@ -1441,7 +1429,7 @@ async function buildFolders(options) {
1441
1429
  }
1442
1430
  if (typescriptFiles.length > 0) {
1443
1431
  if (isScriptPackageModules(tsConfig.options)) {
1444
- const { createRollupBuildParticipant } = await import('./rollup-BWzz69O-.mjs');
1432
+ const { createRollupBuildParticipant } = await import('./rollup-CpLu1Yc3.mjs');
1445
1433
  manager.addParticipant("rollup", createRollupBuildParticipant(location, data, outputDirectory, options.skipDeclarations ?? false));
1446
1434
  } else {
1447
1435
  manager.addParticipant("tsc", createTSCBuildParticipant(location, outputDirectory, options.skipDeclarations ?? false));
@@ -1462,8 +1450,11 @@ async function buildFolders(options) {
1462
1450
  manager.run();
1463
1451
  });
1464
1452
  if (options.docs) {
1453
+ if (!options.docsHandler) {
1454
+ throw new Error("Handler for typescript docs not available");
1455
+ }
1465
1456
  reporter.log("Generating typedoc documentation");
1466
- await generateDocs(location, path.join(outputDirectory, `${data.Package}.d.ts`), path.join(workspace.path, "docs", data.Package), data.Package);
1457
+ await options.docsHandler(location, path.join(outputDirectory, `${data.Package}.d.ts`), path.join(workspace.path, "docs", data.Package), data.Package);
1467
1458
  }
1468
1459
  index++;
1469
1460
  }
@@ -1502,7 +1493,7 @@ async function buildFoldersWatch(options) {
1502
1493
  }
1503
1494
  if (typescriptFiles.length > 0) {
1504
1495
  if (isScriptPackageModules(tsConfig.options)) {
1505
- const { createRollupWatchBuildParticipant } = await import('./rollup-BWzz69O-.mjs');
1496
+ const { createRollupWatchBuildParticipant } = await import('./rollup-CpLu1Yc3.mjs');
1506
1497
  manager.addParticipant("rollup", createRollupWatchBuildParticipant(location, data, outputDirectory, options.skipDeclarations ?? false));
1507
1498
  } else {
1508
1499
  manager.addParticipant("tsc", createTSCWatchBuildParticipant(location, outputDirectory, options.skipDeclarations ?? false));
@@ -1555,7 +1546,11 @@ async function writeBuildResult(buildResult, manifest, location, workspace, outp
1555
1546
  }
1556
1547
  });
1557
1548
  const minifiedPath = path.join(outputDirectory, `${manifest.Package}.min.js`);
1558
- await fs$1.writeFile(minifiedPath, minifyResult.code, {
1549
+ let code = minifyResult.code;
1550
+ if (minifyResult.map) {
1551
+ code += `\n//# sourceMappingURL=${manifest.Package}.min.js.map`;
1552
+ }
1553
+ await fs$1.writeFile(minifiedPath, code, {
1559
1554
  encoding: "utf8"
1560
1555
  });
1561
1556
  if (minifyResult.map !== undefined) {
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@intelligentgraphics/ig.gfx.packager",
3
- "version": "3.1.0-alpha.4",
4
- "description": "IG.GFX.Packager 3.1.0 Alpha 4 (3.1.0.3)",
3
+ "version": "3.1.0-alpha.6",
4
+ "description": "IG.GFX.Packager 3.1.0 Alpha 6 (3.1.0.5)",
5
5
  "author": "Michael Beier <mb@intelligentgraphics.biz>",
6
6
  "main": "lib/lib.mjs",
7
7
  "types": "lib/lib.d.ts",
8
- "private": false,
9
8
  "type": "module",
10
9
  "publishConfig": {
11
10
  "access": "public"
@@ -31,21 +30,19 @@
31
30
  "format": "prettier --write \"**/*.{ts,tsx,json}\""
32
31
  },
33
32
  "dependencies": {
34
- "@babel/preset-env": "^7.28.5",
35
33
  "@intelligentgraphics/declarationbundler": "^0.4.4",
36
34
  "@rollup/plugin-alias": "^6.0.0",
37
35
  "@rollup/plugin-babel": "^6.1.0",
38
- "@rollup/plugin-commonjs": "^25.0.7",
36
+ "@rollup/plugin-commonjs": "^29.0.0",
39
37
  "@rollup/plugin-json": "^6.1.0",
40
38
  "@rollup/plugin-node-resolve": "^16.0.3",
41
39
  "@rollup/plugin-typescript": "^12.3.0",
42
40
  "ajv": "^8.12.0",
43
41
  "axios": "^1.2.5",
44
42
  "core-js": "^3.46.0",
45
- "glob": "^9.3.0",
46
- "inquirer": "^9.1.4",
43
+ "glob": "^13.0.0",
44
+ "inquirer": "^13.0.1",
47
45
  "jszip": "^3.10.1",
48
- "lodash": "^4.17.21",
49
46
  "resolve": "^1.22.1",
50
47
  "rollup": "^4.53.2",
51
48
  "simple-git": "^3.16.0",
@@ -53,23 +50,24 @@
53
50
  "source-map-support": "^0.5.21",
54
51
  "terser": "^5.16.1",
55
52
  "tslib": "^2.8.1",
56
- "typedoc": "^0.24.8",
57
- "typescript": "5.4",
58
- "update-notifier": "^6.0.2",
53
+ "typedoc": "^0.28.14",
54
+ "typescript": "~5.9.3",
55
+ "update-notifier": "^7.3.1",
59
56
  "v8-compile-cache": "^2.3.0",
60
- "write-pkg": "^5.1.0",
61
- "yargs": "^17.6.2"
57
+ "write-pkg": "^7.0.0",
58
+ "yargs": "^18.0.0"
62
59
  },
63
60
  "devDependencies": {
61
+ "@intelligentgraphics/ig.gfx.packager-babel-preset-es5": "^3.1.0-alpha.7",
64
62
  "@intelligentgraphics/ig.gfx.tools.core": "^1.0.0",
65
- "@rollup/plugin-swc": "^0.3.0",
63
+ "@rollup/plugin-swc": "^0.4.0",
66
64
  "@swc/core": "^1.4.6",
67
- "@types/glob": "^8.0.1",
68
65
  "@types/inquirer": "^9.0.3",
69
- "@types/node": "^22.13.4",
66
+ "@types/node": "^24.10.1",
70
67
  "@types/update-notifier": "^6.0.1",
71
68
  "@types/yargs": "^17.0.2",
69
+ "prettier": "^3.7.1",
72
70
  "rollup-plugin-dts": "^6.1.0",
73
- "vitest": "^1.5.0"
71
+ "vitest": "^4.0.14"
74
72
  }
75
73
  }