@kosdev-code/kos-codegen-core 3.0.8 → 3.0.9

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 (40) hide show
  1. package/index.d.ts +2 -2
  2. package/index.d.ts.map +1 -1
  3. package/index.js +816 -488
  4. package/index.js.map +1 -1
  5. package/index.mjs +815 -487
  6. package/index.mjs.map +1 -1
  7. package/lib/generators/add-future-to-model/model-transformer.d.ts +3 -4
  8. package/lib/generators/add-future-to-model/model-transformer.d.ts.map +1 -1
  9. package/lib/generators/add-future-to-model/normalize-options.d.ts.map +1 -1
  10. package/lib/generators/add-future-to-model/registration-transformer.d.ts.map +1 -1
  11. package/lib/generators/augment/resolve-model-file.d.ts.map +1 -1
  12. package/lib/generators/ci-sync.d.ts +26 -0
  13. package/lib/generators/ci-sync.d.ts.map +1 -0
  14. package/lib/generators/generate-polyglot-workspace.d.ts +38 -0
  15. package/lib/generators/generate-polyglot-workspace.d.ts.map +1 -0
  16. package/lib/generators/index.d.ts +6 -0
  17. package/lib/generators/index.d.ts.map +1 -1
  18. package/lib/generators/java-workspace.d.ts +33 -0
  19. package/lib/generators/java-workspace.d.ts.map +1 -0
  20. package/lib/generators/kab-targets.d.ts +40 -0
  21. package/lib/generators/kab-targets.d.ts.map +1 -0
  22. package/lib/generators/release-version-script.d.ts +10 -0
  23. package/lib/generators/release-version-script.d.ts.map +1 -0
  24. package/package.json +2 -2
  25. package/templates/polyglot-workspace/build/build-java.sh.template +18 -0
  26. package/templates/polyglot-workspace/build/build-release.sh.template +11 -0
  27. package/templates/polyglot-workspace/build/build-ui.sh.template +23 -0
  28. package/templates/polyglot-workspace/build/docker-build.sh.template +55 -0
  29. package/templates/polyglot-workspace/build/jdkw.sh.template +93 -0
  30. package/templates/polyglot-workspace/build/nodew.sh.template +73 -0
  31. package/templates/polyglot-workspace/build/release_version_prebuild.sh.template +34 -0
  32. package/templates/polyglot-workspace/github/build-java.json.template +6 -0
  33. package/templates/polyglot-workspace/github/build-release.json.template +14 -0
  34. package/templates/polyglot-workspace/github/build-ui.json.template +13 -0
  35. package/templates/polyglot-workspace/github/workflows/develop-java.yml.template +35 -0
  36. package/templates/polyglot-workspace/github/workflows/develop-ui.yml.template +38 -0
  37. package/templates/polyglot-workspace/github/workflows/release.yml.template +37 -0
  38. package/templates/polyglot-workspace/java/README.md.template +36 -0
  39. package/templates/polyglot-workspace/root/.gitignore.template +5 -0
  40. package/templates/polyglot-workspace/root/README.md.template +71 -0
