contensis-cli 1.3.1-beta.1 → 1.3.1-beta.10
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/README.md +77 -5
- package/dist/commands/copy.js +2 -2
- package/dist/commands/copy.js.map +2 -2
- package/dist/commands/globalOptions.js +13 -4
- package/dist/commands/globalOptions.js.map +2 -2
- package/dist/commands/import.js +1 -1
- package/dist/commands/import.js.map +2 -2
- package/dist/commands/index.js +4 -0
- package/dist/commands/index.js.map +2 -2
- package/dist/commands/push.js +89 -0
- package/dist/commands/push.js.map +3 -3
- package/dist/commands/remove.js +13 -0
- package/dist/commands/remove.js.map +2 -2
- package/dist/commands/update.js +70 -0
- package/dist/commands/update.js.map +7 -0
- package/dist/localisation/en-GB.js +11 -1
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/models/CliService.d.js.map +1 -1
- package/dist/providers/CredentialProvider.js.map +2 -2
- package/dist/providers/SessionCacheProvider.js +18 -0
- package/dist/providers/SessionCacheProvider.js.map +2 -2
- package/dist/services/ContensisCliService.js +139 -45
- package/dist/services/ContensisCliService.js.map +3 -3
- package/dist/shell.js +21 -9
- package/dist/shell.js.map +2 -2
- package/dist/util/console.printer.js +3 -1
- package/dist/util/console.printer.js.map +2 -2
- package/dist/util/html.formatter.js +70 -0
- package/dist/util/html.formatter.js.map +7 -0
- package/dist/util/logger.js +2 -3
- package/dist/util/logger.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/esbuild.config.js +3 -3
- package/package.json +28 -29
- package/src/commands/copy.ts +3 -1
- package/src/commands/globalOptions.ts +10 -3
- package/src/commands/import.ts +2 -0
- package/src/commands/index.ts +4 -0
- package/src/commands/push.ts +125 -1
- package/src/commands/remove.ts +20 -0
- package/src/commands/update.ts +84 -0
- package/src/localisation/en-GB.ts +16 -1
- package/src/models/CliService.d.ts +1 -1
- package/src/providers/CredentialProvider.ts +2 -2
- package/src/providers/SessionCacheProvider.ts +26 -2
- package/src/services/ContensisCliService.ts +255 -104
- package/src/shell.ts +20 -9
- package/src/util/console.printer.ts +23 -19
- package/src/util/html.formatter.ts +52 -0
- package/src/util/logger.ts +2 -2
- package/src/version.ts +1 -1
package/dist/shell.js
CHANGED
|
@@ -46,17 +46,18 @@ var import_version = require("./version");
|
|
|
46
46
|
class ContensisShell {
|
|
47
47
|
currentEnvironment;
|
|
48
48
|
emptyInputCounter = 0;
|
|
49
|
+
cache;
|
|
49
50
|
env;
|
|
50
51
|
firstStart = true;
|
|
51
52
|
userId = "";
|
|
52
53
|
log = import_logger.Logger;
|
|
53
54
|
messages = import_en_GB.LogMessages;
|
|
54
55
|
refreshEnvironment = () => {
|
|
55
|
-
const {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this.env = environments[currentEnvironment];
|
|
56
|
+
const { cache } = new import_ContensisCliService.default([]);
|
|
57
|
+
this.cache = cache;
|
|
58
|
+
this.currentEnvironment = cache.currentEnvironment || "";
|
|
59
|
+
const environments = cache.environments || {};
|
|
60
|
+
this.env = environments[this.currentEnvironment];
|
|
60
61
|
(0, import_util.Logging)("en-GB").then(({ messages, Log }) => {
|
|
61
62
|
this.log = Log;
|
|
62
63
|
this.messages = messages;
|
|
@@ -138,6 +139,7 @@ class ContensisShell {
|
|
|
138
139
|
await this.contensisPrompt();
|
|
139
140
|
};
|
|
140
141
|
contensisPrompt = async () => {
|
|
142
|
+
var _a;
|
|
141
143
|
const { currentEnvironment, env, log, messages, userId } = this;
|
|
142
144
|
const availableCommands = [
|
|
143
145
|
{
|
|
@@ -146,11 +148,20 @@ class ContensisShell {
|
|
|
146
148
|
}
|
|
147
149
|
},
|
|
148
150
|
"connect",
|
|
151
|
+
...Object.keys(this.cache.environments || {}).map(
|
|
152
|
+
(alias) => `connect ${alias}`
|
|
153
|
+
),
|
|
149
154
|
"list envs",
|
|
155
|
+
"remove env",
|
|
150
156
|
"quit"
|
|
151
157
|
];
|
|
152
158
|
if (currentEnvironment)
|
|
153
|
-
availableCommands.push(
|
|
159
|
+
availableCommands.push(
|
|
160
|
+
"login",
|
|
161
|
+
"list projects",
|
|
162
|
+
"set project",
|
|
163
|
+
...(((_a = this.env) == null ? void 0 : _a.projects) || []).map((project) => `set project ${project}`)
|
|
164
|
+
);
|
|
154
165
|
if (userId)
|
|
155
166
|
availableCommands.push(
|
|
156
167
|
"copy field",
|
|
@@ -193,6 +204,7 @@ class ContensisShell {
|
|
|
193
204
|
"list roles",
|
|
194
205
|
"list webhooks",
|
|
195
206
|
"list workflows",
|
|
207
|
+
"push asset",
|
|
196
208
|
"push block",
|
|
197
209
|
"remove components",
|
|
198
210
|
"remove contenttypes",
|
|
@@ -206,7 +218,8 @@ class ContensisShell {
|
|
|
206
218
|
"set role description",
|
|
207
219
|
"set role assignments",
|
|
208
220
|
"set role enabled",
|
|
209
|
-
"set role permissions"
|
|
221
|
+
"set role permissions",
|
|
222
|
+
"update field"
|
|
210
223
|
);
|
|
211
224
|
const prompt = import_inquirer.default.createPromptModule();
|
|
212
225
|
prompt.registerPrompt("command", import_inquirer_command_prompt.default);
|
|
@@ -254,9 +267,8 @@ class ContensisShell {
|
|
|
254
267
|
ex,
|
|
255
268
|
`Shell ${ex instanceof Error ? ex.toString() : JSON.stringify(ex, null, 2)}`
|
|
256
269
|
);
|
|
257
|
-
} finally {
|
|
258
|
-
return this.contensisPrompt();
|
|
259
270
|
}
|
|
271
|
+
return this.contensisPrompt();
|
|
260
272
|
}
|
|
261
273
|
}).catch((err) => {
|
|
262
274
|
log.error(err.message);
|
package/dist/shell.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/shell.ts"],
|
|
4
|
-
"sourcesContent": ["import figlet from 'figlet';\nimport inquirer from 'inquirer';\nimport inquirerPrompt from 'inquirer-command-prompt';\nimport { split } from 'split-cmd';\nimport commands from './commands';\nimport { LogMessages } from './localisation/en-GB';\nimport CredentialProvider from './providers/CredentialProvider';\nimport { appRootDir } from './providers/file-provider';\nimport ContensisCli, { cliCommand } from './services/ContensisCliService';\nimport { Logging } from './util';\nimport { logError, Logger } from './util/logger';\nimport { LIB_VERSION } from './version';\n\nclass ContensisShell {\n private currentEnvironment!: string;\n private emptyInputCounter: number = 0;\n private env!: EnvironmentCache;\n private firstStart = true;\n private userId: string = '';\n private log = Logger;\n private messages = LogMessages;\n\n private refreshEnvironment = () => {\n // Reload any persisted changes from the disk cache\n const {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AACnB,sBAAqB;AACrB,qCAA2B;AAC3B,uBAAsB;AACtB,sBAAqB;AACrB,mBAA4B;AAC5B,gCAA+B;AAC/B,2BAA2B;AAC3B,iCAAyC;AACzC,kBAAwB;AACxB,oBAAiC;AACjC,qBAA4B;AAE5B,MAAM,eAAe;AAAA,EACX;AAAA,EACA,oBAA4B;AAAA,EAC5B;AAAA,EACA,aAAa;AAAA,EACb,SAAiB;AAAA,EACjB,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,qBAAqB,MAAM;AAEjC,UAAM
|
|
4
|
+
"sourcesContent": ["import figlet from 'figlet';\nimport inquirer from 'inquirer';\nimport inquirerPrompt from 'inquirer-command-prompt';\nimport { split } from 'split-cmd';\nimport commands from './commands';\nimport { LogMessages } from './localisation/en-GB';\nimport CredentialProvider from './providers/CredentialProvider';\nimport { appRootDir } from './providers/file-provider';\nimport ContensisCli, { cliCommand } from './services/ContensisCliService';\nimport { Logging } from './util';\nimport { logError, Logger } from './util/logger';\nimport { LIB_VERSION } from './version';\n\nclass ContensisShell {\n private currentEnvironment!: string;\n private emptyInputCounter: number = 0;\n private cache!: SessionCache;\n private env!: EnvironmentCache;\n private firstStart = true;\n private userId: string = '';\n private log = Logger;\n private messages = LogMessages;\n\n private refreshEnvironment = () => {\n // Reload any persisted changes from the disk cache\n const { cache } = new ContensisCli([]);\n this.cache = cache; // read the cache to pre-load suggestions\n // console.log(`refreshing env w/${currentEnvironment}`);\n this.currentEnvironment = cache.currentEnvironment || '';\n const environments = cache.environments || {};\n this.env = environments[this.currentEnvironment];\n\n // Reload logging here to support changing language\n Logging('en-GB').then(({ messages, Log }) => {\n this.log = Log;\n this.messages = messages;\n });\n };\n\n constructor() {\n this.refreshEnvironment();\n inquirerPrompt.setConfig({\n history: {\n save: true,\n folder: appRootDir,\n limit: 100,\n blacklist: ['quit'],\n },\n });\n\n const { log, messages } = this;\n\n figlet.text(\n messages.app.contensis(),\n {\n font: 'Block',\n horizontalLayout: 'default',\n verticalLayout: 'default',\n width: process.stdout.columns,\n whitespaceBreak: true,\n },\n (err, data) => {\n if (err) {\n log.error(messages.app.unknownError());\n console.dir(err);\n return;\n }\n console.log(log.successText(data));\n console.log(log.infoText(messages.app.startup(LIB_VERSION)));\n console.log(log.helpText(messages.app.help()));\n\n this.start().catch(ex => log.error(ex));\n }\n );\n }\n\n restart = async () => {\n this.firstStart = false;\n this.log.line(); // add a line so we can see where the shell has been restarted\n await this.start();\n };\n\n start = async () => {\n this.refreshEnvironment();\n this.userId = '';\n const { currentEnvironment, env, log, messages } = this;\n\n if (env?.lastUserId) {\n const [credsErr, credentials] = await new CredentialProvider(\n {\n userId: env.lastUserId,\n alias: currentEnvironment,\n },\n env.passwordFallback\n ).Init();\n if (credsErr && !credentials.current) {\n log.error(credsErr.message);\n }\n if (credentials.current) {\n if (this.firstStart) {\n const token = await cliCommand(['login', env.lastUserId]).Login(\n env.lastUserId,\n {\n promptPassword: false,\n silent: true,\n }\n );\n if (token) {\n this.userId = env.lastUserId;\n if (!env.currentProject) log.warning(messages.projects.tip());\n }\n this.firstStart = false;\n this.refreshEnvironment();\n } else {\n this.userId = env.lastUserId;\n }\n }\n }\n await this.contensisPrompt();\n };\n\n contensisPrompt = async (): Promise<any> => {\n const { currentEnvironment, env, log, messages, userId } = this;\n\n const availableCommands = [\n {\n filter: (str: string) => {\n return str.replace(/ \\[.*$/, '');\n },\n },\n 'connect',\n ...Object.keys(this.cache.environments || {}).map(\n alias => `connect ${alias}`\n ),\n 'list envs',\n 'remove env',\n 'quit',\n ];\n\n if (currentEnvironment)\n availableCommands.push(\n 'login',\n 'list projects',\n 'set project',\n ...(this.env?.projects || []).map(project => `set project ${project}`)\n );\n if (userId)\n availableCommands.push(\n 'copy field',\n 'create key',\n 'create project',\n 'create role',\n 'diff models',\n 'execute block action release',\n 'execute block action makelive',\n 'execute block action rollback',\n 'execute block action markasbroken',\n 'get assets',\n 'get block',\n 'get block logs',\n 'get contenttype',\n 'get component',\n 'get entries',\n 'get nodes',\n 'get model',\n 'get project',\n 'get proxy',\n 'get renderer',\n 'get role',\n 'get token',\n 'get version',\n 'get webhook',\n 'get workflow',\n 'import contenttypes',\n 'import components',\n 'import entries',\n 'import models',\n 'import nodes',\n 'list blocks',\n 'list contenttypes',\n 'list components',\n 'list keys',\n 'list models',\n 'list proxies',\n 'list renderers',\n 'list roles',\n 'list webhooks',\n 'list workflows',\n 'push asset',\n 'push block',\n 'remove components',\n 'remove contenttypes',\n 'remove key',\n 'remove entries',\n 'remove nodes',\n 'remove role',\n 'set project name',\n 'set project description',\n 'set role name',\n 'set role description',\n 'set role assignments',\n 'set role enabled',\n 'set role permissions',\n 'update field'\n );\n\n const prompt = inquirer.createPromptModule();\n prompt.registerPrompt('command', inquirerPrompt);\n return prompt([\n {\n type: 'command',\n name: 'cmd',\n autoCompletion: availableCommands.sort(),\n autocompletePrompt: log.infoText(messages.app.autocomplete()),\n message: `${userId ? `${userId}@` : ''}${currentEnvironment || ''}>`,\n context: 0,\n validate: (val: string) => {\n if (!val) this.emptyInputCounter++;\n if (this.emptyInputCounter > 1)\n console.log(this.log.infoText(this.messages.app.suggestions()));\n if (val) {\n this.emptyInputCounter = 0;\n return true;\n }\n },\n prefix: `${env?.currentProject || log.infoText('contensis')}`,\n short: true,\n },\n ])\n .then(async (answers: { cmd: string }) => {\n if (answers.cmd === 'quit') {\n this.quit();\n } else {\n try {\n if (answers.cmd) {\n const program = commands();\n await program.parseAsync(\n split(answers.cmd).map(e => e.replace(/\\\\\"/g, '\"')),\n // answers.cmd\n // .match(/\"[^\"]+\"|[^\\s]+/g)\n // ?.map(e => e.replace(/\"(.+)\"/, '$1')),\n {\n from: 'user',\n }\n );\n }\n } catch (ex: any) {\n const str = ex.toString();\n if (!str.includes('CommanderError'))\n logError(\n ex,\n `Shell ${\n ex instanceof Error\n ? ex.toString()\n : JSON.stringify(ex, null, 2)\n }`\n );\n }\n return this.contensisPrompt();\n }\n })\n .catch((err: Error) => {\n log.error(err.message);\n this.quit();\n });\n };\n\n quit = (error?: Error) => {\n const { log, messages } = this;\n process.removeAllListeners('exit');\n\n if (error) {\n log.error(error.message);\n process.exit(1);\n } else {\n log.success(messages.app.quit());\n process.exitCode = 0;\n process.exit(0);\n }\n };\n}\n\nlet globalShell: ContensisShell;\n\nexport const shell = () => {\n // Return a benign function for shell().restart() when used in cli context\n // as some commands need to restart the shell to show an updated prompt\n // after successful connect / login / set project\n if (typeof process.argv?.[2] !== 'undefined')\n return {\n quit: ContensisCli.quit,\n restart() {},\n } as any;\n if (!globalShell) globalShell = new ContensisShell();\n return globalShell;\n};\n\nprocess.on('uncaughtException', function (err) {\n // Handle the error safely\n console.log(err);\n});\n\nprocess.on('SIGINT', () => {\n Logger.warning('received SIGINT');\n shell().quit();\n // setTimeout(() => {\n // }, 2000);\n});\n\nprocess.on('SIGTERM', () => {\n Logger.warning('received SIGTERM');\n shell().quit();\n});\n\nprocess.stdin.on('data', key => {\n if ((key as any) == '\\u0003') {\n console.log('');\n Logger.info(`[CTRL]+[C] detected, exiting shell...`);\n shell().quit();\n }\n});\n\n// process.env.http_proxy = 'http://127.0.0.1:8888';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AACnB,sBAAqB;AACrB,q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IAAI,OAAO;AACrB,WAAK,KAAK;AAAA,IACZ,CAAC;AAAA,EACL;AAAA,EAEA,OAAO,CAAC,UAAkB;AACxB,UAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,YAAQ,mBAAmB,MAAM;AAEjC,QAAI,OAAO;AACT,UAAI,MAAM,MAAM,OAAO;AACvB,cAAQ,KAAK,CAAC;AAAA,IAChB,OAAO;AACL,UAAI,QAAQ,SAAS,IAAI,KAAK,CAAC;AAC/B,cAAQ,WAAW;AACnB,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AACF;AAEA,IAAI;AAEG,MAAM,QAAQ,MAAM;AA5R3B;AAgSE,MAAI,SAAO,aAAQ,SAAR,mBAAe,QAAO;AAC/B,WAAO;AAAA,MACL,MAAM,2BAAAL,QAAa;AAAA,MACnB,UAAU;AAAA,MAAC;AAAA,IACb;AACF,MAAI,CAAC,YAAa,eAAc,IAAI,eAAe;AACnD,SAAO;AACT;AAEA,QAAQ,GAAG,qBAAqB,SAAU,KAAK;AAE7C,UAAQ,IAAI,GAAG;AACjB,CAAC;AAED,QAAQ,GAAG,UAAU,MAAM;AACzB,uBAAO,QAAQ,iBAAiB;AAChC,QAAM,EAAE,KAAK;AAGf,CAAC;AAED,QAAQ,GAAG,WAAW,MAAM;AAC1B,uBAAO,QAAQ,kBAAkB;AACjC,QAAM,EAAE,KAAK;AACf,CAAC;AAED,QAAQ,MAAM,GAAG,QAAQ,SAAO;AAC9B,MAAK,OAAe,KAAU;AAC5B,YAAQ,IAAI,EAAE;AACd,yBAAO,KAAK,uCAAuC;AACnD,UAAM,EAAE,KAAK;AAAA,EACf;AACF,CAAC;",
|
|
6
6
|
"names": ["ContensisCli", "inquirerPrompt", "figlet", "CredentialProvider", "inquirer", "commands"]
|
|
7
7
|
}
|
|
@@ -182,7 +182,9 @@ const printEntriesMigrateResult = (service, migrateResult, {
|
|
|
182
182
|
migrateResult.entries || {}
|
|
183
183
|
)) {
|
|
184
184
|
log.help(
|
|
185
|
-
|
|
185
|
+
action === "update" ? `update entries in project ${log.boldText(
|
|
186
|
+
log.warningText(currentProject)
|
|
187
|
+
)}` : `${action}${action === "delete" ? ` from project ${log.warningText(currentProject)}` : `${projectId ? ` from project ${log.highlightText(projectId)}` : ""} to ${log.boldText(
|
|
186
188
|
log.warningText(currentProject)
|
|
187
189
|
)}`}`
|
|
188
190
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/util/console.printer.ts"],
|
|
4
|
-
"sourcesContent": ["import { Node } from 'contensis-delivery-api/lib/models';\nimport dayjs from 'dayjs';\nimport { deconstructApiError } from './error';\nimport { Logger, addNewLines } from './logger';\nimport {\n BlockVersion,\n CopyFieldResult,\n EntriesMigrationResult,\n EntriesResult,\n MigrateModelsResult,\n MigrateNodesTree,\n MigrateStatus,\n NodesResult,\n ProjectNodesToMigrate,\n} from 'migratortron';\nimport ContensisCli from '~/services/ContensisCliService';\n\nconst formatDate = (date: Date | string, format = 'DD/MM/YYYY HH:mm') =>\n dayjs(date).format(format);\n\nexport const printBlockVersion = (\n { log, messages }: ContensisCli,\n block: BlockVersion,\n printOptions = {\n showSource: true,\n showStatus: true,\n showStaticPaths: true,\n showImage: true,\n }\n) => {\n console.log(\n ` ${log.standardText(`v${block.version.versionNo}`)} ${block.id}`\n );\n console.log(\n ` state: ${messages.blocks.runningStatus(\n block.status.broken ? 'broken' : block.status.running.global\n )}`\n );\n console.log(\n ` released: ${log.infoText(\n block.version.released\n ? `[${formatDate(block.version.released)}] ${block.version.releasedBy}`\n : 'no'\n )}`\n );\n if (block.version.madeLive)\n console.log(\n ` live: ${log.infoText(\n `[${formatDate(block.version.madeLive)}] ${block.version.madeLiveBy}`\n )}`\n );\n if (printOptions.showStatus) {\n console.log(` status:`);\n console.log(` deployment: ${log.infoText(block.status.deployment)}`);\n console.log(` workflow: ${log.infoText(block.status.workflow)}`);\n console.log(\n ` running status: ${messages.blocks.runningStatus(\n block.status.running.global\n )}`\n );\n console.log(` datacentres:`);\n console.log(\n ` hq: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.hq\n )}`\n );\n console.log(\n ` london: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.london\n )}`\n );\n console.log(\n ` manchester: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.manchester\n )}`\n );\n }\n if (printOptions.showSource) {\n console.log(` source:`);\n console.log(` commit: ${log.helpText(block.source.commit.id)}`);\n console.log(\n ` message: ${log.infoText(\n block.source.commit.message\n ?.replaceAll('\\n', '\\\\n')\n .replaceAll('\\\\n\\\\n', '\\\\n')\n .replaceAll('\\\\n', '; ')\n )}`\n );\n console.log(\n ` committed: ${log.infoText(\n `[${formatDate(block.source.commit.dateTime)}] ${\n block.source.commit.authorEmail\n }`\n )}`\n );\n console.log(\n ` pushed: ${log.infoText(\n `[${formatDate(block.version.pushed)}] ${block.version.pushedBy}`\n )}`\n );\n console.log(` ${log.infoText(block.source.commit.commitUrl)}`);\n }\n if (printOptions.showImage) {\n console.log(` image:`);\n console.log(` uri: ${log.infoText(block.image.uri)}`);\n console.log(` tag: ${log.helpText(block.image.tag)}`);\n }\n if (printOptions.showStaticPaths) {\n if (block.staticPaths?.length) {\n console.log(` static paths:`);\n for (const path of block.staticPaths) console.log(` - ${path}`);\n }\n }\n if (block.stagingUrl)\n console.log(` staging url: ${log.infoText(block.stagingUrl)}`);\n console.log('');\n};\n\nexport const printEntriesMigrateResult = (\n service: ContensisCli,\n migrateResult: EntriesMigrationResult | EntriesResult | CopyFieldResult,\n {\n action = 'import',\n showDiff = false,\n showAll = false,\n showChanged = false,\n }: {\n action?: 'import' | 'delete';\n showDiff?: boolean;\n showAll?: boolean;\n showChanged?: boolean;\n } = {}\n) => {\n console.log(``);\n const { log, messages, currentProject } = service;\n for (const [contentTypeId, entryRes] of Object.entries(\n migrateResult.entriesToMigrate.entryIds\n ) as [string, any]) {\n for (const [originalId, entryStatus] of Object.entries(entryRes) as [\n string,\n any\n ][]) {\n if (\n showAll ||\n (showChanged &&\n (\n Object.entries(\n Object.entries(entryStatus[currentProject])[0]\n )[1][1] as any\n ).status !== 'no change')\n ) {\n console.log(\n log.infoText(\n `${Object.entries(entryStatus || {})\n .filter(x => x[0] !== 'entryTitle')\n .map(([projectId, projectStatus]) => {\n const [targetGuid, { status }] = (Object.entries(\n projectStatus || {}\n )?.[0] as [string, { status: MigrateStatus }]) || [\n '',\n { x: { status: undefined } },\n ];\n return `${messages.migrate.status(status)(\n `${status}`\n )} ${originalId}${\n targetGuid !== originalId ? ` -> ${targetGuid}\\n ` : ' '\n }`;\n })}`\n ) + `${log.helpText(contentTypeId)} ${entryStatus.entryTitle}`\n );\n\n for (const [projectId, projectStatus] of Object.entries(\n entryStatus\n ).filter(([key]) => key !== 'entryTitle') as [string, any][]) {\n const [targetGuid, { error, diff, status }] = Object.entries(\n projectStatus\n )[0] as [string, any];\n if (error) log.error(error);\n if (diff && showDiff) {\n console.log(\n ` ${log.infoText(`diff: ${highlightDiffText(diff)}`)}\\n`\n );\n }\n }\n }\n }\n }\n if (showAll || showChanged) console.log(``);\n\n for (const [projectId, contentTypeCounts] of Object.entries(\n migrateResult.entries || {}\n ) as [string, any][]) {\n log.help(\n `${action} from project ${\n action === 'delete'\n ? log.warningText(currentProject)\n : `${log.highlightText(projectId)} to ${log.boldText(\n log.warningText(currentProject)\n )}`\n }`\n );\n for (const [contentTypeId, count] of Object.entries(contentTypeCounts) as [\n string,\n number\n ][]) {\n const isTotalCountRow = contentTypeId === 'totalCount';\n const migrateStatusAndCount =\n migrateResult.entriesToMigrate[currentProject][contentTypeId];\n const existingCount =\n migrateResult.existing?.[currentProject]?.[contentTypeId] || 0;\n const existingPercent = ((existingCount / count) * 100).toFixed(0);\n const noChangeOrTotalEntriesCount =\n typeof migrateStatusAndCount !== 'number'\n ? migrateStatusAndCount?.['no change'] || 0\n : migrateStatusAndCount;\n\n const changedPercentage = (\n (noChangeOrTotalEntriesCount / count) *\n 100\n ).toFixed(0);\n\n const existingColor =\n existingPercent === '0' || action === 'delete'\n ? log.warningText\n : log.infoText;\n\n const changedColor = isTotalCountRow\n ? log.helpText\n : changedPercentage === '100'\n ? log.successText\n : log.warningText;\n\n if (isTotalCountRow && 'nodes' in migrateResult) {\n printNodesMigrateResult(service, migrateResult, {\n showAll,\n showDiff,\n showChanged,\n isEntriesMigration: true,\n });\n }\n console.log(\n ` - ${\n isTotalCountRow\n ? log.highlightText(\n `${contentTypeId}: ${noChangeOrTotalEntriesCount}`\n )\n : `${contentTypeId}: ${log.helpText(count)}`\n }${\n changedPercentage === '100' || isTotalCountRow\n ? ''\n : existingColor(` [existing: ${`${existingPercent}%`}]`)\n }${\n existingPercent === '0' || (action === 'import' && isTotalCountRow)\n ? ''\n : changedColor(\n ` ${\n isTotalCountRow\n ? `[to ${action}: ${noChangeOrTotalEntriesCount}]`\n : changedPercentage === '100'\n ? 'up to date'\n : `[needs update: ${100 - Number(changedPercentage)}%]`\n }`\n )\n }`\n );\n }\n }\n if (migrateResult.errors?.length) {\n console.log(\n ` - ${log.errorText(`errors: ${migrateResult.errors.length}`)}\\n`\n );\n for (const error of migrateResult.errors)\n log.error(error.message, null, '');\n }\n};\n\nexport const printNodesMigrateResult = (\n { log, currentProject }: ContensisCli,\n migrateResult: EntriesMigrationResult | NodesResult,\n {\n action = 'import',\n logLimit = 50,\n showDiff = false,\n showAll = false,\n showChanged = false,\n isEntriesMigration = false,\n }: {\n action?: 'import' | 'delete';\n logLimit?: number;\n showDiff?: boolean;\n showAll?: boolean;\n showChanged?: boolean;\n isEntriesMigration?: boolean;\n } = {}\n) => {\n if (!isEntriesMigration) log.raw(``);\n for (const [projectId, counts] of Object.entries(migrateResult.nodes || {})) {\n const importTitle =\n action === 'delete'\n ? `Delete from project ${log.warningText(currentProject)}`\n : `Import ${\n projectId && projectId !== 'null'\n ? `from project ${log.highlightText(projectId)} `\n : ''\n }to ${log.boldText(log.warningText(currentProject))}`;\n if (!isEntriesMigration) log.help(importTitle);\n\n const migrateStatusAndCount = migrateResult.nodesToMigrate[\n currentProject\n ] as ProjectNodesToMigrate;\n\n const existingCount = migrateResult.nodes?.[projectId]?.totalCount || 0;\n\n const totalCount = Object.keys(migrateResult.nodesToMigrate.nodeIds).length;\n const existingPercent = counts.totalCount\n ? ((existingCount / totalCount) * 100).toFixed(0)\n : '0';\n\n const noChangeCount = migrateStatusAndCount?.['no change'] || 0;\n\n const changedPercentage = counts.totalCount\n ? ((noChangeCount / totalCount) * 100).toFixed(0)\n : '0';\n\n const existingColor =\n existingPercent === '0' || action === 'delete'\n ? log.warningText\n : log.infoText;\n\n const changedColor =\n changedPercentage === '100' ? log.successText : log.warningText;\n\n if (!isEntriesMigration || migrateStatusAndCount.totalCount > 0)\n console.log(\n ` - ${log.highlightText(\n `${isEntriesMigration ? ' + nodes' : 'totalCount'}: ${\n migrateStatusAndCount.totalCount\n }`\n )}${\n changedPercentage === '100'\n ? ''\n : existingColor(` [existing: ${`${existingPercent}%`}]`)\n }${\n existingPercent === '0'\n ? ''\n : changedColor(\n ` ${\n changedPercentage === '100'\n ? 'up to date'\n : `[needs update: ${100 - Number(changedPercentage)}%]`\n }`\n )\n }`\n );\n }\n if (migrateResult.errors?.length) {\n console.log(\n ` - ${log.errorText(`errors: ${migrateResult.errors.length}`)}\\n`\n );\n\n log.limits(\n migrateResult.errors\n .map(error => {\n return log.errorText(deconstructApiError(error));\n })\n .join('\\n'),\n logLimit\n );\n }\n};\n\nconst highlightDiffText = (str: string) => {\n const addedRegex = new RegExp(/<<\\+>>(.*?)<<\\/\\+>>/, 'g');\n const removedRegex = new RegExp(/<<->>(.*?)<<\\/->>/, 'g');\n return str\n .replace(addedRegex, match => {\n return Logger.successText(\n match.replace(/<<\\+>>/g, '<+>').replace(/<<\\/\\+>>/g, '</+>')\n );\n })\n .replace(removedRegex, match => {\n return Logger.errorText(\n match.replace(/<<->>/g, '<->').replace(/<<\\/->>/g, '</->')\n );\n });\n};\n\nexport const printModelMigrationAnalysis = (\n { log, messages }: ContensisCli,\n result: any = {}\n) => {\n for (const [contentTypeId, model] of Object.entries(result) as [\n string,\n any\n ][]) {\n let mainOutput = log.standardText(\n ` - ${contentTypeId}${\n model.contentTypeId ? ` ${log.helpText(model.contentTypeId)}` : ''\n }`\n );\n let extraOutput = '';\n let errorOutput = '';\n let diffOutput = '';\n for (const [key, details] of Object.entries(model) as [string, any][]) {\n if (key === 'dependencies') {\n extraOutput += log.infoText(\n ` references: [${details?.join(', ')}]\\n`\n );\n }\n if (key === 'dependencyOf') {\n extraOutput += log.infoText(\n ` required by: [${details?.join(', ')}]\\n`\n );\n }\n if (key === 'projects') {\n for (const [projectId, projectDetails] of Object.entries(details) as [\n string,\n any\n ][]) {\n mainOutput += log.infoText(\n ` [${messages.migrate.status(projectDetails.status)(\n `${projectId}: ${projectDetails.status}`\n )}]${\n projectDetails.versionNo ? ` v${projectDetails.versionNo}` : ''\n }`\n );\n if (projectDetails.diff)\n diffOutput += ` ${log.highlightText(`diff:`)} ${log.infoText(\n highlightDiffText(projectDetails.diff)\n )}`;\n if (projectDetails.error)\n errorOutput += ` ${log.highlightText(\n `error::`\n )} ${log.errorText(projectDetails.error)}`;\n }\n }\n }\n console.log(mainOutput);\n if (extraOutput) {\n const search = '\\n';\n const replace = '';\n console.log(\n extraOutput.replace(\n new RegExp(search + '([^' + search + ']*)$'),\n replace + '$1'\n )\n );\n }\n if (diffOutput) console.log(diffOutput);\n if (errorOutput) console.log(errorOutput);\n }\n};\n\ntype MigrateResultSummary = MigrateModelsResult['']['contentTypes'];\ntype MigrateResultStatus = keyof MigrateResultSummary;\n\nexport const printModelMigrationResult = (\n { log, messages }: ContensisCli,\n result: MigrateResultSummary\n) => {\n for (const [status, ids] of Object.entries(result) as [\n MigrateResultStatus,\n string[]\n ][]) {\n if (ids?.length) {\n if (status === 'errors') {\n const errors: [string, MappedError][] = ids as any;\n log.raw(\n ` - ${status}: [ ${messages.migrate.models.result(status)(\n ids.map(id => id[0]).join(', ')\n )} ]\\n`\n );\n for (const [contentTypeId, error] of errors)\n log.error(\n `${log.highlightText(contentTypeId)}: ${error.message}`,\n error\n );\n } else\n log.raw(\n ` - ${status}: [ ${messages.migrate.models.result(status)(\n ids.join(', ')\n )} ]`\n );\n }\n }\n};\n\nexport const printNodeTreeOutput = (\n { log, messages }: ContensisCli,\n root: Node | Partial<MigrateNodesTree> | undefined,\n logDetail = 'errors',\n logLimit = 1000\n) => {\n log.raw('');\n const statusColour = messages.migrate.status;\n\n if (root && 'status' in root)\n log.info(\n `Migrate status: ${statusColour('no change')(\n 'N'\n )} [no change]; ${statusColour('create')('C')} [create]; ${statusColour(\n 'update'\n )('U')} [update]; ${statusColour('delete')('D')} [delete]; ${statusColour(\n 'error'\n )('E')} [error];`\n );\n log.info(\n `Node properties: ${log.highlightText(\n 'e'\n )} = has entry; ${log.highlightText('c')} = canonical; ${log.highlightText(\n 'm'\n )} = include in menu`\n );\n\n log.line();\n\n const outputNode = (\n node: Partial<Node | MigrateNodesTree>,\n spaces: string,\n isRoot = false\n ) => {\n const errorOutput =\n 'error' in node && node.error && deconstructApiError(node.error);\n const fullOutput = logDetail === 'all';\n const changesOutput =\n logDetail === 'changes' &&\n 'status' in node &&\n node.status &&\n ['create', 'update'].includes(node.status);\n\n const diffOutput =\n (fullOutput || changesOutput || errorOutput) &&\n 'diff' in node &&\n node.diff?.replaceAll('\\n', '');\n\n return `${\n 'status' in node && node.status\n ? `${statusColour(node.status)(\n node.status.substring(0, 1).toUpperCase()\n )} `\n : ''\n }${node.entry ? log.highlightText('e') : log.infoText('-')}${\n 'isCanonical' in node && node.isCanonical\n ? log.highlightText('c')\n : log.infoText('-')\n }${\n node.includeInMenu ? log.highlightText('m') : log.infoText('-')\n }${spaces}${log[\n 'status' in node && node.status === 'no change'\n ? 'infoText'\n : 'standardText'\n ](\n 'isCanonical' in node && node.isCanonical\n ? log.boldText(\n fullOutput || isRoot || !node.slug ? node.path : `/${node.slug}`\n )\n : fullOutput || isRoot || !node.slug\n ? node.path\n : `/${node.slug}`\n )}${node.entry ? ` ${log.helpText(node.entry.sys.contentTypeId)}` : ''}${\n node.childCount ? ` +${node.childCount}` : ``\n } ${'displayName' in node ? log.infoText(node.displayName) : ''}${\n fullOutput || (changesOutput && node.id !== node.originalId)\n ? `~n ${log.infoText(`id:`)} ${\n !('originalId' in node) || node.id === node.originalId\n ? node.id\n : `${node.id} ${log.infoText(`<= ${node.originalId}`)}`\n }`\n : ''\n }${\n (fullOutput ||\n (changesOutput && node.parentId !== node.originalParentId)) &&\n node.parentId\n ? `~n ${log.infoText(\n `parentId: ${\n !('originalParentId' in node) ||\n node.parentId === node.originalParentId\n ? node.parentId\n : `${node.parentId} <= ${node.originalParentId}`\n }`\n )}`\n : ''\n }${\n fullOutput && node.entry?.sys.id\n ? `~n ${log.infoText(`entryId: ${node.entry.sys.id}`)}`\n : ''\n }${\n errorOutput\n ? `~n${addNewLines(` ${log.errorText(errorOutput)}`, '~n')}`\n : ''\n }${\n diffOutput\n ? `~n${addNewLines(\n ` ${log.infoText(`diff: ${highlightDiffText(diffOutput)}`)}`,\n '~n'\n )}`\n : ''\n }`;\n };\n\n const outputChildren = (\n node: Partial<Node | MigrateNodesTree> | undefined,\n depth = 2\n ) => {\n let str = '';\n for (const child of ((node as any)?.children || []) as Node[]) {\n str += `${outputNode(child, Array(depth + 1).join(' '))}\\n`;\n if ('children' in child) str += outputChildren(child, depth + 1);\n }\n return str;\n };\n\n const children = outputChildren(root);\n log.limits(\n `${outputNode(root || {}, ' ', true)}${children ? `\\n${children}` : ''}`,\n logLimit\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,mBAAoC;AACpC,oBAAoC;AAcpC,MAAM,aAAa,CAAC,MAAqB,SAAS,2BAChD,aAAAA,SAAM,IAAI,EAA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AAS,SAAS,kBAAkB,UAAU,CAAC,EAAE,CAAC;AAAA,MAC3D;AAAA,IACF,CAAC,KACD,EACN;AAAA,EACF;AAEA,QAAM,iBAAiB,CACrB,MACA,QAAQ,MACL;AACH,QAAI,MAAM;AACV,eAAW,UAAW,6BAAc,aAAY,CAAC,GAAc;AAC7D,aAAO,GAAG,WAAW,OAAO,MAAM,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;AAAA;AACxD,UAAI,cAAc,MAAO,QAAO,eAAe,OAAO,QAAQ,CAAC;AAAA,IACjE;AACA,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,eAAe,IAAI;AACpC,MAAI;AAAA,IACF,GAAG,WAAW,QAAQ,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,WAAW;AAAA,EAAK,QAAQ,KAAK,EAAE;AAAA,IACtE;AAAA,EACF;AACF;",
|
|
4
|
+
"sourcesContent": ["import { Node } from 'contensis-delivery-api/lib/models';\nimport dayjs from 'dayjs';\nimport { deconstructApiError } from './error';\nimport { Logger, addNewLines } from './logger';\nimport {\n BlockVersion,\n CopyFieldResult,\n EntriesMigrationResult,\n EntriesResult,\n MigrateModelsResult,\n MigrateNodesTree,\n MigrateStatus,\n NodesResult,\n ProjectNodesToMigrate,\n} from 'migratortron';\nimport ContensisCli from '~/services/ContensisCliService';\n\nconst formatDate = (date: Date | string, format = 'DD/MM/YYYY HH:mm') =>\n dayjs(date).format(format);\n\nexport const printBlockVersion = (\n { log, messages }: ContensisCli,\n block: BlockVersion,\n printOptions = {\n showSource: true,\n showStatus: true,\n showStaticPaths: true,\n showImage: true,\n }\n) => {\n console.log(\n ` ${log.standardText(`v${block.version.versionNo}`)} ${block.id}`\n );\n console.log(\n ` state: ${messages.blocks.runningStatus(\n block.status.broken ? 'broken' : block.status.running.global\n )}`\n );\n console.log(\n ` released: ${log.infoText(\n block.version.released\n ? `[${formatDate(block.version.released)}] ${block.version.releasedBy}`\n : 'no'\n )}`\n );\n if (block.version.madeLive)\n console.log(\n ` live: ${log.infoText(\n `[${formatDate(block.version.madeLive)}] ${block.version.madeLiveBy}`\n )}`\n );\n if (printOptions.showStatus) {\n console.log(` status:`);\n console.log(` deployment: ${log.infoText(block.status.deployment)}`);\n console.log(` workflow: ${log.infoText(block.status.workflow)}`);\n console.log(\n ` running status: ${messages.blocks.runningStatus(\n block.status.running.global\n )}`\n );\n console.log(` datacentres:`);\n console.log(\n ` hq: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.hq\n )}`\n );\n console.log(\n ` london: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.london\n )}`\n );\n console.log(\n ` manchester: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.manchester\n )}`\n );\n }\n if (printOptions.showSource) {\n console.log(` source:`);\n console.log(` commit: ${log.helpText(block.source.commit.id)}`);\n console.log(\n ` message: ${log.infoText(\n block.source.commit.message\n ?.replaceAll('\\n', '\\\\n')\n .replaceAll('\\\\n\\\\n', '\\\\n')\n .replaceAll('\\\\n', '; ')\n )}`\n );\n console.log(\n ` committed: ${log.infoText(\n `[${formatDate(block.source.commit.dateTime)}] ${\n block.source.commit.authorEmail\n }`\n )}`\n );\n console.log(\n ` pushed: ${log.infoText(\n `[${formatDate(block.version.pushed)}] ${block.version.pushedBy}`\n )}`\n );\n console.log(` ${log.infoText(block.source.commit.commitUrl)}`);\n }\n if (printOptions.showImage) {\n console.log(` image:`);\n console.log(` uri: ${log.infoText(block.image.uri)}`);\n console.log(` tag: ${log.helpText(block.image.tag)}`);\n }\n if (printOptions.showStaticPaths) {\n if (block.staticPaths?.length) {\n console.log(` static paths:`);\n for (const path of block.staticPaths) console.log(` - ${path}`);\n }\n }\n if (block.stagingUrl)\n console.log(` staging url: ${log.infoText(block.stagingUrl)}`);\n console.log('');\n};\n\nexport const printEntriesMigrateResult = (\n service: ContensisCli,\n migrateResult: EntriesMigrationResult | EntriesResult | CopyFieldResult,\n {\n action = 'import',\n showDiff = false,\n showAll = false,\n showChanged = false,\n }: {\n action?: 'import' | 'update' | 'delete';\n showDiff?: boolean;\n showAll?: boolean;\n showChanged?: boolean;\n } = {}\n) => {\n console.log(``);\n const { log, messages, currentProject } = service;\n for (const [contentTypeId, entryRes] of Object.entries(\n migrateResult.entriesToMigrate.entryIds\n ) as [string, any]) {\n for (const [originalId, entryStatus] of Object.entries(entryRes) as [\n string,\n any,\n ][]) {\n if (\n showAll ||\n (showChanged &&\n (\n Object.entries(\n Object.entries(entryStatus[currentProject])[0]\n )[1][1] as any\n ).status !== 'no change')\n ) {\n console.log(\n log.infoText(\n `${Object.entries(entryStatus || {})\n .filter(x => x[0] !== 'entryTitle')\n .map(([projectId, projectStatus]) => {\n const [targetGuid, { status }] = (Object.entries(\n projectStatus || {}\n )?.[0] as [string, { status: MigrateStatus }]) || [\n '',\n { x: { status: undefined } },\n ];\n return `${messages.migrate.status(status)(\n `${status}`\n )} ${originalId}${\n targetGuid !== originalId ? ` -> ${targetGuid}\\n ` : ' '\n }`;\n })}`\n ) + `${log.helpText(contentTypeId)} ${entryStatus.entryTitle}`\n );\n\n for (const [projectId, projectStatus] of Object.entries(\n entryStatus\n ).filter(([key]) => key !== 'entryTitle') as [string, any][]) {\n const [targetGuid, { error, diff, status }] = Object.entries(\n projectStatus\n )[0] as [string, any];\n if (error) log.error(error);\n if (diff && showDiff) {\n console.log(\n ` ${log.infoText(`diff: ${highlightDiffText(diff)}`)}\\n`\n );\n }\n }\n }\n }\n }\n if (showAll || showChanged) console.log(``);\n\n for (const [projectId, contentTypeCounts] of Object.entries(\n migrateResult.entries || {}\n ) as [string, any][]) {\n log.help(\n action === 'update'\n ? `update entries in project ${log.boldText(\n log.warningText(currentProject)\n )}`\n : `${action}${\n action === 'delete'\n ? ` from project ${log.warningText(currentProject)}`\n : `${projectId ? ` from project ${log.highlightText(projectId)}` : ''} to ${log.boldText(\n log.warningText(currentProject)\n )}`\n }`\n );\n for (const [contentTypeId, count] of Object.entries(contentTypeCounts) as [\n string,\n number,\n ][]) {\n const isTotalCountRow = contentTypeId === 'totalCount';\n const migrateStatusAndCount =\n migrateResult.entriesToMigrate[currentProject][contentTypeId];\n const existingCount =\n migrateResult.existing?.[currentProject]?.[contentTypeId] || 0;\n const existingPercent = ((existingCount / count) * 100).toFixed(0);\n const noChangeOrTotalEntriesCount =\n typeof migrateStatusAndCount !== 'number'\n ? migrateStatusAndCount?.['no change'] || 0\n : migrateStatusAndCount;\n\n const changedPercentage = (\n (noChangeOrTotalEntriesCount / count) *\n 100\n ).toFixed(0);\n\n const existingColor =\n existingPercent === '0' || action === 'delete'\n ? log.warningText\n : log.infoText;\n\n const changedColor = isTotalCountRow\n ? log.helpText\n : changedPercentage === '100'\n ? log.successText\n : log.warningText;\n\n if (isTotalCountRow && 'nodes' in migrateResult) {\n printNodesMigrateResult(service, migrateResult, {\n showAll,\n showDiff,\n showChanged,\n isEntriesMigration: true,\n });\n }\n console.log(\n ` - ${\n isTotalCountRow\n ? log.highlightText(\n `${contentTypeId}: ${noChangeOrTotalEntriesCount}`\n )\n : `${contentTypeId}: ${log.helpText(count)}`\n }${\n changedPercentage === '100' || isTotalCountRow\n ? ''\n : existingColor(` [existing: ${`${existingPercent}%`}]`)\n }${\n existingPercent === '0' || (action === 'import' && isTotalCountRow)\n ? ''\n : changedColor(\n ` ${\n isTotalCountRow\n ? `[to ${action}: ${noChangeOrTotalEntriesCount}]`\n : changedPercentage === '100'\n ? 'up to date'\n : `[needs update: ${100 - Number(changedPercentage)}%]`\n }`\n )\n }`\n );\n }\n }\n if (migrateResult.errors?.length) {\n console.log(\n ` - ${log.errorText(`errors: ${migrateResult.errors.length}`)}\\n`\n );\n for (const error of migrateResult.errors)\n log.error(error.message, null, '');\n }\n};\n\nexport const printNodesMigrateResult = (\n { log, currentProject }: ContensisCli,\n migrateResult: EntriesMigrationResult | NodesResult,\n {\n action = 'import',\n logLimit = 50,\n showDiff = false,\n showAll = false,\n showChanged = false,\n isEntriesMigration = false,\n }: {\n action?: 'import' | 'delete';\n logLimit?: number;\n showDiff?: boolean;\n showAll?: boolean;\n showChanged?: boolean;\n isEntriesMigration?: boolean;\n } = {}\n) => {\n if (!isEntriesMigration) log.raw(``);\n for (const [projectId, counts] of Object.entries(migrateResult.nodes || {})) {\n const importTitle =\n action === 'delete'\n ? `Delete from project ${log.warningText(currentProject)}`\n : `Import ${\n projectId && projectId !== 'null'\n ? `from project ${log.highlightText(projectId)} `\n : ''\n }to ${log.boldText(log.warningText(currentProject))}`;\n if (!isEntriesMigration) log.help(importTitle);\n\n const migrateStatusAndCount = migrateResult.nodesToMigrate[\n currentProject\n ] as ProjectNodesToMigrate;\n\n const existingCount = migrateResult.nodes?.[projectId]?.totalCount || 0;\n\n const totalCount = Object.keys(migrateResult.nodesToMigrate.nodeIds).length;\n const existingPercent = counts.totalCount\n ? ((existingCount / totalCount) * 100).toFixed(0)\n : '0';\n\n const noChangeCount = migrateStatusAndCount?.['no change'] || 0;\n\n const changedPercentage = counts.totalCount\n ? ((noChangeCount / totalCount) * 100).toFixed(0)\n : '0';\n\n const existingColor =\n existingPercent === '0' || action === 'delete'\n ? log.warningText\n : log.infoText;\n\n const changedColor =\n changedPercentage === '100' ? log.successText : log.warningText;\n\n if (!isEntriesMigration || migrateStatusAndCount.totalCount > 0)\n console.log(\n ` - ${log.highlightText(\n `${isEntriesMigration ? ' + nodes' : 'totalCount'}: ${\n migrateStatusAndCount.totalCount\n }`\n )}${\n changedPercentage === '100'\n ? ''\n : existingColor(` [existing: ${`${existingPercent}%`}]`)\n }${\n existingPercent === '0'\n ? ''\n : changedColor(\n ` ${\n changedPercentage === '100'\n ? 'up to date'\n : `[needs update: ${100 - Number(changedPercentage)}%]`\n }`\n )\n }`\n );\n }\n if (migrateResult.errors?.length) {\n console.log(\n ` - ${log.errorText(`errors: ${migrateResult.errors.length}`)}\\n`\n );\n\n log.limits(\n migrateResult.errors\n .map(error => {\n return log.errorText(deconstructApiError(error));\n })\n .join('\\n'),\n logLimit\n );\n }\n};\n\nconst highlightDiffText = (str: string) => {\n const addedRegex = new RegExp(/<<\\+>>(.*?)<<\\/\\+>>/, 'g');\n const removedRegex = new RegExp(/<<->>(.*?)<<\\/->>/, 'g');\n return str\n .replace(addedRegex, match => {\n return Logger.successText(\n match.replace(/<<\\+>>/g, '<+>').replace(/<<\\/\\+>>/g, '</+>')\n );\n })\n .replace(removedRegex, match => {\n return Logger.errorText(\n match.replace(/<<->>/g, '<->').replace(/<<\\/->>/g, '</->')\n );\n });\n};\n\nexport const printModelMigrationAnalysis = (\n { log, messages }: ContensisCli,\n result: any = {}\n) => {\n for (const [contentTypeId, model] of Object.entries(result) as [\n string,\n any,\n ][]) {\n let mainOutput = log.standardText(\n ` - ${contentTypeId}${\n model.contentTypeId ? ` ${log.helpText(model.contentTypeId)}` : ''\n }`\n );\n let extraOutput = '';\n let errorOutput = '';\n let diffOutput = '';\n for (const [key, details] of Object.entries(model) as [string, any][]) {\n if (key === 'dependencies') {\n extraOutput += log.infoText(\n ` references: [${details?.join(', ')}]\\n`\n );\n }\n if (key === 'dependencyOf') {\n extraOutput += log.infoText(\n ` required by: [${details?.join(', ')}]\\n`\n );\n }\n if (key === 'projects') {\n for (const [projectId, projectDetails] of Object.entries(details) as [\n string,\n any,\n ][]) {\n mainOutput += log.infoText(\n ` [${messages.migrate.status(projectDetails.status)(\n `${projectId}: ${projectDetails.status}`\n )}]${\n projectDetails.versionNo ? ` v${projectDetails.versionNo}` : ''\n }`\n );\n if (projectDetails.diff)\n diffOutput += ` ${log.highlightText(`diff:`)} ${log.infoText(\n highlightDiffText(projectDetails.diff)\n )}`;\n if (projectDetails.error)\n errorOutput += ` ${log.highlightText(\n `error::`\n )} ${log.errorText(projectDetails.error)}`;\n }\n }\n }\n console.log(mainOutput);\n if (extraOutput) {\n const search = '\\n';\n const replace = '';\n console.log(\n extraOutput.replace(\n new RegExp(search + '([^' + search + ']*)$'),\n replace + '$1'\n )\n );\n }\n if (diffOutput) console.log(diffOutput);\n if (errorOutput) console.log(errorOutput);\n }\n};\n\ntype MigrateResultSummary = MigrateModelsResult['']['contentTypes'];\ntype MigrateResultStatus = keyof MigrateResultSummary;\n\nexport const printModelMigrationResult = (\n { log, messages }: ContensisCli,\n result: MigrateResultSummary\n) => {\n for (const [status, ids] of Object.entries(result) as [\n MigrateResultStatus,\n string[],\n ][]) {\n if (ids?.length) {\n if (status === 'errors') {\n const errors: [string, MappedError][] = ids as any;\n log.raw(\n ` - ${status}: [ ${messages.migrate.models.result(status)(\n ids.map(id => id[0]).join(', ')\n )} ]\\n`\n );\n for (const [contentTypeId, error] of errors)\n log.error(\n `${log.highlightText(contentTypeId)}: ${error.message}`,\n error\n );\n } else\n log.raw(\n ` - ${status}: [ ${messages.migrate.models.result(status)(\n ids.join(', ')\n )} ]`\n );\n }\n }\n};\n\nexport const printNodeTreeOutput = (\n { log, messages }: ContensisCli,\n root: Node | Partial<MigrateNodesTree> | undefined,\n logDetail = 'errors',\n logLimit = 1000\n) => {\n log.raw('');\n const statusColour = messages.migrate.status;\n\n if (root && 'status' in root)\n log.info(\n `Migrate status: ${statusColour('no change')(\n 'N'\n )} [no change]; ${statusColour('create')('C')} [create]; ${statusColour(\n 'update'\n )('U')} [update]; ${statusColour('delete')('D')} [delete]; ${statusColour(\n 'error'\n )('E')} [error];`\n );\n log.info(\n `Node properties: ${log.highlightText(\n 'e'\n )} = has entry; ${log.highlightText('c')} = canonical; ${log.highlightText(\n 'm'\n )} = include in menu`\n );\n\n log.line();\n\n const outputNode = (\n node: Partial<Node | MigrateNodesTree>,\n spaces: string,\n isRoot = false\n ) => {\n const errorOutput =\n 'error' in node && node.error && deconstructApiError(node.error);\n const fullOutput = logDetail === 'all';\n const changesOutput =\n logDetail === 'changes' &&\n 'status' in node &&\n node.status &&\n ['create', 'update'].includes(node.status);\n\n const diffOutput =\n (fullOutput || changesOutput || errorOutput) &&\n 'diff' in node &&\n node.diff?.replaceAll('\\n', '');\n\n return `${\n 'status' in node && node.status\n ? `${statusColour(node.status)(\n node.status.substring(0, 1).toUpperCase()\n )} `\n : ''\n }${node.entry ? log.highlightText('e') : log.infoText('-')}${\n 'isCanonical' in node && node.isCanonical\n ? log.highlightText('c')\n : log.infoText('-')\n }${\n node.includeInMenu ? log.highlightText('m') : log.infoText('-')\n }${spaces}${log[\n 'status' in node && node.status === 'no change'\n ? 'infoText'\n : 'standardText'\n ](\n 'isCanonical' in node && node.isCanonical\n ? log.boldText(\n fullOutput || isRoot || !node.slug ? node.path : `/${node.slug}`\n )\n : fullOutput || isRoot || !node.slug\n ? node.path\n : `/${node.slug}`\n )}${node.entry ? ` ${log.helpText(node.entry.sys.contentTypeId)}` : ''}${\n node.childCount ? ` +${node.childCount}` : ``\n } ${'displayName' in node ? log.infoText(node.displayName) : ''}${\n fullOutput || (changesOutput && node.id !== node.originalId)\n ? `~n ${log.infoText(`id:`)} ${\n !('originalId' in node) || node.id === node.originalId\n ? node.id\n : `${node.id} ${log.infoText(`<= ${node.originalId}`)}`\n }`\n : ''\n }${\n (fullOutput ||\n (changesOutput && node.parentId !== node.originalParentId)) &&\n node.parentId\n ? `~n ${log.infoText(\n `parentId: ${\n !('originalParentId' in node) ||\n node.parentId === node.originalParentId\n ? node.parentId\n : `${node.parentId} <= ${node.originalParentId}`\n }`\n )}`\n : ''\n }${\n fullOutput && node.entry?.sys.id\n ? `~n ${log.infoText(`entryId: ${node.entry.sys.id}`)}`\n : ''\n }${\n errorOutput\n ? `~n${addNewLines(` ${log.errorText(errorOutput)}`, '~n')}`\n : ''\n }${\n diffOutput\n ? `~n${addNewLines(\n ` ${log.infoText(`diff: ${highlightDiffText(diffOutput)}`)}`,\n '~n'\n )}`\n : ''\n }`;\n };\n\n const outputChildren = (\n node: Partial<Node | MigrateNodesTree> | undefined,\n depth = 2\n ) => {\n let str = '';\n for (const child of ((node as any)?.children || []) as Node[]) {\n str += `${outputNode(child, Array(depth + 1).join(' '))}\\n`;\n if ('children' in child) str += outputChildren(child, depth + 1);\n }\n return str;\n };\n\n const children = outputChildren(root);\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,KAAK,qBAC3C,KAAK,WACD,OAAO,IAAI;AAAA,MACT,aACE,EAAE,sBAAsB,SACxB,KAAK,aAAa,KAAK,mBACnB,KAAK,WACL,GAAG,KAAK,QAAQ,OAAO,KAAK,gBAAgB,EAClD;AAAA,IACF,CAAC,KACD,EACN,GACE,gBAAc,UAAK,UAAL,mBAAY,IAAI,MAC1B,OAAO,IAAI,SAAS,YAAY,KAAK,MAAM,IAAI,EAAE,EAAE,CAAC,KACpD,EACN,GACE,cACI,SAAK,2BAAY,KAAK,IAAI,UAAU,WAAW,CAAC,IAAI,IAAI,CAAC,KACzD,EACN,GACE,aACI,SAAK;AAAA,MACH,KAAK,IAAI,SAAS,SAAS,kBAAkB,UAAU,CAAC,EAAE,CAAC;AAAA,MAC3D;AAAA,IACF,CAAC,KACD,EACN;AAAA,EACF;AAEA,QAAM,iBAAiB,CACrB,MACA,QAAQ,MACL;AACH,QAAI,MAAM;AACV,eAAW,UAAW,6BAAc,aAAY,CAAC,GAAc;AAC7D,aAAO,GAAG,WAAW,OAAO,MAAM,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;AAAA;AACxD,UAAI,cAAc,MAAO,QAAO,eAAe,OAAO,QAAQ,CAAC;AAAA,IACjE;AACA,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,eAAe,IAAI;AACpC,MAAI;AAAA,IACF,GAAG,WAAW,QAAQ,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,WAAW;AAAA,EAAK,QAAQ,KAAK,EAAE;AAAA,IACtE;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["dayjs", "_a"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var html_formatter_exports = {};
|
|
20
|
+
__export(html_formatter_exports, {
|
|
21
|
+
htmlFormatter: () => htmlFormatter
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(html_formatter_exports);
|
|
24
|
+
var import_json = require("./json.formatter");
|
|
25
|
+
const htmlFormatter = (entries, isDoc = true) => {
|
|
26
|
+
const flatEntries = [];
|
|
27
|
+
if (Array.isArray(entries))
|
|
28
|
+
for (const entry of entries) {
|
|
29
|
+
flatEntries.push((0, import_json.flattenObject)(entry));
|
|
30
|
+
}
|
|
31
|
+
else flatEntries.push((0, import_json.flattenObject)(entries));
|
|
32
|
+
const columns = new Set(flatEntries.map((e) => Object.keys(e)).flat());
|
|
33
|
+
let table = `<table id="contensis-cli-table"><thead><tr>`;
|
|
34
|
+
for (const column of columns) {
|
|
35
|
+
table += `<td>${column}</td>`;
|
|
36
|
+
}
|
|
37
|
+
table += `</tr></thead><tbody>`;
|
|
38
|
+
for (const row of flatEntries) {
|
|
39
|
+
table += `<tr>`;
|
|
40
|
+
for (const column of columns) {
|
|
41
|
+
const val = row[column];
|
|
42
|
+
table += `<td>${typeof val === "undefined" ? "" : val}</td>`;
|
|
43
|
+
}
|
|
44
|
+
table += `</tr>`;
|
|
45
|
+
}
|
|
46
|
+
table += `</tbody></table>`;
|
|
47
|
+
if (isDoc)
|
|
48
|
+
table = `<html><head>${headTag()}</head><body>${table}${scriptTag()}</body></html>`;
|
|
49
|
+
return table;
|
|
50
|
+
};
|
|
51
|
+
const headTag = () => {
|
|
52
|
+
return `<link rel="stylesheet" href="https://cdn.datatables.net/2.1.8/css/dataTables.dataTables.css" />
|
|
53
|
+
<script
|
|
54
|
+
src="https://code.jquery.com/jquery-3.7.1.slim.min.js"
|
|
55
|
+
integrity="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8="
|
|
56
|
+
crossorigin="anonymous"></script>
|
|
57
|
+
<script src="https://cdn.datatables.net/2.1.8/js/dataTables.js"></script>`;
|
|
58
|
+
};
|
|
59
|
+
const scriptTag = () => {
|
|
60
|
+
return `<script>
|
|
61
|
+
let table = new DataTable('#contensis-cli-table', {
|
|
62
|
+
pageLength: 50
|
|
63
|
+
});
|
|
64
|
+
</script>`;
|
|
65
|
+
};
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
htmlFormatter
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=html.formatter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/util/html.formatter.ts"],
|
|
4
|
+
"sourcesContent": ["import { flattenObject } from './json.formatter';\n\nexport const htmlFormatter = <T>(entries: T | T[], isDoc = true) => {\n // Flatten the passed in object\n const flatEntries = [] as any[];\n if (Array.isArray(entries))\n for (const entry of entries) {\n flatEntries.push(flattenObject(entry));\n }\n else flatEntries.push(flattenObject(entries));\n\n // Parse the flattened object to csv\n // const csv = stringify(flatEntries, { header: true });\n // Create an exhaustive list of columns from the entries array\n const columns = new Set<string>(flatEntries.map(e => Object.keys(e)).flat());\n\n let table = `<table id=\"contensis-cli-table\"><thead><tr>`;\n for (const column of columns) {\n table += `<td>${column}</td>`;\n }\n table += `</tr></thead><tbody>`;\n for (const row of flatEntries) {\n table += `<tr>`;\n for (const column of columns) {\n const val = row[column];\n table += `<td>${typeof val === 'undefined' ? '' : val}</td>`;\n }\n table += `</tr>`;\n }\n table += `</tbody></table>`;\n\n if (isDoc)\n table = `<html><head>${headTag()}</head><body>${table}${scriptTag()}</body></html>`;\n return table;\n};\n\nconst headTag = () => {\n return `<link rel=\"stylesheet\" href=\"https://cdn.datatables.net/2.1.8/css/dataTables.dataTables.css\" />\n<script\n src=\"https://code.jquery.com/jquery-3.7.1.slim.min.js\"\n integrity=\"sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8=\"\n crossorigin=\"anonymous\"></script>\n<script src=\"https://cdn.datatables.net/2.1.8/js/dataTables.js\"></script>`;\n};\n\nconst scriptTag = () => {\n return `<script>\nlet table = new DataTable('#contensis-cli-table', {\n pageLength: 50\n});\n</script>`;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA8B;AAEvB,MAAM,gBAAgB,CAAI,SAAkB,QAAQ,SAAS;AAElE,QAAM,cAAc,CAAC;AACrB,MAAI,MAAM,QAAQ,OAAO;AACvB,eAAW,SAAS,SAAS;AAC3B,kBAAY,SAAK,2BAAc,KAAK,CAAC;AAAA,IACvC;AAAA,MACG,aAAY,SAAK,2BAAc,OAAO,CAAC;AAK5C,QAAM,UAAU,IAAI,IAAY,YAAY,IAAI,OAAK,OAAO,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;AAE3E,MAAI,QAAQ;AACZ,aAAW,UAAU,SAAS;AAC5B,aAAS,OAAO,MAAM;AAAA,EACxB;AACA,WAAS;AACT,aAAW,OAAO,aAAa;AAC7B,aAAS;AACT,eAAW,UAAU,SAAS;AAC5B,YAAM,MAAM,IAAI,MAAM;AACtB,eAAS,OAAO,OAAO,QAAQ,cAAc,KAAK,GAAG;AAAA,IACvD;AACA,aAAS;AAAA,EACX;AACA,WAAS;AAET,MAAI;AACF,YAAQ,eAAe,QAAQ,CAAC,gBAAgB,KAAK,GAAG,UAAU,CAAC;AACrE,SAAO;AACT;AAEA,MAAM,UAAU,MAAM;AACpB,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAMT;AAEA,MAAM,YAAY,MAAM;AACtB,SAAO;AAAA;AAAA;AAAA;AAAA;AAKT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/util/logger.js
CHANGED
|
@@ -69,11 +69,10 @@ ${Logger.infoText(
|
|
|
69
69
|
if (progress.active) progress.current.interrupt(message);
|
|
70
70
|
else console.log(message);
|
|
71
71
|
};
|
|
72
|
-
static warning = (content) => {
|
|
72
|
+
static warning = (content, newline = "\n") => {
|
|
73
73
|
const message = `${Logger.getPrefix()} ${Logger.warningText(
|
|
74
74
|
`${Logger.isUserTerminal ? "\u26A0\uFE0F " : "[WARN]"} ${content}`
|
|
75
|
-
)}
|
|
76
|
-
`;
|
|
75
|
+
)}${newline}`;
|
|
77
76
|
if (progress.active) progress.current.interrupt(message);
|
|
78
77
|
else console.log(message);
|
|
79
78
|
};
|
package/dist/util/logger.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/util/logger.ts"],
|
|
4
|
-
"sourcesContent": ["import chalk from 'chalk';\nimport dateFormat from 'dateformat';\nimport deepCleaner from 'deep-cleaner';\nimport {\n ansiEscapeCodes,\n first,\n partition,\n strlen,\n} from 'printable-characters';\n// import ProgressBar from 'progress';\nimport { isSysError, tryStringify } from '.';\n\ntype LogMethod = (content: string) => void;\ntype LogErrorMethod = (content: string, err?: any, newline?: string) => void;\ntype LogJsonMethod = (content: any, depth?: number, indent?: string) => void;\ntype LogJsonDepthMethod = (content: any, depth?: number) => void;\ntype LogArrayMethod = (contentArray: string[]) => void;\ntype LogErrorFunc = (\n err: any,\n msg?: string,\n level?: 'error' | 'critical'\n) => void;\n\nexport class Logger {\n static isUserTerminal = !!process.stdout.columns;\n static getPrefix = () => {\n return Logger.isUserTerminal\n ? Logger.infoText(`[cli]`)\n : `[${dateFormat(new Date(), 'dd/mm HH:MM:ss')}]`;\n };\n static errorText = chalk.bold.red;\n static warningText = chalk.keyword('orange');\n static successText = chalk.keyword('green');\n static helpText = chalk.blue;\n static highlightText = chalk.yellow;\n static infoText = chalk.keyword('grey');\n static standardText = chalk.keyword('white');\n static boldText = chalk.bold;\n static critical: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n '[CRITICAL]'\n )} ${content}`;\n console.log(message);\n };\n static error: LogErrorMethod = (content, err, newline = '\\n') => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n `${Logger.isUserTerminal ? '\u274C' : '[ERROR]'} ${content}${\n err\n ? `\\n\\n${Logger.infoText(\n isSysError(err) ? err.toString() : JSON.stringify(err, null, 2)\n )}`\n : ''\n }`\n )}${newline}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static warning: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.warningText(\n `${Logger.isUserTerminal ? '\u26A0\uFE0F ' : '[WARN]'} ${content}`\n )}\\n`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n // }\n };\n static success: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.successText(\n `${Logger.isUserTerminal ? '\u2705' : '[OK]'} ${content}`\n )}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static info: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgCyan(' \u2139 ') : '[INFO]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static help: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${chalk.blue(\n `${Logger.isUserTerminal ? '\u23E9' : '[HELP]'} ${content}`\n )}\\n`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static standard: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? '\u25FB\uFE0F' : '[STD]'\n } \\n${Logger.standardText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n progress.current.interrupt(message);\n };\n static debug: LogMethod = content => {\n if (['true', '1'].includes(process.env.debug || '')) {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgGrey(' \u2699 ') : '[DEBUG]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n }\n };\n static json: LogJsonDepthMethod = (content, depth = 9) =>\n console.dir(deepCleaner(content), { colors: true, depth });\n static mixed: LogArrayMethod = contentArray =>\n console.log(`${Logger.getPrefix()} ${contentArray.join(' ')}`);\n static line = () =>\n Logger.raw(` ${Logger.infoText(`-------------------------------------`)}`);\n\n static object: LogJsonMethod = content => {\n for (const [key, value] of Object.entries(content || {})) {\n if (value && typeof value === 'object') {\n Logger.raw(` ${chalk.bold.grey(key)}:`);\n if (key === 'fields' && Array.isArray(value)) {\n for (const field of value || []) {\n Logger.raw(\n ` ${chalk.bold(field.id)}${\n field.id === content.entryTitleField\n ? '**'\n : field.validations.minCount?.value ||\n typeof field.validations.required?.message !== 'undefined'\n ? '*'\n : ''\n }: ${chalk.grey(\n `${field.dataType}${\n field.dataFormat\n ? `<${\n Array.isArray(\n field.validations.allowedFieldTypes?.fields\n )\n ? `composer[${field.validations.allowedFieldTypes.fields\n .map((f: any) => f.id)\n .join(' | ')}]`\n : field.dataFormat\n }${\n field.dataFormat === 'entry'\n ? `, ${field.validations.allowedContentTypes.contentTypes.join(\n ' | '\n )}`\n : ''\n }${\n field.dataFormat === 'contenttype'\n ? `[${field.validations?.allowedDataFormats.dataFormats.join(\n ' | '\n )}], ${(\n field.validations?.allowedIds?.ids || ['*']\n ).join(' | ')}`\n : ''\n }>`\n : ''\n }${\n field.validations.maxLength?.value\n ? `(${field.validations.maxLength.value})`\n : ''\n }`\n )}`\n );\n }\n } else if (key === 'groups' && Array.isArray(value)) {\n for (const group of value || []) {\n const description =\n Object.keys(group.description).length &&\n Object.values(group.description)?.[0];\n Logger.raw(\n ` ${chalk.bold(group.id)}${\n description\n ? `: ${chalk.grey(Object.values(group.description)?.[0])}`\n : ''\n }`\n );\n }\n } else {\n Logger.objectRecurse(value, 3, ' ');\n // for (const [innerkey, innervalue] of Object.entries(value)) {\n // if (innervalue && typeof innervalue === 'object') {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}:`);\n // console.table(innervalue);\n // } else if (\n // typeof innervalue !== 'undefined' &&\n // innervalue !== null\n // ) {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}: ${innervalue}`);\n // }\n // }\n }\n } else if (typeof value !== 'undefined' && value !== null) {\n const valueText =\n key === 'id' && typeof value === 'string'\n ? Logger.highlightText(value)\n : value;\n Logger.raw(` ${chalk.bold.grey(key)}: ${valueText}`);\n }\n }\n };\n\n static objectRecurse: LogJsonMethod = (content, depth = 3, indent = '') => {\n if (Array.isArray(content)) {\n for (const item of content) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n if (item.length)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n else {\n if (Array.isArray(item))\n Logger.raw(\n `${indent}${chalk.grey(`[`)}${item.join(', ')}${chalk.grey(\n `]`\n )}`\n );\n else if (typeof item === 'object' && item)\n Logger.objectRecurse(item, depth + 1, `${indent} `);\n else Logger.raw(`${indent}${item}`);\n }\n } else Logger.raw(`${indent}${item}`);\n }\n } else {\n let pos = 0;\n for (const [key, value] of Object.entries(content)) {\n if (key === 'stack') continue; // skip stack output for errors\n const thisIndent =\n pos === 0 ? `${indent.substring(0, indent.length - 2)}- ` : indent;\n if (Array.isArray(value)) {\n if (value.length) Logger.raw(`${thisIndent}${chalk.bold.grey(key)}:`);\n for (const item of value) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n } else {\n Logger.raw(`${indent} ${item}`);\n }\n }\n } else if (value && typeof value === 'object') {\n Logger.raw(`${indent}${chalk.bold.grey(key)}:`);\n\n Logger.objectRecurse(value, depth + 1, `${indent} `);\n // console.table(value);\n } else if (typeof value !== 'undefined' && value !== null) {\n Logger.raw(`${thisIndent}${chalk.bold.grey(key)}: ${value}`);\n }\n pos++;\n }\n }\n };\n static raw: LogMethod = (content: string) => {\n if (progress.active) progress.current.interrupt(content);\n else console.log(content);\n };\n\n static limits = (\n content: string,\n displayLength = 30,\n consoleWidth = process.stdout.columns,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n logMethod: Function = console.info\n ) => {\n if (consoleWidth) {\n const contentArray = content.endsWith('\\n')\n ? content.split('\\n').slice(0, -1)\n : content.split('\\n');\n const contentLines = contentArray.slice(\n 0,\n consoleWidth ? displayLength : undefined\n );\n for (const line of contentLines)\n logMethod(\n line\n .split('~n')\n .map(l =>\n consoleWidth && strlen(l) > consoleWidth\n ? first(l, consoleWidth)\n : l\n )\n .join('\\n')\n );\n } else {\n logMethod(content.replace(ansiEscapeCodes, '').replaceAll('~n', '\\n'));\n }\n\n const tableArray = content.split('\\n');\n if (consoleWidth && tableArray.length > displayLength)\n console.info(\n `\\n`,\n `- and ${tableArray.length - displayLength} more...\\n`\n );\n };\n}\n\nexport const logError: LogErrorFunc = (\n err = new Error('Undefined error'),\n msg,\n level = 'error'\n) => {\n Logger[level](msg || err.message || err?.data?.message || err.Message);\n (Array.isArray(err) ? err : [err]).map((error: AppError) => {\n if (typeof error === 'string') {\n Logger.raw(`${Logger.infoText(error)}\\n`);\n return;\n }\n if ('stack' in error) Logger.raw(` ${Logger.infoText(error.stack)}\\n`);\n if ('data' in error)\n Logger.raw(` ${Logger.infoText(tryStringify(error.data))}\\n`);\n });\n //Logger.line();\n return null;\n};\n\nexport const addNewLines = (\n message = '',\n newLineSeparater = '\\n',\n atPosition = process.stdout.columns\n) => {\n if (message === '' || atPosition === 0) {\n return '';\n }\n\n let result = '';\n let lengthCounter = 0;\n\n // Partition the message string into an array of\n // [nonPrintable, printable][]\n const partitioned = partition(message);\n const addSeparater = () => {\n // If line length counter has exceeded the console width\n // add a new line separater and reset the line length counter\n if (lengthCounter >= atPosition) {\n result += newLineSeparater;\n lengthCounter = 0;\n }\n };\n\n // Loop through the partitioned message parts\n for (const [nonPrintable, printable] of partitioned) {\n // Convert string to array as this will provide accurate\n // lengths and splicing methods with all unicode chars\n const textParts = Array.from(printable);\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // In the first iteration append the non printable unicode chars\n // to the beginning of the spliced text\n result += nonPrintable + text.join('');\n // Keep a count of the current line length\n // as one line of output could span multiple \"partitions\"\n lengthCounter += text.length;\n addSeparater();\n\n // Handle any remaining text in this \"partition\"\n while (textParts.length) {\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // Append the spliced text to the result\n result += text.join('');\n // Increase line length counter\n lengthCounter += text.length;\n addSeparater();\n }\n }\n return result;\n};\n\nexport const progress = {\n current: { interrupt: (x: string) => {} },\n active: false,\n // done: () => new ProgressBar('', 0),\n // colours: { green: '\\u001b[42m \\u001b[0m', red: '\\u001b[41m \\u001b[0m' },\n // current: new ProgressBar(`:bar`, {\n // complete: '=',\n // incomplete: ' ',\n // width: 20,\n // total: 100,\n // }),\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,wBAAuB;AACvB,0BAAwB;AACxB,kCAKO;AAEP,eAAyC;AAalC,MAAM,OAAO;AAAA,EAClB,OAAO,iBAAiB,CAAC,CAAC,QAAQ,OAAO;AAAA,EACzC,OAA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\n strlen,\n} from 'printable-characters';\n// import ProgressBar from 'progress';\nimport { isSysError, tryStringify } from '.';\n\ntype LogMethod = (content: string) => void;\ntype LogErrorMethod = (content: string, err?: any, newline?: string) => void;\ntype LogJsonMethod = (content: any, depth?: number, indent?: string) => void;\ntype LogJsonDepthMethod = (content: any, depth?: number) => void;\ntype LogArrayMethod = (contentArray: string[]) => void;\ntype LogErrorFunc = (\n err: any,\n msg?: string,\n level?: 'error' | 'critical'\n) => void;\n\nexport class Logger {\n static isUserTerminal = !!process.stdout.columns;\n static getPrefix = () => {\n return Logger.isUserTerminal\n ? Logger.infoText(`[cli]`)\n : `[${dateFormat(new Date(), 'dd/mm HH:MM:ss')}]`;\n };\n static errorText = chalk.bold.red;\n static warningText = chalk.keyword('orange');\n static successText = chalk.keyword('green');\n static helpText = chalk.blue;\n static highlightText = chalk.yellow;\n static infoText = chalk.keyword('grey');\n static standardText = chalk.keyword('white');\n static boldText = chalk.bold;\n static critical: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n '[CRITICAL]'\n )} ${content}`;\n console.log(message);\n };\n static error: LogErrorMethod = (content, err, newline = '\\n') => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n `${Logger.isUserTerminal ? '\u274C' : '[ERROR]'} ${content}${\n err\n ? `\\n\\n${Logger.infoText(\n isSysError(err) ? err.toString() : JSON.stringify(err, null, 2)\n )}`\n : ''\n }`\n )}${newline}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static warning: LogMethod = (content, newline = '\\n') => {\n const message = `${Logger.getPrefix()} ${Logger.warningText(\n `${Logger.isUserTerminal ? '\u26A0\uFE0F ' : '[WARN]'} ${content}`\n )}${newline}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n // }\n };\n static success: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.successText(\n `${Logger.isUserTerminal ? '\u2705' : '[OK]'} ${content}`\n )}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static info: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgCyan(' \u2139 ') : '[INFO]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static help: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${chalk.blue(\n `${Logger.isUserTerminal ? '\u23E9' : '[HELP]'} ${content}`\n )}\\n`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static standard: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? '\u25FB\uFE0F' : '[STD]'\n } \\n${Logger.standardText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n progress.current.interrupt(message);\n };\n static debug: LogMethod = content => {\n if (['true', '1'].includes(process.env.debug || '')) {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgGrey(' \u2699 ') : '[DEBUG]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n }\n };\n static json: LogJsonDepthMethod = (content, depth = 9) =>\n console.dir(deepCleaner(content), { colors: true, depth });\n static mixed: LogArrayMethod = contentArray =>\n console.log(`${Logger.getPrefix()} ${contentArray.join(' ')}`);\n static line = () =>\n Logger.raw(` ${Logger.infoText(`-------------------------------------`)}`);\n\n static object: LogJsonMethod = content => {\n for (const [key, value] of Object.entries(content || {})) {\n if (value && typeof value === 'object') {\n Logger.raw(` ${chalk.bold.grey(key)}:`);\n if (key === 'fields' && Array.isArray(value)) {\n for (const field of value || []) {\n Logger.raw(\n ` ${chalk.bold(field.id)}${\n field.id === content.entryTitleField\n ? '**'\n : field.validations.minCount?.value ||\n typeof field.validations.required?.message !== 'undefined'\n ? '*'\n : ''\n }: ${chalk.grey(\n `${field.dataType}${\n field.dataFormat\n ? `<${\n Array.isArray(\n field.validations.allowedFieldTypes?.fields\n )\n ? `composer[${field.validations.allowedFieldTypes.fields\n .map((f: any) => f.id)\n .join(' | ')}]`\n : field.dataFormat\n }${\n field.dataFormat === 'entry'\n ? `, ${field.validations.allowedContentTypes.contentTypes.join(\n ' | '\n )}`\n : ''\n }${\n field.dataFormat === 'contenttype'\n ? `[${field.validations?.allowedDataFormats.dataFormats.join(\n ' | '\n )}], ${(\n field.validations?.allowedIds?.ids || ['*']\n ).join(' | ')}`\n : ''\n }>`\n : ''\n }${\n field.validations.maxLength?.value\n ? `(${field.validations.maxLength.value})`\n : ''\n }`\n )}`\n );\n }\n } else if (key === 'groups' && Array.isArray(value)) {\n for (const group of value || []) {\n const description =\n Object.keys(group.description).length &&\n Object.values(group.description)?.[0];\n Logger.raw(\n ` ${chalk.bold(group.id)}${\n description\n ? `: ${chalk.grey(Object.values(group.description)?.[0])}`\n : ''\n }`\n );\n }\n } else {\n Logger.objectRecurse(value, 3, ' ');\n // for (const [innerkey, innervalue] of Object.entries(value)) {\n // if (innervalue && typeof innervalue === 'object') {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}:`);\n // console.table(innervalue);\n // } else if (\n // typeof innervalue !== 'undefined' &&\n // innervalue !== null\n // ) {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}: ${innervalue}`);\n // }\n // }\n }\n } else if (typeof value !== 'undefined' && value !== null) {\n const valueText =\n key === 'id' && typeof value === 'string'\n ? Logger.highlightText(value)\n : value;\n Logger.raw(` ${chalk.bold.grey(key)}: ${valueText}`);\n }\n }\n };\n\n static objectRecurse: LogJsonMethod = (content, depth = 3, indent = '') => {\n if (Array.isArray(content)) {\n for (const item of content) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n if (item.length)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n else {\n if (Array.isArray(item))\n Logger.raw(\n `${indent}${chalk.grey(`[`)}${item.join(', ')}${chalk.grey(\n `]`\n )}`\n );\n else if (typeof item === 'object' && item)\n Logger.objectRecurse(item, depth + 1, `${indent} `);\n else Logger.raw(`${indent}${item}`);\n }\n } else Logger.raw(`${indent}${item}`);\n }\n } else {\n let pos = 0;\n for (const [key, value] of Object.entries(content)) {\n if (key === 'stack') continue; // skip stack output for errors\n const thisIndent =\n pos === 0 ? `${indent.substring(0, indent.length - 2)}- ` : indent;\n if (Array.isArray(value)) {\n if (value.length) Logger.raw(`${thisIndent}${chalk.bold.grey(key)}:`);\n for (const item of value) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n } else {\n Logger.raw(`${indent} ${item}`);\n }\n }\n } else if (value && typeof value === 'object') {\n Logger.raw(`${indent}${chalk.bold.grey(key)}:`);\n\n Logger.objectRecurse(value, depth + 1, `${indent} `);\n // console.table(value);\n } else if (typeof value !== 'undefined' && value !== null) {\n Logger.raw(`${thisIndent}${chalk.bold.grey(key)}: ${value}`);\n }\n pos++;\n }\n }\n };\n static raw: LogMethod = (content: string) => {\n if (progress.active) progress.current.interrupt(content);\n else console.log(content);\n };\n\n static limits = (\n content: string,\n displayLength = 30,\n consoleWidth = process.stdout.columns,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n logMethod: Function = console.info\n ) => {\n if (consoleWidth) {\n const contentArray = content.endsWith('\\n')\n ? content.split('\\n').slice(0, -1)\n : content.split('\\n');\n const contentLines = contentArray.slice(\n 0,\n consoleWidth ? displayLength : undefined\n );\n for (const line of contentLines)\n logMethod(\n line\n .split('~n')\n .map(l =>\n consoleWidth && strlen(l) > consoleWidth\n ? first(l, consoleWidth)\n : l\n )\n .join('\\n')\n );\n } else {\n logMethod(content.replace(ansiEscapeCodes, '').replaceAll('~n', '\\n'));\n }\n\n const tableArray = content.split('\\n');\n if (consoleWidth && tableArray.length > displayLength)\n console.info(\n `\\n`,\n `- and ${tableArray.length - displayLength} more...\\n`\n );\n };\n}\n\nexport const logError: LogErrorFunc = (\n err = new Error('Undefined error'),\n msg,\n level = 'error'\n) => {\n Logger[level](msg || err.message || err?.data?.message || err.Message);\n (Array.isArray(err) ? err : [err]).map((error: AppError) => {\n if (typeof error === 'string') {\n Logger.raw(`${Logger.infoText(error)}\\n`);\n return;\n }\n if ('stack' in error) Logger.raw(` ${Logger.infoText(error.stack)}\\n`);\n if ('data' in error)\n Logger.raw(` ${Logger.infoText(tryStringify(error.data))}\\n`);\n });\n //Logger.line();\n return null;\n};\n\nexport const addNewLines = (\n message = '',\n newLineSeparater = '\\n',\n atPosition = process.stdout.columns\n) => {\n if (message === '' || atPosition === 0) {\n return '';\n }\n\n let result = '';\n let lengthCounter = 0;\n\n // Partition the message string into an array of\n // [nonPrintable, printable][]\n const partitioned = partition(message);\n const addSeparater = () => {\n // If line length counter has exceeded the console width\n // add a new line separater and reset the line length counter\n if (lengthCounter >= atPosition) {\n result += newLineSeparater;\n lengthCounter = 0;\n }\n };\n\n // Loop through the partitioned message parts\n for (const [nonPrintable, printable] of partitioned) {\n // Convert string to array as this will provide accurate\n // lengths and splicing methods with all unicode chars\n const textParts = Array.from(printable);\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // In the first iteration append the non printable unicode chars\n // to the beginning of the spliced text\n result += nonPrintable + text.join('');\n // Keep a count of the current line length\n // as one line of output could span multiple \"partitions\"\n lengthCounter += text.length;\n addSeparater();\n\n // Handle any remaining text in this \"partition\"\n while (textParts.length) {\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // Append the spliced text to the result\n result += text.join('');\n // Increase line length counter\n lengthCounter += text.length;\n addSeparater();\n }\n }\n return result;\n};\n\nexport const progress = {\n current: { interrupt: (x: string) => {} },\n active: false,\n // done: () => new ProgressBar('', 0),\n // colours: { green: '\\u001b[42m \\u001b[0m', red: '\\u001b[41m \\u001b[0m' },\n // current: new ProgressBar(`:bar`, {\n // complete: '=',\n // incomplete: ' ',\n // width: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AAY,MAAM,eAAe,GAAG;AACtC,WAAO;AAAA,EACT;AAEA,MAAI,SAAS;AACb,MAAI,gBAAgB;AAIpB,QAAM,kBAAc,uCAAU,OAAO;AACrC,QAAM,eAAe,MAAM;AAGzB,QAAI,iBAAiB,YAAY;AAC/B,gBAAU;AACV,sBAAgB;AAAA,IAClB;AAAA,EACF;AAGA,aAAW,CAAC,cAAc,SAAS,KAAK,aAAa;AAGnD,UAAM,YAAY,MAAM,KAAK,SAAS;AAEtC,UAAM,OAAO,UAAU,OAAO,GAAG,aAAa,aAAa;AAG3D,cAAU,eAAe,KAAK,KAAK,EAAE;AAGrC,qBAAiB,KAAK;AACtB,iBAAa;AAGb,WAAO,UAAU,QAAQ;AAEvB,YAAME,QAAO,UAAU,OAAO,GAAG,aAAa,aAAa;AAE3D,gBAAUA,MAAK,KAAK,EAAE;AAEtB,uBAAiBA,MAAK;AACtB,mBAAa;AAAA,IACf;AAAA,EACF;AACA,SAAO;AACT;AAEO,MAAM,WAAW;AAAA,EACtB,SAAS,EAAE,WAAW,CAAC,MAAc;AAAA,EAAC,EAAE;AAAA,EACxC,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASV;",
|
|
6
6
|
"names": ["dateFormat", "chalk", "deepCleaner", "text"]
|
|
7
7
|
}
|
package/dist/version.js
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
LIB_VERSION: () => LIB_VERSION
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const LIB_VERSION = "1.3.1-beta.
|
|
24
|
+
const LIB_VERSION = "1.3.1-beta.10";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
LIB_VERSION
|
package/dist/version.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/version.ts"],
|
|
4
|
-
"sourcesContent": ["export const LIB_VERSION = \"1.3.1-beta.
|
|
4
|
+
"sourcesContent": ["export const LIB_VERSION = \"1.3.1-beta.10\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/esbuild.config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const rimraf = require('rimraf');
|
|
1
|
+
const { rimraf } = require('rimraf');
|
|
2
2
|
const esbuild = require('esbuild');
|
|
3
3
|
const chalk = require('chalk');
|
|
4
4
|
const { globPlugin } = require('esbuild-plugin-glob');
|
|
@@ -11,7 +11,7 @@ const completed = `${chalk.green('[contensis-cli]')} Build successful 👍\n`;
|
|
|
11
11
|
console.time(completed);
|
|
12
12
|
console.time(' - rimraf complete');
|
|
13
13
|
|
|
14
|
-
rimraf('./dist'
|
|
14
|
+
rimraf('./dist').then(() => {
|
|
15
15
|
console.timeEnd(' - rimraf complete');
|
|
16
16
|
console.time(' - esbuild complete');
|
|
17
17
|
esbuild
|
|
@@ -43,5 +43,5 @@ rimraf('./dist', () => {
|
|
|
43
43
|
replaceTscAliasPaths();
|
|
44
44
|
console.timeEnd(' - replace alias paths');
|
|
45
45
|
console.timeEnd(completed);
|
|
46
|
-
})
|
|
46
|
+
});
|
|
47
47
|
});
|