@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.
Files changed (70) hide show
  1. package/LICENSE +9 -9
  2. package/README.md +59 -59
  3. package/bin/index.js +49 -4
  4. package/package.json +3 -3
  5. package/templates/js/.prettierrc.yml +1 -1
  6. package/templates/js/LICENSE +9 -9
  7. package/templates/js/README.md +29 -29
  8. package/templates/js/gitignore +49 -49
  9. package/templates/js/index.html +15 -15
  10. package/templates/js/package.json +2 -2
  11. package/templates/js/public/style.css +7 -7
  12. package/templates/js-jsx/.prettierrc.yml +1 -0
  13. package/templates/js-jsx/LICENSE +9 -0
  14. package/templates/js-jsx/README.md +29 -0
  15. package/templates/js-jsx/eslint.config.js +13 -0
  16. package/templates/js-jsx/gitignore +49 -0
  17. package/templates/js-jsx/index.html +15 -0
  18. package/templates/js-jsx/package.json +34 -0
  19. package/templates/js-jsx/public/logo.png +0 -0
  20. package/templates/js-jsx/public/style.css +7 -0
  21. package/templates/js-jsx/src/app.jsx +9 -0
  22. package/templates/js-jsx/src/main.js +6 -0
  23. package/templates/js-jsx/src/message/message.jsx +14 -0
  24. package/templates/js-jsx/src/store/entities.js +14 -0
  25. package/templates/js-jsx/src/store/index.js +11 -0
  26. package/templates/js-jsx/src/store/middlewares.js +7 -0
  27. package/templates/js-jsx/vite.config.js +21 -0
  28. package/templates/minimal/LICENSE +9 -9
  29. package/templates/minimal/README.md +10 -10
  30. package/templates/minimal/gitignore +6 -6
  31. package/templates/minimal/index.html +34 -34
  32. package/templates/minimal/public/style.css +7 -7
  33. package/templates/ssx-js/.prettierrc.yml +1 -1
  34. package/templates/ssx-js/gitignore +3 -3
  35. package/templates/ssx-js/package.json +2 -2
  36. package/templates/ssx-js/public/style.css +7 -7
  37. package/templates/ssx-ts/.prettierrc.yml +1 -1
  38. package/templates/ssx-ts/gitignore +3 -3
  39. package/templates/ssx-ts/package.json +2 -2
  40. package/templates/ssx-ts/public/style.css +7 -7
  41. package/templates/ts/.prettierrc.yml +1 -1
  42. package/templates/ts/LICENSE +9 -9
  43. package/templates/ts/README.md +30 -30
  44. package/templates/ts/gitignore +49 -49
  45. package/templates/ts/index.html +15 -15
  46. package/templates/ts/package.json +3 -2
  47. package/templates/ts/public/style.css +7 -7
  48. package/templates/ts/src/store/entities.ts +1 -1
  49. package/templates/ts/tsconfig.app.json +6 -0
  50. package/templates/ts-jsx/.prettierrc.yml +1 -0
  51. package/templates/ts-jsx/LICENSE +9 -0
  52. package/templates/ts-jsx/README.md +30 -0
  53. package/templates/ts-jsx/eslint.config.ts +25 -0
  54. package/templates/ts-jsx/gitignore +49 -0
  55. package/templates/ts-jsx/index.html +15 -0
  56. package/templates/ts-jsx/package.json +37 -0
  57. package/templates/ts-jsx/public/logo.png +0 -0
  58. package/templates/ts-jsx/public/style.css +7 -0
  59. package/templates/ts-jsx/src/app.tsx +10 -0
  60. package/templates/ts-jsx/src/main.ts +6 -0
  61. package/templates/ts-jsx/src/message/message.tsx +16 -0
  62. package/templates/ts-jsx/src/store/entities.ts +16 -0
  63. package/templates/ts-jsx/src/store/index.ts +12 -0
  64. package/templates/ts-jsx/src/store/middlewares.ts +9 -0
  65. package/templates/ts-jsx/tsconfig.app.json +11 -0
  66. package/templates/ts-jsx/tsconfig.json +7 -0
  67. package/templates/ts-jsx/tsconfig.node.json +10 -0
  68. package/templates/ts-jsx/types/index.d.ts +27 -0
  69. package/templates/ts-jsx/types/vite-end.d.ts +1 -0
  70. 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,7 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ body {
6
+ margin: 0;
7
+ }
@@ -0,0 +1,10 @@
1
+ export const app = {
2
+ render() {
3
+ return (
4
+ <h1>
5
+ {/* @ts-expect-error - JSX components are entity type names, not imports */}
6
+ <Message1 />, <Message2 />, <Message3 />!
7
+ </h1>
8
+ )
9
+ },
10
+ }
@@ -0,0 +1,6 @@
1
+ import { mount } from "@inglorious/web"
2
+
3
+ import { app } from "./app"
4
+ import { store } from "./store"
5
+
6
+ mount(store, app.render, document.getElementById("root")!)
@@ -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,11 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "target": "ES2020",
7
+ "verbatimModuleSyntax": true,
8
+ "jsx": "preserve"
9
+ },
10
+ "include": ["src"]
11
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "types": ["node"],
7
+ "skipLibCheck": true
8
+ },
9
+ "include": ["vite.config.ts", "eslint.config.ts"]
10
+ }
@@ -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
+ })