@@ -0,0 +1,35 @@
1
+ name: development-java-workflow
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ paths:
7
+ - "java/**"
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ java_build:
12
+ runs-on: ubuntu-latest
13
+ container:
14
+ image: ghcr.io/kosdev-code/kos-buildpublish/kos_builder:dockerimage
15
+ credentials:
16
+ username: ${{ github.actor }}
17
+ password: ${{ secrets.github_token }}
18
+
19
+ steps:
20
+ - name: Checkout Repository
21
+ uses: actions/checkout@v4
22
+ with:
23
+ repository: ${{ github.repository }}
24
+ token: ${{ secrets.GITHUB_TOKEN }}
25
+ path: ${{ github.event.repository.name }}
26
+ lfs: true
27
+
28
+ - name: Build and Publish
29
+ env:
30
+ KOSBUILD_SECRET_URL: ${{ secrets.KOSBUILD_SECRET_URL }}
31
+ KOSBUILD_SECRET_PASSWORD: ${{ secrets.KOSBUILD_SECRET_PASSWORD }}
32
+
33
+ working-directory: ./${{ github.event.repository.name }}
34
+ run: |
35
+ kos_build_handler.sh automation .github/build-java.json
@@ -0,0 +1,38 @@
1
+ name: development-ui-workflow
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ paths:
7
+ - "ui/**"
8
+
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ ui_build:
13
+ runs-on: ubuntu-latest
14
+ container:
15
+ image: ghcr.io/kosdev-code/kos-buildpublish/kos_builder:dockerimage
16
+ credentials:
17
+ username: ${{ github.actor }}
18
+ password: ${{ secrets.github_token }}
19
+ env:
20
+ KOS_KABTOOL_JAR: "/usr/local/lib/kabtool.jar"
21
+ JAVA_CMD: "java"
22
+ steps:
23
+ - name: Checkout Repository
24
+ uses: actions/checkout@v4
25
+ with:
26
+ repository: ${{ github.repository }}
27
+ token: ${{ secrets.GITHUB_TOKEN }}
28
+ path: ${{ github.event.repository.name }}
29
+ lfs: true
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
+
36
+ working-directory: ./${{ github.event.repository.name }}
37
+ run: |
38
+ kos_build_handler.sh automation .github/build-ui.json
@@ -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,71 @@
1
+ # <%= nameDashCase %>
2
+
3
+ KOS application repository. The layout is the same whether the repo holds a
4
+ UI workspace, a Java backend, or both — each half can be added at any time
5
+ without restructuring, and every build/CI script skips cleanly over a half
6
+ that doesn't exist yet.
7
+
8
+ ## Layout
9
+
10
+ | Path | Purpose |
11
+ | --- | --- |
12
+ | `ui/` | KOS UI workspace, if present (Nx root lives here — run `npm`/`nx` commands inside `ui/`; grow with `kosui ui:add`) |
13
+ | `java/` | KOS Java backend, if present (Maven; scaffold modules with the KOS Maven archetypes — `kosui java:add` or see `java/README.md`) |
14
+ | `build/` | Repo-level build orchestration scripts used locally and by CI |
15
+ | `.github/` | CI workflows and `kos_build_handler` manifests (`build-*.json`) |
16
+
17
+ The two halves never embed into each other: each produces its own KAB
18
+ artifacts, published together by the release pipeline.
19
+
20
+ ## Local builds
21
+
22
+ ```sh
23
+ ./build/build-ui.sh # npm ci + build all UI KABs (skips if no ui/)
24
+ ./build/build-java.sh # mvn build (skips if no java modules)
25
+ ./build/build-release.sh # both, in order — what the release pipeline runs
26
+ ```
27
+
28
+ **No toolchain? No problem.** The build scripts provision what's missing
29
+ automatically (the `mvnw` pattern): `build/nodew.sh` fetches a pinned Node
30
+ runtime and `build/jdkw.sh` a pinned Temurin JDK + Maven, each into the
31
+ repo-local, gitignored `.kos/` on first use. Developers with their own
32
+ toolchains/IDEs are never touched — the wrappers always defer to an existing
33
+ install, so working on just one half in your own IDE needs nothing from here.
34
+
35
+ Optional: `./build/docker-build.sh ui|java|release` runs a build inside the
36
+ same container image CI uses (docker or podman; `docker login ghcr.io` for the
37
+ image) — useful to reproduce a CI-environment issue, never required for
38
+ development. Publishing is CI-only (tag push); no local flow publishes
39
+ anything.
40
+
41
+ ## Releases (tag-driven)
42
+
43
+ Push a semver tag to cut a release:
44
+
45
+ ```sh
46
+ git tag 1.0.0 && git push origin 1.0.0
47
+ ```
48
+
49
+ The release workflow derives `KOSBUILD_VERSION` from the tag, then
50
+ `build/release_version_prebuild.sh` stamps it into every UI project's
51
+ `.kos.json` (via `nx run-many --target=version`) and the Maven POMs
52
+ (`mvn versions:set`) before building and publishing all artifacts.
53
+
54
+ ## CI configuration
55
+
56
+ Workflows run in the `kos_builder` container and publish through
57
+ `kos_build_handler.sh`. Repository secrets required:
58
+
59
+ - `KOSBUILD_SECRET_URL`
60
+ - `KOSBUILD_SECRET_PASSWORD`
61
+
62
+ The `default_keyset` in `.github/build-*.json` is org-specific (currently
63
+ `<%= keyset %>`) — change it there if your organization uses a different
64
+ keyset.
65
+
66
+ ## Adding artifacts
67
+
68
+ Every KAB the repo produces must be listed in the `artifacts` arrays of
69
+ `.github/build-ui.json` / `build-java.json`, with the union kept in
70
+ `build-release.json`. `kosui ci:sync` keeps these in sync with the projects
71
+ and modules that actually exist (`kosui java:add` updates them automatically).