@intelligentgraphics/ig.gfx.packager 3.1.0-alpha.5 → 3.1.0-alpha.7
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/bin.mjs +1 -2
- package/build/bin.mjs.map +1 -1
- package/build/{cli-sBIEQH_m.mjs → cli-IlMWNOvf.mjs} +18 -16
- package/build/cli-IlMWNOvf.mjs.map +1 -0
- package/build/{dependencies-DHQlbmdd.mjs → dependencies-CPZzEh3z.mjs} +2 -2
- package/build/{dependencies-DHQlbmdd.mjs.map → dependencies-CPZzEh3z.mjs.map} +1 -1
- package/build/docs-BlCIta3Y.mjs +37 -0
- package/build/docs-BlCIta3Y.mjs.map +1 -0
- package/build/{generateIndex-C--2euvA.mjs → generateIndex-Cf7p2QcW.mjs} +4 -4
- package/build/{generateIndex-C--2euvA.mjs.map → generateIndex-Cf7p2QcW.mjs.map} +1 -1
- package/build/{generateParameterType-BHVKwPrn.mjs → generateParameterType-Cdp9a31q.mjs} +3 -3
- package/build/{generateParameterType-BHVKwPrn.mjs.map → generateParameterType-Cdp9a31q.mjs.map} +1 -1
- package/build/{index-50hVP5ou.mjs → index-Dcu2jMcl.mjs} +7 -8
- package/build/{index-50hVP5ou.mjs.map → index-Dcu2jMcl.mjs.map} +1 -1
- package/build/{index-BsakORqB.mjs → index-w4ax9Zlz.mjs} +54 -50
- package/build/index-w4ax9Zlz.mjs.map +1 -0
- package/build/{postinstall-DBSj4Bwh.mjs → postinstall-Cb7g6gsR.mjs} +4 -4
- package/build/{postinstall-DBSj4Bwh.mjs.map → postinstall-Cb7g6gsR.mjs.map} +1 -1
- package/build/{publishNpm-CBY7sxWk.mjs → publishNpm-29blnfYN.mjs} +6 -7
- package/build/{publishNpm-CBY7sxWk.mjs.map → publishNpm-29blnfYN.mjs.map} +1 -1
- package/build/{rollup-DakgWejt.mjs → rollup-DoDZFLyJ.mjs} +19 -15
- package/build/rollup-DoDZFLyJ.mjs.map +1 -0
- package/build/{scripts-BmQnbRem.mjs → scripts-B3noxiX3.mjs} +2 -2
- package/build/{scripts-BmQnbRem.mjs.map → scripts-B3noxiX3.mjs.map} +1 -1
- package/build/{versionFile-DLMeLtg7.mjs → versionFile-_S1eIMrS.mjs} +4 -4
- package/build/{versionFile-DLMeLtg7.mjs.map → versionFile-_S1eIMrS.mjs.map} +1 -1
- package/lib/lib.mjs +50 -47
- package/package.json +5 -7
- package/readme.md +10 -0
- package/build/cli-sBIEQH_m.mjs.map +0 -1
- package/build/index-BsakORqB.mjs.map +0 -1
- package/build/rollup-DakgWejt.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionFile-DLMeLtg7.mjs","sources":["../../tools.core/build/fs.mjs","../src/lib/git.ts","../src/lib/banner.ts","../src/lib/parseVersion.ts","../src/lib/versionFile.ts"],"sourcesContent":["import * as fs from 'fs';\nimport { isErrorENOENT } from './error.mjs';\n\nconst readStringFromFile = (filePath)=>fs.readFileSync(filePath, {\n encoding: \"utf8\"\n });\nconst readStringFromFileOrUndefined = (filePath)=>{\n try {\n return readStringFromFile(filePath);\n } catch (err) {\n if (!isErrorENOENT(err)) {\n throw err;\n }\n return undefined;\n }\n};\n\nexport { readStringFromFile, readStringFromFileOrUndefined };\n//# sourceMappingURL=fs.mjs.map\n","import simpleGit from \"simple-git\";\nimport * as path from \"path\";\n\nimport { WorkspaceLocation } from \"./workspace\";\nimport { PackageLocation } from \"./package\";\n\nexport const getVersionInformationFromGit = async (\n\tworkspaceLocation: WorkspaceLocation,\n\tpackageLocation: PackageLocation,\n) => {\n\ttry {\n\t\tconst git = simpleGit({\n\t\t\tbaseDir: workspaceLocation.path,\n\t\t});\n\n\t\t// check wether the files for a folder are changed\n\t\t// if so, mark as dirty\n\t\tconst diff = await git.diffSummary();\n\n\t\tconst dirty = diff.files.some((file) => {\n\t\t\tif (\n\t\t\t\tfile.file.toLowerCase().includes(\"releases\") ||\n\t\t\t\tfile.file.toLowerCase().endsWith(\"version.ts\") ||\n\t\t\t\tfile.file.toLowerCase().endsWith(\"package.json\")\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst fullPath = path.resolve(workspaceLocation.path, file.file);\n\t\t\tconst relativePath = path.relative(packageLocation.path, fullPath);\n\n\t\t\treturn !relativePath.startsWith(\"..\");\n\t\t});\n\n\t\tconst log = await git.log({ maxCount: 1 });\n\t\tconst commit = !log.latest?.hash\n\t\t\t? undefined\n\t\t\t: log.latest.hash.substring(0, 7);\n\n\t\treturn {\n\t\t\tcommit,\n\t\t\tdirty,\n\t\t\tcommitDate: log.latest?.date,\n\t\t};\n\t} catch (err) {\n\t\treturn {};\n\t}\n};\n","import { WorkspacePackageJSON } from \"./workspace\";\n\nexport const getWorkspaceBannerText = (manifest: WorkspacePackageJSON) => {\n\tlet bannerText = manifest?.packager?.banner;\n\n\tif (bannerText) {\n\t\tconst match = bannerText.match(/Copyright \\(C\\) (\\d+)( ?- ?(\\d+))?/);\n\n\t\tif (match !== null) {\n\t\t\tconst startYear = parseInt(match[1]);\n\t\t\tconst endYear = new Date().getFullYear();\n\n\t\t\tif (startYear !== endYear) {\n\t\t\t\tbannerText = bannerText.replace(\n\t\t\t\t\tmatch[0],\n\t\t\t\t\t`Copyright (C) ${startYear} - ${endYear}`,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tbannerText = bannerText.replace(\n\t\t\t\t\tmatch[0],\n\t\t\t\t\t`Copyright (C) ${startYear}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn bannerText;\n};\n","import { PackageVersion } from \"./packageVersion\";\n\nexport const parseVersionFromString = (input: string) => {\n\tif (input === undefined) {\n\t\tthrow new Error(`Can not parse version from undefined`);\n\t}\n\n\tlet match: RegExpMatchArray | null;\n\n\tlet major!: string;\n\tlet minor!: string;\n\tlet patch!: string;\n\tlet build: string | undefined;\n\tlet preReleaseType: string | undefined;\n\tlet preReleaseNumber: string | undefined;\n\n\tif (\n\t\t// first try to find a full match with build number\n\t\t(match = input.match(\n\t\t\t/(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)(-([^\\.]+)\\.(\\d+))?/,\n\t\t)) !== null\n\t) {\n\t\t[, major, minor, patch, build, preReleaseType, preReleaseNumber] =\n\t\t\tmatch;\n\t} else if (\n\t\t(match = input.match(/(\\d+)\\.(\\d+)\\.(\\d+)(-([^\\.]+)\\.(\\d+))?/)) !== null\n\t) {\n\t\t[, major, minor, patch, , preReleaseType, preReleaseNumber] = match;\n\t}\n\n\tif (match === null) {\n\t\tthrow new Error(`Could not parse version from input: ${input}`);\n\t}\n\n\tlet preRelease: PackageVersion[\"preRelease\"] = undefined;\n\tlet buildNumber = 100;\n\n\tif (preReleaseType && preReleaseNumber) {\n\t\tpreRelease = {\n\t\t\ttype: preReleaseType,\n\t\t\tversion: parseInt(preReleaseNumber),\n\t\t};\n\t}\n\n\tif (build) {\n\t\tbuildNumber = Number(build);\n\t} else if (input) {\n\t\tconst descriptionMatch = input.match(/(\\d+)\\)$/);\n\n\t\tif (descriptionMatch) {\n\t\t\tbuildNumber = parseInt(descriptionMatch[1]);\n\t\t}\n\t}\n\n\treturn new PackageVersion(\n\t\tparseInt(major),\n\t\tparseInt(minor),\n\t\tparseInt(patch),\n\t\tpreRelease,\n\t\tbuildNumber,\n\t);\n};\n\n// 1000001001 -> 1.0.1.1\n// 1002017001 -> 1.2.17.1\nexport const parseVersionFromNumericVersion = (\n\tversion: number,\n): PackageVersion => {\n\tconst major = Math.floor(version / 1000000000);\n\tconst minor = Math.floor((version % 1000000000) / 1000000);\n\tconst patch = Math.floor((version % 1000000) / 1000);\n\tconst buildNumber = version % 1000;\n\n\treturn new PackageVersion(major, minor, patch, undefined, buildNumber);\n};\n","import * as fs from \"fs\";\nimport * as path from \"path\";\n\nimport { isErrorENOENT } from \"./error\";\nimport { readStringFromFileOrUndefined } from \"./fs\";\nimport { PackageLocation } from \"./package\";\nimport { PackageVersion } from \"./packageVersion\";\n\n// https://regex101.com/r/LtGAu5/1\nconst logRegex =\n\t/console\\.log\\(\\s*\"([\\w\\s\\.\\(\\)]+)\\ *Copyright[\\w\\s\\(\\)\\.]+(\\d{4}|\\d{4} - \\d{4})([\\w\\s\\(\\)\\.]+)?\",?\\s*\\)/i;\nconst currentYear = new Date(Date.now()).getFullYear();\n\nexport function getVersionFileHandler(location: PackageLocation) {\n\tconst filePath = path.join(location.scriptsDir, \"Version.ts\");\n\n\tfunction invalidVersionFile(\n\t\tversionFile: string | undefined,\n\t\texists: boolean,\n\t) {\n\t\treturn {\n\t\t\texists,\n\t\t\twrite: (name: string, newVersion: PackageVersion) => {\n\t\t\t\tconst scriptsContent = fs.readdirSync(location.scriptsDir);\n\t\t\t\tconst tsFiles = scriptsContent.filter((file) =>\n\t\t\t\t\tfile.endsWith(\".ts\"),\n\t\t\t\t);\n\n\t\t\t\tif (tsFiles.length > 0) {\n\t\t\t\t\treturn createVersionFileWriter([currentYear], \"\")(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tnewVersion,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\treset: () => {\n\t\t\t\tif (versionFile !== undefined) {\n\t\t\t\t\tfs.writeFileSync(filePath, versionFile, {\n\t\t\t\t\t\tencoding: \"utf8\",\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfs.rmSync(filePath);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tif (!isErrorENOENT(err)) {\n\t\t\t\t\t\t\tthrow err;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n\n\ttype CopyrightRange = [number, number?];\n\n\tfunction createVersionFileWriter(\n\t\tcopyright: CopyrightRange = [currentYear],\n\t\tcopyrightStuff: string = \"\",\n\t) {\n\t\treturn (name: string, newVersion: PackageVersion) => {\n\t\t\tconst descriptionText = newVersion.toDescriptionString(name);\n\t\t\tconst copyrightText = createYearString(copyright);\n\n\t\t\tconst result = `console.log(\"${descriptionText}. Copyright (C) ${copyrightText}${copyrightStuff}\");`;\n\n\t\t\tfs.writeFileSync(filePath, result, { encoding: \"utf-8\" });\n\t\t};\n\t}\n\n\tlet rawVersionFile = readStringFromFileOrUndefined(filePath);\n\n\tif (rawVersionFile === undefined) {\n\t\treturn invalidVersionFile(rawVersionFile, false);\n\t}\n\n\tconst versionFile = rawVersionFile.replace(/\\n/g, \"\");\n\n\tconst match = versionFile.match(logRegex);\n\n\tif (!match) {\n\t\treturn invalidVersionFile(versionFile, true);\n\t}\n\n\tconst [_full, _description, copyright, copyrightStuff] = match as [\n\t\tstring,\n\t\tstring,\n\t\tstring,\n\t\tstring?,\n\t];\n\n\tconst copyrightYears = copyright.match(/^(\\d+)( ?- ?(\\d+))?$/);\n\n\tlet years: [number, number?];\n\n\tif (copyrightYears === null) {\n\t\tyears = [currentYear];\n\t} else {\n\t\tyears = [Number(copyrightYears[1]), currentYear];\n\t}\n\n\treturn {\n\t\texists: true,\n\t\twrite: createVersionFileWriter(years, copyrightStuff),\n\t\treset: () => {\n\t\t\tfs.writeFileSync(filePath, versionFile, { encoding: \"utf8\" });\n\t\t},\n\t};\n}\n\nconst createYearString = (years: [number, number?]) => {\n\tif (years[1] === undefined || years[0] === years[1]) {\n\t\treturn years[0].toString();\n\t}\n\n\treturn `${years[0]} - ${years[1]}`;\n};\n"],"names":["readStringFromFile","filePath","fs","readFileSync","encoding","readStringFromFileOrUndefined","err","isErrorENOENT","undefined","getVersionInformationFromGit","workspaceLocation","packageLocation","git","simpleGit","baseDir","path","diff","diffSummary","dirty","files","some","file","toLowerCase","includes","endsWith","fullPath","resolve","relativePath","relative","startsWith","log","maxCount","commit","latest","hash","substring","commitDate","date","getWorkspaceBannerText","manifest","bannerText","packager","banner","match","startYear","parseInt","endYear","Date","getFullYear","replace","parseVersionFromString","input","Error","major","minor","patch","build","preReleaseType","preReleaseNumber","preRelease","buildNumber","type","version","Number","descriptionMatch","PackageVersion","parseVersionFromNumericVersion","Math","floor","logRegex","currentYear","now","getVersionFileHandler","location","join","scriptsDir","invalidVersionFile","versionFile","exists","write","name","newVersion","scriptsContent","readdirSync","tsFiles","filter","length","createVersionFileWriter","reset","writeFileSync","rmSync","copyright","copyrightStuff","descriptionText","toDescriptionString","copyrightText","createYearString","result","rawVersionFile","_full","_description","copyrightYears","years","toString"],"mappings":";;;;;;;;;;MAIaA,kBAAAA,GAAqB,CAACC,QAAAA,GAClCC,EAAAA,CAAGC,YAAY,CAACF,QAAAA,EAAU;AAAEG,QAAAA,QAAAA,EAAU;AAAO,KAAA,CAAA;AAEvC,MAAMC,6BAAAA,GAAgC,CAC5CJ,QAAAA,GAAAA;IAEA,IAAI;QACH,OAAOD,kBAAAA,CAAmBC,QAAAA,CAAAA;IAC3B,CAAA,CAAE,OAAOK,GAAAA,EAAK;AACb,QAAA,IAAI,CAACC,aAAAA,CAAcD,GAAAA,CAAAA,EAAM;AACxB,YAAA,MAAMA,GAAAA;AACP,QAAA;AACA,QAAA,OAAOE,SAAAA;AACR,IAAA;AACD,CAAA;;ACZO,MAAMC,4BAAAA,GAA+B,OAC3CC,iBAAAA,EACAC,eAAAA,GAAAA;IAEA,IAAI;AACH,QAAA,MAAMC,MAAMC,SAAAA,CAAU;AACrBC,YAAAA,OAAAA,EAASJ,kBAAkBK;AAC5B,SAAA,CAAA;;;QAIA,MAAMC,IAAAA,GAAO,MAAMJ,GAAAA,CAAIK,WAAW,EAAA;AAElC,QAAA,MAAMC,QAAQF,IAAAA,CAAKG,KAAK,CAACC,IAAI,CAAC,CAACC,IAAAA,GAAAA;YAC9B,IACCA,IAAAA,CAAKA,IAAI,CAACC,WAAW,GAAGC,QAAQ,CAAC,UAAA,CAAA,IACjCF,IAAAA,CAAKA,IAAI,CAACC,WAAW,EAAA,CAAGE,QAAQ,CAAC,YAAA,CAAA,IACjCH,IAAAA,CAAKA,IAAI,CAACC,WAAW,EAAA,CAAGE,QAAQ,C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CAAA,MAAO;QACNgC,KAAAA,GAAQ;YAACvC,MAAAA,CAAOsC,cAAc,CAAC,CAAA,CAAE,CAAA;AAAG/B,YAAAA;AAAY,SAAA;AACjD,IAAA;IAEA,OAAO;QACNQ,MAAAA,EAAQ,IAAA;AACRC,QAAAA,KAAAA,EAAOQ,wBAAwBe,KAAAA,EAAOV,cAAAA,CAAAA;QACtCJ,KAAAA,EAAO,IAAA;YACNtF,EAAAA,CAAGuF,aAAa,CAACxF,QAAAA,EAAU4E,WAAAA,EAAa;gBAAEzE,QAAAA,EAAU;AAAO,aAAA,CAAA;AAC5D,QAAA;AACD,KAAA;AACD;AAEA,MAAM4F,mBAAmB,CAACM,KAAAA,GAAAA;AACzB,IAAA,IAAIA,KAAK,CAAC,CAAA,CAAE,KAAK9F,SAAAA,IAAa8F,KAAK,CAAC,CAAA,CAAE,KAAKA,KAAK,CAAC,CAAA,CAAE,EAAE;AACpD,QAAA,OAAOA,KAAK,CAAC,CAAA,CAAE,CAACC,QAAQ,EAAA;AACzB,IAAA;IAEA,OAAO,CAAA,EAAGD,KAAK,CAAC,CAAA,CAAE,CAAC,GAAG,EAAEA,KAAK,CAAC,CAAA,CAAE,CAAA,CAAE;AACnC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"versionFile-_S1eIMrS.mjs","sources":["../../tools.core/build/fs.mjs","../src/lib/git.ts","../src/lib/banner.ts","../src/lib/parseVersion.ts","../src/lib/versionFile.ts"],"sourcesContent":["import * as fs from 'fs';\nimport { isErrorENOENT } from './error.mjs';\n\nconst readStringFromFile = (filePath)=>fs.readFileSync(filePath, {\n encoding: \"utf8\"\n });\nconst readStringFromFileOrUndefined = (filePath)=>{\n try {\n return readStringFromFile(filePath);\n } catch (err) {\n if (!isErrorENOENT(err)) {\n throw err;\n }\n return undefined;\n }\n};\n\nexport { readStringFromFile, readStringFromFileOrUndefined };\n//# sourceMappingURL=fs.mjs.map\n","import simpleGit from \"simple-git\";\nimport * as path from \"path\";\n\nimport { WorkspaceLocation } from \"./workspace\";\nimport { PackageLocation } from \"./package\";\n\nexport const getVersionInformationFromGit = async (\n\tworkspaceLocation: WorkspaceLocation,\n\tpackageLocation: PackageLocation,\n) => {\n\ttry {\n\t\tconst git = simpleGit({\n\t\t\tbaseDir: workspaceLocation.path,\n\t\t});\n\n\t\t// check wether the files for a folder are changed\n\t\t// if so, mark as dirty\n\t\tconst diff = await git.diffSummary();\n\n\t\tconst dirty = diff.files.some((file) => {\n\t\t\tif (\n\t\t\t\tfile.file.toLowerCase().includes(\"releases\") ||\n\t\t\t\tfile.file.toLowerCase().endsWith(\"version.ts\") ||\n\t\t\t\tfile.file.toLowerCase().endsWith(\"package.json\")\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst fullPath = path.resolve(workspaceLocation.path, file.file);\n\t\t\tconst relativePath = path.relative(packageLocation.path, fullPath);\n\n\t\t\treturn !relativePath.startsWith(\"..\");\n\t\t});\n\n\t\tconst log = await git.log({ maxCount: 1 });\n\t\tconst commit = !log.latest?.hash\n\t\t\t? undefined\n\t\t\t: log.latest.hash.substring(0, 7);\n\n\t\treturn {\n\t\t\tcommit,\n\t\t\tdirty,\n\t\t\tcommitDate: log.latest?.date,\n\t\t};\n\t} catch (err) {\n\t\treturn {};\n\t}\n};\n","import { WorkspacePackageJSON } from \"./workspace\";\n\nexport const getWorkspaceBannerText = (manifest: WorkspacePackageJSON) => {\n\tlet bannerText = manifest?.packager?.banner;\n\n\tif (bannerText) {\n\t\tconst match = bannerText.match(/Copyright \\(C\\) (\\d+)( ?- ?(\\d+))?/);\n\n\t\tif (match !== null) {\n\t\t\tconst startYear = parseInt(match[1]);\n\t\t\tconst endYear = new Date().getFullYear();\n\n\t\t\tif (startYear !== endYear) {\n\t\t\t\tbannerText = bannerText.replace(\n\t\t\t\t\tmatch[0],\n\t\t\t\t\t`Copyright (C) ${startYear} - ${endYear}`,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tbannerText = bannerText.replace(\n\t\t\t\t\tmatch[0],\n\t\t\t\t\t`Copyright (C) ${startYear}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn bannerText;\n};\n","import { PackageVersion } from \"./packageVersion\";\n\nexport const parseVersionFromString = (input: string) => {\n\tif (input === undefined) {\n\t\tthrow new Error(`Can not parse version from undefined`);\n\t}\n\n\tlet match: RegExpMatchArray | null;\n\n\tlet major!: string;\n\tlet minor!: string;\n\tlet patch!: string;\n\tlet build: string | undefined;\n\tlet preReleaseType: string | undefined;\n\tlet preReleaseNumber: string | undefined;\n\n\tif (\n\t\t// first try to find a full match with build number\n\t\t(match = input.match(\n\t\t\t/(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)(-([^\\.]+)\\.(\\d+))?/,\n\t\t)) !== null\n\t) {\n\t\t[, major, minor, patch, build, preReleaseType, preReleaseNumber] =\n\t\t\tmatch;\n\t} else if (\n\t\t(match = input.match(/(\\d+)\\.(\\d+)\\.(\\d+)(-([^\\.]+)\\.(\\d+))?/)) !== null\n\t) {\n\t\t[, major, minor, patch, , preReleaseType, preReleaseNumber] = match;\n\t}\n\n\tif (match === null) {\n\t\tthrow new Error(`Could not parse version from input: ${input}`);\n\t}\n\n\tlet preRelease: PackageVersion[\"preRelease\"] = undefined;\n\tlet buildNumber = 100;\n\n\tif (preReleaseType && preReleaseNumber) {\n\t\tpreRelease = {\n\t\t\ttype: preReleaseType,\n\t\t\tversion: parseInt(preReleaseNumber),\n\t\t};\n\t}\n\n\tif (build) {\n\t\tbuildNumber = Number(build);\n\t} else if (input) {\n\t\tconst descriptionMatch = input.match(/(\\d+)\\)$/);\n\n\t\tif (descriptionMatch) {\n\t\t\tbuildNumber = parseInt(descriptionMatch[1]);\n\t\t}\n\t}\n\n\treturn new PackageVersion(\n\t\tparseInt(major),\n\t\tparseInt(minor),\n\t\tparseInt(patch),\n\t\tpreRelease,\n\t\tbuildNumber,\n\t);\n};\n\n// 1000001001 -> 1.0.1.1\n// 1002017001 -> 1.2.17.1\nexport const parseVersionFromNumericVersion = (\n\tversion: number,\n): PackageVersion => {\n\tconst major = Math.floor(version / 1000000000);\n\tconst minor = Math.floor((version % 1000000000) / 1000000);\n\tconst patch = Math.floor((version % 1000000) / 1000);\n\tconst buildNumber = version % 1000;\n\n\treturn new PackageVersion(major, minor, patch, undefined, buildNumber);\n};\n","import * as fs from \"fs\";\nimport * as path from \"path\";\n\nimport { isErrorENOENT } from \"./error\";\nimport { readStringFromFileOrUndefined } from \"./fs\";\nimport { PackageLocation } from \"./package\";\nimport { PackageVersion } from \"./packageVersion\";\n\n// https://regex101.com/r/LtGAu5/1\nconst logRegex =\n\t/console\\.log\\(\\s*\"([\\w\\s\\.\\(\\)]+)\\ *Copyright[\\w\\s\\(\\)\\.]+(\\d{4}|\\d{4} - \\d{4})([\\w\\s\\(\\)\\.]+)?\",?\\s*\\)/i;\nconst currentYear = new Date(Date.now()).getFullYear();\n\nexport function getVersionFileHandler(location: PackageLocation) {\n\tconst filePath = path.join(location.scriptsDir, \"Version.ts\");\n\n\tfunction invalidVersionFile(\n\t\tversionFile: string | undefined,\n\t\texists: boolean,\n\t) {\n\t\treturn {\n\t\t\texists,\n\t\t\twrite: (name: string, newVersion: PackageVersion) => {\n\t\t\t\tconst scriptsContent = fs.readdirSync(location.scriptsDir);\n\t\t\t\tconst tsFiles = scriptsContent.filter((file) =>\n\t\t\t\t\tfile.endsWith(\".ts\"),\n\t\t\t\t);\n\n\t\t\t\tif (tsFiles.length > 0) {\n\t\t\t\t\treturn createVersionFileWriter([currentYear], \"\")(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tnewVersion,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\treset: () => {\n\t\t\t\tif (versionFile !== undefined) {\n\t\t\t\t\tfs.writeFileSync(filePath, versionFile, {\n\t\t\t\t\t\tencoding: \"utf8\",\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfs.rmSync(filePath);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tif (!isErrorENOENT(err)) {\n\t\t\t\t\t\t\tthrow err;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n\n\ttype CopyrightRange = [number, number?];\n\n\tfunction createVersionFileWriter(\n\t\tcopyright: CopyrightRange = [currentYear],\n\t\tcopyrightStuff: string = \"\",\n\t) {\n\t\treturn (name: string, newVersion: PackageVersion) => {\n\t\t\tconst descriptionText = newVersion.toDescriptionString(name);\n\t\t\tconst copyrightText = createYearString(copyright);\n\n\t\t\tconst result = `console.log(\"${descriptionText}. Copyright (C) ${copyrightText}${copyrightStuff}\");`;\n\n\t\t\tfs.writeFileSync(filePath, result, { encoding: \"utf-8\" });\n\t\t};\n\t}\n\n\tlet rawVersionFile = readStringFromFileOrUndefined(filePath);\n\n\tif (rawVersionFile === undefined) {\n\t\treturn invalidVersionFile(rawVersionFile, false);\n\t}\n\n\tconst versionFile = rawVersionFile.replace(/\\n/g, \"\");\n\n\tconst match = versionFile.match(logRegex);\n\n\tif (!match) {\n\t\treturn invalidVersionFile(versionFile, true);\n\t}\n\n\tconst [_full, _description, copyright, copyrightStuff] = match as [\n\t\tstring,\n\t\tstring,\n\t\tstring,\n\t\tstring?,\n\t];\n\n\tconst copyrightYears = copyright.match(/^(\\d+)( ?- ?(\\d+))?$/);\n\n\tlet years: [number, number?];\n\n\tif (copyrightYears === null) {\n\t\tyears = [currentYear];\n\t} else {\n\t\tyears = [Number(copyrightYears[1]), currentYear];\n\t}\n\n\treturn {\n\t\texists: true,\n\t\twrite: createVersionFileWriter(years, copyrightStuff),\n\t\treset: () => {\n\t\t\tfs.writeFileSync(filePath, versionFile, { encoding: \"utf8\" });\n\t\t},\n\t};\n}\n\nconst createYearString = (years: [number, number?]) => {\n\tif (years[1] === undefined || years[0] === years[1]) {\n\t\treturn years[0].toString();\n\t}\n\n\treturn `${years[0]} - ${years[1]}`;\n};\n"],"names":["readStringFromFile","filePath","fs","readFileSync","encoding","readStringFromFileOrUndefined","err","isErrorENOENT","undefined","getVersionInformationFromGit","workspaceLocation","packageLocation","git","simpleGit","baseDir","path","diff","diffSummary","dirty","files","some","file","toLowerCase","includes","endsWith","fullPath","resolve","relativePath","relative","startsWith","log","maxCount","commit","latest","hash","substring","commitDate","date","getWorkspaceBannerText","manifest","bannerText","packager","banner","match","startYear","parseInt","endYear","Date","getFullYear","replace","parseVersionFromString","input","Error","major","minor","patch","build","preReleaseType","preReleaseNumber","preRelease","buildNumber","type","version","Number","descriptionMatch","PackageVersion","parseVersionFromNumericVersion","Math","floor","logRegex","currentYear","now","getVersionFileHandler","location","join","scriptsDir","invalidVersionFile","versionFile","exists","write","name","newVersion","scriptsContent","readdirSync","tsFiles","filter","length","createVersionFileWriter","reset","writeFileSync","rmSync","copyright","copyrightStuff","descriptionText","toDescriptionString","copyrightText","createYearString","result","rawVersionFile","_full","_description","copyrightYears","years","toString"],"mappings":";;;;;;;;;;MAIaA,kBAAAA,GAAqB,CAACC,QAAAA,GAClCC,EAAAA,CAAGC,YAAY,CAACF,QAAAA,EAAU;AAAEG,QAAAA,QAAAA,EAAU;AAAO,KAAA,CAAA;AAEvC,MAAMC,6BAAAA,GAAgC,CAC5CJ,QAAAA,GAAAA;IAEA,IAAI;QACH,OAAOD,kBAAAA,CAAmBC,QAAAA,CAAAA;IAC3B,CAAA,CAAE,OAAOK,GAAAA,EAAK;AACb,QAAA,IAAI,CAACC,aAAAA,CAAcD,GAAAA,CAAAA,EAAM;AACxB,YAAA,MAAMA,GAAAA;AACP,QAAA;AACA,QAAA,OAAOE,SAAAA;AACR,IAAA;AACD,CAAA;;ACZO,MAAMC,4BAAAA,GAA+B,OAC3CC,iBAAAA,EACAC,eAAAA,GAAAA;IAEA,IAAI;AACH,QAAA,MAAMC,MAAMC,SAAAA,CAAU;AACrBC,YAAAA,OAAAA,EAASJ,kBAAkBK;AAC5B,SAAA,CAA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
|
import { createWriteStream, createReadStream } from 'fs';
|
|
8
8
|
import resolve from 'resolve';
|
|
9
|
-
import 'write-
|
|
9
|
+
import 'write-package';
|
|
10
10
|
import * as glob from 'glob';
|
|
11
|
-
import 'write-json-file';
|
|
12
11
|
import axios, { AxiosError } from 'axios';
|
|
13
|
-
import * as typedoc from 'typedoc';
|
|
14
12
|
import EventEmitter from 'events';
|
|
15
13
|
import { SourceMapGenerator, SourceMapConsumer } from 'source-map-js';
|
|
16
14
|
import Ajv from 'ajv';
|
|
@@ -531,6 +529,7 @@ const createTSCWatchBuildParticipant = (location, outputDir, skipDeclarations)=>
|
|
|
531
529
|
}
|
|
532
530
|
state.diagnostics.push(diagnostic);
|
|
533
531
|
};
|
|
532
|
+
let currentProgram;
|
|
534
533
|
const reportWatchStatusChanged = (diagnostic)=>{
|
|
535
534
|
switch(diagnostic.code){
|
|
536
535
|
// regular watch mode - https://github.com/microsoft/TypeScript/blob/93e6b9da0c4cb164ca90a5a1b07415e81e97f2b1/src/compiler/diagnosticMessages.json#L4567
|
|
@@ -560,7 +559,7 @@ const createTSCWatchBuildParticipant = (location, outputDir, skipDeclarations)=>
|
|
|
560
559
|
});
|
|
561
560
|
return;
|
|
562
561
|
}
|
|
563
|
-
if (emitState.js === undefined
|
|
562
|
+
if (emitState.js === undefined) {
|
|
564
563
|
onBuildEnd({
|
|
565
564
|
type: "success",
|
|
566
565
|
artefacts: {
|
|
@@ -569,11 +568,14 @@ const createTSCWatchBuildParticipant = (location, outputDir, skipDeclarations)=>
|
|
|
569
568
|
});
|
|
570
569
|
return;
|
|
571
570
|
}
|
|
571
|
+
if (!currentProgram) {
|
|
572
|
+
throw new Error(`Expected a program to exist`);
|
|
573
|
+
}
|
|
572
574
|
onBuildEnd({
|
|
573
575
|
type: "success",
|
|
574
576
|
artefacts: {
|
|
575
577
|
js: emitState.js.replace(`//# sourceMappingURL=out.js.map`, ""),
|
|
576
|
-
declarations: getDeclarationFileReferences(location,
|
|
578
|
+
declarations: emitState.definitions ? getDeclarationFileReferences(location, currentProgram, outputDir) + emitState.definitions : undefined,
|
|
577
579
|
sourceMap: emitState.sourceMap
|
|
578
580
|
}
|
|
579
581
|
});
|
|
@@ -581,6 +583,11 @@ const createTSCWatchBuildParticipant = (location, outputDir, skipDeclarations)=>
|
|
|
581
583
|
}
|
|
582
584
|
};
|
|
583
585
|
const host = ts.createWatchCompilerHost(path.join(location.scriptsDir, "tsconfig.json"), getCompilerOptions(location, outputDir, skipDeclarations), customSys, ts.createSemanticDiagnosticsBuilderProgram, registerDiagnostic, reportWatchStatusChanged);
|
|
586
|
+
const originalAfterProgramCreate = host.afterProgramCreate;
|
|
587
|
+
host.afterProgramCreate = (program)=>{
|
|
588
|
+
currentProgram = program;
|
|
589
|
+
originalAfterProgramCreate == null ? void 0 : originalAfterProgramCreate(program);
|
|
590
|
+
};
|
|
584
591
|
const formattingHost = {
|
|
585
592
|
getCanonicalFileName: (path)=>path,
|
|
586
593
|
getCurrentDirectory: host.getCurrentDirectory,
|
|
@@ -636,36 +643,6 @@ function getDeclarationFileReferences(location, program, outputDir) {
|
|
|
636
643
|
return referenceString;
|
|
637
644
|
}
|
|
638
645
|
|
|
639
|
-
async function generateDocs(location, declarationFile, outFolder, name) {
|
|
640
|
-
const mediaDir = path.join(location.manifestDir, "Media");
|
|
641
|
-
const app = await typedoc.Application.bootstrap({
|
|
642
|
-
entryPoints: [
|
|
643
|
-
declarationFile
|
|
644
|
-
],
|
|
645
|
-
out: outFolder,
|
|
646
|
-
tsconfig: path.join(location.scriptsDir, "tsconfig.json"),
|
|
647
|
-
skipErrorChecking: "true",
|
|
648
|
-
basePath: mediaDir
|
|
649
|
-
});
|
|
650
|
-
app.options.setCompilerOptions([
|
|
651
|
-
declarationFile
|
|
652
|
-
], {
|
|
653
|
-
target: ts.ScriptTarget.ES5
|
|
654
|
-
}, undefined);
|
|
655
|
-
app.options.setValue("name", name);
|
|
656
|
-
const [readmePath] = glob.sync("**/readme.md", {
|
|
657
|
-
absolute: true,
|
|
658
|
-
cwd: location.manifestDir
|
|
659
|
-
});
|
|
660
|
-
if (readmePath) {
|
|
661
|
-
app.options.setValue("readme", readmePath);
|
|
662
|
-
}
|
|
663
|
-
const project = await app.convert();
|
|
664
|
-
if (project) {
|
|
665
|
-
await app.generateDocs(project, outFolder);
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
|
|
669
646
|
// Stolen from ig.tools.core
|
|
670
647
|
const toposort = (packages)=>{
|
|
671
648
|
const queue = Object.getOwnPropertyNames(packages);
|
|
@@ -691,7 +668,7 @@ const toposort = (packages)=>{
|
|
|
691
668
|
|
|
692
669
|
class BuildManager extends EventEmitter {
|
|
693
670
|
constructor(manifest, writer, reporter){
|
|
694
|
-
super(), this.manifest = manifest, this.writer = writer, this.reporter = reporter, this.participants = new Map(), this.states = new Map();
|
|
671
|
+
super(), this.manifest = manifest, this.writer = writer, this.reporter = reporter, this.participants = new Map(), this.states = new Map(), this.participantInstances = [];
|
|
695
672
|
}
|
|
696
673
|
addParticipant(name, participant) {
|
|
697
674
|
this.participants.set(name, participant);
|
|
@@ -704,7 +681,7 @@ class BuildManager extends EventEmitter {
|
|
|
704
681
|
}
|
|
705
682
|
this.emit("start");
|
|
706
683
|
for (const [name, participant] of this.participants){
|
|
707
|
-
participant({
|
|
684
|
+
const instance = participant({
|
|
708
685
|
onBuildStart: ()=>{
|
|
709
686
|
let alreadyBusy = false;
|
|
710
687
|
for (const [name, state] of this.states){
|
|
@@ -726,6 +703,12 @@ class BuildManager extends EventEmitter {
|
|
|
726
703
|
},
|
|
727
704
|
log: (message)=>this.reporter.log(message)
|
|
728
705
|
});
|
|
706
|
+
this.participantInstances.push(instance);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
destroy() {
|
|
710
|
+
for (const instance of this.participantInstances){
|
|
711
|
+
instance.destroy();
|
|
729
712
|
}
|
|
730
713
|
}
|
|
731
714
|
maybeEmit() {
|
|
@@ -1460,10 +1443,12 @@ async function buildFolders(options) {
|
|
|
1460
1443
|
}
|
|
1461
1444
|
if (typescriptFiles.length > 0) {
|
|
1462
1445
|
if (isScriptPackageModules(tsConfig.options)) {
|
|
1463
|
-
const { createRollupBuildParticipant } = await import('./rollup-
|
|
1464
|
-
manager.addParticipant("rollup", createRollupBuildParticipant(location, data, outputDirectory, options.
|
|
1446
|
+
const { createRollupBuildParticipant } = await import('./rollup-Brsu5W5I.mjs');
|
|
1447
|
+
manager.addParticipant("rollup", createRollupBuildParticipant(location, data, outputDirectory, !tsConfig.options.declaration));
|
|
1465
1448
|
} else {
|
|
1466
|
-
manager.addParticipant("tsc", createTSCBuildParticipant(location, outputDirectory,
|
|
1449
|
+
manager.addParticipant("tsc", createTSCBuildParticipant(location, outputDirectory, // in the past we always created declaration files,
|
|
1450
|
+
// so we'll use it as the default for legacy modules
|
|
1451
|
+
tsConfig.options.declaration === false));
|
|
1467
1452
|
}
|
|
1468
1453
|
}
|
|
1469
1454
|
manager.addParticipant("animation", createAnimationBuildParticipant(location, data));
|
|
@@ -1481,8 +1466,11 @@ async function buildFolders(options) {
|
|
|
1481
1466
|
manager.run();
|
|
1482
1467
|
});
|
|
1483
1468
|
if (options.docs) {
|
|
1469
|
+
if (!options.docsHandler) {
|
|
1470
|
+
throw new Error("Handler for typescript docs not available");
|
|
1471
|
+
}
|
|
1484
1472
|
reporter.log("Generating typedoc documentation");
|
|
1485
|
-
await
|
|
1473
|
+
await options.docsHandler(location, path.join(outputDirectory, `${data.Package}.d.ts`), path.join(workspace.path, "docs", data.Package), data.Package);
|
|
1486
1474
|
}
|
|
1487
1475
|
index++;
|
|
1488
1476
|
}
|
|
@@ -1495,6 +1483,7 @@ async function buildFoldersWatch(options) {
|
|
|
1495
1483
|
}
|
|
1496
1484
|
const workspace = options.workspace;
|
|
1497
1485
|
const folders = options.packages;
|
|
1486
|
+
options.reporter ?? consoleReporter;
|
|
1498
1487
|
let sortedPackages = sortPackagesByBuildOrder(folders);
|
|
1499
1488
|
let index = 1;
|
|
1500
1489
|
const manifests = new Map(sortedPackages.map((location)=>[
|
|
@@ -1502,11 +1491,12 @@ async function buildFoldersWatch(options) {
|
|
|
1502
1491
|
readPackageCreatorManifest(location)
|
|
1503
1492
|
]));
|
|
1504
1493
|
const maxNameLength = Array.from(manifests.values(), (manifest)=>manifest.Package.length).reduce((acc, length)=>Math.max(acc, length), 0);
|
|
1494
|
+
const managers = [];
|
|
1505
1495
|
for (const location of sortedPackages){
|
|
1506
1496
|
const tsConfig = await ensureTsConfig(location);
|
|
1507
1497
|
const baseReporter = options.reporter ?? consoleReporter;
|
|
1508
1498
|
const data = manifests.get(location);
|
|
1509
|
-
const reporter = createPackageScopedReporter(baseReporter, data.Package, index, folders.length, maxNameLength);
|
|
1499
|
+
const reporter = options.preparedReporter ?? createPackageScopedReporter(baseReporter, data.Package, index, folders.length, maxNameLength);
|
|
1510
1500
|
const outputDirectory = options.outDir || location.scriptsDir;
|
|
1511
1501
|
await fs$1.mkdir(outputDirectory, {
|
|
1512
1502
|
recursive: true
|
|
@@ -1521,10 +1511,12 @@ async function buildFoldersWatch(options) {
|
|
|
1521
1511
|
}
|
|
1522
1512
|
if (typescriptFiles.length > 0) {
|
|
1523
1513
|
if (isScriptPackageModules(tsConfig.options)) {
|
|
1524
|
-
const { createRollupWatchBuildParticipant } = await import('./rollup-
|
|
1525
|
-
manager.addParticipant("rollup", createRollupWatchBuildParticipant(location, data, outputDirectory, options.
|
|
1514
|
+
const { createRollupWatchBuildParticipant } = await import('./rollup-Brsu5W5I.mjs');
|
|
1515
|
+
manager.addParticipant("rollup", createRollupWatchBuildParticipant(location, data, outputDirectory, !tsConfig.options.declaration));
|
|
1526
1516
|
} else {
|
|
1527
|
-
manager.addParticipant("tsc", createTSCWatchBuildParticipant(location, outputDirectory,
|
|
1517
|
+
manager.addParticipant("tsc", createTSCWatchBuildParticipant(location, outputDirectory, // in the past we always created declaration files,
|
|
1518
|
+
// so we'll use it as the default for legacy modules
|
|
1519
|
+
tsConfig.options.declaration === false));
|
|
1528
1520
|
}
|
|
1529
1521
|
}
|
|
1530
1522
|
manager.addParticipant("animation", createAnimationWatchBuildParticipant(location, data));
|
|
@@ -1542,9 +1534,16 @@ async function buildFoldersWatch(options) {
|
|
|
1542
1534
|
});
|
|
1543
1535
|
manager.run();
|
|
1544
1536
|
});
|
|
1537
|
+
managers.push(manager);
|
|
1545
1538
|
index++;
|
|
1546
1539
|
}
|
|
1547
|
-
|
|
1540
|
+
return {
|
|
1541
|
+
destroy: ()=>{
|
|
1542
|
+
for (const manager of managers){
|
|
1543
|
+
manager.destroy();
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1548
1547
|
}
|
|
1549
1548
|
async function writeBuildResult(buildResult, manifest, location, workspace, outputDirectory, minimize, reporter) {
|
|
1550
1549
|
let js = buildResult.js;
|
|
@@ -1574,7 +1573,11 @@ async function writeBuildResult(buildResult, manifest, location, workspace, outp
|
|
|
1574
1573
|
}
|
|
1575
1574
|
});
|
|
1576
1575
|
const minifiedPath = path.join(outputDirectory, `${manifest.Package}.min.js`);
|
|
1577
|
-
|
|
1576
|
+
let code = minifyResult.code;
|
|
1577
|
+
if (minifyResult.map) {
|
|
1578
|
+
code += `\n//# sourceMappingURL=${manifest.Package}.min.js.map`;
|
|
1579
|
+
}
|
|
1580
|
+
await fs$1.writeFile(minifiedPath, code, {
|
|
1578
1581
|
encoding: "utf8"
|
|
1579
1582
|
});
|
|
1580
1583
|
if (minifyResult.map !== undefined) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intelligentgraphics/ig.gfx.packager",
|
|
3
|
-
"version": "3.1.0-alpha.
|
|
4
|
-
"description": "IG.GFX.Packager 3.1.0 Alpha
|
|
3
|
+
"version": "3.1.0-alpha.7",
|
|
4
|
+
"description": "IG.GFX.Packager 3.1.0 Alpha 7 (3.1.0.6)",
|
|
5
5
|
"author": "Michael Beier <mb@intelligentgraphics.biz>",
|
|
6
6
|
"main": "lib/lib.mjs",
|
|
7
7
|
"types": "lib/lib.d.ts",
|
|
8
|
-
"private": false,
|
|
9
8
|
"type": "module",
|
|
10
9
|
"publishConfig": {
|
|
11
10
|
"access": "public"
|
|
@@ -31,8 +30,8 @@
|
|
|
31
30
|
"format": "prettier --write \"**/*.{ts,tsx,json}\""
|
|
32
31
|
},
|
|
33
32
|
"dependencies": {
|
|
34
|
-
"@babel/preset-env": "^7.28.5",
|
|
35
33
|
"@intelligentgraphics/declarationbundler": "^0.4.4",
|
|
34
|
+
"@intelligentgraphics/ig.gfx.packager-babel-preset-es5": "^3.1.0-alpha.8",
|
|
36
35
|
"@rollup/plugin-alias": "^6.0.0",
|
|
37
36
|
"@rollup/plugin-babel": "^6.1.0",
|
|
38
37
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
@@ -53,10 +52,9 @@
|
|
|
53
52
|
"terser": "^5.16.1",
|
|
54
53
|
"tslib": "^2.8.1",
|
|
55
54
|
"typedoc": "^0.28.14",
|
|
56
|
-
"typescript": "
|
|
55
|
+
"typescript": "~5.9.3",
|
|
57
56
|
"update-notifier": "^7.3.1",
|
|
58
|
-
"
|
|
59
|
-
"write-pkg": "^7.0.0",
|
|
57
|
+
"write-package": "^7.0.0",
|
|
60
58
|
"yargs": "^18.0.0"
|
|
61
59
|
},
|
|
62
60
|
"devDependencies": {
|
package/readme.md
CHANGED
|
@@ -556,6 +556,16 @@ Afterwards you may need to reload your editor in order for the installed files t
|
|
|
556
556
|
|
|
557
557
|
## History
|
|
558
558
|
|
|
559
|
+
**IG.GFX.Packager 3.1.0-alpha.7**
|
|
560
|
+
|
|
561
|
+
- use write-package rather dependencies write-pkg
|
|
562
|
+
- drop skipDeclarations options, instead use tsconfig declarations field
|
|
563
|
+
- drop v8-compile-cache
|
|
564
|
+
|
|
565
|
+
**IG.GFX.Packager 3.1.0-alpha.6**
|
|
566
|
+
|
|
567
|
+
- update typescript
|
|
568
|
+
|
|
559
569
|
**IG.GFX.Packager 3.1.0-alpha.5**
|
|
560
570
|
|
|
561
571
|
- drop lodash dependency
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-sBIEQH_m.mjs","sources":["../../tools.core/build/stripUtf8Bom.mjs","../../tools.core/build/npmPackage.mjs","../../tools.core/build/error.mjs","../../tools.core/build/package.mjs","../../tools.core/build/workspace.mjs","../../tools.core/build/assetService.mjs","../src/lib/prompter.ts","../src/cli.ts"],"sourcesContent":["const stripUtf8Bom = (text)=>{\n // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string\n // conversion translates it to FEFF (UTF-16 BOM).\n if (text.charCodeAt(0) === 0xfeff) {\n return text.slice(1);\n }\n return text;\n};\n\nexport { stripUtf8Bom };\n//# sourceMappingURL=stripUtf8Bom.mjs.map\n","import * as fs from 'fs';\nimport * as path from 'path';\nimport { writePackageSync } from 'write-pkg';\nimport { stripUtf8Bom } from './stripUtf8Bom.mjs';\n\nconst readNpmManifest = (directory)=>{\n const packageJsonPath = path.join(directory, \"package.json\");\n const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {\n encoding: \"utf8\"\n }));\n return JSON.parse(packageJson);\n};\nconst writeNpmManifest = (directory, packageJson)=>{\n const packageJsonPath = path.join(directory, \"package.json\");\n writePackageSync(packageJsonPath, packageJson);\n};\n\nexport { readNpmManifest, writeNpmManifest };\n//# sourceMappingURL=npmPackage.mjs.map\n","const getNodeErrorCode = (error)=>{\n if (error !== null && typeof error === \"object\" && error.code !== undefined) {\n return error.code;\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 */ const isErrorEACCES = (error)=>getNodeErrorCode(error) === \"EACCES\";\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 */ const isErrorENOENT = (error)=>getNodeErrorCode(error) === \"ENOENT\";\nconst isErrorEPERM = (error)=>getNodeErrorCode(error) === \"EPERM\";\n\nexport { getNodeErrorCode, isErrorEACCES, isErrorENOENT, isErrorEPERM };\n//# sourceMappingURL=error.mjs.map\n","import * as path from 'path';\nimport * as fs from 'fs';\nimport { isErrorENOENT } from './error.mjs';\nimport { readNpmManifest, writeNpmManifest } from './npmPackage.mjs';\nimport { stripUtf8Bom } from './stripUtf8Bom.mjs';\n\n// Functionality related to working with a single package.\nconst PACKAGE_FILE = \"_Package.json\";\nconst INDEX_FILE = \"_Index.json\";\nconst ANIMATION_FILE_SUFFIX = \".animation.json\";\nconst getCreatorIndexParameterPrimaryJSType = (type)=>{\n switch(type){\n case \"LengthM\":\n case \"ArcDEG\":\n case \"Integer\":\n case \"Int\":\n case \"Float\":\n return \"number\";\n case \"Boolean\":\n case \"Bool\":\n return \"boolean\";\n case \"String\":\n case \"Material\":\n case \"Geometry\":\n case \"Animation\":\n case \"Interactor\":\n case \"Evaluator\":\n default:\n return \"string\";\n }\n};\nfunction parseCreatorPackageName(manifest) {\n const [domain, subdomain] = manifest.Package.split(\".\");\n if (subdomain === undefined) {\n throw new Error(`Expected \"Package\" field of the _Package.json file to contain a value in the form of Domain.SubDomain`);\n }\n return {\n domain,\n subdomain\n };\n}\n/**\n * Detects the package at the given directory.\n *\n * @param {string} directory\n * @returns {PackageLocation}\n */ const detectPackage = (workspace, directory)=>{\n directory = path.resolve(workspace.path, directory);\n const scriptsPath = path.join(directory, \"Scripts\");\n const tsPath = path.join(directory, \"ts\");\n let location;\n if (fs.existsSync(scriptsPath)) {\n location = {\n _kind: \"PackageLocation\",\n path: directory,\n scriptsDir: scriptsPath,\n manifestDir: scriptsPath\n };\n } else if (fs.existsSync(tsPath)) {\n location = {\n _kind: \"PackageLocation\",\n path: directory,\n scriptsDir: tsPath,\n manifestDir: directory\n };\n } else {\n location = {\n _kind: \"PackageLocation\",\n path: directory,\n scriptsDir: directory,\n manifestDir: directory\n };\n }\n try {\n readPackageCreatorManifest(location);\n } catch (err) {\n if (isErrorENOENT(err)) {\n throw new Error(`No _Package.json found in ${location.manifestDir}`);\n }\n throw err;\n }\n return location;\n};\nconst detectPackageLocationFromCreatorWorkspaceLocation = (location)=>{\n const packageLocation = {\n _kind: \"PackageLocation\",\n path: location.path,\n scriptsDir: path.join(location.path, \"Scripts\"),\n manifestDir: path.join(location.path, \"Scripts\")\n };\n try {\n readPackageCreatorManifest(packageLocation);\n } catch (err) {\n if (isErrorENOENT(err)) {\n throw new Error(`No _Package.json found in ${packageLocation.manifestDir}`);\n }\n throw err;\n }\n return packageLocation;\n};\nconst detectPackageAsParentDirectory = (directory)=>{\n let directoryToCheck = directory;\n while(directoryToCheck !== path.dirname(directoryToCheck)){\n if (fs.existsSync(path.join(directoryToCheck, \"Scripts\"))) {\n return {\n _kind: \"PackageLocation\",\n path: directoryToCheck,\n scriptsDir: path.join(directoryToCheck, \"Scripts\"),\n manifestDir: path.join(directoryToCheck, \"Scripts\")\n };\n }\n directoryToCheck = path.dirname(directoryToCheck);\n }\n return undefined;\n};\nconst readPackageCreatorManifest = (location)=>{\n const packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\n const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {\n encoding: \"utf8\"\n }));\n return JSON.parse(packageJson);\n};\nconst writePackageCreatorManifest = (location, creatorPackage)=>{\n const packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\n fs.writeFileSync(packageJsonPath, JSON.stringify(creatorPackage, null, \"\\t\") + \"\\n\");\n};\nconst getPackageCreatorIndexPath = (location)=>path.join(location.manifestDir, INDEX_FILE);\nconst readPackageCreatorIndex = (location)=>{\n try {\n const indexPath = getPackageCreatorIndexPath(location);\n const index = stripUtf8Bom(fs.readFileSync(indexPath, {\n encoding: \"utf8\"\n }));\n return JSON.parse(index);\n } catch (err) {\n if (isErrorENOENT(err)) {\n return undefined;\n }\n throw err;\n }\n};\nconst writePackageCreatorIndex = (location, index)=>{\n const indexPath = getPackageCreatorIndexPath(location);\n fs.writeFileSync(indexPath, JSON.stringify(index, null, \"\\t\") + \"\\n\");\n};\nconst readPackageNpmManifest = (location)=>{\n try {\n return readNpmManifest(location.manifestDir);\n } catch (err) {\n if (isErrorENOENT(err)) {\n return undefined;\n }\n throw err;\n }\n};\nconst writePackageNpmManifest = (location, packageJson)=>{\n writeNpmManifest(location.manifestDir, packageJson);\n};\nconst readPackageAnimationList = (location)=>{\n const directoryContent = fs.readdirSync(location.manifestDir);\n const animationPathList = [];\n for (const entry of directoryContent){\n if (entry.endsWith(ANIMATION_FILE_SUFFIX)) {\n const animationPath = path.join(location.manifestDir, entry);\n animationPathList.push(animationPath);\n }\n }\n return animationPathList;\n};\nconst getPackageReleasesDirectory = (location)=>path.join(location.path, \"Releases\");\nconst arePackageLocationsEqual = (a, b)=>a.path === b.path;\n\nexport { INDEX_FILE, PACKAGE_FILE, arePackageLocationsEqual, detectPackage, detectPackageAsParentDirectory, detectPackageLocationFromCreatorWorkspaceLocation, getCreatorIndexParameterPrimaryJSType, getPackageCreatorIndexPath, getPackageReleasesDirectory, parseCreatorPackageName, readPackageAnimationList, readPackageCreatorIndex, readPackageCreatorManifest, readPackageNpmManifest, writePackageCreatorIndex, writePackageCreatorManifest, writePackageNpmManifest };\n//# sourceMappingURL=package.mjs.map\n","import * as path from 'path';\nimport * as fs from 'fs';\nimport { isErrorENOENT } from './error.mjs';\nimport { writeNpmManifest, readNpmManifest } from './npmPackage.mjs';\nimport { detectPackage } from './package.mjs';\nimport { detectCreatorWorkspaceAsParentDirectory } from './creatorWorkspace.mjs';\n\n// Functionality related to working with a workspace consisting of multiple packages.\nconst detectWorkspace = (directory)=>{\n directory = path.resolve(process.cwd(), directory);\n return {\n _kind: \"WorkspaceLocation\",\n path: directory\n };\n};\nconst detectWorkspaceByPackageJsonLocation = (directory)=>{\n while(directory !== path.dirname(directory)){\n if (fs.existsSync(path.join(directory, \"package.json\"))) {\n return detectWorkspace(directory);\n }\n directory = path.dirname(directory);\n }\n return undefined;\n};\nconst readWorkspaceNpmManifest = (workspace)=>{\n try {\n return readNpmManifest(workspace.path);\n } catch (err) {\n if (isErrorENOENT(err)) {\n throw new Error(`Expected a package.json file to exist in ${workspace.path}. See packager readme for instructions on how to create the package.json.`);\n }\n throw err;\n }\n};\nconst writeWorkspaceNpmManifest = (workspace, packageJson)=>writeNpmManifest(workspace.path, packageJson);\nconst getWorkspaceOutputPath = (workspace)=>path.join(workspace.path, \"bin\");\nconst getWorkspaceLibPath = (workspace)=>path.join(workspace.path, \"lib\");\nfunction* iterateWorkspacePackages(workspace) {\n const entries = fs.readdirSync(workspace.path, {\n withFileTypes: true\n });\n for (const entry of entries){\n if (!entry.isDirectory()) {\n continue;\n }\n try {\n yield detectPackage(workspace, entry.name);\n } catch {}\n }\n}\nfunction* iterateWorkspaceCreatorWorkspaces(workspace) {\n const entries = fs.readdirSync(workspace.path, {\n withFileTypes: true\n });\n for (const entry of entries){\n if (!entry.isDirectory()) {\n continue;\n }\n const detected = detectCreatorWorkspaceAsParentDirectory(path.join(workspace.path, entry.name));\n if (detected !== undefined) {\n yield detected;\n }\n }\n}\n\nexport { detectWorkspace, detectWorkspaceByPackageJsonLocation, getWorkspaceLibPath, getWorkspaceOutputPath, iterateWorkspaceCreatorWorkspaces, iterateWorkspacePackages, readWorkspaceNpmManifest, writeWorkspaceNpmManifest };\n//# sourceMappingURL=workspace.mjs.map\n","import axios, { AxiosError } from 'axios';\n\nconst PLUGIN_ID = \"0feba3a0-b6d1-11e6-9598-0800200c9a66\";\n/**\n * Starts an IG.Asset.Server session and returns the sessionId\n *\n * @param {SessionStartParams} params\n * @returns\n */ const startSession = async ({ url, authentication, ...params })=>{\n const payload = {\n ...params,\n user: undefined,\n password: undefined,\n license: undefined,\n plugin: PLUGIN_ID\n };\n if (authentication.type === \"credentials\") {\n payload.user = authentication.username;\n payload.password = authentication.password;\n } else if (authentication.type === \"license\") {\n payload.license = authentication.license;\n }\n const { data: { session: sessionId, state, response } } = await axios.post(`Session/Start2`, JSON.stringify(payload), {\n baseURL: url\n });\n if (state !== \"SUCCESS\") {\n let message = `Could not start session. IG.Asset.Server responded with ${state}`;\n if (response) {\n message += `: ${response}`;\n }\n throw new Error(message);\n }\n return {\n _kind: \"AssetService\",\n url,\n sessionId,\n domain: params.domain,\n subDomain: params.subDomain\n };\n};\nconst closeSession = async (session)=>{\n await axios.get(`Session/Close/${session.sessionId}`, {\n baseURL: session.url\n });\n};\nconst uploadPackageFromBuffer = async (session, { name, version }, buffer)=>{\n try {\n await uploadPackageToUrl(session.url, `UploadPackage/${session.sessionId}/${name}_${version}`, buffer);\n } catch (err) {\n if (err instanceof AxiosError) {\n var _err_response;\n if (((_err_response = err.response) == null ? void 0 : _err_response.status) === 404) {\n await uploadPackageToUrl(session.url, `UploadPackage/${session.sessionId}/${name}_${version}/`, buffer);\n return;\n }\n throw new Error(`Failed to upload package: ${err.message}`);\n }\n throw err;\n }\n};\nconst uploadPackageToUrl = async (url, path, buffer)=>{\n const { data, status } = await axios.post(path, buffer, {\n baseURL: url\n });\n let objectBody;\n if (typeof data === \"string\") {\n try {\n objectBody = JSON.parse(data);\n } catch (err) {}\n } else if (typeof data === \"object\") {\n objectBody = data;\n }\n if (objectBody !== undefined) {\n if (\"state\" in objectBody && objectBody.state !== \"SUCCESS\") {\n throw new Error(objectBody.response ?? objectBody.state);\n }\n }\n if (status >= 400) {\n if (objectBody !== undefined) {\n let text_1 = \"\";\n for(const key in objectBody){\n text_1 += key + \": \\n\";\n if (typeof objectBody[key] === \"object\") {\n text_1 += JSON.stringify(objectBody[key], undefined, 2);\n } else {\n text_1 += objectBody[key];\n }\n text_1 += \"\\n\\n\";\n }\n throw new Error(text_1);\n }\n throw new Error(data);\n }\n return data;\n};\nconst getExistingPackages = async (session)=>{\n const { data } = await axios.get(`Script/GetInformation/${session.sessionId}`, {\n baseURL: session.url,\n validateStatus: (status)=>status === 404 || status === 200\n }).catch((err)=>{\n throw new Error(`Failed to get existing packages: ${err.message}`);\n });\n return data;\n};\nconst getMaterials = async (session)=>{\n const response = await axios.get(`Material/Get/${session.sessionId}`, {\n baseURL: session.url\n });\n const data = response.data;\n return data.materials;\n};\nconst getGeometries = async (session)=>{\n const response = await axios.get(`Geometry/Get/${session.sessionId}`, {\n baseURL: session.url\n });\n const data = response.data;\n return data.geometries;\n};\n\nexport { closeSession, getExistingPackages, getGeometries, getMaterials, startSession, uploadPackageFromBuffer };\n//# sourceMappingURL=assetService.mjs.map\n","import inquirer from \"inquirer\";\n\nexport interface PrompterOption {\n\tname: string;\n\tvalue: string;\n}\n\nexport interface PrompterQuestion {\n\tmessage: string;\n\toptions: PrompterOption[];\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\";\nimport * as glob from \"glob\";\n\nimport { AssetService } from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nimport {\n\tdetectPackage,\n\tPackageLocation,\n\tparseCreatorPackageName,\n\treadPackageCreatorManifest,\n} from \"./lib/package\";\nimport {\n\tdetectWorkspace,\n\treadWorkspaceNpmManifest,\n\tWorkspaceLocation,\n\twriteWorkspaceNpmManifest,\n} from \"./lib/workspace\";\nimport type { ReleaseFolderOptions } from \"./commands/publish\";\nimport { createDefaultPrompter } from \"./lib/prompter\";\nimport { PackageJSON } from \"./lib/packageJSON\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst pjson: PackageJSON = JSON.parse(\n\tfs.readFileSync(path.join(__dirname, \"..\", \"package.json\"), \"utf8\"),\n);\n\nconst captureError = (err: Error) => {\n\tconsole.log(\"\");\n\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconsole.error(err);\n\t} else {\n\t\tconsole.error(\n\t\t\t\"Stopped execution because of the following error: \" + err.message,\n\t\t);\n\t}\n\n\tprocess.exit(1);\n};\n\nconst buildOptions = {\n\toutDir: {\n\t\tdescription: \"Output directory\",\n\t\ttype: \"string\",\n\t\tdefault: \"bin\",\n\t\tcoerce: (input: string | undefined | null) =>\n\t\t\tinput === undefined || input === null\n\t\t\t\t? undefined\n\t\t\t\t: path.resolve(process.cwd(), input),\n\t},\n\tminimize: {\n\t\tdescription: \"Minify output\",\n\t\ttype: \"boolean\",\n\t\tdefault: true,\n\t},\n\tcwd: {\n\t\tdescription: \"Working directory\",\n\t\ttype: \"string\",\n\t\tdefault: process.cwd(),\n\t},\n\tclean: {\n\t\tdescription: \"Empty output dir before compiling\",\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n\tdocs: {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n\tskipDeclarations: {\n\t\tdescription: \"Skips the creation of typescript declaration files\",\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n} as const;\n\nconst preCommandCheck = async (workspaceLocation: WorkspaceLocation) => {\n\tconst executedLocalPackager = __filename.startsWith(workspaceLocation.path);\n\tconst repositoryPackage = readWorkspaceNpmManifest(workspaceLocation);\n\n\tif (\n\t\trepositoryPackage?.dependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t] ||\n\t\trepositoryPackage?.devDependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t]\n\t) {\n\t\tconst parts = [\"Detected locally installed ig.gfx.packager.\"];\n\n\t\tif (executedLocalPackager) {\n\t\t\tparts.push(\n\t\t\t\t'Run \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.',\n\t\t\t);\n\t\t}\n\t\tparts.push(\n\t\t\t'Run \"npm uninstall @intelligentgraphics/ig.gfx.packager\" to remove the local version.',\n\t\t);\n\n\t\tconsole.error(parts.join(\"\\n\"));\n\t\tprocess.exit(1);\n\t}\n\n\tif (executedLocalPackager) {\n\t\tconsole.error(`Detected locally installed ig.gfx.packager.\nRun \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.\nRun \"npm install\" to get rid of the local packager version.`);\n\t\tprocess.exit(1);\n\t}\n\n\tconst notifier = updateNotifier({\n\t\tpkg: pjson,\n\t\tshouldNotifyInNpmScript: true,\n\t\tupdateCheckInterval: 1000 * 60,\n\t});\n\n\tnotifier.notify({\n\t\tisGlobal: true,\n\t\tdefer: true,\n\t});\n\n\tif (repositoryPackage === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Could not load package.json file in current directory\",\n\t\t);\n\t}\n\n\trepositoryPackage.scripts ??= {};\n\trepositoryPackage.scripts.postinstall = \"packager postinstall\";\n\n\twriteWorkspaceNpmManifest(workspaceLocation, repositoryPackage);\n};\n\nconst yargsInstance = yargs(process.argv.slice(2));\n\nconst resolvePackagesFromMaybePatterns = (\n\targs: string[] = [],\n\tworkspace: WorkspaceLocation,\n) => {\n\tconst folders = new Map<string, PackageLocation>();\n\n\tfor (const arg of args) {\n\t\tglob.sync(arg, { cwd: workspace.path, absolute: true }).forEach(\n\t\t\t(folder) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst location = detectPackage(workspace, folder);\n\n\t\t\t\t\tfolders.set(folder, location);\n\t\t\t\t} catch (err) {}\n\t\t\t},\n\t\t);\n\t}\n\n\treturn Array.from(folders.values());\n};\n\nyargsInstance.command(\n\t\"build [directories...]\",\n\t\"Builds the specified directories\",\n\t(argv) =>\n\t\targv.options({\n\t\t\t...buildOptions,\n\t\t\twatch: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t}),\n\tasync ({ directories = [], watch, ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folders = resolvePackagesFromMaybePatterns(\n\t\t\tdirectories as string[],\n\t\t\tworkspace,\n\t\t);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tif (folders.length === 0) {\n\t\t\treturn console.log(\n\t\t\t\t\"No build targets found. Please check wether a folder with the provided name exists and wether it has _Package.json.\",\n\t\t\t);\n\t\t}\n\n\t\tconst { buildFolders, buildFoldersWatch } =\n\t\t\tawait import(\"./commands/build\");\n\n\t\tif (watch) {\n\t\t\tawait buildFoldersWatch({\n\t\t\t\t...options,\n\t\t\t\tpackages: folders,\n\t\t\t\tworkspace,\n\t\t\t}).catch(captureError);\n\t\t\treturn;\n\t\t}\n\n\t\tawait buildFolders({\n\t\t\t...options,\n\t\t\tpackages: folders,\n\t\t\tworkspace,\n\t\t}).catch(captureError);\n\t},\n);\n\nyargsInstance.command(\n\t\"publish [directory]\",\n\t\"Publishes the specified directory\",\n\t(argv) =>\n\t\targv.options({\n\t\t\t...buildOptions,\n\t\t\tnoUpload: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Only zip built files and do not upload them\",\n\t\t\t},\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish domain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish subdomain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"The name of the new version\",\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\taddress: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Address\",\n\t\t\t\tdefault: \"localhost\",\n\t\t\t},\n\t\t\tservice: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"IG.Asset.Server url\",\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"User\",\n\t\t\t\tdefault: process.env.IG_GFX_USER,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Password\",\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\n\t\t\t},\n\t\t\tdocs: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Generate typedoc documentation\",\n\t\t\t},\n\t\t\tpushOnly: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t\"Try to upload an existing zip file without building and validating the version number\",\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Path to a license file\",\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t\tskipDependencies: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Skip dependency checks\",\n\t\t\t},\n\t\t}),\n\tasync ({ directory, user, password, service, license, ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folder = detectPackage(workspace, directory as string);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tif (!options.noUpload) {\n\t\t\tif (!service) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t'The IG.Asset.Server url has to either be provided using the option --service or through the \"IG_GFX_ASSET_SERVICE\" environment variable',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!license && (!user || !password)) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (license && !license.endsWith(\".iglic\")) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlet authentication: AssetService.Authentication | undefined;\n\n\t\tif (license) {\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\n\t\t\ttry {\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\n\t\t\t\tauthentication = {\n\t\t\t\t\ttype: \"license\",\n\t\t\t\t\tlicense: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (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: folder,\n\t\t\tbanner: true,\n\t\t\tprompter,\n\t\t\tnewVersion: options.newVersion!,\n\t\t\tworkspace,\n\t\t};\n\n\t\tawait releaseFolder(fullOptions).catch(captureError);\n\t},\n);\n\nyargsInstance.command(\n\t\"testConnection [directory]\",\n\t\"Tests connection to asset service\",\n\t(argv) =>\n\t\targv.options({\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish domain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish subdomain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\taddress: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Address\",\n\t\t\t\tdefault: \"localhost\",\n\t\t\t},\n\t\t\tservice: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"IG.Asset.Server url\",\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"User\",\n\t\t\t\tdefault: process.env.IG_GFX_USER,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Password\",\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Path to a license file\",\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t}),\n\tasync ({\n\t\tuser,\n\t\tpassword,\n\t\tservice,\n\t\tlicense,\n\t\tsubdomain,\n\t\tdomain,\n\t\taddress,\n\t\tdirectory,\n\t}) => {\n\t\tif (!service) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t'The IG.Asset.Server url has to either be provided using the option --service or through the \"IG_GFX_ASSET_SERVICE\" environment variable',\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!license && (!user || !password)) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif (license && !license.endsWith(\".iglic\")) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tlet authentication: AssetService.Authentication | undefined;\n\n\t\tif (license) {\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\n\t\t\ttry {\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\n\t\t\t\tauthentication = {\n\t\t\t\t\ttype: \"license\",\n\t\t\t\t\tlicense: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (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\tif (authentication === undefined) {\n\t\t\tthrow new Error(`Expected authentication to be available`);\n\t\t}\n\n\t\tif (typeof directory === \"string\") {\n\t\t\tconst workspace = detectWorkspace(process.cwd());\n\t\t\tconst folder = detectPackage(workspace, directory as string);\n\t\t\tconst manifest = readPackageCreatorManifest(folder);\n\t\t\tconst parsedName = parseCreatorPackageName(manifest);\n\n\t\t\tif (domain === undefined) {\n\t\t\t\tdomain = parsedName.domain;\n\t\t\t}\n\t\t\tif (subdomain === undefined) {\n\t\t\t\tsubdomain = parsedName.subdomain;\n\t\t\t}\n\t\t}\n\n\t\tif (domain === undefined || subdomain === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t`Expected either domain and subdomain to be provided through options or to be executed for a specific package directory`,\n\t\t\t);\n\t\t}\n\n\t\tconst session = await AssetService.startSession({\n\t\t\turl: service,\n\t\t\taddress,\n\t\t\tdomain,\n\t\t\tsubDomain: subdomain,\n\t\t\tauthentication,\n\t\t});\n\n\t\tawait AssetService.closeSession(session);\n\n\t\tconsole.log(`Asset service session successfully started and closed`);\n\t},\n);\n\nyargsInstance.command({\n\tcommand: \"generateIndex [directory]\",\n\tbuilder: (argv) =>\n\t\targv\n\t\t\t.option(\"ignore\", {\n\t\t\t\ttype: \"array\",\n\t\t\t\tdefault: [],\n\t\t\t\tdescription: \"Files to ignore while generating index\",\n\t\t\t})\n\t\t\t.option(\"strictOptional\", {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t\"Marks non optional parameter object properties as required\",\n\t\t\t}),\n\thandler: async ({ directory, ignore, strictOptional }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { generateIndex } = await import(\"./commands/generateIndex\");\n\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\tgenerateIndex({\n\t\t\tlocation,\n\t\t\tignore: ignore as string[],\n\t\t\tstrictOptional,\n\t\t});\n\t},\n\tdescribe: \"Generates an index file for a package based on typescript types\",\n});\n\nyargsInstance.command({\n\tcommand: \"generateParameterType [directory] [name]\",\n\thandler: async ({ directory, name }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { generateParameterType } =\n\t\t\tawait import(\"./commands/generateParameterType\");\n\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\tgenerateParameterType({\n\t\t\tlocation,\n\t\t\tname,\n\t\t});\n\t},\n\tdescribe: \"Generates a parameter type for an interactor or evaluator\",\n});\n\nyargsInstance.command({\n\tcommand: \"postinstall\",\n\tbuilder: (argv) => argv,\n\thandler: async () => {\n\t\tconst { executePostInstall } = await import(\"./commands/postinstall\");\n\n\t\texecutePostInstall(detectWorkspace(process.cwd()));\n\t},\n\tdescribe: \"Runs postinstall tasks\",\n});\n\nyargsInstance.command({\n\tcommand: \"publishNpm [directory]\",\n\tbuilder: (argv) =>\n\t\targv.options({\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Name of the new version\",\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tdryRun: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t}),\n\thandler: async ({ directory, newVersion, dryRun }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tconst { publishToNpm } = await import(\"./commands/publishNpm\");\n\n\t\tawait publishToNpm({\n\t\t\tworkspace,\n\t\t\tlocation: detectPackage(workspace, directory as string),\n\t\t\tversion: newVersion,\n\t\t\tdryRun,\n\t\t}).catch(captureError);\n\t},\n\tdescribe: \"Publishes the package to npm\",\n});\n\nyargsInstance\n\t.demandCommand()\n\t.pkgConf(\"packager\")\n\t.showHelpOnFail(false)\n\t.version(pjson.version).argv;\n"],"names":["stripUtf8Bom","text","charCodeAt","slice","readNpmManifest","directory","packageJsonPath","path","join","packageJson","fs","readFileSync","encoding","JSON","parse","writeNpmManifest","writePackageSync","getNodeErrorCode","error","code","undefined","isErrorEACCES","isErrorENOENT","isErrorEPERM","PACKAGE_FILE","INDEX_FILE","ANIMATION_FILE_SUFFIX","getCreatorIndexParameterPrimaryJSType","type","parseCreatorPackageName","manifest","domain","subdomain","Package","split","Error","detectPackage","workspace","resolve","scriptsPath","tsPath","location","existsSync","_kind","scriptsDir","manifestDir","readPackageCreatorManifest","err","writePackageCreatorManifest","creatorPackage","writeFileSync","stringify","getPackageCreatorIndexPath","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","PLUGIN_ID","startSession","url","authentication","params","payload","user","password","license","plugin","username","data","session","sessionId","state","response","axios","post","baseURL","message","subDomain","closeSession","get","uploadPackageFromBuffer","version","buffer","uploadPackageToUrl","AxiosError","status","objectBody","text_1","key","getExistingPackages","validateStatus","catch","createDefaultPrompter","confirm","inquirer","prompt","ask","question","answer","choices","options","default","__filename","fileURLToPath","__dirname","dirname","pjson","captureError","console","log","env","NODE_ENV","exit","buildOptions","outDir","description","coerce","input","minimize","clean","docs","skipDeclarations","preCommandCheck","workspaceLocation","executedLocalPackager","startsWith","repositoryPackage","dependencies","devDependencies","parts","notifier","updateNotifier","pkg","shouldNotifyInNpmScript","updateCheckInterval","notify","isGlobal","defer","scripts","postinstall","yargsInstance","yargs","argv","resolvePackagesFromMaybePatterns","args","folders","Map","arg","glob","sync","absolute","forEach","folder","set","Array","from","values","command","watch","directories","length","buildFolders","buildFoldersWatch","packages","noUpload","newVersion","VERSION","required","address","service","IG_GFX_ASSET_SERVICE","IG_GFX_USER","IG_GFX_PWD","pushOnly","IG_GFX_LICENSE","skipDependencies","fullLicensePath","content","toString","releaseFolder","prompter","fullOptions","banner","parsedName","AssetService","builder","option","handler","ignore","strictOptional","generateIndex","describe","generateParameterType","executePostInstall","dryRun","publishToNpm","demandCommand","pkgConf","showHelpOnFail"],"mappings":";;;;;;;;;;;AAAO,MAAMA,YAAAA,GAAe,CAACC,IAAAA,GAAAA;;;IAG5B,IAAIA,IAAAA,CAAKC,UAAU,CAAC,CAAA,CAAA,KAAO,MAAA,EAAQ;AAClC,QAAA,OAAOD,IAAAA,CAAKE,KAAK,CAAC,CAAA,CAAA;AACnB,IAAA;AAEA,IAAA,OAAOF,IAAAA;AACR;;ACDO,MAAMG,eAAAA,GAAkB,CAC9BC,SAAAA,GAAAA;IAEA,MAAMC,eAAAA,GAAkBC,IAAAA,CAAKC,IAAI,CAACH,SAAAA,EAAW,cAAA,CAAA;IAC7C,MAAMI,WAAAA,GAAcT,YAAAA,CACnBU,EAAAA,CAAGC,YAAY,CAACL,eAAAA,EAAiB;AAChCM,QAAAA,QAAAA,EAAU;AACX,KAAA,CAAA,CAAA;AAED,IAAA,OAAOC,IAAAA,CAAKC,KAAK,CAACL,WAAAA,CAAAA;AACnB;AAEO,MAAMM,gBAAAA,GAAmB,CAC/BV,SAAAA,EACAI,WAAAA,GAAAA;IAEA,MAAMH,eAAAA,GAAkBC,IAAAA,CAAKC,IAAI,CAACH,SA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