@inglorious/create-app 0.3.5 → 0.5.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/bin/index.js +49 -4
- package/package.json +1 -1
- package/templates/js/LICENSE +9 -9
- package/templates/js/gitignore +49 -49
- 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/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/LICENSE +9 -9
- package/templates/minimal/gitignore +6 -6
- package/templates/ssx-js/gitignore +3 -3
- package/templates/ssx-ts/gitignore +3 -3
- package/templates/ts/LICENSE +9 -9
- package/templates/ts/gitignore +49 -49
- package/templates/ts/index.html +1 -1
- 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
- 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
|
@@ -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
|
+
})
|
|
@@ -1,9 +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.
|
|
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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Editor directories and files
|
|
2
|
-
|
|
3
|
-
.idea
|
|
4
|
-
.vscode
|
|
5
|
-
_.suo
|
|
6
|
-
_.ntvs\*
|
|
1
|
+
# Editor directories and files
|
|
2
|
+
|
|
3
|
+
.idea
|
|
4
|
+
.vscode
|
|
5
|
+
_.suo
|
|
6
|
+
_.ntvs\*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
node_modules
|
|
2
|
-
dist
|
|
3
|
-
.DS_Store
|
|
1
|
+
node_modules
|
|
2
|
+
dist
|
|
3
|
+
.DS_Store
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
node_modules
|
|
2
|
-
dist
|
|
3
|
-
.DS_Store
|
|
1
|
+
node_modules
|
|
2
|
+
dist
|
|
3
|
+
.DS_Store
|
package/templates/ts/LICENSE
CHANGED
|
@@ -1,9 +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.
|
|
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.
|
package/templates/ts/gitignore
CHANGED
|
@@ -1,49 +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
|
|
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
|
package/templates/ts/index.html
CHANGED
|
@@ -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,30 @@
|
|
|
1
|
+
# my-app
|
|
2
|
+
|
|
3
|
+
This project is a minimal starter template for creating an app with the Inglorious Web framework using TypeScript 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 TypeScript source code.
|
|
28
|
+
- `vite.config.js`: Vite configuration file.
|
|
29
|
+
- `tsconfig.json`: TypeScript configuration for the project.
|
|
30
|
+
- `package.json`: Project metadata and dependencies.
|
|
@@ -0,0 +1,25 @@
|
|
|
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: ["**/*.{jsx,tsx}"],
|
|
11
|
+
rules: {
|
|
12
|
+
"react/jsx-no-undef": "off",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
{
|
|
17
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
parserOptions: {
|
|
20
|
+
project: ["./tsconfig.app.json", "./tsconfig.node.json"],
|
|
21
|
+
tsconfigRootDir: import.meta.dirname,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
])
|
|
@@ -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,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 { 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 { 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
|
+
})
|
|
@@ -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.
|