@intelligentgraphics/ig.gfx.packager 3.0.0-alpha.7 → 3.0.0-alpha.9
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.mjs +55 -83
- package/build/cli.mjs.map +1 -1
- package/build/dependencies.mjs +6 -18
- package/build/dependencies.mjs.map +1 -1
- package/build/{commands/generate.mjs → generate.mjs} +13 -10
- package/build/generate.mjs.map +1 -0
- package/build/index.mjs.map +1 -1
- package/build/{commands/build.mjs → index2.mjs} +30 -23
- package/build/index2.mjs.map +1 -0
- package/build/{commands/publish.mjs → index3.mjs} +15 -15
- package/build/index3.mjs.map +1 -0
- package/build/{commands/postinstall.mjs → postinstall.mjs} +6 -3
- package/build/postinstall.mjs.map +1 -0
- package/build/{commands/publishNpm.mjs → publishNpm.mjs} +6 -6
- package/build/publishNpm.mjs.map +1 -0
- package/build/scripts.mjs.map +1 -1
- package/build/versionFile.mjs +10 -10
- package/build/versionFile.mjs.map +1 -1
- package/locales/de.json +18 -18
- package/locales/en.json +37 -37
- package/package.json +4 -5
- package/readme.md +19 -16
- package/scripts/postinstall.js +22 -22
- package/build/commands/build.mjs.map +0 -1
- package/build/commands/generate.mjs.map +0 -1
- package/build/commands/postinstall.mjs.map +0 -1
- package/build/commands/publish.mjs.map +0 -1
- package/build/commands/publishNpm.mjs.map +0 -1
package/build/cli.mjs
CHANGED
|
@@ -24,10 +24,10 @@ const getNodeErrorCode = error => {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
/**
|
|
28
|
-
* No such file or directory: Commonly raised by fs operations to indicate that a component of the specified pathname does not exist. No entity (file or directory) could be found by the given path.
|
|
29
|
-
*
|
|
30
|
-
* @param {unknown} error
|
|
27
|
+
/**
|
|
28
|
+
* No such file or directory: Commonly raised by fs operations to indicate that a component of the specified pathname does not exist. No entity (file or directory) could be found by the given path.
|
|
29
|
+
*
|
|
30
|
+
* @param {unknown} error
|
|
31
31
|
*/
|
|
32
32
|
const isErrorENOENT = error => getNodeErrorCode(error) === "ENOENT";
|
|
33
33
|
|
|
@@ -46,13 +46,13 @@ const writeNpmManifest = (directory, packageJson) => {
|
|
|
46
46
|
// Functionality related to working with a single package.
|
|
47
47
|
const PACKAGE_FILE = "_Package.json";
|
|
48
48
|
const INDEX_FILE = "_Index.json";
|
|
49
|
-
const
|
|
49
|
+
const ANIMATION_FILE_SUFFIX = ".animation.json";
|
|
50
50
|
|
|
51
|
-
/**
|
|
52
|
-
* Describes the location of a single package.
|
|
53
|
-
*
|
|
54
|
-
* @export
|
|
55
|
-
* @interface PackageLocation
|
|
51
|
+
/**
|
|
52
|
+
* Describes the location of a single package.
|
|
53
|
+
*
|
|
54
|
+
* @export
|
|
55
|
+
* @interface PackageLocation
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
58
|
const parseCreatorPackageName = manifest => {
|
|
@@ -62,11 +62,11 @@ const parseCreatorPackageName = manifest => {
|
|
|
62
62
|
subdomain: subdomainParts.join(".")
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
/**
|
|
66
|
-
* Detects the package at the given directory.
|
|
67
|
-
*
|
|
68
|
-
* @param {string} directory
|
|
69
|
-
* @returns {PackageLocation}
|
|
65
|
+
/**
|
|
66
|
+
* Detects the package at the given directory.
|
|
67
|
+
*
|
|
68
|
+
* @param {string} directory
|
|
69
|
+
* @returns {PackageLocation}
|
|
70
70
|
*/
|
|
71
71
|
const detectPackage = (workspace, directory) => {
|
|
72
72
|
directory = path.resolve(workspace.path, directory);
|
|
@@ -155,7 +155,7 @@ const readPackageAnimationList = location => {
|
|
|
155
155
|
const directoryContent = fs.readdirSync(location.manifestDir);
|
|
156
156
|
const animationPathList = [];
|
|
157
157
|
for (const entry of directoryContent) {
|
|
158
|
-
if (entry.endsWith(
|
|
158
|
+
if (entry.endsWith(ANIMATION_FILE_SUFFIX)) {
|
|
159
159
|
const animationPath = path.join(location.manifestDir, entry);
|
|
160
160
|
animationPathList.push(animationPath);
|
|
161
161
|
}
|
|
@@ -166,11 +166,11 @@ const getPackageReleasesDirectory = location => path.join(location.path, "Releas
|
|
|
166
166
|
|
|
167
167
|
// Functionality related to working with a workspace consisting of multiple packages.
|
|
168
168
|
|
|
169
|
-
/**
|
|
170
|
-
* Describe the location of a workspace constining of n packages.
|
|
171
|
-
*
|
|
172
|
-
* @export
|
|
173
|
-
* @interface WorkspaceLocation
|
|
169
|
+
/**
|
|
170
|
+
* Describe the location of a workspace constining of n packages.
|
|
171
|
+
*
|
|
172
|
+
* @export
|
|
173
|
+
* @interface WorkspaceLocation
|
|
174
174
|
*/
|
|
175
175
|
|
|
176
176
|
const detectWorkspace = directory => {
|
|
@@ -235,8 +235,8 @@ const createDefaultPrompter = () => {
|
|
|
235
235
|
};
|
|
236
236
|
|
|
237
237
|
var name = "@intelligentgraphics/ig.gfx.packager";
|
|
238
|
-
var version = "3.0.0-alpha.
|
|
239
|
-
var description = "IG.GFX.Packager 3.0.0 Alpha
|
|
238
|
+
var version = "3.0.0-alpha.9";
|
|
239
|
+
var description = "IG.GFX.Packager 3.0.0 Alpha 9 (3.0.0.10)";
|
|
240
240
|
var author = "Michael Beier <mb@intelligentgraphics.biz>";
|
|
241
241
|
var main = "build/index.mjs";
|
|
242
242
|
var type = "module";
|
|
@@ -244,7 +244,7 @@ var publishConfig = {
|
|
|
244
244
|
access: "public"
|
|
245
245
|
};
|
|
246
246
|
var engines = {
|
|
247
|
-
node: ">=16.
|
|
247
|
+
node: ">=16.19.0"
|
|
248
248
|
};
|
|
249
249
|
var bin = {
|
|
250
250
|
packager: "./build/index.mjs"
|
|
@@ -259,8 +259,7 @@ var scripts = {
|
|
|
259
259
|
clean: "rimraf build *.tsbuildinfo",
|
|
260
260
|
prepublishOnly: "yarn clean && yarn dist",
|
|
261
261
|
test: "vitest",
|
|
262
|
-
format: "prettier --write \"**/*.{ts,tsx,json}\""
|
|
263
|
-
postinstall: "packager postinstall"
|
|
262
|
+
format: "prettier --write \"**/*.{ts,tsx,json}\""
|
|
264
263
|
};
|
|
265
264
|
var dependencies = {
|
|
266
265
|
ajv: "^8.12.0",
|
|
@@ -314,7 +313,7 @@ var pjson = {
|
|
|
314
313
|
devDependencies: devDependencies
|
|
315
314
|
};
|
|
316
315
|
|
|
317
|
-
fileURLToPath(import.meta.url);
|
|
316
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
318
317
|
const captureError = err => {
|
|
319
318
|
console.log("");
|
|
320
319
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -351,62 +350,35 @@ const buildOptions = {
|
|
|
351
350
|
}
|
|
352
351
|
};
|
|
353
352
|
const preCommandCheck = async () => {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
// ] ||
|
|
377
|
-
// repositoryPackage?.devDependencies?.[
|
|
378
|
-
// "@intelligentgraphics/ig.gfx.packager"
|
|
379
|
-
// ]
|
|
380
|
-
// ) {
|
|
381
|
-
// const parts = ["Detected locally installed ig.gfx.packager."];
|
|
382
|
-
|
|
383
|
-
// if (executedLocalPackager) {
|
|
384
|
-
// parts.push(
|
|
385
|
-
// 'Run "npm install -g @intelligentgraphics/ig.gfx.packager@latest" to install the global version, if it is not yet installed.',
|
|
386
|
-
// );
|
|
387
|
-
// }
|
|
388
|
-
// parts.push(
|
|
389
|
-
// 'Run "npm uninstall @intelligentgraphics/ig.gfx.packager" to remove the local version.',
|
|
390
|
-
// );
|
|
391
|
-
|
|
392
|
-
// console.error(parts.join("\n"));
|
|
393
|
-
// process.exit(1);
|
|
394
|
-
// }
|
|
395
|
-
|
|
396
|
-
// if (executedLocalPackager) {
|
|
397
|
-
// console.error(`Detected locally installed ig.gfx.packager.
|
|
398
|
-
// Run "npm install -g @intelligentgraphics/ig.gfx.packager@latest" to install the global version, if it is not yet installed.
|
|
399
|
-
// Run "npm install" to get rid of the local packager version.`);
|
|
400
|
-
// process.exit(1);
|
|
401
|
-
// }
|
|
402
|
-
|
|
353
|
+
var _repositoryPackage, _repositoryPackage$de, _repositoryPackage2, _repositoryPackage2$d;
|
|
354
|
+
const executedLocalPackager = path.relative(process.cwd(), __filename).indexOf("..") === -1;
|
|
355
|
+
let repositoryPackage;
|
|
356
|
+
try {
|
|
357
|
+
const repositoryPackageJson = fs.readFileSync(path.resolve(process.cwd(), "package.json"), "utf8");
|
|
358
|
+
repositoryPackage = JSON.parse(repositoryPackageJson);
|
|
359
|
+
} catch (err) {}
|
|
360
|
+
if ((_repositoryPackage = repositoryPackage) !== null && _repositoryPackage !== void 0 && (_repositoryPackage$de = _repositoryPackage.dependencies) !== null && _repositoryPackage$de !== void 0 && _repositoryPackage$de["@intelligentgraphics/ig.gfx.packager"] || (_repositoryPackage2 = repositoryPackage) !== null && _repositoryPackage2 !== void 0 && (_repositoryPackage2$d = _repositoryPackage2.devDependencies) !== null && _repositoryPackage2$d !== void 0 && _repositoryPackage2$d["@intelligentgraphics/ig.gfx.packager"]) {
|
|
361
|
+
const parts = ["Detected locally installed ig.gfx.packager."];
|
|
362
|
+
if (executedLocalPackager) {
|
|
363
|
+
parts.push('Run "npm install -g @intelligentgraphics/ig.gfx.packager@latest" to install the global version, if it is not yet installed.');
|
|
364
|
+
}
|
|
365
|
+
parts.push('Run "npm uninstall @intelligentgraphics/ig.gfx.packager" to remove the local version.');
|
|
366
|
+
console.error(parts.join("\n"));
|
|
367
|
+
process.exit(1);
|
|
368
|
+
}
|
|
369
|
+
if (executedLocalPackager) {
|
|
370
|
+
console.error(`Detected locally installed ig.gfx.packager.
|
|
371
|
+
Run "npm install -g @intelligentgraphics/ig.gfx.packager@latest" to install the global version, if it is not yet installed.
|
|
372
|
+
Run "npm install" to get rid of the local packager version.`);
|
|
373
|
+
process.exit(1);
|
|
374
|
+
}
|
|
403
375
|
const notifier = updateNotifier({
|
|
404
376
|
pkg: pjson,
|
|
405
377
|
shouldNotifyInNpmScript: true,
|
|
406
378
|
updateCheckInterval: 1000 * 60
|
|
407
379
|
});
|
|
408
380
|
notifier.notify({
|
|
409
|
-
isGlobal:
|
|
381
|
+
isGlobal: true,
|
|
410
382
|
defer: true
|
|
411
383
|
});
|
|
412
384
|
const workspaceLocation = detectWorkspace(process.cwd());
|
|
@@ -426,7 +398,7 @@ yargsInstance.command("build [directories...]", "Builds the specified directorie
|
|
|
426
398
|
await preCommandCheck();
|
|
427
399
|
const {
|
|
428
400
|
buildFolders
|
|
429
|
-
} = await import('./
|
|
401
|
+
} = await import('./index2.mjs').then(function (n) { return n.i; });
|
|
430
402
|
await buildFolders({
|
|
431
403
|
...options,
|
|
432
404
|
directories: directories
|
|
@@ -541,7 +513,7 @@ yargsInstance.command("publish [directory]", "Publishes the specified directory"
|
|
|
541
513
|
}
|
|
542
514
|
const {
|
|
543
515
|
releaseFolder
|
|
544
|
-
} = await import('./
|
|
516
|
+
} = await import('./index3.mjs');
|
|
545
517
|
const prompter = createDefaultPrompter();
|
|
546
518
|
const fullOptions = {
|
|
547
519
|
...options,
|
|
@@ -570,7 +542,7 @@ yargsInstance.command({
|
|
|
570
542
|
await preCommandCheck();
|
|
571
543
|
const {
|
|
572
544
|
extract
|
|
573
|
-
} = await import('./
|
|
545
|
+
} = await import('./generate.mjs');
|
|
574
546
|
const workspace = detectWorkspace(process.cwd());
|
|
575
547
|
const location = detectPackage(workspace, directory);
|
|
576
548
|
extract(location, ignore);
|
|
@@ -582,7 +554,7 @@ yargsInstance.command({
|
|
|
582
554
|
handler: async () => {
|
|
583
555
|
const {
|
|
584
556
|
executePostInstall
|
|
585
|
-
} = await import('./
|
|
557
|
+
} = await import('./postinstall.mjs');
|
|
586
558
|
executePostInstall(detectWorkspace(process.cwd()));
|
|
587
559
|
},
|
|
588
560
|
describe: "Runs postinstall tasks"
|
|
@@ -608,7 +580,7 @@ yargsInstance.command({
|
|
|
608
580
|
const workspace = detectWorkspace(process.cwd());
|
|
609
581
|
const {
|
|
610
582
|
publishToNpm
|
|
611
|
-
} = await import('./
|
|
583
|
+
} = await import('./publishNpm.mjs');
|
|
612
584
|
await publishToNpm({
|
|
613
585
|
workspace,
|
|
614
586
|
location: detectPackage(workspace, directory),
|
|
@@ -624,5 +596,5 @@ var cli = /*#__PURE__*/Object.freeze({
|
|
|
624
596
|
__proto__: null
|
|
625
597
|
});
|
|
626
598
|
|
|
627
|
-
export { detectPackage as a, readPackageNpmManifest as b, readPackageAnimationList as c, detectWorkspace as d, readPackageCreatorIndex as e, readWorkspaceNpmManifest as f, getWorkspaceOutputPath as g, getPackageReleasesDirectory as h, isErrorENOENT as i, readNpmManifest as j, writePackageCreatorIndex as k, getWorkspaceLibPath as l, writePackageNpmManifest as m, iterateWorkspacePackages as n, cli as o, parseCreatorPackageName as p, readPackageCreatorManifest as r, translate as t, writePackageCreatorManifest as w };
|
|
599
|
+
export { INDEX_FILE as I, PACKAGE_FILE as P, detectPackage as a, readPackageNpmManifest as b, readPackageAnimationList as c, detectWorkspace as d, readPackageCreatorIndex as e, readWorkspaceNpmManifest as f, getWorkspaceOutputPath as g, getPackageReleasesDirectory as h, isErrorENOENT as i, readNpmManifest as j, writePackageCreatorIndex as k, getWorkspaceLibPath as l, writePackageNpmManifest as m, iterateWorkspacePackages as n, cli as o, parseCreatorPackageName as p, readPackageCreatorManifest as r, translate as t, writePackageCreatorManifest as w };
|
|
628
600
|
//# sourceMappingURL=cli.mjs.map
|
package/build/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","sources":["../src/lib/localization.ts","../src/lib/error.ts","../src/lib/npmPackage.ts","../src/lib/package.ts","../src/lib/workspace.ts","../src/lib/prompter.ts","../src/cli.ts"],"sourcesContent":["import y18n from \"y18n\";\nimport * as path from \"path\";\nimport { dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst instance = y18n({\n\tdirectory: path.join(__dirname, \"..\", \"locales\"),\n\tupdateFiles: false,\n\tlocale: \"en\",\n\tfallbackToLanguage: true,\n});\n\nexport const setLocale = (locale: string) => {\n\tinstance.setLocale(locale);\n};\n\nexport const translate = (key: string, ...args: string[]) =>\n\tinstance.__(key, ...args);\n","interface NodeError extends Error {\n\tcode: string;\n}\n\nexport const getNodeErrorCode = (error: unknown) => {\n\tif (\n\t\terror !== null &&\n\t\ttypeof error === \"object\" &&\n\t\t(error as NodeError).code !== undefined\n\t) {\n\t\treturn (error as NodeError).code;\n\t}\n};\n\n/**\n * Permission denied: An attempt was made to access a file in a way forbidden by its file access permissions.\n *\n * @param {unknown} error\n */\nexport const isErrorEACCES = (error: unknown) =>\n\tgetNodeErrorCode(error) === \"EACCES\";\n\n/**\n * No such file or directory: Commonly raised by fs operations to indicate that a component of the specified pathname does not exist. No entity (file or directory) could be found by the given path.\n *\n * @param {unknown} error\n */\nexport const isErrorENOENT = (error: unknown) =>\n\tgetNodeErrorCode(error) === \"ENOENT\";\n","import * as fs from \"fs\";\nimport * as path from \"path\";\nimport { writePackageSync } from \"write-pkg\";\n\nimport { PackageJSON } from \"./packageJSON\";\n\nexport const readNpmManifest = <T extends PackageJSON>(\n\tdirectory: string,\n): T => {\n\tconst packageJsonPath = path.join(directory, \"package.json\");\n\tconst packageJson = fs.readFileSync(packageJsonPath, {\n\t\tencoding: \"utf8\",\n\t});\n\treturn JSON.parse(packageJson);\n};\n\nexport const writeNpmManifest = <T extends PackageJSON>(\n\tdirectory: string,\n\tpackageJson: T,\n) => {\n\tconst packageJsonPath = path.join(directory, \"package.json\");\n\twritePackageSync(packageJsonPath, packageJson);\n};\n","// Functionality related to working with a single package.\n\nimport * as path from \"path\";\nimport * as fs from \"fs\";\n\nimport { isErrorENOENT } from \"./error\";\nimport { WorkspaceLocation } from \"./workspace\";\nimport { readNpmManifest, writeNpmManifest } from \"./npmPackage\";\nimport { PackageJSON } from \"./packageJSON\";\n\nconst PACKAGE_FILE = \"_Package.json\";\nconst INDEX_FILE = \"_Index.json\";\nconst ANIMATION_FILE = \".animation.json\";\n\n/**\n * Describes the location of a single package.\n *\n * @export\n * @interface PackageLocation\n */\nexport interface PackageLocation {\n\t_kind: \"PackageLocation\";\n\t/**\n\t * Main directory of a package\n\t *\n\t * @type {string}\n\t */\n\tpath: string;\n\t/**\n\t * Directory containing the typescript files\n\t *\n\t * @type {string}\n\t */\n\tscriptsDir: string;\n\t/**\n\t * Diretory containing the _Package.json, _Index.json, package.json and animation.json files\n\t *\n\t * @type {string}\n\t */\n\tmanifestDir: string;\n}\n\nexport interface CreatorPackage {\n\tScope: string;\n\tPackage: string;\n\tRunTime: boolean;\n\tType: \"Interactor\" | \"Mixed\" | \"Core\" | \"Context\" | \"Evaluator\";\n}\n\nexport const parseCreatorPackageName = (manifest: CreatorPackage) => {\n\tconst [domain, ...subdomainParts] = manifest.Package.split(\".\");\n\treturn {\n\t\tdomain,\n\t\tsubdomain: subdomainParts.join(\".\"),\n\t};\n};\n\nexport interface PackageNpmManifest extends PackageJSON {\n\tig?: {\n\t\tscriptingLibrary?: boolean;\n\t};\n}\n\n/**\n * Detects the package at the given directory.\n *\n * @param {string} directory\n * @returns {PackageLocation}\n */\nexport const detectPackage = (\n\tworkspace: WorkspaceLocation,\n\tdirectory: string,\n): PackageLocation => {\n\tdirectory = path.resolve(workspace.path, directory);\n\n\tconst scriptsPath = path.join(directory, \"Scripts\");\n\tconst tsPath = path.join(directory, \"ts\");\n\n\tlet location: PackageLocation;\n\n\tif (fs.existsSync(scriptsPath)) {\n\t\tlocation = {\n\t\t\t_kind: \"PackageLocation\",\n\t\t\tpath: directory,\n\t\t\tscriptsDir: scriptsPath,\n\t\t\tmanifestDir: scriptsPath,\n\t\t};\n\t} else if (fs.existsSync(tsPath)) {\n\t\tlocation = {\n\t\t\t_kind: \"PackageLocation\",\n\t\t\tpath: directory,\n\t\t\tscriptsDir: tsPath,\n\t\t\tmanifestDir: directory,\n\t\t};\n\t} else {\n\t\tlocation = {\n\t\t\t_kind: \"PackageLocation\",\n\t\t\tpath: directory,\n\t\t\tscriptsDir: directory,\n\t\t\tmanifestDir: directory,\n\t\t};\n\t}\n\n\ttry {\n\t\treadPackageCreatorManifest(location);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\tthrow new Error(\n\t\t\t\t`No _Package.json found in ${location.manifestDir}`,\n\t\t\t);\n\t\t}\n\t\tthrow err;\n\t}\n\n\treturn location;\n};\n\nexport const readPackageCreatorManifest = (\n\tlocation: PackageLocation,\n): CreatorPackage => {\n\tconst packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\n\tconst packageJson = fs.readFileSync(packageJsonPath, { encoding: \"utf8\" });\n\tconst result: Omit<CreatorPackage, \"Scope\"> & { Scope?: string } =\n\t\tJSON.parse(packageJson);\n\treturn {\n\t\t...result,\n\t\tScope: result.Scope || result.Package,\n\t};\n};\n\nexport const writePackageCreatorManifest = (\n\tlocation: PackageLocation,\n\tcreatorPackage: CreatorPackage,\n) => {\n\tconst packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\n\tfs.writeFileSync(\n\t\tpackageJsonPath,\n\t\tJSON.stringify(creatorPackage, null, \"\\t\") + \"\\n\",\n\t);\n};\n\nexport const readPackageCreatorIndex = (\n\tlocation: PackageLocation,\n): object | undefined => {\n\ttry {\n\t\tconst indexPath = path.join(location.manifestDir, INDEX_FILE);\n\t\tconst index = fs.readFileSync(indexPath, { encoding: \"utf8\" });\n\t\treturn JSON.parse(index);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthrow err;\n\t}\n};\n\nexport const writePackageCreatorIndex = (\n\tlocation: PackageLocation,\n\tindex: object,\n) => {\n\tconst packageJsonPath = path.join(location.manifestDir, INDEX_FILE);\n\tfs.writeFileSync(packageJsonPath, JSON.stringify(index, null, \"\\t\") + \"\\n\");\n};\n\nexport const readPackageNpmManifest = (\n\tlocation: PackageLocation,\n): PackageNpmManifest | undefined => {\n\ttry {\n\t\treturn readNpmManifest(location.manifestDir);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthrow err;\n\t}\n};\n\nexport const writePackageNpmManifest = (\n\tlocation: PackageLocation,\n\tpackageJson: PackageNpmManifest,\n) => {\n\twriteNpmManifest(location.manifestDir, packageJson);\n};\n\nexport const readPackageAnimationList = (location: PackageLocation) => {\n\tconst directoryContent = fs.readdirSync(location.manifestDir);\n\tconst animationPathList: string[] = [];\n\n\tfor (const entry of directoryContent) {\n\t\tif (entry.endsWith(ANIMATION_FILE)) {\n\t\t\tconst animationPath = path.join(location.manifestDir, entry);\n\t\t\tanimationPathList.push(animationPath);\n\t\t}\n\t}\n\n\treturn animationPathList;\n};\n\nexport const getPackageReleasesDirectory = (location: PackageLocation) =>\n\tpath.join(location.path, \"Releases\");\n\nexport const arePackageLocationsEqual = (\n\ta: PackageLocation,\n\tb: PackageLocation,\n) => a.path === b.path;\n","// Functionality related to working with a workspace consisting of multiple packages.\n\nimport * as path from \"path\";\nimport * as fs from \"fs\";\n\nimport { PackageJSON } from \"./packageJSON\";\nimport { isErrorENOENT } from \"./error\";\nimport { readNpmManifest, writeNpmManifest } from \"./npmPackage\";\nimport { detectPackage } from \"./package\";\n\n/**\n * Describe the location of a workspace constining of n packages.\n *\n * @export\n * @interface WorkspaceLocation\n */\nexport interface WorkspaceLocation {\n\t_kind: \"WorkspaceLocation\";\n\tpath: string;\n}\n\nexport interface WorkspacePackageJSON extends PackageJSON {\n\tpackager?: { banner?: string };\n}\n\nexport const detectWorkspace = (directory: string): WorkspaceLocation => {\n\tdirectory = path.resolve(process.cwd(), directory);\n\treturn {\n\t\t_kind: \"WorkspaceLocation\",\n\t\tpath: directory,\n\t};\n};\n\nexport const readWorkspaceNpmManifest = (\n\tworkspace: WorkspaceLocation,\n): WorkspacePackageJSON | undefined => {\n\ttry {\n\t\treturn readNpmManifest<WorkspacePackageJSON>(workspace.path);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthrow err;\n\t}\n};\n\nexport const writeWorkspaceNpmManifest = <T extends WorkspacePackageJSON>(\n\tworkspace: WorkspaceLocation,\n\tpackageJson: T,\n) => writeNpmManifest(workspace.path, packageJson);\n\nexport const getWorkspaceOutputPath = (workspace: WorkspaceLocation) =>\n\tpath.join(workspace.path, \"bin\");\n\nexport const getWorkspaceLibPath = (workspace: WorkspaceLocation) =>\n\tpath.join(workspace.path, \"lib\");\n\nexport function* iterateWorkspacePackages(workspace: WorkspaceLocation) {\n\tconst entries = fs.readdirSync(workspace.path, { withFileTypes: true });\n\n\tfor (const entry of entries) {\n\t\tif (!entry.isDirectory()) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\tyield detectPackage(workspace, entry.name);\n\t\t} catch {}\n\t}\n}\n","import inquirer from \"inquirer\";\n\nexport interface PrompterQuestion {\n\tmessage: string;\n\toptions: string[];\n\tdefault?: string;\n}\n\nexport interface Prompter {\n\tconfirm(message: string): Promise<boolean>;\n\n\task(question: PrompterQuestion): Promise<string>;\n}\n\nexport const createDefaultPrompter = (): Prompter => {\n\treturn {\n\t\tconfirm: async (message) => {\n\t\t\tconst { confirm } = await inquirer.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\tmessage,\n\t\t\t\t\tname: \"confirm\",\n\t\t\t\t},\n\t\t\t]);\n\t\t\treturn confirm as boolean;\n\t\t},\n\n\t\task: async (question) => {\n\t\t\tconst { answer } = await inquirer.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: \"list\",\n\t\t\t\t\tmessage: question.message,\n\t\t\t\t\tname: \"answer\",\n\t\t\t\t\tchoices: question.options,\n\t\t\t\t\tdefault: question.default,\n\t\t\t\t},\n\t\t\t]);\n\t\t\treturn answer as string;\n\t\t},\n\t};\n};\n","import updateNotifier from \"update-notifier\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport yargs from \"yargs/yargs\";\nimport { fileURLToPath } from \"url\";\n\nimport { translate } from \"./lib/localization\";\nimport { Authentication } from \"./lib/authentication\";\nimport { detectPackage } from \"./lib/package\";\nimport {\n\tdetectWorkspace,\n\treadWorkspaceNpmManifest,\n\twriteWorkspaceNpmManifest,\n} from \"./lib/workspace\";\nimport type { ReleaseFolderOptions } from \"./commands/publish\";\nimport { createDefaultPrompter } from \"./lib/prompter\";\n\nimport pjson from \"../package.json\";\n\nconst __filename = fileURLToPath(import.meta.url);\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(translate(\"messages.error\", err.message));\n\t}\n};\n\nconst buildOptions = {\n\toutDir: {\n\t\tdescription: translate(\"options.outDir.description\"),\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: translate(\"options.minimize.description\"),\n\t\ttype: \"boolean\",\n\t\tdefault: true,\n\t},\n\tcwd: {\n\t\tdescription: translate(\"options.cwd.description\"),\n\t\ttype: \"string\",\n\t\tdefault: process.cwd(),\n\t},\n\tclean: {\n\t\tdescription: translate(\"options.clean.description\"),\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 () => {\n\t// \tconst executedLocalPackager =\n\t// \t\tpath.relative(process.cwd(), __filename).indexOf(\"..\") === -1;\n\n\t// \tlet repositoryPackage:\n\t// \t\t| {\n\t// \t\t\t\tdependencies?: Record<string, string>;\n\t// \t\t\t\tdevDependencies?: Record<string, string>;\n\t// \t\t }\n\t// \t\t| undefined;\n\n\t// \ttry {\n\t// \t\tconst repositoryPackageJson = fs.readFileSync(\n\t// \t\t\tpath.resolve(process.cwd(), \"package.json\"),\n\t// \t\t\t\"utf8\",\n\t// \t\t);\n\n\t// \t\trepositoryPackage = JSON.parse(repositoryPackageJson);\n\t// \t} catch (err) {}\n\n\t// \tif (\n\t// \t\trepositoryPackage?.dependencies?.[\n\t// \t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t// \t\t] ||\n\t// \t\trepositoryPackage?.devDependencies?.[\n\t// \t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t// \t\t]\n\t// \t) {\n\t// \t\tconst parts = [\"Detected locally installed ig.gfx.packager.\"];\n\n\t// \t\tif (executedLocalPackager) {\n\t// \t\t\tparts.push(\n\t// \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\t);\n\t// \t\t}\n\t// \t\tparts.push(\n\t// \t\t\t'Run \"npm uninstall @intelligentgraphics/ig.gfx.packager\" to remove the local version.',\n\t// \t\t);\n\n\t// \t\tconsole.error(parts.join(\"\\n\"));\n\t// \t\tprocess.exit(1);\n\t// \t}\n\n\t// \tif (executedLocalPackager) {\n\t// \t\tconsole.error(`Detected locally installed ig.gfx.packager.\n\t// Run \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.\n\t// Run \"npm install\" to get rid of the local packager version.`);\n\t// \t\tprocess.exit(1);\n\t// \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: false,\n\t\tdefer: true,\n\t});\n\n\tconst workspaceLocation = detectWorkspace(process.cwd());\n\n\tconst packageJson = readWorkspaceNpmManifest(workspaceLocation);\n\n\tif (packageJson === 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\tpackageJson.scripts ??= {};\n\tpackageJson.scripts.postinstall = \"packager postinstall\";\n\n\twriteWorkspaceNpmManifest(workspaceLocation, packageJson);\n};\n\nconst yargsInstance = yargs(process.argv.slice(2));\n\nyargsInstance.command(\n\t\"build [directories...]\",\n\t\"Builds the specified directories\",\n\t(argv) => argv.options(buildOptions),\n\tasync ({ directories = [], ...options }) => {\n\t\tawait preCommandCheck();\n\n\t\tconst { buildFolders } = await import(\"./commands/build\");\n\n\t\tawait buildFolders({\n\t\t\t...options,\n\t\t\tdirectories: directories as string[],\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: translate(\"options.noUpload.description\"),\n\t\t\t},\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.domain.description\"),\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.subdomain.description\"),\n\t\t\t},\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.newVersion.description\"),\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: translate(\"options.address.description\"),\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: translate(\"options.service.description\"),\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: translate(\"options.user.description\"),\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: translate(\"options.password.description\"),\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: translate(\"options.docs.description\"),\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: translate(\"options.pushOnly.description\"),\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.license.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t}),\n\tasync ({ directory, user, password, service, license, ...options }) => {\n\t\tawait preCommandCheck();\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\ttranslate(\n\t\t\t\t\t\t\t\"options.service.demands\",\n\t\t\t\t\t\t\t\"IG_GFX_ASSET_SERVICE\",\n\t\t\t\t\t\t),\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: 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 (err?.code === \"ENOENT\") {\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: directory as string,\n\t\t\tbanner: true,\n\t\t\tprompter,\n\t\t\tnewVersion: options.newVersion!,\n\t\t};\n\n\t\tawait releaseFolder(fullOptions).catch(captureError);\n\t},\n);\n\nyargsInstance.command({\n\tcommand: \"generateIndex [directory]\",\n\tbuilder: (argv) => {\n\t\treturn argv.option(\"ignore\", {\n\t\t\ttype: \"array\",\n\t\t\tdefault: [],\n\t\t\tdescription: translate(\"options.ignore.description\"),\n\t\t});\n\t},\n\thandler: async ({ directory, ignore }) => {\n\t\tawait preCommandCheck();\n\n\t\tconst { extract } = await import(\"./commands/generate\");\n\n\t\tconst workspace = detectWorkspace(process.cwd());\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\textract(location, ignore as string[]);\n\t},\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: translate(\"options.newVersion.description\"),\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().argv;\n"],"names":["__dirname","dirname","fileURLToPath","import","meta","url","instance","y18n","directory","path","join","updateFiles","locale","fallbackToLanguage","translate","key","args","__","getNodeErrorCode","error","code","undefined","isErrorENOENT","readNpmManifest","packageJsonPath","packageJson","fs","readFileSync","encoding","JSON","parse","writeNpmManifest","writePackageSync","PACKAGE_FILE","INDEX_FILE","ANIMATION_FILE","parseCreatorPackageName","manifest","domain","subdomainParts","Package","split","subdomain","detectPackage","workspace","resolve","scriptsPath","tsPath","location","existsSync","_kind","scriptsDir","manifestDir","readPackageCreatorManifest","err","Error","result","Scope","writePackageCreatorManifest","creatorPackage","writeFileSync","stringify","readPackageCreatorIndex","indexPath","index","writePackageCreatorIndex","readPackageNpmManifest","writePackageNpmManifest","readPackageAnimationList","directoryContent","readdirSync","animationPathList","entry","endsWith","animationPath","push","getPackageReleasesDirectory","detectWorkspace","process","cwd","readWorkspaceNpmManifest","writeWorkspaceNpmManifest","getWorkspaceOutputPath","getWorkspaceLibPath","iterateWorkspacePackages","entries","withFileTypes","isDirectory","name","createDefaultPrompter","confirm","message","inquirer","prompt","type","ask","question","answer","choices","options","default","captureError","console","log","env","NODE_ENV","buildOptions","outDir","description","coerce","input","minimize","clean","docs","preCommandCheck","notifier","updateNotifier","pkg","pjson","shouldNotifyInNpmScript","updateCheckInterval","notify","isGlobal","defer","workspaceLocation","scripts","postinstall","yargsInstance","yargs","argv","slice","command","directories","buildFolders","catch","noUpload","newVersion","VERSION","required","address","service","IG_GFX_ASSET_SERVICE","user","IG_GFX_USER","password","IG_GFX_PWD","pushOnly","license","IG_GFX_LICENSE","authentication","fullLicensePath","content","toString","username","releaseFolder","prompter","fullOptions","banner","builder","option","handler","ignore","extract","executePostInstall","describe","dryRun","publishToNpm","version","demandCommand","pkgConf","showHelpOnFail"],"mappings":";;;;;;;;;;;AAKA,MAAMA,SAAS,GAAGC,OAAO,CAACC,aAAa,CAACC,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAA;AAEzD,MAAMC,QAAQ,GAAGC,IAAI,CAAC;EACrBC,SAAS,EAAEC,IAAI,CAACC,IAAI,CAACV,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC;AAChDW,EAAAA,WAAW,EAAE,KAAK;AAClBC,EAA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AAO,EAAE,CAACtC,IAAI;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"cli.mjs","sources":["../src/lib/localization.ts","../src/lib/error.ts","../src/lib/npmPackage.ts","../src/lib/package.ts","../src/lib/workspace.ts","../src/lib/prompter.ts","../src/cli.ts"],"sourcesContent":["import y18n from \"y18n\";\r\nimport * as path from \"path\";\r\nimport { dirname } from \"path\";\r\nimport { fileURLToPath } from \"url\";\r\n\r\nconst __dirname = dirname(fileURLToPath(import.meta.url));\r\n\r\nconst instance = y18n({\r\n\tdirectory: path.join(__dirname, \"..\", \"locales\"),\r\n\tupdateFiles: false,\r\n\tlocale: \"en\",\r\n\tfallbackToLanguage: true,\r\n});\r\n\r\nexport const setLocale = (locale: string) => {\r\n\tinstance.setLocale(locale);\r\n};\r\n\r\nexport const translate = (key: string, ...args: string[]) =>\r\n\tinstance.__(key, ...args);\r\n","interface NodeError extends Error {\r\n\tcode: string;\r\n}\r\n\r\nexport const getNodeErrorCode = (error: unknown) => {\r\n\tif (\r\n\t\terror !== null &&\r\n\t\ttypeof error === \"object\" &&\r\n\t\t(error as NodeError).code !== undefined\r\n\t) {\r\n\t\treturn (error as NodeError).code;\r\n\t}\r\n};\r\n\r\n/**\r\n * Permission denied: An attempt was made to access a file in a way forbidden by its file access permissions.\r\n *\r\n * @param {unknown} error\r\n */\r\nexport const isErrorEACCES = (error: unknown) =>\r\n\tgetNodeErrorCode(error) === \"EACCES\";\r\n\r\n/**\r\n * No such file or directory: Commonly raised by fs operations to indicate that a component of the specified pathname does not exist. No entity (file or directory) could be found by the given path.\r\n *\r\n * @param {unknown} error\r\n */\r\nexport const isErrorENOENT = (error: unknown) =>\r\n\tgetNodeErrorCode(error) === \"ENOENT\";\r\n","import * as fs from \"fs\";\r\nimport * as path from \"path\";\r\nimport { writePackageSync } from \"write-pkg\";\r\n\r\nimport { PackageJSON } from \"./packageJSON\";\r\n\r\nexport const readNpmManifest = <T extends PackageJSON>(\r\n\tdirectory: string,\r\n): T => {\r\n\tconst packageJsonPath = path.join(directory, \"package.json\");\r\n\tconst packageJson = fs.readFileSync(packageJsonPath, {\r\n\t\tencoding: \"utf8\",\r\n\t});\r\n\treturn JSON.parse(packageJson);\r\n};\r\n\r\nexport const writeNpmManifest = <T extends PackageJSON>(\r\n\tdirectory: string,\r\n\tpackageJson: T,\r\n) => {\r\n\tconst packageJsonPath = path.join(directory, \"package.json\");\r\n\twritePackageSync(packageJsonPath, packageJson);\r\n};\r\n","// Functionality related to working with a single package.\r\n\r\nimport * as path from \"path\";\r\nimport * as fs from \"fs\";\r\n\r\nimport { isErrorENOENT } from \"./error\";\r\nimport { WorkspaceLocation } from \"./workspace\";\r\nimport { readNpmManifest, writeNpmManifest } from \"./npmPackage\";\r\nimport { PackageJSON } from \"./packageJSON\";\r\n\r\nexport const PACKAGE_FILE = \"_Package.json\";\r\nexport const INDEX_FILE = \"_Index.json\";\r\nconst ANIMATION_FILE_SUFFIX = \".animation.json\";\r\n\r\n/**\r\n * Describes the location of a single package.\r\n *\r\n * @export\r\n * @interface PackageLocation\r\n */\r\nexport interface PackageLocation {\r\n\t_kind: \"PackageLocation\";\r\n\t/**\r\n\t * Main directory of a package\r\n\t *\r\n\t * @type {string}\r\n\t */\r\n\tpath: string;\r\n\t/**\r\n\t * Directory containing the typescript files\r\n\t *\r\n\t * @type {string}\r\n\t */\r\n\tscriptsDir: string;\r\n\t/**\r\n\t * Diretory containing the _Package.json, _Index.json, package.json and animation.json files\r\n\t *\r\n\t * @type {string}\r\n\t */\r\n\tmanifestDir: string;\r\n}\r\n\r\nexport interface CreatorPackage {\r\n\tScope: string;\r\n\tPackage: string;\r\n\tRunTime: boolean;\r\n\tType: \"Interactor\" | \"Mixed\" | \"Core\" | \"Context\" | \"Evaluator\";\r\n}\r\n\r\nexport type CreatorIndex = CreatorIndexEntry[];\r\n\r\nexport interface CreatorIndexEntry {\r\n\tName: string;\r\n\tDescription?: string;\r\n\tType: \"Interactor\" | \"Evaluator\";\r\n\tParameters: CreatorIndexParameter[];\r\n}\r\n\r\nexport interface CreatorIndexParameter {\r\n\tName: string;\r\n\tType: CreatorIndexParameterType;\r\n\tDescription?: string;\r\n\tDefault?: unknown;\r\n\tDisplayIndex: number;\r\n}\r\n\r\nexport type CreatorIndexParameterType =\r\n\t| \"String\"\r\n\t| \"LengthM\"\r\n\t| \"Material\"\r\n\t| \"Boolean\"\r\n\t| \"Bool\"\r\n\t| \"ArcDEG\"\r\n\t| \"Integer\"\r\n\t| \"Int\"\r\n\t| \"Float\";\r\n\r\nexport const parseCreatorPackageName = (manifest: CreatorPackage) => {\r\n\tconst [domain, ...subdomainParts] = manifest.Package.split(\".\");\r\n\treturn {\r\n\t\tdomain,\r\n\t\tsubdomain: subdomainParts.join(\".\"),\r\n\t};\r\n};\r\n\r\nexport interface PackageNpmManifest extends PackageJSON {\r\n\tig?: {\r\n\t\tscriptingLibrary?: boolean;\r\n\t};\r\n}\r\n\r\n/**\r\n * Detects the package at the given directory.\r\n *\r\n * @param {string} directory\r\n * @returns {PackageLocation}\r\n */\r\nexport const detectPackage = (\r\n\tworkspace: WorkspaceLocation,\r\n\tdirectory: string,\r\n): PackageLocation => {\r\n\tdirectory = path.resolve(workspace.path, directory);\r\n\r\n\tconst scriptsPath = path.join(directory, \"Scripts\");\r\n\tconst tsPath = path.join(directory, \"ts\");\r\n\r\n\tlet location: PackageLocation;\r\n\r\n\tif (fs.existsSync(scriptsPath)) {\r\n\t\tlocation = {\r\n\t\t\t_kind: \"PackageLocation\",\r\n\t\t\tpath: directory,\r\n\t\t\tscriptsDir: scriptsPath,\r\n\t\t\tmanifestDir: scriptsPath,\r\n\t\t};\r\n\t} else if (fs.existsSync(tsPath)) {\r\n\t\tlocation = {\r\n\t\t\t_kind: \"PackageLocation\",\r\n\t\t\tpath: directory,\r\n\t\t\tscriptsDir: tsPath,\r\n\t\t\tmanifestDir: directory,\r\n\t\t};\r\n\t} else {\r\n\t\tlocation = {\r\n\t\t\t_kind: \"PackageLocation\",\r\n\t\t\tpath: directory,\r\n\t\t\tscriptsDir: directory,\r\n\t\t\tmanifestDir: directory,\r\n\t\t};\r\n\t}\r\n\r\n\ttry {\r\n\t\treadPackageCreatorManifest(location);\r\n\t} catch (err) {\r\n\t\tif (isErrorENOENT(err)) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t`No _Package.json found in ${location.manifestDir}`,\r\n\t\t\t);\r\n\t\t}\r\n\t\tthrow err;\r\n\t}\r\n\r\n\treturn location;\r\n};\r\n\r\nexport const readPackageCreatorManifest = (\r\n\tlocation: PackageLocation,\r\n): CreatorPackage => {\r\n\tconst packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\r\n\tconst packageJson = fs.readFileSync(packageJsonPath, { encoding: \"utf8\" });\r\n\tconst result: Omit<CreatorPackage, \"Scope\"> & { Scope?: string } =\r\n\t\tJSON.parse(packageJson);\r\n\treturn {\r\n\t\t...result,\r\n\t\tScope: result.Scope || result.Package,\r\n\t};\r\n};\r\n\r\nexport const writePackageCreatorManifest = (\r\n\tlocation: PackageLocation,\r\n\tcreatorPackage: CreatorPackage,\r\n) => {\r\n\tconst packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\r\n\tfs.writeFileSync(\r\n\t\tpackageJsonPath,\r\n\t\tJSON.stringify(creatorPackage, null, \"\\t\") + \"\\n\",\r\n\t);\r\n};\r\n\r\nexport const readPackageCreatorIndex = (\r\n\tlocation: PackageLocation,\r\n): CreatorIndex | undefined => {\r\n\ttry {\r\n\t\tconst indexPath = path.join(location.manifestDir, INDEX_FILE);\r\n\t\tconst index = fs.readFileSync(indexPath, { encoding: \"utf8\" });\r\n\t\treturn JSON.parse(index);\r\n\t} catch (err) {\r\n\t\tif (isErrorENOENT(err)) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\tthrow err;\r\n\t}\r\n};\r\n\r\nexport const writePackageCreatorIndex = (\r\n\tlocation: PackageLocation,\r\n\tindex: CreatorIndex,\r\n) => {\r\n\tconst packageJsonPath = path.join(location.manifestDir, INDEX_FILE);\r\n\tfs.writeFileSync(packageJsonPath, JSON.stringify(index, null, \"\\t\") + \"\\n\");\r\n};\r\n\r\nexport const readPackageNpmManifest = (\r\n\tlocation: PackageLocation,\r\n): PackageNpmManifest | undefined => {\r\n\ttry {\r\n\t\treturn readNpmManifest(location.manifestDir);\r\n\t} catch (err) {\r\n\t\tif (isErrorENOENT(err)) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\tthrow err;\r\n\t}\r\n};\r\n\r\nexport const writePackageNpmManifest = (\r\n\tlocation: PackageLocation,\r\n\tpackageJson: PackageNpmManifest,\r\n) => {\r\n\twriteNpmManifest(location.manifestDir, packageJson);\r\n};\r\n\r\nexport const readPackageAnimationList = (location: PackageLocation) => {\r\n\tconst directoryContent = fs.readdirSync(location.manifestDir);\r\n\tconst animationPathList: string[] = [];\r\n\r\n\tfor (const entry of directoryContent) {\r\n\t\tif (entry.endsWith(ANIMATION_FILE_SUFFIX)) {\r\n\t\t\tconst animationPath = path.join(location.manifestDir, entry);\r\n\t\t\tanimationPathList.push(animationPath);\r\n\t\t}\r\n\t}\r\n\r\n\treturn animationPathList;\r\n};\r\n\r\nexport const getPackageReleasesDirectory = (location: PackageLocation) =>\r\n\tpath.join(location.path, \"Releases\");\r\n\r\nexport const arePackageLocationsEqual = (\r\n\ta: PackageLocation,\r\n\tb: PackageLocation,\r\n) => a.path === b.path;\r\n","// Functionality related to working with a workspace consisting of multiple packages.\r\n\r\nimport * as path from \"path\";\r\nimport * as fs from \"fs\";\r\n\r\nimport { PackageJSON } from \"./packageJSON\";\r\nimport { isErrorENOENT } from \"./error\";\r\nimport { readNpmManifest, writeNpmManifest } from \"./npmPackage\";\r\nimport { detectPackage } from \"./package\";\r\n\r\n/**\r\n * Describe the location of a workspace constining of n packages.\r\n *\r\n * @export\r\n * @interface WorkspaceLocation\r\n */\r\nexport interface WorkspaceLocation {\r\n\t_kind: \"WorkspaceLocation\";\r\n\tpath: string;\r\n}\r\n\r\nexport interface WorkspacePackageJSON extends PackageJSON {\r\n\tpackager?: { banner?: string };\r\n}\r\n\r\nexport const detectWorkspace = (directory: string): WorkspaceLocation => {\r\n\tdirectory = path.resolve(process.cwd(), directory);\r\n\treturn {\r\n\t\t_kind: \"WorkspaceLocation\",\r\n\t\tpath: directory,\r\n\t};\r\n};\r\n\r\nexport const readWorkspaceNpmManifest = (\r\n\tworkspace: WorkspaceLocation,\r\n): WorkspacePackageJSON | undefined => {\r\n\ttry {\r\n\t\treturn readNpmManifest<WorkspacePackageJSON>(workspace.path);\r\n\t} catch (err) {\r\n\t\tif (isErrorENOENT(err)) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\tthrow err;\r\n\t}\r\n};\r\n\r\nexport const writeWorkspaceNpmManifest = <T extends WorkspacePackageJSON>(\r\n\tworkspace: WorkspaceLocation,\r\n\tpackageJson: T,\r\n) => writeNpmManifest(workspace.path, packageJson);\r\n\r\nexport const getWorkspaceOutputPath = (workspace: WorkspaceLocation) =>\r\n\tpath.join(workspace.path, \"bin\");\r\n\r\nexport const getWorkspaceLibPath = (workspace: WorkspaceLocation) =>\r\n\tpath.join(workspace.path, \"lib\");\r\n\r\nexport function* iterateWorkspacePackages(workspace: WorkspaceLocation) {\r\n\tconst entries = fs.readdirSync(workspace.path, { withFileTypes: true });\r\n\r\n\tfor (const entry of entries) {\r\n\t\tif (!entry.isDirectory()) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tyield detectPackage(workspace, entry.name);\r\n\t\t} catch {}\r\n\t}\r\n}\r\n","import inquirer from \"inquirer\";\r\n\r\nexport interface PrompterQuestion {\r\n\tmessage: string;\r\n\toptions: string[];\r\n\tdefault?: string;\r\n}\r\n\r\nexport interface Prompter {\r\n\tconfirm(message: string): Promise<boolean>;\r\n\r\n\task(question: PrompterQuestion): Promise<string>;\r\n}\r\n\r\nexport const createDefaultPrompter = (): Prompter => {\r\n\treturn {\r\n\t\tconfirm: async (message) => {\r\n\t\t\tconst { confirm } = await inquirer.prompt([\r\n\t\t\t\t{\r\n\t\t\t\t\ttype: \"confirm\",\r\n\t\t\t\t\tmessage,\r\n\t\t\t\t\tname: \"confirm\",\r\n\t\t\t\t},\r\n\t\t\t]);\r\n\t\t\treturn confirm as boolean;\r\n\t\t},\r\n\r\n\t\task: async (question) => {\r\n\t\t\tconst { answer } = await inquirer.prompt([\r\n\t\t\t\t{\r\n\t\t\t\t\ttype: \"list\",\r\n\t\t\t\t\tmessage: question.message,\r\n\t\t\t\t\tname: \"answer\",\r\n\t\t\t\t\tchoices: question.options,\r\n\t\t\t\t\tdefault: question.default,\r\n\t\t\t\t},\r\n\t\t\t]);\r\n\t\t\treturn answer as string;\r\n\t\t},\r\n\t};\r\n};\r\n","import updateNotifier from \"update-notifier\";\r\nimport * as fs from \"fs\";\r\nimport * as path from \"path\";\r\nimport yargs from \"yargs/yargs\";\r\nimport { fileURLToPath } from \"url\";\r\n\r\nimport { translate } from \"./lib/localization\";\r\nimport { Authentication } from \"./lib/authentication\";\r\nimport { detectPackage } from \"./lib/package\";\r\nimport {\r\n\tdetectWorkspace,\r\n\treadWorkspaceNpmManifest,\r\n\twriteWorkspaceNpmManifest,\r\n} from \"./lib/workspace\";\r\nimport type { ReleaseFolderOptions } from \"./commands/publish\";\r\nimport { createDefaultPrompter } from \"./lib/prompter\";\r\n\r\nimport pjson from \"../package.json\";\r\n\r\nconst __filename = fileURLToPath(import.meta.url);\r\n\r\nconst captureError = (err: Error) => {\r\n\tconsole.log(\"\");\r\n\r\n\tif (process.env.NODE_ENV !== \"production\") {\r\n\t\tconsole.error(err);\r\n\t} else {\r\n\t\tconsole.error(translate(\"messages.error\", err.message));\r\n\t}\r\n};\r\n\r\nconst buildOptions = {\r\n\toutDir: {\r\n\t\tdescription: translate(\"options.outDir.description\"),\r\n\t\ttype: \"string\",\r\n\t\tdefault: \"bin\",\r\n\t\tcoerce: (input: string | undefined | null) =>\r\n\t\t\tinput === undefined || input === null\r\n\t\t\t\t? undefined\r\n\t\t\t\t: path.resolve(process.cwd(), input),\r\n\t},\r\n\tminimize: {\r\n\t\tdescription: translate(\"options.minimize.description\"),\r\n\t\ttype: \"boolean\",\r\n\t\tdefault: true,\r\n\t},\r\n\tcwd: {\r\n\t\tdescription: translate(\"options.cwd.description\"),\r\n\t\ttype: \"string\",\r\n\t\tdefault: process.cwd(),\r\n\t},\r\n\tclean: {\r\n\t\tdescription: translate(\"options.clean.description\"),\r\n\t\ttype: \"boolean\",\r\n\t\tdefault: false,\r\n\t},\r\n\tdocs: {\r\n\t\ttype: \"boolean\",\r\n\t\tdefault: false,\r\n\t},\r\n} as const;\r\n\r\nconst preCommandCheck = async () => {\r\n\tconst executedLocalPackager =\r\n\t\tpath.relative(process.cwd(), __filename).indexOf(\"..\") === -1;\r\n\r\n\tlet repositoryPackage:\r\n\t\t| {\r\n\t\t\t\tdependencies?: Record<string, string>;\r\n\t\t\t\tdevDependencies?: Record<string, string>;\r\n\t\t }\r\n\t\t| undefined;\r\n\r\n\ttry {\r\n\t\tconst repositoryPackageJson = fs.readFileSync(\r\n\t\t\tpath.resolve(process.cwd(), \"package.json\"),\r\n\t\t\t\"utf8\",\r\n\t\t);\r\n\r\n\t\trepositoryPackage = JSON.parse(repositoryPackageJson);\r\n\t} catch (err) {}\r\n\r\n\tif (\r\n\t\trepositoryPackage?.dependencies?.[\r\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\r\n\t\t] ||\r\n\t\trepositoryPackage?.devDependencies?.[\r\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\r\n\t\t]\r\n\t) {\r\n\t\tconst parts = [\"Detected locally installed ig.gfx.packager.\"];\r\n\r\n\t\tif (executedLocalPackager) {\r\n\t\t\tparts.push(\r\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.',\r\n\t\t\t);\r\n\t\t}\r\n\t\tparts.push(\r\n\t\t\t'Run \"npm uninstall @intelligentgraphics/ig.gfx.packager\" to remove the local version.',\r\n\t\t);\r\n\r\n\t\tconsole.error(parts.join(\"\\n\"));\r\n\t\tprocess.exit(1);\r\n\t}\r\n\r\n\tif (executedLocalPackager) {\r\n\t\tconsole.error(`Detected locally installed ig.gfx.packager.\r\nRun \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.\r\nRun \"npm install\" to get rid of the local packager version.`);\r\n\t\tprocess.exit(1);\r\n\t}\r\n\r\n\tconst notifier = updateNotifier({\r\n\t\tpkg: pjson,\r\n\t\tshouldNotifyInNpmScript: true,\r\n\t\tupdateCheckInterval: 1000 * 60,\r\n\t});\r\n\r\n\tnotifier.notify({\r\n\t\tisGlobal: true,\r\n\t\tdefer: true,\r\n\t});\r\n\r\n\tconst workspaceLocation = detectWorkspace(process.cwd());\r\n\r\n\tconst packageJson = readWorkspaceNpmManifest(workspaceLocation);\r\n\r\n\tif (packageJson === undefined) {\r\n\t\tthrow new Error(\r\n\t\t\t\"Could not load package.json file in current directory\",\r\n\t\t);\r\n\t}\r\n\r\n\tpackageJson.scripts ??= {};\r\n\tpackageJson.scripts.postinstall = \"packager postinstall\";\r\n\r\n\twriteWorkspaceNpmManifest(workspaceLocation, packageJson);\r\n};\r\n\r\nconst yargsInstance = yargs(process.argv.slice(2));\r\n\r\nyargsInstance.command(\r\n\t\"build [directories...]\",\r\n\t\"Builds the specified directories\",\r\n\t(argv) => argv.options(buildOptions),\r\n\tasync ({ directories = [], ...options }) => {\r\n\t\tawait preCommandCheck();\r\n\r\n\t\tconst { buildFolders } = await import(\"./commands/build\");\r\n\r\n\t\tawait buildFolders({\r\n\t\t\t...options,\r\n\t\t\tdirectories: directories as string[],\r\n\t\t}).catch(captureError);\r\n\t},\r\n);\r\n\r\nyargsInstance.command(\r\n\t\"publish [directory]\",\r\n\t\"Publishes the specified directory\",\r\n\t(argv) =>\r\n\t\targv.options({\r\n\t\t\t...buildOptions,\r\n\t\t\tnoUpload: {\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t\tdescription: translate(\"options.noUpload.description\"),\r\n\t\t\t},\r\n\t\t\tdomain: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.domain.description\"),\r\n\t\t\t},\r\n\t\t\tsubdomain: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.subdomain.description\"),\r\n\t\t\t},\r\n\t\t\tnewVersion: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.newVersion.description\"),\r\n\t\t\t\tdefault: process.env.VERSION,\r\n\t\t\t\trequired: true,\r\n\t\t\t},\r\n\t\t\taddress: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.address.description\"),\r\n\t\t\t\tdefault: \"localhost\",\r\n\t\t\t},\r\n\t\t\tservice: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.service.description\"),\r\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\r\n\t\t\t\trequired: true,\r\n\t\t\t},\r\n\t\t\tuser: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.user.description\"),\r\n\t\t\t\tdefault: process.env.IG_GFX_USER,\r\n\t\t\t},\r\n\t\t\tpassword: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.password.description\"),\r\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\r\n\t\t\t},\r\n\t\t\tdocs: {\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t\tdescription: translate(\"options.docs.description\"),\r\n\t\t\t},\r\n\t\t\tpushOnly: {\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t\tdescription: translate(\"options.pushOnly.description\"),\r\n\t\t\t},\r\n\t\t\tlicense: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.license.description\"),\r\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\r\n\t\t\t},\r\n\t\t}),\r\n\tasync ({ directory, user, password, service, license, ...options }) => {\r\n\t\tawait preCommandCheck();\r\n\r\n\t\tif (!options.noUpload) {\r\n\t\t\tif (!service) {\r\n\t\t\t\tcaptureError(\r\n\t\t\t\t\tnew Error(\r\n\t\t\t\t\t\ttranslate(\r\n\t\t\t\t\t\t\t\"options.service.demands\",\r\n\t\t\t\t\t\t\t\"IG_GFX_ASSET_SERVICE\",\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!license && (!user || !password)) {\r\n\t\t\t\tcaptureError(\r\n\t\t\t\t\tnew Error(\r\n\t\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\r\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\r\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (license && !license.endsWith(\".iglic\")) {\r\n\t\t\t\tcaptureError(\r\n\t\t\t\t\tnew Error(\r\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.`,\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet authentication: Authentication | undefined;\r\n\r\n\t\tif (license) {\r\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\r\n\t\t\ttry {\r\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\r\n\t\t\t\tauthentication = {\r\n\t\t\t\t\ttype: \"license\",\r\n\t\t\t\t\tlicense: content.toString(\"base64\"),\r\n\t\t\t\t};\r\n\t\t\t} catch (err) {\r\n\t\t\t\tif (err?.code === \"ENOENT\") {\r\n\t\t\t\t\tcaptureError(\r\n\t\t\t\t\t\tnew Error(\r\n\t\t\t\t\t\t\t`Expected to find a license file at path: ${fullLicensePath}`,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcaptureError(\r\n\t\t\t\t\tnew Error(\r\n\t\t\t\t\t\t`Failed to read license file at path: ${fullLicensePath}`,\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t} else if (user && password) {\r\n\t\t\tconsole.log(\r\n\t\t\t\t`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`,\r\n\t\t\t);\r\n\t\t\tauthentication = {\r\n\t\t\t\ttype: \"credentials\",\r\n\t\t\t\tusername: user,\r\n\t\t\t\tpassword,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tconst { releaseFolder } = await import(\"./commands/publish\");\r\n\r\n\t\tconst prompter = createDefaultPrompter();\r\n\r\n\t\tconst fullOptions: ReleaseFolderOptions = {\r\n\t\t\t...options,\r\n\t\t\tauthentication,\r\n\t\t\tservice: service!,\r\n\t\t\tdirectory: directory as string,\r\n\t\t\tbanner: true,\r\n\t\t\tprompter,\r\n\t\t\tnewVersion: options.newVersion!,\r\n\t\t};\r\n\r\n\t\tawait releaseFolder(fullOptions).catch(captureError);\r\n\t},\r\n);\r\n\r\nyargsInstance.command({\r\n\tcommand: \"generateIndex [directory]\",\r\n\tbuilder: (argv) => {\r\n\t\treturn argv.option(\"ignore\", {\r\n\t\t\ttype: \"array\",\r\n\t\t\tdefault: [],\r\n\t\t\tdescription: translate(\"options.ignore.description\"),\r\n\t\t});\r\n\t},\r\n\thandler: async ({ directory, ignore }) => {\r\n\t\tawait preCommandCheck();\r\n\r\n\t\tconst { extract } = await import(\"./commands/generate\");\r\n\r\n\t\tconst workspace = detectWorkspace(process.cwd());\r\n\t\tconst location = detectPackage(workspace, directory as string);\r\n\r\n\t\textract(location, ignore as string[]);\r\n\t},\r\n});\r\n\r\nyargsInstance.command({\r\n\tcommand: \"postinstall\",\r\n\tbuilder: (argv) => argv,\r\n\thandler: async () => {\r\n\t\tconst { executePostInstall } = await import(\"./commands/postinstall\");\r\n\r\n\t\texecutePostInstall(detectWorkspace(process.cwd()));\r\n\t},\r\n\tdescribe: \"Runs postinstall tasks\",\r\n});\r\n\r\nyargsInstance.command({\r\n\tcommand: \"publishNpm [directory]\",\r\n\tbuilder: (argv) =>\r\n\t\targv.options({\r\n\t\t\tnewVersion: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.newVersion.description\"),\r\n\t\t\t\tdefault: process.env.VERSION,\r\n\t\t\t\trequired: true,\r\n\t\t\t},\r\n\t\t\tdryRun: {\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t}),\r\n\thandler: async ({ directory, newVersion, dryRun }) => {\r\n\t\tconst workspace = detectWorkspace(process.cwd());\r\n\r\n\t\tconst { publishToNpm } = await import(\"./commands/publishNpm\");\r\n\r\n\t\tawait publishToNpm({\r\n\t\t\tworkspace,\r\n\t\t\tlocation: detectPackage(workspace, directory as string),\r\n\t\t\tversion: newVersion,\r\n\t\t\tdryRun,\r\n\t\t}).catch(captureError);\r\n\t},\r\n\tdescribe: \"Publishes the package to npm\",\r\n});\r\n\r\nyargsInstance\r\n\t.demandCommand()\r\n\t.pkgConf(\"packager\")\r\n\t.showHelpOnFail(false)\r\n\t.version().argv;\r\n"],"names":["__dirname","dirname","fileURLToPath","import","meta","url","instance","y18n","directory","path","join","updateFiles","locale","fallbackToLanguage","translate","key","args","__","getNodeErrorCode","error","code","undefined","isErrorENOENT","readNpmManifest","packageJsonPath","packageJson","fs","readFileSync","encoding","JSON","parse","writeNpmManifest","writePackageSync","PACKAGE_FILE","INDEX_FILE","ANIMATION_FILE_SUFFIX","parseCreatorPackageName","manifest","domain","subdomainParts","Package","split","subdomain","detectPackage","workspace","resolve","scriptsPath","tsPath","location","existsSync","_kind","scriptsDir","manifestDir","readPackageCreatorManifest","err","Error","result","Scope","writePackageCreatorManifest","creatorPackage","writeFileSync","stringify","readPackageCreatorIndex","indexPath","index","writePackageCreatorIndex","readPackageNpmManifest","writePackageNpmManifest","readPackageAnimationList","directoryContent","readdirSync","animationPathList","entry","endsWith","animationPath","push","getPackageReleasesDirectory","detectWorkspace","process","cwd","readWorkspaceNpmManifest","writeWorkspaceNpmManifest","getWorkspaceOutputPath","getWorkspaceLibPath","iterateWorkspacePackages","entries","withFileTypes","isDirectory","name","createDefaultPrompter","confirm","message","inquirer","prompt","type","ask","question","answer","choices","options","default","__filename","captureError","console","log","env","NODE_ENV","buildOptions","outDir","description","coerce","input","minimize","clean","docs","preCommandCheck","executedLocalPackager","relative","indexOf","repositoryPackage","repositoryPackageJson","dependencies","devDependencies","parts","exit","notifier","updateNotifier","pkg","pjson","shouldNotifyInNpmScript","updateCheckInterval","notify","isGlobal","defer","workspaceLocation","scripts","postinstall","yargsInstance","yargs","argv","slice","command","directories","buildFolders","catch","noUpload","newVersion","VERSION","required","address","service","IG_GFX_ASSET_SERVICE","user","IG_GFX_USER","password","IG_GFX_PWD","pushOnly","license","IG_GFX_LICENSE","authentication","fullLicensePath","content","toString","username","releaseFolder","prompter","fullOptions","banner","builder","option","handler","ignore","extract","executePostInstall","describe","dryRun","publishToNpm","version","demandCommand","pkgConf","showHelpOnFail"],"mappings":";;;;;;;;;;;AAKA,MAAMA,SAAS,GAAGC,OAAO,CAACC,aAAa,CAACC,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAA;AAEzD,MAAMC,QAAQ,GAAGC,IAAI,CAAC;EACrBC,SAAS,EAAEC,IAAI,CAACC,IAAI,CAACV,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC;AAChDW,EAAAA,WAAW,EAAE,KAAK;AAClBC,EAAAA,MAAM,EAAE,IAAI;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;;;;;;"}
|
package/build/dependencies.mjs
CHANGED
|
@@ -2,19 +2,7 @@
|
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import resolve from 'resolve';
|
|
5
|
-
import { j as readNpmManifest, i as isErrorENOENT, f as readWorkspaceNpmManifest } from './cli.mjs';
|
|
6
|
-
|
|
7
|
-
const PACKAGE_FILE = "_Package.json";
|
|
8
|
-
const INDEX_FILE = "_Index.json";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Describes the location of a single published package.
|
|
12
|
-
*
|
|
13
|
-
* I.e. node_modules/@intelligentgraphics/3d.ig.gfx.core
|
|
14
|
-
*
|
|
15
|
-
* @export
|
|
16
|
-
* @interface PublishedPackageLocation
|
|
17
|
-
*/
|
|
5
|
+
import { j as readNpmManifest, P as PACKAGE_FILE, i as isErrorENOENT, I as INDEX_FILE, f as readWorkspaceNpmManifest } from './cli.mjs';
|
|
18
6
|
|
|
19
7
|
const detectPublishedPackageByModuleName = (workspace, name) => {
|
|
20
8
|
const manifestPath = resolve.sync(name + "/package.json", {
|
|
@@ -96,11 +84,11 @@ const readPublishedPackageCreatorIndex = location => {
|
|
|
96
84
|
// return results;
|
|
97
85
|
// };
|
|
98
86
|
|
|
99
|
-
/**
|
|
100
|
-
* Recursively determines all installed ig libraries for a workspace.
|
|
101
|
-
*
|
|
102
|
-
* @param {WorkspaceLocation} workspace
|
|
103
|
-
* @returns {PublishedPackageLocation[]}
|
|
87
|
+
/**
|
|
88
|
+
* Recursively determines all installed ig libraries for a workspace.
|
|
89
|
+
*
|
|
90
|
+
* @param {WorkspaceLocation} workspace
|
|
91
|
+
* @returns {PublishedPackageLocation[]}
|
|
104
92
|
*/
|
|
105
93
|
const determineWorkspaceIGLibraries = workspace => {
|
|
106
94
|
const manifest = readWorkspaceNpmManifest(workspace);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.mjs","sources":["../src/lib/publishedPackage.ts","../src/lib/dependencies.ts"],"sourcesContent":["import * as path from \"path\";\nimport * as fs from \"fs\";\nimport resolve from \"resolve\";\n\nimport { readNpmManifest } from \"./npmPackage\";\nimport {
|
|
1
|
+
{"version":3,"file":"dependencies.mjs","sources":["../src/lib/publishedPackage.ts","../src/lib/dependencies.ts"],"sourcesContent":["import * as path from \"path\";\r\nimport * as fs from \"fs\";\r\nimport resolve from \"resolve\";\r\n\r\nimport { readNpmManifest } from \"./npmPackage\";\r\nimport {\r\n\tCreatorPackage,\r\n\tINDEX_FILE,\r\n\tPackageNpmManifest,\r\n\tPACKAGE_FILE,\r\n} from \"./package\";\r\nimport { isErrorENOENT } from \"./error\";\r\nimport { WorkspaceLocation } from \"./workspace\";\r\n\r\n/**\r\n * Describes the location of a single published package.\r\n *\r\n * I.e. node_modules/@intelligentgraphics/3d.ig.gfx.core\r\n *\r\n * @export\r\n * @interface PublishedPackageLocation\r\n */\r\nexport interface PublishedPackageLocation {\r\n\t_kind: \"PublishedPackageLocation\";\r\n\tpath: string;\r\n}\r\n\r\nexport const detectPublishedPackageByModuleName = (\r\n\tworkspace: WorkspaceLocation,\r\n\tname: string,\r\n) => {\r\n\tconst manifestPath = resolve.sync(name + \"/package.json\", {\r\n\t\tbasedir: workspace.path,\r\n\t});\r\n\tconst dir = path.dirname(manifestPath);\r\n\treturn detectPublishedPackage(dir);\r\n};\r\n\r\nexport const detectPublishedPackage = (\r\n\tpath: string,\r\n): PublishedPackageLocation => ({\r\n\t_kind: \"PublishedPackageLocation\",\r\n\tpath,\r\n});\r\n\r\nexport const readPublishedPackageNpmManifest = (\r\n\tlocation: PublishedPackageLocation,\r\n): PackageNpmManifest => {\r\n\treturn readNpmManifest<PackageNpmManifest>(location.path);\r\n};\r\n\r\nexport const readPublishedPackageCreatorManifest = (\r\n\tlocation: PublishedPackageLocation,\r\n): CreatorPackage | undefined => {\r\n\ttry {\r\n\t\tconst packageJsonPath = path.join(location.path, PACKAGE_FILE);\r\n\t\tconst packageJson = fs.readFileSync(packageJsonPath, {\r\n\t\t\tencoding: \"utf8\",\r\n\t\t});\r\n\t\tconst result: Omit<CreatorPackage, \"Scope\"> & { Scope?: string } =\r\n\t\t\tJSON.parse(packageJson);\r\n\t\treturn {\r\n\t\t\t...result,\r\n\t\t\tScope: result.Scope || result.Package,\r\n\t\t};\r\n\t} catch (err) {\r\n\t\tif (isErrorENOENT(err)) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\tthrow err;\r\n\t}\r\n};\r\n\r\nexport const readPublishedPackageCreatorIndex = (\r\n\tlocation: PublishedPackageLocation,\r\n) => {\r\n\ttry {\r\n\t\tconst packageJsonPath = path.join(location.path, INDEX_FILE);\r\n\t\tconst packageJson = fs.readFileSync(packageJsonPath, {\r\n\t\t\tencoding: \"utf8\",\r\n\t\t});\r\n\t\tconst result: object = JSON.parse(packageJson);\r\n\t\treturn result;\r\n\t} catch (err) {\r\n\t\tif (isErrorENOENT(err)) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\tthrow err;\r\n\t}\r\n};\r\n","import { CreatorPackage } from \"./package\";\r\nimport { PackageJSON } from \"./packageJSON\";\r\nimport {\r\n\tdetectPublishedPackageByModuleName,\r\n\tPublishedPackageLocation,\r\n\treadPublishedPackageCreatorManifest,\r\n\treadPublishedPackageNpmManifest,\r\n} from \"./publishedPackage\";\r\nimport { readWorkspaceNpmManifest, WorkspaceLocation } from \"./workspace\";\r\n\r\n// /**\r\n// * Determines the implicit dependencies of a an actual data workspace package.\r\n// *\r\n// * An implicit dependency is a dependency that is installed for the workspace and has the same runtime environment (evaluator, interactor) as the package.\r\n// *\r\n// * @param {WorkspaceLocation} workspace\r\n// * @param {CreatorPackage} creatorPackage\r\n// * @returns {PublishedPackageLocation[]}\r\n// */\r\n// export const determinePackageImplicitDependencies = (\r\n// \tworkspace: WorkspaceLocation,\r\n// \tcreatorPackage: CreatorPackage,\r\n// ): PublishedPackageLocation[] => {\r\n// \tconst libraries = determineWorkspaceIGLibraries(workspace);\r\n\r\n// \tconst results: PublishedPackageLocation[] = [];\r\n// \tfor (const librarylocation of libraries) {\r\n// \t\tconst libraryManifest =\r\n// \t\t\treadPublishedPackageCreatorManifest(librarylocation);\r\n\r\n// \t\tif (\r\n// \t\t\tlibraryManifest !== undefined &&\r\n// \t\t\t(libraryManifest.Type === \"Mixed\" ||\r\n// \t\t\t\tlibraryManifest.RunTime === creatorPackage.RunTime)\r\n// \t\t) {\r\n// \t\t\tresults.push(librarylocation);\r\n// \t\t}\r\n// \t}\r\n\r\n// \treturn results;\r\n// };\r\n\r\n/**\r\n * Recursively determines all installed ig libraries for a workspace.\r\n *\r\n * @param {WorkspaceLocation} workspace\r\n * @returns {PublishedPackageLocation[]}\r\n */\r\nexport const determineWorkspaceIGLibraries = (\r\n\tworkspace: WorkspaceLocation,\r\n): PublishedPackageLocation[] => {\r\n\tconst manifest = readWorkspaceNpmManifest(workspace);\r\n\r\n\tif (manifest === undefined) {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tconst libraries = collectIGLibraries(workspace, manifest);\r\n\tconst results = new Map<string, PublishedPackageLocation>();\r\n\r\n\tfor (const location of libraries) {\r\n\t\tconst manifest = readPublishedPackageNpmManifest(location);\r\n\t\tif (!results.has(manifest.name)) {\r\n\t\t\tresults.set(manifest.name, location);\r\n\t\t}\r\n\t}\r\n\r\n\treturn Array.from(results.values());\r\n};\r\n\r\nconst collectIGLibraries = (\r\n\tworkspace: WorkspaceLocation,\r\n\tmanifest: PackageJSON,\r\n): PublishedPackageLocation[] => {\r\n\tif (!manifest.dependencies) {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tconst runtimeDependencies = Object.getOwnPropertyNames(\r\n\t\tmanifest.dependencies,\r\n\t);\r\n\r\n\tconst result: PublishedPackageLocation[] = [];\r\n\r\n\tfor (const runtimeDependency of runtimeDependencies) {\r\n\t\tconst location = detectPublishedPackageByModuleName(\r\n\t\t\tworkspace,\r\n\t\t\truntimeDependency,\r\n\t\t);\r\n\r\n\t\tconst runtimeManifest = readPublishedPackageNpmManifest(location);\r\n\r\n\t\t// packages need to explicitly be marked as ig scriptingLibraries\r\n\t\tif (runtimeManifest.ig?.scriptingLibrary) {\r\n\t\t\tresult.push(location);\r\n\t\t\tresult.push(...collectIGLibraries(workspace, runtimeManifest));\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\n"],"names":["detectPublishedPackageByModuleName","workspace","name","manifestPath","resolve","sync","basedir","path","dir","dirname","detectPublishedPackage","_kind","readPublishedPackageNpmManifest","location","readNpmManifest","readPublishedPackageCreatorManifest","packageJsonPath","join","PACKAGE_FILE","packageJson","fs","readFileSync","encoding","result","JSON","parse","Scope","Package","err","isErrorENOENT","undefined","readPublishedPackageCreatorIndex","INDEX_FILE","determineWorkspaceIGLibraries","manifest","readWorkspaceNpmManifest","libraries","collectIGLibraries","results","Map","has","set","Array","from","values","dependencies","runtimeDependencies","Object","getOwnPropertyNames","runtimeDependency","runtimeManifest","ig","scriptingLibrary","push"],"mappings":";;;;;;AA2BO,MAAMA,kCAAkC,GAAG,CACjDC,SAA4B,EAC5BC,IAAY,KACR;EACJ,MAAMC,YAAY,GAAGC,OAAO,CAACC,IAAI,CAACH,IAAI,GAAG,eAAe,EAAE;IACzDI,OAAO,EAAEL,SAAS,CAACM,IAAAA;AACpB,GAAC,CAAC,CAAA;AACF,EAAA,MAAMC,GAAG,GAAGD,IAAI,CAACE,OAAO,CAACN,YAAY,CAAC,CAAA;EACtC,OAAOO,sBAAsB,CAACF,GAAG,CAAC,CAAA;AACnC,CAAC,CAAA;AAEM,MAAME,sBAAsB,GAClCH,IAAY,KACmB;AAC/BI,EAAAA,KAAK,EAAE,0BAA0B;AACjCJ,EAAAA,IAAAA;AACD,CAAC,CAAC,CAAA;AAEWK,MAAAA,+BAA+B,GAC3CC,QAAkC,IACV;AACxB,EAAA,OAAOC,eAAe,CAAqBD,QAAQ,CAACN,IAAI,CAAC,CAAA;AAC1D,EAAC;AAEYQ,M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AA;AACpD,IAAA,MAAMjC,QAAQ,GAAGb,kCAAkC,CAClDC,SAAS,EACTgD,iBAAiB,CACjB,CAAA;AAED,IAAA,MAAMC,eAAe,GAAGtC,+BAA+B,CAACC,QAAQ,CAAC,CAAA;;AAEjE;AACA,IAAA,IAAA,CAAA,mBAAA,GAAIqC,eAAe,CAACC,EAAE,MAAlB,IAAA,IAAA,mBAAA,KAAA,KAAA,CAAA,IAAA,mBAAA,CAAoBC,gBAAgB,EAAE;AACzC7B,MAAAA,MAAM,CAAC8B,IAAI,CAACxC,QAAQ,CAAC,CAAA;MACrBU,MAAM,CAAC8B,IAAI,CAAC,GAAGhB,kBAAkB,CAACpC,SAAS,EAAEiD,eAAe,CAAC,CAAC,CAAA;AAC/D,KAAA;AACD,GAAA;AAEA,EAAA,OAAO3B,MAAM,CAAA;AACd,CAAC;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import ts from 'typescript';
|
|
3
|
-
import '
|
|
4
|
-
import {
|
|
5
|
-
import { g as getPackageTypescriptFiles } from '../scripts.mjs';
|
|
3
|
+
import { k as writePackageCreatorIndex } from './cli.mjs';
|
|
4
|
+
import { g as getPackageTypescriptFiles } from './scripts.mjs';
|
|
6
5
|
import 'update-notifier';
|
|
7
6
|
import 'fs';
|
|
8
7
|
import 'path';
|
|
@@ -133,10 +132,10 @@ function findParametersInterfaceInFiles(program, fileList, name) {
|
|
|
133
132
|
return undefined;
|
|
134
133
|
}
|
|
135
134
|
|
|
136
|
-
/**
|
|
137
|
-
* Extracts and returns script array for _Index.json from a src folder
|
|
138
|
-
*
|
|
139
|
-
* @param folderPath path to a src folder
|
|
135
|
+
/**
|
|
136
|
+
* Extracts and returns script array for _Index.json from a src folder
|
|
137
|
+
*
|
|
138
|
+
* @param folderPath path to a src folder
|
|
140
139
|
*/
|
|
141
140
|
function extract(location, ignore = []) {
|
|
142
141
|
const files = getPackageTypescriptFiles(location);
|
|
@@ -155,7 +154,6 @@ function extract(location, ignore = []) {
|
|
|
155
154
|
|
|
156
155
|
// Loop through the root AST nodes of the file
|
|
157
156
|
ts.forEachChild(sourceFile, node => {
|
|
158
|
-
let obj = {};
|
|
159
157
|
const evalNode = findEvaluatorNode(node);
|
|
160
158
|
if (evalNode === undefined) {
|
|
161
159
|
return;
|
|
@@ -164,14 +162,19 @@ function extract(location, ignore = []) {
|
|
|
164
162
|
if (evalNode.name === undefined) {
|
|
165
163
|
throw new Error(`Expected evaluator class to have a name`);
|
|
166
164
|
}
|
|
167
|
-
|
|
168
|
-
if (
|
|
165
|
+
const name = moduleName + "." + evalNode.name.getText();
|
|
166
|
+
if (name.length > 45) throw new Error(`Package name length >45 '${name}'`);
|
|
169
167
|
let para = getParameter(evalNode);
|
|
170
168
|
let paraName = (para === null || para === void 0 ? void 0 : para.type).typeName.getText();
|
|
171
169
|
let interfac = findParametersInterfaceInFiles(program, filtered, paraName);
|
|
172
170
|
if (interfac === undefined) {
|
|
173
171
|
throw new Error(`Failed to find parameters type declaration for evaluator ${evalNode.name.getText()}`);
|
|
174
172
|
}
|
|
173
|
+
const obj = {
|
|
174
|
+
Name: name,
|
|
175
|
+
Parameters: [],
|
|
176
|
+
Type: "Evaluator"
|
|
177
|
+
};
|
|
175
178
|
let rawDocTags = ts.getJSDocTags(evalNode);
|
|
176
179
|
if (rawDocTags.length) {
|
|
177
180
|
let dict = getTagDict(rawDocTags);
|