@inglorious/create-app 0.3.3 → 0.4.0
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 +9 -9
- package/README.md +59 -59
- package/bin/index.js +49 -4
- package/package.json +3 -3
- package/templates/js/.prettierrc.yml +1 -1
- package/templates/js/LICENSE +9 -9
- package/templates/js/README.md +29 -29
- package/templates/js/gitignore +49 -49
- package/templates/js/index.html +15 -15
- package/templates/js/package.json +2 -2
- package/templates/js/public/style.css +7 -7
- package/templates/js-jsx/.prettierrc.yml +1 -0
- package/templates/js-jsx/LICENSE +9 -0
- package/templates/js-jsx/README.md +29 -0
- package/templates/js-jsx/eslint.config.js +13 -0
- package/templates/js-jsx/gitignore +49 -0
- package/templates/js-jsx/index.html +15 -0
- package/templates/js-jsx/package.json +34 -0
- package/templates/js-jsx/public/logo.png +0 -0
- package/templates/js-jsx/public/style.css +7 -0
- package/templates/js-jsx/src/app.jsx +9 -0
- package/templates/js-jsx/src/main.js +6 -0
- package/templates/js-jsx/src/message/message.jsx +14 -0
- package/templates/js-jsx/src/store/entities.js +14 -0
- package/templates/js-jsx/src/store/index.js +11 -0
- package/templates/js-jsx/src/store/middlewares.js +7 -0
- package/templates/js-jsx/vite.config.js +21 -0
- package/templates/minimal/LICENSE +9 -9
- package/templates/minimal/README.md +10 -10
- package/templates/minimal/gitignore +6 -6
- package/templates/minimal/index.html +34 -34
- package/templates/minimal/public/style.css +7 -7
- package/templates/ssx-js/.prettierrc.yml +1 -1
- package/templates/ssx-js/gitignore +3 -3
- package/templates/ssx-js/package.json +2 -2
- package/templates/ssx-js/public/style.css +7 -7
- package/templates/ssx-ts/.prettierrc.yml +1 -1
- package/templates/ssx-ts/gitignore +3 -3
- package/templates/ssx-ts/package.json +2 -2
- package/templates/ssx-ts/public/style.css +7 -7
- package/templates/ts/.prettierrc.yml +1 -1
- package/templates/ts/LICENSE +9 -9
- package/templates/ts/README.md +30 -30
- package/templates/ts/gitignore +49 -49
- package/templates/ts/index.html +15 -15
- package/templates/ts/package.json +3 -2
- package/templates/ts/public/style.css +7 -7
- package/templates/ts/src/store/entities.ts +1 -1
- package/templates/ts/tsconfig.app.json +6 -0
- package/templates/ts-jsx/.prettierrc.yml +1 -0
- package/templates/ts-jsx/LICENSE +9 -0
- package/templates/ts-jsx/README.md +30 -0
- package/templates/ts-jsx/eslint.config.ts +25 -0
- package/templates/ts-jsx/gitignore +49 -0
- package/templates/ts-jsx/index.html +15 -0
- package/templates/ts-jsx/package.json +37 -0
- package/templates/ts-jsx/public/logo.png +0 -0
- package/templates/ts-jsx/public/style.css +7 -0
- package/templates/ts-jsx/src/app.tsx +10 -0
- package/templates/ts-jsx/src/main.ts +6 -0
- package/templates/ts-jsx/src/message/message.tsx +16 -0
- package/templates/ts-jsx/src/store/entities.ts +16 -0
- package/templates/ts-jsx/src/store/index.ts +12 -0
- package/templates/ts-jsx/src/store/middlewares.ts +9 -0
- package/templates/ts-jsx/tsconfig.app.json +11 -0
- package/templates/ts-jsx/tsconfig.json +7 -0
- package/templates/ts-jsx/tsconfig.node.json +10 -0
- package/templates/ts-jsx/types/index.d.ts +27 -0
- package/templates/ts-jsx/types/vite-end.d.ts +1 -0
- package/templates/ts-jsx/vite.config.ts +24 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
.pnp
|
|
4
|
+
.pnp.js
|
|
5
|
+
|
|
6
|
+
# Local env files
|
|
7
|
+
.env
|
|
8
|
+
.env.local
|
|
9
|
+
.env.development.local
|
|
10
|
+
.env.test.local
|
|
11
|
+
.env.production.local
|
|
12
|
+
|
|
13
|
+
# Testing
|
|
14
|
+
coverage
|
|
15
|
+
|
|
16
|
+
# Turbo
|
|
17
|
+
.turbo
|
|
18
|
+
|
|
19
|
+
# Vercel
|
|
20
|
+
.vercel
|
|
21
|
+
|
|
22
|
+
# Build Outputs
|
|
23
|
+
.next/
|
|
24
|
+
out/
|
|
25
|
+
build
|
|
26
|
+
dist
|
|
27
|
+
dist-ssr
|
|
28
|
+
storybook-static
|
|
29
|
+
vite.config.js.timestamp-*
|
|
30
|
+
|
|
31
|
+
# Debug
|
|
32
|
+
logs
|
|
33
|
+
*.log
|
|
34
|
+
npm-debug.log*
|
|
35
|
+
yarn-debug.log*
|
|
36
|
+
yarn-error.log*
|
|
37
|
+
pnpm-debug.log*
|
|
38
|
+
lerna-debug.log*
|
|
39
|
+
|
|
40
|
+
# Editor directories and files
|
|
41
|
+
.vscode/*
|
|
42
|
+
.idea
|
|
43
|
+
.DS_Store
|
|
44
|
+
*.suo
|
|
45
|
+
*.ntvs*
|
|
46
|
+
*.njsproj
|
|
47
|
+
*.sln
|
|
48
|
+
*.sw?
|
|
49
|
+
.qodo
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
|
7
|
+
<link rel="stylesheet" href="/style.css" />
|
|
8
|
+
<title>Inglorious App</title>
|
|
9
|
+
</head>
|
|
10
|
+
|
|
11
|
+
<body>
|
|
12
|
+
<div id="root"></div>
|
|
13
|
+
<script type="module" src="./src/main.js"></script>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ts-template",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"private": true,
|
|
6
|
+
"description": "A new app created with @inglorious/create-app",
|
|
7
|
+
"author": "",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"format": "prettier --write .",
|
|
11
|
+
"lint": "eslint .",
|
|
12
|
+
"dev": "vite",
|
|
13
|
+
"build": "vite build",
|
|
14
|
+
"preview": "vite preview"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@inglorious/web": "workspace:*"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@inglorious/eslint-config": "workspace:*",
|
|
21
|
+
"@inglorious/jsx": "workspace:*",
|
|
22
|
+
"@inglorious/vite-plugin-jsx": "workspace:*",
|
|
23
|
+
"@types/node": "^25.0.9",
|
|
24
|
+
"eslint": "^9.39.1",
|
|
25
|
+
"prettier": "^3.6.2",
|
|
26
|
+
"rollup-plugin-minify-template-literals": "^1.1.7",
|
|
27
|
+
"sharp": "^0.34.5",
|
|
28
|
+
"svgo": "^4.0.0",
|
|
29
|
+
"typescript": "^5.9.2",
|
|
30
|
+
"vite": "^7.1.6",
|
|
31
|
+
"vite-plugin-image-optimizer": "^2.0.3"
|
|
32
|
+
},
|
|
33
|
+
"packageManager": "pnpm@10.15.0",
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">= 22"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MessageType } from "../../types"
|
|
2
|
+
|
|
3
|
+
export const message: MessageType = {
|
|
4
|
+
click(entity) {
|
|
5
|
+
entity.isUpperCase = !entity.isUpperCase
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
render(entity, api) {
|
|
9
|
+
const message = entity.isUpperCase ? entity.who.toUpperCase() : entity.who
|
|
10
|
+
return (
|
|
11
|
+
<span onClick={() => api.notify(`#${entity.id}:click`)}>
|
|
12
|
+
Hello {message}
|
|
13
|
+
</span>
|
|
14
|
+
)
|
|
15
|
+
},
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AppState } from "../../types"
|
|
2
|
+
|
|
3
|
+
export const entities: AppState = {
|
|
4
|
+
message1: {
|
|
5
|
+
type: "message",
|
|
6
|
+
who: "world",
|
|
7
|
+
},
|
|
8
|
+
message2: {
|
|
9
|
+
type: "message",
|
|
10
|
+
who: "wide",
|
|
11
|
+
},
|
|
12
|
+
message3: {
|
|
13
|
+
type: "message",
|
|
14
|
+
who: "web",
|
|
15
|
+
},
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createStore, type TypesConfig } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
import type { AppEntity, AppState } from "../../types"
|
|
4
|
+
import { message } from "../message/message"
|
|
5
|
+
import { entities } from "./entities"
|
|
6
|
+
import { middlewares } from "./middlewares"
|
|
7
|
+
|
|
8
|
+
export const store = createStore<AppEntity, AppState>({
|
|
9
|
+
types: { message } as unknown as TypesConfig<AppEntity>,
|
|
10
|
+
entities,
|
|
11
|
+
middlewares,
|
|
12
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createDevtools, type Middleware } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
import type { AppEntity, AppState } from "../../types"
|
|
4
|
+
|
|
5
|
+
export const middlewares: Middleware<AppEntity, AppState>[] = []
|
|
6
|
+
|
|
7
|
+
if (import.meta.env.DEV) {
|
|
8
|
+
middlewares.push(createDevtools<AppEntity, AppState>().middleware)
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "./vite-end"
|
|
2
|
+
|
|
3
|
+
import { BaseEntity, EntitiesState } from "@inglorious/web"
|
|
4
|
+
|
|
5
|
+
// Define your entity types
|
|
6
|
+
export interface MessageEntity extends BaseEntity {
|
|
7
|
+
type: "message"
|
|
8
|
+
id?: string
|
|
9
|
+
who: string
|
|
10
|
+
isUpperCase?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Union type of all entities
|
|
14
|
+
export type AppEntity = MessageEntity
|
|
15
|
+
|
|
16
|
+
// State type with known entity IDs
|
|
17
|
+
export interface AppState extends EntitiesState<AppEntity> {
|
|
18
|
+
message1: MessageEntity
|
|
19
|
+
message2: MessageEntity
|
|
20
|
+
message3: MessageEntity
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Types configuration
|
|
24
|
+
export interface MessageType {
|
|
25
|
+
click: (entity: MessageEntity) => void
|
|
26
|
+
render: (entity: MessageEntity, api: Api) => TemplateResult | null
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import path from "node:path"
|
|
2
|
+
import { fileURLToPath } from "node:url"
|
|
3
|
+
|
|
4
|
+
import { jsx } from "@inglorious/vite-plugin-jsx"
|
|
5
|
+
import { minifyTemplateLiterals } from "rollup-plugin-minify-template-literals"
|
|
6
|
+
import { defineConfig } from "vite"
|
|
7
|
+
import { ViteImageOptimizer } from "vite-plugin-image-optimizer"
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
10
|
+
const __dirname = path.dirname(__filename)
|
|
11
|
+
|
|
12
|
+
// https://vite.dev/config/
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
// @see https://github.com/vitejs/vite/issues/1973
|
|
15
|
+
define: { "process.env": {} },
|
|
16
|
+
|
|
17
|
+
plugins: [minifyTemplateLiterals(), ViteImageOptimizer(), jsx()],
|
|
18
|
+
|
|
19
|
+
resolve: {
|
|
20
|
+
alias: {
|
|
21
|
+
"@": path.resolve(__dirname, "src"),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
})
|