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

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
@@ -4,14 +4,13 @@ export declare class ModelFileTransformer {
4
4
  private codegenFs;
5
5
  private options;
6
6
  constructor(codegenFs: CodegenFileSystem, options: NormalizedAddFutureToModelOptions);
7
+ private get progressType();
7
8
  transform(): void;
8
- private addESLintDisable;
9
+ private removeLegacyImports;
9
10
  private addImports;
10
- private addServiceImport;
11
- private addInterfaceMerging;
11
+ private removeLegacyClassMembers;
12
12
  private addDecorator;
13
13
  private updatePublicType;
14
- private removeLegacySetup;
15
14
  private addFutureMethod;
16
15
  private addOnFutureUpdateMethod;
17
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"model-transformer.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-future-to-model/model-transformer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAEjE,qBAAa,oBAAoB;IAE7B,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;gBADP,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,iCAAiC;IAGpD,SAAS,IAAI,IAAI;IAyBjB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,UAAU;IA6GlB,OAAO,CAAC,gBAAgB;IA+CxB,OAAO,CAAC,mBAAmB;IAqC3B,OAAO,CAAC,YAAY;IA2BpB,OAAO,CAAC,gBAAgB;IAwBxB,OAAO,CAAC,iBAAiB;IA4BzB,OAAO,CAAC,eAAe;IA+DvB,OAAO,CAAC,uBAAuB;CA8ChC"}
1
+ {"version":3,"file":"model-transformer.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-future-to-model/model-transformer.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AA0BjE,qBAAa,oBAAoB;IAE7B,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;gBADP,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,iCAAiC;IAGpD,OAAO,KAAK,YAAY,GAKvB;IAED,SAAS,IAAI,IAAI;IAsCjB,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,UAAU;IA8BlB,OAAO,CAAC,wBAAwB;IA+BhC,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,eAAe;IAuCvB,OAAO,CAAC,uBAAuB;CAiChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-future-to-model/normalize-options.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EACV,uBAAuB,EACvB,iCAAiC,EAClC,MAAM,SAAS,CAAC;AAEjB,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,uBAAuB,EAChC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,iCAAiC,CAsEnC"}
1
+ {"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-future-to-model/normalize-options.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EACV,uBAAuB,EACvB,iCAAiC,EAClC,MAAM,SAAS,CAAC;AAEjB,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,uBAAuB,EAChC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,iCAAiC,CA0EnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"registration-transformer.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-future-to-model/registration-transformer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAEjE,qBAAa,2BAA2B;IAEpC,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;gBADP,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,iCAAiC;IAGpD,SAAS,IAAI,IAAI;IAiBjB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,mBAAmB;CAyD5B"}
1
+ {"version":3,"file":"registration-transformer.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-future-to-model/registration-transformer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAEjE,qBAAa,2BAA2B;IAEpC,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;gBADP,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,iCAAiC;IAGpD,SAAS,IAAI,IAAI;IA0BjB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,mBAAmB;CAyD5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-model-file.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/resolve-model-file.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAIjC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE,cAAc,EACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAqCnE"}
1
+ {"version":3,"file":"resolve-model-file.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/resolve-model-file.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAIjC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE,cAAc,EACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAiDnE"}
@@ -0,0 +1,26 @@
1
+ import { CodegenFileSystem } from '../codegen-filesystem';
2
+ export interface DiscoveredArtifact {
3
+ id: string;
4
+ filename: string;
5
+ layer?: number;
6
+ }
7
+ export interface CiSyncOptions {
8
+ /** Remove stale entries instead of keeping and reporting them. */
9
+ prune?: boolean;
10
+ }
11
+ export interface CiSyncManifestResult {
12
+ added: string[];
13
+ stale: string[];
14
+ pruned: string[];
15
+ }
16
+ export interface CiSyncResult {
17
+ manifests: Record<string, CiSyncManifestResult>;
18
+ discovered: {
19
+ ui: DiscoveredArtifact[];
20
+ java: DiscoveredArtifact[];
21
+ };
22
+ }
23
+ export declare function discoverUiArtifacts(codegenFs: CodegenFileSystem): DiscoveredArtifact[];
24
+ export declare function discoverJavaArtifacts(codegenFs: CodegenFileSystem): DiscoveredArtifact[];
25
+ export declare function syncCiManifests(codegenFs: CodegenFileSystem, options?: CiSyncOptions): CiSyncResult;
26
+ //# sourceMappingURL=ci-sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-sync.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/ci-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAChD,UAAU,EAAE;QAAE,EAAE,EAAE,kBAAkB,EAAE,CAAC;QAAC,IAAI,EAAE,kBAAkB,EAAE,CAAA;KAAE,CAAC;CACtE;AAgBD,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,iBAAiB,GAC3B,kBAAkB,EAAE,CAwCtB;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,iBAAiB,GAC3B,kBAAkB,EAAE,CAsBtB;AAkDD,wBAAgB,eAAe,CAC7B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,GAAE,aAAkB,GAC1B,YAAY,CAmBd"}
@@ -0,0 +1,38 @@
1
+ import { CodegenFileSystem } from '../codegen-filesystem';
2
+ export interface PolyglotWorkspaceOptions {
3
+ /** Workspace/repo name (also determines the UI app name `<name>-ui`). */
4
+ name: string;
5
+ /**
6
+ * The repo-root layer is IDENTICAL for every type — same scripts,
7
+ * workflows, and manifests, all runtime-tolerant of a missing half — so a
8
+ * repo can grow the other half later without restructuring. The type only
9
+ * seeds the manifests: "polyglot"/"ui" (default) pre-register the UI app
10
+ * artifact; "java" starts with empty artifact lists (ci:sync/java:add
11
+ * fill them in).
12
+ */
13
+ type?: "polyglot" | "ui" | "java";
14
+ /**
15
+ * `default_keyset` for the kos_build_handler manifests. Org-specific;
16
+ * changeable in .github/build-*.json afterward. Default: "prod.kos".
17
+ */
18
+ keyset?: string;
19
+ /**
20
+ * Node version build/nodew.sh pins and auto-provisions when the machine
21
+ * has none. Defaults to the Node running this generator — grounded in a
22
+ * version known to work with the scaffolded workspace.
23
+ */
24
+ nodeVersion?: string;
25
+ /** JDK major build/jdkw.sh pins (matches the archetypes' java.version). */
26
+ jdkMajor?: string;
27
+ /** Maven version build/jdkw.sh provisions when mvn is absent. */
28
+ mavenVersion?: string;
29
+ }
30
+ export interface PolyglotWorkspaceResult {
31
+ /**
32
+ * Root-relative paths the caller must mark executable (CodegenFileSystem
33
+ * has no chmod; CI invokes these directly as ./build/<script>).
34
+ */
35
+ executablePaths: string[];
36
+ }
37
+ export declare function generatePolyglotWorkspace(codegenFs: CodegenFileSystem, templateDir: string, options: PolyglotWorkspaceOptions): PolyglotWorkspaceResult;
38
+ //# sourceMappingURL=generate-polyglot-workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-polyglot-workspace.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/generate-polyglot-workspace.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI/D,MAAM,WAAW,wBAAwB;IACvC,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,GAAG,MAAM,CAAC;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAUD,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,iBAAiB,EAC5B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,wBAAwB,GAChC,uBAAuB,CAyCzB"}
@@ -1,6 +1,11 @@
1
1
  export { generateSplashProject, type SplashProjectOptions, } from './generate-splash-project';
2
2
  export { generateInit, type KosInitOptions } from './generate-init';
3
+ export { generatePolyglotWorkspace, type PolyglotWorkspaceOptions, type PolyglotWorkspaceResult, } from './generate-polyglot-workspace';
4
+ export { syncCiManifests, discoverUiArtifacts, discoverJavaArtifacts, type CiSyncOptions, type CiSyncResult, type CiSyncManifestResult, type DiscoveredArtifact, } from './ci-sync';
5
+ export { ensureJavaAggregatorPom, type EnsureJavaAggregatorOptions, finalizeArchetypeModule, type FinalizeArchetypeModuleOptions, addJavaArtifactToManifests, type AddJavaArtifactOptions, } from './java-workspace';
3
6
  export { normalizeOptions, type KosBaseGeneratorOptions, type NormalizedOptions, } from './normalize-options';
7
+ export { buildKabTargets, type KabTargetsOptions, type KabTargetDefinition, UPDATE_RELEASE_VERSION_SCRIPT_PATH, } from './kab-targets';
8
+ export { UPDATE_RELEASE_VERSION_SCRIPT } from './release-version-script';
4
9
  export { appendBarrelExport } from './barrel-utils';
5
10
  export { updateModelIndex } from './update-model-index';
6
11
  export { generateHook, type HookOptions } from './generate-hook';
@@ -11,6 +16,7 @@ export { generateModel, type ModelOptions, type GenerateModelParams, } from './g
11
16
  export { addFutureToModel, type AddFutureToModelOptions, type NormalizedAddFutureToModelOptions, } from './add-future-to-model';
12
17
  export { addContainerSupportToModel, type AddContainerSupportOptions, } from './add-container-support';
13
18
  export { addModelEffectToModel, type AddModelEffectOptions, addDependencyToModel, type AddDependencyOptions, addChildToModel, type AddChildOptions, type ChildShape, addTopicHandlerToModel, type AddTopicHandlerOptions, addConfigPropertyToModel, type AddConfigPropertyOptions, addServiceRequestToModel, type AddServiceRequestOptions, addPropertyToModel, type AddPropertyOptions, addComputedToModel, type AddComputedOptions, } from './member-mutators';
19
+ export { resolveModelFilePath, type ModelFileQuery, } from './augment/resolve-model-file';
14
20
  export { transformSourceFile, ensureNamedImport, resolveSdkModuleSpecifier, getModelClass, addClassDecorator, ensureDeclarationMerge, ensureFileEslintDisable, addDecoratedMethod, addDecoratedProperty, addPlainProperty, addGetter, } from './augment/ts-toolkit';
15
21
  export { validateModel, type ValidateModelOptions, type ValidationFinding, type ValidationResult, } from './validate';
16
22
  export { describeModel, type DescribeModelOptions, type DescribedMember, type ModelDescription, } from './describe';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iCAAiC,GACvC,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,0BAA0B,EAC1B,KAAK,0BAA0B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,GACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,iBAAiB,EACjB,KAAK,gBAAgB,GACtB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,33 @@
1
+ import { CodegenFileSystem } from '../codegen-filesystem';
2
+ export interface EnsureJavaAggregatorOptions {
3
+ groupId: string;
4
+ /** Aggregator artifactId (typically the workspace name). */
5
+ artifactId: string;
6
+ moduleName: string;
7
+ }
8
+ export declare function ensureJavaAggregatorPom(codegenFs: CodegenFileSystem, options: EnsureJavaAggregatorOptions): void;
9
+ export interface FinalizeArchetypeModuleOptions {
10
+ moduleName: string;
11
+ /** kos-bom version to pin (replaces the template's 0.0.0-SNAPSHOT). */
12
+ kosVersion?: string;
13
+ /** Fills the template's undefined ${kos-kab-maven-plugin.version}. */
14
+ kabPluginVersion?: string;
15
+ /** Explicit version for the api-info dep the kos-bom doesn't manage. */
16
+ apiInfoVersion?: string;
17
+ }
18
+ /**
19
+ * Repair a freshly archetype-generated module for use inside a polyglot
20
+ * workspace. Returns human-readable notes about anything it could NOT fix
21
+ * (missing versions the caller failed to derive) so the CLI can warn.
22
+ */
23
+ export declare function finalizeArchetypeModule(codegenFs: CodegenFileSystem, options: FinalizeArchetypeModuleOptions): string[];
24
+ export interface AddJavaArtifactOptions {
25
+ moduleName: string;
26
+ }
27
+ /**
28
+ * Register the module's KAB in build-java.json and build-release.json.
29
+ * Only the artifacts arrays are touched — keyset/build_cmd/etc. are the
30
+ * user's (same contract as ci:sync).
31
+ */
32
+ export declare function addJavaArtifactToManifests(codegenFs: CodegenFileSystem, options: AddJavaArtifactOptions): void;
33
+ //# sourceMappingURL=java-workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"java-workspace.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/java-workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,2BAA2B,GACnC,IAAI,CA+BN;AAED,MAAM,WAAW,8BAA8B;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,8BAA8B,GACtC,MAAM,EAAE,CAqEV;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,sBAAsB,GAC9B,IAAI,CA4BN"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Shared KOS artifact-target bundle.
3
+ *
4
+ * Every project that packages a KAB gets the same target family:
5
+ * kab — kabtool build + list (dependsOn zip)
6
+ * zip — archiver (dependsOn build [+ descriptor])
7
+ * descriptor — descriptor.mjs (optional; apps/plugins/content/i18n)
8
+ * version — stamps the release version into the project's `.kos.json`
9
+ *
10
+ * The `version` target is KOS *artifact* versioning: it rewrites the
11
+ * `version` field of the project's `.kos.json` (which kabtool/descriptor bake
12
+ * into the KAB) and never touches `package.json`. Tag-based release pipelines
13
+ * drive it via:
14
+ * nx run-many --target=version --args=--ver=$KOSBUILD_VERSION
15
+ *
16
+ * kab and version are deliberately produced by ONE helper so no generator can
17
+ * emit a KAB-packaging project that is not release-versionable.
18
+ */
19
+ export interface KabTargetsOptions {
20
+ /** Project name as Nx knows it (argument to kabtool/archiver/descriptor). */
21
+ name: string;
22
+ /** Subdirectory of dist/archives/ the KAB lands in. Default: "packages". */
23
+ archiveDir?: string;
24
+ /**
25
+ * Output directory under dist/ for descriptor.json (e.g. `apps/my-ui`,
26
+ * `plugins/my-plugin`). When set, a `descriptor` target is emitted and
27
+ * `zip` depends on it. Omit for projects without a descriptor (themes).
28
+ */
29
+ descriptorDir?: string;
30
+ /** Build target `zip` depends on. Default: "build" (plugins: "build:production"). */
31
+ buildTarget?: string;
32
+ }
33
+ export interface KabTargetDefinition {
34
+ command: string;
35
+ options?: Record<string, unknown>;
36
+ dependsOn?: string[];
37
+ }
38
+ export declare const UPDATE_RELEASE_VERSION_SCRIPT_PATH = "tools/scripts/update-release-version.mjs";
39
+ export declare function buildKabTargets(options: KabTargetsOptions): Record<string, KabTargetDefinition>;
40
+ //# sourceMappingURL=kab-targets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kab-targets.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/kab-targets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,iBAAiB;IAChC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,eAAO,MAAM,kCAAkC,6CACH,CAAC;AAE7C,wBAAgB,eAAe,CAC7B,OAAO,EAAE,iBAAiB,GACzB,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CA+CrC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Source of tools/scripts/update-release-version.mjs — the implementation of
3
+ * the `version` target emitted by buildKabTargets (see kab-targets.ts).
4
+ *
5
+ * Kept as a constant (not a .template file) so the preset generator and the
6
+ * add-version-targets migration emit byte-identical scripts and cannot drift.
7
+ * The script has no template variables: the project name arrives via argv.
8
+ */
9
+ export declare const UPDATE_RELEASE_VERSION_SCRIPT = "import devkit from \"@nx/devkit\";\nimport { resolve } from \"path\";\nimport { readFileSync, writeFileSync } from \"fs\";\nimport prettier from \"prettier\";\n\n// KOS artifact versioning: stamps the project's .kos.json \"version\" field\n// (which kabtool bakes into the KAB). Never touches package.json.\n// Driven by tag-based releases:\n// nx run-many --target=version --args=--ver=$KOSBUILD_VERSION\n\nconst { readCachedProjectGraph } = devkit;\nconst [, , name, versionArg] = process.argv;\n\n// \"{args.ver}\" arrives literally when the target runs without --args=--ver=<v>;\n// treat that (or a missing arg) as \"report current version, change nothing\".\nconst version =\n versionArg && !versionArg.startsWith(\"{args\") ? versionArg : undefined;\n\nif (!name) {\n console.error(\"usage: update-release-version.mjs <project> <version>\");\n process.exit(1);\n}\n\nconst graph = readCachedProjectGraph();\nconst project = graph.nodes[name];\nif (!project) {\n console.error(\"Unknown project: \" + name);\n process.exit(1);\n}\n\nconst kosJsonPath = resolve(process.cwd(), project.data.root, \".kos.json\");\nlet kosJson;\ntry {\n kosJson = JSON.parse(readFileSync(kosJsonPath, \"utf8\"));\n} catch {\n console.error(\"Missing or invalid .kos.json: \" + kosJsonPath);\n process.exit(1);\n}\n\nif (!version) {\n console.log(name + \": \" + kosJson.version + \" (no --ver given; unchanged)\");\n process.exit(0);\n}\n\nconst prettierOptions = await prettier.resolveConfig(kosJsonPath);\nconst output = await prettier.format(\n JSON.stringify({ ...kosJson, version }, null, 2),\n { ...prettierOptions, parser: \"json\" }\n);\nwriteFileSync(kosJsonPath, output);\nconsole.log(name + \": version -> \" + version);\n";
10
+ //# sourceMappingURL=release-version-script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-version-script.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/release-version-script.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,0sDAmDzC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosdev-code/kos-codegen-core",
3
- "version": "3.0.8",
3
+ "version": "3.0.10",
4
4
  "type": "commonjs",
