@inglorious/create-app 0.4.0 → 0.5.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.
- package/bin/index.js +5 -5
- package/package.json +2 -2
- package/templates/js/src/message/message.js +2 -2
- package/templates/js-jsx/src/message/message.jsx +2 -4
- package/templates/js-vue/.prettierrc.yml +1 -0
- package/templates/js-vue/LICENSE +9 -0
- package/templates/js-vue/README.md +29 -0
- package/templates/js-vue/eslint.config.js +1 -0
- package/templates/js-vue/gitignore +49 -0
- package/templates/js-vue/index.html +15 -0
- package/templates/js-vue/package.json +34 -0
- package/templates/js-vue/public/logo.png +0 -0
- package/templates/js-vue/public/style.css +7 -0
- package/templates/js-vue/src/app.vue +3 -0
- package/templates/js-vue/src/main.js +6 -0
- package/templates/js-vue/src/message/message.vue +10 -0
- package/templates/js-vue/src/store/entities.js +14 -0
- package/templates/js-vue/src/store/index.js +11 -0
- package/templates/js-vue/src/store/middlewares.js +7 -0
- package/templates/js-vue/vite.config.js +21 -0
- package/templates/minimal/src/message/message.js +2 -2
- package/templates/ts/index.html +1 -1
- package/templates/ts/src/message/message.ts +2 -2
- package/templates/ts-jsx/index.html +1 -1
- package/templates/ts-jsx/src/message/message.tsx +2 -4
- package/templates/ts-jsx/types/index.d.ts +1 -1
- package/templates/ts-vue/.prettierrc.yml +1 -0
- package/templates/ts-vue/LICENSE +9 -0
- package/templates/ts-vue/README.md +29 -0
- package/templates/ts-vue/eslint.config.ts +18 -0
- package/templates/ts-vue/gitignore +49 -0
- package/templates/ts-vue/index.html +15 -0
- package/templates/ts-vue/package.json +36 -0
- package/templates/ts-vue/public/logo.png +0 -0
- package/templates/ts-vue/public/style.css +7 -0
- package/templates/ts-vue/src/app.vue +3 -0
- package/templates/ts-vue/src/main.ts +7 -0
- package/templates/ts-vue/src/message/message.vue +10 -0
- package/templates/ts-vue/src/store/entities.ts +16 -0
- package/templates/ts-vue/src/store/index.ts +13 -0
- package/templates/ts-vue/src/store/middlewares.ts +7 -0
- package/templates/ts-vue/tsconfig.app.json +10 -0
- package/templates/ts-vue/tsconfig.json +7 -0
- package/templates/ts-vue/tsconfig.node.json +10 -0
- package/templates/ts-vue/types/index.d.ts +27 -0
- package/templates/ts-vue/types/vite-end.d.ts +1 -0
- package/templates/ts-vue/vite.config.ts +24 -0
package/bin/index.js
CHANGED
|
@@ -90,11 +90,11 @@ async function main() {
|
|
|
90
90
|
description: "JSX/TSX syntax (<div>...</div>)",
|
|
91
91
|
value: "jsx",
|
|
92
92
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
{
|
|
94
|
+
title: "Vue",
|
|
95
|
+
description: "Vue SFC-style templates",
|
|
96
|
+
value: "vue",
|
|
97
|
+
},
|
|
98
98
|
],
|
|
99
99
|
},
|
|
100
100
|
{ onCancel },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inglorious/create-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "A scaffolding tool to quickly create a new app with Inglorious Web.",
|
|
5
5
|
"author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"prettier": "^3.6.2",
|
|
41
|
-
"@inglorious/eslint-config": "1.1.
|
|
41
|
+
"@inglorious/eslint-config": "1.1.2"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"format": "prettier --write .",
|
|
@@ -6,9 +6,9 @@ export const message = {
|
|
|
6
6
|
},
|
|
7
7
|
|
|
8
8
|
render(entity, api) {
|
|
9
|
-
const
|
|
9
|
+
const who = entity.isUpperCase ? entity.who.toUpperCase() : entity.who
|
|
10
10
|
return html`<span @click=${() => api.notify(`#${entity.id}:click`)}
|
|
11
|
-
>Hello ${
|
|
11
|
+
>Hello ${who}</span
|
|
12
12
|
>`
|
|
13
13
|
},
|
|
14
14
|
}
|
|
@@ -4,11 +4,9 @@ export const message = {
|
|
|
4
4
|
},
|
|
5
5
|
|
|
6
6
|
render(entity, api) {
|
|
7
|
-
const
|
|
7
|
+
const who = entity.isUpperCase ? entity.who.toUpperCase() : entity.who
|
|
8
8
|
return (
|
|
9
|
-
<span onClick={() => api.notify(`#${entity.id}:click`)}>
|
|
10
|
-
Hello {message}
|
|
11
|
-
</span>
|
|
9
|
+
<span onClick={() => api.notify(`#${entity.id}:click`)}>Hello {who}</span>
|
|
12
10
|
)
|
|
13
11
|
},
|
|
14
12
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
semi: false
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2025 Inglorious Coderz Srl.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# my-app
|
|
2
|
+
|
|
3
|
+
This project is a minimal starter template for creating an app with the Inglorious Web framework using plain JavaScript and Vite.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
This project was scaffolded with `@inglorious/create-app`.
|
|
8
|
+
|
|
9
|
+
To get started, follow these steps:
|
|
10
|
+
|
|
11
|
+
1. **Install dependencies**:
|
|
12
|
+
Navigate to your project directory and install the required packages.
|
|
13
|
+
```sh
|
|
14
|
+
pnpm install
|
|
15
|
+
```
|
|
16
|
+
2. **Start the development server**:
|
|
17
|
+
Run the following command to start the Vite development server.
|
|
18
|
+
```sh
|
|
19
|
+
pnpm dev
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This will start a Vite development server. Open your browser to the local URL provided to see it in action.
|
|
23
|
+
|
|
24
|
+
## Project Setup
|
|
25
|
+
|
|
26
|
+
- `index.html`: The main entry point for your app.
|
|
27
|
+
- `src/`: Contains your app's JavaScript source code.
|
|
28
|
+
- `vite.config.js`: Vite configuration file.
|
|
29
|
+
- `package.json`: Project metadata and dependencies.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@inglorious/eslint-config/browser"
|
|
@@ -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,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "js-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/vite-plugin-vue": "workspace:*",
|
|
22
|
+
"eslint": "^9.39.1",
|
|
23
|
+
"prettier": "^3.6.2",
|
|
24
|
+
"rollup-plugin-minify-template-literals": "^1.1.7",
|
|
25
|
+
"sharp": "^0.34.5",
|
|
26
|
+
"svgo": "^4.0.0",
|
|
27
|
+
"vite": "^7.1.6",
|
|
28
|
+
"vite-plugin-image-optimizer": "^2.0.3"
|
|
29
|
+
},
|
|
30
|
+
"packageManager": "pnpm@10.15.0",
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">= 22"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createStore } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
import { message } from "../message/message.vue"
|
|
4
|
+
import { entities } from "./entities"
|
|
5
|
+
import { middlewares } from "./middlewares"
|
|
6
|
+
|
|
7
|
+
export const store = createStore({
|
|
8
|
+
types: { message },
|
|
9
|
+
entities,
|
|
10
|
+
middlewares,
|
|
11
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import path from "node:path"
|
|
2
|
+
import { fileURLToPath } from "node:url"
|
|
3
|
+
|
|
4
|
+
import { vue } from "@inglorious/vite-plugin-vue"
|
|
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
|
+
plugins: [minifyTemplateLiterals(), ViteImageOptimizer(), vue()],
|
|
15
|
+
|
|
16
|
+
resolve: {
|
|
17
|
+
alias: {
|
|
18
|
+
"@": path.resolve(__dirname, "src"),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
})
|
|
@@ -6,9 +6,9 @@ export const message = {
|
|
|
6
6
|
},
|
|
7
7
|
|
|
8
8
|
render(entity, api) {
|
|
9
|
-
const
|
|
9
|
+
const who = entity.isUpperCase ? entity.who.toUpperCase() : entity.who
|
|
10
10
|
return html`<span @click=${() => api.notify(`#${entity.id}:click`)}
|
|
11
|
-
>Hello ${
|
|
11
|
+
>Hello ${who}</span
|
|
12
12
|
>`
|
|
13
13
|
},
|
|
14
14
|
}
|
package/templates/ts/index.html
CHANGED
|
@@ -8,9 +8,9 @@ export const message: MessageType = {
|
|
|
8
8
|
},
|
|
9
9
|
|
|
10
10
|
render(entity, api) {
|
|
11
|
-
const
|
|
11
|
+
const who = entity.isUpperCase ? entity.who.toUpperCase() : entity.who
|
|
12
12
|
return html`<span @click=${() => api.notify(`#${entity.id}:click`)}
|
|
13
|
-
>Hello ${
|
|
13
|
+
>Hello ${who}</span
|
|
14
14
|
>`
|
|
15
15
|
},
|
|
16
16
|
}
|
|
@@ -6,11 +6,9 @@ export const message: MessageType = {
|
|
|
6
6
|
},
|
|
7
7
|
|
|
8
8
|
render(entity, api) {
|
|
9
|
-
const
|
|
9
|
+
const who = entity.isUpperCase ? entity.who.toUpperCase() : entity.who
|
|
10
10
|
return (
|
|
11
|
-
<span onClick={() => api.notify(`#${entity.id}:click`)}>
|
|
12
|
-
Hello {message}
|
|
13
|
-
</span>
|
|
11
|
+
<span onClick={() => api.notify(`#${entity.id}:click`)}>Hello {who}</span>
|
|
14
12
|
)
|
|
15
13
|
},
|
|
16
14
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
semi: false
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2025 Inglorious Coderz Srl.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# my-app
|
|
2
|
+
|
|
3
|
+
This project is a minimal starter template for creating an app with the Inglorious Web framework using plain JavaScript and Vite.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
This project was scaffolded with `@inglorious/create-app`.
|
|
8
|
+
|
|
9
|
+
To get started, follow these steps:
|
|
10
|
+
|
|
11
|
+
1. **Install dependencies**:
|
|
12
|
+
Navigate to your project directory and install the required packages.
|
|
13
|
+
```sh
|
|
14
|
+
pnpm install
|
|
15
|
+
```
|
|
16
|
+
2. **Start the development server**:
|
|
17
|
+
Run the following command to start the Vite development server.
|
|
18
|
+
```sh
|
|
19
|
+
pnpm dev
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This will start a Vite development server. Open your browser to the local URL provided to see it in action.
|
|
23
|
+
|
|
24
|
+
## Project Setup
|
|
25
|
+
|
|
26
|
+
- `index.html`: The main entry point for your app.
|
|
27
|
+
- `src/`: Contains your app's JavaScript source code.
|
|
28
|
+
- `vite.config.js`: Vite configuration file.
|
|
29
|
+
- `package.json`: Project metadata and dependencies.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import browserConfig from "@inglorious/eslint-config/browser"
|
|
2
|
+
import typescriptConfig from "@inglorious/eslint-config/typescript"
|
|
3
|
+
import { defineConfig } from "eslint/config"
|
|
4
|
+
|
|
5
|
+
export default defineConfig([
|
|
6
|
+
...browserConfig,
|
|
7
|
+
...typescriptConfig,
|
|
8
|
+
|
|
9
|
+
{
|
|
10
|
+
files: ["**/*.ts", "**/*.vue"],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parserOptions: {
|
|
13
|
+
project: ["./tsconfig.app.json", "./tsconfig.node.json"],
|
|
14
|
+
tsconfigRootDir: import.meta.dirname,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
])
|
|
@@ -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.ts"></script>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "js-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/vite-plugin-vue": "workspace:*",
|
|
22
|
+
"@types/node": "^25.0.9",
|
|
23
|
+
"eslint": "^9.39.1",
|
|
24
|
+
"prettier": "^3.6.2",
|
|
25
|
+
"rollup-plugin-minify-template-literals": "^1.1.7",
|
|
26
|
+
"sharp": "^0.34.5",
|
|
27
|
+
"svgo": "^4.0.0",
|
|
28
|
+
"typescript": "^5.9.2",
|
|
29
|
+
"vite": "^7.1.6",
|
|
30
|
+
"vite-plugin-image-optimizer": "^2.0.3"
|
|
31
|
+
},
|
|
32
|
+
"packageManager": "pnpm@10.15.0",
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">= 22"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
Binary file
|
|
@@ -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,13 @@
|
|
|
1
|
+
import { createStore, type TypesConfig } from "@inglorious/web"
|
|
2
|
+
|
|
3
|
+
import type { AppEntity, AppState } from "../../types"
|
|
4
|
+
// @ts-expect-error - Handled by @inglorious/vite-plugin-vue
|
|
5
|
+
import { message } from "../message/message.vue"
|
|
6
|
+
import { entities } from "./entities"
|
|
7
|
+
import { middlewares } from "./middlewares"
|
|
8
|
+
|
|
9
|
+
export const store = createStore<AppEntity, AppState>({
|
|
10
|
+
types: { message } as unknown as TypesConfig<AppEntity>,
|
|
11
|
+
entities,
|
|
12
|
+
middlewares,
|
|
13
|
+
})
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "./vite-end"
|
|
2
|
+
|
|
3
|
+
import { Api, BaseEntity, EntitiesState, TemplateResult } 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 { vue } from "@inglorious/vite-plugin-vue"
|
|
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(), vue()],
|
|
18
|
+
|
|
19
|
+
resolve: {
|
|
20
|
+
alias: {
|
|
21
|
+
"@": path.resolve(__dirname, "src"),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
})
|