@inglorious/create-app 1.1.2 → 1.3.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/README.md +21 -7
- package/bin/index.js +64 -88
- package/bin/lib/app-jsx.js +280 -0
- package/bin/lib/app-lit.js +275 -0
- package/bin/lib/app-vue.js +239 -0
- package/bin/lib/app.js +402 -0
- package/bin/lib/cli.js +34 -0
- package/bin/lib/constants.js +6 -4
- package/bin/lib/features.js +171 -0
- package/bin/lib/imports.js +64 -0
- package/bin/lib/mobile.js +19 -1
- package/bin/lib/pwa.js +50 -4
- package/bin/lib/questions.js +184 -0
- package/bin/lib/source.js +58 -0
- package/package.json +4 -4
- package/templates/js/package.json +4 -4
- package/templates/js/vite.config.js +2 -1
- package/templates/js-jsx/package.json +4 -4
- package/templates/js-jsx/vite.config.js +2 -1
- package/templates/js-vue/package.json +4 -4
- package/templates/js-vue/vite.config.js +2 -1
- package/templates/ssx-js/package.json +8 -7
- package/templates/ssx-js/src/site.config.js +2 -1
- package/templates/ssx-ts/package.json +9 -7
- package/templates/ssx-ts/src/site.config.ts +1 -0
- package/templates/ts/package.json +8 -6
- package/templates/ts/src/app.ts +4 -2
- package/templates/ts/tsconfig.app.json +2 -0
- package/templates/ts/tsconfig.node.json +2 -0
- package/templates/ts/types/index.d.ts +4 -1
- package/templates/ts/vite.config.ts +2 -1
- package/templates/ts-jsx/package.json +8 -6
- package/templates/ts-jsx/src/app.tsx +2 -3
- package/templates/ts-jsx/tsconfig.app.json +2 -0
- package/templates/ts-jsx/tsconfig.node.json +2 -0
- package/templates/ts-jsx/types/index.d.ts +3 -1
- package/templates/ts-jsx/types/vite-end.d.ts +1 -0
- package/templates/ts-jsx/vite.config.ts +2 -1
- package/templates/ts-vue/eslint.config.ts +1 -1
- package/templates/ts-vue/package.json +8 -6
- package/templates/ts-vue/src/main.ts +1 -1
- package/templates/ts-vue/src/store/middlewares.ts +5 -2
- package/templates/ts-vue/tsconfig.app.json +2 -0
- package/templates/ts-vue/tsconfig.node.json +2 -0
- package/templates/ts-vue/types/index.d.ts +3 -1
- package/templates/ts-vue/vite.config.ts +2 -1
|
@@ -22,14 +22,16 @@
|
|
|
22
22
|
"@inglorious/jsx": "workspace:*",
|
|
23
23
|
"@inglorious/vite-plugin-hmr": "workspace:*",
|
|
24
24
|
"@inglorious/vite-plugin-jsx": "workspace:*",
|
|
25
|
-
"@types/node": "^
|
|
26
|
-
"
|
|
27
|
-
"
|
|
25
|
+
"@types/node": "^22.20.5",
|
|
26
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
27
|
+
"eslint": "^10.13.0",
|
|
28
|
+
"jiti": "^2.7.0",
|
|
29
|
+
"prettier": "^3.9.10",
|
|
28
30
|
"rollup-plugin-minify-template-literals": "^2.2.0",
|
|
29
|
-
"sharp": "^0.35.
|
|
31
|
+
"sharp": "^0.35.5",
|
|
30
32
|
"svgo": "^4.1.0",
|
|
31
|
-
"typescript": "
|
|
32
|
-
"vite": "^8.
|
|
33
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
34
|
+
"vite": "^8.3.4",
|
|
33
35
|
"vite-plugin-image-optimizer": "^2.0.3"
|
|
34
36
|
},
|
|
35
37
|
"packageManager": "pnpm@10.15.0",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { AppApi } from "../types"
|
|
3
2
|
import { Message } from "./types/message"
|
|
4
3
|
|
|
5
4
|
export const App = {
|
|
6
|
-
render(props: Record<string, unknown> | null, api:
|
|
5
|
+
render(props: Record<string, unknown> | null, api: AppApi) {
|
|
7
6
|
return (
|
|
8
7
|
<h1>
|
|
9
8
|
{/* @ts-expect-error - JSX components are entity type names, not imports */}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "./tsconfig.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
5
|
"module": "ESNext",
|
|
5
6
|
"moduleResolution": "bundler",
|
|
6
7
|
"target": "ES2020",
|
|
8
|
+
"noEmit": true,
|
|
7
9
|
"verbatimModuleSyntax": true,
|
|
8
10
|
"jsx": "preserve"
|
|
9
11
|
},
|
|
@@ -21,8 +21,10 @@ export interface AppState extends EntitiesState<AppEntity> {
|
|
|
21
21
|
message3: MessageEntity
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export type AppApi = Api<AppEntity, AppState>
|
|
25
|
+
|
|
24
26
|
// Types configuration
|
|
25
27
|
export interface MessageType {
|
|
26
28
|
click: (entity: MessageEntity) => void
|
|
27
|
-
render: (entity: MessageEntity, api:
|
|
29
|
+
render: (entity: MessageEntity, api: AppApi) => TemplateResult | null
|
|
28
30
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from "node:path"
|
|
2
2
|
import { fileURLToPath } from "node:url"
|
|
3
3
|
|
|
4
|
+
import { hmr } from "@inglorious/vite-plugin-hmr"
|
|
4
5
|
import { jsx } from "@inglorious/vite-plugin-jsx"
|
|
5
6
|
import { minifyTemplateLiterals } from "rollup-plugin-minify-template-literals"
|
|
6
7
|
import { defineConfig } from "vite"
|
|
@@ -14,7 +15,7 @@ export default defineConfig({
|
|
|
14
15
|
// @see https://github.com/vitejs/vite/issues/1973
|
|
15
16
|
define: { "process.env": {} },
|
|
16
17
|
|
|
17
|
-
plugins: [ViteImageOptimizer(), jsx()],
|
|
18
|
+
plugins: [ViteImageOptimizer(), jsx(), hmr()],
|
|
18
19
|
|
|
19
20
|
build: {
|
|
20
21
|
rollupOptions: {
|
|
@@ -21,14 +21,16 @@
|
|
|
21
21
|
"@inglorious/eslint-config": "workspace:*",
|
|
22
22
|
"@inglorious/vite-plugin-hmr": "workspace:*",
|
|
23
23
|
"@inglorious/vite-plugin-vue": "workspace:*",
|
|
24
|
-
"@types/node": "^
|
|
25
|
-
"
|
|
26
|
-
"
|
|
24
|
+
"@types/node": "^22.20.5",
|
|
25
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
26
|
+
"eslint": "^10.13.0",
|
|
27
|
+
"jiti": "^2.7.0",
|
|
28
|
+
"prettier": "^3.9.10",
|
|
27
29
|
"rollup-plugin-minify-template-literals": "^2.2.0",
|
|
28
|
-
"sharp": "^0.35.
|
|
30
|
+
"sharp": "^0.35.5",
|
|
29
31
|
"svgo": "^4.1.0",
|
|
30
|
-
"typescript": "
|
|
31
|
-
"vite": "^8.
|
|
32
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
33
|
+
"vite": "^8.3.4",
|
|
32
34
|
"vite-plugin-image-optimizer": "^2.0.3"
|
|
33
35
|
},
|
|
34
36
|
"packageManager": "pnpm@10.15.0",
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type { Middleware } from "@inglorious/store"
|
|
1
2
|
import { createDevtools } from "@inglorious/store/client/devtools"
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
import type { AppEntity, AppState } from "../../types"
|
|
5
|
+
|
|
6
|
+
export const middlewares: Middleware<AppEntity, AppState>[] = []
|
|
4
7
|
|
|
5
8
|
if (import.meta.env.DEV) {
|
|
6
|
-
middlewares.push(createDevtools().middleware)
|
|
9
|
+
middlewares.push(createDevtools<AppEntity, AppState>().middleware)
|
|
7
10
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "./tsconfig.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
5
|
"module": "ESNext",
|
|
5
6
|
"moduleResolution": "bundler",
|
|
6
7
|
"target": "ES2020",
|
|
8
|
+
"noEmit": true,
|
|
7
9
|
"verbatimModuleSyntax": true
|
|
8
10
|
},
|
|
9
11
|
"include": ["src"]
|
|
@@ -21,8 +21,10 @@ export interface AppState extends EntitiesState<AppEntity> {
|
|
|
21
21
|
message3: MessageEntity
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export type AppApi = Api<AppEntity, AppState>
|
|
25
|
+
|
|
24
26
|
// Types configuration
|
|
25
27
|
export interface MessageType {
|
|
26
28
|
click: (entity: MessageEntity) => void
|
|
27
|
-
render: (entity: MessageEntity, api:
|
|
29
|
+
render: (entity: MessageEntity, api: AppApi) => TemplateResult | null
|
|
28
30
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from "node:path"
|
|
2
2
|
import { fileURLToPath } from "node:url"
|
|
3
3
|
|
|
4
|
+
import { hmr } from "@inglorious/vite-plugin-hmr"
|
|
4
5
|
import { vue } from "@inglorious/vite-plugin-vue"
|
|
5
6
|
import { minifyTemplateLiterals } from "rollup-plugin-minify-template-literals"
|
|
6
7
|
import { defineConfig } from "vite"
|
|
@@ -14,7 +15,7 @@ export default defineConfig({
|
|
|
14
15
|
// @see https://github.com/vitejs/vite/issues/1973
|
|
15
16
|
define: { "process.env": {} },
|
|
16
17
|
|
|
17
|
-
plugins: [ViteImageOptimizer(), vue()],
|
|
18
|
+
plugins: [ViteImageOptimizer(), vue(), hmr()],
|
|
18
19
|
|
|
19
20
|
build: {
|
|
20
21
|
rollupOptions: {
|