5
5
  "main": "./index.js",
6
6
  "module": "./index.mjs",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "kos": {
27
27
  "build": {
28
- "gitHash": "29a870c61fdd44a1dbbef550f682c9d991e98146"
28
+ "gitHash": "a6322d3066945ba2545675cdb286b572d85a5452"
29
29
  }
30
30
  }
31
31
  }
@@ -0,0 +1,18 @@
1
+ #!/bin/bash
2
+ set -e -o pipefail
3
+
4
+ THIS_SCRIPT=$(realpath "$0")
5
+ TOP_DIR=$(dirname "$THIS_SCRIPT")/..
6
+
7
+ # Skips cleanly while java/ has no modules so the repo builds end-to-end from
8
+ # day one. Scaffold modules with the KOS Maven archetypes — see java/README.md.
9
+ if [ ! -f "${TOP_DIR}/java/pom.xml" ]; then
10
+ echo "No Java modules yet (java/pom.xml not found); skipping Java build."
11
+ exit 0
12
+ fi
13
+
14
+ # Provision a repo-local JDK + Maven if none are installed (the mvnw pattern).
15
+ . "$(dirname "$THIS_SCRIPT")/jdkw.sh"
16
+
17
+ cd "${TOP_DIR}/java"
18
+ mvn clean install --no-snapshot-updates -DskipTests -T4
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+ set -e -o pipefail
3
+
4
+ THIS_SCRIPT=$(realpath "$0")
5
+ THIS_SCRIPT_DIR=$(dirname "$THIS_SCRIPT")
6
+
7
+ echo "************ Run UI Build ***********"
8
+ "${THIS_SCRIPT_DIR}/build-ui.sh"
9
+
10
+ echo "************ Run Java Build ***********"
11
+ "${THIS_SCRIPT_DIR}/build-java.sh"
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+ set -e -o pipefail
3
+
4
+ THIS_SCRIPT=$(realpath "$0")
5
+ TOP_DIR=$(dirname "$THIS_SCRIPT")/..
6
+
7
+ # Skips cleanly while the repo has no ui half so the same scripts work for
8
+ # every workspace shape. Grow a ui half with: kosui ui:add
9
+ if [ ! -f "${TOP_DIR}/ui/package.json" ]; then
10
+ echo "No ui workspace yet (ui/package.json not found); skipping UI build."
11
+ exit 0
12
+ fi
13
+
14
+ # Provision a repo-local Node if none is installed (the mvnw pattern).
15
+ . "$(dirname "$THIS_SCRIPT")/nodew.sh"
16
+
17
+ cd "${TOP_DIR}/ui"
18
+
19
+ echo "************ NPM Install ***********"
20
+ npm ci
21
+
22
+ echo "************ Build UI KABs ***********"
23
+ npm run kab
@@ -0,0 +1,55 @@
1
+ #!/bin/bash
2
+ set -e -o pipefail
3
+
4
+ # Run a repo build inside the same container image CI uses — no local Node,
5
+ # JDK, or Maven required (only Docker or Podman). "Works in the container" ≈
6
+ # "works in CI". Usage: ./build/docker-build.sh [ui|java|release] (default:
7
+ # release)
8
+ #
9
+ # The image is pulled from GitHub Container Registry; if the pull is denied,
10
+ # authenticate first: docker login ghcr.io -u <github-user> (or podman login)
11
+
12
+ THIS_SCRIPT=$(realpath "$0")
13
+ TOP_DIR=$(dirname "$THIS_SCRIPT")/..
14
+ TARGET="${1:-release}"
15
+
16
+ if command -v docker >/dev/null 2>&1 && docker info >/dev/null 2>&1; then
17
+ RUNTIME=docker
18
+ elif command -v podman >/dev/null 2>&1; then
19
+ RUNTIME=podman
20
+ else
21
+ echo "Neither a running docker daemon nor podman found — install one, or use ./build/build-${TARGET}.sh with a local toolchain." >&2
22
+ exit 1
23
+ fi
24
+
25
+ case "$TARGET" in
26
+ ui | java | release) ;;
27
+ *)
28
+ echo "usage: $0 [ui|java|release]" >&2
29
+ exit 1
30
+ ;;
31
+ esac
32
+
33
+ IMAGE="ghcr.io/kosdev-code/kos-buildpublish/kos_builder:dockerimage"
34
+ WORKSPACE_NAME="$(basename "$(cd "$TOP_DIR" && pwd)")"
35
+
36
+ # npm cache + node_modules volumes only make sense once a ui half exists
37
+ # (and mounting /work/ui/node_modules would otherwise create a stray ui/).
38
+ UI_VOLUMES=""
39
+ if [ -f "${TOP_DIR}/ui/package.json" ]; then
40
+ UI_VOLUMES="-v kos-npm-cache-${WORKSPACE_NAME}:/root/.npm -v kos-node-modules-${WORKSPACE_NAME}:/work/ui/node_modules"
41
+ fi
42
+
43
+ # Named volumes keep Maven/npm caches warm between runs and keep the
44
+ # container's linux node_modules out of the host's ui/node_modules.
45
+ "$RUNTIME" run --rm \
46
+ -v "$(cd "$TOP_DIR" && pwd):/work" \
47
+ -v "kos-m2-${WORKSPACE_NAME}:/root/.m2" \
48
+ ${UI_VOLUMES} \
49
+ -w /work \
50
+ -e KOS_KABTOOL_JAR=/usr/local/lib/kabtool.jar \
51
+ -e JAVA_CMD=java \
52
+ ${KOSBUILD_VERSION:+-e KOSBUILD_VERSION="${KOSBUILD_VERSION}"} \
53
+ --entrypoint bash \
54
+ "$IMAGE" \
55
+ -lc "./build/build-${TARGET}.sh"
@@ -0,0 +1,93 @@
1
+ # jdkw — JDK + Maven wrapper (the mvnw pattern, one level deeper).
2
+ #
3
+ # SOURCE this file (it edits PATH/JAVA_HOME): `. "$(dirname "$0")/jdkw.sh"`
4
+ # If mvn and a JDK >= the pin are already on PATH they are used as-is —
5
+ # developers with their own toolchain/IDE are never touched. Otherwise a
6
+ # pinned Temurin JDK and Apache Maven are provisioned ONCE into .kos/
7
+ # (repo-local, gitignored) so the java build runs with no global installs.
8
+
9
+ JDKW_JAVA_MAJOR="<%= jdkMajor %>"
10
+ JDKW_MAVEN_VERSION="<%= mavenVersion %>"
11
+
12
+ jdkw_top_dir() {
13
+ # BASH_SOURCE because this file is sourced, not executed.
14
+ local src="${BASH_SOURCE[0]:-$0}"
15
+ echo "$(cd "$(dirname "$src")/.." && pwd)"
16
+ }
17
+
18
+ jdkw_java_ok() {
19
+ command -v java >/dev/null 2>&1 || return 1
20
+ local v
21
+ v="$(java -version 2>&1 | head -n 1 | sed -E 's/.*version "([0-9]+).*/\1/')" || return 1
22
+ [ "$v" -ge "$JDKW_JAVA_MAJOR" ] 2>/dev/null
23
+ }
24
+
25
+ jdkw_os() {
26
+ case "$(uname -s)" in
27
+ Darwin) echo "mac" ;;
28
+ Linux) echo "linux" ;;
29
+ *) return 1 ;;
30
+ esac
31
+ }
32
+
33
+ jdkw_arch() {
34
+ case "$(uname -m)" in
35
+ arm64 | aarch64) echo "aarch64" ;;
36
+ x86_64) echo "x64" ;;
37
+ *) return 1 ;;
38
+ esac
39
+ }
40
+
41
+ jdkw_ensure_java() {
42
+ if jdkw_java_ok; then
43
+ return 0
44
+ fi
45
+ local top os arch dest home
46
+ top="$(jdkw_top_dir)"
47
+ os="$(jdkw_os)" || {
48
+ echo "jdkw: unsupported OS $(uname -s) — install JDK ${JDKW_JAVA_MAJOR}+ manually" >&2
49
+ return 1
50
+ }
51
+ arch="$(jdkw_arch)" || {
52
+ echo "jdkw: unsupported arch $(uname -m) — install JDK ${JDKW_JAVA_MAJOR}+ manually" >&2
53
+ return 1
54
+ }
55
+ dest="${top}/.kos/jdk-${JDKW_JAVA_MAJOR}"
56
+ if [ ! -d "${dest}/bin" ] && [ ! -d "${dest}/Contents/Home/bin" ]; then
57
+ echo "jdkw: no JDK ${JDKW_JAVA_MAJOR}+ found; provisioning Temurin ${JDKW_JAVA_MAJOR} into .kos/ (one-time)" >&2
58
+ mkdir -p "$dest"
59
+ curl -fsSL "https://api.adoptium.net/v3/binary/latest/${JDKW_JAVA_MAJOR}/ga/${os}/${arch}/jdk/hotspot/normal/eclipse" |
60
+ tar -xz -C "$dest" --strip-components=1 || {
61
+ echo "jdkw: JDK download failed — install JDK ${JDKW_JAVA_MAJOR}+ manually" >&2
62
+ return 1
63
+ }
64
+ fi
65
+ if [ -d "${dest}/Contents/Home" ]; then
66
+ home="${dest}/Contents/Home"
67
+ else
68
+ home="$dest"
69
+ fi
70
+ export JAVA_HOME="$home"
71
+ export PATH="${home}/bin:${PATH}"
72
+ }
73
+
74
+ jdkw_ensure_maven() {
75
+ if command -v mvn >/dev/null 2>&1; then
76
+ return 0
77
+ fi
78
+ local top dest
79
+ top="$(jdkw_top_dir)"
80
+ dest="${top}/.kos/maven/apache-maven-${JDKW_MAVEN_VERSION}"
81
+ if [ ! -x "${dest}/bin/mvn" ]; then
82
+ echo "jdkw: no mvn found; provisioning Apache Maven ${JDKW_MAVEN_VERSION} into .kos/ (one-time)" >&2
83
+ mkdir -p "${top}/.kos/maven"
84
+ curl -fsSL "https://archive.apache.org/dist/maven/maven-3/${JDKW_MAVEN_VERSION}/binaries/apache-maven-${JDKW_MAVEN_VERSION}-bin.tar.gz" |
85
+ tar -xz -C "${top}/.kos/maven" || {
86
+ echo "jdkw: Maven download failed — install Maven manually" >&2
87
+ return 1
88
+ }
89
+ fi
90
+ export PATH="${dest}/bin:${PATH}"
91
+ }
92
+
93
+ jdkw_ensure_java && jdkw_ensure_maven
@@ -0,0 +1,73 @@
1
+ # nodew — Node wrapper, the mvnw pattern for Node.js.
2
+ #
3
+ # SOURCE this file (it edits PATH): `. "$(dirname "$0")/nodew.sh"`
4
+ # If a suitable node is already on PATH it is used as-is. Otherwise a pinned
5
+ # Node runtime is downloaded ONCE into .kos/node/ (repo-local, gitignored) so
6
+ # non-UI developers can run the build scripts with no global Node install.
7
+ # npm ships inside the Node distribution.
8
+
9
+ NODEW_VERSION="<%= nodeVersion %>"
10
+ NODEW_MAJOR="${NODEW_VERSION%%.*}"
11
+
12
+ nodew_top_dir() {
13
+ # BASH_SOURCE because this file is sourced, not executed.
14
+ local src="${BASH_SOURCE[0]:-$0}"
15
+ echo "$(cd "$(dirname "$src")/.." && pwd)"
16
+ }
17
+
18
+ nodew_have_suitable_node() {
19
+ command -v node >/dev/null 2>&1 || return 1
20
+ local v
21
+ v="$(node --version 2>/dev/null)" || return 1
22
+ v="${v#v}"
23
+ [ "${v%%.*}" -ge "$NODEW_MAJOR" ] 2>/dev/null
24
+ }
25
+
26
+ nodew_platform() {
27
+ case "$(uname -s)" in
28
+ Darwin) echo "darwin" ;;
29
+ Linux) echo "linux" ;;
30
+ *) return 1 ;;
31
+ esac
32
+ }
33
+
34
+ nodew_arch() {
35
+ case "$(uname -m)" in
36
+ arm64 | aarch64) echo "arm64" ;;
37
+ x86_64) echo "x64" ;;
38
+ *) return 1 ;;
39
+ esac
40
+ }
41
+
42
+ nodew_ensure() {
43
+ if nodew_have_suitable_node; then
44
+ return 0
45
+ fi
46
+
47
+ local top platform arch dist dest
48
+ top="$(nodew_top_dir)"
49
+ platform="$(nodew_platform)" || {
50
+ echo "nodew: unsupported OS $(uname -s) — install Node.js ${NODEW_MAJOR}+ manually" >&2
51
+ return 1
52
+ }
53
+ arch="$(nodew_arch)" || {
54
+ echo "nodew: unsupported arch $(uname -m) — install Node.js ${NODEW_MAJOR}+ manually" >&2
55
+ return 1
56
+ }
57
+ dist="node-v${NODEW_VERSION}-${platform}-${arch}"
58
+ dest="${top}/.kos/node/${dist}"
59
+
60
+ if [ ! -x "${dest}/bin/node" ]; then
61
+ echo "nodew: no Node ${NODEW_MAJOR}+ found; provisioning ${dist} into .kos/node/ (one-time)" >&2
62
+ mkdir -p "${top}/.kos/node"
63
+ curl -fsSL "https://nodejs.org/dist/v${NODEW_VERSION}/${dist}.tar.gz" |
64
+ tar -xz -C "${top}/.kos/node" || {
65
+ echo "nodew: download failed — install Node.js ${NODEW_MAJOR}+ manually" >&2
66
+ return 1
67
+ }
68
+ fi
69
+
70
+ export PATH="${dest}/bin:${PATH}"
71
+ }
72
+
73
+ nodew_ensure
@@ -0,0 +1,34 @@
1
+ #!/bin/bash
2
+ set -e -o pipefail
3
+
4
+ THIS_SCRIPT=$(realpath "$0")
5
+ TOP_DIR=$(dirname "$THIS_SCRIPT")/..
6
+
7
+ # KOS artifact versioning: stamp the tag-derived release version into every
8
+ # UI project's .kos.json and into the Maven POMs before the release build.
9
+ if [ -z "${KOSBUILD_VERSION}" ]; then
10
+ echo "KOSBUILD_VERSION must be defined for release builds"
11
+ exit 1
12
+ fi
13
+
14
+ if [ -f "${TOP_DIR}/ui/package.json" ]; then
15
+ # Provision a repo-local Node if none is installed (the mvnw pattern).
16
+ . "$(dirname "$THIS_SCRIPT")/nodew.sh"
17
+ cd "${TOP_DIR}/ui"
18
+ npm ci
19
+ npx nx run-many --target=version --args=--ver="${KOSBUILD_VERSION}"
20
+ else
21
+ echo "No ui workspace yet; skipping ui version stamp."
22
+ fi
23
+
24
+ if [ -f "${TOP_DIR}/java/pom.xml" ]; then
25
+ # Provision a repo-local JDK + Maven if none are installed.
26
+ . "$(dirname "$THIS_SCRIPT")/jdkw.sh"
27
+ cd "${TOP_DIR}/java"
28
+ # -DprocessAllModules: archetype-generated modules are standalone (no
29
+ # <parent> link to the aggregator), so a plain versions:set would stamp
30
+ # only the aggregator and leave module KABs at the old version.
31
+ mvn versions:set -DnewVersion="${KOSBUILD_VERSION}" -DprocessAllModules=true -DgenerateBackupPoms=false
32
+ else
33
+ echo "No Java modules yet; skipping Java version stamp."
34
+ fi
@@ -0,0 +1,6 @@
1
+ {
2
+ "default_keyset": "<%= keyset %>",
3
+ "build_cmd": "./build/build-java.sh",
4
+
5
+ "artifacts": []
6
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "default_keyset": "<%= keyset %>",
3
+ "prebuild_cmd": "build/release_version_prebuild.sh",
4
+ "build_cmd": "build/build-release.sh",
5
+
6
+ "artifacts": [<% if (hasUi) { %>
7
+ {
8
+ "id": "<%= appUiName %>",
9
+ "filename": "ui/dist/archives/packages/<%= appUiName %>/<%= appUiName %>.kab",
10
+ "artifactstore": "kos-cdn",
11
+ "marketplace": 1
12
+ }<% } %>
13
+ ]
14
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "default_keyset": "<%= keyset %>",
3
+ "build_cmd": "./build/build-ui.sh",
4
+
5
+ "artifacts": [<% if (hasUi) { %>
6
+ {
7
+ "id": "<%= appUiName %>",
8
+ "filename": "ui/dist/archives/packages/<%= appUiName %>/<%= appUiName %>.kab",
9
+ "artifactstore": "kos-cdn",
10
+ "marketplace": 1
11
+ }<% } %>
12
+ ]
13
+ }