create-koppajs 1.0.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 +21 -0
- package/README.md +131 -0
- package/bin/create-koppajs.js +175 -0
- package/package.json +34 -0
- package/template/LICENSE +201 -0
- package/template/README.md +49 -0
- package/template/_gitignore +5 -0
- package/template/index.html +14 -0
- package/template/package.json +21 -0
- package/template/public/favicon.svg +15 -0
- package/template/src/app-view.kpa +36 -0
- package/template/src/counter-component.kpa +87 -0
- package/template/src/main.ts +8 -0
- package/template/src/style.css +5 -0
- package/template/tsconfig.json +15 -0
- package/template/vite.config.mjs +10 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bastian Bensch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<a id="readme-top"></a>
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://public-assets-1b57ca06-687a-4142-a525-0635f7649a5c.s3.eu-central-1.amazonaws.com/koppajs/koppajs-logo-text-900x226.png" width="500" alt="KoppaJS Logo">
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<br>
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/create-koppajs"><img src="https://img.shields.io/npm/v/create-koppajs?style=flat-square" alt="npm version"></a>
|
|
11
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License"></a>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<br>
|
|
15
|
+
|
|
16
|
+
<div align="center">
|
|
17
|
+
<h1 align="center">create-koppajs</h1>
|
|
18
|
+
<h3 align="center">Scaffold a new KoppaJS project in seconds</h3>
|
|
19
|
+
<p align="center">
|
|
20
|
+
<i>The fastest way to start building with KoppaJS.</i>
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<br>
|
|
25
|
+
|
|
26
|
+
<div align="center">
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="https://github.com/koppajs/koppajs-documentation">Documentation</a>
|
|
29
|
+
·
|
|
30
|
+
<a href="https://github.com/koppajs/koppajs-core">KoppaJS Core</a>
|
|
31
|
+
·
|
|
32
|
+
<a href="https://github.com/koppajs/koppajs-vite-plugin">Vite Plugin</a>
|
|
33
|
+
·
|
|
34
|
+
<a href="https://github.com/koppajs/create-koppajs/issues">Issues</a>
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<br>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary>Table of Contents</summary>
|
|
42
|
+
<ol>
|
|
43
|
+
<li><a href="#what-is-this">What is this?</a></li>
|
|
44
|
+
<li><a href="#usage">Usage</a></li>
|
|
45
|
+
<li><a href="#what-gets-generated">What gets generated</a></li>
|
|
46
|
+
<li><a href="#requirements">Requirements</a></li>
|
|
47
|
+
<li><a href="#community--contribution">Community & Contribution</a></li>
|
|
48
|
+
<li><a href="#license">License</a></li>
|
|
49
|
+
</ol>
|
|
50
|
+
</details>
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## What is this?
|
|
55
|
+
|
|
56
|
+
`create-koppajs` is the **official project scaffolder** for KoppaJS.
|
|
57
|
+
|
|
58
|
+
It creates a ready-to-run starter project with a single command — no configuration, no dependencies to install first, no boilerplate to write by hand.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pnpm create koppajs my-app
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm create koppajs my-app
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npx create-koppajs my-app
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Then:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
cd my-app
|
|
80
|
+
pnpm install
|
|
81
|
+
pnpm dev
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
If you omit the project name, the CLI will prompt you for one.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## What gets generated
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
my-app/
|
|
92
|
+
├── index.html
|
|
93
|
+
├── package.json
|
|
94
|
+
├── tsconfig.json
|
|
95
|
+
├── vite.config.mjs
|
|
96
|
+
├── .gitignore
|
|
97
|
+
├── LICENSE
|
|
98
|
+
├── README.md
|
|
99
|
+
├── public/
|
|
100
|
+
│ └── favicon.svg
|
|
101
|
+
└── src/
|
|
102
|
+
├── main.ts
|
|
103
|
+
├── style.css
|
|
104
|
+
├── app-view.kpa
|
|
105
|
+
└── counter-component.kpa
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- **Vite** as dev server and bundler
|
|
109
|
+
- **TypeScript** support out of the box
|
|
110
|
+
- **Two sample components** (app view + counter) to get started
|
|
111
|
+
- **Zero unnecessary dependencies**
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Requirements
|
|
116
|
+
|
|
117
|
+
- Node.js >= 20
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Community & Contribution
|
|
122
|
+
|
|
123
|
+
Issues and pull requests are welcome:
|
|
124
|
+
|
|
125
|
+
https://github.com/koppajs/create-koppajs/issues
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
MIT — © 2026 KoppaJS, Bastian Bensch
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, copyFileSync, statSync } from "node:fs";
|
|
4
|
+
import { basename, join, dirname, resolve } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { createInterface } from "node:readline";
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
const TEMPLATE_DIR = join(__dirname, "..", "template");
|
|
11
|
+
const CLI_PKG = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
12
|
+
|
|
13
|
+
// ── Args ────────────────────────────────────────────────────────────
|
|
14
|
+
|
|
15
|
+
function parseArgs(argv) {
|
|
16
|
+
const raw = argv.slice(2);
|
|
17
|
+
return {
|
|
18
|
+
help: raw.includes("--help") || raw.includes("-h"),
|
|
19
|
+
version: raw.includes("--version") || raw.includes("-v"),
|
|
20
|
+
projectName: raw.find((a) => !a.startsWith("-")) || null,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// ── Help / Version ──────────────────────────────────────────────────
|
|
25
|
+
|
|
26
|
+
function printHelp() {
|
|
27
|
+
console.log(`
|
|
28
|
+
create-koppajs v${CLI_PKG.version}
|
|
29
|
+
|
|
30
|
+
Scaffold a new KoppaJS project.
|
|
31
|
+
|
|
32
|
+
Usage:
|
|
33
|
+
pnpm create koppajs [project-name]
|
|
34
|
+
npm create koppajs [project-name]
|
|
35
|
+
npx create-koppajs [project-name]
|
|
36
|
+
|
|
37
|
+
Options:
|
|
38
|
+
--help, -h Show this help message
|
|
39
|
+
--version, -v Show version number
|
|
40
|
+
|
|
41
|
+
Example:
|
|
42
|
+
pnpm create koppajs my-app
|
|
43
|
+
`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function printVersion() {
|
|
47
|
+
console.log(CLI_PKG.version);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// ── Prompt ──────────────────────────────────────────────────────────
|
|
51
|
+
|
|
52
|
+
function promptProjectName() {
|
|
53
|
+
return new Promise((res, rej) => {
|
|
54
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
55
|
+
let answered = false;
|
|
56
|
+
rl.on("close", () => {
|
|
57
|
+
if (!answered) rej(new Error("Input closed before a project name was provided."));
|
|
58
|
+
});
|
|
59
|
+
rl.question(" Project name: ", (answer) => {
|
|
60
|
+
answered = true;
|
|
61
|
+
rl.close();
|
|
62
|
+
res(answer.trim());
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ── Validation ──────────────────────────────────────────────────────
|
|
68
|
+
|
|
69
|
+
function validateProjectName(name) {
|
|
70
|
+
if (!name) {
|
|
71
|
+
console.error("\n Error: Project name cannot be empty.\n");
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
if (name === "." || name === "..") {
|
|
75
|
+
console.error(`\n Error: Invalid project name "${name}".\n`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
if (name.includes("/") || name.includes("\\")) {
|
|
79
|
+
console.error("\n Error: Project name must not contain path separators.\n");
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// ── Target directory ────────────────────────────────────────────────
|
|
85
|
+
|
|
86
|
+
function ensureTargetDir(targetPath) {
|
|
87
|
+
if (existsSync(targetPath) && readdirSync(targetPath).length > 0) {
|
|
88
|
+
console.error(`\n Error: Directory "${basename(targetPath)}" already exists and is not empty.\n`);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
mkdirSync(targetPath, { recursive: true });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ── Copy ────────────────────────────────────────────────────────────
|
|
95
|
+
|
|
96
|
+
// npm excludes .gitignore from published packages — ship as _gitignore
|
|
97
|
+
// and rename during scaffolding (same approach as create-vite).
|
|
98
|
+
const RENAME_FILES = { _gitignore: ".gitignore" };
|
|
99
|
+
|
|
100
|
+
function copyDirRecursive(src, dest) {
|
|
101
|
+
mkdirSync(dest, { recursive: true });
|
|
102
|
+
for (const entry of readdirSync(src)) {
|
|
103
|
+
const srcPath = join(src, entry);
|
|
104
|
+
const destName = RENAME_FILES[entry] || entry;
|
|
105
|
+
const destPath = join(dest, destName);
|
|
106
|
+
if (statSync(srcPath).isDirectory()) {
|
|
107
|
+
copyDirRecursive(srcPath, destPath);
|
|
108
|
+
} else {
|
|
109
|
+
copyFileSync(srcPath, destPath);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// ── Patch package.json ──────────────────────────────────────────────
|
|
115
|
+
|
|
116
|
+
function patchPackageJson(destDir, projectName) {
|
|
117
|
+
const pkgPath = join(destDir, "package.json");
|
|
118
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
119
|
+
pkg.name = projectName;
|
|
120
|
+
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// ── Patch README ────────────────────────────────────────────────────
|
|
124
|
+
|
|
125
|
+
function patchReadme(destDir, projectName) {
|
|
126
|
+
const readmePath = join(destDir, "README.md");
|
|
127
|
+
let content = readFileSync(readmePath, "utf-8");
|
|
128
|
+
content = content.replaceAll("__PROJECT_NAME__", projectName);
|
|
129
|
+
writeFileSync(readmePath, content);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ── Final output ────────────────────────────────────────────────────
|
|
133
|
+
|
|
134
|
+
function printNextSteps(projectName) {
|
|
135
|
+
console.log(" Done! Next steps:\n");
|
|
136
|
+
console.log(` cd ${projectName}`);
|
|
137
|
+
console.log(" pnpm install");
|
|
138
|
+
console.log(" pnpm dev\n");
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// ── Main ────────────────────────────────────────────────────────────
|
|
142
|
+
|
|
143
|
+
async function main() {
|
|
144
|
+
const { help, version, projectName: argName } = parseArgs(process.argv);
|
|
145
|
+
|
|
146
|
+
if (help) {
|
|
147
|
+
printHelp();
|
|
148
|
+
process.exit(0);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (version) {
|
|
152
|
+
printVersion();
|
|
153
|
+
process.exit(0);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const projectName = argName || (await promptProjectName());
|
|
157
|
+
|
|
158
|
+
validateProjectName(projectName);
|
|
159
|
+
|
|
160
|
+
const targetDir = resolve(process.cwd(), projectName);
|
|
161
|
+
|
|
162
|
+
ensureTargetDir(targetDir);
|
|
163
|
+
|
|
164
|
+
console.log(`\n Scaffolding KoppaJS project: ${projectName}\n`);
|
|
165
|
+
|
|
166
|
+
copyDirRecursive(TEMPLATE_DIR, targetDir);
|
|
167
|
+
patchPackageJson(targetDir, projectName);
|
|
168
|
+
patchReadme(targetDir, projectName);
|
|
169
|
+
printNextSteps(projectName);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
main().catch((err) => {
|
|
173
|
+
console.error(`\n Error: ${err.message}\n`);
|
|
174
|
+
process.exit(1);
|
|
175
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-koppajs",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Scaffold a new KoppaJS project in seconds.",
|
|
7
|
+
"bin": {
|
|
8
|
+
"create-koppajs": "./bin/create-koppajs.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin",
|
|
12
|
+
"template",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=20"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"lint": "node -c bin/create-koppajs.js",
|
|
21
|
+
"test": "node ./bin/create-koppajs.js --help",
|
|
22
|
+
"smoke": "node scripts/smoke-test.mjs"
|
|
23
|
+
},
|
|
24
|
+
"author": "Bastian Bensch",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/koppajs/create-koppajs"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/koppajs/create-koppajs#readme",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/koppajs/create-koppajs/issues"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/template/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# __PROJECT_NAME__
|
|
2
|
+
|
|
3
|
+
A [KoppaJS](https://github.com/koppajs/koppajs-core) project.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
**Install dependencies:**
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Start the dev server:**
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm dev
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Build for production:**
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Preview the production build:**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm serve
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Project Structure
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
src/
|
|
35
|
+
├── main.ts Entry point — registers components, boots KoppaJS
|
|
36
|
+
├── style.css Global styles
|
|
37
|
+
├── app-view.kpa Root application view
|
|
38
|
+
└── counter-component.kpa Sample counter component
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Learn More
|
|
42
|
+
|
|
43
|
+
- [KoppaJS Documentation](https://github.com/koppajs/koppajs-documentation)
|
|
44
|
+
- [KoppaJS Core](https://github.com/koppajs/koppajs-core)
|
|
45
|
+
- [KoppaJS Vite Plugin](https://github.com/koppajs/koppajs-vite-plugin)
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
Apache-2.0
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
<title>KoppaJS Minimal Starter</title>
|
|
7
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
8
|
+
<link rel="stylesheet" href="/src/style.css" />
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<app-view></app-view>
|
|
12
|
+
<script type="module" src="/src/main.ts"></script>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "koppajs-example",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Minimal starter example for KoppaJS.",
|
|
6
|
+
"author": "Bastian Bensch",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "vite --host",
|
|
10
|
+
"build": "tsc && vite build",
|
|
11
|
+
"serve": "vite preview"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@koppajs/koppajs-core": "^3.0.0"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@koppajs/koppajs-vite-plugin": "^1.0.0",
|
|
18
|
+
"typescript": "^5.9.3",
|
|
19
|
+
"vite": "^7.2.6"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg width="410" height="404" viewBox="0 0 410 404" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M399.641 59.5246L215.643 388.545C211.844 395.338 202.084 395.378 198.228 388.618L10.5817 59.5563C6.38087 52.1896 12.6802 43.2665 21.0281 44.7586L205.223 77.6824C206.398 77.8924 207.601 77.8904 208.776 77.6763L389.119 44.8058C397.439 43.2894 403.768 52.1434 399.641 59.5246Z" fill="url(#paint0_linear)"/>
|
|
3
|
+
<path d="M292.965 1.5744L156.801 28.2552C154.563 28.6937 152.906 30.5903 152.771 32.8664L144.395 174.33C144.198 177.662 147.258 180.248 150.51 179.498L188.42 170.749C191.967 169.931 195.172 173.055 194.443 176.622L183.18 231.775C182.422 235.487 185.907 238.661 189.532 237.56L212.947 230.446C216.577 229.344 220.065 232.527 219.297 236.242L201.398 322.875C200.278 328.294 207.486 331.249 210.492 326.603L212.5 323.5L323.454 102.072C325.312 98.3645 322.108 94.137 318.036 94.9228L279.014 102.454C275.347 103.161 272.227 99.746 273.262 96.1583L298.731 7.86689C299.767 4.27314 296.636 0.855181 292.965 1.5744Z" fill="url(#paint1_linear)"/>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="paint0_linear" x1="6.00017" y1="32.9999" x2="235" y2="344" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop stop-color="#41D1FF"/>
|
|
7
|
+
<stop offset="1" stop-color="#BD34FE"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="paint1_linear" x1="194.651" y1="8.81818" x2="236.076" y2="292.989" gradientUnits="userSpaceOnUse">
|
|
10
|
+
<stop stop-color="#FFEA83"/>
|
|
11
|
+
<stop offset="0.0833333" stop-color="#FFDD35"/>
|
|
12
|
+
<stop offset="1" stop-color="#FFA800"/>
|
|
13
|
+
</linearGradient>
|
|
14
|
+
</defs>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[template]
|
|
2
|
+
<div class="app-root">
|
|
3
|
+
<img src="https://public-assets-1b57ca06-687a-4142-a525-0635f7649a5c.s3.eu-central-1.amazonaws.com/koppajs/koppajs-logo-text-900x226.png" width="420" alt="KoppaJS Logo" class="logo">
|
|
4
|
+
<p class="subtitle">Minimal Starter</p>
|
|
5
|
+
<counter-component></counter-component>
|
|
6
|
+
</div>
|
|
7
|
+
[/template]
|
|
8
|
+
|
|
9
|
+
[css]
|
|
10
|
+
.app-root {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
min-height: 100vh;
|
|
16
|
+
background: #0f1117;
|
|
17
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
18
|
+
padding: 2rem;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.logo {
|
|
22
|
+
margin-bottom: .9rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.subtitle {
|
|
26
|
+
color: #64dce8;
|
|
27
|
+
font-size: 1rem;
|
|
28
|
+
letter-spacing: 0.25em;
|
|
29
|
+
text-transform: uppercase;
|
|
30
|
+
margin: 0 0 1.5rem 0;
|
|
31
|
+
opacity: 0.8;
|
|
32
|
+
}
|
|
33
|
+
[/css]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
[template]
|
|
2
|
+
<div class="counter-card">
|
|
3
|
+
<span class="counter-label">Counter</span>
|
|
4
|
+
<p class="counter-value">{{ count }}</p>
|
|
5
|
+
<div class="counter-buttons">
|
|
6
|
+
<button onClick="decrement">−</button>
|
|
7
|
+
<button onClick="increment">+</button>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
[/template]
|
|
11
|
+
|
|
12
|
+
[ts]
|
|
13
|
+
return {
|
|
14
|
+
state: { count: 0 },
|
|
15
|
+
methods: {
|
|
16
|
+
increment() {
|
|
17
|
+
this.count++;
|
|
18
|
+
},
|
|
19
|
+
decrement() {
|
|
20
|
+
this.count--;
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
[/ts]
|
|
25
|
+
|
|
26
|
+
[css]
|
|
27
|
+
.counter-card {
|
|
28
|
+
background: #1a1d2e;
|
|
29
|
+
border: 1px solid #2a2d3e;
|
|
30
|
+
border-radius: 1.2rem;
|
|
31
|
+
padding: 2.5rem 3rem;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 1.2rem;
|
|
36
|
+
min-width: 260px;
|
|
37
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 48px rgba(100, 220, 232, 0.05);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.counter-label {
|
|
41
|
+
font-size: 0.85rem;
|
|
42
|
+
color: #64dce8;
|
|
43
|
+
text-transform: uppercase;
|
|
44
|
+
letter-spacing: 0.2em;
|
|
45
|
+
opacity: 0.7;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.counter-value {
|
|
49
|
+
font-size: 3rem;
|
|
50
|
+
font-weight: 700;
|
|
51
|
+
color: #e8eaf0;
|
|
52
|
+
margin: 0;
|
|
53
|
+
font-variant-numeric: tabular-nums;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.counter-buttons {
|
|
57
|
+
display: flex;
|
|
58
|
+
gap: 1rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
button {
|
|
62
|
+
background: transparent;
|
|
63
|
+
color: #64dce8;
|
|
64
|
+
border: 1px solid #64dce8;
|
|
65
|
+
border-radius: 0.6rem;
|
|
66
|
+
padding: 0.6rem 1.5rem;
|
|
67
|
+
font-size: 1.3rem;
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1),
|
|
71
|
+
color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
|
|
72
|
+
transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
|
|
73
|
+
border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
button:hover {
|
|
77
|
+
background: rgba(100, 220, 232, 0.12);
|
|
78
|
+
color: #8ff0f8;
|
|
79
|
+
border-color: #8ff0f8;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
button:active {
|
|
83
|
+
background: #64dce8;
|
|
84
|
+
color: #0f1117;
|
|
85
|
+
transform: scale(0.93);
|
|
86
|
+
}
|
|
87
|
+
[/css]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"lib": ["ES2022", "DOM"],
|
|
6
|
+
"strict": true,
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"noEmit": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*.ts"],
|
|
14
|
+
"exclude": ["node_modules", "dist"]
|
|
15
|
+
}
|