@intelligentgraphics/ig.gfx.packager 3.0.0-beta.1 → 3.0.0-beta.3
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 +3 -2
- package/build/cli.mjs.map +1 -1
- package/build/lib/localization.mjs +1 -1
- package/build/lib/localization.mjs.map +1 -1
- package/package.json +2 -2
- package/readme.md +9 -0
package/build/cli.mjs
CHANGED
|
@@ -8,9 +8,10 @@ import { translate } from './lib/localization.mjs';
|
|
|
8
8
|
import { detectPackage } from './lib/package.mjs';
|
|
9
9
|
import { detectWorkspace, readWorkspaceNpmManifest, writeWorkspaceNpmManifest } from './lib/workspace.mjs';
|
|
10
10
|
import { createDefaultPrompter } from './lib/prompter.mjs';
|
|
11
|
-
import pjson from '../package.json';
|
|
12
11
|
|
|
13
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const pjson = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"));
|
|
14
15
|
const captureError = err => {
|
|
15
16
|
console.log("");
|
|
16
17
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -105,7 +106,7 @@ yargsInstance.command("build [directories...]", "Builds the specified directorie
|
|
|
105
106
|
...options
|
|
106
107
|
}) => {
|
|
107
108
|
const workspace = detectWorkspace(options.cwd);
|
|
108
|
-
const folders = resolvePackagesFromArgs(
|
|
109
|
+
const folders = resolvePackagesFromArgs(directories, workspace);
|
|
109
110
|
await preCommandCheck(workspace);
|
|
110
111
|
const {
|
|
111
112
|
buildFolders
|
package/build/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","sources":["../src/cli.ts"],"sourcesContent":["import updateNotifier from \"update-notifier\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport yargs from \"yargs/yargs\";\nimport { fileURLToPath } from \"url\";\nimport glob from \"glob\";\n\nimport { translate } from \"./lib/localization\";\nimport { Authentication } from \"./lib/authentication\";\nimport { detectPackage, PackageLocation } from \"./lib/package\";\nimport {\n\tdetectWorkspace,\n\treadWorkspaceNpmManifest,\n\tWorkspaceLocation,\n\twriteWorkspaceNpmManifest,\n} from \"./lib/workspace\";\nimport type { ReleaseFolderOptions } from \"./commands/publish\";\nimport { createDefaultPrompter } from \"./lib/prompter\";\nimport { PackageJSON } from \"./lib/packageJSON\";\n\nimport pjson from \"../package.json\";\n\nconst __filename = fileURLToPath(import.meta.url);\n\nconst captureError = (err: Error) => {\n\tconsole.log(\"\");\n\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconsole.error(err);\n\t} else {\n\t\tconsole.error(translate(\"messages.error\", err.message));\n\t}\n};\n\nconst buildOptions = {\n\toutDir: {\n\t\tdescription: translate(\"options.outDir.description\"),\n\t\ttype: \"string\",\n\t\tdefault: \"bin\",\n\t\tcoerce: (input: string | undefined | null) =>\n\t\t\tinput === undefined || input === null\n\t\t\t\t? undefined\n\t\t\t\t: path.resolve(process.cwd(), input),\n\t},\n\tminimize: {\n\t\tdescription: translate(\"options.minimize.description\"),\n\t\ttype: \"boolean\",\n\t\tdefault: true,\n\t},\n\tcwd: {\n\t\tdescription: translate(\"options.cwd.description\"),\n\t\ttype: \"string\",\n\t\tdefault: process.cwd(),\n\t},\n\tclean: {\n\t\tdescription: translate(\"options.clean.description\"),\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n\tdocs: {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n} as const;\n\nconst preCommandCheck = async (workspaceLocation: WorkspaceLocation) => {\n\tconst executedLocalPackager =\n\t\tpath.relative(process.cwd(), __filename).indexOf(\"..\") === -1;\n\n\tlet repositoryPackage: PackageJSON | undefined;\n\n\ttry {\n\t\trepositoryPackage = readWorkspaceNpmManifest(workspaceLocation);\n\t} catch (err) {}\n\n\tif (\n\t\trepositoryPackage?.dependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t] ||\n\t\trepositoryPackage?.devDependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t]\n\t) {\n\t\tconst parts = [\"Detected locally installed ig.gfx.packager.\"];\n\n\t\tif (executedLocalPackager) {\n\t\t\tparts.push(\n\t\t\t\t'Run \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.',\n\t\t\t);\n\t\t}\n\t\tparts.push(\n\t\t\t'Run \"npm uninstall @intelligentgraphics/ig.gfx.packager\" to remove the local version.',\n\t\t);\n\n\t\tconsole.error(parts.join(\"\\n\"));\n\t\tprocess.exit(1);\n\t}\n\n\tif (executedLocalPackager) {\n\t\tconsole.error(`Detected locally installed ig.gfx.packager.\nRun \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.\nRun \"npm install\" to get rid of the local packager version.`);\n\t\tprocess.exit(1);\n\t}\n\n\tconst notifier = updateNotifier({\n\t\tpkg: pjson,\n\t\tshouldNotifyInNpmScript: true,\n\t\tupdateCheckInterval: 1000 * 60,\n\t});\n\n\tnotifier.notify({\n\t\tisGlobal: true,\n\t\tdefer: true,\n\t});\n\n\tif (repositoryPackage === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Could not load package.json file in current directory\",\n\t\t);\n\t}\n\n\trepositoryPackage.scripts ??= {};\n\trepositoryPackage.scripts.postinstall = \"packager postinstall\";\n\n\twriteWorkspaceNpmManifest(workspaceLocation, repositoryPackage);\n};\n\nconst yargsInstance = yargs(process.argv.slice(2));\n\nconst resolvePackagesFromArgs = (\n\targs: string[] = [],\n\tworkspace: WorkspaceLocation,\n) => {\n\tconst folders = new Map<string, PackageLocation>();\n\n\tfor (const arg of args) {\n\t\tglob.sync(arg, { cwd: workspace.path, absolute: true }).forEach(\n\t\t\t(folder) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst location = detectPackage(workspace, folder);\n\t\t\t\t\tfolders.set(folder, location);\n\t\t\t\t} catch (err) {}\n\t\t\t},\n\t\t);\n\t}\n\n\treturn Array.from(folders.values());\n};\n\nyargsInstance.command(\n\t\"build [directories...]\",\n\t\"Builds the specified directories\",\n\t(argv) => argv.options(buildOptions),\n\tasync ({ directories = [], ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folders = resolvePackagesFromArgs(\n\t\t\toptions.directories as string[],\n\t\t\tworkspace,\n\t\t);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { buildFolders } = await import(\"./commands/build\");\n\n\t\tif (folders.length === 0) {\n\t\t\treturn console.log(translate(\"messages.buildSkipEmpty\"));\n\t\t}\n\n\t\tawait buildFolders({\n\t\t\t...options,\n\t\t\tpackages: folders,\n\t\t\tworkspace,\n\t\t}).catch(captureError);\n\t},\n);\n\nyargsInstance.command(\n\t\"publish [directory]\",\n\t\"Publishes the specified directory\",\n\t(argv) =>\n\t\targv.options({\n\t\t\t...buildOptions,\n\t\t\tnoUpload: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: translate(\"options.noUpload.description\"),\n\t\t\t},\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.domain.description\"),\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.subdomain.description\"),\n\t\t\t},\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.newVersion.description\"),\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\taddress: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.address.description\"),\n\t\t\t\tdefault: \"localhost\",\n\t\t\t},\n\t\t\tservice: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.service.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.user.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_USER,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.password.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\n\t\t\t},\n\t\t\tdocs: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: translate(\"options.docs.description\"),\n\t\t\t},\n\t\t\tpushOnly: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: translate(\"options.pushOnly.description\"),\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.license.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t}),\n\tasync ({ directory, user, password, service, license, ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folder = detectPackage(workspace, directory as string);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tif (!options.noUpload) {\n\t\t\tif (!service) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\ttranslate(\n\t\t\t\t\t\t\t\"options.service.demands\",\n\t\t\t\t\t\t\t\"IG_GFX_ASSET_SERVICE\",\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!license && (!user || !password)) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (license && !license.endsWith(\".iglic\")) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlet authentication: Authentication | undefined;\n\n\t\tif (license) {\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\n\t\t\ttry {\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\n\t\t\t\tauthentication = {\n\t\t\t\t\ttype: \"license\",\n\t\t\t\t\tlicense: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (err?.code === \"ENOENT\") {\n\t\t\t\t\tcaptureError(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Expected to find a license file at path: ${fullLicensePath}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to read license file at path: ${fullLicensePath}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (user && password) {\n\t\t\tconsole.log(\n\t\t\t\t`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`,\n\t\t\t);\n\t\t\tauthentication = {\n\t\t\t\ttype: \"credentials\",\n\t\t\t\tusername: user,\n\t\t\t\tpassword,\n\t\t\t};\n\t\t}\n\n\t\tconst { releaseFolder } = await import(\"./commands/publish\");\n\n\t\tconst prompter = createDefaultPrompter();\n\n\t\tconst fullOptions: ReleaseFolderOptions = {\n\t\t\t...options,\n\t\t\tauthentication,\n\t\t\tservice: service!,\n\t\t\tdirectory: folder,\n\t\t\tbanner: true,\n\t\t\tprompter,\n\t\t\tnewVersion: options.newVersion!,\n\t\t\tworkspace,\n\t\t};\n\n\t\tawait releaseFolder(fullOptions).catch(captureError);\n\t},\n);\n\nyargsInstance.command({\n\tcommand: \"generateIndex [directory]\",\n\tbuilder: (argv) => {\n\t\treturn argv.option(\"ignore\", {\n\t\t\ttype: \"array\",\n\t\t\tdefault: [],\n\t\t\tdescription: translate(\"options.ignore.description\"),\n\t\t});\n\t},\n\thandler: async ({ directory, ignore }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { extract } = await import(\"./commands/generate\");\n\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\textract(location, ignore as string[]);\n\t},\n});\n\nyargsInstance.command({\n\tcommand: \"postinstall\",\n\tbuilder: (argv) => argv,\n\thandler: async () => {\n\t\tconst { executePostInstall } = await import(\"./commands/postinstall\");\n\n\t\texecutePostInstall(detectWorkspace(process.cwd()));\n\t},\n\tdescribe: \"Runs postinstall tasks\",\n});\n\nyargsInstance.command({\n\tcommand: \"publishNpm [directory]\",\n\tbuilder: (argv) =>\n\t\targv.options({\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.newVersion.description\"),\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tdryRun: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t}),\n\thandler: async ({ directory, newVersion, dryRun }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tconst { publishToNpm } = await import(\"./commands/publishNpm\");\n\n\t\tawait publishToNpm({\n\t\t\tworkspace,\n\t\t\tlocation: detectPackage(workspace, directory as string),\n\t\t\tversion: newVersion,\n\t\t\tdryRun,\n\t\t}).catch(captureError);\n\t},\n\tdescribe: \"Publishes the package to npm\",\n});\n\nyargsInstance\n\t.demandCommand()\n\t.pkgConf(\"packager\")\n\t.showHelpOnFail(false)\n\t.version().argv;\n"],"names":["__filename","fileURLToPath","import","meta","url","captureError","err","console","log","process","env","NODE_ENV","error","translate","message","buildOptions","outDir","description","type","default","coerce","input","undefined","path","resolve","cwd","minimize","clean","docs","preCommandCheck","workspaceLocation","executedLocalPackager","relative","indexOf","repositoryPackage","readWorkspaceNpmManifest","dependencies","devDependencies","parts","push","join","exit","notifier","updateNotifier","pkg","pjson","shouldNotifyInNpmScript","updateCheckInterval","notify","isGlobal","defer","Error","scripts","postinstall","writeWorkspaceNpmManifest","yargsInstance","yargs","argv","slice","resolvePackagesFromArgs","args","workspace","folders","Map","arg","glob","sync","absolute","forEach","folder","location","detectPackage","set","Array","from","values","command","options","directories","detectWorkspace","buildFolders","length","packages","catch","noUpload","domain","subdomain","newVersion","VERSION","required","address","service","IG_GFX_ASSET_SERVICE","user","IG_GFX_USER","password","IG_GFX_PWD","pushOnly","license","IG_GFX_LICENSE","directory","endsWith","authentication","fullLicensePath","content","fs","readFileSync","toString","code","username","releaseFolder","prompter","createDefaultPrompter","fullOptions","banner","builder","option","handler","ignore","extract","executePostInstall","describe","dryRun","publishToNpm","version","demandCommand","pkgConf","showHelpOnFail"],"mappings":";;;;;;;;;;;;AAsBA,MAAMA,UAAU,GAAGC,aAAa,CAACC,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAA;AAEjD,MAAMC,YAAY,GAAIC,GAAU,IAAK;AACpCC,EAAAA,OAAO,CAACC,GAAG,CAAC,EAAE,CAAC,CAAA;AAEf,EAAA,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;AAC1CJ,IAAAA,OAAO,CAACK,KAAK,CAACN,GAAG,CAAC,CAAA;AACnB,GAAC,MAAM;IACNC,OAAO,CAACK,KAAK,CAACC,SAAS,CAAC,gBAAgB,EAAEP,GAAG,CAACQ,OAAO,CAAC,CAAC,CAAA;AACxD,GAAA;AACD,CAAC,CAAA;AAED,MAAMC,YAAY,GAAG;AACpBC,EAAAA,MAAM,EAAE;AACPC,IAAAA,WAAW,EAAEJ,SAAS,CAAC,4BAA4B,CAAC;AACpDK,IAA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":["import updateNotifier from \"update-notifier\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport yargs from \"yargs/yargs\";\nimport { fileURLToPath } from \"url\";\nimport glob from \"glob\";\n\nimport { translate } from \"./lib/localization\";\nimport { Authentication } from \"./lib/authentication\";\nimport { detectPackage, PackageLocation } from \"./lib/package\";\nimport {\n\tdetectWorkspace,\n\treadWorkspaceNpmManifest,\n\tWorkspaceLocation,\n\twriteWorkspaceNpmManifest,\n} from \"./lib/workspace\";\nimport type { ReleaseFolderOptions } from \"./commands/publish\";\nimport { createDefaultPrompter } from \"./lib/prompter\";\nimport { PackageJSON } from \"./lib/packageJSON\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst pjson: PackageJSON = JSON.parse(\n\tfs.readFileSync(path.join(__dirname, \"..\", \"package.json\"), \"utf8\"),\n);\n\nconst captureError = (err: Error) => {\n\tconsole.log(\"\");\n\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconsole.error(err);\n\t} else {\n\t\tconsole.error(translate(\"messages.error\", err.message));\n\t}\n};\n\nconst buildOptions = {\n\toutDir: {\n\t\tdescription: translate(\"options.outDir.description\"),\n\t\ttype: \"string\",\n\t\tdefault: \"bin\",\n\t\tcoerce: (input: string | undefined | null) =>\n\t\t\tinput === undefined || input === null\n\t\t\t\t? undefined\n\t\t\t\t: path.resolve(process.cwd(), input),\n\t},\n\tminimize: {\n\t\tdescription: translate(\"options.minimize.description\"),\n\t\ttype: \"boolean\",\n\t\tdefault: true,\n\t},\n\tcwd: {\n\t\tdescription: translate(\"options.cwd.description\"),\n\t\ttype: \"string\",\n\t\tdefault: process.cwd(),\n\t},\n\tclean: {\n\t\tdescription: translate(\"options.clean.description\"),\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n\tdocs: {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n} as const;\n\nconst preCommandCheck = async (workspaceLocation: WorkspaceLocation) => {\n\tconst executedLocalPackager =\n\t\tpath.relative(process.cwd(), __filename).indexOf(\"..\") === -1;\n\n\tlet repositoryPackage: PackageJSON | undefined;\n\n\ttry {\n\t\trepositoryPackage = readWorkspaceNpmManifest(workspaceLocation);\n\t} catch (err) {}\n\n\tif (\n\t\trepositoryPackage?.dependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t] ||\n\t\trepositoryPackage?.devDependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t]\n\t) {\n\t\tconst parts = [\"Detected locally installed ig.gfx.packager.\"];\n\n\t\tif (executedLocalPackager) {\n\t\t\tparts.push(\n\t\t\t\t'Run \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.',\n\t\t\t);\n\t\t}\n\t\tparts.push(\n\t\t\t'Run \"npm uninstall @intelligentgraphics/ig.gfx.packager\" to remove the local version.',\n\t\t);\n\n\t\tconsole.error(parts.join(\"\\n\"));\n\t\tprocess.exit(1);\n\t}\n\n\tif (executedLocalPackager) {\n\t\tconsole.error(`Detected locally installed ig.gfx.packager.\nRun \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.\nRun \"npm install\" to get rid of the local packager version.`);\n\t\tprocess.exit(1);\n\t}\n\n\tconst notifier = updateNotifier({\n\t\tpkg: pjson,\n\t\tshouldNotifyInNpmScript: true,\n\t\tupdateCheckInterval: 1000 * 60,\n\t});\n\n\tnotifier.notify({\n\t\tisGlobal: true,\n\t\tdefer: true,\n\t});\n\n\tif (repositoryPackage === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Could not load package.json file in current directory\",\n\t\t);\n\t}\n\n\trepositoryPackage.scripts ??= {};\n\trepositoryPackage.scripts.postinstall = \"packager postinstall\";\n\n\twriteWorkspaceNpmManifest(workspaceLocation, repositoryPackage);\n};\n\nconst yargsInstance = yargs(process.argv.slice(2));\n\nconst resolvePackagesFromArgs = (\n\targs: string[] = [],\n\tworkspace: WorkspaceLocation,\n) => {\n\tconst folders = new Map<string, PackageLocation>();\n\n\tfor (const arg of args) {\n\t\tglob.sync(arg, { cwd: workspace.path, absolute: true }).forEach(\n\t\t\t(folder) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst location = detectPackage(workspace, folder);\n\t\t\t\t\tfolders.set(folder, location);\n\t\t\t\t} catch (err) {}\n\t\t\t},\n\t\t);\n\t}\n\n\treturn Array.from(folders.values());\n};\n\nyargsInstance.command(\n\t\"build [directories...]\",\n\t\"Builds the specified directories\",\n\t(argv) => argv.options(buildOptions),\n\tasync ({ directories = [], ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folders = resolvePackagesFromArgs(\n\t\t\tdirectories as string[],\n\t\t\tworkspace,\n\t\t);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { buildFolders } = await import(\"./commands/build\");\n\n\t\tif (folders.length === 0) {\n\t\t\treturn console.log(translate(\"messages.buildSkipEmpty\"));\n\t\t}\n\n\t\tawait buildFolders({\n\t\t\t...options,\n\t\t\tpackages: folders,\n\t\t\tworkspace,\n\t\t}).catch(captureError);\n\t},\n);\n\nyargsInstance.command(\n\t\"publish [directory]\",\n\t\"Publishes the specified directory\",\n\t(argv) =>\n\t\targv.options({\n\t\t\t...buildOptions,\n\t\t\tnoUpload: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: translate(\"options.noUpload.description\"),\n\t\t\t},\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.domain.description\"),\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.subdomain.description\"),\n\t\t\t},\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.newVersion.description\"),\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\taddress: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.address.description\"),\n\t\t\t\tdefault: \"localhost\",\n\t\t\t},\n\t\t\tservice: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.service.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.user.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_USER,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.password.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\n\t\t\t},\n\t\t\tdocs: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: translate(\"options.docs.description\"),\n\t\t\t},\n\t\t\tpushOnly: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: translate(\"options.pushOnly.description\"),\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.license.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t}),\n\tasync ({ directory, user, password, service, license, ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folder = detectPackage(workspace, directory as string);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tif (!options.noUpload) {\n\t\t\tif (!service) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\ttranslate(\n\t\t\t\t\t\t\t\"options.service.demands\",\n\t\t\t\t\t\t\t\"IG_GFX_ASSET_SERVICE\",\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!license && (!user || !password)) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (license && !license.endsWith(\".iglic\")) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlet authentication: Authentication | undefined;\n\n\t\tif (license) {\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\n\t\t\ttry {\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\n\t\t\t\tauthentication = {\n\t\t\t\t\ttype: \"license\",\n\t\t\t\t\tlicense: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (err?.code === \"ENOENT\") {\n\t\t\t\t\tcaptureError(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Expected to find a license file at path: ${fullLicensePath}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to read license file at path: ${fullLicensePath}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (user && password) {\n\t\t\tconsole.log(\n\t\t\t\t`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`,\n\t\t\t);\n\t\t\tauthentication = {\n\t\t\t\ttype: \"credentials\",\n\t\t\t\tusername: user,\n\t\t\t\tpassword,\n\t\t\t};\n\t\t}\n\n\t\tconst { releaseFolder } = await import(\"./commands/publish\");\n\n\t\tconst prompter = createDefaultPrompter();\n\n\t\tconst fullOptions: ReleaseFolderOptions = {\n\t\t\t...options,\n\t\t\tauthentication,\n\t\t\tservice: service!,\n\t\t\tdirectory: folder,\n\t\t\tbanner: true,\n\t\t\tprompter,\n\t\t\tnewVersion: options.newVersion!,\n\t\t\tworkspace,\n\t\t};\n\n\t\tawait releaseFolder(fullOptions).catch(captureError);\n\t},\n);\n\nyargsInstance.command({\n\tcommand: \"generateIndex [directory]\",\n\tbuilder: (argv) => {\n\t\treturn argv.option(\"ignore\", {\n\t\t\ttype: \"array\",\n\t\t\tdefault: [],\n\t\t\tdescription: translate(\"options.ignore.description\"),\n\t\t});\n\t},\n\thandler: async ({ directory, ignore }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { extract } = await import(\"./commands/generate\");\n\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\textract(location, ignore as string[]);\n\t},\n});\n\nyargsInstance.command({\n\tcommand: \"postinstall\",\n\tbuilder: (argv) => argv,\n\thandler: async () => {\n\t\tconst { executePostInstall } = await import(\"./commands/postinstall\");\n\n\t\texecutePostInstall(detectWorkspace(process.cwd()));\n\t},\n\tdescribe: \"Runs postinstall tasks\",\n});\n\nyargsInstance.command({\n\tcommand: \"publishNpm [directory]\",\n\tbuilder: (argv) =>\n\t\targv.options({\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.newVersion.description\"),\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tdryRun: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t}),\n\thandler: async ({ directory, newVersion, dryRun }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tconst { publishToNpm } = await import(\"./commands/publishNpm\");\n\n\t\tawait publishToNpm({\n\t\t\tworkspace,\n\t\t\tlocation: detectPackage(workspace, directory as string),\n\t\t\tversion: newVersion,\n\t\t\tdryRun,\n\t\t}).catch(captureError);\n\t},\n\tdescribe: \"Publishes the package to npm\",\n});\n\nyargsInstance\n\t.demandCommand()\n\t.pkgConf(\"packager\")\n\t.showHelpOnFail(false)\n\t.version().argv;\n"],"names":["__filename","fileURLToPath","import","meta","url","__dirname","path","dirname","pjson","JSON","parse","fs","readFileSync","join","captureError","err","console","log","process","env","NODE_ENV","error","translate","message","buildOptions","outDir","description","type","default","coerce","input","undefined","resolve","cwd","minimize","clean","docs","preCommandCheck","workspaceLocation","executedLocalPackager","relative","indexOf","repositoryPackage","readWorkspaceNpmManifest","dependencies","devDependencies","parts","push","exit","notifier","updateNotifier","pkg","shouldNotifyInNpmScript","updateCheckInterval","notify","isGlobal","defer","Error","scripts","postinstall","writeWorkspaceNpmManifest","yargsInstance","yargs","argv","slice","resolvePackagesFromArgs","args","workspace","folders","Map","arg","glob","sync","absolute","forEach","folder","location","detectPackage","set","Array","from","values","command","options","directories","detectWorkspace","buildFolders","length","packages","catch","noUpload","domain","subdomain","newVersion","VERSION","required","address","service","IG_GFX_ASSET_SERVICE","user","IG_GFX_USER","password","IG_GFX_PWD","pushOnly","license","IG_GFX_LICENSE","directory","endsWith","authentication","fullLicensePath","content","toString","code","username","releaseFolder","prompter","createDefaultPrompter","fullOptions","banner","builder","option","handler","ignore","extract","executePostInstall","describe","dryRun","publishToNpm","version","demandCommand","pkgConf","showHelpOnFail"],"mappings":";;;;;;;;;;;AAoBA,MAAMA,UAAU,GAAGC,aAAa,CAACC,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAA;AACjD,MAAMC,SAAS,GAAGC,IAAI,CAACC,OAAO,CAACP,UAAU,CAAC,CAAA;AAE1C,MAAMQ,KAAkB,GAAGC,IAAI,CAACC,KAAK,CACpCC,EAAE,CAACC,YAAY,CAACN,IAAI,CAACO,IAAI,CAACR,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CACnE,CAAA;AAED,MAAMS,YA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YAAY,CAAC;MAClB5D,SAAS;AACTS,MAAAA,QAAQ,EAAEC,aAAa,CAACV,SAAS,EAAEuC,SAAS,CAAW;AACvDsB,MAAAA,OAAO,EAAEnC,UAAU;AACnBiC,MAAAA,MAAAA;AACD,KAAC,CAAC,CAACrC,KAAK,CAAC3E,YAAY,CAAC,CAAA;GACtB;AACD+G,EAAAA,QAAQ,EAAE,8BAAA;AACX,CAAC,CAAC,CAAA;AAEFhE,aAAa,CACXoE,aAAa,EAAE,CACfC,OAAO,CAAC,UAAU,CAAC,CACnBC,cAAc,CAAC,KAAK,CAAC,CACrBH,OAAO,EAAE,CAACjE,IAAI"}
|
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
|
|
|
5
5
|
|
|
6
6
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
const instance = y18n({
|
|
8
|
-
directory: path.join(__dirname, "..", "locales"),
|
|
8
|
+
directory: path.join(__dirname, "..", "..", "locales"),
|
|
9
9
|
updateFiles: false,
|
|
10
10
|
locale: "en",
|
|
11
11
|
fallbackToLanguage: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localization.mjs","sources":["../../src/lib/localization.ts"],"sourcesContent":["import y18n from \"y18n\";\nimport * as path from \"path\";\nimport { dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst instance = y18n({\n\tdirectory: path.join(__dirname, \"..\", \"locales\"),\n\tupdateFiles: false,\n\tlocale: \"en\",\n\tfallbackToLanguage: true,\n});\n\nexport const setLocale = (locale: string) => {\n\tinstance.setLocale(locale);\n};\n\nexport const translate = (key: string, ...args: string[]) =>\n\tinstance.__(key, ...args);\n"],"names":["__dirname","dirname","fileURLToPath","import","meta","url","instance","y18n","directory","path","join","updateFiles","locale","fallbackToLanguage","translate","key","args","__"],"mappings":";;;;;AAKA,MAAMA,SAAS,GAAGC,OAAO,CAACC,aAAa,CAACC,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAA;AAEzD,MAAMC,QAAQ,GAAGC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"localization.mjs","sources":["../../src/lib/localization.ts"],"sourcesContent":["import y18n from \"y18n\";\nimport * as path from \"path\";\nimport { dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst instance = y18n({\n\tdirectory: path.join(__dirname, \"..\", \"..\", \"locales\"),\n\tupdateFiles: false,\n\tlocale: \"en\",\n\tfallbackToLanguage: true,\n});\n\nexport const setLocale = (locale: string) => {\n\tinstance.setLocale(locale);\n};\n\nexport const translate = (key: string, ...args: string[]) =>\n\tinstance.__(key, ...args);\n"],"names":["__dirname","dirname","fileURLToPath","import","meta","url","instance","y18n","directory","path","join","updateFiles","locale","fallbackToLanguage","translate","key","args","__"],"mappings":";;;;;AAKA,MAAMA,SAAS,GAAGC,OAAO,CAACC,aAAa,CAACC,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAA;AAEzD,MAAMC,QAAQ,GAAGC,IAAI,CAAC;AACrBC,EAAAA,SAAS,EAAEC,IAAI,CAACC,IAAI,CAACV,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC;AACtDW,EAAAA,WAAW,EAAE,KAAK;AAClBC,EAAAA,MAAM,EAAE,IAAI;AACZC,EAAAA,kBAAkB,EAAE,IAAA;AACrB,CAAC,CAAC,CAAA;MAMWC,SAAS,GAAG,CAACC,GAAW,EAAE,GAAGC,IAAc,KACvDV,QAAQ,CAACW,EAAE,CAACF,GAAG,EAAE,GAAGC,IAAI;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intelligentgraphics/ig.gfx.packager",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
4
|
-
"description": "IG.GFX.Packager 3.0.0 Beta
|
|
3
|
+
"version": "3.0.0-beta.3",
|
|
4
|
+
"description": "IG.GFX.Packager 3.0.0 Beta 3 (3.0.0.14)",
|
|
5
5
|
"author": "Michael Beier <mb@intelligentgraphics.biz>",
|
|
6
6
|
"main": "build/index.mjs",
|
|
7
7
|
"private": false,
|
package/readme.md
CHANGED
|
@@ -319,6 +319,15 @@ The ts files have to adhere to a certain form to be processed.
|
|
|
319
319
|
|
|
320
320
|
## History
|
|
321
321
|
|
|
322
|
+
**IG.GFX.Packager 3.0.0-beta.3**
|
|
323
|
+
|
|
324
|
+
- fix build command
|
|
325
|
+
- fix loading of localizations
|
|
326
|
+
|
|
327
|
+
**IG.GFX.Packager 3.0.0-beta.2**
|
|
328
|
+
|
|
329
|
+
- remove json import
|
|
330
|
+
|
|
322
331
|
**IG.GFX.Packager 3.0.0-beta.1**
|
|
323
332
|
|
|
324
333
|
- restructure to fix release on windows
|