create-domis 1.0.27 → 1.0.28

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 (2) hide show
  1. package/dist/index.js +30 -21
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { execSync } from "child_process";
8
8
  import fs from "fs";
9
9
  import path from "path";
10
10
  var API_VERIFY = "https://verifyprokey-rk2ogbbeja-uc.a.run.app";
11
- console.log(chalk.green.bold("\n\u{1F525} DomisPacks Technical v1.0.25\n"));
11
+ console.log(chalk.green.bold("\n\u{1F525} DomisPacks Technical v1.0.28\n"));
12
12
  async function main() {
13
13
  const answers = await inquirer.prompt([
14
14
  {
@@ -18,7 +18,7 @@ async function main() {
18
18
  choices: [
19
19
  { name: "\u{1F525} DomisDocs Free - firebase.json + firebaserc + package.json + README.md", value: "demo" },
20
20
  { name: "\u{1F525} DomisDocs Lite \u2014 Next.js 15 + Tailwind v4 + Firebase Killer", value: "lite" },
21
- { name: "\u{1F525} DomisDocs Pro \u2014 Next.js 15 + Stripe + Rules + SSR + CI/CD", value: "pro" }
21
+ { name: "\u{1F525} DomisDocs PRO \u2014 Next.js 15 + Stripe + Rules + SSR + CI/CD", value: "pro" }
22
22
  ]
23
23
  },
24
24
  {
@@ -43,33 +43,42 @@ async function main() {
43
43
  try {
44
44
  if (fs.existsSync(target)) throw new Error(`Pasta "${target}" J\xC1 EXISTE!`);
45
45
  fs.mkdirSync(target, { recursive: true });
46
- try {
47
- const res = await fetch("https://domisdocs-6a896.web.app/firebase.json");
48
- const json = await res.text();
49
- fs.writeFileSync(path.join(target, "firebase.json"), json);
50
- } catch {
46
+ const legacyDemoPath = "C:/Users/dell/Documents/GitHub/DomisDoc-Legacy-Thecnical/templates/domisdocs-free";
47
+ if (fs.existsSync(legacyDemoPath)) {
48
+ const files = fs.readdirSync(legacyDemoPath);
49
+ for (const file of files) {
50
+ if (file === "node_modules" || file === ".next") continue;
51
+ fs.copyFileSync(path.join(legacyDemoPath, file), path.join(target, file));
52
+ }
53
+ spinner2.text = "Copiado do template local atualizado";
54
+ } else {
51
55
  fs.writeFileSync(path.join(target, "firebase.json"), JSON.stringify({
52
- hosting: { public: "dist", ignore: ["firebase.json", "**/.*", "**/node_modules/**"] }
56
+ hosting: {
57
+ public: "dist",
58
+ ignore: ["firebase.json", "**/.*", "**/node_modules/**"],
59
+ rewrites: [{ source: "**", destination: "/index.html" }]
60
+ }
53
61
  }, null, 2));
62
+ fs.writeFileSync(path.join(target, ".firebaserc"), JSON.stringify({
63
+ projects: { default: "free" }
64
+ }, null, 2));
65
+ fs.writeFileSync(path.join(target, "package.json"), JSON.stringify({
66
+ name: target,
67
+ version: "1.0.0",
68
+ private: true,
69
+ scripts: { dev: "vite", build: "vite build" }
70
+ }, null, 2));
71
+ fs.writeFileSync(path.join(target, "README.md"), `DomisDocs Free`);
54
72
  }
55
- fs.writeFileSync(path.join(target, ".firebaserc"), JSON.stringify({
56
- projects: { default: "free" }
57
- }, null, 2));
58
- fs.writeFileSync(path.join(target, "package.json"), JSON.stringify({
59
- name: target,
60
- version: "1.0.0",
61
- private: true,
62
- scripts: { dev: "vite", build: "vite build" }
63
- }, null, 2));
64
- fs.writeFileSync(path.join(target, "README.md"), `DomisDocs Free`);
65
73
  spinner2.succeed(chalk.green.bold(`
66
74
  \u2705 ${target} DomisDocs Free criada!`));
67
75
  console.log(chalk.cyan(`
68
76
  DomisDocs: https://domisdocs-6a896.web.app`));
69
77
  console.log(chalk.gray("Esse pack \xE9 gr\xE1tis e p\xFAblico, sem necessidade de PRO_KEY."));
70
78
  console.log(chalk.cyan(`
71
- \u{1F449} cd ${target}
72
- \u{1F449} ls -> firebase.json + .firebaserc + package.json + README.md`));
79
+ \u{1F449} cd ${target}`));
80
+ const created = fs.readdirSync(target);
81
+ console.log(chalk.gray(`\u{1F449} Arquivos: ${created.join(" + ")}`));
73
82
  } catch (e) {
74
83
  const msg = e instanceof Error ? e.message : String(e);
75
84
  spinner2.fail(chalk.red(`\u274C Erro DEMO: ${msg}`));
@@ -77,7 +86,7 @@ DomisDocs: https://domisdocs-6a896.web.app`));
77
86
  }
78
87
  return;
79
88
  }
80
- const spinner = ora("Verificando PRO_KEY...").start();
89
+ const spinner = ora("Verificando PRO_KEY no cofre Legacy...").start();
81
90
  try {
82
91
  const url = `${API_VERIFY}?key=${encodeURIComponent(answers.proKey)}&pack=${answers.pack}`;
83
92
  const res = await fetch(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-domis",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "CLI Oficial DomisPacks - Acelerador Next.js 15 + Tailwind v4 + Firebase Killer + Stripe",
5
5
  "type": "module",
6
6
  "bin": {