@design-edito/cli 0.0.76 → 0.0.77
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/cli/assets/version.txt +1 -1
- package/package.json +1 -1
- package/upgrade/index.js +8 -8
- package/upgrade/index.js.map +3 -3
package/cli/assets/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.77
|
package/package.json
CHANGED
package/upgrade/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{spawn as
|
|
2
|
+
import{spawn as n}from"node:child_process";import t from"node:process";import{program as l}from"commander";import c from"prompts";import{Logs as e}from"@design-edito/tools/agnostic/misc/logs/index.js";var o={title:e.styles.title("Global upgrade of @design-edito/cli"),installed:e.styles.info(`
|
|
3
3
|
Currently installed NPM packages:
|
|
4
|
-
`)
|
|
5
|
-
Something went wrong while listing the globally installed NPM packages. Aborting.`)
|
|
6
|
-
Aborting.`)
|
|
7
|
-
`)
|
|
8
|
-
|
|
9
|
-
`)
|
|
4
|
+
`),listError:e.styles.error(`
|
|
5
|
+
Something went wrong while listing the globally installed NPM packages. Aborting.`),confirm:"You may be prompted for your sudo password to complete the installation. Do you want to continue?",aborting:e.styles.error(`
|
|
6
|
+
Aborting.`),installing:e.styles.important(`Installing @design-edito/cli globally...
|
|
7
|
+
`),success:e.styles.success(`
|
|
8
|
+
Success.
|
|
9
|
+
`),installationError:e.styles.error(`
|
|
10
10
|
Installation failed. Please check your permissions and try again.
|
|
11
|
-
`)),o.exit(t))})})});
|
|
11
|
+
`)};l.name("@design-edito/upgrade").description("Upgrades @design-edito/cli to the latest version available").action(async()=>{console.log(o.title),console.log(o.installed),n("npm",["list","-g"],{stdio:"inherit"}).on("exit",async s=>{if(s!==0)return console.log(o.listError),t.exit(s);let{proceedUpgrade:r}=await c({name:"proceedUpgrade",type:"confirm",message:o.confirm});if(r!==!0)return console.log(o.aborting),t.exit(1);console.log("");let a=n("sudo",["npm","i","-g","@design-edito/cli"],{stdio:"inherit"});console.log(o.installing),a.on("exit",i=>{i===0?console.log(o.success):(console.error(o.installationError),t.exit(i))})})});l.parse(t.argv);
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/upgrade/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/upgrade/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { spawn } from 'node:child_process'\nimport process from 'node:process'\nimport { program } from 'commander'\nimport prompts from 'prompts'\nimport { Logs } from '@design-edito/tools/agnostic/misc/logs/index.js'\n\nprogram\n .name('@design-edito/upgrade')\n .description('Upgrades @design-edito/cli to the latest version available')\n .action(async () => {\n console.log(
|
|
5
|
-
"mappings": "AAAA,OAAS,SAAAA,MAAa,qBACtB,OAAOC,MAAa,eACpB,OAAS,WAAAC,MAAe,YACxB,OAAOC,MAAa,UACpB,OAAS,QAAAC,MAAY,
|
|
6
|
-
"names": ["spawn", "process", "program", "prompts", "Logs", "code", "proceedUpgrade", "child2"]
|
|
4
|
+
"sourcesContent": ["import { spawn } from 'node:child_process'\nimport process from 'node:process'\nimport { program } from 'commander'\nimport prompts from 'prompts'\nimport { Logs } from '@design-edito/tools/agnostic/misc/logs/index.js'\n\nconst logged = {\n title: Logs.styles.title('Global upgrade of @design-edito/cli'),\n installed: Logs.styles.info('\\nCurrently installed NPM packages:\\n'),\n listError: Logs.styles.error('\\nSomething went wrong while listing the globally installed NPM packages. Aborting.'),\n confirm: 'You may be prompted for your sudo password to complete the installation. Do you want to continue?',\n aborting: Logs.styles.error('\\nAborting.'),\n installing: Logs.styles.important('Installing @design-edito/cli globally...\\n'),\n success: Logs.styles.success('\\nSuccess.\\n'),\n installationError: Logs.styles.error('\\nInstallation failed. Please check your permissions and try again.\\n')\n}\n\nprogram\n .name('@design-edito/upgrade')\n .description('Upgrades @design-edito/cli to the latest version available')\n .action(async () => {\n console.log(logged.title)\n console.log(logged.installed)\n const child1 = spawn('npm', ['list', '-g'], { stdio: 'inherit' })\n child1.on('exit', async code => {\n if (code !== 0) {\n console.log(logged.listError)\n return process.exit(code)\n }\n const { proceedUpgrade } = await prompts({\n name: 'proceedUpgrade',\n type: 'confirm',\n message: logged.confirm\n })\n if (proceedUpgrade !== true) {\n console.log(logged.aborting)\n return process.exit(1)\n }\n console.log('')\n const child2 = spawn('sudo', ['npm', 'i', '-g', '@design-edito/cli'], { stdio: 'inherit' })\n console.log(logged.installing)\n child2.on('exit', code => {\n if (code === 0) console.log(logged.success)\n else {\n console.error(logged.installationError)\n process.exit(code) \n }\n })\n })\n })\n\nprogram.parse(process.argv)\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,SAAAA,MAAa,qBACtB,OAAOC,MAAa,eACpB,OAAS,WAAAC,MAAe,YACxB,OAAOC,MAAa,UACpB,OAAS,QAAAC,MAAY,kDAErB,IAAMC,EAAS,CACb,MAAOD,EAAK,OAAO,MAAM,qCAAqC,EAC9D,UAAWA,EAAK,OAAO,KAAK;AAAA;AAAA,CAAuC,EACnE,UAAWA,EAAK,OAAO,MAAM;AAAA,kFAAqF,EAClH,QAAS,oGACT,SAAUA,EAAK,OAAO,MAAM;AAAA,UAAa,EACzC,WAAYA,EAAK,OAAO,UAAU;AAAA,CAA4C,EAC9E,QAASA,EAAK,OAAO,QAAQ;AAAA;AAAA,CAAc,EAC3C,kBAAmBA,EAAK,OAAO,MAAM;AAAA;AAAA,CAAuE,CAC9G,EAEAF,EACG,KAAK,uBAAuB,EAC5B,YAAY,4DAA4D,EACxE,OAAO,SAAY,CAClB,QAAQ,IAAIG,EAAO,KAAK,EACxB,QAAQ,IAAIA,EAAO,SAAS,EACbL,EAAM,MAAO,CAAC,OAAQ,IAAI,EAAG,CAAE,MAAO,SAAU,CAAC,EACzD,GAAG,OAAQ,MAAMM,GAAQ,CAC9B,GAAIA,IAAS,EACX,eAAQ,IAAID,E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