@intelligentgraphics/ig.gfx.packager 3.0.9 → 3.0.11

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 (43) hide show
  1. package/build/bin.mjs +6 -0
  2. package/build/bin.mjs.map +1 -0
  3. package/build/cli-381989cc.mjs +1389 -0
  4. package/build/cli-381989cc.mjs.map +1 -0
  5. package/build/dependencies-1f665204.mjs +129 -0
  6. package/build/dependencies-1f665204.mjs.map +1 -0
  7. package/build/generateIndex-074f4aa1.mjs +257 -0
  8. package/build/generateIndex-074f4aa1.mjs.map +1 -0
  9. package/build/generateParameterType-4c9e95a5.mjs +75 -0
  10. package/build/generateParameterType-4c9e95a5.mjs.map +1 -0
  11. package/build/index-06ac2c4c.mjs +495 -0
  12. package/build/index-06ac2c4c.mjs.map +1 -0
  13. package/build/index-cc42a478.mjs +312 -0
  14. package/build/index-cc42a478.mjs.map +1 -0
  15. package/build/postinstall-c38d9b55.mjs +67 -0
  16. package/build/postinstall-c38d9b55.mjs.map +1 -0
  17. package/build/publishNpm-8ec1b871.mjs +134 -0
  18. package/build/publishNpm-8ec1b871.mjs.map +1 -0
  19. package/build/versionFile-aa8b6b7a.mjs +384 -0
  20. package/build/versionFile-aa8b6b7a.mjs.map +1 -0
  21. package/lib/lib.mjs +1476 -0
  22. package/package.json +13 -9
  23. package/readme.md +86 -2
  24. package/build/cli-17d957b0.js +0 -2531
  25. package/build/cli-17d957b0.js.map +0 -1
  26. package/build/dependencies-51916db0.js +0 -149
  27. package/build/dependencies-51916db0.js.map +0 -1
  28. package/build/generateIndex-59993f0f.js +0 -266
  29. package/build/generateIndex-59993f0f.js.map +0 -1
  30. package/build/generateParameterType-d3ab08fd.js +0 -74
  31. package/build/generateParameterType-d3ab08fd.js.map +0 -1
  32. package/build/index-a48c5d0a.js +0 -480
  33. package/build/index-a48c5d0a.js.map +0 -1
  34. package/build/index-ac2cd050.js +0 -308
  35. package/build/index-ac2cd050.js.map +0 -1
  36. package/build/index.mjs +0 -6
  37. package/build/index.mjs.map +0 -1
  38. package/build/postinstall-9990fb31.js +0 -64
  39. package/build/postinstall-9990fb31.js.map +0 -1
  40. package/build/publishNpm-74a96626.js +0 -133
  41. package/build/publishNpm-74a96626.js.map +0 -1
  42. package/build/versionFile-68e35b54.js +0 -370
  43. package/build/versionFile-68e35b54.js.map +0 -1
