@orsetra/camel-pom-gen 1.0.0 → 1.1.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/index.ts +12 -4
- package/package.json +6 -6
package/index.ts
CHANGED
|
@@ -63,6 +63,10 @@ export interface PomGenConfig {
|
|
|
63
63
|
* The pom.xml is read from and written back to {rootDir}/pom.xml.
|
|
64
64
|
*/
|
|
65
65
|
rootDir?: string
|
|
66
|
+
/** Maven groupId for the generated project. Defaults to 'org.apache.camel.k.integration'. */
|
|
67
|
+
groupId?: string
|
|
68
|
+
/** Maven artifactId for the generated project. Defaults to 'camel-k-integration'. */
|
|
69
|
+
artifactId?: string
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
export interface SyncPomResult {
|
|
@@ -77,7 +81,9 @@ export interface SyncPomResult {
|
|
|
77
81
|
// ── Global state ──────────────────────────────────────────────────────────────
|
|
78
82
|
|
|
79
83
|
let _config: CamelKRuntimeConfig = DEFAULT_CONFIG
|
|
80
|
-
let _rootDir
|
|
84
|
+
let _rootDir = '.'
|
|
85
|
+
let _groupId = 'org.apache.camel.k.integration'
|
|
86
|
+
let _artifactId = 'camel-k-integration'
|
|
81
87
|
|
|
82
88
|
// ── Init ──────────────────────────────────────────────────────────────────────
|
|
83
89
|
|
|
@@ -86,10 +92,12 @@ let _rootDir = '.'
|
|
|
86
92
|
*/
|
|
87
93
|
export function init(config: PomGenConfig): void {
|
|
88
94
|
const base = getRuntimeConfig(config.operatorVersion ?? DEFAULT_CONFIG.operatorVersion)
|
|
89
|
-
_config
|
|
95
|
+
_config = config.flavor && config.flavor !== base.flavor
|
|
90
96
|
? { ...base, flavor: config.flavor }
|
|
91
97
|
: base
|
|
92
|
-
_rootDir
|
|
98
|
+
_rootDir = config.rootDir ?? '.'
|
|
99
|
+
_groupId = config.groupId ?? 'org.apache.camel.k.integration'
|
|
100
|
+
_artifactId = config.artifactId ?? 'camel-k-integration'
|
|
93
101
|
registerFsProvider(config.fs)
|
|
94
102
|
}
|
|
95
103
|
|
|
@@ -113,7 +121,7 @@ export async function syncPom(): Promise<SyncPomResult> {
|
|
|
113
121
|
const sources = await scanSources(fs, _rootDir)
|
|
114
122
|
|
|
115
123
|
// Build dependency project
|
|
116
|
-
const project = createProject(
|
|
124
|
+
const project = createProject(_groupId, _artifactId, _config.operatorVersion)
|
|
117
125
|
if (_config.flavor === 'quarkus') {
|
|
118
126
|
addDependencyGAV(project, 'org.apache.camel.k', 'camel-k-runtime')
|
|
119
127
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orsetra/camel-pom-gen",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Generate Camel K pom.xml from route sources — ports the dependency-detection pipeline from camel-k Go to TypeScript",
|
|
5
5
|
"main": "./index.ts",
|
|
6
6
|
"types": "./index.ts",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"js-yaml": "^4.1.1"
|
|
32
32
|
},
|
|
33
|
-
"scripts": {
|
|
34
|
-
"test": "vitest run",
|
|
35
|
-
"test:watch": "vitest"
|
|
36
|
-
},
|
|
37
33
|
"devDependencies": {
|
|
38
34
|
"@types/js-yaml": "^4.0.9",
|
|
39
35
|
"typescript": "^5",
|
|
40
36
|
"vitest": "^5.0.3"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:watch": "vitest"
|
|
41
41
|
}
|
|
42
|
-
}
|
|
42
|
+
}
|