@design-edito/cli 0.0.77 → 0.0.78

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.
@@ -1 +1 @@
1
- 0.0.77
1
+ 0.0.78
package/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import m from"node:process";import{promises as l}from"node:fs";import f from"node:url";import r from"node:path";import{spawn as g}from"node:child_process";import{program as t}from"commander";var h=f.fileURLToPath(import.meta.url),a=r.dirname(h);t.name("@design-edito/cli").description("The home of @design-edito/cli's project");t.command("list").description("list all the available commands").action(j);t.command("version").description("print current version of the package").action(v);var w=await c();w.forEach(n=>{t.command(n,{hidden:!0}).allowUnknownOption(!0).action(async(...i)=>{let[o,e,s,...d]=m.argv;if(s===void 0)return t.help();if(!(await c()).includes(s))return t.help();let p=r.join(a,"../",s,"index.js");g(p,d,{stdio:"inherit"}).on("error",u=>console.error(`Failed to start subprogram '${s}':`,u))})});t.parse(m.argv);async function c(){let n=r.join(a,"assets/list.txt");return(await l.readFile(n,{encoding:"utf-8"})).split(`
2
+ import m from"node:process";import{promises as l}from"node:fs";import h from"node:url";import r from"node:path";import{spawn as g}from"node:child_process";import{program as n}from"commander";var v=h.fileURLToPath(import.meta.url),a=r.dirname(v);n.name("@design-edito/cli").description("The home of @design-edito/cli's project").option("-v, --version","output the current version").action(async t=>"version"in t?await p():n.help());n.command("list").description("list all the available commands").action(j);n.command("version").description("print current version of the package").action(p);var w=await c();w.forEach(t=>{n.command(t,{hidden:!0}).allowUnknownOption(!0).action(async(...i)=>{let[o,e,s,...d]=m.argv;if(s===void 0)return n.help();if(!(await c()).includes(s))return n.help();let u=r.join(a,"../",s,"index.js");g(u,d,{stdio:"inherit"}).on("error",f=>console.error(`Failed to start subprogram '${s}':`,f))})});n.parse(m.argv);async function c(){let t=r.join(a,"assets/list.txt");return(await l.readFile(t,{encoding:"utf-8"})).split(`
3
3
  `).map(o=>o.trim())}async function j(){let i=(await c()).map(o=>{let e=Object.assign(new Array(24).fill(" "),o.split("")).join("");return o==="cli"?`${e} # npx @design-edito/cli help`:`${e} # npx @design-edito/cli ${o} help`}).join(`
4
- `);console.log(i)}async function v(){let n=r.join(a,"assets/version.txt"),i=await l.readFile(n,{encoding:"utf-8"});console.log(i)}
4
+ `);console.log(i)}async function p(){let t=r.join(a,"assets/version.txt"),i=await l.readFile(t,{encoding:"utf-8"});console.log(i)}
5
5
  //# sourceMappingURL=index.js.map
