sprawlify 0.0.92 → 0.0.94

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.mjs +310 -12
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -6,9 +6,8 @@ import { cyan, green, red, yellow } from "kleur/colors";
6
6
  import { z } from "zod";
7
7
  import { existsSync } from "fs";
8
8
  import prompts from "prompts";
9
- import dedent from "dedent";
10
9
  //#region package.json
11
- var version = "0.0.92";
10
+ var version = "0.0.94";
12
11
  //#endregion
13
12
  //#region src/utils/file-helper.ts
14
13
  const FILE_BACKUP_SUFFIX = ".bak";
@@ -342,9 +341,104 @@ function createTemplate(config) {
342
341
  //#endregion
343
342
  //#region src/templates/index.ts
344
343
  const templates = {
345
- react: createTemplate({ files: [{
346
- path: "tsconfig.app.json",
347
- content: dedent`{
344
+ react: createTemplate({ files: [
345
+ {
346
+ path: "src/root.tsx",
347
+ content: `export function Root() {
348
+ return (
349
+ <div>
350
+ <h1 className="text-2xl font-bold">Welcome to Sprawlify + React!</h1>
351
+ <p className="mt-4 text-lg">This is your root component.</p>
352
+ </div>
353
+ )
354
+ }`
355
+ },
356
+ {
357
+ path: "src/main.tsx",
358
+ content: `import { StrictMode } from 'react'
359
+ import { createRoot } from 'react-dom/client'
360
+ import { Root } from './root'
361
+ import './globals.css'
362
+
363
+ createRoot(document.getElementById('root')!).render(
364
+ <StrictMode>
365
+ <Root />
366
+ </StrictMode>,
367
+ )`
368
+ },
369
+ {
370
+ path: ".gitignore",
371
+ content: `# Logs
372
+ logs
373
+ *.log
374
+ npm-debug.log*
375
+ yarn-debug.log*
376
+ yarn-error.log*
377
+ pnpm-debug.log*
378
+ lerna-debug.log*
379
+
380
+ node_modules
381
+ dist
382
+ dist-ssr
383
+ *.local
384
+
385
+ # Editor directories and files
386
+ .vscode/*
387
+ !.vscode/extensions.json
388
+ .idea
389
+ .DS_Store
390
+ *.suo
391
+ *.ntvs*
392
+ *.njsproj
393
+ *.sln
394
+ *.sw?`
395
+ },
396
+ {
397
+ path: "index.html",
398
+ content: `<!DOCTYPE html>
399
+ <html lang="en">
400
+ <head>
401
+ <meta charset="UTF-8" />
402
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
403
+ <title>Sprawlify + React</title>
404
+ </head>
405
+ <body>
406
+ <div id="root"></div>
407
+ <script type="module" src="/src/main.tsx"><\/script>
408
+ </body>
409
+ </html>`
410
+ },
411
+ {
412
+ path: "package.json",
413
+ content: `{
414
+ "private": true,
415
+ "version": "0.0.0",
416
+ "type": "module",
417
+ "scripts": {
418
+ "dev": "vite",
419
+ "build": "tsc -b && vite build",
420
+ "preview": "vite preview"
421
+ },
422
+ "dependencies": {
423
+ "react": "^19.2.4",
424
+ "react-dom": "^19.2.4"
425
+ },
426
+ "devDependencies": {
427
+ "@tailwindcss/vite": "^4.2.1",
428
+ "@types/node": "^24.12.0",
429
+ "@types/react": "^19.2.14",
430
+ "@types/react-dom": "^19.2.3",
431
+ "@vitejs/plugin-react": "^6.0.1",
432
+ "globals": "^17.4.0",
433
+ "tailwindcss": "^4.2.1",
434
+ "typescript": "~5.9.3",
435
+ "vite": "^8.0.0"
436
+ }
437
+ }`
438
+ },
439
+ {
440
+ path: "tsconfig.app.json",
441
+ content: `{
348
442
  "compilerOptions": {
349
443
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
350
444
  "target": "ES2023",
@@ -369,21 +463,225 @@ const templates = {
369
463
  "noUncheckedSideEffectImports": true
370
464
  },
371
465
  "include": ["src"]
466
+ }`
467
+ },
468
+ {
469
+ path: "tsconfig.json",
470
+ content: `{
471
+ "files": [],
472
+ "references": [
473
+ { "path": "./tsconfig.app.json" },
474
+ { "path": "./tsconfig.node.json" }
475
+ ]
476
+ }`
477
+ },
478
+ {
479
+ path: "tsconfig.node.json",
480
+ content: `{
481
+ "compilerOptions": {
482
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
483
+ "target": "ES2023",
484
+ "lib": ["ES2023"],
485
+ "module": "ESNext",
486
+ "types": ["node"],
487
+ "skipLibCheck": true,
488
+ /* Bundler mode */
489
+ "moduleResolution": "bundler",
490
+ "allowImportingTsExtensions": true,
491
+ "verbatimModuleSyntax": true,
492
+ "moduleDetection": "force",
493
+ "noEmit": true,
494
+ /* Linting */
495
+ "strict": true,
496
+ "noUnusedLocals": true,
497
+ "noUnusedParameters": true,
498
+ "erasableSyntaxOnly": true,
499
+ "noFallthroughCasesInSwitch": true,
500
+ "noUncheckedSideEffectImports": true
501
+ },
502
+ "include": ["vite.config.ts"]
503
+ }`
504
+ },
505
+ {
506
+ path: "vite.config.ts",
507
+ content: `import { defineConfig } from "vite"
508
+ import react from "@vitejs/plugin-react"
509
+ import tailwindcss from "@tailwindcss/vite"
510
+
511
+ export default defineConfig({
512
+ plugins: [tailwindcss(), react()],
513
+ })`
514
+ }
515
+ ] }),
516
+ solid: createTemplate({ files: [
517
+ {
518
+ path: "src/root.tsx",
519
+ content: `export function Root() {
520
+ return (
521
+ <div>
522
+ <h1 class="text-2xl font-bold">Welcome to Sprawlify + React!</h1>
523
+ <p class="mt-4 text-lg">This is your root component.</p>
524
+ </div>
525
+ )
526
+ }`
527
+ },
528
+ {
529
+ path: "src/main.tsx",
530
+ content: `/* @refresh reload */
531
+ import { render } from "solid-js/web"
532
+ import { Root } from "./root"
533
+ ]import "./globals.css"
534
+
535
+ const root = document.getElementById('root')
536
+
537
+ render(() => <Root />, root!)`
538
+ },
539
+ {
540
+ path: ".gitignore",
541
+ content: `# Logs
542
+ logs
543
+ *.log
544
+ npm-debug.log*
545
+ yarn-debug.log*
546
+ yarn-error.log*
547
+ pnpm-debug.log*
548
+ lerna-debug.log*
549
+
550
+ node_modules
551
+ dist
552
+ dist-ssr
553
+ *.local
554
+
555
+ # Editor directories and files
556
+ .vscode/*
557
+ !.vscode/extensions.json
558
+ .idea
559
+ .DS_Store
560
+ *.suo
561
+ *.ntvs*
562
+ *.njsproj
563
+ *.sln
564
+ *.sw?`
565
+ },
566
+ {
567
+ path: "index.html",
568
+ content: `<!DOCTYPE html>
569
+ <html lang="en">
570
+ <head>
571
+ <meta charset="UTF-8" />
572
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
573
+ <title>Sprawlify + Solid</title>
574
+ </head>
575
+ <body>
576
+ <div id="root"></div>
577
+ <script type="module" src="/src/main.tsx"><\/script>
578
+ </body>
579
+ </html>
580
+ `
581
+ },
582
+ {
583
+ path: "package.json",
584
+ content: `{
585
+ "private": true,
586
+ "version": "0.0.0",
587
+ "type": "module",
588
+ "scripts": {
589
+ "dev": "vite",
590
+ "build": "tsc -b && vite build",
591
+ "preview": "vite preview"
592
+ },
593
+ "dependencies": {
594
+ "solid-js": "^1.9.11"
595
+ },
596
+ "devDependencies": {
597
+ "@types/node": "^24.12.0",
598
+ "typescript": "~5.9.3",
599
+ "vite": "^8.0.0",
600
+ "vite-plugin-solid": "^2.11.11"
601
+ }
372
602
  }
373
603
  `
374
- }, {
375
- path: "tsconfig.json",
376
- content: dedent`{
604
+ },
605
+ {
606
+ path: "tsconfig.app.json",
607
+ content: `{
608
+ "compilerOptions": {
609
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
610
+ "target": "ES2023",
611
+ "useDefineForClassFields": true,
612
+ "module": "ESNext",
613
+ "lib": ["ES2023", "DOM", "DOM.Iterable"],
614
+ "types": ["vite/client"],
615
+ "skipLibCheck": true,
616
+ /* Bundler mode */
617
+ "moduleResolution": "bundler",
618
+ "allowImportingTsExtensions": true,
619
+ "verbatimModuleSyntax": true,
620
+ "moduleDetection": "force",
621
+ "noEmit": true,
622
+ "jsx": "preserve",
623
+ "jsxImportSource": "solid-js",
624
+ /* Linting */
625
+ "strict": true,
626
+ "noUnusedLocals": true,
627
+ "noUnusedParameters": true,
628
+ "erasableSyntaxOnly": true,
629
+ "noFallthroughCasesInSwitch": true,
630
+ "noUncheckedSideEffectImports": true
631
+ },
632
+ "include": ["src"]
633
+ }`
634
+ },
635
+ {
636
+ path: "tsconfig.json",
637
+ content: `{
377
638
  "files": [],
378
639
  "references": [
379
640
  { "path": "./tsconfig.app.json" },
380
641
  { "path": "./tsconfig.node.json" }
381
642
  ]
382
643
  }`
383
- }] }),
384
- solid: createTemplate({}),
385
- svelte: createTemplate({}),
386
- vue: createTemplate({})
644
+ },
645
+ {
646
+ path: "tsconfig.node.json",
647
+ content: `{
648
+ "compilerOptions": {
649
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
650
+ "target": "ES2023",
651
+ "lib": ["ES2023"],
652
+ "module": "ESNext",
653
+ "types": ["node"],
654
+ "skipLibCheck": true,
655
+ /* Bundler mode */
656
+ "moduleResolution": "bundler",
657
+ "allowImportingTsExtensions": true,
658
+ "verbatimModuleSyntax": true,
659
+ "moduleDetection": "force",
660
+ "noEmit": true,
661
+ /* Linting */
662
+ "strict": true,
663
+ "noUnusedLocals": true,
664
+ "noUnusedParameters": true,
665
+ "erasableSyntaxOnly": true,
666
+ "noFallthroughCasesInSwitch": true,
667
+ "noUncheckedSideEffectImports": true
668
+ },
669
+ "include": ["vite.config.ts"]
670
+ }`
671
+ },
672
+ {
673
+ path: "vite.config.ts",
674
+ content: `import { defineConfig } from "vite"
675
+ import solid from "vite-plugin-solid"
676
+ import tailwindcss from "@tailwindcss/vite"
677
+
678
+ export default defineConfig({
679
+ plugins: [tailwindcss(), solid()],
680
+ })`
681
+ }
682
+ ] }),
683
+ svelte: createTemplate({ files: [] }),
684
+ vue: createTemplate({ files: [] })
387
685
  };
388
686
  //#endregion
389
687
  //#region src/commands/init/run-init.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprawlify",
3
- "version": "0.0.92",
3
+ "version": "0.0.94",
4
4
  "type": "module",
5
5
  "description": "A command-line interface for Sprawlify.",
6
6
  "author": "sprawlify <npm@sprawlify.com>",