@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.mjs","sources":["../src/commands/generate.ts"],"sourcesContent":["import ts from \"typescript\";\r\n\r\nimport {\r\n\tPackageLocation,\r\n\twritePackageCreatorIndex,\r\n\treadPackageCreatorIndex,\r\n} from \"../lib/package\";\r\nimport { getPackageTypescriptFiles } from \"../lib/scripts\";\r\nimport {\r\n\tCreatorIndexEntry,\r\n\tCreatorIndexParameter,\r\n\tCreatorIndexParameterType,\r\n} from \"../lib/package\";\r\n\r\nfunction findTsNode<T extends ts.Node>(\r\n\tnode: ts.Node,\r\n\tcallback: (node: ts.Node) => node is T,\r\n): T | undefined;\r\nfunction findTsNode(\r\n\tnode: ts.Node,\r\n\tcallback: (node: ts.Node) => boolean,\r\n): ts.Node | undefined;\r\nfunction findTsNode(\r\n\tnode: ts.Node,\r\n\tcallback: (node: ts.Node) => boolean,\r\n): ts.Node | undefined {\r\n\tlet result: ts.Node | undefined;\r\n\r\n\tts.forEachChild(node, (child) => {\r\n\t\tif (callback(child)) {\r\n\t\t\tresult = child;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t});\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction capitalizeFirstLetter(string) {\r\n\treturn string?.charAt(0).toUpperCase() + string?.slice(1);\r\n}\r\n\r\nfunction parseDefault(value: string, type: string) {\r\n\tconst uType: CreatorIndexParameterType = capitalizeFirstLetter(type);\r\n\tif (value === \"null\") return null;\r\n\tswitch (uType) {\r\n\t\tcase \"LengthM\":\r\n\t\tcase \"ArcDEG\":\r\n\t\tcase \"Float\":\r\n\t\t\treturn parseFloat(value);\r\n\t\tcase \"Integer\":\r\n\t\tcase \"Int\":\r\n\t\t\treturn parseInt(value);\r\n\t\tcase \"Boolean\":\r\n\t\tcase \"Bool\":\r\n\t\t\treturn value === \"true\";\r\n\t\tcase \"Material\":\r\n\t\tcase \"String\":\r\n\t\tdefault:\r\n\t\t\treturn value.replace(/^\"/, \"\").replace(/\"$/, \"\");\r\n\t}\r\n}\r\n\r\nfunction findEvaluatorNode(node: ts.Node): ts.ClassDeclaration | undefined {\r\n\tif (\r\n\t\tts.isModuleDeclaration(node) &&\r\n\t\tnode.body &&\r\n\t\tts.isModuleDeclaration(node.body) &&\r\n\t\tnode.body.body\r\n\t) {\r\n\t\tconst classDeclaration = findTsNode(\r\n\t\t\tnode.body.body,\r\n\t\t\t(child): child is ts.ClassDeclaration => {\r\n\t\t\t\tif (!ts.isClassDeclaration(child)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst isEvaluator = child.heritageClauses?.some((clause) => {\r\n\t\t\t\t\tif (clause.token !== ts.SyntaxKind.ExtendsKeyword) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn clause.types.some((type) =>\r\n\t\t\t\t\t\ttype.getText().includes(\"Evaluator\"),\r\n\t\t\t\t\t);\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn isEvaluator ?? false;\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\treturn classDeclaration;\r\n\t}\r\n}\r\n\r\nfunction getParameter(evaluatorNode: ts.ClassDeclaration) {\r\n\tlet memb = evaluatorNode.members?.find(\r\n\t\t(member) => member?.name?.getText().toLowerCase() == \"create\",\r\n\t);\r\n\tif (ts.isMethodDeclaration(memb!)) {\r\n\t\treturn memb.parameters.find(\r\n\t\t\t(para) => para.name.getText().toLowerCase() == \"parameters\",\r\n\t\t);\r\n\t}\r\n}\r\n\r\nfunction findParametersInterface(\r\n\tnode: ts.Node,\r\n\tinterfaceName: string,\r\n): ts.InterfaceDeclaration | undefined {\r\n\tif (\r\n\t\tts.isModuleDeclaration(node) &&\r\n\t\tnode.body &&\r\n\t\tts.isModuleDeclaration(node.body) &&\r\n\t\tnode.body.body\r\n\t) {\r\n\t\tconst interfaceDeclaration = findTsNode(\r\n\t\t\tnode.body.body,\r\n\t\t\t(child): child is ts.InterfaceDeclaration =>\r\n\t\t\t\tts.isInterfaceDeclaration(child) &&\r\n\t\t\t\tchild.name.getText() == interfaceName,\r\n\t\t);\r\n\r\n\t\treturn interfaceDeclaration;\r\n\t}\r\n\r\n\treturn undefined;\r\n}\r\n\r\nfunction getModuleName(sourceFile: ts.Node): string {\r\n\tlet fullName = \"\";\r\n\tif (ts.isModuleDeclaration(sourceFile)) {\r\n\t\tfullName += sourceFile.name.getText();\r\n\r\n\t\tlet packageB = sourceFile.body!;\r\n\t\tif (ts.isModuleDeclaration(packageB)) {\r\n\t\t\tfullName += \".\" + packageB.name.getText();\r\n\t\t}\r\n\t}\r\n\treturn fullName;\r\n}\r\n\r\nfunction genParameters(\r\n\tinterfac: ts.InterfaceDeclaration,\r\n): CreatorIndexParameter[] {\r\n\treturn interfac.members.map((member, i) => {\r\n\t\tlet para = {} as CreatorIndexParameter;\r\n\r\n\t\tpara.Name = member.name!.getText();\r\n\t\tif (para.Name.length > 45)\r\n\t\t\tthrow new Error(`Parameter name length >45 '${para.Name}'`);\r\n\r\n\t\tlet rawDocTags = ts.getJSDocTags(member);\r\n\t\tif (rawDocTags.length) {\r\n\t\t\tlet dict = getTagDict(rawDocTags);\r\n\t\t\tif (dict.summary) para.Description = dict.summary;\r\n\t\t\tif (dict.creatorType)\r\n\t\t\t\tpara.Type = dict.creatorType as CreatorIndexParameterType;\r\n\t\t\tif (dict.default && dict.creatorType)\r\n\t\t\t\tpara.Default = parseDefault(dict.default, dict.creatorType);\r\n\t\t\tpara.DisplayIndex = i + 1;\r\n\t\t}\r\n\t\treturn para;\r\n\t});\r\n}\r\n\r\ninterface IDocTags {\r\n\tdefault?: string;\r\n\tcreatorType?: string;\r\n\tsummary?: string;\r\n}\r\n\r\nfunction getTagDict(tags: any): IDocTags {\r\n\tlet dict = {};\r\n\ttags.forEach((tag) => {\r\n\t\tdict[tag.tagName.text] = tag.comment;\r\n\t});\r\n\treturn dict;\r\n}\r\n\r\nfunction findParametersInterfaceInFiles(\r\n\tprogram: ts.Program,\r\n\tfileList: string[],\r\n\tname: string,\r\n): ts.InterfaceDeclaration | undefined {\r\n\tfor (const file of fileList) {\r\n\t\tconst sourceFile = program.getSourceFile(file);\r\n\r\n\t\tif (sourceFile === undefined) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t`Expected a source file to exist for file name \"${file}\"`,\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tlet interfaceDeclaration: ts.InterfaceDeclaration | undefined;\r\n\r\n\t\tts.forEachChild(sourceFile, (node) => {\r\n\t\t\tinterfaceDeclaration = findParametersInterface(node, name);\r\n\r\n\t\t\treturn interfaceDeclaration !== undefined;\r\n\t\t});\r\n\r\n\t\tif (interfaceDeclaration !== undefined) {\r\n\t\t\treturn interfaceDeclaration;\r\n\t\t}\r\n\t}\r\n\r\n\treturn undefined;\r\n}\r\n\r\n/**\r\n * Extracts and returns script array for _Index.json from a src folder\r\n *\r\n * @param folderPath path to a src folder\r\n */\r\nexport function extract(location: PackageLocation, ignore: string[] = []) {\r\n\tconst files = getPackageTypescriptFiles(location);\r\n\tconst filtered = files.filter((path) => {\r\n\t\treturn !ignore.some((suffix) => path.endsWith(suffix));\r\n\t});\r\n\tlet arr = new Array<CreatorIndexEntry>();\r\n\r\n\tlet program = ts.createProgram(filtered, { allowJs: true });\r\n\tprogram.getTypeChecker();\r\n\tfiltered.forEach((file) => {\r\n\t\t// Create a Program to represent the project, then pull out the\r\n\t\t// source file to parse its AST.\r\n\t\tconst sourceFile = program.getSourceFile(file);\r\n\r\n\t\t// Loop through the root AST nodes of the file\r\n\t\tts.forEachChild(sourceFile!, (node) => {\r\n\t\t\tconst evalNode = findEvaluatorNode(node);\r\n\r\n\t\t\tif (evalNode === undefined) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tlet moduleName = getModuleName(node);\r\n\r\n\t\t\tif (evalNode.name === undefined) {\r\n\t\t\t\tthrow new Error(`Expected evaluator class to have a name`);\r\n\t\t\t}\r\n\r\n\t\t\tconst name = moduleName + \".\" + evalNode.name.getText();\r\n\r\n\t\t\tif (name.length > 45)\r\n\t\t\t\tthrow new Error(`Package name length >45 '${name}'`);\r\n\r\n\t\t\tlet para = getParameter(evalNode);\r\n\t\t\tlet paraName = (para?.type as any).typeName.getText();\r\n\t\t\tlet interfac = findParametersInterfaceInFiles(\r\n\t\t\t\tprogram,\r\n\t\t\t\tfiltered,\r\n\t\t\t\tparaName,\r\n\t\t\t);\r\n\r\n\t\t\tif (interfac === undefined) {\r\n\t\t\t\tthrow new Error(\r\n\t\t\t\t\t`Failed to find parameters type declaration for evaluator ${evalNode.name.getText()}`,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tconst obj: CreatorIndexEntry = {\r\n\t\t\t\tName: name,\r\n\t\t\t\tParameters: [],\r\n\t\t\t\tType: \"Evaluator\",\r\n\t\t\t};\r\n\r\n\t\t\tlet rawDocTags = ts.getJSDocTags(evalNode);\r\n\t\t\tif (rawDocTags.length) {\r\n\t\t\t\tlet dict = getTagDict(rawDocTags);\r\n\t\t\t\tif (dict.summary) obj.Description = dict.summary;\r\n\t\t\t\tif (dict.creatorType)\r\n\t\t\t\t\tobj.Type = dict.creatorType as \"Interactor\" | \"Evaluator\";\r\n\t\t\t}\r\n\r\n\t\t\tobj.Parameters = genParameters(interfac);\r\n\r\n\t\t\tarr.push(obj);\r\n\t\t});\r\n\t});\r\n\r\n\twritePackageCreatorIndex(location, arr);\r\n}\r\n"],"names":["findTsNode","node","callback","result","ts","forEachChild","child","capitalizeFirstLetter","string","charAt","toUpperCase","slice","parseDefault","value","type","uType","parseFloat","parseInt","replace","findEvaluatorNode","isModuleDeclaration","body","classDeclaration","isClassDeclaration","isEvaluator","heritageClauses","some","clause","token","SyntaxKind","ExtendsKeyword","types","getText","includes","getParameter","evaluatorNode","memb","members","find","member","name","toLowerCase","isMethodDeclaration","parameters","para","findParametersInterface","interfaceName","interfaceDeclaration","isInterfaceDeclaration","undefined","getModuleName","sourceFile","fullName","packageB","genParameters","interfac","map","i","Name","length","Error","rawDocTags","getJSDocTags","dict","getTagDict","summary","Description","creatorType","Type","default","Default","DisplayIndex","tags","forEach","tag","tagName","text","comment","findParametersInterfaceInFiles","program","fileList","file","getSourceFile","extract","location","ignore","files","getPackageTypescriptFiles","filtered","filter","path","suffix","endsWith","arr","Array","createProgram","allowJs","getTypeChecker","evalNode","moduleName","paraName","typeName","obj","Parameters","push","writePackageCreatorIndex"],"mappings":";;;;;;;;;;;;;;AAsBA,SAASA,UAAU,CAClBC,IAAa,EACbC,QAAoC,EACd;AACtB,EAAA,IAAIC,MAA2B,CAAA;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AAGjD,aAAa,CAACC,QAAQ,CAAC,CAAA;AAExCsC,MAAAA,GAAG,CAACW,IAAI,CAACF,GAAG,CAAC,CAAA;AACd,KAAC,CAAC,CAAA;AACH,GAAC,CAAC,CAAA;AAEFG,EAAAA,wBAAwB,CAACrB,QAAQ,EAAES,GAAG,CAAC,CAAA;AACxC;;;;"}
|
package/build/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import \"source-map-support/register.js\";\nimport \"v8-compile-cache\";\n\nimport(\"./cli\");\n"],"names":[],"mappings":";;;;AAGA,OAAO,WAAO,oCAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import \"source-map-support/register.js\";\r\nimport \"v8-compile-cache\";\r\n\r\nimport(\"./cli\");\r\n"],"names":[],"mappings":";;;;AAGA,OAAO,WAAO,oCAAC"}
|
|
@@ -3,9 +3,9 @@ import * as path from 'path';
|
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import glob from 'glob';
|
|
5
5
|
import * as terser from 'terser';
|
|
6
|
-
import { d as detectWorkspace, t as translate, r as readPackageCreatorManifest, a as detectPackage, b as readPackageNpmManifest } from '
|
|
6
|
+
import { d as detectWorkspace, t as translate, r as readPackageCreatorManifest, a as detectPackage, b as readPackageNpmManifest } from './cli.mjs';
|
|
7
7
|
import ts from 'typescript';
|
|
8
|
-
import { g as getPackageTypescriptFiles } from '
|
|
8
|
+
import { g as getPackageTypescriptFiles } from './scripts.mjs';
|
|
9
9
|
import typedoc from 'typedoc';
|
|
10
10
|
|
|
11
11
|
const logPackageMessage = (name, step, index, total) => {
|
|
@@ -27,7 +27,7 @@ const tryReadTsConfig = location => {
|
|
|
27
27
|
});
|
|
28
28
|
return config;
|
|
29
29
|
};
|
|
30
|
-
const build = async location => {
|
|
30
|
+
const build = async (location, outputDir) => {
|
|
31
31
|
const config = tryReadTsConfig(location);
|
|
32
32
|
config.compilerOptions.lib = ["es5", "dom"];
|
|
33
33
|
const result = ts.convertCompilerOptionsFromJson(config.compilerOptions, location.scriptsDir);
|
|
@@ -36,7 +36,9 @@ const build = async location => {
|
|
|
36
36
|
removeComments: false,
|
|
37
37
|
declaration: true,
|
|
38
38
|
sourceMap: false,
|
|
39
|
-
|
|
39
|
+
// We don't use tsc to actually emit the files, but we still need to set the correct
|
|
40
|
+
// output directory so the compiler can rewrite the `reference path` directives.
|
|
41
|
+
outFile: path.join(outputDir, "out.js"),
|
|
40
42
|
target: ts.ScriptTarget.ES5,
|
|
41
43
|
noEmitOnError: true
|
|
42
44
|
};
|
|
@@ -90,13 +92,15 @@ const createErrorMessage = diagnostic => {
|
|
|
90
92
|
return `${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`;
|
|
91
93
|
};
|
|
92
94
|
|
|
93
|
-
const generateDocs = async (
|
|
95
|
+
const generateDocs = async (location, declarationFile, outFolder, name) => {
|
|
94
96
|
const app = new typedoc.Application();
|
|
95
|
-
const mediaDir = path.join(
|
|
97
|
+
const mediaDir = path.join(location.manifestDir, "Media");
|
|
96
98
|
app.bootstrap({
|
|
97
99
|
entryPoints: [declarationFile],
|
|
98
100
|
media: mediaDir,
|
|
99
|
-
out: outFolder
|
|
101
|
+
out: outFolder,
|
|
102
|
+
tsconfig: path.join(location.scriptsDir, "tsconfig.json"),
|
|
103
|
+
skipErrorChecking: true
|
|
100
104
|
});
|
|
101
105
|
app.options.setCompilerOptions([declarationFile], {
|
|
102
106
|
target: ts.ScriptTarget.ES5
|
|
@@ -104,7 +108,7 @@ const generateDocs = async (folderPath, declarationFile, outFolder, name) => {
|
|
|
104
108
|
app.options.setValue("name", name);
|
|
105
109
|
const [readmePath] = glob.sync("**/readme.md", {
|
|
106
110
|
absolute: true,
|
|
107
|
-
cwd:
|
|
111
|
+
cwd: location.manifestDir
|
|
108
112
|
});
|
|
109
113
|
if (readmePath) {
|
|
110
114
|
app.options.setValue("readme", readmePath);
|
|
@@ -150,28 +154,26 @@ const buildFolders = async options => {
|
|
|
150
154
|
if (folders.length === 0) {
|
|
151
155
|
return console.log(translate("messages.buildSkipEmpty"));
|
|
152
156
|
}
|
|
153
|
-
const sortedPackages =
|
|
157
|
+
const sortedPackages = sortPackagesByBuildOrder(folders);
|
|
154
158
|
let index = 1;
|
|
155
|
-
for (const
|
|
156
|
-
location
|
|
157
|
-
}] of sortedPackages) {
|
|
159
|
+
for (const location of sortedPackages) {
|
|
158
160
|
if (options.skipPackagesWithoutTsFiles && getPackageTypescriptFiles(location).length === 0) {
|
|
159
161
|
continue;
|
|
160
162
|
}
|
|
161
163
|
ensureTsConfig(location);
|
|
162
164
|
const data = readPackageCreatorManifest(location);
|
|
163
|
-
const logStep = step => logPackageMessage(data.Package, step, index,
|
|
165
|
+
const logStep = step => logPackageMessage(data.Package, step, index, folders.length);
|
|
164
166
|
logStep(translate("messages.building"));
|
|
165
|
-
const
|
|
167
|
+
const outputDirectory = options.outDir || location.scriptsDir;
|
|
168
|
+
fs.mkdirSync(outputDirectory, {
|
|
169
|
+
recursive: true
|
|
170
|
+
});
|
|
171
|
+
const buildResult = await build(location, outputDirectory);
|
|
166
172
|
const banner = options.banner ? createBannerComment(options.banner) : undefined;
|
|
167
173
|
if (banner) {
|
|
168
174
|
buildResult.js = banner + "\n" + buildResult.js;
|
|
169
175
|
buildResult.definitions = banner + "\n" + buildResult.definitions;
|
|
170
176
|
}
|
|
171
|
-
const outputDirectory = options.outDir || location.scriptsDir;
|
|
172
|
-
fs.mkdirSync(outputDirectory, {
|
|
173
|
-
recursive: true
|
|
174
|
-
});
|
|
175
177
|
fs.writeFileSync(path.join(outputDirectory, `${data.Package}.js`), buildResult.js, {
|
|
176
178
|
encoding: "utf8"
|
|
177
179
|
});
|
|
@@ -198,7 +200,7 @@ const buildFolders = async options => {
|
|
|
198
200
|
}
|
|
199
201
|
if (options.docs) {
|
|
200
202
|
logStep(translate("messages.docsGeneration"));
|
|
201
|
-
await generateDocs(location
|
|
203
|
+
await generateDocs(location, path.join(outputDirectory, `${data.Package}.d.ts`), path.join(options.cwd, "docs", data.Package), data.Package);
|
|
202
204
|
}
|
|
203
205
|
|
|
204
206
|
// logStep(translate("messages.built"));
|
|
@@ -238,7 +240,7 @@ const applyTsConfigOption = data => {
|
|
|
238
240
|
data.compilerOptions.target = "es5";
|
|
239
241
|
data.compilerOptions.lib = ["es5", "dom"];
|
|
240
242
|
};
|
|
241
|
-
const
|
|
243
|
+
const sortPackagesByBuildOrder = folders => {
|
|
242
244
|
const packages = Array.from(folders).reduce((acc, location) => {
|
|
243
245
|
const data = readPackageNpmManifest(location);
|
|
244
246
|
if (data !== undefined) {
|
|
@@ -268,9 +270,14 @@ const buildSortedPackageMap = folders => {
|
|
|
268
270
|
return acc;
|
|
269
271
|
}, {});
|
|
270
272
|
const sortedPackages = toposort(packageDependencies);
|
|
271
|
-
const result =
|
|
273
|
+
const result = [];
|
|
272
274
|
for (const packageName of sortedPackages) {
|
|
273
|
-
|
|
275
|
+
const location = packages[packageName].location;
|
|
276
|
+
if (readPackageCreatorManifest(location).Package.endsWith(".Basics")) {
|
|
277
|
+
result.unshift(location);
|
|
278
|
+
} else {
|
|
279
|
+
result.push(location);
|
|
280
|
+
}
|
|
274
281
|
}
|
|
275
282
|
return result;
|
|
276
283
|
};
|
|
@@ -316,4 +323,4 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
316
323
|
});
|
|
317
324
|
|
|
318
325
|
export { buildFolders as b, index as i, logPackageMessage as l };
|
|
319
|
-
//# sourceMappingURL=
|
|
326
|
+
//# sourceMappingURL=index2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index2.mjs","sources":["../src/lib/log.ts","../src/commands/build/tsc.ts","../src/commands/build/docs.ts","../src/lib/toposort.ts","../src/commands/build/index.ts"],"sourcesContent":["export const logPackageMessage = (\r\n\tname: string,\r\n\tstep: string,\r\n\tindex?: number,\r\n\ttotal?: number,\r\n) => {\r\n\tconst numLength = total === undefined ? undefined : total.toString().length;\r\n\r\n\tconst indexString =\r\n\t\ttotal === undefined || total < 2\r\n\t\t\t? \"\"\r\n\t\t\t: `${index!.toString().padStart(numLength!, \"0\")}/${total} `;\r\n\r\n\tconst identifierString = `${indexString}${name.padEnd(15)}`;\r\n\r\n\tconsole.log(`${identifierString} >> ${step}`);\r\n};\r\n","import ts from \"typescript\";\r\nimport * as path from \"path\";\r\nimport * as fs from \"fs\";\r\n\r\nimport { PackageLocation } from \"../../lib/package\";\r\n\r\nimport { FolderBuilder } from \".\";\r\nimport { getPackageTypescriptFiles } from \"../../lib/scripts\";\r\n\r\nexport const tryReadTsConfig = (location: PackageLocation) => {\r\n\tconst { config } = ts.readConfigFile(\r\n\t\tpath.join(location.scriptsDir, \"tsconfig.json\"),\r\n\t\t(path) => {\r\n\t\t\ttry {\r\n\t\t\t\treturn fs.readFileSync(path, \"utf8\");\r\n\t\t\t} catch {\r\n\t\t\t\treturn undefined;\r\n\t\t\t}\r\n\t\t},\r\n\t);\r\n\r\n\treturn config as {\r\n\t\tcompilerOptions: ts.CompilerOptions;\r\n\t};\r\n};\r\n\r\nexport const build: FolderBuilder = async (\r\n\tlocation: PackageLocation,\r\n\toutputDir: string,\r\n) => {\r\n\tconst config = tryReadTsConfig(location);\r\n\r\n\tconfig.compilerOptions.lib = [\"es5\", \"dom\"];\r\n\r\n\tconst result = ts.convertCompilerOptionsFromJson(\r\n\t\tconfig.compilerOptions,\r\n\t\tlocation.scriptsDir,\r\n\t);\r\n\r\n\tconst compilerOptions: ts.CompilerOptions = {\r\n\t\t...result.options,\r\n\t\tremoveComments: false,\r\n\t\tdeclaration: true,\r\n\t\tsourceMap: false,\r\n\t\t// We don't use tsc to actually emit the files, but we still need to set the correct\r\n\t\t// output directory so the compiler can rewrite the `reference path` directives.\r\n\t\toutFile: path.join(outputDir, \"out.js\"),\r\n\t\ttarget: ts.ScriptTarget.ES5,\r\n\t\tnoEmitOnError: true,\r\n\t};\r\n\r\n\tconst host = ts.createCompilerHost(compilerOptions);\r\n\thost.getCurrentDirectory = () => location.scriptsDir;\r\n\r\n\tlet js: string | undefined;\r\n\tlet definitions: string | undefined;\r\n\r\n\thost.writeFile = (fileName, data, writeByteOrderMark) => {\r\n\t\tif (fileName.endsWith(\".js\")) {\r\n\t\t\tjs = data;\r\n\t\t} else if (fileName.endsWith(\".d.ts\")) {\r\n\t\t\tdefinitions = data;\r\n\t\t}\r\n\t};\r\n\r\n\tconst files = getPackageTypescriptFiles(location);\r\n\r\n\tif (files.length === 0) {\r\n\t\tthrow new Error(\r\n\t\t\t`Expected typescript files to exist when building a package. Packages only consisting of animation jsons do not need to be built.`,\r\n\t\t);\r\n\t}\r\n\r\n\tconst programOptions: ts.CreateProgramOptions = {\r\n\t\trootNames: files,\r\n\t\toptions: compilerOptions,\r\n\t\thost,\r\n\t};\r\n\r\n\tconst program = ts.createProgram(programOptions);\r\n\tconst emitResult = program.emit();\r\n\tconst allDiagnostics = ts.getPreEmitDiagnostics(program);\r\n\r\n\tif (!emitResult.emitSkipped) {\r\n\t\tif (allDiagnostics.length > 0) {\r\n\t\t\tconsole.log(allDiagnostics.map(createErrorMessage).join(\"\\n\"));\r\n\t\t}\r\n\r\n\t\tif (js === undefined || definitions === undefined) {\r\n\t\t\tthrow new Error(`Unexpected: no js or definitions were created`);\r\n\t\t}\r\n\r\n\t\treturn { js, definitions };\r\n\t}\r\n\r\n\tconst error = allDiagnostics.map(createErrorMessage).join(\"\\n\");\r\n\r\n\tthrow new Error(error);\r\n};\r\n\r\nconst createErrorMessage = (diagnostic: ts.Diagnostic) => {\r\n\tif (!diagnostic.file) {\r\n\t\treturn `${ts.flattenDiagnosticMessageText(\r\n\t\t\tdiagnostic.messageText,\r\n\t\t\t\"\\n\",\r\n\t\t)}`;\r\n\t}\r\n\r\n\tconst { line, character } = diagnostic.file.getLineAndCharacterOfPosition(\r\n\t\tdiagnostic.start!,\r\n\t);\r\n\r\n\tconst message = ts.flattenDiagnosticMessageText(\r\n\t\tdiagnostic.messageText,\r\n\t\t\"\\n\",\r\n\t);\r\n\r\n\treturn `${diagnostic.file.fileName} (${line + 1},${\r\n\t\tcharacter + 1\r\n\t}): ${message}`;\r\n};\r\n","import typedoc from \"typedoc\";\r\nimport glob from \"glob\";\r\nimport ts from \"typescript\";\r\nimport * as path from \"path\";\r\nimport { PackageLocation } from \"../../lib/package\";\r\n\r\nexport const generateDocs = async (\r\n\tlocation: PackageLocation,\r\n\tdeclarationFile: string,\r\n\toutFolder: string,\r\n\tname: string,\r\n) => {\r\n\tconst app = new typedoc.Application();\r\n\r\n\tconst mediaDir = path.join(location.manifestDir, \"Media\");\r\n\r\n\tapp.bootstrap({\r\n\t\tentryPoints: [declarationFile],\r\n\t\tmedia: mediaDir,\r\n\t\tout: outFolder,\r\n\t\ttsconfig: path.join(location.scriptsDir, \"tsconfig.json\"),\r\n\t\tskipErrorChecking: true,\r\n\t});\r\n\r\n\tapp.options.setCompilerOptions(\r\n\t\t[declarationFile],\r\n\t\t{\r\n\t\t\ttarget: ts.ScriptTarget.ES5,\r\n\t\t},\r\n\t\tundefined,\r\n\t);\r\n\r\n\tapp.options.setValue(\"name\", name);\r\n\r\n\tconst [readmePath] = glob.sync(\"**/readme.md\", {\r\n\t\tabsolute: true,\r\n\t\tcwd: location.manifestDir,\r\n\t});\r\n\r\n\tif (readmePath) {\r\n\t\tapp.options.setValue(\"readme\", readmePath);\r\n\t}\r\n\r\n\tconst project = app.convert();\r\n\r\n\tif (project) {\r\n\t\tawait app.generateDocs(project, outFolder);\r\n\t}\r\n};\r\n","// Stolen from ig.tools.core\r\n\r\nexport const toposort = (packages: Record<string, string[]>) => {\r\n\tconst queue = Object.getOwnPropertyNames(packages);\r\n\tconst result: string[] = [];\r\n\r\n\tlet index = 0;\r\n\r\n\twhile (queue.length > 0) {\r\n\t\tif (index >= queue.length) {\r\n\t\t\tthrow new Error(\"Packages can not have cyclic dependencies\");\r\n\t\t}\r\n\r\n\t\tconst queueEntry = queue[index];\r\n\r\n\t\tconst dependencies = packages[queueEntry];\r\n\t\tconst dependencyQueued = dependencies.some((dependency) =>\r\n\t\t\tqueue.includes(dependency),\r\n\t\t);\r\n\r\n\t\tif (dependencyQueued) {\r\n\t\t\tindex++;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tqueue.splice(index, 1);\r\n\t\tindex = 0;\r\n\t\tresult.push(queueEntry);\r\n\t}\r\n\r\n\treturn result;\r\n};\r\n","import * as path from \"path\";\r\nimport * as fs from \"fs\";\r\nimport glob from \"glob\";\r\nimport * as terser from \"terser\";\r\n\r\nimport { logPackageMessage } from \"../../lib/log\";\r\nimport { translate } from \"../../lib/localization\";\r\nimport { build as tscBuild } from \"./tsc\";\r\nimport { generateDocs } from \"./docs\";\r\nimport {\r\n\tdetectPackage,\r\n\tPackageLocation,\r\n\treadPackageCreatorManifest,\r\n\treadPackageNpmManifest,\r\n} from \"../../lib/package\";\r\nimport { detectWorkspace, WorkspaceLocation } from \"../../lib/workspace\";\r\nimport { getPackageTypescriptFiles } from \"../../lib/scripts\";\r\nimport { toposort } from \"../../lib/toposort\";\r\nimport { PackageJSON } from \"../../lib/packageJSON\";\r\n\r\nexport interface BannerOptions {\r\n\ttext: string | undefined;\r\n\tversion: string | undefined;\r\n\tcommit: string | undefined;\r\n\tcommitDirty: boolean | undefined;\r\n\tdate: Date | undefined;\r\n}\r\n\r\nexport interface BuildFoldersOptions {\r\n\tcwd: string;\r\n\tdirectories: string[];\r\n\toutDir?: string;\r\n\tminimize: boolean;\r\n\tbanner?: BannerOptions;\r\n\tclean?: boolean;\r\n\tdocs?: boolean;\r\n\tskipPackagesWithoutTsFiles?: boolean;\r\n}\r\n\r\nexport interface BuildFolderOptions extends BuildFoldersOptions {\r\n\toutFile: string;\r\n}\r\n\r\nexport interface FolderBuilderResult {\r\n\tjs: string;\r\n\tdefinitions: string;\r\n}\r\n\r\nexport type FolderBuilder = (\r\n\tlocation: PackageLocation,\r\n\toutputDir: string,\r\n) => Promise<FolderBuilderResult>;\r\n\r\ntype FolderData = {\r\n\tlocation: PackageLocation;\r\n\tdata?: PackageJSON;\r\n};\r\n\r\nexport const buildFolders = async (options: BuildFoldersOptions) => {\r\n\tif (options.outDir !== undefined && options.clean) {\r\n\t\tfs.rmSync(options.outDir, { recursive: true });\r\n\t}\r\n\r\n\tconst workspace = detectWorkspace(options.cwd);\r\n\tconst folders = resolvePackagesFromArgs(options.directories, workspace);\r\n\r\n\tif (folders.length === 0) {\r\n\t\treturn console.log(translate(\"messages.buildSkipEmpty\"));\r\n\t}\r\n\r\n\tconst sortedPackages = sortPackagesByBuildOrder(folders);\r\n\r\n\tlet index = 1;\r\n\r\n\tfor (const location of sortedPackages) {\r\n\t\tif (\r\n\t\t\toptions.skipPackagesWithoutTsFiles &&\r\n\t\t\tgetPackageTypescriptFiles(location).length === 0\r\n\t\t) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tensureTsConfig(location);\r\n\r\n\t\tconst data = readPackageCreatorManifest(location);\r\n\r\n\t\tconst logStep = (step: string) =>\r\n\t\t\tlogPackageMessage(data.Package, step, index, folders.length);\r\n\r\n\t\tlogStep(translate(\"messages.building\"));\r\n\r\n\t\tconst outputDirectory = options.outDir || location.scriptsDir;\r\n\t\tfs.mkdirSync(outputDirectory, { recursive: true });\r\n\r\n\t\tconst buildResult = await tscBuild(location, outputDirectory);\r\n\t\tconst banner = options.banner\r\n\t\t\t? createBannerComment(options.banner)\r\n\t\t\t: undefined;\r\n\r\n\t\tif (banner) {\r\n\t\t\tbuildResult.js = banner + \"\\n\" + buildResult.js;\r\n\t\t\tbuildResult.definitions = banner + \"\\n\" + buildResult.definitions;\r\n\t\t}\r\n\r\n\t\tfs.writeFileSync(\r\n\t\t\tpath.join(outputDirectory, `${data.Package}.js`),\r\n\t\t\tbuildResult.js,\r\n\t\t\t{ encoding: \"utf8\" },\r\n\t\t);\r\n\t\tfs.writeFileSync(\r\n\t\t\tpath.join(outputDirectory, `${data.Package}.d.ts`),\r\n\t\t\tbuildResult.definitions,\r\n\t\t\t{ encoding: \"utf8\" },\r\n\t\t);\r\n\r\n\t\tif (options.minimize) {\r\n\t\t\tconst minifyResult = await terser.minify(buildResult.js, {\r\n\t\t\t\tecma: 5,\r\n\t\t\t});\r\n\r\n\t\t\tconst minifiedPath = path.join(\r\n\t\t\t\toutputDirectory,\r\n\t\t\t\t`${data.Package}.min.js`,\r\n\t\t\t);\r\n\t\t\tfs.writeFileSync(minifiedPath, minifyResult.code!, {\r\n\t\t\t\tencoding: \"utf8\",\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (location.path.includes(\"Basics\")) {\r\n\t\t\tfs.mkdirSync(path.join(options.cwd, \"lib\"), {\r\n\t\t\t\trecursive: true,\r\n\t\t\t});\r\n\r\n\t\t\tlogStep(translate(\"messages.basicsCopy\"));\r\n\t\t\tfs.writeFileSync(\r\n\t\t\t\tpath.join(options.cwd, \"lib\", `${data.Package}.d.ts`),\r\n\t\t\t\tbuildResult.definitions,\r\n\t\t\t\t{ encoding: \"utf8\" },\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (options.docs) {\r\n\t\t\tlogStep(translate(\"messages.docsGeneration\"));\r\n\t\t\tawait generateDocs(\r\n\t\t\t\tlocation,\r\n\t\t\t\tpath.join(outputDirectory, `${data.Package}.d.ts`),\r\n\t\t\t\tpath.join(options.cwd, \"docs\", data.Package),\r\n\t\t\t\tdata.Package,\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t// logStep(translate(\"messages.built\"));\r\n\r\n\t\tindex++;\r\n\t}\r\n};\r\n\r\nconst resolvePackagesFromArgs = (\r\n\targs: string[] = [],\r\n\tworkspace: WorkspaceLocation,\r\n) => {\r\n\tconst folders = new Map<string, PackageLocation>();\r\n\r\n\tfor (const arg of args) {\r\n\t\tglob.sync(arg, { cwd: workspace.path, absolute: true }).forEach(\r\n\t\t\t(folder) => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst location = detectPackage(workspace, folder);\r\n\t\t\t\t\tfolders.set(folder, location);\r\n\t\t\t\t} catch (err) {}\r\n\t\t\t},\r\n\t\t);\r\n\t}\r\n\r\n\treturn Array.from(folders.values());\r\n};\r\n\r\nconst ensureTsConfig = (location: PackageLocation) => {\r\n\tconst tsconfigPath = path.join(location.scriptsDir, \"tsconfig.json\");\r\n\r\n\tif (!fs.existsSync(tsconfigPath)) {\r\n\t\tconst content = {};\r\n\t\tapplyTsConfigOption(content);\r\n\r\n\t\tfs.writeFileSync(\r\n\t\t\ttsconfigPath,\r\n\t\t\tJSON.stringify(content, undefined, \"\\t\"),\r\n\t\t\t\"utf8\",\r\n\t\t);\r\n\t} else {\r\n\t\tconst content = JSON.parse(fs.readFileSync(tsconfigPath, \"utf8\"));\r\n\t\tapplyTsConfigOption(content);\r\n\t\tfs.writeFileSync(\r\n\t\t\ttsconfigPath,\r\n\t\t\tJSON.stringify(content, undefined, \"\\t\"),\r\n\t\t\t\"utf8\",\r\n\t\t);\r\n\t}\r\n};\r\n\r\nconst applyTsConfigOption = (data: {\r\n\tcompilerOptions?: { target?: string; lib?: string[] };\r\n}) => {\r\n\tdata.compilerOptions = data.compilerOptions ?? {};\r\n\tdata.compilerOptions.target = \"es5\";\r\n\tdata.compilerOptions.lib = [\"es5\", \"dom\"];\r\n};\r\n\r\nconst sortPackagesByBuildOrder = (\r\n\tfolders: PackageLocation[],\r\n): PackageLocation[] => {\r\n\tconst packages = Array.from(folders).reduce(\r\n\t\t(\r\n\t\t\tacc: Record<string, FolderData>,\r\n\t\t\tlocation,\r\n\t\t): Record<string, FolderData> => {\r\n\t\t\tconst data = readPackageNpmManifest(location);\r\n\r\n\t\t\tif (data !== undefined) {\r\n\t\t\t\tacc[data.name] = {\r\n\t\t\t\t\tdata,\r\n\t\t\t\t\tlocation,\r\n\t\t\t\t};\r\n\t\t\t} else {\r\n\t\t\t\tacc[location.path] = {\r\n\t\t\t\t\tdata: undefined,\r\n\t\t\t\t\tlocation,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t},\r\n\t\t{},\r\n\t);\r\n\r\n\tconst packageDependencies = Object.getOwnPropertyNames(packages).reduce(\r\n\t\t(acc, packageName) => {\r\n\t\t\tconst packageData = packages[packageName];\r\n\r\n\t\t\tif (packageData.data === undefined) {\r\n\t\t\t\tacc[packageName] = [];\r\n\t\t\t} else {\r\n\t\t\t\tacc[packageName] = Object.getOwnPropertyNames({\r\n\t\t\t\t\t...packageData.data.devDependencies,\r\n\t\t\t\t\t...packageData.data.dependencies,\r\n\t\t\t\t\t...packageData.data.peerDependencies,\r\n\t\t\t\t}).filter((packageName) => packages[packageName] !== undefined);\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t},\r\n\t\t{},\r\n\t);\r\n\r\n\tconst sortedPackages = toposort(packageDependencies);\r\n\tconst result: PackageLocation[] = [];\r\n\r\n\tfor (const packageName of sortedPackages) {\r\n\t\tconst location = packages[packageName].location;\r\n\r\n\t\tif (readPackageCreatorManifest(location).Package.endsWith(\".Basics\")) {\r\n\t\t\tresult.unshift(location);\r\n\t\t} else {\r\n\t\t\tresult.push(location);\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\n\r\nconst createBannerComment = (banner: BannerOptions) => {\r\n\tconst bannerParts: string[] = [];\r\n\r\n\tif (banner.text) {\r\n\t\tbannerParts.push(\" * \" + banner.text);\r\n\t}\r\n\r\n\t{\r\n\t\tconst details: string[] = [];\r\n\r\n\t\tif (banner.version) {\r\n\t\t\tdetails.push(`Version: ${banner.version}`);\r\n\t\t}\r\n\t\tif (banner.commit) {\r\n\t\t\tif (banner.commitDirty) {\r\n\t\t\t\tdetails.push(`Commit: ${banner.commit} (dirty)`);\r\n\t\t\t} else {\r\n\t\t\t\tdetails.push(`Commit: ${banner.commit}`);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (banner.date) {\r\n\t\t\tdetails.push(`Date: ${banner.date.toISOString()}`);\r\n\t\t}\r\n\r\n\t\tconst detailsText = details.map((line) => ` * ${line}`).join(\"\\n\");\r\n\t\tif (detailsText) {\r\n\t\t\tbannerParts.push(detailsText);\r\n\t\t}\r\n\t}\r\n\r\n\tconst bannerText = bannerParts.join(\"\\n\\n\");\r\n\r\n\tif (bannerText) {\r\n\t\treturn `/*\r\n${bannerText}\r\n*\r\n* @preserve\t\t\t\r\n*/`;\r\n\t}\r\n\r\n\treturn undefined;\r\n};\r\n"],"names":["logPackageMessage","name","step","index","total","numLength","undefined","toString","length","indexString","padStart","identifierString","padEnd","console","log","tryReadTsConfig","location","config","ts","readConfigFile","path","join","scriptsDir","fs","readFileSync","build","outputDir","compilerOptions","lib","result","convertCompilerOptionsFromJson","options","removeComments","declaration","sourceMap","outFile","target","ScriptTarget","ES5","noEmitOnError","host","createCompilerHost","getCurrentDirectory","js","definitions","writeFile","fileName","data","writeByteOrderMark","endsWith","files","getPackageTypescriptFiles","Error","programOptions","rootNames","program","createProgram","emitResult","emit","allDiagnostics","getPreEmitDiagnostics","emitSkipped","map","createErrorMessage","error","diagnostic","file","flattenDiagnosticMessageText","messageText","line","character","getLineAndCharacterOfPosition","start","message","generateDocs","declarationFile","outFolder","app","typedoc","Application","mediaDir","manifestDir","bootstrap","entryPoints","media","out","tsconfig","skipErrorChecking","setCompilerOptions","setValue","readmePath","glob","sync","absolute","cwd","project","convert","toposort","packages","queue","Object","getOwnPropertyNames","queueEntry","dependencies","dependencyQueued","some","dependency","includes","splice","push","buildFolders","outDir","clean","rmSync","recursive","workspace","detectWorkspace","folders","resolvePackagesFromArgs","directories","translate","sortedPackages","sortPackagesByBuildOrder","skipPackagesWithoutTsFiles","ensureTsConfig","readPackageCreatorManifest","logStep","Package","outputDirectory","mkdirSync","buildResult","tscBuild","banner","createBannerComment","writeFileSync","encoding","minimize","minifyResult","terser","minify","ecma","minifiedPath","code","docs","args","Map","arg","forEach","folder","detectPackage","set","err","Array","from","values","tsconfigPath","existsSync","content","applyTsConfigOption","JSON","stringify","parse","reduce","acc","readPackageNpmManifest","packageDependencies","packageName","packageData","devDependencies","peerDependencies","filter","unshift","bannerParts","text","details","version","commit","commitDirty","date","toISOString","detailsText","bannerText"],"mappings":";;;;;;;;;;AAAO,MAAMA,iBAAiB,GAAG,CAChCC,IAAY,EACZC,IAAY,EACZC,KAAc,EACdC,KAAc,KACV;AACJ,EAAA,MAAMC,SAAS,GAAGD,KAAK,KAAKE,SAAS,GAAGA,SAAS,GAAGF,KAAK,CAACG,QAAQ,EAAE,CAACC,MAAM,CAAA;EAE3E,MAAMC,WAAW,GAChBL,KAAK,KAAKE,SAAS,IAAIF,KAAK,GAAG,CAAC,GAC7B,EAAE,GACD,CAAA,EAAED,KAAK,CAAEI,QAAQ,EAAE,CAACG,QAAQ,CAACL,SAAS,EAAG,GAAG,CAAE,CAAGD,CAAAA,EAAAA,KAAM,CAAE,CAAA,CAAA,CAAA;EAE9D,MAAMO,gBAAgB,GAAI,CAAA,EAAEF,WAAY,CAAA,EAAER,IAAI,CAACW,MAAM,CAAC,EAAE,CAAE,CAAC,CAAA,CAAA;EAE3DC,OAAO,CAACC,GAAG,CAAE,CAAA,EAAEH,gBAAiB,CAAMT,IAAAA,EAAAA,IAAK,EAAC,CAAC,CAAA;AAC9C;;ACPO,MAAMa,eAAe,GAAIC,QAAyB,IAAK;EAC7D,MAAM;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAGC,EAAE,CAACC,cAAc,CACnCC,IAAI,CAACC,IAAI,CAACL,QAAQ,CAACM,UAAU,EAAE,eAAe,CAAC,EAC9CF,IAAI,IAAK;IACT,IAAI;AACH,MAAA,OAAOG,EAAE,CAACC,YAAY,CAACJ,IAAI,EAAE,MAAM,CAAC,CAAA;AACrC,KAAC,CAAC,MAAM;AACP,MAAA,OAAOd,SAAS,CAAA;AACjB,KAAA;AACD,GAAC,CACD,CAAA;AAED,EAAA,OAAOW,MAAM,CAAA;AAGd,CAAC,CAAA;AAEM,MAAMQ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AG,CAAA,CAAC,CAAC,CAAA;AACnD,KAAA;AAEA,IAAA,MAAMC,WAAW,GAAGN,OAAO,CAAChH,GAAG,CAAEO,IAAI,IAAM,CAAKA,GAAAA,EAAAA,IAAK,EAAC,CAAC,CAAChD,IAAI,CAAC,IAAI,CAAC,CAAA;AAClE,IAAA,IAAI+J,WAAW,EAAE;AAChBR,MAAAA,WAAW,CAAC/D,IAAI,CAACuE,WAAW,CAAC,CAAA;AAC9B,KAAA;AACD,GAAA;AAEA,EAAA,MAAMC,UAAU,GAAGT,WAAW,CAACvJ,IAAI,CAAC,MAAM,CAAC,CAAA;AAE3C,EAAA,IAAIgK,UAAU,EAAE;IACf,OAAQ,CAAA;AACV,EAAEA,UAAW,CAAA;AACb;AACA;AACA,EAAG,CAAA,CAAA;AACF,GAAA;AAEA,EAAA,OAAO/K,SAAS,CAAA;AACjB,CAAC;;;;;;;;;"}
|
|
@@ -3,17 +3,17 @@ import * as path from 'path';
|
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import { pipeline } from 'stream/promises';
|
|
5
5
|
import { execSync } from 'child_process';
|
|
6
|
-
import { l as logPackageMessage, b as buildFolders } from './
|
|
7
|
-
import { p as parseCreatorPackageName, g as getWorkspaceOutputPath, r as readPackageCreatorManifest, w as writePackageCreatorManifest, c as readPackageAnimationList, i as isErrorENOENT, e as readPackageCreatorIndex, d as detectWorkspace, a as detectPackage, f as readWorkspaceNpmManifest, t as translate, h as getPackageReleasesDirectory } from '
|
|
8
|
-
import { g as getVersionFileHandler, p as parseVersionFromString, a as getVersionInformationFromGit, b as getWorkspaceBannerText, c as parseVersionFromNumericVersion, P as PackageVersion } from '
|
|
6
|
+
import { l as logPackageMessage, b as buildFolders } from './index2.mjs';
|
|
7
|
+
import { P as PACKAGE_FILE, I as INDEX_FILE, p as parseCreatorPackageName, g as getWorkspaceOutputPath, r as readPackageCreatorManifest, w as writePackageCreatorManifest, c as readPackageAnimationList, i as isErrorENOENT, e as readPackageCreatorIndex, d as detectWorkspace, a as detectPackage, f as readWorkspaceNpmManifest, t as translate, h as getPackageReleasesDirectory } from './cli.mjs';
|
|
8
|
+
import { g as getVersionFileHandler, p as parseVersionFromString, a as getVersionInformationFromGit, b as getWorkspaceBannerText, c as parseVersionFromNumericVersion, P as PackageVersion } from './versionFile.mjs';
|
|
9
9
|
import axios from 'axios';
|
|
10
|
-
import { r as readPublishedPackageCreatorIndex, d as determineWorkspaceIGLibraries, a as readPublishedPackageNpmManifest, b as readPublishedPackageCreatorManifest } from '
|
|
10
|
+
import { r as readPublishedPackageCreatorIndex, d as determineWorkspaceIGLibraries, a as readPublishedPackageNpmManifest, b as readPublishedPackageCreatorManifest } from './dependencies.mjs';
|
|
11
11
|
import Ajv from 'ajv';
|
|
12
12
|
import JSZip from 'jszip';
|
|
13
13
|
import * as terser from 'terser';
|
|
14
14
|
import 'glob';
|
|
15
15
|
import 'typescript';
|
|
16
|
-
import '
|
|
16
|
+
import './scripts.mjs';
|
|
17
17
|
import 'typedoc';
|
|
18
18
|
import 'update-notifier';
|
|
19
19
|
import 'yargs/yargs';
|
|
@@ -25,11 +25,11 @@ import 'simple-git';
|
|
|
25
25
|
import 'resolve';
|
|
26
26
|
|
|
27
27
|
const PLUGIN_ID = "0feba3a0-b6d1-11e6-9598-0800200c9a66";
|
|
28
|
-
/**
|
|
29
|
-
* Starts an IG.Asset.Server session and returns the sessionId
|
|
30
|
-
*
|
|
31
|
-
* @param {SessionStartParams} params
|
|
32
|
-
* @returns
|
|
28
|
+
/**
|
|
29
|
+
* Starts an IG.Asset.Server session and returns the sessionId
|
|
30
|
+
*
|
|
31
|
+
* @param {SessionStartParams} params
|
|
32
|
+
* @returns
|
|
33
33
|
*/
|
|
34
34
|
const startSession = async ({
|
|
35
35
|
url,
|
|
@@ -128,10 +128,10 @@ const uploadPackageToUrl = (url, path, zipFilePath) => axios.post(path, fs.creat
|
|
|
128
128
|
|
|
129
129
|
const buildArchiveFromPublishedPackage = (location, manifest, creatorPackage) => {
|
|
130
130
|
const archive = new JSZip();
|
|
131
|
-
archive.file(
|
|
131
|
+
archive.file(PACKAGE_FILE, JSON.stringify(creatorPackage, null, 2));
|
|
132
132
|
const index = readPublishedPackageCreatorIndex(location);
|
|
133
133
|
if (index !== undefined) {
|
|
134
|
-
archive.file(
|
|
134
|
+
archive.file(INDEX_FILE, JSON.stringify(index, null, 2));
|
|
135
135
|
}
|
|
136
136
|
archive.file(manifest.main, fs.createReadStream(path.join(location.path, manifest.main)));
|
|
137
137
|
return archive;
|
|
@@ -244,10 +244,10 @@ Packaging without a javascript file is only allowed when animation json files ar
|
|
|
244
244
|
ecma: 5
|
|
245
245
|
});
|
|
246
246
|
archive.file(`${data.Package}.js`, minifyResult.code);
|
|
247
|
-
archive.file(
|
|
247
|
+
archive.file(PACKAGE_FILE, JSON.stringify(data, null, 2));
|
|
248
248
|
const creatorIndex = readPackageCreatorIndex(packageLocation);
|
|
249
249
|
if (creatorIndex !== undefined) {
|
|
250
|
-
archive.file(
|
|
250
|
+
archive.file(INDEX_FILE, JSON.stringify(creatorIndex, null, 2));
|
|
251
251
|
}
|
|
252
252
|
for (const directory of scriptDirectories) {
|
|
253
253
|
try {
|
|
@@ -564,4 +564,4 @@ const createSessionManager = async params => {
|
|
|
564
564
|
};
|
|
565
565
|
|
|
566
566
|
export { releaseFolder };
|
|
567
|
-
//# sourceMappingURL=
|
|
567
|
+
//# sourceMappingURL=index3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index3.mjs","sources":["../src/lib/assetService.ts","../src/commands/publish/zip.ts","../src/commands/publish/index.ts"],"sourcesContent":["import axios from \"axios\";\r\nimport * as fs from \"fs\";\r\n\r\nimport { Authentication } from \"./authentication\";\r\n\r\nexport interface SessionStartParams\r\n\textends Omit<\r\n\t\tSessionStartPayload,\r\n\t\t\"user\" | \"password\" | \"license\" | \"plugin\"\r\n\t> {\r\n\tauthentication: Authentication;\r\n\turl: string;\r\n}\r\n\r\nexport interface SessionStartPayload {\r\n\tplugin: string;\r\n\taddress: string | undefined;\r\n\tdomain: string;\r\n\tsubDomain: string;\r\n\tuser: string | undefined;\r\n\tpassword: string | undefined;\r\n\tlicense: string | undefined;\r\n}\r\n\r\nexport interface SessionStartResponse {\r\n\tsession: string;\r\n\tstate: string;\r\n}\r\n\r\nconst PLUGIN_ID = \"0feba3a0-b6d1-11e6-9598-0800200c9a66\";\r\n\r\nexport interface Session {\r\n\turl: string;\r\n\tsessionId: string;\r\n\tdomain: string;\r\n\tsubDomain: string;\r\n}\r\n\r\n/**\r\n * Starts an IG.Asset.Server session and returns the sessionId\r\n *\r\n * @param {SessionStartParams} params\r\n * @returns\r\n */\r\nexport const startSession = async ({\r\n\turl,\r\n\tauthentication,\r\n\t...params\r\n}: SessionStartParams): Promise<Session> => {\r\n\tconst payload: SessionStartPayload = {\r\n\t\t...params,\r\n\t\tuser: undefined,\r\n\t\tpassword: undefined,\r\n\t\tlicense: undefined,\r\n\t\tplugin: PLUGIN_ID,\r\n\t};\r\n\r\n\tif (authentication.type === \"credentials\") {\r\n\t\tpayload.user = authentication.username;\r\n\t\tpayload.password = authentication.password;\r\n\t} else if (authentication.type === \"license\") {\r\n\t\tpayload.license = authentication.license;\r\n\t}\r\n\r\n\tconst {\r\n\t\tdata: { session: sessionId, state },\r\n\t} = await axios.post<SessionStartResponse>(\r\n\t\t`Session/Start2`,\r\n\t\tJSON.stringify(payload),\r\n\t\t{\r\n\t\t\tbaseURL: url,\r\n\t\t},\r\n\t);\r\n\r\n\tif (state !== \"SUCCESS\") {\r\n\t\tthrow new Error(\r\n\t\t\t`Could not start session: IG.Asset.Server responded with ${state}`,\r\n\t\t);\r\n\t}\r\n\r\n\treturn {\r\n\t\turl,\r\n\t\tsessionId,\r\n\t\tdomain: params.domain,\r\n\t\tsubDomain: params.subDomain,\r\n\t};\r\n};\r\n\r\nexport const closeSession = async (session: Session) => {\r\n\tawait axios.get(`Session/Close/${session.sessionId}`, {\r\n\t\tbaseURL: session.url,\r\n\t});\r\n};\r\n\r\nexport interface UploadPackageDetails {\r\n\tname: string;\r\n\tversion: string;\r\n}\r\n\r\nexport const uploadPackage = async (\r\n\tsession: Session,\r\n\t{ name, version }: UploadPackageDetails,\r\n\tzipFilePath: string,\r\n) => {\r\n\ttry {\r\n\t\tawait uploadPackageToUrl(\r\n\t\t\tsession.url,\r\n\t\t\t`UploadPackage/${session.sessionId}/${name}_${version}`,\r\n\t\t\tzipFilePath,\r\n\t\t);\r\n\t} catch (err) {\r\n\t\tawait uploadPackageToUrl(\r\n\t\t\tsession.url,\r\n\t\t\t`UploadPackage/${session.sessionId}/${name}_${version}/`,\r\n\t\t\tzipFilePath,\r\n\t\t);\r\n\t}\r\n};\r\n\r\nexport interface ExistingPackage {\r\n\tscope: string;\r\n\tinformalVersion: string;\r\n\tsupport: boolean;\r\n\tnumericVersion: number;\r\n}\r\n\r\nexport const getExistingPackages = async (\r\n\tsession: Session,\r\n): Promise<ExistingPackage[] | undefined> =>\r\n\taxios\r\n\t\t.get(`Script/GetInformation/${session.sessionId}`, {\r\n\t\t\tbaseURL: session.url,\r\n\t\t\tvalidateStatus: (status) => status === 404 || status === 200,\r\n\t\t})\r\n\t\t.then(({ data }) => (Array.isArray(data) ? data : undefined));\r\n\r\nconst uploadPackageToUrl = (url: string, path: string, zipFilePath: string) =>\r\n\taxios\r\n\t\t.post(path, fs.createReadStream(zipFilePath), {\r\n\t\t\tbaseURL: url,\r\n\t\t})\r\n\t\t.then(({ data, status }) => {\r\n\t\t\tlet objectBody: any;\r\n\r\n\t\t\tif (typeof data === \"string\") {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tobjectBody = JSON.parse(data);\r\n\t\t\t\t} catch (err) {}\r\n\t\t\t} else if (typeof data === \"object\") {\r\n\t\t\t\tobjectBody = data;\r\n\t\t\t}\r\n\r\n\t\t\tif (objectBody !== undefined) {\r\n\t\t\t\tif (\"state\" in objectBody && objectBody.state !== \"SUCCESS\") {\r\n\t\t\t\t\tthrow new Error(objectBody.response ?? objectBody.state);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (status >= 400) {\r\n\t\t\t\tif (objectBody !== undefined) {\r\n\t\t\t\t\tlet text = \"\";\r\n\r\n\t\t\t\t\tfor (const key in objectBody) {\r\n\t\t\t\t\t\ttext += key + \": \\n\";\r\n\t\t\t\t\t\tif (typeof objectBody[key] === \"object\") {\r\n\t\t\t\t\t\t\ttext += JSON.stringify(\r\n\t\t\t\t\t\t\t\tobjectBody[key],\r\n\t\t\t\t\t\t\t\tundefined,\r\n\t\t\t\t\t\t\t\t2,\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttext += objectBody[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttext += \"\\n\\n\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthrow new Error(text);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthrow new Error(data);\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\t\t});\r\n","import Ajv, { ValidateFunction } from \"ajv\";\r\nimport axios from \"axios\";\r\nimport JSZip from \"jszip\";\r\nimport * as path from \"path\";\r\nimport * as fs from \"fs\";\r\nimport * as terser from \"terser\";\r\n\r\nimport { isErrorENOENT } from \"../../lib/error\";\r\nimport { logPackageMessage } from \"../../lib/log\";\r\nimport {\r\n\tCreatorPackage,\r\n\treadPackageCreatorManifest,\r\n\twritePackageCreatorManifest,\r\n\treadPackageAnimationList,\r\n\treadPackageCreatorIndex,\r\n\tparseCreatorPackageName,\r\n\tPackageLocation,\r\n\tPackageNpmManifest,\r\n\tINDEX_FILE,\r\n\tPACKAGE_FILE,\r\n} from \"../../lib/package\";\r\nimport { getWorkspaceOutputPath, WorkspaceLocation } from \"../../lib/workspace\";\r\nimport {\r\n\tPublishedPackageLocation,\r\n\treadPublishedPackageCreatorIndex,\r\n} from \"../../lib/publishedPackage\";\r\n\r\nexport const buildArchiveFromPublishedPackage = (\r\n\tlocation: PublishedPackageLocation,\r\n\tmanifest: PackageNpmManifest,\r\n\tcreatorPackage: CreatorPackage,\r\n) => {\r\n\tconst archive = new JSZip();\r\n\r\n\tarchive.file(PACKAGE_FILE, JSON.stringify(creatorPackage, null, 2));\r\n\r\n\tconst index = readPublishedPackageCreatorIndex(location);\r\n\r\n\tif (index !== undefined) {\r\n\t\tarchive.file(INDEX_FILE, JSON.stringify(index, null, 2));\r\n\t}\r\n\r\n\tarchive.file(\r\n\t\tmanifest.main,\r\n\t\tfs.createReadStream(path.join(location.path, manifest.main)),\r\n\t);\r\n\r\n\treturn archive;\r\n};\r\n\r\nlet validateSchema: ValidateFunction | undefined;\r\n\r\nconst runtimeScripts: CreatorPackage[\"Type\"][] = [\r\n\t\"Interactor\",\r\n\t\"Core\",\r\n\t\"Mixed\",\r\n];\r\n\r\nconst notRuntimeScripts: CreatorPackage[\"Type\"][] = [\"Context\", \"Evaluator\"];\r\n\r\nexport const buildArchiveFromPackage = async (\r\n\tworkspaceLocation: WorkspaceLocation,\r\n\tpackageLocation: PackageLocation,\r\n\tdata: CreatorPackage,\r\n) => {\r\n\tconst { domain, subdomain } = parseCreatorPackageName(data);\r\n\r\n\tconst logStep = (step: string) => logPackageMessage(data.Package, step);\r\n\r\n\tif (validateSchema === undefined) {\r\n\t\tvalidateSchema = await axios\r\n\t\t\t.get(\r\n\t\t\t\t\"https://archive.intelligentgraphics.biz/schemas/gfx/animation.json\",\r\n\t\t\t)\r\n\t\t\t.then(({ data }) =>\r\n\t\t\t\tnew Ajv({\r\n\t\t\t\t\tcoerceTypes: true,\r\n\t\t\t\t\tallErrors: true,\r\n\t\t\t\t\tremoveAdditional: true,\r\n\t\t\t\t\tuseDefaults: \"empty\",\r\n\t\t\t\t\tvalidateSchema: \"log\",\r\n\t\t\t\t}).compile(data),\r\n\t\t\t);\r\n\t}\r\n\r\n\tconst libFilePath = path.join(\r\n\t\tgetWorkspaceOutputPath(workspaceLocation),\r\n\t\t`${data.Package}.min.js`,\r\n\t);\r\n\r\n\tconst scriptDirectories: string[] = [\r\n\t\tpackageLocation.path,\r\n\t\tpackageLocation.scriptsDir,\r\n\t];\r\n\r\n\tif (subdomain === \"GFX.Standard\") {\r\n\t\tlogStep(`Including Images folder`);\r\n\t\tscriptDirectories.push(path.join(packageLocation.path, \"Images\"));\r\n\t}\r\n\r\n\tconst manifest = readPackageCreatorManifest(packageLocation);\r\n\r\n\tif (manifest !== undefined) {\r\n\t\tif (manifest.RunTime && notRuntimeScripts.includes(manifest.Type)) {\r\n\t\t\tlogStep(\"Setting script RunTime to false because of script type\");\r\n\t\t\twritePackageCreatorManifest(packageLocation, {\r\n\t\t\t\t...manifest,\r\n\t\t\t\tRunTime: false,\r\n\t\t\t});\r\n\t\t} else if (\r\n\t\t\t!manifest.RunTime &&\r\n\t\t\truntimeScripts.includes(manifest.Type)\r\n\t\t) {\r\n\t\t\tlogStep(\"Setting script RunTime to true because of script type\");\r\n\t\t\twritePackageCreatorManifest(packageLocation, {\r\n\t\t\t\t...manifest,\r\n\t\t\t\tRunTime: true,\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t// if (index === undefined) {\r\n\t// \tthrow new Error(\r\n\t// \t\t`Could not find an \"${INDEX_FILE}\" file in \"${primaryScriptDir}\"`,\r\n\t// \t);\r\n\t// }\r\n\r\n\tconst animations = new Map<string, string>();\r\n\r\n\tfor (const scriptFilePath of readPackageAnimationList(packageLocation)) {\r\n\t\tconst content = fs.readFileSync(scriptFilePath, { encoding: \"utf8\" })!;\r\n\r\n\t\tlet data: { Id: string };\r\n\r\n\t\ttry {\r\n\t\t\tdata = JSON.parse(content);\r\n\t\t} catch (err) {\r\n\t\t\tconst relativePath = path.relative(\r\n\t\t\t\tworkspaceLocation.path,\r\n\t\t\t\tscriptFilePath,\r\n\t\t\t);\r\n\r\n\t\t\tif (err instanceof SyntaxError) {\r\n\t\t\t\tthrow new Error(\r\n\t\t\t\t\t`Encountered invalid syntax in file \"${relativePath}\": ${String(\r\n\t\t\t\t\t\terr,\r\n\t\t\t\t\t)}`,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tthrow new Error(\r\n\t\t\t\t`Encountered an unexpected error while parsing animation json file at path \"${relativePath}\"`,\r\n\t\t\t\t{\r\n\t\t\t\t\tcause: err,\r\n\t\t\t\t},\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tvalidateSchema!(data);\r\n\r\n\t\tanimations.set(data.Id, JSON.stringify(data));\r\n\t}\r\n\r\n\tlet libFile: string | undefined;\r\n\r\n\ttry {\r\n\t\tlibFile = fs.readFileSync(libFilePath, { encoding: \"utf8\" });\r\n\t} catch (err) {\r\n\t\tif (!isErrorENOENT(err)) {\r\n\t\t\tthrow err;\r\n\t\t}\r\n\t}\r\n\r\n\tif (libFile === undefined) {\r\n\t\tif (animations.size === 0) {\r\n\t\t\tthrow new Error(`Could not find a javascript file at \"${libFilePath}\".\r\nPackaging without a javascript file is only allowed when animation json files are available`);\r\n\t\t}\r\n\t}\r\n\r\n\tconst archive = new JSZip();\r\n\r\n\tlet library: string = \"\";\r\n\r\n\tif (libFile) {\r\n\t\tlibrary = libFile;\r\n\t}\r\n\r\n\tif (!library) {\r\n\t\tconst date = new Date(Date.now());\r\n\t\tlibrary = `/* This file is part of the ${domain} Data Packages.\r\n\t\t* Copyright (C) ${date.getFullYear()} intelligentgraphics. All Rights Reserved. */`;\r\n\t}\r\n\r\n\tif (animations.size > 0) {\r\n\t\tconst scopeParts = data.Scope.split(\".\");\r\n\t\tconst scope = data.Scope;\r\n\r\n\t\tlibrary += createNamespace(scopeParts);\r\n\r\n\t\tfor (const [name, data] of animations) {\r\n\t\t\tlibrary += `${scope}.${name} = ` + data + \";\";\r\n\t\t\tlogPackageMessage(\r\n\t\t\t\tmanifest.Package,\r\n\t\t\t\t`Added animation ${scope}.${name}`,\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tconst minifyResult = await terser.minify(library, { ecma: 5 });\r\n\r\n\tarchive.file(`${data.Package}.js`, minifyResult.code!);\r\n\tarchive.file(PACKAGE_FILE, JSON.stringify(data, null, 2));\r\n\r\n\tconst creatorIndex = readPackageCreatorIndex(packageLocation);\r\n\r\n\tif (creatorIndex !== undefined) {\r\n\t\tarchive.file(INDEX_FILE, JSON.stringify(creatorIndex, null, 2));\r\n\t}\r\n\r\n\tfor (const directory of scriptDirectories) {\r\n\t\ttry {\r\n\t\t\tfor (const file of fs.readdirSync(directory)) {\r\n\t\t\t\tconst { ext } = path.parse(file);\r\n\r\n\t\t\t\tswitch (ext) {\r\n\t\t\t\t\tcase \".png\":\r\n\t\t\t\t\tcase \".jpeg\":\r\n\t\t\t\t\tcase \".jpg\":\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tarchive.file(\r\n\t\t\t\t\tfile,\r\n\t\t\t\t\tfs.createReadStream(path.join(directory, file)),\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Script directory \"${directory}\" does not exist`);\r\n\t\t}\r\n\t}\r\n\r\n\treturn archive;\r\n};\r\n\r\nconst createNamespace = (parts: string[]) => {\r\n\tlet code = `var ${parts[0]};`;\r\n\r\n\tfor (let index = 0; index < parts.length; index++) {\r\n\t\tconst path = parts.slice(0, index + 1).join(\".\");\r\n\r\n\t\tcode += `\\n(${path} = ${path} || {});`;\r\n\t}\r\n\r\n\treturn code;\r\n};\r\n","import * as path from \"path\";\r\nimport * as fs from \"fs\";\r\nimport { pipeline } from \"stream/promises\";\r\nimport { execSync } from \"child_process\";\r\n\r\nimport { logPackageMessage } from \"../../lib/log\";\r\nimport { translate } from \"../../lib/localization\";\r\nimport { Authentication } from \"../../lib/authentication\";\r\nimport {\r\n\tCreatorPackage,\r\n\tdetectPackage,\r\n\tgetPackageReleasesDirectory,\r\n\tparseCreatorPackageName,\r\n\treadPackageCreatorManifest,\r\n} from \"../../lib/package\";\r\nimport {\r\n\tdetectWorkspace,\r\n\tgetWorkspaceOutputPath,\r\n\treadWorkspaceNpmManifest,\r\n\tWorkspaceLocation,\r\n} from \"../../lib/workspace\";\r\nimport { getVersionInformationFromGit } from \"../../lib/git\";\r\nimport { getWorkspaceBannerText } from \"../../lib/banner\";\r\nimport {\r\n\tparseVersionFromNumericVersion,\r\n\tparseVersionFromString,\r\n} from \"../../lib/parseVersion\";\r\nimport { getVersionFileHandler } from \"../../lib/versionFile\";\r\nimport * as AssetService from \"../../lib/assetService\";\r\nimport { isErrorENOENT } from \"../../lib/error\";\r\nimport { determineWorkspaceIGLibraries } from \"../../lib/dependencies\";\r\nimport {\r\n\treadPublishedPackageCreatorManifest,\r\n\treadPublishedPackageNpmManifest,\r\n} from \"../../lib/publishedPackage\";\r\nimport { Prompter } from \"../../lib/prompter\";\r\nimport { PackageVersion } from \"../../lib/packageVersion\";\r\n\r\nimport { BuildFoldersOptions, buildFolders } from \"../build\";\r\nimport {\r\n\tbuildArchiveFromPackage,\r\n\tbuildArchiveFromPublishedPackage,\r\n} from \"./zip\";\r\n\r\nexport interface ReleaseFolderOptions\r\n\textends Omit<\r\n\t\tBuildFoldersOptions,\r\n\t\t\"skipPackagesWithoutTsFiles\" | \"banner\" | \"directories\"\r\n\t> {\r\n\tdirectory: string;\r\n\tnoUpload: boolean;\r\n\tnewVersion: string;\r\n\tdomain?: string;\r\n\tsubdomain?: string;\r\n\taddress?: string;\r\n\tservice: string;\r\n\tauthentication?: Authentication;\r\n\tpushOnly: boolean;\r\n\tbanner?: boolean;\r\n\tprompter: Prompter;\r\n}\r\n\r\nexport const releaseFolder = async (options: ReleaseFolderOptions) => {\r\n\tconst workspace = detectWorkspace(options.cwd);\r\n\tconst location = detectPackage(workspace, options.directory);\r\n\r\n\tconst { write: writeVersionFile, reset: resetVersionFile } =\r\n\t\tgetVersionFileHandler(location);\r\n\r\n\tconst packageDescription = readPackageCreatorManifest(location);\r\n\tconst fullPackageName = packageDescription.Package;\r\n\tconst { domain, subdomain } = parseCreatorPackageName(packageDescription);\r\n\r\n\tconst publishDomain = options.domain ?? domain;\r\n\tconst publishSubdomain = options.subdomain ?? subdomain;\r\n\r\n\tconst sharedPackageJson = readWorkspaceNpmManifest(workspace);\r\n\r\n\tlet newVersion: PackageVersion;\r\n\ttry {\r\n\t\tnewVersion = parseVersionFromString(options.newVersion);\r\n\t} catch (err) {\r\n\t\tthrow new Error(`Please enter a version in this format 1.0.0.100`);\r\n\t}\r\n\r\n\tif (newVersion.buildNumber < 100) {\r\n\t\tnewVersion.preRelease = {\r\n\t\t\ttype: \"beta\",\r\n\t\t\tversion: newVersion.buildNumber,\r\n\t\t};\r\n\t} else if (newVersion.buildNumber > 100) {\r\n\t\tnewVersion.preRelease = {\r\n\t\t\ttype: \"patch\",\r\n\t\t\tversion: newVersion.buildNumber - 100,\r\n\t\t};\r\n\t}\r\n\r\n\tif (sharedPackageJson !== undefined) {\r\n\t\tlogPackageMessage(\r\n\t\t\tpackageDescription.Package,\r\n\t\t\t`Running npm install to make sure all dependencies are up to date`,\r\n\t\t);\r\n\t\texecSync(`npm install`, { encoding: \"utf-8\", cwd: workspace.path });\r\n\t}\r\n\r\n\tconst binDir = getWorkspaceOutputPath(workspace);\r\n\tfs.mkdirSync(binDir, { recursive: true });\r\n\r\n\tlet assetServerPackageDetails: AssetService.UploadPackageDetails;\r\n\r\n\tlet packageNameWithVersion: string;\r\n\r\n\t{\r\n\t\tconst versionWithoutPrelease = newVersion.clone();\r\n\t\tversionWithoutPrelease.preRelease = undefined;\r\n\t\tconst newVersionString = versionWithoutPrelease.toVersionString({\r\n\t\t\tbuildNumber: true,\r\n\t\t});\r\n\t\tpackageNameWithVersion = `${packageDescription.Package}_${newVersionString}`;\r\n\r\n\t\tassetServerPackageDetails = {\r\n\t\t\tname: packageDescription.Package,\r\n\t\t\tversion: newVersionString,\r\n\t\t};\r\n\t}\r\n\r\n\tconst zipFilePath = path.join(binDir, packageNameWithVersion + \".zip\");\r\n\r\n\ttry {\r\n\t\tif (options.pushOnly) {\r\n\t\t\tif (!fs.existsSync(zipFilePath)) {\r\n\t\t\t\tthrow new Error(\r\n\t\t\t\t\t`Expected a zip file to exist at path ${zipFilePath} since pushOnly is specified`,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst gitVersionInformation = await getVersionInformationFromGit(\r\n\t\t\t\tworkspace,\r\n\t\t\t\tlocation,\r\n\t\t\t);\r\n\r\n\t\t\twriteVersionFile(fullPackageName, newVersion);\r\n\r\n\t\t\tconst bannerText =\r\n\t\t\t\tsharedPackageJson !== undefined\r\n\t\t\t\t\t? getWorkspaceBannerText(sharedPackageJson)\r\n\t\t\t\t\t: undefined;\r\n\r\n\t\t\tawait buildFolders({\r\n\t\t\t\t...options,\r\n\t\t\t\tdirectories: [location.path],\r\n\t\t\t\tskipPackagesWithoutTsFiles: true,\r\n\t\t\t\tbanner: options.banner\r\n\t\t\t\t\t? {\r\n\t\t\t\t\t\t\ttext: bannerText,\r\n\t\t\t\t\t\t\tcommit: gitVersionInformation.commit,\r\n\t\t\t\t\t\t\tcommitDirty: gitVersionInformation.dirty,\r\n\t\t\t\t\t\t\tversion: newVersion.toVersionString({\r\n\t\t\t\t\t\t\t\tbuildNumber: true,\r\n\t\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t\tdate: new Date(Date.now()),\r\n\t\t\t\t\t\t\t// gitVersionInformation.commitDate\r\n\t\t\t\t\t\t\t// \t? new Date(gitVersionInformation.commitDate)\r\n\t\t\t\t\t\t\t// \t: new Date(Date.now()),\r\n\t\t\t\t\t }\r\n\t\t\t\t\t: undefined,\r\n\t\t\t});\r\n\r\n\t\t\tnewVersion.preRelease = undefined;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tfs.rmSync(zipFilePath);\r\n\t\t\t} catch (err) {\r\n\t\t\t\tif (!isErrorENOENT(err)) {\r\n\t\t\t\t\tthrow err;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst archive = await buildArchiveFromPackage(\r\n\t\t\t\tworkspace,\r\n\t\t\t\tlocation,\r\n\t\t\t\tpackageDescription,\r\n\t\t\t);\r\n\r\n\t\t\tconst zipOutputStream = fs.createWriteStream(zipFilePath);\r\n\t\t\tawait pipeline(archive.generateNodeStream(), zipOutputStream);\r\n\t\t}\r\n\r\n\t\tif (!options.noUpload) {\r\n\t\t\tif (!options.authentication) {\r\n\t\t\t\tthrow new Error(`Expected authentication to be available`);\r\n\t\t\t}\r\n\r\n\t\t\tlogPackageMessage(\r\n\t\t\t\tpackageDescription.Package,\r\n\t\t\t\t`Opening connection to IG.Asset.Server`,\r\n\t\t\t);\r\n\r\n\t\t\tconst sessionManager = await createSessionManager({\r\n\t\t\t\turl: options.service,\r\n\t\t\t\taddress: options.address,\r\n\t\t\t\tdomain: publishDomain,\r\n\t\t\t\tsubDomain: publishSubdomain,\r\n\t\t\t\tauthentication: options.authentication,\r\n\t\t\t});\r\n\r\n\t\t\ttry {\r\n\t\t\t\tif (\r\n\t\t\t\t\t!(await ensureRequiredVersions(\r\n\t\t\t\t\t\tworkspace,\r\n\t\t\t\t\t\tpackageDescription,\r\n\t\t\t\t\t\tsessionManager,\r\n\t\t\t\t\t\toptions.prompter,\r\n\t\t\t\t\t))\r\n\t\t\t\t) {\r\n\t\t\t\t\tlogPackageMessage(\r\n\t\t\t\t\t\tpackageDescription.Package,\r\n\t\t\t\t\t\t\"Failed to ensure required dependency versions: IG.Asset.Server does not yet support required apis for dependency check\",\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlogPackageMessage(\r\n\t\t\t\t\tpackageDescription.Package,\r\n\t\t\t\t\t`Uploading package to ${publishDomain}.${publishSubdomain}`,\r\n\t\t\t\t);\r\n\r\n\t\t\t\tawait AssetService.uploadPackage(\r\n\t\t\t\t\tsessionManager.getTargetSession(),\r\n\t\t\t\t\tassetServerPackageDetails,\r\n\t\t\t\t\tzipFilePath,\r\n\t\t\t\t);\r\n\t\t\t} finally {\r\n\t\t\t\tawait sessionManager.destroy().catch((err) => {\r\n\t\t\t\t\tlogPackageMessage(\r\n\t\t\t\t\t\tpackageDescription.Package,\r\n\t\t\t\t\t\t`Failed to close IG.Asset.Server session(s): ${err}`,\r\n\t\t\t\t\t);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t} catch (err) {\r\n\t\tresetVersionFile();\r\n\t\tthrow err;\r\n\t}\r\n\r\n\tif (newVersion.buildNumber >= 100 && !options.pushOnly) {\r\n\t\tlogPackageMessage(\r\n\t\t\tfullPackageName,\r\n\t\t\ttranslate(\"messages.movingReleaseZip\"),\r\n\t\t);\r\n\r\n\t\tconst zipFileName = `${packageNameWithVersion}.zip`;\r\n\t\tconst releasesPath = getPackageReleasesDirectory(location);\r\n\r\n\t\tfs.mkdirSync(releasesPath, { recursive: true });\r\n\t\tfs.copyFileSync(zipFilePath, path.join(releasesPath, zipFileName));\r\n\t}\r\n};\r\n\r\nconst ensureRequiredVersions = async (\r\n\tworkspaceLocation: WorkspaceLocation,\r\n\tcreatorPackage: CreatorPackage,\r\n\tsessionManager: SessionManager,\r\n\tprompter: Prompter,\r\n) => {\r\n\tinterface UploadedPackage\r\n\t\textends Omit<AssetService.ExistingPackage, \"version\"> {\r\n\t\tversion: PackageVersion;\r\n\t}\r\n\r\n\tconst libraries = determineWorkspaceIGLibraries(workspaceLocation);\r\n\r\n\t// If there are no libraries, we don't need to check for required versions\r\n\tif (libraries.length === 0) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\tconst targetSession = sessionManager.getTargetSession();\r\n\r\n\tconst rawUploadedPackages = await AssetService.getExistingPackages(\r\n\t\ttargetSession,\r\n\t);\r\n\r\n\tif (rawUploadedPackages === undefined) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tconst uploadedPackages = rawUploadedPackages.map(\r\n\t\t(entry): UploadedPackage => {\r\n\t\t\tlet version: PackageVersion;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tversion = parseVersionFromNumericVersion(entry.numericVersion);\r\n\t\t\t} catch (err) {\r\n\t\t\t\tthrow new Error(\r\n\t\t\t\t\t`Encountered invalid format for version ${entry.numericVersion}`,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif (version.buildNumber < 100) {\r\n\t\t\t\tversion.preRelease = {\r\n\t\t\t\t\ttype: \"beta\",\r\n\t\t\t\t\tversion: version.buildNumber,\r\n\t\t\t\t};\r\n\t\t\t} else if (version.buildNumber > 100) {\r\n\t\t\t\tversion.preRelease = {\r\n\t\t\t\t\ttype: \"patch\",\r\n\t\t\t\t\tversion: version.buildNumber - 100,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\treturn {\r\n\t\t\t\t...entry,\r\n\t\t\t\tversion,\r\n\t\t\t};\r\n\t\t},\r\n\t);\r\n\r\n\tfor (const libraryLocation of libraries) {\r\n\t\tconst libraryManifest =\r\n\t\t\treadPublishedPackageNpmManifest(libraryLocation);\r\n\t\tconst libraryCreatorPackage =\r\n\t\t\treadPublishedPackageCreatorManifest(libraryLocation);\r\n\r\n\t\tif (\r\n\t\t\tlibraryCreatorPackage === undefined ||\r\n\t\t\tlibraryManifest.main === undefined ||\r\n\t\t\tlibraryCreatorPackage.Package === creatorPackage.Package\r\n\t\t) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tconst libraryVersion = PackageVersion.extractFromLine(\r\n\t\t\tlibraryManifest.version,\r\n\t\t);\r\n\r\n\t\tif (libraryVersion.preRelease) {\r\n\t\t\tlibraryVersion.buildNumber = libraryVersion.preRelease.version;\r\n\t\t\tlibraryVersion.preRelease = undefined;\r\n\t\t} else {\r\n\t\t\tlibraryVersion.buildNumber = 100;\r\n\t\t}\r\n\r\n\t\tlet uploadedPackageInBasics: UploadedPackage | undefined;\r\n\t\tlet uploadedPackageInTarget: UploadedPackage | undefined;\r\n\r\n\t\tfor (const uploadedPackage of uploadedPackages) {\r\n\t\t\tif (uploadedPackage.scope === libraryCreatorPackage.Package) {\r\n\t\t\t\tif (uploadedPackage.support) {\r\n\t\t\t\t\tuploadedPackageInBasics = uploadedPackage;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tuploadedPackageInTarget = uploadedPackage;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst validInBasics =\r\n\t\t\tuploadedPackageInBasics !== undefined &&\r\n\t\t\t!uploadedPackageInBasics.version.isLesserThan(libraryVersion);\r\n\t\tconst validInTarget =\r\n\t\t\tuploadedPackageInTarget !== undefined &&\r\n\t\t\t!uploadedPackageInTarget.version.isLesserThan(libraryVersion);\r\n\r\n\t\tif (validInBasics || validInTarget) {\r\n\t\t\tif (\r\n\t\t\t\ttargetSession.subDomain !== \"Basics\" &&\r\n\t\t\t\t(uploadedPackageInBasics !== undefined ||\r\n\t\t\t\t\tuploadedPackageInTarget !== undefined)\r\n\t\t\t) {\r\n\t\t\t\tlogPackageMessage(\r\n\t\t\t\t\tcreatorPackage.Package,\r\n\t\t\t\t\t`Package ${libraryCreatorPackage.Package} is uploaded both for Basics and ${targetSession.subDomain}. The package within ${targetSession.subDomain} will be used.`,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tlogPackageMessage(\r\n\t\t\tcreatorPackage.Package,\r\n\t\t\t`Requested at least version ${libraryVersion.toVersionString({\r\n\t\t\t\tbuildNumber: true,\r\n\t\t\t})} for package ${libraryCreatorPackage.Package}`,\r\n\t\t);\r\n\r\n\t\tif (targetSession.subDomain !== \"Basics\" && uploadedPackageInTarget) {\r\n\t\t\tconst version = uploadedPackageInTarget.version.toVersionString({\r\n\t\t\t\tbuildNumber: true,\r\n\t\t\t});\r\n\r\n\t\t\tlogPackageMessage(\r\n\t\t\t\tcreatorPackage.Package,\r\n\t\t\t\t`Found invalid version ${version} for package ${libraryCreatorPackage.Package} in ${targetSession.subDomain}`,\r\n\t\t\t);\r\n\t\t}\r\n\t\tif (uploadedPackageInBasics) {\r\n\t\t\tconst version = uploadedPackageInBasics.version.toVersionString({\r\n\t\t\t\tbuildNumber: true,\r\n\t\t\t});\r\n\r\n\t\t\tlet message = `Found invalid version ${version} for package ${libraryCreatorPackage.Package} in Basics`;\r\n\r\n\t\t\tif (\r\n\t\t\t\ttargetSession.subDomain !== \"Basics\" &&\r\n\t\t\t\tuploadedPackageInTarget\r\n\t\t\t) {\r\n\t\t\t\tmessage += `. This version will not be used since the package also exists in ${targetSession.subDomain}`;\r\n\t\t\t}\r\n\r\n\t\t\tlogPackageMessage(creatorPackage.Package, message);\r\n\t\t}\r\n\r\n\t\tconst possibleTargets: string[] = [\"Basics\"];\r\n\r\n\t\tif (targetSession.subDomain !== \"Basics\") {\r\n\t\t\tpossibleTargets.push(targetSession.subDomain);\r\n\t\t}\r\n\r\n\t\tconst uploadTargetScope = await prompter.ask({\r\n\t\t\tmessage: `Select the scope to upload the required version of ${libraryCreatorPackage.Package} to or select \"skip\" to skip the upload.`,\r\n\t\t\toptions: [...possibleTargets, \"Skip\"],\r\n\t\t\tdefault: possibleTargets[0],\r\n\t\t});\r\n\r\n\t\tif (uploadTargetScope === \"Skip\") {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tconst archive = buildArchiveFromPublishedPackage(\r\n\t\t\tlibraryLocation,\r\n\t\t\tlibraryManifest,\r\n\t\t\tlibraryCreatorPackage,\r\n\t\t);\r\n\r\n\t\tconst newVersionString = libraryVersion.toVersionString({\r\n\t\t\tbuildNumber: true,\r\n\t\t});\r\n\t\tconst packageNameWithVersion = `${libraryCreatorPackage.Package}_${newVersionString}`;\r\n\r\n\t\tconst zipFilePath = path.join(\r\n\t\t\tgetWorkspaceOutputPath(workspaceLocation),\r\n\t\t\t`${packageNameWithVersion}.zip`,\r\n\t\t);\r\n\r\n\t\ttry {\r\n\t\t\tfs.rmSync(zipFilePath);\r\n\t\t} catch (err) {\r\n\t\t\tif (!isErrorENOENT(err)) {\r\n\t\t\t\tthrow err;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst zipOutputStream = fs.createWriteStream(zipFilePath);\r\n\t\tawait pipeline(archive.generateNodeStream(), zipOutputStream);\r\n\r\n\t\tconst session =\r\n\t\t\tuploadTargetScope === \"Basics\"\r\n\t\t\t\t? await sessionManager.getBasicsSession()\r\n\t\t\t\t: targetSession;\r\n\r\n\t\tlogPackageMessage(\r\n\t\t\tcreatorPackage.Package,\r\n\t\t\t`Uploading package ${libraryCreatorPackage.Package} with version ${newVersionString} to ${session.domain}.${session.subDomain}`,\r\n\t\t);\r\n\r\n\t\tawait AssetService.uploadPackage(\r\n\t\t\tsession,\r\n\t\t\t{\r\n\t\t\t\tname: libraryCreatorPackage.Package,\r\n\t\t\t\tversion: newVersionString,\r\n\t\t\t},\r\n\t\t\tzipFilePath,\r\n\t\t);\r\n\t}\r\n\r\n\treturn true;\r\n};\r\n\r\ninterface SessionManager {\r\n\tgetBasicsSession: () => Promise<AssetService.Session>;\r\n\tgetTargetSession: () => AssetService.Session;\r\n\tdestroy: () => Promise<void>;\r\n}\r\n\r\nconst createSessionManager = async (\r\n\tparams: AssetService.SessionStartParams,\r\n): Promise<SessionManager> => {\r\n\tconst targetSession = await AssetService.startSession(params);\r\n\tlet basicsSession: AssetService.Session | undefined;\r\n\r\n\treturn {\r\n\t\tgetBasicsSession: async () => {\r\n\t\t\tif (targetSession.subDomain === \"Basics\") {\r\n\t\t\t\treturn targetSession;\r\n\t\t\t}\r\n\r\n\t\t\tif (basicsSession === undefined) {\r\n\t\t\t\tbasicsSession = await AssetService.startSession({\r\n\t\t\t\t\t...params,\r\n\t\t\t\t\tsubDomain: \"Basics\",\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\treturn basicsSession;\r\n\t\t},\r\n\r\n\t\tgetTargetSession: () => targetSession,\r\n\r\n\t\tdestroy: async () => {\r\n\t\t\tawait AssetService.closeSession(targetSession);\r\n\r\n\t\t\tif (basicsSession !== undefined) {\r\n\t\t\t\tawait AssetService.closeSession(basicsSession);\r\n\t\t\t}\r\n\t\t},\r\n\t};\r\n};\r\n"],"names":["PLUGIN_ID","startSession","url","authentication","params","payload","user","undefined","password","license","plugin","type","username","data","session","sessionId","state","axios","post","JSON","stringify","baseURL","Error","domain","subDomain","closeSession","get","uploadPackage","name","version","zipFilePath","uploadPackageToUrl","err","getExistingPackages","validateStatus","status","then","Array","isArray","path","fs","createReadStream","objectBody","parse","response","text","key","buildArchiveFromPublishedPackage","location","manifest","creatorPackage","archive","JSZip","file","PACKAGE_FILE","index","readPublishedPackageCreatorIndex","INDEX_FILE","main","join","validateSchema","runtimeScripts","notRuntimeScripts","buildArchiveFromPackage","workspaceLocation","packageLocation","subdomain","parseCreatorPackageName","logStep","step","logPackageMessage","Package","Ajv","coerceTypes","allErrors","removeAdditional","useDefaults","compile","libFilePath","getWorkspaceOutputPath","scriptDirectories","scriptsDir","push","readPackageCreatorManifest","RunTime","includes","Type","writePackageCreatorManifest","animations","Map","scriptFilePath","readPackageAnimationList","content","readFileSync","encoding","relativePath","relative","SyntaxError","String","cause","set","Id","libFile","isErrorENOENT","size","library","date","Date","now","getFullYear","scopeParts","Scope","split","scope","createNamespace","minifyResult","terser","minify","ecma","code","creatorIndex","readPackageCreatorIndex","directory","readdirSync","ext","console","error","parts","length","slice","releaseFolder","options","workspace","detectWorkspace","cwd","detectPackage","write","writeVersionFile","reset","resetVersionFile","getVersionFileHandler","packageDescription","fullPackageName","publishDomain","publishSubdomain","sharedPackageJson","readWorkspaceNpmManifest","newVersion","parseVersionFromString","buildNumber","preRelease","execSync","binDir","mkdirSync","recursive","assetServerPackageDetails","packageNameWithVersion","versionWithoutPrelease","clone","newVersionString","toVersionString","pushOnly","existsSync","gitVersionInformation","getVersionInformationFromGit","bannerText","getWorkspaceBannerText","buildFolders","directories","skipPackagesWithoutTsFiles","banner","commit","commitDirty","dirty","rmSync","zipOutputStream","createWriteStream","pipeline","generateNodeStream","noUpload","sessionManager","createSessionManager","service","address","ensureRequiredVersions","prompter","AssetService","getTargetSession","destroy","catch","translate","zipFileName","releasesPath","getPackageReleasesDirectory","copyFileSync","libraries","determineWorkspaceIGLibraries","targetSession","rawUploadedPackages","uploadedPackages","map","entry","parseVersionFromNumericVersion","numericVersion","libraryLocation","libraryManifest","readPublishedPackageNpmManifest","libraryCreatorPackage","readPublishedPackageCreatorManifest","libraryVersion","PackageVersion","extractFromLine","uploadedPackageInBasics","uploadedPackageInTarget","uploadedPackage","support","validInBasics","isLesserThan","validInTarget","message","possibleTargets","uploadTargetScope","ask","default","getBasicsSession","basicsSession"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAMA,SAAS,GAAG,sCAAsC,CAAA;AASxD;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,GAAG,OAAO;EAClCC,GAAG;EACHC,cAAc;EACd,GAAGC,MAAAA;AACgB,CAAC,KAAuB;AAC3C,EAAA,MAAMC,OAA4B,GAAG;AACpC,IAAA,GAAGD,MAAM;AACTE,IAAAA,IAAI,EAAEC,SAAS;AACfC,IAAAA,QAAQ,EAAED,SAAS;AACnBE,IAAAA,OAAO,EAAEF,SAAS;AAClBG,IAAAA,MAAM,EAAEV,SAAAA;GACR,CAAA;AAED,EAAA,IAAIG,cAAc,CAACQ,IAAI,KAAK,aAAa,EAAE;AAC1CN,IAAAA,OAAO,CAACC,IAAI,GAAGH,cAAc,CAACS,QAAQ,CAAA;AACtCP,IAAAA,OAAO,CAACG,QAAQ,GAAGL,cAAc,CAACK,QAAQ,CAAA;AAC3C,GAAC,MAAM,IAAIL,cAAc,CAACQ,IAAI,KAAK,SAAS,EAAE;AAC7CN,IAAAA,OAAO,CAACI,OAAO,GAAGN,cAAc,CAACM,OAAO,CAAA;AACzC,GAAA;EAEA,MAAM;AACLI,IAAAA,IAAI,EAAE;AAAEC,MAAAA,OAAO,EAAEC,SAAS;AAAEC,MAAAA,KAAAA;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AA;MAE9C,IAAI4B,aAAa,KAAK1N,SAAS,EAAE;AAChC,QAAA,MAAMmL,YAAyB,CAACuC,aAAa,CAAC,CAAA;AAC/C,OAAA;AACD,KAAA;GACA,CAAA;AACF,CAAC;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
|
-
import { f as readWorkspaceNpmManifest, l as getWorkspaceLibPath } from '
|
|
5
|
-
import { d as determineWorkspaceIGLibraries, a as readPublishedPackageNpmManifest } from '
|
|
4
|
+
import { f as readWorkspaceNpmManifest, l as getWorkspaceLibPath } from './cli.mjs';
|
|
5
|
+
import { d as determineWorkspaceIGLibraries, a as readPublishedPackageNpmManifest } from './dependencies.mjs';
|
|
6
6
|
import 'update-notifier';
|
|
7
7
|
import 'yargs/yargs';
|
|
8
8
|
import 'url';
|
|
@@ -38,7 +38,10 @@ const executePostInstall = workspace => {
|
|
|
38
38
|
const manifest = readPublishedPackageNpmManifest(location);
|
|
39
39
|
|
|
40
40
|
// add a hint to the top of the file so we know it's managed by the packager.
|
|
41
|
-
const content = DEFINITION_FILE_HINT
|
|
41
|
+
const content = `${DEFINITION_FILE_HINT}
|
|
42
|
+
// This is a reference to version ${manifest.version}.
|
|
43
|
+
// Run "npm install" to install the types if they are missing or not up to date.
|
|
44
|
+
/// <reference types="${manifest.name}" />`;
|
|
42
45
|
fs.writeFileSync(path.join(getWorkspaceLibPath(workspace), manifest.types), content, {
|
|
43
46
|
encoding: "utf8"
|
|
44
47
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postinstall.mjs","sources":["../src/commands/postinstall.ts"],"sourcesContent":["import * as path from \"path\";\r\nimport * as fs from \"fs\";\r\n\r\nimport {\r\n\tgetWorkspaceLibPath,\r\n\treadWorkspaceNpmManifest,\r\n\tWorkspaceLocation,\r\n} from \"../lib/workspace\";\r\nimport { readPublishedPackageNpmManifest } from \"../lib/publishedPackage\";\r\nimport { determineWorkspaceIGLibraries } from \"../lib/dependencies\";\r\n\r\nconst DEFINITION_FILE_HINT =\r\n\t\"// This file is automatically managed by the ig.gfx.packager.\";\r\n\r\nexport const executePostInstall = (workspace: WorkspaceLocation) => {\r\n\tconst manifest = readWorkspaceNpmManifest(workspace);\r\n\r\n\tif (manifest === undefined) {\r\n\t\tthrow new Error(`Expected an npm manifest to exist.`);\r\n\t}\r\n\r\n\tconst libPath = getWorkspaceLibPath(workspace);\r\n\r\n\tfs.mkdirSync(libPath, { recursive: true });\r\n\r\n\tconst existingDefinitions = fs.readdirSync(libPath);\r\n\r\n\t// delete all existing definition files that are managed by the packager.\r\n\t// we'll recreate all needed definitions in the next step.\r\n\tfor (const existingDefinitionName of existingDefinitions) {\r\n\t\tconst content = fs.readFileSync(\r\n\t\t\tpath.join(libPath, existingDefinitionName),\r\n\t\t\t{ encoding: \"utf-8\" },\r\n\t\t);\r\n\r\n\t\tif (content.startsWith(DEFINITION_FILE_HINT)) {\r\n\t\t\tfs.rmSync(path.join(libPath, existingDefinitionName));\r\n\t\t}\r\n\t}\r\n\r\n\tconst libraryLocations = determineWorkspaceIGLibraries(workspace);\r\n\r\n\tfor (const location of libraryLocations) {\r\n\t\tconst manifest = readPublishedPackageNpmManifest(location);\r\n\r\n\t\t// add a hint to the top of the file so we know it's managed by the packager.\r\n\t\tconst content = `${DEFINITION_FILE_HINT}\r\n// This is a reference to version ${manifest.version}.\r\n// Run \"npm install\" to install the types if they are missing or not up to date.\r\n/// <reference types=\"${manifest.name}\" />`;\r\n\r\n\t\tfs.writeFileSync(\r\n\t\t\tpath.join(getWorkspaceLibPath(workspace), manifest.types),\r\n\t\t\tcontent,\r\n\t\t\t{\r\n\t\t\t\tencoding: \"utf8\",\r\n\t\t\t},\r\n\t\t);\r\n\t}\r\n};\r\n"],"names":["DEFINITION_FILE_HINT","executePostInstall","workspace","manifest","readWorkspaceNpmManifest","undefined","Error","libPath","getWorkspaceLibPath","fs","mkdirSync","recursive","existingDefinitions","readdirSync","existingDefinitionName","content","readFileSync","path","join","encoding","startsWith","rmSync","libraryLocations","determineWorkspaceIGLibraries","location","readPublishedPackageNpmManifest","version","name","writeFileSync","types"],"mappings":";;;;;;;;;;;;;AAWA,MAAMA,oBAAoB,GACzB,+DAA+D,CAAA;AAEnDC,MAAAA,kBAAkB,GAAIC,SAA4B,IAAK;AACnE,EAAA,MAAMC,QAAQ,GAAGC,wBAAwB,CAACF,SAAS,CAAC,CAAA;EAEpD,IAAIC,QAAQ,KAAKE,SAAS,EAAE;AAC3B,IAAA,MAAM,IAAIC,KAAK,CAAE,CAAA,kCAAA,CAAmC,CAAC,CAAA;AACtD,GAAA;AAEA,EAAA,MAAMC,OAAO,GAAGC,mBAAmB,CAACN,SAAS,CAAC,CAAA;AAE9CO,EAAAA,EAAE,CAACC,SAAS,CAACH,OAAO,EAAE;AAAEI,IAAAA,SAAS,EAAE,IAAA;AAAK,GAAC,CAAC,CAAA;AAE1C,EAAA,MAAMC,mBAAmB,GAAGH,EAAE,CAACI,WAAW,CAACN,OAAO,CAAC,CAAA;;AAEnD;AACA;AACA,EAAA,KAAK,MAAMO,sBAAsB,IAAIF,mBAAmB,EAAE;AACzD,IAAA,MAAMG,OAAO,GAAGN,EAAE,CAACO,YAAY,CAC9BC,IAAI,CAACC,IAAI,CAACX,OAAO,EAAEO,sBAAsB,CAAC,EAC1C;AAAEK,MAAAA,QAAQ,EAAE,OAAA;AAAQ,KAAC,CACrB,CAAA;AAED,IAAA,IAAIJ,OAAO,CAACK,UAAU,CAACpB,oBAAoB,CAAC,EAAE;MAC7CS,EAAE,CAACY,MAAM,CAACJ,IAAI,CAACC,IAAI,CAACX,OAAO,EAAEO,sBAAsB,CAAC,CAAC,CAAA;AACtD,KAAA;AACD,GAAA;AAEA,EAAA,MAAMQ,gBAAgB,GAAGC,6BAA6B,CAACrB,SAAS,CAAC,CAAA;AAEjE,EAAA,KAAK,MAAMsB,QAAQ,IAAIF,gBAAgB,EAAE;AACxC,IAAA,MAAMnB,QAAQ,GAAGsB,+BAA+B,CAACD,QAAQ,CAAC,CAAA;;AAE1D;IACA,MAAMT,OAAO,GAAI,CAAA,EAAEf,oBAAqB,CAAA;AAC1C,kCAAoCG,EAAAA,QAAQ,CAACuB,OAAQ,CAAA;AACrD;AACA,sBAAwBvB,EAAAA,QAAQ,CAACwB,IAAK,CAAK,IAAA,CAAA,CAAA;AAEzClB,IAAAA,EAAE,CAACmB,aAAa,CACfX,IAAI,CAACC,IAAI,CAACV,mBAAmB,CAACN,SAAS,CAAC,EAAEC,QAAQ,CAAC0B,KAAK,CAAC,EACzDd,OAAO,EACP;AACCI,MAAAA,QAAQ,EAAE,MAAA;AACX,KAAC,CACD,CAAA;AACF,GAAA;AACD;;;;"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import { spawnSync } from 'child_process';
|
|
5
|
-
import { f as readWorkspaceNpmManifest, g as getWorkspaceOutputPath, r as readPackageCreatorManifest, b as readPackageNpmManifest, m as writePackageNpmManifest, e as readPackageCreatorIndex, n as iterateWorkspacePackages } from '
|
|
6
|
-
import { p as parseVersionFromString, g as getVersionFileHandler, a as getVersionInformationFromGit, b as getWorkspaceBannerText } from '
|
|
7
|
-
import { b as buildFolders, l as logPackageMessage } from './
|
|
5
|
+
import { f as readWorkspaceNpmManifest, g as getWorkspaceOutputPath, r as readPackageCreatorManifest, b as readPackageNpmManifest, m as writePackageNpmManifest, P as PACKAGE_FILE, e as readPackageCreatorIndex, I as INDEX_FILE, n as iterateWorkspacePackages } from './cli.mjs';
|
|
6
|
+
import { p as parseVersionFromString, g as getVersionFileHandler, a as getVersionInformationFromGit, b as getWorkspaceBannerText } from './versionFile.mjs';
|
|
7
|
+
import { b as buildFolders, l as logPackageMessage } from './index2.mjs';
|
|
8
8
|
import 'update-notifier';
|
|
9
9
|
import 'yargs/yargs';
|
|
10
10
|
import 'url';
|
|
@@ -15,7 +15,7 @@ import 'simple-git';
|
|
|
15
15
|
import 'glob';
|
|
16
16
|
import 'terser';
|
|
17
17
|
import 'typescript';
|
|
18
|
-
import '
|
|
18
|
+
import './scripts.mjs';
|
|
19
19
|
import 'typedoc';
|
|
20
20
|
|
|
21
21
|
const publishToNpm = async ({
|
|
@@ -93,10 +93,10 @@ const publishToNpm = async ({
|
|
|
93
93
|
fs.copyFileSync(path.join(getWorkspaceOutputPath(workspace), `${creatorPackage.Package}.d.ts`), path.join(publishDir, `${creatorPackage.Package}.d.ts`));
|
|
94
94
|
fs.copyFileSync(path.join(getWorkspaceOutputPath(workspace), `${creatorPackage.Package}.min.js`), path.join(publishDir, `${creatorPackage.Package}.js`));
|
|
95
95
|
fs.copyFileSync(path.join(location.manifestDir, "package.json"), path.join(publishDir, "package.json"));
|
|
96
|
-
fs.writeFileSync(path.join(publishDir,
|
|
96
|
+
fs.writeFileSync(path.join(publishDir, PACKAGE_FILE), JSON.stringify(creatorPackage, null, 2));
|
|
97
97
|
const index = readPackageCreatorIndex(location);
|
|
98
98
|
if (index !== undefined) {
|
|
99
|
-
fs.writeFileSync(path.join(publishDir,
|
|
99
|
+
fs.writeFileSync(path.join(publishDir, INDEX_FILE), JSON.stringify(index));
|
|
100
100
|
}
|
|
101
101
|
const readmeName = fs.readdirSync(location.path).find(name => name.toLowerCase() === "readme.md");
|
|
102
102
|
if (readmeName !== undefined) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishNpm.mjs","sources":["../src/commands/publishNpm.ts"],"sourcesContent":["import * as path from \"path\";\r\nimport * as fs from \"fs\";\r\nimport { spawnSync } from \"child_process\";\r\n\r\nimport { PackageVersion } from \"../lib/packageVersion\";\r\nimport {\r\n\tINDEX_FILE,\r\n\tPackageLocation,\r\n\tPACKAGE_FILE,\r\n\treadPackageCreatorIndex,\r\n\treadPackageCreatorManifest,\r\n\treadPackageNpmManifest,\r\n\twritePackageNpmManifest,\r\n} from \"../lib/package\";\r\nimport {\r\n\tgetWorkspaceOutputPath,\r\n\titerateWorkspacePackages,\r\n\treadWorkspaceNpmManifest,\r\n\tWorkspaceLocation,\r\n} from \"../lib/workspace\";\r\nimport { getVersionInformationFromGit } from \"../lib/git\";\r\nimport { getWorkspaceBannerText } from \"../lib/banner\";\r\nimport { parseVersionFromString } from \"../lib/parseVersion\";\r\nimport { getVersionFileHandler } from \"../lib/versionFile\";\r\nimport { logPackageMessage } from \"../lib/log\";\r\n\r\nimport { buildFolders } from \"./build\";\r\n\r\nexport interface PublishToNpmSettings {\r\n\tworkspace: WorkspaceLocation;\r\n\tlocation: PackageLocation;\r\n\tversion: string;\r\n\tdryRun?: boolean;\r\n}\r\n\r\nexport const publishToNpm = async ({\r\n\tworkspace,\r\n\tlocation,\r\n\tversion: providedVersion,\r\n\tdryRun,\r\n}: PublishToNpmSettings) => {\r\n\tlet newVersion: PackageVersion;\r\n\ttry {\r\n\t\tnewVersion = parseVersionFromString(providedVersion);\r\n\t} catch (err) {\r\n\t\tthrow new Error(`Please enter a version in this format 1.0.0.100`);\r\n\t}\r\n\r\n\tif (newVersion.buildNumber < 100) {\r\n\t\tnewVersion.preRelease = {\r\n\t\t\ttype: \"beta\",\r\n\t\t\tversion: newVersion.buildNumber,\r\n\t\t};\r\n\t} else if (newVersion.buildNumber === 100) {\r\n\t\tnewVersion.preRelease = undefined;\r\n\t} else {\r\n\t\tthrow new Error(\r\n\t\t\t`Refusing to publish a package with a build version larger than 100.`,\r\n\t\t);\r\n\t}\r\n\r\n\tconst workspaceManifest = readWorkspaceNpmManifest(workspace);\r\n\tconst workspaceOutputPath = getWorkspaceOutputPath(workspace);\r\n\tconst creatorPackage = readPackageCreatorManifest(location);\r\n\tlet packageJson = readPackageNpmManifest(location);\r\n\r\n\tif (packageJson === undefined) {\r\n\t\tpackageJson = {\r\n\t\t\tname:\r\n\t\t\t\t\"@intelligentgraphics/3d\" +\r\n\t\t\t\tcreatorPackage.Package.toLowerCase(),\r\n\t\t\tversion: \"1.0.0\",\r\n\t\t\tdescription: creatorPackage.Package,\r\n\t\t};\r\n\t}\r\n\r\n\tpackageJson.version = newVersion.toVersionString({\r\n\t\tbuildNumber: false,\r\n\t});\r\n\tpackageJson.description = newVersion.toDescriptionString(\r\n\t\tcreatorPackage.Package,\r\n\t);\r\n\tpackageJson.main = `${creatorPackage.Package}.js`;\r\n\tpackageJson.types = `${creatorPackage.Package}.d.ts`;\r\n\tpackageJson.publishConfig ??= {};\r\n\tpackageJson.publishConfig.acccess = \"public\";\r\n\tpackageJson.ig = {\r\n\t\tscriptingLibrary: true,\r\n\t};\r\n\tpackageJson.files = undefined;\r\n\r\n\tconst publishDir = path.join(\r\n\t\tworkspaceOutputPath,\r\n\t\t\"publish\",\r\n\t\tcreatorPackage.Package,\r\n\t);\r\n\tfs.rmSync(publishDir, { recursive: true, force: true });\r\n\tfs.mkdirSync(publishDir, { recursive: true });\r\n\r\n\twritePackageNpmManifest(location, packageJson);\r\n\r\n\tgetVersionFileHandler(location).write(creatorPackage.Package, newVersion);\r\n\r\n\tconst gitVersionInformation = await getVersionInformationFromGit(\r\n\t\tworkspace,\r\n\t\tlocation,\r\n\t);\r\n\r\n\tconst bannerText =\r\n\t\tworkspaceManifest !== undefined\r\n\t\t\t? getWorkspaceBannerText(workspaceManifest)\r\n\t\t\t: undefined;\r\n\r\n\tawait buildFolders({\r\n\t\tcwd: workspace.path,\r\n\t\tdirectories: [location.path],\r\n\t\tminimize: true,\r\n\t\toutDir: getWorkspaceOutputPath(workspace),\r\n\t\tbanner: {\r\n\t\t\ttext: bannerText,\r\n\t\t\tcommit: gitVersionInformation.commit,\r\n\t\t\tcommitDirty: gitVersionInformation.dirty,\r\n\t\t\tversion: newVersion.toVersionString({\r\n\t\t\t\tbuildNumber: true,\r\n\t\t\t}),\r\n\t\t\tdate: new Date(Date.now()),\r\n\t\t},\r\n\t});\r\n\r\n\tfs.copyFileSync(\r\n\t\tpath.join(\r\n\t\t\tgetWorkspaceOutputPath(workspace),\r\n\t\t\t`${creatorPackage.Package}.d.ts`,\r\n\t\t),\r\n\t\tpath.join(publishDir, `${creatorPackage.Package}.d.ts`),\r\n\t);\r\n\tfs.copyFileSync(\r\n\t\tpath.join(\r\n\t\t\tgetWorkspaceOutputPath(workspace),\r\n\t\t\t`${creatorPackage.Package}.min.js`,\r\n\t\t),\r\n\t\tpath.join(publishDir, `${creatorPackage.Package}.js`),\r\n\t);\r\n\r\n\tfs.copyFileSync(\r\n\t\tpath.join(location.manifestDir, \"package.json\"),\r\n\t\tpath.join(publishDir, \"package.json\"),\r\n\t);\r\n\r\n\tfs.writeFileSync(\r\n\t\tpath.join(publishDir, PACKAGE_FILE),\r\n\t\tJSON.stringify(creatorPackage, null, 2),\r\n\t);\r\n\r\n\tconst index = readPackageCreatorIndex(location);\r\n\r\n\tif (index !== undefined) {\r\n\t\tfs.writeFileSync(\r\n\t\t\tpath.join(publishDir, INDEX_FILE),\r\n\t\t\tJSON.stringify(index),\r\n\t\t);\r\n\t}\r\n\r\n\tconst readmeName = fs\r\n\t\t.readdirSync(location.path)\r\n\t\t.find((name) => name.toLowerCase() === \"readme.md\");\r\n\r\n\tif (readmeName !== undefined) {\r\n\t\tfs.copyFileSync(\r\n\t\t\tpath.join(location.path, readmeName),\r\n\t\t\tpath.join(publishDir, readmeName),\r\n\t\t);\r\n\t}\r\n\r\n\tconst npmPublishArgs: string[] = [];\r\n\r\n\tif (dryRun) {\r\n\t\tnpmPublishArgs.push(\"--dry-run\");\r\n\t}\r\n\r\n\tif (newVersion.preRelease) {\r\n\t\tnpmPublishArgs.push(\"--tag\", \"next\");\r\n\t}\r\n\r\n\tlogPackageMessage(\r\n\t\tcreatorPackage.Package,\r\n\t\t`Publishing to npm with version ${packageJson.version} using tag ${\r\n\t\t\tnewVersion.preRelease ? \"next\" : \"latest\"\r\n\t\t}`,\r\n\t);\r\n\r\n\tspawnSync(\"npm\", [\"publish\", ...npmPublishArgs], {\r\n\t\tstdio: \"inherit\",\r\n\t\tencoding: \"utf8\",\r\n\t\tcwd: publishDir,\r\n\t});\r\n\r\n\tfor (const packageLocation of iterateWorkspacePackages(workspace)) {\r\n\t\tconst manifest = readPackageNpmManifest(packageLocation);\r\n\r\n\t\tif (manifest?.dependencies?.[packageJson.name] !== undefined) {\r\n\t\t\tmanifest.dependencies[packageJson.name] = \"^\" + packageJson.version;\r\n\t\t\twritePackageNpmManifest(packageLocation, manifest);\r\n\t\t}\r\n\t}\r\n};\r\n"],"names":["publishToNpm","workspace","location","version","providedVersion","dryRun","newVersion","parseVersionFromString","err","Error","buildNumber","preRelease","type","undefined","workspaceManifest","readWorkspaceNpmManifest","workspaceOutputPath","getWorkspaceOutputPath","creatorPackage","readPackageCreatorManifest","packageJson","readPackageNpmManifest","name","Package","toLowerCase","description","toVersionString","toDescriptionString","main","types","publishConfig","acccess","ig","scriptingLibrary","files","publishDir","path","join","fs","rmSync","recursive","force","mkdirSync","writePackageNpmManifest","getVersionFileHandler","write","gitVersionInformation","getVersionInformationFromGit","bannerText","getWorkspaceBannerText","buildFolders","cwd","directories","minimize","outDir","banner","text","commit","commitDirty","dirty","date","Date","now","copyFileSync","manifestDir","writeFileSync","PACKAGE_FILE","JSON","stringify","index","readPackageCreatorIndex","INDEX_FILE","readmeName","readdirSync","find","npmPublishArgs","push","logPackageMessage","spawnSync","stdio","encoding","packageLocation","iterateWorkspacePackages","manifest","dependencies"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmCO,MAAMA,YAAY,GAAG,OAAO;EAClCC,SAAS;EACTC,QAAQ;AACRC,EAAAA,OAAO,EAAEC,eAAe;AACxBC,EAAAA,MAAAA;AACqB,CAAC,KAAK;AAC3B,EAAA,IAAIC,UAA0B,CAAA;EAC9B,IAAI;AACHA,IAAAA,UAAU,GAAGC,sBAAsB,CAACH,eAAe,CAAC,CAAA;GACpD,CAAC,OAAOI,GAAG,EAAE;AACb,IAAA,MAAM,IAAIC,KAAK,CAAE,CAAA,+CAA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SAAS;AAChBC,IAAAA,QAAQ,EAAE,MAAM;AAChB7B,IAAAA,GAAG,EAAEhB,UAAAA;AACN,GAAC,CAAC,CAAA;AAEF,EAAA,KAAK,MAAM8C,eAAe,IAAIC,wBAAwB,CAACjF,SAAS,CAAC,EAAE;AAAA,IAAA,IAAA,qBAAA,CAAA;AAClE,IAAA,MAAMkF,QAAQ,GAAG9D,sBAAsB,CAAC4D,eAAe,CAAC,CAAA;AAExD,IAAA,IAAI,CAAAE,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,CAAA,qBAAA,GAARA,QAAQ,CAAEC,YAAY,MAAtB,IAAA,IAAA,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,qBAAA,CAAyBhE,WAAW,CAACE,IAAI,CAAC,MAAKT,SAAS,EAAE;AAC7DsE,MAAAA,QAAQ,CAACC,YAAY,CAAChE,WAAW,CAACE,IAAI,CAAC,GAAG,GAAG,GAAGF,WAAW,CAACjB,OAAO,CAAA;AACnEwC,MAAAA,uBAAuB,CAACsC,eAAe,EAAEE,QAAQ,CAAC,CAAA;AACnD,KAAA;AACD,GAAA;AACD;;;;"}
|
package/build/scripts.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scripts.mjs","sources":["../src/lib/scripts.ts"],"sourcesContent":["import glob from \"glob\";\n\nimport { PackageLocation } from \"./package\";\n\nexport const getPackageTypescriptFiles = (location: PackageLocation) =>\n\tglob.sync(\"**/*.ts\", {\n\t\tabsolute: true,\n\t\tcwd: location.scriptsDir,\n\t\tignore: \"node_modules/**/*\",\n\t});\n"],"names":["getPackageTypescriptFiles","location","glob","sync","absolute","cwd","scriptsDir","ignore"],"mappings":";;;AAIO,MAAMA,yBAAyB,GAAIC,QAAyB,IAClEC,IAAI,CAACC,IAAI,CAAC,SAAS,EAAE;AACpBC,EAAAA,QAAQ,EAAE,IAAI;EACdC,GAAG,EAAEJ,QAAQ,CAACK,UAAU;AACxBC,EAAAA,MAAM,EAAE,mBAAA;AACT,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"scripts.mjs","sources":["../src/lib/scripts.ts"],"sourcesContent":["import glob from \"glob\";\r\n\r\nimport { PackageLocation } from \"./package\";\r\n\r\nexport const getPackageTypescriptFiles = (location: PackageLocation) =>\r\n\tglob.sync(\"**/*.ts\", {\r\n\t\tabsolute: true,\r\n\t\tcwd: location.scriptsDir,\r\n\t\tignore: \"node_modules/**/*\",\r\n\t});\r\n"],"names":["getPackageTypescriptFiles","location","glob","sync","absolute","cwd","scriptsDir","ignore"],"mappings":";;;AAIO,MAAMA,yBAAyB,GAAIC,QAAyB,IAClEC,IAAI,CAACC,IAAI,CAAC,SAAS,EAAE;AACpBC,EAAAA,QAAQ,EAAE,IAAI;EACdC,GAAG,EAAEJ,QAAQ,CAACK,UAAU;AACxBC,EAAAA,MAAM,EAAE,mBAAA;AACT,CAAC;;;;"}
|
package/build/versionFile.mjs
CHANGED
|
@@ -202,21 +202,21 @@ class PackageVersion {
|
|
|
202
202
|
return parts.join(" ");
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
/**
|
|
206
|
-
* Determines wether the version is lesser than the input version
|
|
207
|
-
*
|
|
208
|
-
* @param {PackageVersion} version
|
|
209
|
-
* @returns
|
|
205
|
+
/**
|
|
206
|
+
* Determines wether the version is lesser than the input version
|
|
207
|
+
*
|
|
208
|
+
* @param {PackageVersion} version
|
|
209
|
+
* @returns
|
|
210
210
|
*/
|
|
211
211
|
isLesserThan(version) {
|
|
212
212
|
return PackageVersion.toNumber(this) < PackageVersion.toNumber(version);
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
/**
|
|
216
|
-
* Determines wether the version is greater than the input version
|
|
217
|
-
*
|
|
218
|
-
* @param {PackageVersion} version
|
|
219
|
-
* @returns
|
|
215
|
+
/**
|
|
216
|
+
* Determines wether the version is greater than the input version
|
|
217
|
+
*
|
|
218
|
+
* @param {PackageVersion} version
|
|
219
|
+
* @returns
|
|
220
220
|
*/
|
|
221
221
|
isGreaterThan(version) {
|
|
222
222
|
return PackageVersion.toNumber(this) > PackageVersion.toNumber(version);
|