@kosdev-code/kos-codegen-core 0.1.0-next.792 → 0.1.0-next.796

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 (35) hide show
  1. package/index.d.ts +2 -2
  2. package/index.d.ts.map +1 -1
  3. package/index.js +395 -0
  4. package/index.js.map +1 -1
  5. package/index.mjs +395 -0
  6. package/index.mjs.map +1 -1
  7. package/lib/generators/ci-sync.d.ts +26 -0
  8. package/lib/generators/ci-sync.d.ts.map +1 -0
  9. package/lib/generators/generate-polyglot-workspace.d.ts +29 -0
  10. package/lib/generators/generate-polyglot-workspace.d.ts.map +1 -0
  11. package/lib/generators/index.d.ts +5 -0
  12. package/lib/generators/index.d.ts.map +1 -1
  13. package/lib/generators/java-workspace.d.ts +33 -0
  14. package/lib/generators/java-workspace.d.ts.map +1 -0
  15. package/lib/generators/kab-targets.d.ts +40 -0
  16. package/lib/generators/kab-targets.d.ts.map +1 -0
  17. package/lib/generators/release-version-script.d.ts +10 -0
  18. package/lib/generators/release-version-script.d.ts.map +1 -0
  19. package/package.json +2 -2
  20. package/templates/polyglot-workspace/build/build-java.sh.template +18 -0
  21. package/templates/polyglot-workspace/build/build-release.sh.template +11 -0
  22. package/templates/polyglot-workspace/build/build-ui.sh.template +16 -0
  23. package/templates/polyglot-workspace/build/docker-build.sh.template +49 -0
  24. package/templates/polyglot-workspace/build/jdkw.sh.template +93 -0
  25. package/templates/polyglot-workspace/build/nodew.sh.template +73 -0
  26. package/templates/polyglot-workspace/build/release_version_prebuild.sh.template +31 -0
  27. package/templates/polyglot-workspace/github/build-java.json.template +6 -0
  28. package/templates/polyglot-workspace/github/build-release.json.template +14 -0
  29. package/templates/polyglot-workspace/github/build-ui.json.template +13 -0
  30. package/templates/polyglot-workspace/github/workflows/develop-java.yml.template +35 -0
  31. package/templates/polyglot-workspace/github/workflows/develop-ui.yml.template +38 -0
  32. package/templates/polyglot-workspace/github/workflows/release.yml.template +37 -0
  33. package/templates/polyglot-workspace/java/README.md.template +36 -0
  34. package/templates/polyglot-workspace/root/.gitignore.template +5 -0
  35. package/templates/polyglot-workspace/root/README.md.template +69 -0
