@codeleap/cli 1.0.2 → 1.1.0

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/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,31 +0,0 @@
1
- import { waitFor } from '@codeleap/common'
2
- import { codeleapCommand } from '../lib/Command'
3
-
4
- import { spinWhileNotCompleted } from '../lib/spinner'
5
- import { chalk, inquirer, figlet } from '../lib'
6
-
7
- export const initCommand = codeleapCommand({
8
- name: 'init',
9
- parameters: [],
10
- alias: 'i',
11
- }, async ({_}) => {
12
- const answers = await inquirer.prompt([
13
- {
14
- message: `What's your name?`,
15
- default: 'Codeleap',
16
- name: 'name',
17
- },
18
- ])
19
-
20
- spinWhileNotCompleted(async () => {
21
- await waitFor(10000)
22
-
23
- console.log(chalk.greenBright(answers.name +', your awesomeness level is:'))
24
-
25
- console.log(chalk.yellow(figlet.textSync('Cacetinho')))
26
- }, {
27
- name: 'Measuring your awesomeness...',
28
- })
29
-
30
- })
31
-
package/src/index.ts DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
- import { cli } from 'cleye'
3
- import { initCommand } from './commands/init'
4
-
5
- cli({
6
- name: 'codeleap',
7
- commands: [
8
- initCommand,
9
- ],
10
- })
11
-
12
-
13
- export {}
@@ -1,10 +0,0 @@
1
- import { command } from 'cleye';
2
- import figlet from 'figlet'
3
- import chalk from 'chalk'
4
-
5
- export const codeleapCommand:typeof command = (opts, callback) => {
6
- return command(opts, async (...args) => {
7
- console.log(chalk.blue(figlet.textSync('Codeleap')))
8
- return await callback(...args)
9
- })
10
- }
package/src/lib/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export {default as figlet } from 'figlet'
2
- export {default as chalk } from 'chalk'
3
- export {default as inquirer } from 'inquirer'
@@ -1,21 +0,0 @@
1
- import { FunctionType } from '@codeleap/common';
2
- import { createSpinner, Options } from 'nanospinner';
3
-
4
- type SpinWhileNotCompletedOpts = Options & {
5
- name: string
6
- }
7
-
8
- export async function spinWhileNotCompleted(operation:FunctionType<[], Promise<any>>, opts:SpinWhileNotCompletedOpts){
9
- const {name, ...others} = opts
10
-
11
- const spinner = createSpinner(`${name}\n`, others)
12
-
13
- spinner.start()
14
-
15
-
16
- const result = await operation()
17
-
18
- spinner.success()
19
-
20
- return result
21
- }