@intelligentgraphics/ig.gfx.packager 3.0.4 → 3.0.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.
- package/build/{cli-5332deff.js → cli-0844c1bd.js} +11 -10
- package/build/cli-0844c1bd.js.map +1 -0
- package/build/{dependencies-227aca50.js → dependencies-aa561191.js} +2 -2
- package/build/dependencies-aa561191.js.map +1 -0
- package/build/generate-3019231d.js +231 -0
- package/build/generate-3019231d.js.map +1 -0
- package/build/{index-92b6ba5c.js → index-e2dc4a57.js} +2 -2
- package/build/{index-92b6ba5c.js.map → index-e2dc4a57.js.map} +1 -1
- package/build/{index-5d595f56.js → index-fb306868.js} +5 -5
- package/build/{index-5d595f56.js.map → index-fb306868.js.map} +1 -1
- package/build/index.mjs +1 -1
- package/build/{postinstall-7e50da37.js → postinstall-2c12dd4f.js} +3 -3
- package/build/{postinstall-7e50da37.js.map → postinstall-2c12dd4f.js.map} +1 -1
- package/build/{publishNpm-e2c8347f.js → publishNpm-1a1b8561.js} +4 -4
- package/build/{publishNpm-e2c8347f.js.map → publishNpm-1a1b8561.js.map} +1 -1
- package/build/{versionFile-b3a65dc8.js → versionFile-c4057cb5.js} +2 -2
- package/build/{versionFile-b3a65dc8.js.map → versionFile-c4057cb5.js.map} +1 -1
- package/package.json +2 -2
- package/readme.md +95 -29
- package/build/cli-5332deff.js.map +0 -1
- package/build/dependencies-227aca50.js.map +0 -1
- package/build/generate-a3a16031.js +0 -196
- package/build/generate-a3a16031.js.map +0 -1
package/readme.md
CHANGED
|
@@ -294,35 +294,89 @@ The path specified after the media:// schema will be resolved within a directory
|
|
|
294
294
|
|
|
295
295
|
### \_Index.json generation
|
|
296
296
|
|
|
297
|
-
The packager has a cli command `generateIndex [directory]
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
297
|
+
The packager has a cli command `npm run generateIndex [directory]` to generate an \_Index.json file for an Evaluator package.
|
|
298
|
+
|
|
299
|
+
You may need to register this command in the package.json of your git repository by adding the following attribute to the scripts object:
|
|
300
|
+
|
|
301
|
+
```json
|
|
302
|
+
"scripts": {
|
|
303
|
+
"generateIndex": "packager generateIndex"
|
|
304
|
+
},
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
This command collects all classes that either implement or extend the IEvaluator class from IGX.Eval, collects the properties of their parameters
|
|
308
|
+
and generates the \_Index.json file based on JSDoc informations for the properties and the class.
|
|
309
|
+
|
|
310
|
+
The following jsdoc attributes are supported:
|
|
311
|
+
|
|
312
|
+
- _default_ -> the default value
|
|
313
|
+
- _creatorType_ -> to define the type (like Material, String, Geometry)
|
|
314
|
+
- _summary_ -> to set a short description for the parameter. By default the generator will use the text above the attributes as the description.
|
|
315
|
+
|
|
316
|
+
**Example:**
|
|
317
|
+
|
|
318
|
+
```ts
|
|
319
|
+
namespace IG.Test {
|
|
320
|
+
interface Params {
|
|
321
|
+
/**
|
|
322
|
+
* Width of the corpus.
|
|
323
|
+
*
|
|
324
|
+
* Additional informations used to document the property internally
|
|
325
|
+
*
|
|
326
|
+
* @default 1.0
|
|
327
|
+
* @creatorType Float
|
|
328
|
+
* @summary Width of the corpus
|
|
329
|
+
*/
|
|
330
|
+
Corpus_Width?: number | string;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Type of the corpus
|
|
334
|
+
*
|
|
335
|
+
* @default "extra_wide"
|
|
336
|
+
* @creatorType String
|
|
337
|
+
*/
|
|
338
|
+
Corpus_Type?: string;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* The description of my evaluator
|
|
343
|
+
*/
|
|
344
|
+
export class MyEvaluator extends IGX.IEvaluator {
|
|
345
|
+
public static Create(
|
|
346
|
+
productId: string,
|
|
347
|
+
path: string,
|
|
348
|
+
parameters: Params,
|
|
349
|
+
): IGX.EvalResponse {}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
The code snippet above will generate the following \_Index.json output:
|
|
355
|
+
|
|
356
|
+
```json
|
|
357
|
+
[
|
|
358
|
+
{
|
|
359
|
+
"Name": "IG.Test.MyEvaluator",
|
|
360
|
+
"Description": "The description of my evaluator",
|
|
361
|
+
"Type": "Evaluator",
|
|
362
|
+
"Parameters": [
|
|
363
|
+
{
|
|
364
|
+
"Name": "Corpus_Width",
|
|
365
|
+
"Description": "Symbolische Angabe der Korpusbreite",
|
|
366
|
+
"Default": "W50",
|
|
367
|
+
"Type": "String",
|
|
368
|
+
"DisplayIndex": 1
|
|
369
|
+
}
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
**Migrating from a handwritten \_Index.json to an auto generated one:**
|
|
376
|
+
|
|
377
|
+
1. Make sure all Evaluators implement or extend the IGX.IEvaluator class.
|
|
378
|
+
2. Run the index generation. The output should be nearly identical. If an evaluator does not have an explicit Parameter type, the generator will reuse the informations from an existing \_Index.json file.
|
|
379
|
+
3. Now you can choose to add the parameter types either incrementally or all at once.
|
|
326
380
|
|
|
327
381
|
## Troubleshoot
|
|
328
382
|
|
|
@@ -333,6 +387,18 @@ Afterwards you may need to reload your editor in order for the installed files t
|
|
|
333
387
|
|
|
334
388
|
## History
|
|
335
389
|
|
|
390
|
+
**IG.GFX.Packager 3.0.6**
|
|
391
|
+
|
|
392
|
+
- fix check for local packager execution
|
|
393
|
+
|
|
394
|
+
**IG.GFX.Packager 3.0.5**
|
|
395
|
+
|
|
396
|
+
- update documentation for generateIndex command
|
|
397
|
+
- enforce better property order for parameters
|
|
398
|
+
- improve index generation
|
|
399
|
+
- use typechecker for index generation to improve reliability
|
|
400
|
+
- reuse parameters of existing \_index.json when no parameters are defined for an evaluator
|
|
401
|
+
|
|
336
402
|
**IG.GFX.Packager 3.0.4**
|
|
337
403
|
|
|
338
404
|
- start a troubleshoot section
|