@intelligentgraphics/ig.gfx.packager 3.1.4 → 3.2.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 (61) hide show
  1. package/build/bin.js +7 -0
  2. package/build/bin.js.map +1 -0
  3. package/build/build-CMbCj7x-.js +945 -0
  4. package/build/build-CMbCj7x-.js.map +1 -0
  5. package/build/build-kkMVBBJL.js +408 -0
  6. package/build/build-kkMVBBJL.js.map +1 -0
  7. package/build/cli-Co1DhAmx.js +405 -0
  8. package/build/cli-Co1DhAmx.js.map +1 -0
  9. package/build/docs-BkGeoYY2.js +30 -0
  10. package/build/docs-BkGeoYY2.js.map +1 -0
  11. package/build/generateIndex-C_DxQ2R4.js +209 -0
  12. package/build/generateIndex-C_DxQ2R4.js.map +1 -0
  13. package/build/generateParameterType-CdCi5BWM.js +46 -0
  14. package/build/generateParameterType-CdCi5BWM.js.map +1 -0
  15. package/build/package-DHx2bvVO.js +1 -0
  16. package/build/postinstall-DHTlEmNr.js +35 -0
  17. package/build/postinstall-DHTlEmNr.js.map +1 -0
  18. package/build/prompter-DONgUlzS.js +20 -0
  19. package/build/prompter-DONgUlzS.js.map +1 -0
  20. package/build/publish-E5zcQAo0.js +348 -0
  21. package/build/publish-E5zcQAo0.js.map +1 -0
  22. package/build/publishNpm-CBT1819u.js +115 -0
  23. package/build/publishNpm-CBT1819u.js.map +1 -0
  24. package/build/publishedPackage-D-KiU0FG.js +1 -0
  25. package/build/rollup-Csyght27.js +179 -0
  26. package/build/rollup-Csyght27.js.map +1 -0
  27. package/build/scripts-CBblHIL1.js +29 -0
  28. package/build/scripts-CBblHIL1.js.map +1 -0
  29. package/build/versionFile-DViDwgCa.js +123 -0
  30. package/build/versionFile-DViDwgCa.js.map +1 -0
  31. package/build/workspace-D0XY2EMu.js +1 -0
  32. package/lib/lib.js +1595 -0
  33. package/package.json +30 -30
  34. package/readme.md +5 -0
  35. package/build/bin.mjs +0 -5
  36. package/build/bin.mjs.map +0 -1
  37. package/build/cli-CTqQeYIu.mjs +0 -768
  38. package/build/cli-CTqQeYIu.mjs.map +0 -1
  39. package/build/dependencies-CCIr5dgH.mjs +0 -129
  40. package/build/dependencies-CCIr5dgH.mjs.map +0 -1
  41. package/build/docs-DvFV9WXA.mjs +0 -37
  42. package/build/docs-DvFV9WXA.mjs.map +0 -1
  43. package/build/generateIndex-COnAgsMM.mjs +0 -306
  44. package/build/generateIndex-COnAgsMM.mjs.map +0 -1
  45. package/build/generateParameterType-BFVUv72F.mjs +0 -71
  46. package/build/generateParameterType-BFVUv72F.mjs.map +0 -1
  47. package/build/index-Ck4_b8Wk.mjs +0 -1400
  48. package/build/index-Ck4_b8Wk.mjs.map +0 -1
  49. package/build/index-DHSUlJia.mjs +0 -477
  50. package/build/index-DHSUlJia.mjs.map +0 -1
  51. package/build/postinstall-BTuIhY_F.mjs +0 -61
  52. package/build/postinstall-BTuIhY_F.mjs.map +0 -1
  53. package/build/publishNpm-A02qW1UY.mjs +0 -167
  54. package/build/publishNpm-A02qW1UY.mjs.map +0 -1
  55. package/build/rollup-BeQ0dM8U.mjs +0 -221
  56. package/build/rollup-BeQ0dM8U.mjs.map +0 -1
  57. package/build/scripts-B3noxiX3.mjs +0 -45
  58. package/build/scripts-B3noxiX3.mjs.map +0 -1
  59. package/build/versionFile-B9z_qwQL.mjs +0 -206
  60. package/build/versionFile-B9z_qwQL.mjs.map +0 -1
  61. package/lib/lib.mjs +0 -2706
