sprawlify 0.0.93 → 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.
- package/dist/index.mjs +193 -23
- 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.
|
|
10
|
+
var version = "0.0.94";
|
|
12
11
|
//#endregion
|
|
13
12
|
//#region src/utils/file-helper.ts
|
|
14
13
|
const FILE_BACKUP_SUFFIX = ".bak";
|
|
@@ -340,20 +339,12 @@ function createTemplate(config) {
|
|
|
340
339
|
};
|
|
341
340
|
}
|
|
342
341
|
//#endregion
|
|
343
|
-
//#region \0@oxc-project+runtime@0.115.0/helpers/taggedTemplateLiteral.js
|
|
344
|
-
function _taggedTemplateLiteral(e, t) {
|
|
345
|
-
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } }));
|
|
346
|
-
}
|
|
347
|
-
//#endregion
|
|
348
|
-
//#region src/templates/react.ts
|
|
349
|
-
var _templateObject;
|
|
350
|
-
//#endregion
|
|
351
342
|
//#region src/templates/index.ts
|
|
352
343
|
const templates = {
|
|
353
344
|
react: createTemplate({ files: [
|
|
354
345
|
{
|
|
355
346
|
path: "src/root.tsx",
|
|
356
|
-
content:
|
|
347
|
+
content: `export function Root() {
|
|
357
348
|
return (
|
|
358
349
|
<div>
|
|
359
350
|
<h1 className="text-2xl font-bold">Welcome to Sprawlify + React!</h1>
|
|
@@ -364,7 +355,7 @@ const templates = {
|
|
|
364
355
|
},
|
|
365
356
|
{
|
|
366
357
|
path: "src/main.tsx",
|
|
367
|
-
content:
|
|
358
|
+
content: `import { StrictMode } from 'react'
|
|
368
359
|
import { createRoot } from 'react-dom/client'
|
|
369
360
|
import { Root } from './root'
|
|
370
361
|
import './globals.css'
|
|
@@ -377,7 +368,7 @@ createRoot(document.getElementById('root')!).render(
|
|
|
377
368
|
},
|
|
378
369
|
{
|
|
379
370
|
path: ".gitignore",
|
|
380
|
-
content:
|
|
371
|
+
content: `# Logs
|
|
381
372
|
logs
|
|
382
373
|
*.log
|
|
383
374
|
npm-debug.log*
|
|
@@ -404,11 +395,22 @@ dist-ssr
|
|
|
404
395
|
},
|
|
405
396
|
{
|
|
406
397
|
path: "index.html",
|
|
407
|
-
content:
|
|
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>`
|
|
408
410
|
},
|
|
409
411
|
{
|
|
410
412
|
path: "package.json",
|
|
411
|
-
content:
|
|
413
|
+
content: `{
|
|
412
414
|
"private": true,
|
|
413
415
|
"version": "0.0.0",
|
|
414
416
|
"type": "module",
|
|
@@ -422,11 +424,13 @@ dist-ssr
|
|
|
422
424
|
"react-dom": "^19.2.4"
|
|
423
425
|
},
|
|
424
426
|
"devDependencies": {
|
|
427
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
425
428
|
"@types/node": "^24.12.0",
|
|
426
429
|
"@types/react": "^19.2.14",
|
|
427
430
|
"@types/react-dom": "^19.2.3",
|
|
428
431
|
"@vitejs/plugin-react": "^6.0.1",
|
|
429
432
|
"globals": "^17.4.0",
|
|
433
|
+
"tailwindcss": "^4.2.1",
|
|
430
434
|
"typescript": "~5.9.3",
|
|
431
435
|
"vite": "^8.0.0"
|
|
432
436
|
}
|
|
@@ -434,7 +438,7 @@ dist-ssr
|
|
|
434
438
|
},
|
|
435
439
|
{
|
|
436
440
|
path: "tsconfig.app.json",
|
|
437
|
-
content:
|
|
441
|
+
content: `{
|
|
438
442
|
"compilerOptions": {
|
|
439
443
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
440
444
|
"target": "ES2023",
|
|
@@ -463,7 +467,7 @@ dist-ssr
|
|
|
463
467
|
},
|
|
464
468
|
{
|
|
465
469
|
path: "tsconfig.json",
|
|
466
|
-
content:
|
|
470
|
+
content: `{
|
|
467
471
|
"files": [],
|
|
468
472
|
"references": [
|
|
469
473
|
{ "path": "./tsconfig.app.json" },
|
|
@@ -473,7 +477,7 @@ dist-ssr
|
|
|
473
477
|
},
|
|
474
478
|
{
|
|
475
479
|
path: "tsconfig.node.json",
|
|
476
|
-
content:
|
|
480
|
+
content: `{
|
|
477
481
|
"compilerOptions": {
|
|
478
482
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
479
483
|
"target": "ES2023",
|
|
@@ -500,16 +504,182 @@ dist-ssr
|
|
|
500
504
|
},
|
|
501
505
|
{
|
|
502
506
|
path: "vite.config.ts",
|
|
503
|
-
content:
|
|
504
|
-
import react from
|
|
507
|
+
content: `import { defineConfig } from "vite"
|
|
508
|
+
import react from "@vitejs/plugin-react"
|
|
509
|
+
import tailwindcss from "@tailwindcss/vite"
|
|
505
510
|
|
|
506
511
|
export default defineConfig({
|
|
507
|
-
plugins: [react()],
|
|
508
|
-
})
|
|
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>
|
|
509
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
|
+
}
|
|
602
|
+
}
|
|
603
|
+
`
|
|
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: `{
|
|
638
|
+
"files": [],
|
|
639
|
+
"references": [
|
|
640
|
+
{ "path": "./tsconfig.app.json" },
|
|
641
|
+
{ "path": "./tsconfig.node.json" }
|
|
642
|
+
]
|
|
643
|
+
}`
|
|
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
|
+
})`
|
|
510
681
|
}
|
|
511
682
|
] }),
|
|
512
|
-
solid: createTemplate({ files: [] }),
|
|
513
683
|
svelte: createTemplate({ files: [] }),
|
|
514
684
|
vue: createTemplate({ files: [] })
|
|
515
685
|
};
|