Skip to content

Commit 0c59d09

Browse files
committed
feat(compas): improved package manager support
1 parent 1c05783 commit 0c59d09

File tree

7 files changed

+356
-122
lines changed

7 files changed

+356
-122
lines changed

gen/compas.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,17 @@ export function applyCompasStructure(generator) {
9090
"Did clean caches from project directories. Managed by {@link CacheCleanupIntegration}.",
9191
),
9292

93-
packageManagerInstallCommand: T.generic()
93+
packageManager: T.generic()
9494
.keys(T.string())
95-
.values(T.array().values(T.string()))
95+
.values({
96+
name: T.string(),
97+
installCommand: T.string(),
98+
nodeModulesBinCommand: T.string(),
99+
packageJsonScriptCommand: T.string(),
100+
})
96101
.optional()
97102
.docs(
98-
"The inferred package install command per rootDirectory. Managed by {@link PackageManagerIntegration}.",
103+
"The inferred package manager per rootDirectory. Managed by {@link PackageManagerIntegration}.",
99104
),
100105
}),
101106
);

packages/compas/src/generated/common/structure.json

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
"sql": {},
7171
"type": "boolean"
7272
},
73-
"packageManagerInstallCommand": {
74-
"docString": "The inferred package install command per rootDirectory. Managed by {@link PackageManagerIntegration}.",
73+
"packageManager": {
74+
"docString": "The inferred package manager per rootDirectory. Managed by {@link PackageManagerIntegration}.",
7575
"isOptional": true,
7676
"validator": {},
7777
"sql": {},
@@ -93,22 +93,65 @@
9393
"docString": "",
9494
"isOptional": false,
9595
"validator": {
96-
"convert": false
96+
"allowNull": false,
97+
"strict": true
9798
},
9899
"sql": {},
99-
"type": "array",
100-
"values": {
101-
"docString": "",
102-
"isOptional": false,
103-
"validator": {
104-
"allowNull": false,
105-
"trim": false,
106-
"lowerCase": false,
107-
"upperCase": false,
108-
"min": 1
100+
"type": "object",
101+
"relations": [],
102+
"keys": {
103+
"name": {
104+
"docString": "",
105+
"isOptional": false,
106+
"validator": {
107+
"allowNull": false,
108+
"trim": false,
109+
"lowerCase": false,
110+
"upperCase": false,
111+
"min": 1
112+
},
113+
"sql": {},
114+
"type": "string"
109115
},
110-
"sql": {},
111-
"type": "string"
116+
"installCommand": {
117+
"docString": "",
118+
"isOptional": false,
119+
"validator": {
120+
"allowNull": false,
121+
"trim": false,
122+
"lowerCase": false,
123+
"upperCase": false,
124+
"min": 1
125+
},
126+
"sql": {},
127+
"type": "string"
128+
},
129+
"nodeModulesBinCommand": {
130+
"docString": "",
131+
"isOptional": false,
132+
"validator": {
133+
"allowNull": false,
134+
"trim": false,
135+
"lowerCase": false,
136+
"upperCase": false,
137+
"min": 1
138+
},
139+
"sql": {},
140+
"type": "string"
141+
},
142+
"packageJsonScriptCommand": {
143+
"docString": "",
144+
"isOptional": false,
145+
"validator": {
146+
"allowNull": false,
147+
"trim": false,
148+
"lowerCase": false,
149+
"upperCase": false,
150+
"min": 1
151+
},
152+
"sql": {},
153+
"type": "string"
154+
}
112155
}
113156
}
114157
}

packages/compas/src/generated/common/types.d.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,14 @@ export type CompasCache = {
6565
"cachesCleaned"?: boolean|undefined;
6666

6767
/**
68-
* The inferred package install command per rootDirectory. Managed by {@link PackageManagerIntegration}.
68+
* The inferred package manager per rootDirectory. Managed by {@link PackageManagerIntegration}.
6969
*/
70-
"packageManagerInstallCommand"?: { [key: string]: (string)[]}|undefined;
70+
"packageManager"?: { [key: string]: {
71+
"name": string;
72+
"installCommand": string;
73+
"nodeModulesBinCommand": string;
74+
"packageJsonScriptCommand": string;
75+
}}|undefined;
7176
};
7277

7378
export type CompasResolvedConfigInput = {
@@ -134,9 +139,14 @@ export type CompasCacheInput = {
134139
"cachesCleaned"?: boolean|"true"|"false"|undefined;
135140

136141
/**
137-
* The inferred package install command per rootDirectory. Managed by {@link PackageManagerIntegration}.
142+
* The inferred package manager per rootDirectory. Managed by {@link PackageManagerIntegration}.
138143
*/
139-
"packageManagerInstallCommand"?: { [key: string]: (string)[]}|undefined;
144+
"packageManager"?: { [key: string]: {
145+
"name": string;
146+
"installCommand": string;
147+
"nodeModulesBinCommand": string;
148+
"packageJsonScriptCommand": string;
149+
}}|undefined;
140150
};
141151

142152
export type CompasConfig = {

0 commit comments

Comments
 (0)