creatium 0.1.9 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +32 -1475
  2. package/dist/main.mjs +237 -441
  3. package/package.json +4 -3
package/README.md CHANGED
@@ -1,1512 +1,73 @@
1
- <!-- AUTOGEN BY DOVENV - START
2
- Do not edit this file -->
3
-
4
1
  # Creatium
5
2
 
6
3
  [![Web](https://img.shields.io/badge/Web-grey?style=for-the-badge&logoColor=white)](https://pigeonposse.com)
7
4
  [![About Us](https://img.shields.io/badge/About%20Us-grey?style=for-the-badge&logoColor=white)](https://pigeonposse.com?popup=about)
8
5
  [![Donate](https://img.shields.io/badge/Donate-pink?style=for-the-badge&logoColor=white)](https://pigeonposse.com/?popup=donate)
9
- [![Github](https://img.shields.io/badge/Github-black?style=for-the-badge&logo=github&logoColor=white)](https://github.com/pigeonposse)
10
- [![Twitter](https://img.shields.io/badge/Twitter-black?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/pigeonposse_)
11
- [![Instagram](https://img.shields.io/badge/Instagram-black?style=for-the-badge&logo=instagram&logoColor=white)](https://www.instagram.com/pigeon.posse/)
12
- [![Medium](https://img.shields.io/badge/Medium-black?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/@pigeonposse)
13
-
14
-
15
- [![License](https://img.shields.io/github/license/pigeonposse/creatium?color=green&style=for-the-badge&logoColor=white)](https://github.com/pigeonposse/creatium/blob/main/LICENSE)
16
- [![Version](https://img.shields.io/npm/v/creatium?color=blue&style=for-the-badge&label=Version)](https://www.npmjs.com/package/creatium)
17
-
18
- ## 🤔 What is it `creatium`?
19
-
20
- `creatium` is a JavaScript Library for creating project templates.
21
-
22
- > Useful for create-binaries like `pnpm create backan`
6
+ [![Twitter](https://img.shields.io/badge/Twitter-black?style=for-the-badge&logoColor=white&logo=twitter)](https://twitter.com/pigeonposse_)
7
+ [![Instagram](https://img.shields.io/badge/Instagram-black?style=for-the-badge&logoColor=white&logo=instagram)](https://www.instagram.com/pigeon.posse/)
8
+ [![Medium](https://img.shields.io/badge/Medium-black?style=for-the-badge&logoColor=white&logo=medium)](https://medium.com/@pigeonposse)
23
9
 
24
- [Read more](https://www.npmjs.com/package/creatium)
10
+ [![BANNER](https://github.com/pigeonposse/creatium/blob/main/docs/public/banner.png?raw=true)](https://creatium.pigeonposse.com)
25
11
 
26
- Demo of the `creatium` library:
12
+ [![License](https://img.shields.io/github/license/pigeonposse/creatium?style=for-the-badge&color=green&logoColor=white)](/LICENSE)
13
+ [![Version](https://img.shields.io/npm/v/creatium?style=for-the-badge&color=blue&label=Version)](https://www.npmjs.com/package/creatium)
27
14
 
28
- ![demo](https://github.com/pigeonposse/creatium/raw/main/docs/public/example.gif)
15
+ Build your create-bins quickly and easily
29
16
 
30
17
  ## Table of contents
31
18
 
32
- - [🤔 What is it `creatium`?](#-what-is-it-creatium)
33
- - [📄 Description](#-description)
19
+ - [What is it `creatium`?](#what-is-it-creatium)
34
20
  - [🔑 Installation](#-installation)
35
- - [🚀 Usage](#-usage)
36
- - [Simple use case](#simple-use-case)
37
- - [Advanced use case](#advanced-use-case)
38
- - [Api documentation](#api-documentation)
39
- - [Classes](#classes)
40
- - [Type Aliases](#type-aliases)
41
- - [Variables](#variables)
21
+ - [More](#more)
42
22
  - [👨‍💻 Development](#-development)
43
23
  - [☕ Donate](#-donate)
44
24
  - [📜 License](#-license)
45
25
  - [🐦 About us](#-about-us)
46
26
 
47
27
 
48
- ## 📄 Description
49
-
50
- Build your create-bins quickly and easily
51
-
52
-
53
- ## 🔑 Installation
54
-
55
- ```bash
56
- npm install creatium
57
- # or
58
- pnpm add creatium
59
- # or
60
- yarn add creatium
61
- # or
62
- deno install creatium
63
- # or
64
- bun add creatium
65
- ```
66
-
67
- ## 🚀 Usage
68
-
69
- Create a cli and a library project with `creatium`
70
-
71
- ### Simple use case
72
-
73
- Recommended for most use cases.
74
-
75
- Below we show a practical example.
76
-
77
- > {my-library-name} refers to the name of your library. Change it to the name of your library.
78
-
79
- #### Project structure
80
-
81
- Create a project with the following structure:
82
-
83
- ```text
84
- 📂 data
85
- ├── 📂 templates
86
- │ ├── 📂 js-project
87
- │ │ └── ... (files, folders...)
88
- │ └── 📂 ts-project
89
- │ └── ... (files, folders...)
90
- 📂 src
91
- ├── bin.js
92
- ├── lib.js
93
- ├── core.js
94
- 📄 package.json
95
-
96
- ```
97
-
98
- #### src/core.js
99
-
100
- Create a new instance of `creatium` and export it as `core`
101
-
102
- ```javascript
103
-
104
- import { dirname, join } from 'node:path'
105
- import { fileURLToPath } from 'node:url'
106
- import { version } from './package.json'
107
- import { Creatium } from 'creatium'
108
-
109
- const currentDir = join( dirname( fileURLToPath( import.meta.url ) ) )
110
- const templatesDir = join( currentDir, '..', 'data','templates' ) // absolute path for `templates` folder
111
-
112
- export const core = new Creatium( {
113
- name: '{my-library-name}', // recomended use the name of your package.json becasue it will be used by updater function
114
- version,
115
- templates : {
116
- js : {
117
- input : join( templatesDir, 'js-project' ),
118
- name : 'JavaScript project',
119
- },
120
- ts : {
121
- input : join( templatesDir, 'ts-project' ),
122
- name : 'TypeScript project',
123
- },
124
- },
125
- } )
126
- ```
127
-
128
- #### src/bin.js
129
-
130
- Create a bin file and call the `cli` method of the `core` instance.
131
-
132
- ```javascript
133
-
134
- #!/usr/bin/env node
135
-
136
- // create cli
137
- import { core } from './core.js'
138
- await core.cli()
139
- ```
140
-
141
- #### src/lib.js
142
-
143
- Create a library file and export the `create` function for use outside.
144
-
145
- ```javascript
146
- import { core } from './core.js'
147
-
148
- /**
149
- * Create project template.
150
- * @param {Parameters<typeof core.build>[0]} params - The parameters required for creation.
151
- * @returns {Promise<Object>} A promise that resolves to the result of the creation process.
152
- */
153
- export const create = async ( params ) => {
154
-
155
- return await core.build( params )
156
-
157
- }
158
- ```
159
-
160
- #### package.json
161
-
162
- Create a package.json file with the following structure:
163
-
164
- ```json
165
- {
166
- "name": "create-{my-library-name}",
167
- "version": "0.0.1",
168
- "type": "module",
169
- "main": "src/lib.js",
170
- "module": "src/lib.js",
171
- "bin": {
172
- "create-{my-library-name}": "src/bin.js"
173
- },
174
- "scripts": {
175
- "dev": "node src/bin.js",
176
- },
177
- "files": [
178
- "src",
179
- "data",
180
- ]
181
- }
182
- ```
183
-
184
- #### Data (templates)
185
-
186
- Create a data folder with your `templates`.
187
-
188
- ```text
189
- 📂 data
190
- ├── 📂 templates
191
- │ ├── 📂 js-project
192
- │ │ └── ... (files, folders...)
193
- │ ├── 📂 ts-project
194
- │ │ └── ... (files, folders...)
195
-
196
- ```
197
-
198
- #### Execute
199
-
200
- Once the package is published you can use it with:
201
-
202
- ```bash
203
- npm create {my-library-name}
204
- # or
205
- pnpm create {my-library-name}
206
- # or
207
- yarn create {my-library-name}
208
- # or
209
- bun create {my-library-name}
210
- # or
211
- deno create {my-library-name}
212
- ```
213
-
214
- ### Advanced use case
215
-
216
- You can use the `CreatiumCore` class to create a fully customized __cli__ and __user prompt__.
217
-
218
- This class is the one that the main `Creatium` class uses to function.
219
-
220
- Below we show a practical example.
221
-
222
- > {my-library-name} refers to the name of your library. Change it to the name of your library.
223
-
224
- #### Project structure
225
-
226
- Create a project with the following structure:
227
-
228
- ```text
229
- 📂 data
230
- ├── 📂 templates
231
- │ ├── 📂 js-project
232
- │ │ └── ... (files, folders...)
233
- │ ├── 📂 ts-project
234
- │ │ └── ... (files, folders...)
235
- │ 📂 partials
236
- │ ├── 📂 workspace (used in example)
237
- │ │ └── ... (files, folders...)
238
- │ └── 📂 .../
239
- 📂 src
240
- ├── bin.js
241
- ├── lib.js
242
- ├── core.js
243
- 📄 package.json
244
-
245
- ```
246
-
247
- #### src/core.js
248
-
249
- - Create a new instance of `CreatiumCore` and export it as `core`
250
- - Create and export `createTemplate` function for use outside in `src/lib.js` and `src/bin.js`
251
-
252
- ```javascript
253
- import { dirname, join } from 'node:path'
254
- import { fileURLToPath } from 'node:url'
255
- import { version } from './package.json'
256
- import { CreatiumCore } from 'creatium'
257
-
258
- const currentDir = join( dirname( fileURLToPath( import.meta.url ) ) )
259
- const dataDir = join( currentDir, '..', 'data' ) // Absolute path for the `data` folder
260
- const partialsDir = join( dataDir, 'partials' )
261
- const templatesDir = join( dataDir, 'templates' )
262
-
263
- export const core = new CreatiumCore( {
264
- name: '{my-library-name}',
265
- version,
266
- updater : true,
267
- cache : true,
268
- prompt : {
269
- output : {
270
- type : 'output',
271
- alias : [ 'o' ],
272
- desc : 'Where do you want create a new project?',
273
- },
274
- name : {
275
- type : 'name',
276
- alias : [ 'n' ],
277
- },
278
- wsFiles : {
279
- type : 'boolean',
280
- desc : 'Include workspace files',
281
- promptMsg : 'Do you want add a workspace files like LICENSE, .npmrc and .gitignore?',
282
- },
283
- desc : {
284
- type : 'text',
285
- desc : 'Add a description of your project',
286
- },
287
- input : {
288
- type : 'template',
289
- desc : 'Select template',
290
- options : {
291
- js : {
292
- input : join( templatesDir, 'js-project' ),
293
- name : 'JavaScript project',
294
- },
295
- ts : {
296
- input : join( templatesDir, 'ts-project' ),
297
- name : 'TypeScript project',
298
- },
299
- },
300
- },
301
- install : {
302
- type : 'install',
303
- desc : 'Select package manager',
304
- onlyOptions : [
305
- 'pnpm',
306
- 'npm',
307
- 'deno',
308
- ], // Only these package managers can be selected
309
- },
310
- openEditor : { type: 'openEditor' },
311
- },
312
- } )
313
-
314
- /**
315
- * Function for create a new project template.
316
- * @param {Awaited<ReturnType<typeof core.cli>>} params - The values to create the template.
317
- * @returns {Promise<void>} - A promise that resolves when the template is created.
318
- */
319
- export const createTemplate = async ( params ) => {
320
-
321
- try {
322
-
323
- const {
324
- output,
325
- input,
326
- install,
327
- openEditor,
328
- name,
329
- wsFiles,
330
- } = params
331
-
332
- const { prompt } = core.utils // extract prompt utils and use it for write in prompt line
333
-
334
- // Copy the workspace partials folder if wsFiles is true.
335
- // this must be first than the creatium.createTemplate because creatium.createTemplate ends the line process
336
- // and wsFiles must be override in the creatium.createTemplate function.
337
- if ( wsFiles ) {
338
-
339
- await core.copyDir( {
340
- input : join( partialsDir, 'workspace' ),
341
- output,
342
- } )
343
-
344
- prompt.log.success( 'Added workspace files!' )
345
-
346
- }
347
-
348
- // example of dynamic pkg json config
349
- const pkgJSON = {
350
- name : name,
351
- description : consts.desc,
352
- version : '0.0.1',
353
- license : wsFiles ? 'MIT' : undefined
354
- }
355
-
356
- await core.createTemplate( {
357
- output,
358
- input,
359
- install,
360
- openEditor,
361
- name,
362
- // custom parameters for been susbstituted in the template files
363
- consts : {
364
- // example of dynamic pkg json config
365
- pkg : JSON.stringify( pkgJSON, null, 2 ),
366
- },
367
- } )
368
-
369
- }
370
- catch ( error ) {
371
-
372
- if ( error instanceof Error ) prompt.log.error( error.message ) // show error message in prompt line
373
- else console.error( 'Unexpected error:', error )
374
-
375
- core.cancel() // cancel the process
376
-
377
- }
378
-
379
- }
380
-
381
- ```
382
-
383
- #### src/bin.js
384
-
385
- Create a bin file and call the `cli` method of the `core` instance.
386
-
387
- ```javascript
388
- #!/usr/bin/env node
389
-
390
- import { core, createTemplate } from './core.js'
391
- // Run the CLI and obtain the prompt values
392
- const res = await core.cli()
393
- // Call to the create function for create the template
394
- await createTemplate( res )
395
-
396
- ```
397
-
398
- #### src/lib.js
399
-
400
- Create a library file and export the `create` function for use outside.
401
-
402
- ```javascript
403
- import { core, createTemplate } from './core.js'
404
-
405
- /**
406
- * Create project template.
407
- * @param {Parameters<typeof core.build>[0]} params - The parameters required for creation.
408
- * @returns {Promise<Object>} A promise that resolves to the result of the creation process.
409
- */
410
- export const create = async ( params ) => {
411
-
412
- const res = await core.build( params )
413
- await createTemplate( res )
414
- return res
28
+ ## What is it `creatium`?
415
29
 
416
- }
417
- ```
418
-
419
- #### package.json
30
+ `creatium` is a JavaScript Library for creating project templates.
420
31
 
421
- Create a package.json file with the following structure:
32
+ > Useful for create-binaries like `pnpm create backan`
422
33
 
423
- ```json
424
- {
425
- "name": "create-{my-library-name}",
426
- "version": "0.0.1",
427
- "type": "module",
428
- "main": "src/lib.js",
429
- "module": "src/lib.js",
430
- "bin": {
431
- "create-{my-library-name}": "src/bin.js"
432
- },
433
- "scripts": {
434
- "dev": "node src/bin.js",
435
- },
436
- "files": [
437
- "src",
438
- "data",
439
- ]
440
- }
441
- ```
34
+ [Read more](https://www.npmjs.com/package/creatium)
442
35
 
443
- #### Data (templates & partials)
36
+ Demo of the `creatium` library:
444
37
 
445
- Create a data folder with your templates and your partials.
38
+ ![demo](https://github.com/pigeonposse/creatium/raw/main/docs/public/example.gif)
446
39
 
447
- ```text
448
- 📂 data
449
- ├── 📂 templates
450
- │ ├── 📂 js-project
451
- │ │ └── ... (files, folders...)
452
- │ ├── 📂 ts-project
453
- │ │ └── ... (files, folders...)
454
- │ 📂 partials
455
- │ ├── 📂 workspace (used in example)
456
- │ │ └── ... (files, folders...)
457
- │ └── 📂 .../
458
-
459
- ```
460
40
 
461
- #### Execute
462
41
 
463
- Once the package is published you can use it with:
42
+ ## 🔑 Installation
464
43
 
465
- ```bash
466
- npm create {my-library-name}
44
+ ```bash
45
+ npm install creatium
467
46
  # or
468
- pnpm create {my-library-name}
47
+ pnpm install creatium
469
48
  # or
470
- yarn create {my-library-name}
49
+ yarn add creatium
471
50
  # or
472
- bun create {my-library-name}
51
+ bun add creatium
473
52
  # or
474
- deno create {my-library-name}
475
- ```
476
-
477
-
478
- ## Api documentation
479
-
480
- ### Classes
481
-
482
- #### Creatium
483
-
484
- Class of `Creatium` for create project templates (CLI and Library).
485
-
486
- ##### Example
487
-
488
- ```ts
489
- //////////////// core.js ///////////////////
490
-
491
- import { Creatium } from 'creatium'
492
- export const core = new Creatium({
493
- name: 'My Project',
494
- version: '1.0.0',
495
- templates: {
496
- ...
497
- },
498
- })
499
-
500
- //////////////// bin.js ///////////////////
501
-
502
- import { core } from './core.js'
503
- core.cli()
504
-
505
- //////////////// lib.js ///////////////////
506
-
507
- import { core } from './core.js'
508
- export const create = core.build
509
- ```
510
-
511
- ##### Constructors
512
-
513
- ###### new Creatium()
514
-
515
- ```ts
516
- new Creatium(options: {
517
- cache: boolean;
518
- consts: Record<string, string>;
519
- intro: false | (data: HookParams) => Response<void>;
520
- name: string;
521
- onCancel: false | (data: HookParams) => Response<void>;
522
- opts: {
523
- install: false | [
524
- | "bun"
525
- | "deno"
526
- | "npm"
527
- | "pnpm"
528
- | "yarn",
529
- | "bun"
530
- | "deno"
531
- | "npm"
532
- | "pnpm"
533
- | "yarn", ...("bun" | "deno" | "npm" | "pnpm" | "yarn")[]];
534
- name: boolean;
535
- openEditor: false | ["code" | "subl" | "webstorm", "code" | "subl" | "webstorm", ...("code" | "subl" | "webstorm")[]];
536
- };
537
- outro: false | (data: HookParams) => Response<void>;
538
- templates: {};
539
- updater: boolean;
540
- version: string;
541
- }): Creatium
542
- ```
543
-
544
- ###### Parameters
545
-
546
- | Parameter | Type | Description |
547
- | ------ | ------ | ------ |
548
- | `options` | `object` | - |
549
- | `options.cache`? | `boolean` | Use cache **Default** `true` |
550
- | `options.consts`? | `Record`\<`string`, `string`\> | Add consts to use in your templates. |
551
- | `options.intro`? | `false` \| (`data`: `HookParams`) => `Response`\<`void`\> | Set custom intro |
552
- | `options.name` | `string` | Set name of you project |
553
- | `options.onCancel`? | `false` \| (`data`: `HookParams`) => `Response`\<`void`\> | Set custom function foor when user cancels the process |
554
- | `options.opts`? | `object` | Set your prompt options |
555
- | `options.opts.install`? | `false` \| [ \| `"bun"` \| `"deno"` \| `"npm"` \| `"pnpm"` \| `"yarn"`, \| `"bun"` \| `"deno"` \| `"npm"` \| `"pnpm"` \| `"yarn"`, ...("bun" \| "deno" \| "npm" \| "pnpm" \| "yarn")\[\]] | Active/deactivate the install prompt Also, You can set the installators that you want to use. |
556
- | `options.opts.name`? | `boolean` | Active/deactivate the name prompt |
557
- | `options.opts.openEditor`? | `false` \| [`"code"` \| `"subl"` \| `"webstorm"`, `"code"` \| `"subl"` \| `"webstorm"`, ...("code" \| "subl" \| "webstorm")\[\]] | Active/deactivate the openEditor prompt. Also, You can set the editors that you want to use. |
558
- | `options.outro`? | `false` \| (`data`: `HookParams`) => `Response`\<`void`\> | Set custom outro |
559
- | `options.templates` | `object` | Set your template ooptions |
560
- | `options.updater`? | `boolean` | Use updater **Default** `false` |
561
- | `options.version` | `string` | Set version of you current project Used in for the updater notifications. |
562
-
563
- ###### Returns
564
-
565
- [`Creatium`](index.md#creatium)
566
-
567
- ##### Methods
568
-
569
- ###### build()
570
-
571
- ```ts
572
- build(values?: {
573
- input: string;
574
- install: Installer;
575
- name: string;
576
- openEditor: TextEditor;
577
- output: string;
578
- }, opts?: CreateOpts): Promise<{
579
- input: string;
580
- install: undefined;
581
- name: undefined;
582
- openEditor: undefined;
583
- output: string;
584
- }>
585
- ```
586
-
587
- A simplified version of the `build` method from the main class.
588
-
589
- ###### Parameters
590
-
591
- | Parameter | Type | Description |
592
- | ------ | ------ | ------ |
593
- | `values`? | `object` | The values to override the CLI prompts. If not set, the CLI prompts will be executed. |
594
- | `values.input`? | `string` | Set the input path or the template key |
595
- | `values.install`? | `Installer` | Set the installer |
596
- | `values.name`? | `string` | Set the name of the template |
597
- | `values.openEditor`? | `TextEditor` | Open editor |
598
- | `values.output`? | `string` | Set the output path |
599
- | `opts`? | [`CreateOpts`](index.md#createopts) | The options to pass to the CLI. |
600
-
601
- ###### Returns
602
-
603
- `Promise`\<\{
604
- `input`: `string`;
605
- `install`: `undefined`;
606
- `name`: `undefined`;
607
- `openEditor`: `undefined`;
608
- `output`: `string`;
609
- \}\>
610
-
611
- A promise resolving to the prompt values obtained after executing the CLI.
612
-
613
- | Name | Type |
614
- | ------ | ------ |
615
- | `input`? | `string` |
616
- | `install`? | `undefined` |
617
- | `name`? | `undefined` |
618
- | `openEditor`? | `undefined` |
619
- | `output`? | `string` |
620
-
621
- ###### Examples
622
-
623
- ```ts
624
- // simple usage
625
- await core.build()
626
- ```
627
-
628
- ```ts
629
- // custom usage
630
- await core.build( { args : process.argv.slice(4), hideBin : false } )
631
- ```
632
-
633
- ###### cli()
634
-
635
- ```ts
636
- cli(props?: CliOpts): Promise<{
637
- input: string;
638
- install: undefined;
639
- name: undefined;
640
- openEditor: undefined;
641
- output: string;
642
- }>
643
- ```
644
-
645
- A simplified version of the `cli` method from the main class.
646
- Initializes and executes the command-line interface (CLI) process.
647
-
648
- ###### Parameters
649
-
650
- | Parameter | Type | Description |
651
- | ------ | ------ | ------ |
652
- | `props`? | [`CliOpts`](index.md#cliopts) | Optional CLI options to configure the initialization process. |
653
-
654
- ###### Returns
655
-
656
- `Promise`\<\{
657
- `input`: `string`;
658
- `install`: `undefined`;
659
- `name`: `undefined`;
660
- `openEditor`: `undefined`;
661
- `output`: `string`;
662
- \}\>
663
-
664
- A promise resolving to the prompt values obtained after executing the CLI.
665
-
666
- | Name | Type |
667
- | ------ | ------ |
668
- | `input`? | `string` |
669
- | `install`? | `undefined` |
670
- | `name`? | `undefined` |
671
- | `openEditor`? | `undefined` |
672
- | `output`? | `string` |
673
-
674
- ###### Examples
675
-
676
- ```ts
677
- // simple usage
678
- await core.cli()
679
- ```
680
-
681
- ```ts
682
- // custom usage
683
- await core.cli( { args : process.argv.slice(4), hideBin : false } )
684
- ```
685
-
686
-
687
- #### CreatiumCore\<C\>
688
-
689
- Customizable class of `Creatium` for create project templates (CLI and Library).
690
-
691
- ##### Example
692
-
693
- ```ts
694
- //////////////// core.js ///////////////////
695
-
696
- export const core = new CreatiumCore({
697
- name: 'My Project',
698
- version: '1.0.0',
699
- prompts: {
700
- ...
701
- },
702
- ...
703
- })
704
-
705
- //////////////// bin.js ///////////////////
706
-
707
- import { core } from './core.js'
708
- const res = await core.cli()
709
- // do something with res...
710
- await core.createTemplate( res )
711
-
712
- //////////////// lib.js ///////////////////
713
-
714
- import { core } from './core.js'
715
- export const create = async (args) => {
716
- const res = await core.build( args )
717
- // do something with res...
718
- await core.createTemplate( res )
719
- }
720
- ```
721
-
722
- ##### Type Parameters
723
-
724
- | Type Parameter | Default type | Description |
725
- | ------ | ------ | ------ |
726
- | `C` *extends* [`Config`](index.md#config) | [`Config`](index.md#config) | |
727
-
728
- ##### Accessors
729
-
730
- ###### debugMode
731
-
732
- ###### Set Signature
733
-
734
- ```ts
735
- set debugMode(value: boolean): void
736
- ```
737
-
738
- Force debug mode
739
-
740
- ###### Parameters
741
-
742
- | Parameter | Type |
743
- | ------ | ------ |
744
- | `value` | `boolean` |
745
-
746
- ###### Returns
747
-
748
- `void`
749
-
750
- ##### Constructors
751
-
752
- ###### new CreatiumCore()
753
-
754
- ```ts
755
- new CreatiumCore<C>(config: C): CreatiumCore<C>
756
- ```
757
-
758
- ###### Parameters
759
-
760
- | Parameter | Type |
761
- | ------ | ------ |
762
- | `config` | `C` |
763
-
764
- ###### Returns
765
-
766
- [`CreatiumCore`](index.md#creatiumcorec)\<`C`\>
767
-
768
- ##### Methods
769
-
770
- ###### build()
771
-
772
- ```ts
773
- build(values?: { [K in string | number | symbol]: { [K in string | number | symbol]: { [K in string | number | symbol]?: { [K in string | number | symbol]: ((...)[(...)] extends Object ? (...) extends (...) ? (...) : (...) : never)[K] } }[K] }[K] }, opts?: CreateOpts): Promise<{ [K in string | number | symbol]: { [K in string | number | symbol]?: { [K in string | number | symbol]: (C["prompt"][K] extends Object ? T extends keyof OptionsClasses ? { [K in (...) | (...) | (...)]: (...)[(...)] } : never : never)[K] } }[K] }>
774
- ```
775
-
776
- Initialize the CLI and executes the callback function passed in the config.
777
-
778
- ###### Parameters
779
-
780
- | Parameter | Type | Description |
781
- | ------ | ------ | ------ |
782
- | `values`? | \{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]?: \{ \[K in string \| number \| symbol\]: ((...)\[(...)\] extends Object ? (...) extends (...) ? (...) : (...) : never)\[K\] \} \}\[K\] \}\[K\] \} | The values to override the CLI prompts. If not set, the CLI prompts will be executed. |
783
- | `opts`? | [`CreateOpts`](index.md#createopts) | The options to pass to the CLI. |
784
-
785
- ###### Returns
786
-
787
- `Promise`\<\{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]?: \{ \[K in string \| number \| symbol\]: (C\["prompt"\]\[K\] extends Object ? T extends keyof OptionsClasses ? \{ \[K in (...) \| (...) \| (...)\]: (...)\[(...)\] \} : never : never)\[K\] \} \}\[K\] \}\>
788
-
789
- The result of the callback function.
790
-
791
- ###### cancel()
792
-
793
- ```ts
794
- cancel(message?: string): Promise<void>
795
- ```
796
-
797
- Cancels the current process and exits with code 0.
798
-
799
- If a `message` is provided, it will be displayed in the console.
800
- If `onCancel` is set in the config, it will be called with the current data.
801
- If `onCancel` is not set, a default message will be displayed.
802
-
803
- ###### Parameters
804
-
805
- | Parameter | Type | Description |
806
- | ------ | ------ | ------ |
807
- | `message`? | `string` | The message to display before exiting. |
808
-
809
- ###### Returns
810
-
811
- `Promise`\<`void`\>
812
-
813
- ###### cli()
814
-
815
- ```ts
816
- cli(props?: CliOpts): Promise<{ [K in string | number | symbol]: { [K in string | number | symbol]?: { [K in string | number | symbol]: (C["prompt"][K] extends Object ? T extends keyof OptionsClasses ? { [K in (...) | (...) | (...)]: (...)[(...)] } : never : never)[K] } }[K] }>
817
- ```
818
-
819
- Initializes and executes the command-line interface (CLI) process.
820
-
821
- ###### Parameters
822
-
823
- | Parameter | Type | Description |
824
- | ------ | ------ | ------ |
825
- | `props`? | [`CliOpts`](index.md#cliopts) | Optional CLI options to configure the initialization process. |
826
-
827
- ###### Returns
828
-
829
- `Promise`\<\{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]?: \{ \[K in string \| number \| symbol\]: (C\["prompt"\]\[K\] extends Object ? T extends keyof OptionsClasses ? \{ \[K in (...) \| (...) \| (...)\]: (...)\[(...)\] \} : never : never)\[K\] \} \}\[K\] \}\>
830
-
831
- A promise resolving to the prompt values obtained after executing the CLI.
832
-
833
- ###### Examples
834
-
835
- ```ts
836
- // simple usage
837
- await core.cli()
838
- ```
839
-
840
- ```ts
841
- // custom usage
842
- await core.cli( { args : process.argv.slice( 4), hideBin : false } )
843
- ```
844
-
845
- ###### copyDir()
846
-
847
- ```ts
848
- copyDir(data: {
849
- input: string;
850
- output: string;
851
- }): Promise<void>
852
- ```
853
-
854
- Copy a directory from input path to output path.
855
-
856
- ###### Parameters
857
-
858
- | Parameter | Type | Description |
859
- | ------ | ------ | ------ |
860
- | `data` | `object` | Options object with input and output paths. |
861
- | `data.input` | `string` | The path to the directory to copy. |
862
- | `data.output` | `string` | The path to the destination directory. |
863
-
864
- ###### Returns
865
-
866
- `Promise`\<`void`\>
867
-
868
- - Resolves when the directory has been copied.
869
-
870
- ###### Example
871
-
872
- ```ts
873
- const copyResult = await core.copyDir({
874
- input : '/path/to/sourceDir',
875
- output: '/path/to/destinationDir',
876
- })
877
- ```
878
-
879
- ###### createTemplate()
880
-
881
- ```ts
882
- createTemplate(values: CreateTemplateOpts): Promise<void>
883
- ```
884
-
885
- Create a new project template.
886
-
887
- ###### Parameters
888
-
889
- | Parameter | Type | Description |
890
- | ------ | ------ | ------ |
891
- | `values` | [`CreateTemplateOpts`](index.md#createtemplateopts) | The values to create the template. |
892
-
893
- ###### Returns
894
-
895
- `Promise`\<`void`\>
896
-
897
- - A promise that resolves when the template is created.
898
-
899
- ###### Examples
900
-
901
- ```ts
902
- // basic usage
903
- await core.createTemplate( { input : 'my/template/path', output : 'my/project/path' } )
904
- ```
905
-
906
- ```ts
907
- // custom usage
908
- await core.createTemplate( {
909
- input : 'my/template/path',
910
- output : 'my/project/path',
911
- install : 'pnpm',
912
- open : 'vscode',
913
- consts : {
914
- version : '1.0.0',
915
- header : '// Template generated by Creatium. a project from PigeonPosse',
916
- },
917
- } )
918
- ```
919
-
920
- ###### getTemplateInput()
921
-
922
- ```ts
923
- getTemplateInput(input?: {
924
- input: string;
925
- }): Promise<undefined | string>
926
- ```
927
-
928
- Return the input path of a template by name or path.
929
-
930
- ###### Parameters
931
-
932
- | Parameter | Type | Description |
933
- | ------ | ------ | ------ |
934
- | `input`? | `object` | The name of the template or the path to the template. |
935
- | `input.input`? | `string` | - |
936
-
937
- ###### Returns
938
-
939
- `Promise`\<`undefined` \| `string`\>
940
-
941
- The input path of the template or undefined if not found.
942
-
943
- ###### Examples
944
-
945
- ```ts
946
- // with template path
947
- const input = await core.getTemplateInput( { input : 'my/template/path' } )
948
- ```
949
-
950
- ```ts
951
- // With template key
952
- // template key must be specified in the config prompt secction.
953
- const input = await core.getTemplateInput( { input : 'templateKey' )
954
- ```
955
-
956
- ###### install()
957
-
958
- ```ts
959
- install(options?: {
960
- input: string;
961
- installer: Installer;
962
- }): Promise<void>
963
- ```
964
-
965
- Installs the project with the given package manager.
966
-
967
- ###### Parameters
968
-
969
- | Parameter | Type | Description |
970
- | ------ | ------ | ------ |
971
- | `options`? | `object` | The options to install. |
972
- | `options.input`? | `string` | The path to the folder. If not provided, the current directory is used. |
973
- | `options.installer`? | `Installer` | The package manager to use for the installation. |
974
-
975
- ###### Returns
976
-
977
- `Promise`\<`void`\>
978
-
979
- ###### Example
980
-
981
- ```ts
982
- await core.install( {
983
- installer : 'pnpm',
984
- input : 'my/project/path',
985
- } )
986
- ```
987
-
988
- ###### intro()
989
-
990
- ```ts
991
- intro(message?: string): Promise<void>
992
- ```
993
-
994
- Intro prompt line.
995
-
996
- If the parameter `message` is provided, it will be used as the intro message.
997
- If the `intro` option is a function, it will be called with the `this.#data` as the argument.
998
- If the `intro` option is undefined, the default intro message will be used.
999
-
1000
- ###### Parameters
1001
-
1002
- | Parameter | Type | Description |
1003
- | ------ | ------ | ------ |
1004
- | `message`? | `string` | The intro message. |
1005
-
1006
- ###### Returns
1007
-
1008
- `Promise`\<`void`\>
1009
-
1010
- ###### openEditor()
1011
-
1012
- ```ts
1013
- openEditor(params: {
1014
- editor: TextEditor;
1015
- input: string;
1016
- }): Promise<void>
1017
- ```
1018
-
1019
- Open the project in the given editor.
1020
-
1021
- ###### Parameters
1022
-
1023
- | Parameter | Type | Description |
1024
- | ------ | ------ | ------ |
1025
- | `params` | `object` | The parameters for opening the editor. |
1026
- | `params.editor`? | `TextEditor` | The editor to open the project in. |
1027
- | `params.input`? | `string` | The input path. If not provided, the current directory is used. |
1028
-
1029
- ###### Returns
1030
-
1031
- `Promise`\<`void`\>
1032
-
1033
- ###### Example
1034
-
1035
- ```ts
1036
- await core.openEditor( {
1037
- editor : 'vscode',
1038
- input : 'my/project/path',
1039
- })
1040
- ```
1041
-
1042
- ###### outro()
1043
-
1044
- ```ts
1045
- outro(message?: string): Promise<void>
1046
- ```
1047
-
1048
- Outro prompt line.
1049
-
1050
- If the parameter `message` is provided, it will be used as the outro message.
1051
- If the `outro` option is a function, it will be called with the `this.#data` as the argument.
1052
- If the `outro` option is undefined, the default outro message will be used.
1053
-
1054
- ###### Parameters
1055
-
1056
- | Parameter | Type | Description |
1057
- | ------ | ------ | ------ |
1058
- | `message`? | `string` | The outro message. |
1059
-
1060
- ###### Returns
1061
-
1062
- `Promise`\<`void`\>
1063
-
1064
- ###### replacePlaceholders()
1065
-
1066
- ```ts
1067
- replacePlaceholders(args: {
1068
- input: string;
1069
- inputOpts: Options;
1070
- params: Params;
1071
- }): Promise<void>
53
+ deno add creatium
1072
54
  ```
1073
55
 
1074
- Replaces placeholders in files within the specified directory.
1075
-
1076
- This function searches for files in the provided input directory and replaces
1077
- placeholders within those files using the specified parameters. The placeholders
1078
- in the content are replaced with values from the `params` object.
1079
-
1080
- ###### Parameters
1081
-
1082
- | Parameter | Type | Description |
1083
- | ------ | ------ | ------ |
1084
- | `args` | `object` | The arguments object. |
1085
- | `args.input`? | `string` | The directory path containing files with placeholders. |
1086
- | `args.inputOpts`? | `Options` | - |
1087
- | `args.params`? | `Params` | An object containing key-value pairs for replacing placeholders. |
56
+ ## More
1088
57
 
1089
- ###### Returns
58
+ - [Core](https://creatium.pigeonposse.com/guide/core)
59
+ - [Create](https://creatium.pigeonposse.com/guide/create)
1090
60
 
1091
- `Promise`\<`void`\>
1092
-
1093
- A Promise that resolves once all placeholders have been replaced.
1094
-
1095
- ###### Example
1096
-
1097
- ```ts
1098
- await core.replacePlaceholders( {
1099
- input : 'my/project/path',
1100
- params : { consts: { version: '1.0.0' }, prompt: { name: 'My Project' } },
1101
- })
1102
- ```
1103
-
1104
- ###### updateNotify()
1105
-
1106
- ```ts
1107
- updateNotify(opts?: {
1108
- custom: (info?: UpdateInfo) => Response<void>;
1109
- opts: NotifyOptions;
1110
- }): Promise<void>
1111
- ```
1112
-
1113
- Shows a notification if the current package is outdated.
1114
-
1115
- **information**: If this 'custom' function is provided, the default
1116
- notification will not be shown.
1117
61
 
1118
62
  ---
1119
63
 
1120
- ###### Parameters
1121
-
1122
- | Parameter | Type | Description |
1123
- | ------ | ------ | ------ |
1124
- | `opts`? | `object` | Options for the update notification. |
1125
- | `opts.custom`? | (`info`?: `UpdateInfo`) => `Response`\<`void`\> | A custom function to run with the update |
1126
- | `opts.opts`? | `NotifyOptions` | Options for the `update-notifier` package. |
1127
-
1128
- ###### Returns
1129
-
1130
- `Promise`\<`void`\>
1131
-
1132
- ###### Examples
1133
-
1134
- ```ts
1135
- // With default options. Recommended for most use cases.
1136
- await core.updateNotify()
1137
- ```
1138
-
1139
- ```ts
1140
- // With custom options
1141
- await core.updateNotify({ opts: { ... } })
1142
- ```
1143
-
1144
- ```ts
1145
- // With custom function
1146
- await core.updateNotify({ custom: () => {} })
1147
- ```
1148
-
1149
- ##### Properties
1150
-
1151
- | Property | Type |
1152
- | ------ | ------ |
1153
- | `config` | `C` |
1154
- | `utils` | `__module` |
1155
-
1156
- ### Type Aliases
1157
-
1158
- #### CliOpts
1159
-
1160
- ```ts
1161
- type CliOpts: {
1162
- args: string[];
1163
- hideBin: boolean;
1164
- };
1165
- ```
1166
-
1167
- ##### Type declaration
1168
-
1169
- | Name | Type | Description |
1170
- | ------ | ------ | ------ |
1171
- | `args`? | `string`[] | Arguments to pass to the command **Default** `process.argv.slice(2)` |
1172
- | `hideBin`? | `boolean` | Hide the first two arguments **Default** `false` |
1173
-
1174
-
1175
- #### Config
1176
-
1177
- ```ts
1178
- type Config: {
1179
- cache: boolean;
1180
- hooks: {
1181
- afterPrompt: <D>(data: D) => Response<D | undefined>;
1182
- beforePrompt: <D>(data: D) => Response<D | undefined>;
1183
- };
1184
- intro: (data: HookParams) => Response<void> | false;
1185
- name: string;
1186
- onCancel: (data: HookParams) => Response<void> | false;
1187
- outro: (data: HookParams) => Response<void> | false;
1188
- prompt: OptionsParams;
1189
- updater: boolean;
1190
- version: string;
1191
- };
1192
- ```
1193
-
1194
- ##### Type declaration
1195
-
1196
- | Name | Type | Description |
1197
- | ------ | ------ | ------ |
1198
- | `cache`? | `boolean` | Use cache **Default** `true` |
1199
- | `hooks`? | \{ `afterPrompt`: \<`D`\>(`data`: `D`) => `Response`\<`D` \| `undefined`\>; `beforePrompt`: \<`D`\>(`data`: `D`) => `Response`\<`D` \| `undefined`\>; \} | hooks for |
1200
- | `hooks.afterPrompt`? | \<`D`\>(`data`: `D`) => `Response`\<`D` \| `undefined`\> | - |
1201
- | `hooks.beforePrompt`? | \<`D`\>(`data`: `D`) => `Response`\<`D` \| `undefined`\> | - |
1202
- | `intro`? | (`data`: `HookParams`) => `Response`\<`void`\> \| `false` | Set custom intro |
1203
- | `name` | `string` | Set name of you project |
1204
- | `onCancel`? | (`data`: `HookParams`) => `Response`\<`void`\> \| `false` | Set custom function foor when user cancels the process |
1205
- | `outro`? | (`data`: `HookParams`) => `Response`\<`void`\> \| `false` | Set custom outro |
1206
- | `prompt` | `OptionsParams` | Set you prompts config |
1207
- | `updater`? | `boolean` | Use updater **Default** `false` |
1208
- | `version` | `string` | Set version of you current project Used in for the updater notifications. |
1209
-
1210
-
1211
- #### CreateOpts
1212
-
1213
- ```ts
1214
- type CreateOpts: CliOpts & {
1215
- activeCli: boolean;
1216
- };
1217
- ```
1218
-
1219
- ##### Type declaration
1220
-
1221
- | Name | Type | Description |
1222
- | ------ | ------ | ------ |
1223
- | `activeCli`? | `boolean` | Options for activate cli. **Default** `true` |
1224
-
1225
-
1226
- #### CreateTemplateOpts
1227
-
1228
- ```ts
1229
- type CreateTemplateOpts: {
1230
- consts: Record<string, string>;
1231
- input: string;
1232
- install: Installer;
1233
- name: string;
1234
- openEditor: TextEditor;
1235
- output: string;
1236
- };
1237
- ```
1238
-
1239
- ##### Type declaration
1240
-
1241
- | Name | Type | Description |
1242
- | ------ | ------ | ------ |
1243
- | `consts`? | `Record`\<`string`, `string`\> | Add consts to use in your templates. |
1244
- | `input`? | `string` | Set the input path or the template key |
1245
- | `install`? | `Installer` | Set the installer |
1246
- | `name`? | `string` | Set the name of the template |
1247
- | `openEditor`? | `TextEditor` | Open editor |
1248
- | `output`? | `string` | Set the output path |
1249
-
1250
- ### Variables
1251
-
1252
- #### env
1253
-
1254
- ```ts
1255
- const env: {
1256
- isBrowser: boolean;
1257
- isBun: boolean;
1258
- isDeno: boolean;
1259
- isJsDom: boolean;
1260
- isNode: boolean;
1261
- isWebWorker: boolean;
1262
- } = _env;
1263
- ```
1264
-
1265
- Environment functions
1266
-
1267
- ##### Type declaration
1268
-
1269
- | Name | Type |
1270
- | ------ | ------ |
1271
- | `isBrowser` | `boolean` |
1272
- | `isBun` | `boolean` |
1273
- | `isDeno` | `boolean` |
1274
- | `isJsDom` | `boolean` |
1275
- | `isNode` | `boolean` |
1276
- | `isWebWorker` | `boolean` |
1277
-
1278
-
1279
- #### INSTALLER
1280
-
1281
- ```ts
1282
- const INSTALLER: {
1283
- BUN: 'bun';
1284
- DENO: 'deno';
1285
- NONE: 'none';
1286
- NPM: 'npm';
1287
- PNPM: 'pnpm';
1288
- YARN: 'yarn';
1289
- };
1290
- ```
1291
-
1292
- installer values used in `install` option.
1293
-
1294
- ##### Type declaration
1295
-
1296
- | Name | Type | Default value |
1297
- | ------ | ------ | ------ |
1298
- | `BUN` | `"bun"` | 'bun' |
1299
- | `DENO` | `"deno"` | 'deno' |
1300
- | `NONE` | `"none"` | 'none' |
1301
- | `NPM` | `"npm"` | 'npm' |
1302
- | `PNPM` | `"pnpm"` | 'pnpm' |
1303
- | `YARN` | `"yarn"` | 'yarn' |
1304
-
1305
-
1306
- #### OPTION
1307
-
1308
- ```ts
1309
- const OPTION: {
1310
- array: 'array';
1311
- boolean: 'boolean';
1312
- install: 'install';
1313
- multiselect: 'multiselect';
1314
- name: 'name';
1315
- number: 'number';
1316
- openEditor: 'openEditor';
1317
- output: 'output';
1318
- path: 'path';
1319
- select: 'select';
1320
- template: 'template';
1321
- text: 'text';
1322
- void: 'void';
1323
- };
1324
- ```
1325
-
1326
- Object of the CREATIUM types
1327
-
1328
- ##### Type declaration
1329
-
1330
- | Name | Type | Default value |
1331
- | ------ | ------ | ------ |
1332
- | `array` | `"array"` | 'array' |
1333
- | `boolean` | `"boolean"` | 'boolean' |
1334
- | `install` | `"install"` | 'install' |
1335
- | `multiselect` | `"multiselect"` | 'multiselect' |
1336
- | `name` | `"name"` | 'name' |
1337
- | `number` | `"number"` | 'number' |
1338
- | `openEditor` | `"openEditor"` | 'openEditor' |
1339
- | `output` | `"output"` | 'output' |
1340
- | `path` | `"path"` | 'path' |
1341
- | `select` | `"select"` | 'select' |
1342
- | `template` | `"template"` | 'template' |
1343
- | `text` | `"text"` | 'text' |
1344
- | `void` | `"void"` | 'void' |
1345
-
1346
-
1347
- #### prompt
1348
-
1349
- ```ts
1350
- const prompt: {
1351
- box: (opts: {
1352
- opts: Options;
1353
- type: PromptLineMethod;
1354
- value: string;
1355
- }) => void;
1356
- columns: (opts: {
1357
- opts: GlobalOptions;
1358
- type: PromptLineMethod;
1359
- value: ColumnData;
1360
- }) => void;
1361
- log: {
1362
- error: (message: string) => void;
1363
- info: (message: string) => void;
1364
- message: (message?: string, { symbol }?: LogMessageOptions) => void;
1365
- step: (message: string) => void;
1366
- success: (message: string) => void;
1367
- warn: (message: string) => void;
1368
- warning: (message: string) => void;
1369
- };
1370
- number: (opts: {
1371
- defaultValue: string;
1372
- errorText: string;
1373
- initialValue: string;
1374
- message: string;
1375
- placeholder: string;
1376
- validate: (value: string) => string | void;
1377
- }) => Promise<number | symbol>;
1378
- table: (opts: {
1379
- opts: TableUserConfig;
1380
- type: PromptLineMethod;
1381
- value: TableData;
1382
- }) => void;
1383
- cancel: void;
1384
- confirm: Promise<boolean | symbol>;
1385
- group: Promise<{ [P in string | number | symbol]: PromptGroupAwaitedReturn<T>[P] }>;
1386
- groupMultiselect: Promise<symbol | Value[]>;
1387
- intro: void;
1388
- isCancel: value is symbol;
1389
- multiselect: Promise<symbol | Value[]>;
1390
- note: void;
1391
- outro: void;
1392
- password: Promise<string | symbol>;
1393
- select: Promise<symbol | Value>;
1394
- selectKey: Promise<symbol | Value>;
1395
- spinner: {
1396
- message: (msg?: string) => void;
1397
- start: (msg?: string) => void;
1398
- stop: (msg?: string, code?: number) => void;
1399
- };
1400
- tasks: Promise<void>;
1401
- text: Promise<string | symbol>;
1402
- } = _prompt;
1403
- ```
1404
-
1405
- Prompt functions
1406
-
1407
- ##### Type declaration
1408
-
1409
- | Name | Type | Description |
1410
- | ------ | ------ | ------ |
1411
- | `box` | (`opts`: \{ `opts`: `Options`; `type`: `PromptLineMethod`; `value`: `string`; \}) => `void` | - |
1412
- | `columns` | (`opts`: \{ `opts`: `GlobalOptions`; `type`: `PromptLineMethod`; `value`: `ColumnData`; \}) => `void` | - |
1413
- | `log` | \{ `error`: (`message`: `string`) => `void`; `info`: (`message`: `string`) => `void`; `message`: (`message`?: `string`, `{ symbol }`?: `LogMessageOptions`) => `void`; `step`: (`message`: `string`) => `void`; `success`: (`message`: `string`) => `void`; `warn`: (`message`: `string`) => `void`; `warning`: (`message`: `string`) => `void`; \} | - |
1414
- | `log.error` | (`message`: `string`) => `void` | - |
1415
- | `log.info` | (`message`: `string`) => `void` | - |
1416
- | `log.message` | (`message`?: `string`, `{ symbol }`?: `LogMessageOptions`) => `void` | - |
1417
- | `log.step` | (`message`: `string`) => `void` | - |
1418
- | `log.success` | (`message`: `string`) => `void` | - |
1419
- | `log.warn` | (`message`: `string`) => `void` | - |
1420
- | `log.warning` | (`message`: `string`) => `void` | alias for `log.warn()`. |
1421
- | `number` | (`opts`: \{ `defaultValue`: `string`; `errorText`: `string`; `initialValue`: `string`; `message`: `string`; `placeholder`: `string`; `validate`: (`value`: `string`) => `string` \| `void`; \}) => `Promise`\<`number` \| `symbol`\> | - |
1422
- | `table` | (`opts`: \{ `opts`: `TableUserConfig`; `type`: `PromptLineMethod`; `value`: `TableData`; \}) => `void` | - |
1423
- | `cancel()` | `void` | - |
1424
- | `confirm()` | `Promise`\<`boolean` \| `symbol`\> | - |
1425
- | `group()` | `Promise`\<\{ \[P in string \| number \| symbol\]: PromptGroupAwaitedReturn\<T\>\[P\] \}\> | Define a group of prompts to be displayed and return a results of objects within the group |
1426
- | `groupMultiselect()` | `Promise`\<`symbol` \| `Value`[]\> | - |
1427
- | `intro()` | `void` | - |
1428
- | `isCancel()` | `value is symbol` | - |
1429
- | `multiselect()` | `Promise`\<`symbol` \| `Value`[]\> | - |
1430
- | `note()` | `void` | - |
1431
- | `outro()` | `void` | - |
1432
- | `password()` | `Promise`\<`string` \| `symbol`\> | - |
1433
- | `select()` | `Promise`\<`symbol` \| `Value`\> | - |
1434
- | `selectKey()` | `Promise`\<`symbol` \| `Value`\> | - |
1435
- | `spinner()` | \{ `message`: (`msg`?: `string`) => `void`; `start`: (`msg`?: `string`) => `void`; `stop`: (`msg`?: `string`, `code`?: `number`) => `void`; \} | - |
1436
- | `tasks()` | `Promise`\<`void`\> | Define a group of tasks to be executed |
1437
- | `text()` | `Promise`\<`string` \| `symbol`\> | - |
1438
-
1439
-
1440
- #### style
1441
-
1442
- ```ts
1443
- const style: {
1444
- box: (text: string, options?: Options) => string;
1445
- color: ChalkInstance;
1446
- columns: <Data>(data: Data, options?: GlobalOptions) => string;
1447
- gradient: (txt: string, colors: GradientColors, opts?: GradientOpts) => string;
1448
- line: (__namedParameters: {
1449
- align: 'center';
1450
- lineChar: '⎯';
1451
- title: string;
1452
- }) => string;
1453
- table: (data: TableData, options?: TableUserConfig) => string;
1454
- } = _style;
1455
- ```
1456
-
1457
- Style functions
1458
-
1459
- ##### Type declaration
1460
-
1461
- | Name | Type |
1462
- | ------ | ------ |
1463
- | `box` | (`text`: `string`, `options`?: `Options`) => `string` |
1464
- | `color` | `ChalkInstance` |
1465
- | `columns` | \<`Data`\>(`data`: `Data`, `options`?: `GlobalOptions`) => `string` |
1466
- | `gradient` | (`txt`: `string`, `colors`: `GradientColors`, `opts`?: `GradientOpts`) => `string` |
1467
- | `line` | (`__namedParameters`: \{ `align`: `'center'`; `lineChar`: `'⎯'`; `title`: `string`; \}) => `string` |
1468
- | `table` | (`data`: `TableData`, `options`?: `TableUserConfig`) => `string` |
1469
-
1470
-
1471
- #### sys
1472
-
1473
- ```ts
1474
- const sys: __module = _sys;
1475
- ```
1476
-
1477
- System functions
1478
-
1479
-
1480
- #### TEXT\_EDITOR
1481
-
1482
- ```ts
1483
- const TEXT_EDITOR: {
1484
- NONE: 'none';
1485
- SUBLIME: 'subl';
1486
- VSCODE: 'code';
1487
- WEBSTORM: 'webstorm';
1488
- };
1489
- ```
1490
-
1491
- Text editor values used in `openEditor` option.
1492
-
1493
- ##### Type declaration
1494
-
1495
- | Name | Type | Default value |
1496
- | ------ | ------ | ------ |
1497
- | `NONE` | `"none"` | 'none' |
1498
- | `SUBLIME` | `"subl"` | 'subl' |
1499
- | `VSCODE` | `"code"` | 'code' |
1500
- | `WEBSTORM` | `"webstorm"` | 'webstorm' |
1501
-
1502
-
1503
64
  ## 👨‍💻 Development
1504
65
 
1505
66
  __creatium__ is an open-source project and its development is open to anyone who wants to participate.
1506
67
 
1507
68
  [![Issues](https://img.shields.io/badge/Issues-grey?style=for-the-badge)](https://github.com/pigeonposse/creatium/issues)
1508
69
  [![Pull requests](https://img.shields.io/badge/Pulls-grey?style=for-the-badge)](https://github.com/pigeonposse/creatium/pulls)
1509
- [![Read more](https://img.shields.io/badge/Read%20more-grey?style=for-the-badge)](https://github.com/pigeonposse/creatium)
70
+ [![Read more](https://img.shields.io/badge/Read%20more-grey?style=for-the-badge)](https://creatium.pigeonposse.com)
1510
71
 
1511
72
  ## ☕ Donate
1512
73
 
@@ -1526,16 +87,14 @@ This software is licensed with __[GPL-3.0](https://github.com/pigeonposse/creati
1526
87
 
1527
88
  [![More](https://img.shields.io/badge/Read-more-grey?style=for-the-badge)](https://github.com/pigeonposse)
1528
89
 
1529
- ***
90
+ ---
1530
91
 
1531
92
  [![Web](https://img.shields.io/badge/Web-grey?style=for-the-badge&logoColor=white)](https://pigeonposse.com)
1532
93
  [![About Us](https://img.shields.io/badge/About%20Us-grey?style=for-the-badge&logoColor=white)](https://pigeonposse.com?popup=about)
1533
94
  [![Donate](https://img.shields.io/badge/Donate-pink?style=for-the-badge&logoColor=white)](https://pigeonposse.com/?popup=donate)
1534
- [![Github](https://img.shields.io/badge/Github-black?style=for-the-badge&logo=github&logoColor=white)](https://github.com/pigeonposse)
1535
- [![Twitter](https://img.shields.io/badge/Twitter-black?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/pigeonposse_)
1536
- [![Instagram](https://img.shields.io/badge/Instagram-black?style=for-the-badge&logo=instagram&logoColor=white)](https://www.instagram.com/pigeon.posse/)
1537
- [![Medium](https://img.shields.io/badge/Medium-black?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/@pigeonposse)
1538
-
95
+ [![Twitter](https://img.shields.io/badge/Twitter-black?style=for-the-badge&logoColor=white&logo=twitter)](https://twitter.com/pigeonposse_)
96
+ [![Instagram](https://img.shields.io/badge/Instagram-black?style=for-the-badge&logoColor=white&logo=instagram)](https://www.instagram.com/pigeon.posse/)
97
+ [![Medium](https://img.shields.io/badge/Medium-black?style=for-the-badge&logoColor=white&logo=medium)](https://medium.com/@pigeonposse)
1539
98
 
1540
99
  <!--
1541
100
 
@@ -1560,11 +119,9 @@ This software is licensed with __[GPL-3.0](https://github.com/pigeonposse/creati
1560
119
  ╚██████╗██║ ██║███████╗██║ ██║ ██║ ██║╚██████╔╝██║ ╚═╝ ██║
1561
120
  ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
1562
121
 
1563
- Author: Angelo
1564
-
1565
- -->
122
+ - Author: [Angelo](https://github.com/angelespejo)
1566
123
 
1567
124
 
1568
125
 
126
+ -->
1569
127
 
1570
- <!-- AUTOGEN BY DOVENV - END -->