@@ -0,0 +1,405 @@
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";
5
+ import updateNotifier from "update-notifier";
6
+ import * as fs from "node:fs";
7
+ import * as path from "node:path";
8
+ import yargs from "yargs/yargs";
9
+ import { fileURLToPath } from "node:url";
10
+ import * as glob from "glob";
11
+ //#region src/cli.ts
12
+ const docsHandler = async (location, declarationFile, outFolder, name) => {
13
+ const { generateDocs } = await import("./docs-BkGeoYY2.js");
14
+ return await generateDocs(location, declarationFile, outFolder, name);
15
+ };
16
+ const __filename = fileURLToPath(import.meta.url);
17
+ const __dirname = path.dirname(__filename);
18
+ const pjson = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"));
19
+ const captureError = (err) => {
20
+ console.log("");
21
+ if (process.env.NODE_ENV !== "production") console.error(err);
22
+ else console.error("Stopped execution because of the following error: " + err.message);
23
+ process.exit(1);
24
+ };
25
+ const buildOptions = {
26
+ outDir: {
27
+ description: "Output directory",
28
+ type: "string",
29
+ default: "bin",
30
+ coerce: (input) => input === void 0 || input === null ? void 0 : path.resolve(process.cwd(), input)
31
+ },
32
+ minimize: {
33
+ description: "Minify output",
34
+ type: "boolean",
35
+ default: true
36
+ },
37
+ cwd: {
38
+ description: "Working directory",
39
+ type: "string",
40
+ default: process.cwd()
41
+ },
42
+ clean: {
43
+ description: "Empty output dir before compiling",
44
+ type: "boolean",
45
+ default: false
46
+ },
47
+ docs: {
48
+ type: "boolean",
49
+ default: false
50
+ }
51
+ };
52
+ const preCommandCheck = async (workspaceLocation) => {
53
+ const executedLocalPackager = __filename.startsWith(workspaceLocation.path);
54
+ const repositoryPackage = readWorkspaceNpmManifest(workspaceLocation);
55
+ if (repositoryPackage?.dependencies?.["@intelligentgraphics/ig.gfx.packager"] || repositoryPackage?.devDependencies?.["@intelligentgraphics/ig.gfx.packager"]) {
56
+ const parts = ["Detected locally installed ig.gfx.packager."];
57
+ if (executedLocalPackager) parts.push("Run \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.");
58
+ parts.push("Run \"npm uninstall @intelligentgraphics/ig.gfx.packager\" to remove the local version.");
59
+ console.error(parts.join("\n"));
60
+ process.exit(1);
61
+ }
62
+ if (executedLocalPackager) {
63
+ console.error(`Detected locally installed ig.gfx.packager.
64
+ Run "npm install -g @intelligentgraphics/ig.gfx.packager@latest" to install the global version, if it is not yet installed.
65
+ Run "npm install" to get rid of the local packager version.`);
66
+ process.exit(1);
67
+ }
68
+ updateNotifier({
69
+ pkg: pjson,
70
+ shouldNotifyInNpmScript: true,
71
+ updateCheckInterval: 1e3 * 60
72
+ }).notify({
73
+ isGlobal: true,
74
+ defer: true
75
+ });
76
+ if (repositoryPackage === void 0) throw new Error("Could not load package.json file in current directory");
77
+ repositoryPackage.scripts ??= {};
78
+ repositoryPackage.scripts.postinstall = "packager postinstall";
79
+ writeWorkspaceNpmManifest(workspaceLocation, repositoryPackage);
80
+ };
81
+ const yargsInstance = yargs(process.argv.slice(2));
82
+ const resolvePackagesFromMaybePatterns = (args = [], workspace) => {
83
+ const folders = /* @__PURE__ */ new Map();
84
+ for (const arg of args) glob.sync(arg, {
85
+ cwd: workspace.path,
86
+ absolute: true
87
+ }).forEach((folder) => {
88
+ try {
89
+ const location = detectPackage(workspace, folder);
90
+ folders.set(folder, location);
91
+ } catch (err) {}
92
+ });
93
+ return Array.from(folders.values());
94
+ };
95
+ yargsInstance.command("build [directories...]", "Builds the specified directories", (argv) => argv.options({
96
+ ...buildOptions,
97
+ watch: {
98
+ type: "boolean",
99
+ default: false
100
+ }
101
+ }), async ({ directories = [], watch, ...options }) => {
102
+ const workspace = detectWorkspace(options.cwd);
103
+ const folders = resolvePackagesFromMaybePatterns(directories, workspace);
104
+ await preCommandCheck(workspace);
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");
107
+ if (watch) {
108
+ await buildFoldersWatch({
109
+ ...options,
110
+ packages: folders,
111
+ workspace,
112
+ docsHandler
113
+ }).catch(captureError);
114
+ return;
115
+ }
116
+ await buildFolders({
117
+ ...options,
118
+ packages: folders,
119
+ workspace,
120
+ docsHandler
121
+ }).catch(captureError);
122
+ });
123
+ yargsInstance.command("publish [directory]", "Publishes the specified directory", (argv) => argv.options({
124
+ ...buildOptions,
125
+ noUpload: {
126
+ type: "boolean",
127
+ default: false,
128
+ description: "Only zip built files and do not upload them"
129
+ },
130
+ domain: {
131
+ type: "string",
132
+ description: "Overwrite the publish domain. Defaults to the one in the _Package.json"
133
+ },
134
+ subdomain: {
135
+ type: "string",
136
+ description: "Overwrite the publish subdomain. Defaults to the one in the _Package.json"
137
+ },
138
+ newVersion: {
139
+ type: "string",
140
+ description: "The name of the new version",
141
+ default: process.env.VERSION,
142
+ required: true
143
+ },
144
+ address: {
145
+ type: "string",
146
+ description: "Address",
147
+ default: "localhost"
148
+ },
149
+ service: {
150
+ type: "string",
151
+ description: "IG.Asset.Server url",
152
+ default: process.env.IG_GFX_ASSET_SERVICE,
153
+ required: true
154
+ },
155
+ user: {
156
+ type: "string",
157
+ description: "User",
158
+ default: process.env.IG_GFX_USER
159
+ },
160
+ password: {
161
+ type: "string",
162
+ description: "Password",
163
+ default: process.env.IG_GFX_PWD
164
+ },
165
+ docs: {
166
+ type: "boolean",
167
+ default: false,
168
+ description: "Generate typedoc documentation"
169
+ },
170
+ pushOnly: {
171
+ type: "boolean",
172
+ default: false,
173
+ description: "Try to upload an existing zip file without building and validating the version number"
174
+ },
175
+ license: {
176
+ type: "string",
177
+ description: "Path to a license file",
178
+ default: process.env.IG_GFX_LICENSE
179
+ },
180
+ skipDependencies: {
181
+ type: "boolean",
182
+ default: false,
183
+ description: "Skip dependency checks"
184
+ }
185
+ }), async ({ directory, user, password, service, license, ...options }) => {
186
+ const workspace = detectWorkspace(options.cwd);
187
+ const folder = detectPackage(workspace, directory);
188
+ await preCommandCheck(workspace);
189
+ if (!options.noUpload) {
190
+ if (!service) {
191
+ captureError(/* @__PURE__ */ 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"));
192
+ return;
193
+ }
194
+ if (!license && (!user || !password)) {
195
+ captureError(/* @__PURE__ */ new Error(`Expected authentication to be provided through either of the following methods:
196
+ - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable
197
+ - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`));
198
+ return;
199
+ }
200
+ if (license && !license.endsWith(".iglic")) {
201
+ captureError(/* @__PURE__ */ new Error(`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.`));
202
+ return;
203
+ }
204
+ }
205
+ let authentication;
206
+ if (license) {
207
+ const fullLicensePath = path.resolve(process.cwd(), license);
208
+ try {
209
+ authentication = {
210
+ type: "license",
211
+ license: fs.readFileSync(fullLicensePath).toString("base64")
212
+ };
213
+ } catch (err) {
214
+ if (typeof err === "object" && err !== null && "code" in err && err?.code === "ENOENT") {
215
+ captureError(/* @__PURE__ */ new Error(`Expected to find a license file at path: ${fullLicensePath}`));
216
+ return;
217
+ }
218
+ captureError(/* @__PURE__ */ new Error(`Failed to read license file at path: ${fullLicensePath}`));
219
+ return;
220
+ }
221
+ } else if (user && password) {
222
+ console.log(`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`);
223
+ authentication = {
224
+ type: "credentials",
225
+ username: user,
226
+ password
227
+ };
228
+ }
229
+ const { releaseFolder } = await import("./publish-E5zcQAo0.js");
230
+ const prompter = createDefaultPrompter();
231
+ await releaseFolder({
232
+ ...options,
233
+ authentication,
234
+ service,
235
+ directory: folder,
236
+ banner: true,
237
+ prompter,
238
+ newVersion: options.newVersion,
239
+ workspace,
240
+ docsHandler
241
+ }).catch(captureError);
242
+ });
243
+ yargsInstance.command("testConnection [directory]", "Tests connection to asset service", (argv) => argv.options({
244
+ domain: {
245
+ type: "string",
246
+ description: "Overwrite the publish domain. Defaults to the one in the _Package.json"
247
+ },
248
+ subdomain: {
249
+ type: "string",
250
+ description: "Overwrite the publish subdomain. Defaults to the one in the _Package.json"
251
+ },
252
+ address: {
253
+ type: "string",
254
+ description: "Address",
255
+ default: "localhost"
256
+ },
257
+ service: {
258
+ type: "string",
259
+ description: "IG.Asset.Server url",
260
+ default: process.env.IG_GFX_ASSET_SERVICE,
261
+ required: true
262
+ },
263
+ user: {
264
+ type: "string",
265
+ description: "User",
266
+ default: process.env.IG_GFX_USER
267
+ },
268
+ password: {
269
+ type: "string",
270
+ description: "Password",
271
+ default: process.env.IG_GFX_PWD
272
+ },
273
+ license: {
274
+ type: "string",
275
+ description: "Path to a license file",
276
+ default: process.env.IG_GFX_LICENSE
277
+ }
278
+ }), async ({ user, password, service, license, subdomain, domain, address, directory }) => {
279
+ if (!service) {
280
+ captureError(/* @__PURE__ */ 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"));
281
+ return;
282
+ }
283
+ if (!license && (!user || !password)) {
284
+ captureError(/* @__PURE__ */ new Error(`Expected authentication to be provided through either of the following methods:
285
+ - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable
286
+ - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`));
287
+ return;
288
+ }
289
+ if (license && !license.endsWith(".iglic")) {
290
+ captureError(/* @__PURE__ */ new Error(`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.`));
291
+ return;
292
+ }
293
+ let authentication;
294
+ if (license) {
295
+ const fullLicensePath = path.resolve(process.cwd(), license);
296
+ try {
297
+ authentication = {
298
+ type: "license",
299
+ license: fs.readFileSync(fullLicensePath).toString("base64")
300
+ };
301
+ } catch (err) {
302
+ if (typeof err === "object" && err !== null && "code" in err && err?.code === "ENOENT") {
303
+ captureError(/* @__PURE__ */ new Error(`Expected to find a license file at path: ${fullLicensePath}`));
304
+ return;
305
+ }
306
+ captureError(/* @__PURE__ */ new Error(`Failed to read license file at path: ${fullLicensePath}`));
307
+ return;
308
+ }
309
+ } else if (user && password) {
310
+ console.log(`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`);
311
+ authentication = {
312
+ type: "credentials",
313
+ username: user,
314
+ password
315
+ };
316
+ }
317
+ if (authentication === void 0) throw new Error(`Expected authentication to be available`);
318
+ if (typeof directory === "string") {
319
+ const parsedName = parseCreatorPackageName(readPackageCreatorManifest(detectPackage(detectWorkspace(process.cwd()), directory)));
320
+ if (domain === void 0) domain = parsedName.domain;
321
+ if (subdomain === void 0) subdomain = parsedName.subdomain;
322
+ }
323
+ if (domain === void 0 || subdomain === void 0) throw new Error(`Expected either domain and subdomain to be provided through options or to be executed for a specific package directory`);
324
+ const session = await assetService_exports.startSession({
325
+ url: service,
326
+ address,
327
+ domain,
328
+ subDomain: subdomain,
329
+ authentication
330
+ });
331
+ await assetService_exports.closeSession(session);
332
+ console.log(`Asset service session successfully started and closed`);
333
+ });
334
+ yargsInstance.command({
335
+ command: "generateIndex [directory]",
336
+ builder: (argv) => argv.option("ignore", {
337
+ type: "array",
338
+ default: [],
339
+ description: "Files to ignore while generating index"
340
+ }).option("strictOptional", {
341
+ type: "boolean",
342
+ description: "Marks non optional parameter object properties as required"
343
+ }),
344
+ handler: async ({ directory, ignore, strictOptional }) => {
345
+ const workspace = detectWorkspace(process.cwd());
346
+ await preCommandCheck(workspace);
347
+ const { generateIndex } = await import("./generateIndex-C_DxQ2R4.js");
348
+ generateIndex({
349
+ location: detectPackage(workspace, directory),
350
+ ignore,
351
+ strictOptional
352
+ });
353
+ },
354
+ describe: "Generates an index file for a package based on typescript types"
355
+ });
356
+ yargsInstance.command({
357
+ command: "generateParameterType [directory] [name]",
358
+ handler: async ({ directory, name }) => {
359
+ const workspace = detectWorkspace(process.cwd());
360
+ await preCommandCheck(workspace);
361
+ const { generateParameterType } = await import("./generateParameterType-CdCi5BWM.js");
362
+ generateParameterType({
363
+ location: detectPackage(workspace, directory),
364
+ name
365
+ });
366
+ },
367
+ describe: "Generates a parameter type for an interactor or evaluator"
368
+ });
369
+ yargsInstance.command({
370
+ command: "postinstall",
371
+ builder: (argv) => argv,
372
+ handler: async () => {
373
+ const { executePostInstall } = await import("./postinstall-DHTlEmNr.js");
374
+ executePostInstall(detectWorkspace(process.cwd()));
375
+ },
376
+ describe: "Runs postinstall tasks"
377
+ });
378
+ yargsInstance.command({
379
+ command: "publishNpm [directory]",
380
+ builder: (argv) => argv.options({
381
+ newVersion: {
382
+ type: "string",
383
+ description: "Name of the new version",
384
+ default: process.env.VERSION,
385
+ required: true
386
+ },
387
+ dryRun: { type: "boolean" }
388
+ }),
389
+ handler: async ({ directory, newVersion, dryRun }) => {
390
+ const workspace = detectWorkspace(process.cwd());
391
+ const { publishToNpm } = await import("./publishNpm-CBT1819u.js");
392
+ await publishToNpm({
393
+ workspace,
394
+ location: detectPackage(workspace, directory),
395
+ version: newVersion,
396
+ dryRun
397
+ }).catch(captureError);
398
+ },
399
+ describe: "Publishes the package to npm"
400
+ });
401
+ yargsInstance.demandCommand().pkgConf("packager").showHelpOnFail(false).version(pjson.version).argv;
402
+ //#endregion
403
+ export {};
404
+
405
+ //# sourceMappingURL=cli-Co1DhAmx.js.map
@@ -0,0 +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;EACN,SAAS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,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"}
@@ -0,0 +1,30 @@
1
+ import "./build-kkMVBBJL.js";
2
+ import "./package-DHx2bvVO.js";
3
+ import * as path from "node:path";
4
+ import * as glob from "glob";
5
+ import ts from "typescript";
6
+ import * as typedoc from "typedoc";
7
+ //#region src/lib/docs.ts
8
+ async function generateDocs(location, declarationFile, outFolder, name) {
9
+ const mediaDir = path.join(location.manifestDir, "Media");
10
+ const app = await typedoc.Application.bootstrap({
11
+ entryPoints: [path.relative(process.cwd(), declarationFile).split(path.sep).join("/")],
12
+ out: outFolder,
13
+ tsconfig: path.join(location.scriptsDir, "tsconfig.json"),
14
+ skipErrorChecking: true,
15
+ basePath: mediaDir
16
+ });
17
+ app.options.setCompilerOptions([declarationFile], { target: ts.ScriptTarget.ES5 }, void 0);
18
+ app.options.setValue("name", name);
19
+ const [readmePath] = glob.sync("**/readme.md", {
20
+ absolute: true,
21
+ cwd: location.manifestDir
22
+ });
23
+ if (readmePath) app.options.setValue("readme", readmePath);
24
+ const project = await app.convert();
25
+ if (project) await app.generateDocs(project, outFolder);
26
+ }
27
+ //#endregion
28
+ export { generateDocs };
29
+
30
+ //# sourceMappingURL=docs-BkGeoYY2.js.map
@@ -0,0 +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"}