@intelligentgraphics/ig.gfx.packager 3.0.3 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli-5332deff.js +2486 -0
- package/build/cli-5332deff.js.map +1 -0
- package/build/{lib/dependencies.mjs → dependencies-227aca50.js} +62 -4
- package/build/dependencies-227aca50.js.map +1 -0
- package/build/{commands/generate.mjs → generate-a3a16031.js} +17 -3
- package/build/generate-a3a16031.js.map +1 -0
- package/build/{commands/publish/index.mjs → index-5d595f56.js} +181 -16
- package/build/index-5d595f56.js.map +1 -0
- package/build/{commands/build/index.mjs → index-92b6ba5c.js} +151 -8
- package/build/index-92b6ba5c.js.map +1 -0
- package/build/index.mjs +1 -1
- package/build/index.mjs.map +1 -1
- package/build/{commands/postinstall.mjs → postinstall-7e50da37.js} +18 -8
- package/build/postinstall-7e50da37.js.map +1 -0
- package/build/{commands/publishNpm.mjs → publishNpm-e2c8347f.js} +21 -9
- package/build/publishNpm-e2c8347f.js.map +1 -0
- package/build/versionFile-b3a65dc8.js +370 -0
- package/build/versionFile-b3a65dc8.js.map +1 -0
- package/package.json +8 -7
- package/readme.md +16 -3
- package/build/cli.mjs +0 -313
- package/build/cli.mjs.map +0 -1
- package/build/commands/build/docs.mjs +0 -34
- package/build/commands/build/docs.mjs.map +0 -1
- package/build/commands/build/index.mjs.map +0 -1
- package/build/commands/build/tsc.mjs +0 -84
- package/build/commands/build/tsc.mjs.map +0 -1
- package/build/commands/generate.mjs.map +0 -1
- package/build/commands/postinstall.mjs.map +0 -1
- package/build/commands/publish/index.mjs.map +0 -1
- package/build/commands/publish/zip.mjs +0 -168
- package/build/commands/publish/zip.mjs.map +0 -1
- package/build/commands/publishNpm.mjs.map +0 -1
- package/build/lib/assetService.mjs +0 -111
- package/build/lib/assetService.mjs.map +0 -1
- package/build/lib/banner.mjs +0 -20
- package/build/lib/banner.mjs.map +0 -1
- package/build/lib/dependencies.mjs.map +0 -1
- package/build/lib/error.mjs +0 -15
- package/build/lib/error.mjs.map +0 -1
- package/build/lib/fs.mjs +0 -19
- package/build/lib/fs.mjs.map +0 -1
- package/build/lib/git.mjs +0 -37
- package/build/lib/git.mjs.map +0 -1
- package/build/lib/log.mjs +0 -9
- package/build/lib/log.mjs.map +0 -1
- package/build/lib/npmPackage.mjs +0 -19
- package/build/lib/npmPackage.mjs.map +0 -1
- package/build/lib/package.mjs +0 -129
- package/build/lib/package.mjs.map +0 -1
- package/build/lib/packageVersion.mjs +0 -174
- package/build/lib/packageVersion.mjs.map +0 -1
- package/build/lib/parseVersion.mjs +0 -54
- package/build/lib/parseVersion.mjs.map +0 -1
- package/build/lib/prompter.mjs +0 -31
- package/build/lib/prompter.mjs.map +0 -1
- package/build/lib/publishedPackage.mjs +0 -66
- package/build/lib/publishedPackage.mjs.map +0 -1
- package/build/lib/scripts.mjs +0 -10
- package/build/lib/scripts.mjs.map +0 -1
- package/build/lib/stripUtf8Bom.mjs +0 -11
- package/build/lib/stripUtf8Bom.mjs.map +0 -1
- package/build/lib/toposort.mjs +0 -26
- package/build/lib/toposort.mjs.map +0 -1
- package/build/lib/versionFile.mjs +0 -78
- package/build/lib/versionFile.mjs.map +0 -1
- package/build/lib/workspace.mjs +0 -51
- package/build/lib/workspace.mjs.map +0 -1
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
import { isErrorENOENT } from './error.mjs';
|
|
4
|
-
import { readStringFromFileOrUndefined } from './fs.mjs';
|
|
5
|
-
|
|
6
|
-
// https://regex101.com/r/LtGAu5/1
|
|
7
|
-
const logRegex = /console\.log\(\s*"([\w\s\.\(\)]+)\ *Copyright[\w\s\(\)\.]+(\d{4}|\d{4} - \d{4})([\w\s\(\)\.]+)?",?\s*\)/i;
|
|
8
|
-
const currentYear = new Date(Date.now()).getFullYear();
|
|
9
|
-
const getVersionFileHandler = location => {
|
|
10
|
-
const filePath = path.join(location.scriptsDir, "Version.ts");
|
|
11
|
-
const invalidVersionFile = versionFile => ({
|
|
12
|
-
version: undefined,
|
|
13
|
-
write: (name, newVersion) => {
|
|
14
|
-
const scriptsContent = fs.readdirSync(location.scriptsDir);
|
|
15
|
-
const tsFiles = scriptsContent.filter(file => file.endsWith(".ts"));
|
|
16
|
-
if (tsFiles.length > 0) {
|
|
17
|
-
return createVersionFileWriter([currentYear], "")(name, newVersion);
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
reset: () => {
|
|
21
|
-
if (versionFile !== undefined) {
|
|
22
|
-
fs.writeFileSync(filePath, versionFile, {
|
|
23
|
-
encoding: "utf8"
|
|
24
|
-
});
|
|
25
|
-
} else {
|
|
26
|
-
try {
|
|
27
|
-
fs.rmSync(filePath);
|
|
28
|
-
} catch (err) {
|
|
29
|
-
if (!isErrorENOENT(err)) {
|
|
30
|
-
throw err;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
const createVersionFileWriter = (copyright = [currentYear], copyrightStuff = "") => (name, newVersion) => {
|
|
37
|
-
const descriptionText = newVersion.toDescriptionString(name);
|
|
38
|
-
const copyrightText = createYearString(copyright);
|
|
39
|
-
const result = `console.log("${descriptionText}. Copyright (C) ${copyrightText}${copyrightStuff}");`;
|
|
40
|
-
fs.writeFileSync(filePath, result, {
|
|
41
|
-
encoding: "utf-8"
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
let rawVersionFile = readStringFromFileOrUndefined(filePath);
|
|
45
|
-
if (rawVersionFile === undefined) {
|
|
46
|
-
return invalidVersionFile(rawVersionFile);
|
|
47
|
-
}
|
|
48
|
-
const versionFile = rawVersionFile.replace(/\n/g, "");
|
|
49
|
-
const match = versionFile.match(logRegex);
|
|
50
|
-
if (!match) {
|
|
51
|
-
return invalidVersionFile(versionFile);
|
|
52
|
-
}
|
|
53
|
-
const [_full, _description, copyright, copyrightStuff] = match;
|
|
54
|
-
const copyrightYears = copyright.match(/^(\d+)( ?- ?(\d+))?$/);
|
|
55
|
-
let years;
|
|
56
|
-
if (copyrightYears === null) {
|
|
57
|
-
years = [currentYear];
|
|
58
|
-
} else {
|
|
59
|
-
years = [Number(copyrightYears[1]), currentYear];
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
write: createVersionFileWriter(years, copyrightStuff),
|
|
63
|
-
reset: () => {
|
|
64
|
-
fs.writeFileSync(filePath, versionFile, {
|
|
65
|
-
encoding: "utf8"
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
const createYearString = years => {
|
|
71
|
-
if (years[1] === undefined || years[0] === years[1]) {
|
|
72
|
-
return years[0].toString();
|
|
73
|
-
}
|
|
74
|
-
return `${years[0]} - ${years[1]}`;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export { getVersionFileHandler };
|
|
78
|
-
//# sourceMappingURL=versionFile.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"versionFile.mjs","sources":["../../src/lib/versionFile.ts"],"sourcesContent":["import * as fs from \"fs\";\nimport * as path from \"path\";\n\nimport { isErrorENOENT } from \"./error\";\nimport { readStringFromFileOrUndefined } from \"./fs\";\nimport { PackageLocation } from \"./package\";\nimport { PackageVersion } from \"./packageVersion\";\n\n// https://regex101.com/r/LtGAu5/1\nconst logRegex =\n\t/console\\.log\\(\\s*\"([\\w\\s\\.\\(\\)]+)\\ *Copyright[\\w\\s\\(\\)\\.]+(\\d{4}|\\d{4} - \\d{4})([\\w\\s\\(\\)\\.]+)?\",?\\s*\\)/i;\nconst currentYear = new Date(Date.now()).getFullYear();\n\nexport const getVersionFileHandler = (location: PackageLocation) => {\n\tconst filePath = path.join(location.scriptsDir, \"Version.ts\");\n\n\tconst invalidVersionFile = (versionFile: string | undefined) => ({\n\t\tversion: undefined,\n\t\twrite: (name: string, newVersion: PackageVersion) => {\n\t\t\tconst scriptsContent = fs.readdirSync(location.scriptsDir);\n\t\t\tconst tsFiles = scriptsContent.filter((file) =>\n\t\t\t\tfile.endsWith(\".ts\"),\n\t\t\t);\n\n\t\t\tif (tsFiles.length > 0) {\n\t\t\t\treturn createVersionFileWriter([currentYear], \"\")(\n\t\t\t\t\tname,\n\t\t\t\t\tnewVersion,\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\treset: () => {\n\t\t\tif (versionFile !== undefined) {\n\t\t\t\tfs.writeFileSync(filePath, versionFile, { encoding: \"utf8\" });\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tfs.rmSync(filePath);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (!isErrorENOENT(err)) {\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n\n\ttype CopyrightRange = [number, number?];\n\n\tconst createVersionFileWriter =\n\t\t(\n\t\t\tcopyright: CopyrightRange = [currentYear],\n\t\t\tcopyrightStuff: string = \"\",\n\t\t) =>\n\t\t(name: string, newVersion: PackageVersion) => {\n\t\t\tconst descriptionText = newVersion.toDescriptionString(name);\n\t\t\tconst copyrightText = createYearString(copyright);\n\n\t\t\tconst result = `console.log(\"${descriptionText}. Copyright (C) ${copyrightText}${copyrightStuff}\");`;\n\n\t\t\tfs.writeFileSync(filePath, result, { encoding: \"utf-8\" });\n\t\t};\n\n\tlet rawVersionFile = readStringFromFileOrUndefined(filePath);\n\n\tif (rawVersionFile === undefined) {\n\t\treturn invalidVersionFile(rawVersionFile);\n\t}\n\n\tconst versionFile = rawVersionFile.replace(/\\n/g, \"\");\n\n\tconst match = versionFile.match(logRegex);\n\n\tif (!match) {\n\t\treturn invalidVersionFile(versionFile);\n\t}\n\n\tconst [_full, _description, copyright, copyrightStuff] = match as [\n\t\tstring,\n\t\tstring,\n\t\tstring,\n\t\tstring?,\n\t];\n\n\tconst copyrightYears = copyright.match(/^(\\d+)( ?- ?(\\d+))?$/);\n\n\tlet years: [number, number?];\n\n\tif (copyrightYears === null) {\n\t\tyears = [currentYear];\n\t} else {\n\t\tyears = [Number(copyrightYears[1]), currentYear];\n\t}\n\n\treturn {\n\t\twrite: createVersionFileWriter(years, copyrightStuff),\n\t\treset: () => {\n\t\t\tfs.writeFileSync(filePath, versionFile, { encoding: \"utf8\" });\n\t\t},\n\t};\n};\n\nconst createYearString = (years: [number, number?]) => {\n\tif (years[1] === undefined || years[0] === years[1]) {\n\t\treturn years[0].toString();\n\t}\n\n\treturn `${years[0]} - ${years[1]}`;\n};\n"],"names":["logRegex","currentYear","Date","now","getFullYear","getVersionFileHandler","location","filePath","path","join","scriptsDir","invalidVersionFile","versionFile","version","undefined","write","name","newVersion","scriptsContent","fs","readdirSync","tsFiles","filter","file","endsWith","length","createVersionFileWriter","reset","writeFileSync","encoding","rmSync","err","isErrorENOENT","copyright","copyrightStuff","descriptionText","toDescriptionString","copyrightText","createYearString","result","rawVersionFile","readStringFromFileOrUndefined","replace","match","_full","_description","copyrightYears","years","Number","toString"],"mappings":";;;;;AAQA;AACA,MAAMA,QAAQ,GACb,0GAA0G,CAAA;AAC3G,MAAMC,WAAW,GAAG,IAAIC,IAAI,CAACA,IAAI,CAACC,GAAG,EAAE,CAAC,CAACC,WAAW,EAAE,CAAA;AAEzCC,MAAAA,qBAAqB,GAAIC,QAAyB,IAAK;EACnE,MAAMC,QAAQ,GAAGC,IAAI,CAACC,IAAI,CAACH,QAAQ,CAACI,UAAU,EAAE,YAAY,CAAC,CAAA;EAE7D,MAAMC,kBAAkB,GAAIC,WAA+B,KAAM;AAChEC,IAAAA,OAAO,EAAEC,SAAS;AAClBC,IAAAA,KAAK,EAAE,CAACC,IAAY,EAAEC,UAA0B,KAAK;MACpD,MAAMC,cAAc,GAAGC,EAAE,CAACC,WAAW,CAACd,QAAQ,CAACI,UAAU,CAAC,CAAA;AAC1D,MAAA,MAAMW,OAAO,GAAGH,cAAc,CAACI,MAAM,CAAEC,IAAI,IAC1CA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C,CAAC,CAAC,KAAKA,KAAK,CAAC,CAAC,CAAC,EAAE;AACpD,IAAA,OAAOA,KAAK,CAAC,CAAC,CAAC,CAACE,QAAQ,EAAE,CAAA;AAC3B,GAAA;EAEA,OAAQ,CAAA,EAAEF,KAAK,CAAC,CAAC,CAAE,MAAKA,KAAK,CAAC,CAAC,CAAE,CAAC,CAAA,CAAA;AACnC,CAAC;;;;"}
|
package/build/lib/workspace.mjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as path from 'path';
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
import { isErrorENOENT } from './error.mjs';
|
|
4
|
-
import { readNpmManifest, writeNpmManifest } from './npmPackage.mjs';
|
|
5
|
-
import { detectPackage } from './package.mjs';
|
|
6
|
-
|
|
7
|
-
// Functionality related to working with a workspace consisting of multiple packages.
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Describe the location of a workspace constining of n packages.
|
|
11
|
-
*
|
|
12
|
-
* @export
|
|
13
|
-
* @interface WorkspaceLocation
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
const detectWorkspace = directory => {
|
|
17
|
-
directory = path.resolve(process.cwd(), directory);
|
|
18
|
-
return {
|
|
19
|
-
_kind: "WorkspaceLocation",
|
|
20
|
-
path: directory
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
const readWorkspaceNpmManifest = workspace => {
|
|
24
|
-
try {
|
|
25
|
-
return readNpmManifest(workspace.path);
|
|
26
|
-
} catch (err) {
|
|
27
|
-
if (isErrorENOENT(err)) {
|
|
28
|
-
throw new Error(`Expected a package.json file to exist in ${workspace.path}. See packager readme for instructions on how to create the package.json.`);
|
|
29
|
-
}
|
|
30
|
-
throw err;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const writeWorkspaceNpmManifest = (workspace, packageJson) => writeNpmManifest(workspace.path, packageJson);
|
|
34
|
-
const getWorkspaceOutputPath = workspace => path.join(workspace.path, "bin");
|
|
35
|
-
const getWorkspaceLibPath = workspace => path.join(workspace.path, "lib");
|
|
36
|
-
function* iterateWorkspacePackages(workspace) {
|
|
37
|
-
const entries = fs.readdirSync(workspace.path, {
|
|
38
|
-
withFileTypes: true
|
|
39
|
-
});
|
|
40
|
-
for (const entry of entries) {
|
|
41
|
-
if (!entry.isDirectory()) {
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
try {
|
|
45
|
-
yield detectPackage(workspace, entry.name);
|
|
46
|
-
} catch {}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { detectWorkspace, getWorkspaceLibPath, getWorkspaceOutputPath, iterateWorkspacePackages, readWorkspaceNpmManifest, writeWorkspaceNpmManifest };
|
|
51
|
-
//# sourceMappingURL=workspace.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.mjs","sources":["../../src/lib/workspace.ts"],"sourcesContent":["// Functionality related to working with a workspace consisting of multiple packages.\n\nimport * as path from \"path\";\nimport * as fs from \"fs\";\n\nimport { PackageJSON } from \"./packageJSON\";\nimport { isErrorENOENT } from \"./error\";\nimport { readNpmManifest, writeNpmManifest } from \"./npmPackage\";\nimport { detectPackage } from \"./package\";\n\n/**\n * Describe the location of a workspace constining of n packages.\n *\n * @export\n * @interface WorkspaceLocation\n */\nexport interface WorkspaceLocation {\n\t_kind: \"WorkspaceLocation\";\n\tpath: string;\n}\n\nexport interface WorkspacePackageJSON extends PackageJSON {\n\tpackager?: { banner?: string };\n}\n\nexport const detectWorkspace = (directory: string): WorkspaceLocation => {\n\tdirectory = path.resolve(process.cwd(), directory);\n\treturn {\n\t\t_kind: \"WorkspaceLocation\",\n\t\tpath: directory,\n\t};\n};\n\nexport const readWorkspaceNpmManifest = (\n\tworkspace: WorkspaceLocation,\n): WorkspacePackageJSON => {\n\ttry {\n\t\treturn readNpmManifest<WorkspacePackageJSON>(workspace.path);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Expected a package.json file to exist in ${workspace.path}. See packager readme for instructions on how to create the package.json.`,\n\t\t\t);\n\t\t}\n\t\tthrow err;\n\t}\n};\n\nexport const writeWorkspaceNpmManifest = <T extends WorkspacePackageJSON>(\n\tworkspace: WorkspaceLocation,\n\tpackageJson: T,\n) => writeNpmManifest(workspace.path, packageJson);\n\nexport const getWorkspaceOutputPath = (workspace: WorkspaceLocation) =>\n\tpath.join(workspace.path, \"bin\");\n\nexport const getWorkspaceLibPath = (workspace: WorkspaceLocation) =>\n\tpath.join(workspace.path, \"lib\");\n\nexport function* iterateWorkspacePackages(workspace: WorkspaceLocation) {\n\tconst entries = fs.readdirSync(workspace.path, { withFileTypes: true });\n\n\tfor (const entry of entries) {\n\t\tif (!entry.isDirectory()) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\tyield detectPackage(workspace, entry.name);\n\t\t} catch {}\n\t}\n}\n"],"names":["detectWorkspace","directory","path","resolve","process","cwd","_kind","readWorkspaceNpmManifest","workspace","readNpmManifest","err","isErrorENOENT","Error","writeWorkspaceNpmManifest","packageJson","writeNpmManifest","getWorkspaceOutputPath","join","getWorkspaceLibPath","iterateWorkspacePackages","entries","fs","readdirSync","withFileTypes","entry","isDirectory","detectPackage","name"],"mappings":";;;;;;AAAA;;AAUA;AACA;AACA;AACA;AACA;AACA;;AAUaA,MAAAA,eAAe,GAAIC,SAAiB,IAAwB;EACxEA,SAAS,GAAGC,IAAI,CAACC,OAAO,CAACC,OAAO,CAACC,GAAG,EAAE,EAAEJ,SAAS,CAAC,CAAA;EAClD,OAAO;AACNK,IAAAA,KAAK,EAAE,mBAAmB;AAC1BJ,IAAAA,IAAI,EAAED,SAAAA;GACN,CAAA;AACF,EAAC;AAEYM,MAAAA,wBAAwB,GACpCC,SAA4B,IACF;EAC1B,IAAI;AACH,IAAA,OAAOC,eAAe,CAAuBD,SAAS,CAACN,IAAI,CAAC,CAAA;GAC5D,CAAC,OA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