create-strayl-web-app 1.0.0 → 1.0.1

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  // src/index.ts
5
5
  import { Command } from "commander";
6
6
  import pc from "picocolors";
7
- import { cpSync, existsSync, readFileSync, writeFileSync } from "fs";
7
+ import { cpSync, existsSync, readFileSync, renameSync, writeFileSync } from "fs";
8
8
  import { resolve, dirname, join } from "path";
9
9
  import { fileURLToPath } from "url";
10
10
  var __dirname = dirname(fileURLToPath(import.meta.url));
@@ -39,6 +39,10 @@ program.name("create-strayl-web-app").description("Scaffold a new Strayl web app
39
39
  }
40
40
  console.log(pc.cyan(`Creating project "${name}"...`));
41
41
  cpSync(templateDir, targetDir, { recursive: true });
42
+ const gitignorePath = join(targetDir, "gitignore");
43
+ if (existsSync(gitignorePath)) {
44
+ renameSync(gitignorePath, join(targetDir, ".gitignore"));
45
+ }
42
46
  const pkgJsonPath = join(targetDir, "package.json");
43
47
  if (existsSync(pkgJsonPath)) {
44
48
  const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { cpSync, existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { resolve, dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst templateDir = resolve(__dirname, \"..\", \"template\");\n\nconst program = new Command();\n\nprogram\n .name(\"create-strayl-web-app\")\n .description(\"Scaffold a new Strayl web application\")\n .requiredOption(\"--name <name>\", \"Name of the new project\")\n .action((opts: { name: string }) => {\n const name = opts.name.trim();\n\n if (!name) {\n console.error(pc.red(\"Error: --name must not be empty.\"));\n process.exit(1);\n }\n\n if (!/^[a-zA-Z0-9_@\\/-][a-zA-Z0-9_.\\-@\\/]*$/.test(name)) {\n console.error(\n pc.red(\n \"Error: Invalid project name. Use only alphanumeric characters, hyphens, underscores, dots, and slashes.\"\n )\n );\n process.exit(1);\n }\n\n const targetDir = resolve(process.cwd(), name);\n\n if (existsSync(targetDir)) {\n console.error(\n pc.red(`Error: Directory \"${name}\" already exists.`)\n );\n process.exit(1);\n }\n\n if (!existsSync(templateDir)) {\n console.error(\n pc.red(\"Error: Template directory not found. The package may be corrupted.\")\n );\n process.exit(1);\n }\n\n console.log(pc.cyan(`Creating project \"${name}\"...`));\n\n cpSync(templateDir, targetDir, { recursive: true });\n\n const pkgJsonPath = join(targetDir, \"package.json\");\n if (existsSync(pkgJsonPath)) {\n const pkgJson = JSON.parse(readFileSync(pkgJsonPath, \"utf-8\"));\n pkgJson.name = name;\n delete pkgJson.private;\n writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + \"\\n\");\n }\n\n console.log(pc.green(`\\nProject \"${name}\" created successfully!\\n`));\n console.log(\"Next steps:\");\n console.log(pc.cyan(` cd ${name}`));\n console.log(pc.cyan(\" npm install\"));\n console.log(pc.cyan(\" npm run dev\"));\n console.log();\n });\n\nprogram.parse();\n"],"mappings":";;;;AAAA,SAAS,eAAe;AACxB,OAAO,QAAQ;AACf,SAAS,QAAQ,YAAY,cAAc,qBAAqB;AAChE,SAAS,SAAS,SAAS,YAAY;AACvC,SAAS,qBAAqB;AAE9B,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AACxD,IAAM,cAAc,QAAQ,WAAW,MAAM,UAAU;AAEvD,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,uBAAuB,EAC5B,YAAY,uCAAuC,EACnD,eAAe,iBAAiB,yBAAyB,EACzD,OAAO,CAAC,SAA2B;AAClC,QAAM,OAAO,KAAK,KAAK,KAAK;AAE5B,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,GAAG,IAAI,kCAAkC,CAAC;AACxD,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,MAAI,CAAC,wCAAwC,KAAK,IAAI,GAAG;AACvD,YAAQ;AAAA,MACN,GAAG;AAAA,QACD;AAAA,MACF;AAAA,IACF;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,QAAM,YAAY,QAAQ,QAAQ,IAAI,GAAG,IAAI;AAE7C,MAAI,WAAW,SAAS,GAAG;AACzB,YAAQ;AAAA,MACN,GAAG,IAAI,qBAAqB,IAAI,mBAAmB;AAAA,IACrD;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,MAAI,CAAC,WAAW,WAAW,GAAG;AAC5B,YAAQ;AAAA,MACN,GAAG,IAAI,oEAAoE;AAAA,IAC7E;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,UAAQ,IAAI,GAAG,KAAK,qBAAqB,IAAI,MAAM,CAAC;AAEpD,SAAO,aAAa,WAAW,EAAE,WAAW,KAAK,CAAC;AAElD,QAAM,cAAc,KAAK,WAAW,cAAc;AAClD,MAAI,WAAW,WAAW,GAAG;AAC3B,UAAM,UAAU,KAAK,MAAM,aAAa,aAAa,OAAO,CAAC;AAC7D,YAAQ,OAAO;AACf,WAAO,QAAQ;AACf,kBAAc,aAAa,KAAK,UAAU,SAAS,MAAM,CAAC,IAAI,IAAI;AAAA,EACpE;AAEA,UAAQ,IAAI,GAAG,MAAM;AAAA,WAAc,IAAI;AAAA,CAA2B,CAAC;AACnE,UAAQ,IAAI,aAAa;AACzB,UAAQ,IAAI,GAAG,KAAK,QAAQ,IAAI,EAAE,CAAC;AACnC,UAAQ,IAAI,GAAG,KAAK,eAAe,CAAC;AACpC,UAAQ,IAAI,GAAG,KAAK,eAAe,CAAC;AACpC,UAAQ,IAAI;AACd,CAAC;AAEH,QAAQ,MAAM;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { cpSync, existsSync, readFileSync, renameSync, writeFileSync } from \"node:fs\";\nimport { resolve, dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst templateDir = resolve(__dirname, \"..\", \"template\");\n\nconst program = new Command();\n\nprogram\n .name(\"create-strayl-web-app\")\n .description(\"Scaffold a new Strayl web application\")\n .requiredOption(\"--name <name>\", \"Name of the new project\")\n .action((opts: { name: string }) => {\n const name = opts.name.trim();\n\n if (!name) {\n console.error(pc.red(\"Error: --name must not be empty.\"));\n process.exit(1);\n }\n\n if (!/^[a-zA-Z0-9_@\\/-][a-zA-Z0-9_.\\-@\\/]*$/.test(name)) {\n console.error(\n pc.red(\n \"Error: Invalid project name. Use only alphanumeric characters, hyphens, underscores, dots, and slashes.\"\n )\n );\n process.exit(1);\n }\n\n const targetDir = resolve(process.cwd(), name);\n\n if (existsSync(targetDir)) {\n console.error(\n pc.red(`Error: Directory \"${name}\" already exists.`)\n );\n process.exit(1);\n }\n\n if (!existsSync(templateDir)) {\n console.error(\n pc.red(\"Error: Template directory not found. The package may be corrupted.\")\n );\n process.exit(1);\n }\n\n console.log(pc.cyan(`Creating project \"${name}\"...`));\n\n cpSync(templateDir, targetDir, { recursive: true });\n\n // npm publish strips .gitignore, so we ship it as \"gitignore\" and rename here\n const gitignorePath = join(targetDir, \"gitignore\");\n if (existsSync(gitignorePath)) {\n renameSync(gitignorePath, join(targetDir, \".gitignore\"));\n }\n\n const pkgJsonPath = join(targetDir, \"package.json\");\n if (existsSync(pkgJsonPath)) {\n const pkgJson = JSON.parse(readFileSync(pkgJsonPath, \"utf-8\"));\n pkgJson.name = name;\n delete pkgJson.private;\n writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + \"\\n\");\n }\n\n console.log(pc.green(`\\nProject \"${name}\" created successfully!\\n`));\n console.log(\"Next steps:\");\n console.log(pc.cyan(` cd ${name}`));\n console.log(pc.cyan(\" npm install\"));\n console.log(pc.cyan(\" npm run dev\"));\n console.log();\n });\n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,QAAM,cAAc,KAAK,WAAW,cAAc;AAClD,MAAI,WAAW,WAAW,GAAG;AAC3B,UAAM,UAAU,KAAK,MAAM,aAAa,aAAa,OAAO,CAAC;AAC7D,YAAQ,OAAO;AACf,WAAO,QAAQ;AACf,kBAAc,aAAa,KAAK,UAAU,SAAS,MAAM,CAAC,IAAI,IAAI;AAAA,EACpE;AAEA,UAAQ,IAAI,GAAG,MAAM;AAAA,WAAc,IAAI;AAAA,CAA2B,CAAC;AACnE,UAAQ,IAAI,aAAa;AACzB,UAAQ,IAAI,GAAG,KAAK,QAAQ,IAAI,EAAE,CAAC;AACnC,UAAQ,IAAI,GAAG,KAAK,eAAe,CAAC;AACpC,UAAQ,IAAI,GAAG,KAAK,eAAe,CAAC;AACpC,UAAQ,IAAI;AACd,CAAC;AAEH,QAAQ,MAAM;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-strayl-web-app",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Scaffold a new Strayl web application",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,13 @@
1
+ node_modules
2
+ .DS_Store
3
+ dist
4
+ dist-ssr
5
+ *.local
6
+ count.txt
7
+ .env
8
+ .nitro
9
+ .tanstack
10
+ .wrangler
11
+ .output
12
+ .vinxi
13
+ todos.json