@@ -1,149 +0,0 @@
1
- import * as path from 'path';
2
- import * as fs from 'fs';
3
- import resolve from 'resolve';
4
- import { m as readNpmManifest, P as PACKAGE_FILE, n as stripUtf8Bom, i as isErrorENOENT, I as INDEX_FILE, c as readWorkspaceNpmManifest } from './cli-17d957b0.js';
5
-
6
- /**
7
- * Describes the location of a single published package.
8
- *
9
- * I.e. node_modules/@intelligentgraphics/3d.ig.gfx.core
10
- *
11
- * @export
12
- * @interface PublishedPackageLocation
13
- */
14
-
15
- /**
16
- * Detects a published package from a path.
17
- *
18
- * Can return undefined if the package is not installed.
19
- *
20
- * @param {string} resolveBasePath
21
- * @param {string} name
22
- * @return {*} {(PublishedPackageLocation | undefined)}
23
- */
24
- const detectPublishedPackageFromPath = (resolveBasePath, name) => {
25
- try {
26
- const manifestPath = resolve.sync(name + "/package.json", {
27
- basedir: resolveBasePath
28
- });
29
- const dir = path.dirname(manifestPath);
30
- return {
31
- _kind: "PublishedPackageLocation",
32
- path: dir
33
- };
34
- } catch (err) {
35
- return undefined;
36
- }
37
- };
38
- const readPublishedPackageNpmManifest = location => {
39
- return readNpmManifest(location.path);
40
- };
41
- const readPublishedPackageCreatorManifest = location => {
42
- try {
43
- const packageJsonPath = path.join(location.path, PACKAGE_FILE);
44
- const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {
45
- encoding: "utf8"
46
- }));
47
- const result = JSON.parse(packageJson);
48
- return {
49
- ...result,
50
- Scope: result.Scope || result.Package
51
- };
52
- } catch (err) {
53
- if (isErrorENOENT(err)) {
54
- return undefined;
55
- }
56
- throw err;
57
- }
58
- };
59
- const readPublishedPackageCreatorIndex = location => {
60
- try {
61
- const packageJsonPath = path.join(location.path, INDEX_FILE);
62
- const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {
63
- encoding: "utf8"
64
- }));
65
- const result = JSON.parse(packageJson);
66
- return result;
67
- } catch (err) {
68
- if (isErrorENOENT(err)) {
69
- return undefined;
70
- }
71
- throw err;
72
- }
73
- };
74
-
75
- // /**
76
- // * Determines the implicit dependencies of a an actual data workspace package.
77
- // *
78
- // * An implicit dependency is a dependency that is installed for the workspace and has the same runtime environment (evaluator, interactor) as the package.
79
- // *
80
- // * @param {WorkspaceLocation} workspace
81
- // * @param {CreatorPackage} creatorPackage
82
- // * @returns {PublishedPackageLocation[]}
83
- // */
84
- // export const determinePackageImplicitDependencies = (
85
- // workspace: WorkspaceLocation,
86
- // creatorPackage: CreatorPackage,
87
- // ): PublishedPackageLocation[] => {
88
- // const libraries = determineWorkspaceIGLibraries(workspace);
89
-
90
- // const results: PublishedPackageLocation[] = [];
91
- // for (const librarylocation of libraries) {
92
- // const libraryManifest =
93
- // readPublishedPackageCreatorManifest(librarylocation);
94
-
95
- // if (
96
- // libraryManifest !== undefined &&
97
- // (libraryManifest.Type === "Mixed" ||
98
- // libraryManifest.RunTime === creatorPackage.RunTime)
99
- // ) {
100
- // results.push(librarylocation);
101
- // }
102
- // }
103
-
104
- // return results;
105
- // };
106
-
107
- /**
108
- * Recursively determines all installed ig libraries for a workspace.
109
- *
110
- * @param {WorkspaceLocation} workspace
111
- * @returns {PublishedPackageLocation[]}
112
- */
113
- const determineWorkspaceIGLibraries = workspace => {
114
- const manifest = readWorkspaceNpmManifest(workspace);
115
- const libraries = collectIGLibraries(workspace, manifest);
116
- const results = new Map();
117
- for (const location of libraries) {
118
- const manifest = readPublishedPackageNpmManifest(location);
119
- if (!results.has(manifest.name)) {
120
- results.set(manifest.name, location);
121
- }
122
- }
123
- return Array.from(results.values());
124
- };
125
- const collectIGLibraries = (workspace, manifest) => {
126
- if (!manifest.dependencies) {
127
- return [];
128
- }
129
- const runtimeDependencies = Object.getOwnPropertyNames(manifest.dependencies);
130
- const result = [];
131
- for (const runtimeDependency of runtimeDependencies) {
132
- var _runtimeManifest$ig;
133
- const location = detectPublishedPackageFromPath(workspace.path, runtimeDependency);
134
- if (location === undefined) {
135
- continue;
136
- }
137
- const runtimeManifest = readPublishedPackageNpmManifest(location);
138
-
139
- // packages need to explicitly be marked as ig scriptingLibraries
140
- if ((_runtimeManifest$ig = runtimeManifest.ig) !== null && _runtimeManifest$ig !== void 0 && _runtimeManifest$ig.scriptingLibrary) {
141
- result.push(location);
142
- result.push(...collectIGLibraries(workspace, runtimeManifest));
143
- }
144
- }
145
- return result;
146
- };
147
-
148
- export { readPublishedPackageNpmManifest as a, readPublishedPackageCreatorManifest as b, determineWorkspaceIGLibraries as d, readPublishedPackageCreatorIndex as r };
149
- //# sourceMappingURL=dependencies-51916db0.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependencies-51916db0.js","sources":["../../tools.core/build/publishedPackage.mjs","../../tools.core/build/dependencies.mjs"],"sourcesContent":["import * as path from 'path';\nimport * as fs from 'fs';\nimport resolve from 'resolve';\nimport { readNpmManifest } from './npmPackage.mjs';\nimport { PACKAGE_FILE, INDEX_FILE } from './package.mjs';\nimport { isErrorENOENT } from './error.mjs';\nimport { stripUtf8Bom } from './stripUtf8Bom.mjs';\n\n/**\n * Describes the location of a single published package.\n *\n * I.e. node_modules/@intelligentgraphics/3d.ig.gfx.core\n *\n * @export\n * @interface PublishedPackageLocation\n */\n\n/**\n * Detects a published package from a path.\n *\n * Can return undefined if the package is not installed.\n *\n * @param {string} resolveBasePath\n * @param {string} name\n * @return {*} {(PublishedPackageLocation | undefined)}\n */\nconst detectPublishedPackageFromPath = (resolveBasePath, name) => {\n try {\n const manifestPath = resolve.sync(name + \"/package.json\", {\n basedir: resolveBasePath\n });\n const dir = path.dirname(manifestPath);\n return {\n _kind: \"PublishedPackageLocation\",\n path: dir\n };\n } catch (err) {\n return undefined;\n }\n};\nconst readPublishedPackageNpmManifest = location => {\n return readNpmManifest(location.path);\n};\nconst readPublishedPackageCreatorManifest = location => {\n try {\n const packageJsonPath = path.join(location.path, PACKAGE_FILE);\n const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {\n encoding: \"utf8\"\n }));\n const result = JSON.parse(packageJson);\n return {\n ...result,\n Scope: result.Scope || result.Package\n };\n } catch (err) {\n if (isErrorENOENT(err)) {\n return undefined;\n }\n throw err;\n }\n};\nconst getPublishedPackageCreatorIndexPath = location => path.join(location.path, INDEX_FILE);\nconst readPublishedPackageCreatorIndex = location => {\n try {\n const packageJsonPath = path.join(location.path, INDEX_FILE);\n const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {\n encoding: \"utf8\"\n }));\n const result = JSON.parse(packageJson);\n return result;\n } catch (err) {\n if (isErrorENOENT(err)) {\n return undefined;\n }\n throw err;\n }\n};\n\nexport { detectPublishedPackageFromPath, getPublishedPackageCreatorIndexPath, readPublishedPackageCreatorIndex, readPublishedPackageCreatorManifest, readPublishedPackageNpmManifest };\n//# sourceMappingURL=publishedPackage.mjs.map\n","import { readPublishedPackageNpmManifest, detectPublishedPackageFromPath } from './publishedPackage.mjs';\nimport { readWorkspaceNpmManifest } from './workspace.mjs';\n\n// /**\n// * Determines the implicit dependencies of a an actual data workspace package.\n// *\n// * An implicit dependency is a dependency that is installed for the workspace and has the same runtime environment (evaluator, interactor) as the package.\n// *\n// * @param {WorkspaceLocation} workspace\n// * @param {CreatorPackage} creatorPackage\n// * @returns {PublishedPackageLocation[]}\n// */\n// export const determinePackageImplicitDependencies = (\n// \tworkspace: WorkspaceLocation,\n// \tcreatorPackage: CreatorPackage,\n// ): PublishedPackageLocation[] => {\n// \tconst libraries = determineWorkspaceIGLibraries(workspace);\n\n// \tconst results: PublishedPackageLocation[] = [];\n// \tfor (const librarylocation of libraries) {\n// \t\tconst libraryManifest =\n// \t\t\treadPublishedPackageCreatorManifest(librarylocation);\n\n// \t\tif (\n// \t\t\tlibraryManifest !== undefined &&\n// \t\t\t(libraryManifest.Type === \"Mixed\" ||\n// \t\t\t\tlibraryManifest.RunTime === creatorPackage.RunTime)\n// \t\t) {\n// \t\t\tresults.push(librarylocation);\n// \t\t}\n// \t}\n\n// \treturn results;\n// };\n\n/**\n * Recursively determines all installed ig libraries for a workspace.\n *\n * @param {WorkspaceLocation} workspace\n * @returns {PublishedPackageLocation[]}\n */\nconst determineWorkspaceIGLibraries = workspace => {\n const manifest = readWorkspaceNpmManifest(workspace);\n const libraries = collectIGLibraries(workspace, manifest);\n const results = new Map();\n for (const location of libraries) {\n const manifest = readPublishedPackageNpmManifest(location);\n if (!results.has(manifest.name)) {\n results.set(manifest.name, location);\n }\n }\n return Array.from(results.values());\n};\nconst collectIGLibraries = (workspace, manifest) => {\n if (!manifest.dependencies) {\n return [];\n }\n const runtimeDependencies = Object.getOwnPropertyNames(manifest.dependencies);\n const result = [];\n for (const runtimeDependency of runtimeDependencies) {\n var _runtimeManifest$ig;\n const location = detectPublishedPackageFromPath(workspace.path, runtimeDependency);\n if (location === undefined) {\n continue;\n }\n const runtimeManifest = readPublishedPackageNpmManifest(location);\n\n // packages need to explicitly be marked as ig scriptingLibraries\n if ((_runtimeManifest$ig = runtimeManifest.ig) !== null && _runtimeManifest$ig !== void 0 && _runtimeManifest$ig.scriptingLibrary) {\n result.push(location);\n result.push(...collectIGLibraries(workspace, runtimeManifest));\n }\n }\n return result;\n};\n\nexport { determineWorkspaceIGLibraries };\n//# sourceMappingURL=dependencies.mjs.map\n"],"names":["detectPublishedPackageFromPath","resolveBasePath","name","manifestPath","resolve","sync","basedir","dir","path","dirname","_kind","err","undefined","readPublishedPackageNpmManifest","location","readNpmManifest","readPublishedPackageCreatorManifest","packageJsonPath","join","PACKAGE_FILE","packageJson","stripUtf8Bom","fs","readFileSync","encoding","result","JSON","parse","Scope","Package","isErrorENOENT","readPublishedPackageCreatorIndex","INDEX_FILE","determineWorkspaceIGLibraries","workspace","manifest","readWorkspaceNpmManifest","libraries","collectIGLibraries","results","Map","has","set","Array","from","values","dependencies","runtimeDependencies","Object","getOwnPropertyNames","runtimeDependency","_runtimeManifest$ig","runtimeManifest","ig","scriptingLibrary","push"],"mappings":";;;;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACaA,MAAAA,8BAA8B,GAAGA,CAC7CC,eAAuB,EACvBC,IAAY,KAC8B;EAC1C,IAAI;IACH,MAAMC,YAAY,GAAGC,OAAO,CAACC,IAAI,CAACH,IAAI,GAAG,eAAe,EAAE;AACzDI,MAAAA,OAAO,EAAEL,eAAAA;AACV,KAAC,CAAC,CAAA;AACF,IAAA,MAAMM,GAAG,GAAGC,IAAI,CAACC,OAAO,CAACN,YAAY,CAAC,CAAA;IACtC,OAAO;AACNO,MAAAA,KAAK,EAAE,0BAA0B;AACjCF,MAAAA,IAAI,EAAED,GAAAA;AACN,KAAA,CAAA;GACD,CAAC,OAAOI,GAAG,EAAE;AACb,IAAA,OAAOC,SAAS,CAAA;AACjB,GAAA;AACD,CAAA,CAAA;AAEaC,MAAAA,+BAA+B,GAC3CC,QAAkC,IACV;AACxB,EAAA,OAAOC,eAAe,CAAqBD,QAAQ,CAACN,IAAI,CAAC,CAAA;AAC1D,EAAA;AAEaQ,MAAAA,mCAAmC,GAC/CF,QAAkC,IACF;EAChC,IAAI;IACH,MAAMG,eAAe,GAAGT,IAAI,CAACU,IAAI,CAACJ,QAAQ,CAACN,IAAI,EAAEW,YAAY,CAAC,CAAA;IAC9D,MAAMC,WAAW,GAAGC,YAAY,CAC/BC,EAAE,CAACC,YAAY,CAACN,eAAe,EAAE;AAChCO,MAAAA,QAAQ,EAAE,MAAA;AACX,KAAC,CAAC,CACF,CAAA;AACD,IAAA,MAAMC,MAA0D,GAC/DC,IAAI,CAACC,KAAK,CAACP,WAAW,CAAC,CAAA;IACxB,OAAO;AACN,MAAA,GAAG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AAQ,CAAC,CAAA;MACrBW,MAAM,CAAC8B,IAAI,CAAC,GAAGjB,kBAAkB,CAACJ,SAAS,EAAEkB,eAAe,CAAC,CAAC,CAAA;AAC/D,KAAA;AACD,GAAA;AAEA,EAAA,OAAO3B,MAAM,CAAA;AACd,CAAC;;;;"}
@@ -1,266 +0,0 @@
1
- import ts from 'typescript';
2
- import 'path';
3
- import 'fs';
4
- import 'resolve';
5
- import 'write-pkg';
6
- import { h as getPackageTypescriptFiles, b as readPackageCreatorIndex, j as writePackageCreatorIndex } from './cli-17d957b0.js';
7
- import 'node:path';
8
- import 'node:fs';
9
- import 'axios';
10
- import 'update-notifier';
11
- import 'yargs/yargs';
12
- import 'url';
13
- import 'glob';
14
- import 'assert';
15
- import 'events';
16
- import 'util';
17
- import 'inquirer';
18
-
19
- /**
20
- * Extracts and returns script array for _Index.json from a src folder
21
- *
22
- * @param folderPath path to a src folder
23
- */
24
- function generateIndex({
25
- location,
26
- ignore = []
27
- }) {
28
- const files = getPackageTypescriptFiles(location);
29
- const filtered = files.filter(path => {
30
- return !ignore.some(suffix => path.endsWith(suffix));
31
- });
32
- const arr = [];
33
- const existingIndex = readPackageCreatorIndex(location) ?? [];
34
- const program = ts.createProgram(filtered, {
35
- allowJs: true
36
- });
37
- const typeChecker = program.getTypeChecker();
38
- filtered.forEach(file => {
39
- // Create a Program to represent the project, then pull out the
40
- // source file to parse its AST.
41
- const sourceFile = program.getSourceFile(file);
42
-
43
- // Loop through the root AST nodes of the file
44
- ts.forEachChild(sourceFile, node => {
45
- for (const scriptingClass of findScriptingClasses(node)) {
46
- if (scriptingClass.node.name === undefined) {
47
- throw new Error(`Expected ${scriptingClass.type} class to have a name`);
48
- }
49
- const name = typeChecker.getFullyQualifiedName(typeChecker.getSymbolAtLocation(scriptingClass.node.name));
50
- if (name.length > 45) {
51
- throw new Error(`Package name length >45 '${name}'`);
52
- }
53
- const parameterDeclaration = getScriptingClassParameterdeclaration(scriptingClass);
54
- const parametersType = parameterDeclaration === undefined ? undefined : typeChecker.getTypeAtLocation(parameterDeclaration);
55
- if (parametersType === undefined) {
56
- console.log(`Failed to find parameters type declaration for ${scriptingClass.type} ${name}. Skipping parameter list generation`);
57
- }
58
- const existingIndexEntry = existingIndex.find(entry => entry.Name === name);
59
- const obj = {
60
- Name: name,
61
- Description: existingIndexEntry === null || existingIndexEntry === void 0 ? void 0 : existingIndexEntry.Description,
62
- Type: scriptingClass.type === "evaluator" ? "Evaluator" : "Interactor",
63
- Parameters: []
64
- };
65
- const rawDocTags = ts.getJSDocTags(scriptingClass.node);
66
- const dict = getTagDict(rawDocTags);
67
- if (dict.summary) {
68
- obj.Description = dict.summary;
69
- } else {
70
- const comment = typeChecker.getTypeAtLocation(scriptingClass.node).symbol.getDocumentationComment(typeChecker).map(comment => comment.text).join(" ");
71
- if (comment) {
72
- obj.Description = comment;
73
- }
74
- }
75
- if (parametersType !== undefined) {
76
- obj.Parameters = genParameters(typeChecker.getPropertiesOfType(parametersType));
77
- if (obj.Parameters.length === 0 && parametersType.getStringIndexType() !== undefined) {
78
- obj.Parameters = (existingIndexEntry === null || existingIndexEntry === void 0 ? void 0 : existingIndexEntry.Parameters) ?? [];
79
- }
80
- } else if (existingIndexEntry !== undefined) {
81
- obj.Parameters = existingIndexEntry.Parameters;
82
- }
83
- arr.push(obj);
84
- }
85
- });
86
- });
87
- arr.sort((a, b) => a.Name.localeCompare(b.Name));
88
- writePackageCreatorIndex(location, arr);
89
- }
90
- function capitalizeFirstLetter(string) {
91
- return (string === null || string === void 0 ? void 0 : string.charAt(0).toUpperCase()) + (string === null || string === void 0 ? void 0 : string.slice(1));
92
- }
93
- function parseDefault(value, type) {
94
- const uType = capitalizeFirstLetter(type);
95
- if (value === "null") return null;
96
- switch (uType) {
97
- case "LengthM":
98
- case "ArcDEG":
99
- case "Float":
100
- return parseFloat(value);
101
- case "Integer":
102
- case "Int":
103
- return parseInt(value);
104
- case "Boolean":
105
- case "Bool":
106
- return value === "true";
107
- case "Material":
108
- case "String":
109
- case "Geometry":
110
- default:
111
- return value.replace(/^"/, "").replace(/"$/, "");
112
- }
113
- }
114
- function genParameters(properties) {
115
- return properties.map((symbol, i) => {
116
- var _symbol$getDeclaratio;
117
- const parameter = {
118
- Name: symbol.name,
119
- Description: undefined,
120
- Type: "String",
121
- Default: undefined,
122
- DisplayIndex: i + 1
123
- };
124
- if (parameter.Name.length > 45) {
125
- throw new Error(`Parameter name length >45 '${parameter.Name}'`);
126
- }
127
- let declaration = (_symbol$getDeclaratio = symbol.getDeclarations()) === null || _symbol$getDeclaratio === void 0 ? void 0 : _symbol$getDeclaratio[0];
128
- let documentationComment = symbol.getDocumentationComment(undefined);
129
- let checkLinksSymbol = symbol;
130
- while (checkLinksSymbol !== undefined && declaration === undefined) {
131
- const links = checkLinksSymbol.links;
132
- if (links !== null && links !== void 0 && links.syntheticOrigin) {
133
- var _links$syntheticOrigi;
134
- declaration = (_links$syntheticOrigi = links.syntheticOrigin.getDeclarations()) === null || _links$syntheticOrigi === void 0 ? void 0 : _links$syntheticOrigi[0];
135
- if (documentationComment.length === 0) {
136
- documentationComment = links.syntheticOrigin.getDocumentationComment(undefined);
137
- }
138
- checkLinksSymbol = links.syntheticOrigin;
139
- }
140
- }
141
- if (declaration === undefined) {
142
- const links = symbol.links;
143
- if (links !== null && links !== void 0 && links.syntheticOrigin) {
144
- var _links$syntheticOrigi2;
145
- declaration = (_links$syntheticOrigi2 = links.syntheticOrigin.getDeclarations()) === null || _links$syntheticOrigi2 === void 0 ? void 0 : _links$syntheticOrigi2[0];
146
- if (documentationComment.length === 0) {
147
- documentationComment = links.syntheticOrigin.getDocumentationComment(undefined);
148
- }
149
- }
150
- }
151
- if (declaration !== undefined) {
152
- const rawDocTags = ts.getJSDocTags(declaration);
153
- const dict = getTagDict(rawDocTags);
154
- if (dict.summary) {
155
- parameter.Description = dict.summary;
156
- } else {
157
- const comment = documentationComment.map(comment => comment.text).join(" ");
158
- if (comment) {
159
- parameter.Description = comment;
160
- }
161
- }
162
- if (dict.creatorType) {
163
- parameter.Type = dict.creatorType;
164
- }
165
- if (dict.default) {
166
- parameter.Default = parseDefault(dict.default, parameter.Type);
167
- }
168
- }
169
- return parameter;
170
- });
171
- }
172
- function getTagDict(tags) {
173
- const dict = {};
174
- for (const tag of tags) {
175
- dict[tag.tagName.text] = tag.comment;
176
- }
177
- return dict;
178
- }
179
- const getScriptingClassParameterdeclaration = scriptingClass => {
180
- for (const member of scriptingClass.node.members) {
181
- if (ts.isMethodDeclaration(member)) {
182
- for (let index = 0; index < member.parameters.length; index++) {
183
- const parameter = member.parameters[index];
184
- if (isScriptingClassParameterDeclaration(scriptingClass, member, index)) {
185
- return parameter;
186
- }
187
- }
188
- }
189
- if (ts.isConstructorDeclaration(member)) {
190
- for (let index = 0; index < member.parameters.length; index++) {
191
- const parameter = member.parameters[index];
192
- if (isScriptingClassParameterDeclaration(scriptingClass, member, index)) {
193
- return parameter;
194
- }
195
- }
196
- }
197
- }
198
- };
199
- const isScriptingClassParameterDeclaration = (scriptingClass, memberNode, parameterIndex) => {
200
- if (scriptingClass.type === "evaluator") {
201
- var _memberNode$name;
202
- return (memberNode === null || memberNode === void 0 ? void 0 : (_memberNode$name = memberNode.name) === null || _memberNode$name === void 0 ? void 0 : _memberNode$name.getText()) == "Create" && parameterIndex === 2;
203
- }
204
- if (scriptingClass.type === "interactor") {
205
- return memberNode.kind === ts.SyntaxKind.Constructor && parameterIndex === 0;
206
- }
207
- return false;
208
- };
209
- /**
210
- * Finds interactors and evaluators within a script file
211
- *
212
- * @param {ts.Node} node
213
- * @return {*}
214
- */
215
- const findScriptingClasses = node => {
216
- let body;
217
- if (ts.isModuleDeclaration(node)) {
218
- body = node.body;
219
- }
220
- if (body !== undefined && ts.isModuleDeclaration(body)) {
221
- body = body.body;
222
- }
223
- const classes = [];
224
- if (body !== undefined) {
225
- ts.forEachChild(body, child => {
226
- if (!ts.isClassDeclaration(child)) {
227
- return;
228
- }
229
- const scriptingClass = detectScriptingClass(child);
230
- if (scriptingClass !== undefined) {
231
- classes.push(scriptingClass);
232
- }
233
- });
234
- }
235
- return classes;
236
- };
237
- const detectScriptingClass = node => {
238
- var _node$heritageClauses, _node$heritageClauses2;
239
- const isEvaluator = (_node$heritageClauses = node.heritageClauses) === null || _node$heritageClauses === void 0 ? void 0 : _node$heritageClauses.some(clause => {
240
- if (clause.token !== ts.SyntaxKind.ExtendsKeyword && clause.token !== ts.SyntaxKind.ImplementsKeyword) {
241
- return false;
242
- }
243
- return clause.types.some(type => type.getText().includes("Evaluator"));
244
- });
245
- if (isEvaluator) {
246
- return {
247
- node,
248
- type: "evaluator"
249
- };
250
- }
251
- const isInteractor = (_node$heritageClauses2 = node.heritageClauses) === null || _node$heritageClauses2 === void 0 ? void 0 : _node$heritageClauses2.some(clause => {
252
- if (clause.token !== ts.SyntaxKind.ExtendsKeyword) {
253
- return false;
254
- }
255
- return clause.types.some(type => type.getText().includes("Interactor"));
256
- });
257
- if (isInteractor) {
258
- return {
259
- node,
260
- type: "interactor"
261
- };
262
- }
263
- };
264
-
265
- export { generateIndex, isScriptingClassParameterDeclaration };
266
- //# sourceMappingURL=generateIndex-59993f0f.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateIndex-59993f0f.js","sources":["../src/commands/generateIndex.ts"],"sourcesContent":["import ts from \"typescript\";\n\nimport {\n\tPackageLocation,\n\twritePackageCreatorIndex,\n\treadPackageCreatorIndex,\n} from \"../lib/package\";\nimport { getPackageTypescriptFiles } from \"../lib/scripts\";\nimport {\n\tCreatorIndexEntry,\n\tCreatorIndexParameter,\n\tCreatorIndexParameterType,\n} from \"../lib/package\";\n\nexport interface GenerateIndexOptions {\n\tignore?: string[];\n\tlocation: PackageLocation;\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({ location, ignore = [] }: GenerateIndexOptions) {\n\tconst files = getPackageTypescriptFiles(location);\n\tconst filtered = files.filter((path) => {\n\t\treturn !ignore.some((suffix) => path.endsWith(suffix));\n\t});\n\tconst arr: CreatorIndexEntry[] = [];\n\n\tconst existingIndex = readPackageCreatorIndex(location) ?? [];\n\n\tconst program = ts.createProgram(filtered, { allowJs: true });\n\tconst typeChecker = program.getTypeChecker();\n\tfiltered.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\t// Loop through the root AST nodes of the file\n\t\tts.forEachChild(sourceFile!, (node) => {\n\t\t\tfor (const scriptingClass of findScriptingClasses(node)) {\n\t\t\t\tif (scriptingClass.node.name === undefined) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Expected ${scriptingClass.type} class to have a name`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst name = typeChecker.getFullyQualifiedName(\n\t\t\t\t\ttypeChecker.getSymbolAtLocation(scriptingClass.node.name)!,\n\t\t\t\t);\n\n\t\t\t\tif (name.length > 45) {\n\t\t\t\t\tthrow new Error(`Package name length >45 '${name}'`);\n\t\t\t\t}\n\n\t\t\t\tconst parameterDeclaration =\n\t\t\t\t\tgetScriptingClassParameterdeclaration(scriptingClass);\n\n\t\t\t\tconst parametersType =\n\t\t\t\t\tparameterDeclaration === undefined\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: typeChecker.getTypeAtLocation(parameterDeclaration);\n\n\t\t\t\tif (parametersType === undefined) {\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t`Failed to find parameters type declaration for ${scriptingClass.type} ${name}. Skipping parameter list generation`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst existingIndexEntry = existingIndex.find(\n\t\t\t\t\t(entry) => entry.Name === name,\n\t\t\t\t);\n\n\t\t\t\tconst obj: CreatorIndexEntry = {\n\t\t\t\t\tName: name,\n\t\t\t\t\tDescription: existingIndexEntry?.Description,\n\t\t\t\t\tType:\n\t\t\t\t\t\tscriptingClass.type === \"evaluator\"\n\t\t\t\t\t\t\t? \"Evaluator\"\n\t\t\t\t\t\t\t: \"Interactor\",\n\t\t\t\t\tParameters: [],\n\t\t\t\t};\n\n\t\t\t\tconst rawDocTags = ts.getJSDocTags(scriptingClass.node);\n\n\t\t\t\tconst dict = getTagDict(rawDocTags);\n\t\t\t\tif (dict.summary) {\n\t\t\t\t\tobj.Description = dict.summary;\n\t\t\t\t} else {\n\t\t\t\t\tconst comment = typeChecker\n\t\t\t\t\t\t.getTypeAtLocation(scriptingClass.node)\n\t\t\t\t\t\t.symbol.getDocumentationComment(typeChecker)\n\t\t\t\t\t\t.map((comment) => comment.text)\n\t\t\t\t\t\t.join(\" \");\n\n\t\t\t\t\tif (comment) {\n\t\t\t\t\t\tobj.Description = comment;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (parametersType !== undefined) {\n\t\t\t\t\tobj.Parameters = genParameters(\n\t\t\t\t\t\ttypeChecker.getPropertiesOfType(parametersType),\n\t\t\t\t\t);\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tobj.Parameters.length === 0 &&\n\t\t\t\t\t\tparametersType.getStringIndexType() !== undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\tobj.Parameters = existingIndexEntry?.Parameters ?? [];\n\t\t\t\t\t}\n\t\t\t\t} else if (existingIndexEntry !== undefined) {\n\t\t\t\t\tobj.Parameters = existingIndexEntry.Parameters;\n\t\t\t\t}\n\n\t\t\t\tarr.push(obj);\n\t\t\t}\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\nfunction 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\nfunction genParameters(properties: ts.Symbol[]): 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\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 links = (\n\t\t\t\tsymbol 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\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}\n\t\t\tif (dict.default) {\n\t\t\t\tparameter.Default = parseDefault(dict.default, parameter.Type);\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] = tag.comment;\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\nexport const 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 */\nconst findScriptingClasses = (node: ts.Node) => {\n\tlet body: ts.NamespaceBody | ts.JSDocNamespaceBody | undefined;\n\n\tif (ts.isModuleDeclaration(node)) {\n\t\tbody = node.body;\n\t}\n\tif (body !== undefined && ts.isModuleDeclaration(body)) {\n\t\tbody = body.body;\n\t}\n\n\tconst classes: ScriptingClass[] = [];\n\n\tif (body !== undefined) {\n\t\tts.forEachChild(body, (child) => {\n\t\t\tif (!ts.isClassDeclaration(child)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst scriptingClass = detectScriptingClass(child);\n\n\t\t\tif (scriptingClass !== undefined) {\n\t\t\t\tclasses.push(scriptingClass);\n\t\t\t}\n\t\t});\n\t}\n\n\treturn classes;\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"],"names":["generateIndex","location","ignore","files","getPackageTypescriptFiles","filtered","filter","path","some","suffix","endsWith","arr","existingIndex","readPackageCreatorIndex","program","ts","createProgram","allowJs","typeChecker","getTypeChecker","forEach","file","sourceFile","getSourceFile","forEachChild","node","scriptingClass","findScriptingClasses","name","undefined","Error","type","getFullyQualifiedName","getSymbolAtLocation","length","parameterDeclaration","getScriptingClassParameterdeclaration","parametersType","getTypeAtLocation","console","log","existingIndexEntry","find","entry","Name","obj","Description","Type","Parameters","rawDocTags","getJSDocTags","dict","getTagDict","summary","comment","symbol","getDocumentationComment","map","text","join","genParameters","getPropertiesOfType","getStringIndexType","push","sort","a","b","localeCompare","writePackageCreatorIndex","capitalizeFirstLetter","string","charAt","toUpperCase","slice","parseDefault","value","uType","parseFloat","parseInt","replace","properties","i","_symbol$getDeclaratio","parameter","Default","DisplayIndex","declaration","getDeclarations","documentationComment","checkLinksSymbol","links","syntheticOrigin","_links$syntheticOrigi","_links$syntheticOrigi2","creatorType","default","tags","tag","tagName","member","members","isMethodDeclaration","index","parameters","isScriptingClassParameterDeclaration","isConstructorDeclaration","memberNode","parameterIndex","_memberNode$name","getText","kind","SyntaxKind","Constructor","body","isModuleDeclaration","classes","child","isClassDeclaration","detectScriptingClass","_node$heritageClauses","_node$heritageClauses2","isEvaluator","heritageClauses","clause","token","ExtendsKeyword","ImplementsKeyword","types","includes","isInteractor"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAaA,CAAC;EAAEC,QAAQ;AAAEC,EAAAA,MAAM,GAAG,EAAA;AAAyB,CAAC,EAAE;AAC9E,EAAA,MAAMC,KAAK,GAAGC,yBAAyB,CAACH,QAAQ,CAAC,CAAA;AACjD,EAAA,MAAMI,QAAQ,GAAGF,KAAK,CAACG,MAAM,CAAEC,IAAI,IAAK;AACvC,IAAA,OAAO,CAACL,MAAM,CAACM,IAAI,CAAEC,MAAM,IAAKF,IAAI,CAACG,QAAQ,CAACD,MAAM,CAAC,CAAC,CAAA;AACvD,GAAC,CAAC,CAAA;EACF,MAAME,GAAwB,GAAG,EAAE,CAAA;AAEnC,EAAA,MAAMC,aAAa,GAAGC,uBAAuB,CAACZ,QAAQ,CAAC,IAAI,EAAE,CAAA;AAE7D,EAAA,MAAMa,OAAO,GAAGC,EAAE,CAACC,aAAa,CAACX,QAAQ,EAAE;AAAEY,IAAAA,OAAO,EAAE,IAAA;AAAK,GAAC,CAAC,CAAA;AAC7D,EAAA,MAAMC,WAAW,GAAGJ,OAAO,CAACK,cAA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AC,CACrC,CAAA;AACF,GAAC,CAAC,CAAA;AAEF,EAAA,IAAIC,YAAY,EAAE;IACjB,OAAO;MACNxG,IAAI;AACJM,MAAAA,IAAI,EAAE,YAAA;KACN,CAAA;AACF,GAAA;AACD,CAAC;;;;"}
@@ -1,74 +0,0 @@
1
- import ts from 'typescript';
2
- import * as fs from 'fs';
3
- import * as path from 'path';
4
- import * as os from 'os';
5
- import 'resolve';
6
- import 'write-pkg';
7
- import { b as readPackageCreatorIndex, r as readPackageCreatorManifest, k as getCreatorIndexParameterPrimaryJSType } from './cli-17d957b0.js';
8
- import 'glob';
9
- import 'node:path';
10
- import 'node:fs';
11
- import 'axios';
12
- import 'update-notifier';
13
- import 'yargs/yargs';
14
- import 'url';
15
- import 'assert';
16
- import 'events';
17
- import 'util';
18
- import 'inquirer';
19
-
20
- const generateParameterType = ({
21
- location,
22
- name
23
- }) => {
24
- const index = readPackageCreatorIndex(location);
25
- const manifest = readPackageCreatorManifest(location);
26
- if (index === undefined) {
27
- throw new Error(`Could not find the _Index.json file`);
28
- }
29
- let qualifiedName = name;
30
- let className = name;
31
- const scope = manifest.Scope ?? manifest.Package;
32
- if (name.startsWith(scope)) {
33
- className = name.slice(scope.length + 1);
34
- } else {
35
- qualifiedName = `${scope}.${name}`;
36
- }
37
- const informations = index.find(item => item.Name === qualifiedName);
38
- if (informations === undefined) {
39
- throw new Error(`Could not find an index entry for ${name}`);
40
- }
41
- const members = [];
42
- if (informations.Parameters !== undefined) {
43
- const sortedList = informations.Parameters.slice();
44
- sortedList.sort((a, b) => a.DisplayIndex - b.DisplayIndex);
45
- for (const parameter of sortedList) {
46
- const jsType = getCreatorIndexParameterPrimaryJSType(parameter.Type);
47
- const type = jsType === "string" ? ts.factory.createTypeReferenceNode("string") : ts.factory.createUnionTypeNode([ts.factory.createTypeReferenceNode(jsType), ts.factory.createTypeReferenceNode("string")]);
48
- let propertySignature = ts.factory.createPropertySignature(undefined, parameter.Name, ts.factory.createToken(ts.SyntaxKind.QuestionToken), type);
49
- const jsdocParts = [];
50
- if (parameter.Description !== undefined) {
51
- jsdocParts.push(parameter.Description, "");
52
- }
53
- jsdocParts.push(`@creatorType ${parameter.Type}`);
54
- if (jsType === "string") {
55
- jsdocParts.push(`@default "${parameter.Default}"`);
56
- } else {
57
- jsdocParts.push(`@default ${parameter.Default}`);
58
- }
59
- const jsdocContent = jsdocParts.map(part => `* ${part}`).join("\n ");
60
- propertySignature = ts.addSyntheticLeadingComment(propertySignature, ts.SyntaxKind.MultiLineCommentTrivia, `*\n ${jsdocContent}\n `, true);
61
- members.push(propertySignature);
62
- }
63
- }
64
- const interfaceName = `${className}Params`;
65
- let interfaceDeclaration = ts.factory.createInterfaceDeclaration(undefined, interfaceName, undefined, undefined, members);
66
- interfaceDeclaration = ts.addSyntheticLeadingComment(interfaceDeclaration, ts.SyntaxKind.MultiLineCommentTrivia, `*\n * Parameters for the ${className} class\n `, true);
67
- const printer = ts.createPrinter();
68
- const content = printer.printNode(ts.EmitHint.Unspecified, interfaceDeclaration, ts.createSourceFile("index.ts", "", ts.ScriptTarget.Latest)).replace(/ /g, "\t");
69
- const outFile = path.join(location.scriptsDir, `${interfaceName}.txt`);
70
- fs.writeFileSync(outFile, `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.` + os.EOL + os.EOL + content);
71
- };
72
-
73
- export { generateParameterType };
74
- //# sourceMappingURL=generateParameterType-d3ab08fd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateParameterType-d3ab08fd.js","sources":["../src/commands/generateParameterType.ts"],"sourcesContent":["import ts from \"typescript\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport * as os from \"os\";\n\nimport {\n\tPackageLocation,\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 ]);\n\n\t\t\tlet propertySignature = ts.factory.createPropertySignature(\n\t\t\t\tundefined,\n\t\t\t\tparameter.Name,\n\t\t\t\tts.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(\"\\n \");\n\t\t\tpropertySignature = ts.addSyntheticLeadingComment(\n\t\t\t\tpropertySignature,\n\t\t\t\tts.SyntaxKind.MultiLineCommentTrivia,\n\t\t\t\t`*\\n ${jsdocContent}\\n `,\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`*\\n * Parameters for the ${className} class\\n `,\n\t\ttrue,\n\t);\n\n\tconst printer = ts.createPrinter();\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"],"names":["generateParameterType","location","name","index","readPackageCreatorIndex","manifest","readPackageCreatorManifest","undefined","Error","qualifiedName","className","scope","Scope","Package","startsWith","slice","length","informations","find","item","Name","members","Parameters","sortedList","sort","a","b","DisplayIndex","parameter","jsType","getCreatorIndexParameterPrimaryJSType","Type","type","ts","factory","createTypeReferenceNode","createUnionTypeNode","propertySignature","createPropertySignature","createToken","SyntaxKind","QuestionToken","jsdocParts","Description","push","Default","jsdocContent","map","part","join","addSyntheticLeadingComment","MultiLineCommentTrivia","interfaceName","interfaceDeclaration","createInterfaceDeclaration","printer","createPrinter","content","printNode","EmitHint","Unspecified","createSourceFile","ScriptTarget","Latest","replace","outFile","path","scriptsDir","fs","writeFileSync","os","EOL"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBO,MAAMA,qBAAqB,GAAGA,CAAC;EACrCC,QAAQ;AACRC,EAAAA,IAAAA;AAC6B,CAAC,KAAK;AACnC,EAAA,MAAMC,KAAK,GAAGC,uBAAuB,CAACH,QAAQ,CAAC,CAAA;AAC/C,EAAA,MAAMI,QAAQ,GAAGC,0BAA0B,CAACL,QAAQ,CAAC,CAAA;EAErD,IAAIE,KAAK,KAAKI,SAAS,EAAE;AACxB,IAAA,MAAM,IAAIC,KAAK,CAAE,CAAA,mCAAA,CAAoC,CAAC,CAAA;AACvD,GAAA;EAEA,IAAIC,aAAa,GAAGP,IAAI,CAAA;EACxB,IAAIQ,SAAS,GAAGR,IAAI,CAAA;EAEpB,MAAMS,KAAK,GAAGN,QAAQ,CAACO,KAAK,IAAIP,QAAQ,CAACQ,OAAO,CAAA;AAEhD,EAAA,IAAIX,IAAI,CAACY,UAAU,CAACH,KAAK,CAAC,EAAE;IAC3BD,SAAS,GAAGR,IAAI,CAACa,KAAK,CAACJ,KAAK,CAACK,MAAM,GAAG,CAAC,CAAC,CAAA;AACzC,GAAC,MAAM;AACNP,IAAAA,aAAa,GAAI,CAAA,EAAEE,KAAM,CAAA,CAAA,EAAGT,IAAK,CAAC,CAAA,CAAA;AACnC,GAAA;AAEA,EAAA,MAAMe,YAAY,GAAGd,KAAK,CAACe,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACC,IAAI,KAAKX,aAAa,CAAC,CAAA;EAEtE,IAAIQ,YAAY,KAAKV,SAAS,EAAE;A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