create-caspian-app 0.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.
@@ -0,0 +1,130 @@
1
+ <div class="container py-10">
2
+ <div class="max-w-2xl mx-auto bg-white shadow-sm rounded p-6">
3
+ <div class="flex items-start gap-4">
4
+ <svg
5
+ class="w-10 h-10 text-red-600"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ aria-hidden
10
+ >
11
+ <path
12
+ d="M11.001 2a1 1 0 0 1 .998 0L21 7v9a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V7l8.001-5z"
13
+ stroke="currentColor"
14
+ stroke-width="1.5"
15
+ stroke-linecap="round"
16
+ stroke-linejoin="round"
17
+ />
18
+ <path
19
+ d="M12 8v4"
20
+ stroke="currentColor"
21
+ stroke-width="1.5"
22
+ stroke-linecap="round"
23
+ stroke-linejoin="round"
24
+ />
25
+ <path
26
+ d="M12 16h.01"
27
+ stroke="currentColor"
28
+ stroke-width="1.5"
29
+ stroke-linecap="round"
30
+ stroke-linejoin="round"
31
+ />
32
+ </svg>
33
+
34
+ <div class="flex-1">
35
+ <h1 class="text-2xl font-semibold text-red-600">
36
+ Something went wrong
37
+ </h1>
38
+ <p class="mt-2 text-sm text-gray-600">
39
+ We're sorry — an unexpected error occurred. Try reloading or return to
40
+ the homepage.
41
+ </p>
42
+
43
+ <p class="mt-3 text-sm text-gray-700">[[error_message]]</p>
44
+
45
+ <div class="mt-4 flex flex-wrap gap-2">
46
+ <a
47
+ href="/"
48
+ class="inline-block px-3 py-1.5 bg-gray-100 border border-gray-200 rounded text-sm text-gray-800 hover:bg-gray-200"
49
+ >Home</a
50
+ >
51
+ <button
52
+ class="inline-block px-3 py-1.5 bg-blue-600 text-white rounded text-sm"
53
+ onclick="reloadPage()"
54
+ >
55
+ Reload
56
+ </button>
57
+ [% if error_trace %]
58
+ <button
59
+ id="toggleTraceBtn"
60
+ class="inline-block px-3 py-1.5 bg-transparent border border-gray-200 rounded text-sm text-black"
61
+ onclick="setShowTrace(showTrace => !showTrace)"
62
+ >
63
+ {showTrace ? "Hide details" : "Show details"}
64
+ </button>
65
+ [% endif %]
66
+ </div>
67
+ </div>
68
+ </div>
69
+
70
+ [% if error_trace %]
71
+ <div id="traceArea" class="mt-4" hidden="{!showTrace}">
72
+ <div class="flex items-center justify-between mb-2">
73
+ <div class="text-xs text-gray-500">Error details (soft copy)</div>
74
+ <div class="flex gap-2">
75
+ <button
76
+ class="px-2 py-1 text-xs bg-gray-100 border rounded text-black"
77
+ onclick="copyTrace()"
78
+ >
79
+ {showCopyTrace ? "Copied" : "Copy"}
80
+ </button>
81
+ <button
82
+ class="px-2 py-1 text-xs bg-gray-100 border rounded text-black"
83
+ onclick="downloadTrace()"
84
+ >
85
+ Download
86
+ </button>
87
+ </div>
88
+ </div>
89
+ <pre
90
+ id="tracePre"
91
+ class="p-4 bg-gray-100 rounded overflow-auto text-xs text-black"
92
+ >[[error_trace]]</pre>
93
+ </div>
94
+ [% endif %]
95
+ </div>
96
+ </div>
97
+
98
+ <script>
99
+ const [showTrace, setShowTrace] = pp.state(false);
100
+ const [showCopyTrace, setShowCopyTrace] = pp.state(false);
101
+
102
+ function reloadPage() {
103
+ window.location.reload();
104
+ }
105
+
106
+ function copyTrace() {
107
+ const tracePre = document.getElementById("tracePre");
108
+ navigator.clipboard.writeText(tracePre.innerText);
109
+
110
+ setShowCopyTrace(true);
111
+ setTimeout(() => {
112
+ setShowCopyTrace(false);
113
+ }, 2000);
114
+ }
115
+
116
+ function downloadTrace() {
117
+ const tracePre = document.getElementById("tracePre");
118
+ const blob = new Blob([tracePre.innerText], {
119
+ type: "text/plain",
120
+ });
121
+ const url = URL.createObjectURL(blob);
122
+ const a = document.createElement("a");
123
+ a.href = url;
124
+ a.download = "error_trace.txt";
125
+ document.body.appendChild(a);
126
+ a.click();
127
+ document.body.removeChild(a);
128
+ URL.revokeObjectURL(url);
129
+ }
130
+ </script>
@@ -0,0 +1,24 @@
1
+ @import "tailwindcss";
2
+
3
+ :root {
4
+ --background: #ffffff;
5
+ --foreground: #171717;
6
+ }
7
+
8
+ @theme inline {
9
+ --color-background: var(--background);
10
+ --color-foreground: var(--foreground);
11
+ }
12
+
13
+ @media (prefers-color-scheme: dark) {
14
+ :root {
15
+ --background: #0a0a0a;
16
+ --foreground: #ededed;
17
+ }
18
+ }
19
+
20
+ body {
21
+ background: var(--background);
22
+ color: var(--foreground);
23
+ font-family: Arial, Helvetica, sans-serif;
24
+ }
@@ -0,0 +1,159 @@
1
+ <div
2
+ class="min-h-screen bg-background text-foreground selection:bg-primary/30 flex flex-col items-center justify-between py-8 md:py-12 px-6 md:px-24 overflow-x-hidden relative"
3
+ >
4
+ <div class="fixed inset-0 bg-grid -z-20 opacity-[0.15]"></div>
5
+ <div class="fixed inset-0 glow-conic -z-10 translate-y-[-20%]"></div>
6
+
7
+ <div
8
+ class="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex"
9
+ >
10
+ <p
11
+ class="fixed left-0 top-0 flex w-full justify-center border-b border-border bg-background/80 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-muted/30 lg:p-4 lg:dark:bg-zinc-800/30"
12
+ >
13
+ Get started by editing&nbsp;
14
+ <code class="font-bold text-primary">src/app/index.html</code>
15
+ </p>
16
+
17
+ <div
18
+ class="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-linear-to-t from-background via-background lg:static lg:h-auto lg:w-auto lg:bg-none"
19
+ >
20
+ <a
21
+ href="https://github.com/TheSteelNinjaCode/create-caspian-app"
22
+ target="_blank"
23
+ rel="noreferrer"
24
+ class="pointer-events-auto flex place-items-center gap-2 p-8 lg:p-0 hover:text-primary transition-colors"
25
+ >
26
+ <span class="font-brand text-xs font-bold tracking-widest"
27
+ >BUILT WITH CASPIAN</span
28
+ >
29
+
30
+ <svg
31
+ xmlns="http://www.w3.org/2000/svg"
32
+ viewBox="0 0 24 24"
33
+ class="h-5 w-5"
34
+ fill="currentColor"
35
+ aria-hidden="true"
36
+ >
37
+ <path
38
+ d="M12 2C6.477 2 2 6.486 2 12.02c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.866-.013-1.7-2.782.605-3.369-1.343-3.369-1.343-.454-1.157-1.109-1.466-1.109-1.466-.907-.62.069-.608.069-.608 1.003.071 1.531 1.033 1.531 1.033.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.952 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.27.098-2.646 0 0 .84-.27 2.75 1.026A9.56 9.56 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.748-1.026 2.748-1.026.546 1.376.202 2.393.1 2.646.64.7 1.028 1.595 1.028 2.688 0 3.849-2.339 4.695-4.566 4.944.359.31.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.579.688.481A10.02 10.02 0 0 0 22 12.02C22 6.486 17.523 2 12 2z"
39
+ />
40
+ </svg>
41
+ </a>
42
+ </div>
43
+ </div>
44
+
45
+ <div
46
+ class="relative flex flex-col items-center justify-center gap-6 z-10 before:absolute before:h-75 before:w-120 before:-translate-x-1/2 before:rounded-full before:bg-linear-to-br before:from-transparent before:to-primary before:opacity-10 before:blur-2xl before:content-[''] before:max-w-full after:absolute after:-z-20 after:h-45 after:w-60 after:translate-x-1/3 after:bg-linear-to-t after:from-cyan-300 after:via-primary after:opacity-20 after:blur-2xl after:content-[''] after:max-w-full"
47
+ >
48
+ <div
49
+ class="relative flex flex-col items-center justify-center gap-6 z-10 pt-24 lg:pt-0 before:absolute before:h-75 before:w-120 before:-translate-x-1/2 before:rounded-full before:bg-linear-to-br before:from-transparent before:to-primary before:opacity-10 before:blur-2xl before:content-[''] before:max-w-full after:absolute after:-z-20 after:h-45 after:w-60 after:translate-x-1/3 after:bg-linear-to-t after:from-cyan-300 after:via-primary after:opacity-20 after:blur-2xl after:content-[''] after:max-w-full"
50
+ >
51
+ <div
52
+ class="relative w-24 h-24 md:w-32 md:h-32 flex items-center justify-center mb-4"
53
+ >
54
+ <img
55
+ src="/favicon.ico"
56
+ alt="caspian logo"
57
+ class="w-full h-full object-contain"
58
+ />
59
+ </div>
60
+
61
+ <h1
62
+ class="text-4xl md:text-6xl font-bold font-brand tracking-tight text-center"
63
+ >
64
+ CASPIAN
65
+ </h1>
66
+ </div>
67
+ <p
68
+ class="text-muted-foreground text-center max-w-[85vw] md:max-w-125 text-sm md:text-base"
69
+ >
70
+ The Native Python Framework with
71
+ <span class="text-[#053b69] font-medium whitespace-nowrap"
72
+ >PulsePoint</span
73
+ >
74
+ Reactivity.
75
+ </p>
76
+ </div>
77
+
78
+ <div
79
+ class="mb-32 grid text-center lg:max-w-5xl lg:w-full lg:mb-0 grid-cols-1 md:grid-cols-2 lg:grid-cols-4 lg:text-left gap-5 md:gap-6 mt-16"
80
+ >
81
+ <a
82
+ href="https://caspian.tsnc.tech/docs"
83
+ class="group rounded-lg border border-transparent px-5 py-4 transition-all hover:border-border hover:bg-muted/20 hover:backdrop-blur-sm"
84
+ target="_blank"
85
+ >
86
+ <h2
87
+ class="mb-3 text-xl md:text-2xl font-semibold font-brand group-hover:text-primary transition-colors"
88
+ >
89
+ Docs
90
+ <span
91
+ class="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none"
92
+ >-></span
93
+ >
94
+ </h2>
95
+ <p class="m-0 text-sm text-muted-foreground">
96
+ Find in-depth information about Caspian, Prisma, and PulsePoint
97
+ features.
98
+ </p>
99
+ </a>
100
+
101
+ <a
102
+ href="https://caspian.tsnc.tech/docs/rpc"
103
+ class="group rounded-lg border border-transparent px-5 py-4 transition-all hover:border-border hover:bg-muted/20 hover:backdrop-blur-sm"
104
+ target="_blank"
105
+ >
106
+ <h2
107
+ class="mb-3 text-xl md:text-2xl font-semibold font-brand group-hover:text-cyan-400 transition-colors"
108
+ >
109
+ RPC
110
+ <span
111
+ class="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none"
112
+ >-></span
113
+ >
114
+ </h2>
115
+ <p class="m-0 text-sm text-muted-foreground">
116
+ Learn how to call Python functions from HTML using Native RPC.
117
+ </p>
118
+ </a>
119
+
120
+ <a
121
+ href="https://caspian.tsnc.tech/docs/database"
122
+ class="group rounded-lg border border-transparent px-5 py-4 transition-all hover:border-border hover:bg-muted/20 hover:backdrop-blur-sm"
123
+ target="_blank"
124
+ >
125
+ <h2
126
+ class="mb-3 text-xl md:text-2xl font-semibold font-brand group-hover:text-purple-400 transition-colors"
127
+ >
128
+ Schema
129
+ <span
130
+ class="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none"
131
+ >-></span
132
+ >
133
+ </h2>
134
+ <p class="m-0 text-sm text-muted-foreground">
135
+ Edit <code>schema.prisma</code> to define your data models and generate
136
+ type-safe clients.
137
+ </p>
138
+ </a>
139
+
140
+ <a
141
+ href="https://caspian.tsnc.tech/docs/deploy"
142
+ class="group rounded-lg border border-transparent px-5 py-4 transition-all hover:border-border hover:bg-muted/20 hover:backdrop-blur-sm"
143
+ target="_blank"
144
+ >
145
+ <h2
146
+ class="mb-3 text-xl md:text-2xl font-semibold font-brand group-hover:text-green-400 transition-colors"
147
+ >
148
+ Deploy
149
+ <span
150
+ class="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none"
151
+ >-></span
152
+ >
153
+ </h2>
154
+ <p class="m-0 text-sm text-muted-foreground">
155
+ Instantly deploy your native Python app to Vercel, Railway, or Docker.
156
+ </p>
157
+ </a>
158
+ </div>
159
+ </div>
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" class="dark">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>[[layout.title]]</title>
7
+ <meta name="description" content="[[layout.description]]" />
8
+ <link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16" />
9
+ </head>
10
+
11
+ <body
12
+ pp-spa="true"
13
+ style="
14
+ opacity: 0;
15
+ pointer-events: none;
16
+ user-select: none;
17
+ transition: opacity 0.18s ease-out;
18
+ "
19
+ >
20
+ [[children | safe]]
21
+ </body>
22
+ </html>
@@ -0,0 +1,18 @@
1
+ <div class="bg-gray-50 flex h-screen items-center justify-center px-4">
2
+ <div class="text-center">
3
+ <h1 class="text-9xl font-black text-gray-200">404</h1>
4
+
5
+ <p class="text-2xl font-bold tracking-tight text-gray-900 sm:text-4xl">
6
+ Uh-oh!
7
+ </p>
8
+
9
+ <p class="mt-4 text-gray-500">We can't find that page.</p>
10
+
11
+ <a
12
+ href="/"
13
+ class="mt-6 inline-block rounded bg-indigo-600 px-5 py-3 text-sm font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring"
14
+ >
15
+ Go Back Home
16
+ </a>
17
+ </div>
18
+ </div>
@@ -0,0 +1,35 @@
1
+ export function createGlobalSingleton<T>(
2
+ name: string,
3
+ SingletonClass: { getInstance(): T } | T,
4
+ target: any = window,
5
+ immediateInit: boolean = true
6
+ ) {
7
+ Object.defineProperty(target, name, {
8
+ get() {
9
+ if (
10
+ SingletonClass &&
11
+ (typeof SingletonClass === "function" ||
12
+ typeof SingletonClass === "object") &&
13
+ "getInstance" in SingletonClass &&
14
+ typeof SingletonClass.getInstance === "function"
15
+ ) {
16
+ return (SingletonClass as { getInstance(): T }).getInstance();
17
+ } else {
18
+ return SingletonClass as T;
19
+ }
20
+ },
21
+ set(next) {
22
+ console.warn(`[${name}] Cannot override global ${name}; ignoring.`, next);
23
+ },
24
+ configurable: false,
25
+ enumerable: true,
26
+ });
27
+
28
+ if (immediateInit) {
29
+ try {
30
+ target[name];
31
+ } catch (error) {
32
+ console.error(`Failed to initialize ${name}:`, error);
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,5 @@
1
+ import "/js/pp-reactive-v1.js";
2
+
3
+ // The following global names have already been declared elsewhere in the project:
4
+ // - pp: Used for the Reactive Core functionality.
5
+ // - searchParams: Manages URL manipulation and query parameters.
@@ -0,0 +1,111 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
18
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
+
27
+ /* Modules */
28
+ "module": "ESNext" /* Specify what module code is generated. */,
29
+ // "rootDir": "./", /* Specify the root folder within your source files. */
30
+ "moduleResolution": "Node", /* Specify how TypeScript looks up a file from a given module specifier. */
31
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
+ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
39
+ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
40
+ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
41
+ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
42
+ "resolveJsonModule": true /* Enable importing .json files. */,
43
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
44
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
45
+
46
+ /* JavaScript Support */
47
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
48
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
49
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
50
+
51
+ /* Emit */
52
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
53
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
54
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
55
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
56
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
57
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
58
+ // "outDir": "./", /* Specify an output folder for all emitted files. */
59
+ // "removeComments": true, /* Disable emitting comments. */
60
+ // "noEmit": true, /* Disable emitting files from a compilation. */
61
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
62
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
63
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
64
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
65
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
66
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
67
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
68
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
69
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
70
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
71
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
72
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
73
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
74
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
75
+
76
+ /* Interop Constraints */
77
+ "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
78
+ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
79
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
80
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
81
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
82
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
83
+
84
+ /* Type Checking */
85
+ "strict": true /* Enable all strict type-checking options. */,
86
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
87
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
88
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
89
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
90
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
91
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
92
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
93
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
94
+ "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
95
+ "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
96
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
97
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
98
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
99
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
100
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
101
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
102
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
103
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
104
+
105
+ /* Completeness */
106
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
107
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
108
+ },
109
+ "include": ["**/*.ts", ".casp/**/*.d.ts"],
110
+ "exclude": ["node_modules", ".venv"]
111
+ }
@@ -0,0 +1,61 @@
1
+ import { defineConfig, Plugin } from "vite";
2
+ import path from "path";
3
+ import fg from "fast-glob";
4
+ import { writeFileSync } from "fs";
5
+ import { generateGlobalTypes } from "./settings/vite-plugins/generate-global-types.js";
6
+
7
+ const entries = Object.fromEntries(
8
+ fg.sync("ts/**/*.ts", { ignore: ["**/*.test.ts"] }).map((f) => {
9
+ const rel = f.replace(/^ts\//, "").replace(/\.ts$/, "");
10
+ return [rel, path.resolve(__dirname, f)];
11
+ })
12
+ );
13
+
14
+ const VITE_WATCH_EXCLUDE = [
15
+ "public/js/**",
16
+ "node_modules/**",
17
+ ".venv/**",
18
+ ".casp/**",
19
+ ];
20
+
21
+ function browserSyncNotify(): Plugin {
22
+ const flagFile = path.resolve(__dirname, ".casp", ".vite-build-complete");
23
+
24
+ return {
25
+ name: "browsersync-notify",
26
+ writeBundle() {
27
+ writeFileSync(flagFile, Date.now().toString());
28
+ },
29
+ };
30
+ }
31
+
32
+ export default defineConfig(({ command, mode }) => ({
33
+ publicDir: false,
34
+ build: {
35
+ outDir: "public/js",
36
+ emptyOutDir: false,
37
+ minify: "esbuild",
38
+ sourcemap: false,
39
+ watch:
40
+ command === "build" && mode === "development"
41
+ ? { exclude: VITE_WATCH_EXCLUDE }
42
+ : undefined,
43
+ rollupOptions: {
44
+ input: entries,
45
+ external: [/^\/js\/.*/],
46
+ output: {
47
+ entryFileNames: "[name].js",
48
+ chunkFileNames: "chunks/[name]-[hash].js",
49
+ assetFileNames: "assets/[name]-[hash][extname]",
50
+ },
51
+ },
52
+ },
53
+ plugins: [
54
+ generateGlobalTypes(),
55
+ ...(command === "build" && mode === "development"
56
+ ? [browserSyncNotify()]
57
+ : []),
58
+ ],
59
+ esbuild: { legalComments: "none" },
60
+ define: { "process.env.NODE_ENV": '"production"' },
61
+ }));
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "create-caspian-app",
3
+ "version": "0.0.1",
4
+ "description": "Scaffold a new Caspian project (FastAPI-powered reactive Python framework).",
5
+ "main": "dist/index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1",
9
+ "prepublish": "npm run tsc"
10
+ },
11
+ "bin": {
12
+ "create-caspian-app": "dist/index.js",
13
+ "casp": "dist/caspian.js"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/TheSteelNinjaCode/create-caspian-app.git"
18
+ },
19
+ "homepage": "https://caspian.tsnc.tech/",
20
+ "keywords": [
21
+ "caspian",
22
+ "caspian orm",
23
+ "prisma",
24
+ "python",
25
+ "nodejs",
26
+ "venv",
27
+ "orm",
28
+ "database",
29
+ "boilerplate"
30
+ ],
31
+ "author": "Jefferson Abraham Omier <thesteelninjacode@gmail.com>",
32
+ "license": "MIT",
33
+ "devDependencies": {
34
+ "@types/node": "^25.0.3",
35
+ "eslint": "^9.39.2",
36
+ "typescript": "^5.9.3"
37
+ },
38
+ "dependencies": {
39
+ "chalk": "^5.6.2",
40
+ "prompts": "^2.4.2"
41
+ }
42
+ }