create-domis 1.0.14 → 1.0.16
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.js +6 -104
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -1,111 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
|
|
29
|
-
// node_modules/picocolors/picocolors.js
|
|
30
|
-
var require_picocolors = __commonJS({
|
|
31
|
-
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
32
|
-
"use strict";
|
|
33
|
-
var p = process || {};
|
|
34
|
-
var argv = p.argv || [];
|
|
35
|
-
var env = p.env || {};
|
|
36
|
-
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
37
|
-
var formatter = (open, close, replace = open) => (input) => {
|
|
38
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
39
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
40
|
-
};
|
|
41
|
-
var replaceClose = (string, close, replace, index) => {
|
|
42
|
-
let result = "", cursor = 0;
|
|
43
|
-
do {
|
|
44
|
-
result += string.substring(cursor, index) + replace;
|
|
45
|
-
cursor = index + close.length;
|
|
46
|
-
index = string.indexOf(close, cursor);
|
|
47
|
-
} while (~index);
|
|
48
|
-
return result + string.substring(cursor);
|
|
49
|
-
};
|
|
50
|
-
var createColors = (enabled = isColorSupported) => {
|
|
51
|
-
let f = enabled ? formatter : () => String;
|
|
52
|
-
return {
|
|
53
|
-
isColorSupported: enabled,
|
|
54
|
-
reset: f("\x1B[0m", "\x1B[0m"),
|
|
55
|
-
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
56
|
-
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
57
|
-
italic: f("\x1B[3m", "\x1B[23m"),
|
|
58
|
-
underline: f("\x1B[4m", "\x1B[24m"),
|
|
59
|
-
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
60
|
-
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
61
|
-
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
62
|
-
black: f("\x1B[30m", "\x1B[39m"),
|
|
63
|
-
red: f("\x1B[31m", "\x1B[39m"),
|
|
64
|
-
green: f("\x1B[32m", "\x1B[39m"),
|
|
65
|
-
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
66
|
-
blue: f("\x1B[34m", "\x1B[39m"),
|
|
67
|
-
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
68
|
-
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
69
|
-
white: f("\x1B[37m", "\x1B[39m"),
|
|
70
|
-
gray: f("\x1B[90m", "\x1B[39m"),
|
|
71
|
-
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
72
|
-
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
73
|
-
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
74
|
-
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
75
|
-
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
76
|
-
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
77
|
-
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
78
|
-
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
79
|
-
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
80
|
-
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
81
|
-
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
82
|
-
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
83
|
-
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
84
|
-
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
85
|
-
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
86
|
-
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
87
|
-
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
88
|
-
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
89
|
-
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
90
|
-
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
91
|
-
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
92
|
-
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
93
|
-
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
94
|
-
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
module.exports = createColors();
|
|
98
|
-
module.exports.createColors = createColors;
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
3
|
|
|
102
4
|
// src/index.ts
|
|
103
|
-
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
104
5
|
import prompts from "prompts";
|
|
6
|
+
import pc from "picocolors";
|
|
105
7
|
import ora from "ora";
|
|
106
8
|
import fs from "fs";
|
|
107
9
|
import path from "path";
|
|
108
|
-
console.log(
|
|
10
|
+
console.log(pc.bgMagenta(pc.black(" DOMIS CLI ")), pc.magenta("v0.1.0 - Acelere seu Angular + Firebase\n"));
|
|
109
11
|
var args = process.argv.slice(2);
|
|
110
12
|
if (args.includes("--help") || args.includes("-h")) {
|
|
111
13
|
console.log(
|
|
@@ -144,10 +46,10 @@ async function main() {
|
|
|
144
46
|
await scaffold(template, cliProjectName, proKey);
|
|
145
47
|
}
|
|
146
48
|
async function scaffold(template, projectName, proKey) {
|
|
147
|
-
const spinner = ora(`Baixando ${
|
|
49
|
+
const spinner = ora(`Baixando ${pc.cyan(template)}...`).start();
|
|
148
50
|
try {
|
|
149
51
|
if (template.includes("pro") && (!proKey || proKey.length < 5)) {
|
|
150
|
-
spinner.fail(
|
|
52
|
+
spinner.fail(pc.red("Precisa de PRO_KEY"));
|
|
151
53
|
process.exit(1);
|
|
152
54
|
}
|
|
153
55
|
const localTemplatePath = path.resolve(process.cwd(), "templates", template);
|
|
@@ -158,13 +60,13 @@ async function scaffold(template, projectName, proKey) {
|
|
|
158
60
|
fs.mkdirSync(projectName, { recursive: true });
|
|
159
61
|
fs.writeFileSync(path.join(projectName, "firebase.json"), JSON.stringify({ hosting: { public: "dist/seu-projeto/browser", rewrites: [{ source: "**", destination: "/index.html" }] } }, null, 2));
|
|
160
62
|
}
|
|
161
|
-
spinner.succeed(
|
|
63
|
+
spinner.succeed(pc.green(`Template ${template} em./${projectName}`));
|
|
162
64
|
console.log(`
|
|
163
65
|
cd ${projectName}
|
|
164
66
|
npm install
|
|
165
67
|
firebase deploy`);
|
|
166
68
|
} catch (e) {
|
|
167
|
-
spinner.fail(
|
|
69
|
+
spinner.fail(pc.red("Falha"));
|
|
168
70
|
console.error(e.message);
|
|
169
71
|
}
|
|
170
72
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-domis",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "CLI Oficial do ecossistema Domis - Acelere seus projetos Angular + Firebase",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
"author": "Domisnnet",
|
|
17
17
|
"license": "LICENSE",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"node-fetch": "^3.3.2",
|
|
19
|
+
"prompts": "^2.4.2",
|
|
20
|
+
"picocolors": "^1.0.1",
|
|
22
21
|
"ora": "^7.0.1"
|
|
23
22
|
},
|
|
24
23
|
"devDependencies": {
|