create-dreamer-app 1.0.1 → 1.0.2
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/LICENSE +15 -0
- package/README.md +99 -0
- package/package.json +2 -2
- package/template/src/assets/disco-dreamer.svg +4 -0
- package/template/tsconfig.json +3 -23
- package/template/vite.config.js +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Glorbicon
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# create-dreamer-app
|
|
2
|
+
|
|
3
|
+
Start building with **Disco Dreamer** in a few commands.
|
|
4
|
+
|
|
5
|
+
Scaffold a starter app with TypeScript, TSX components, and Vite already configured. The CLI creates your project and installs its dependencies so you can get straight to your first scene.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx create-dreamer-app@latest my-dreamer-app
|
|
11
|
+
cd my-dreamer-app
|
|
12
|
+
npm run dev
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Open the local URL printed by Vite. The development server uses port `3000` by default.
|
|
16
|
+
|
|
17
|
+
**Requirements:** Node.js `20.19+` within the Node 20 release line, or `22.12+`, and npm.
|
|
18
|
+
|
|
19
|
+
## What's included
|
|
20
|
+
|
|
21
|
+
- **Disco Dreamer** with a starter scene and text component.
|
|
22
|
+
- **TypeScript and TSX** with strict type checking.
|
|
23
|
+
- **Vite** for local development and production builds.
|
|
24
|
+
- **Source aliases** so you can import from `@/` instead of navigating relative paths.
|
|
25
|
+
- A full-page canvas with basic styles.
|
|
26
|
+
|
|
27
|
+
## Make it yours
|
|
28
|
+
|
|
29
|
+
Start in `src/components/Message/index.tsx` to change the greeting:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { Text } from "discodreamer";
|
|
33
|
+
|
|
34
|
+
export function Message() {
|
|
35
|
+
return <Text value="Hello, Dreamer!" />;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Add components to `src/components/GameScreen/index.tsx` to build out your scene. Use the `@/` alias anywhere in your TypeScript source:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Message } from "@/components/Message";
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Project structure
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
my-dreamer-app/
|
|
49
|
+
├── src/
|
|
50
|
+
│ ├── assets/
|
|
51
|
+
│ │ └── disco-dreamer.svg
|
|
52
|
+
│ ├── components/
|
|
53
|
+
│ │ ├── GameScreen/index.tsx
|
|
54
|
+
│ │ └── Message/index.tsx
|
|
55
|
+
│ ├── index.html # HTML page and canvas
|
|
56
|
+
│ ├── index.tsx # Root scene component
|
|
57
|
+
│ ├── main.ts # App registration
|
|
58
|
+
│ └── main.css # Canvas and page styles
|
|
59
|
+
├── package.json
|
|
60
|
+
├── tsconfig.json
|
|
61
|
+
└── vite.config.js
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Commands
|
|
65
|
+
|
|
66
|
+
Run these inside your generated project:
|
|
67
|
+
|
|
68
|
+
| Command | Description |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| `npm run dev` | Start the development server. |
|
|
71
|
+
| `npm run typecheck` | Check TypeScript without emitting files. |
|
|
72
|
+
| `npm run build` | Check types and build the app into `dist/`. |
|
|
73
|
+
| `npm run preview` | Preview the production build locally after building. |
|
|
74
|
+
|
|
75
|
+
## CLI options
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
npx create-dreamer-app@latest [directory] [--skip-install]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Omit the directory to choose a name interactively. The destination must be a new or empty directory.
|
|
82
|
+
|
|
83
|
+
| Option | Description |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `--skip-install` | Create the project without installing dependencies. |
|
|
86
|
+
| `-h`, `--help` | Show usage information. |
|
|
87
|
+
|
|
88
|
+
To install dependencies yourself:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
npx create-dreamer-app@latest my-dreamer-app --skip-install
|
|
92
|
+
cd my-dreamer-app
|
|
93
|
+
npm install
|
|
94
|
+
npm run dev
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
ISC
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-dreamer-app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "The scaffolding application for using Disco Dreamer.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"create-dreamer-app": "
|
|
7
|
+
"create-dreamer-app": "index.js"
|
|
8
8
|
},
|
|
9
9
|
"engines": {
|
|
10
10
|
"node": "^20.19.0 || >=22.12.0"
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="280" height="64" viewBox="0 0 280 64" role="img" aria-labelledby="title">
|
|
2
|
+
<title id="title">Disco Dreamer</title>
|
|
3
|
+
<text x="140" y="32" dominant-baseline="middle" text-anchor="middle" fill="#a78bfa" font-family="system-ui, sans-serif" font-size="32" font-weight="700">Disco Dreamer</text>
|
|
4
|
+
</svg>
|
package/template/tsconfig.json
CHANGED
|
@@ -1,37 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
2
|
"compilerOptions": {
|
|
4
|
-
// File Layout
|
|
5
3
|
"rootDir": "./src",
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
|
|
8
|
-
// Environment Settings
|
|
9
|
-
// See also https://aka.ms/tsconfig/module
|
|
10
4
|
"module": "esnext",
|
|
11
5
|
"moduleResolution": "bundler",
|
|
12
6
|
"noEmit": true,
|
|
13
7
|
"target": "esnext",
|
|
14
|
-
|
|
15
|
-
// Browser environment and Vite asset imports:
|
|
16
8
|
"lib": ["esnext", "DOM"],
|
|
17
9
|
"types": ["vite/client"],
|
|
18
|
-
|
|
19
|
-
// Other Outputs
|
|
20
|
-
"sourceMap": true,
|
|
21
|
-
|
|
22
|
-
// Stricter Typechecking Options
|
|
23
10
|
"noUncheckedIndexedAccess": true,
|
|
24
11
|
"exactOptionalPropertyTypes": false,
|
|
25
|
-
|
|
26
|
-
// Style Options
|
|
27
|
-
// "noImplicitReturns": true,
|
|
28
|
-
// "noImplicitOverride": true,
|
|
29
|
-
// "noUnusedLocals": true,
|
|
30
|
-
// "noUnusedParameters": true,
|
|
31
|
-
// "noFallthroughCasesInSwitch": true,
|
|
32
|
-
// "noPropertyAccessFromIndexSignature": true,
|
|
33
|
-
|
|
34
|
-
// Recommended Options
|
|
35
12
|
"strict": true,
|
|
36
13
|
"jsx": "preserve",
|
|
37
14
|
"verbatimModuleSyntax": true,
|
|
@@ -39,6 +16,9 @@
|
|
|
39
16
|
"noUncheckedSideEffectImports": true,
|
|
40
17
|
"moduleDetection": "force",
|
|
41
18
|
"skipLibCheck": true,
|
|
19
|
+
"paths": {
|
|
20
|
+
"@/*": ["./src/*"]
|
|
21
|
+
}
|
|
42
22
|
},
|
|
43
23
|
"include": ["src"]
|
|
44
24
|
}
|
package/template/vite.config.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { defineConfig } from "vite";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
2
3
|
|
|
3
4
|
export default defineConfig({
|
|
4
5
|
root: "src",
|
|
5
6
|
base: "./",
|
|
7
|
+
resolve: {
|
|
8
|
+
alias: {
|
|
9
|
+
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
10
|
+
},
|
|
11
|
+
},
|
|
6
12
|
oxc: {
|
|
7
13
|
jsxInject: 'import { DreamFactory as __DreamFactory } from "discodreamer"',
|
|
8
14
|
jsx: {
|