package/cli/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/cli/index.ts"],
4
- "sourcesContent": ["import process from 'node:process'\nimport { promises as fs } from 'node:fs'\nimport url from 'node:url'\nimport path from 'node:path'\nimport { spawn } from 'node:child_process'\nimport { program } from 'commander'\n\nconst __filename = url.fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\nprogram\n .name('@design-edito/cli')\n .description('The home of @design-edito/cli\\'s project')\n \nprogram\n .command('list')\n .description('list all the available commands')\n .action(printCommands)\n\nprogram\n .command('version')\n .description('print current version of the package')\n .action(printVersion)\n\nconst subCommands = await listCommands()\nsubCommands.forEach(subCommand => {\n program\n .command(subCommand, { hidden: true })\n .allowUnknownOption(true)\n .action(async (...args) => {\n const [_nodePath, _thisPath, targetCommand, ...forwardedArgs] = process.argv\n if (targetCommand === undefined) return program.help()\n const commandsList = await listCommands()\n if (!commandsList.includes(targetCommand)) return program.help()\n const subprogramPath = path.join(__dirname, '../', targetCommand, 'index.js')\n const subprocess = spawn(subprogramPath, forwardedArgs, { stdio: 'inherit' })\n subprocess.on('error', err => console.error(`Failed to start subprogram '${targetCommand}':`, err))\n })\n})\n\nprogram.parse(process.argv)\n\nasync function listCommands () {\n const listFilePath = path.join(__dirname, 'assets/list.txt')\n const list = await fs.readFile(listFilePath, { encoding: 'utf-8' })\n return list.split('\\n').map(e => e.trim())\n}\n\nasync function printCommands () {\n const list = await listCommands()\n const output = list\n .map(c => {\n const twentyFourCharName = Object.assign(\n new Array(24).fill(' ') as string[],\n c.split('') as string[]\n ).join('')\n if (c === 'cli') return `${twentyFourCharName} # npx @design-edito/cli help`\n return `${twentyFourCharName} # npx @design-edito/cli ${c} help`\n })\n .join('\\n')\n console.log(output)\n return;\n}\n\nasync function printVersion () {\n const versionFilePath = path.join(__dirname, 'assets/version.txt')\n const version = await fs.readFile(versionFilePath, { encoding: 'utf-8' })\n console.log(version)\n return;\n}\n"],
5
- "mappings": "AAAA,OAAOA,MAAa,eACpB,OAAS,YAAYC,MAAU,UAC/B,OAAOC,MAAS,WAChB,OAAOC,MAAU,YACjB,OAAS,SAAAC,MAAa,qBACtB,OAAS,WAAAC,MAAe,YAExB,IAAMC,EAAaJ,EAAI,cAAc,YAAY,GAAG,EAC9CK,EAAYJ,EAAK,QAAQG,CAAU,EAEzCD,EACG,KAAK,mBAAmB,EACxB,YAAY,yCAA0C,EAEzDA,EACG,QAAQ,MAAM,EACd,YAAY,iCAAiC,EAC7C,OAAOG,CAAa,EAEvBH,EACG,QAAQ,SAAS,EACjB,YAAY,sCAAsC,EAClD,OAAOI,CAAY,EAEtB,IAAMC,EAAc,MAAMC,EAAa,EACvCD,EAAY,QAAQE,GAAc,CAChCP,EACG,QAAQO,EAAY,CAAE,OAAQ,EAAK,CAAC,EACpC,mBAAmB,EAAI,EACvB,OAAO,SAAUC,IAAS,CACzB,GAAM,CAACC,EAAWC,EAAWC,EAAe,GAAGC,CAAa,EAAIjB,EAAQ,KACxE,GAAIgB,IAAkB,OAAW,OAAOX,EAAQ,KAAK,EAErD,GAAI,EADiB,MAAMM,EAAa,GACtB,SAASK,CAAa,EAAG,OAAOX,EAAQ,KAAK,EAC/D,IAAMa,EAAiBf,EAAK,KAAKI,EAAW,MAAOS,EAAe,UAAU,EACzDZ,EAAMc,EAAgBD,EAAe,CAAE,MAAO,SAAU,CAAC,EACjE,GAAG,QAASE,GAAO,QAAQ,MAAM,+BAA+BH,CAAa,KAAMG,CAAG,CAAC,CACpG,CAAC,CACL,CAAC,EAEDd,EAAQ,MAAML,EAAQ,IAAI,EAE1B,eAAeW,GAAgB,CAC7B,IAAMS,EAAejB,EAAK,KAAKI,EAAW,iBAAiB,EAE3D,OADa,MAAMN,EAAG,SAASmB,EAAc,CAAE,SAAU,OAAQ,CAAC,GACtD,MAAM;AAAA,CAAI,EAAE,IAAIC,GAAKA,EAAE,KAAK,CAAC,CAC3C,CAEA,eAAeb,GAAiB,CAE9B,IAAMc,GADO,MAAMX,EAAa,GAE7B,IAAIY,GAAK,CACR,IAAMC,EAAqB,OAAO,OAChC,IAAI,MAAM,EAAE,EAAE,KAAK,GAAG,EACtBD,EAAE,MAAM,EAAE,CACZ,EAAE,KAAK,EAAE,EACT,OAAIA,IAAM,MAAc,GAAGC,CAAkB,gCACtC,GAAGA,CAAkB,4BAA4BD,CAAC,OAC3D,CAAC,EACA,KAAK;AAAA,CAAI,EACZ,QAAQ,IAAID,CAAM,CAEpB,CAEA,eAAeb,GAAgB,CAC7B,IAAMgB,EAAkBtB,EAAK,KAAKI,EAAW,oBAAoB,EAC3DmB,EAAU,MAAMzB,EAAG,SAASwB,EAAiB,CAAE,SAAU,OAAQ,CAAC,EACxE,QAAQ,IAAIC,CAAO,CAErB",
6
- "names": ["process", "fs", "url", "path", "spawn", "program", "__filename", "__dirname", "printCommands", "printVersion", "subCommands", "listCommands", "subCommand", "args", "_nodePath", "_thisPath", "targetCommand", "forwardedArgs", "subprogramPath", "err", "listFilePath", "e", "output", "c", "twentyFourCharName", "versionFilePath", "version"]
4
+ "sourcesContent": ["import process from 'node:process'\nimport { promises as fs } from 'node:fs'\nimport url from 'node:url'\nimport path from 'node:path'\nimport { spawn } from 'node:child_process'\nimport { program } from 'commander'\n\nconst __filename = url.fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\nprogram\n .name('@design-edito/cli')\n .description('The home of @design-edito/cli\\'s project')\n .option('-v, --version', 'output the current version')\n .action(async options => 'version' in options\n ? await printVersion()\n : program.help())\n \nprogram\n .command('list')\n .description('list all the available commands')\n .action(printCommands)\n\nprogram\n .command('version')\n .description('print current version of the package')\n .action(printVersion)\n\nconst subCommands = await listCommands()\nsubCommands.forEach(subCommand => {\n program\n .command(subCommand, { hidden: true })\n .allowUnknownOption(true)\n .action(async (...args) => {\n const [_nodePath, _thisPath, targetCommand, ...forwardedArgs] = process.argv\n if (targetCommand === undefined) return program.help()\n const commandsList = await listCommands()\n if (!commandsList.includes(targetCommand)) return program.help()\n const subprogramPath = path.join(__dirname, '../', targetCommand, 'index.js')\n const subprocess = spawn(subprogramPath, forwardedArgs, { stdio: 'inherit' })\n subprocess.on('error', err => console.error(`Failed to start subprogram '${targetCommand}':`, err))\n })\n})\n\nprogram.parse(process.argv)\n\nasync function listCommands () {\n const listFilePath = path.join(__dirname, 'assets/list.txt')\n const list = await fs.readFile(listFilePath, { encoding: 'utf-8' })\n return list.split('\\n').map(e => e.trim())\n}\n\nasync function printCommands () {\n const list = await listCommands()\n const output = list\n .map(c => {\n const twentyFourCharName = Object.assign(\n new Array(24).fill(' ') as string[],\n c.split('') as string[]\n ).join('')\n if (c === 'cli') return `${twentyFourCharName} # npx @design-edito/cli help`\n return `${twentyFourCharName} # npx @design-edito/cli ${c} help`\n })\n .join('\\n')\n console.log(output)\n return;\n}\n\nasync function printVersion () {\n const versionFilePath = path.join(__dirname, 'assets/version.txt')\n const version = await fs.readFile(versionFilePath, { encoding: 'utf-8' })\n console.log(version)\n return;\n}\n"],
5
+ "mappings": "AAAA,OAAOA,MAAa,eACpB,OAAS,YAAYC,MAAU,UAC/B,OAAOC,MAAS,WAChB,OAAOC,MAAU,YACjB,OAAS,SAAAC,MAAa,qBACtB,OAAS,WAAAC,MAAe,YAExB,IAAMC,EAAaJ,EAAI,cAAc,YAAY,GAAG,EAC9CK,EAAYJ,EAAK,QAAQG,CAAU,EAEzCD,EACG,KAAK,mBAAmB,EACxB,YAAY,yCAA0C,EACtD,OAAO,gBAAiB,4BA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AAGC,CAAkB,gCACtC,GAAGA,CAAkB,4BAA4BD,CAAC,OAC3D,CAAC,EACA,KAAK;AAAA,CAAI,EACZ,QAAQ,IAAID,CAAM,CAEpB,CAEA,eAAed,GAAgB,CAC7B,IAAMiB,EAAkBvB,EAAK,KAAKI,EAAW,oBAAoB,EAC3DoB,EAAU,MAAM1B,EAAG,SAASyB,EAAiB,CAAE,SAAU,OAAQ,CAAC,EACxE,QAAQ,IAAIC,CAAO,CAErB",
6
+ "names": ["process", "fs", "url", "path", "spawn", "program", "__filename", "__dirname", "options", "printVersion", "printCommands", "subCommands", "listCommands", "subCommand", "args", "_nodePath", "_thisPath", "targetCommand", "forwardedArgs", "subprogramPath", "err", "listFilePath", "e", "output", "c", "twentyFourCharName", "versionFilePath", "version"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design-edito/cli",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "description": "",
5
5
  "author": "Maxime Fabas",
6
6
  "license": "ISC",
@@ -14,8 +14,8 @@
14
14
  "bin": {
15
15
  "cli": "./cli/index.js",
16
16
  "make-template": "./make-template/index.js",
17
- "tree": "./tree/index.js",
18
- "upgrade": "./upgrade/index.js"
17
+ "upgrade": "./upgrade/index.js",
18
+ "tree": "./tree/index.js"
19
19
  },
20
20
  "dependencies": {
21
21
  "@design-edito/tools": "^0.1.8",