@@ -0,0 +1,37 @@
1
+ name: <%= nameDashCase %> release workflow
2
+ on:
3
+ push:
4
+ tags:
5
+ - "[0-9]+.[0-9]+.[0-9]+"
6
+
7
+ jobs:
8
+ release:
9
+ runs-on: ubuntu-latest
10
+ container:
11
+ image: ghcr.io/kosdev-code/kos-buildpublish/kos_builder:dockerimage
12
+ credentials:
13
+ username: ${{ github.actor }}
14
+ password: ${{ secrets.github_token }}
15
+ env:
16
+ KOS_KABTOOL_JAR: "/usr/local/lib/kabtool.jar"
17
+ JAVA_CMD: "java"
18
+ steps:
19
+ - name: Checkout Repository
20
+ uses: actions/checkout@v4
21
+ with:
22
+ repository: ${{ github.repository }}
23
+ token: ${{ secrets.GITHUB_TOKEN }}
24
+ path: ${{ github.event.repository.name }}
25
+ lfs: true
26
+
27
+ - name: Extract Version
28
+ run: |
29
+ echo KOSBUILD_VERSION=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
30
+
31
+ - name: Build and Publish
32
+ env:
33
+ KOSBUILD_SECRET_URL: ${{ secrets.KOSBUILD_SECRET_URL }}
34
+ KOSBUILD_SECRET_PASSWORD: ${{ secrets.KOSBUILD_SECRET_PASSWORD }}
35
+ working-directory: ./${{ github.event.repository.name }}
36
+ run: |
37
+ kos_build_handler.sh automation .github/build-release.json
@@ -0,0 +1,36 @@
1
+ # Java backend
2
+
3
+ Scaffold KOS Java modules here with the official KOS Maven archetypes — do not
4
+ hand-roll the project structure.
5
+
6
+ ## Prerequisites
7
+
8
+ - JDK 17 and Maven (see https://kosdev.com/articles/setup-you-kos-java-workspace/)
9
+
10
+ ## Creating a module
11
+
12
+ ```sh
13
+ cd java
14
+ mvn archetype:generate \
15
+ -DarchetypeGroupId=com.kos.archetypes \
16
+ -DarchetypeArtifactId=system-app
17
+ ```
18
+
19
+ Archetypes (see https://kosdev.com/articles/kos_maven_archetypes/):
20
+
21
+ | Archetype | Use for |
22
+ | --- | --- |
23
+ | `system-app` | The system app — the starting point of any KOS device |
24
+ | `app` | Apps extending system functionality |
25
+ | `sdk-app` | SDKs enabling inter-app collaboration |
26
+ | `multi-module` | Multiple KABs from a single project |
27
+
28
+ If your KOS CLI provides it, `kosui java:add` runs the archetype and updates
29
+ the CI manifests in one step.
30
+
31
+ ## Conventions
32
+
33
+ - Keep module versions at `0.0.0-SNAPSHOT` — releases are stamped from the git
34
+ tag by `build/release_version_prebuild.sh` (`mvn versions:set`).
35
+ - Register each module's KAB in `.github/build-java.json` and
36
+ `.github/build-release.json` (`artifacts` arrays) so CI publishes it.
@@ -0,0 +1,5 @@
1
+ .DS_Store
2
+ target/
3
+ *.log
4
+ # repo-local toolchain provisioned by build/nodew.sh
5
+ .kos/
@@ -0,0 +1,69 @@
1
+ # <%= nameDashCase %>
2
+
3
+ Polyglot KOS application repository: a Java backend and a KOS UI workspace that
4
+ build side-by-side KOS artifacts (KABs) published to the KOS marketplace.
5
+
6
+ ## Layout
7
+
8
+ | Path | Purpose |
9
+ | --- | --- |
10
+ | `ui/` | KOS UI workspace (Nx root lives here — run `npm`/`nx` commands inside `ui/`) |
11
+ | `java/` | KOS Java backend (Maven; scaffold modules with the KOS Maven archetypes — see `java/README.md`) |
12
+ | `build/` | Repo-level build orchestration scripts used locally and by CI |
13
+ | `.github/` | CI workflows and `kos_build_handler` manifests (`build-*.json`) |
14
+
15
+ The two halves never embed into each other: each produces its own KAB
16
+ artifacts, published together by the release pipeline.
17
+
18
+ ## Local builds
19
+
20
+ ```sh
21
+ ./build/build-ui.sh # npm ci + build all UI KABs
22
+ ./build/build-java.sh # mvn build (skips cleanly while java/ is empty)
23
+ ./build/build-release.sh # UI then Java (what the release pipeline runs)
24
+ ```
25
+
26
+ **No toolchain? No problem.** The build scripts provision what's missing
27
+ automatically (the `mvnw` pattern): `build/nodew.sh` fetches a pinned Node
28
+ runtime and `build/jdkw.sh` a pinned Temurin JDK + Maven, each into the
29
+ repo-local, gitignored `.kos/` on first use. Developers with their own
30
+ toolchains/IDEs are never touched — the wrappers always defer to an existing
31
+ install, so working on just `java/` in your own IDE needs nothing from here.
32
+
33
+ Optional: `./build/docker-build.sh ui|java|release` runs a build inside the
34
+ same container image CI uses (docker or podman; `docker login ghcr.io` for the
35
+ image) — useful to reproduce a CI-environment issue, never required for
36
+ development. Publishing is CI-only (tag push); no local flow publishes
37
+ anything.
38
+
39
+ ## Releases (tag-driven)
40
+
41
+ Push a semver tag to cut a release:
42
+
43
+ ```sh
44
+ git tag 1.0.0 && git push origin 1.0.0
45
+ ```
46
+
47
+ The release workflow derives `KOSBUILD_VERSION` from the tag, then
48
+ `build/release_version_prebuild.sh` stamps it into every UI project's
49
+ `.kos.json` (via `nx run-many --target=version`) and into the Maven POMs
50
+ (`mvn versions:set`) before building and publishing all artifacts.
51
+
52
+ ## CI configuration
53
+
54
+ Workflows run in the `kos_builder` container and publish through
55
+ `kos_build_handler.sh`. Repository secrets required:
56
+
57
+ - `KOSBUILD_SECRET_URL`
58
+ - `KOSBUILD_SECRET_PASSWORD`
59
+
60
+ The `default_keyset` in `.github/build-*.json` is org-specific (currently
61
+ `<%= keyset %>`) — change it there if your organization uses a different
62
+ keyset.
63
+
64
+ ## Adding artifacts
65
+
66
+ Every KAB the repo produces must be listed in the `artifacts` arrays of
67
+ `.github/build-ui.json` / `build-java.json` and the union kept in
68
+ `build-release.json`. Update these when adding UI projects or Java modules
69
+ (`kosui ci:sync` automates this where available).