Skip to content

Commit 1189821

Browse files
feat(@angular/cli): add aube as supported package manager, tested with a new workspace and the app works fine
1 parent 062ac27 commit 1189821

8 files changed

Lines changed: 53 additions & 7 deletions

File tree

‎packages/angular/cli/lib/config/workspace-schema.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"packageManager": {
4848
"description": "Specify which package manager tool to use.",
4949
"type": "string",
50-
"enum": ["npm", "yarn", "pnpm", "bun"]
50+
"enum": ["npm", "yarn", "pnpm", "bun", "aube"]
5151
},
5252
"warnings": {
5353
"description": "Control CLI specific console warnings",
@@ -101,7 +101,7 @@
101101
"packageManager": {
102102
"description": "Specify which package manager tool to use.",
103103
"type": "string",
104-
"enum": ["npm", "yarn", "pnpm", "bun"]
104+
"enum": ["npm", "yarn", "pnpm", "bun", "aube"]
105105
},
106106
"warnings": {
107107
"description": "Control CLI specific console warnings",

‎packages/angular/cli/src/package-managers/discovery_spec.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,12 @@ describe('discover', () => {
108108
const result = await discover(host, '/project');
109109
expect(result).toBe('bun');
110110
});
111+
112+
it('should discover the aube lockfile', async () => {
113+
const host = new MockHost({
114+
'/project': ['aube-lock.yaml'],
115+
});
116+
const result = await discover(host, '/project');
117+
expect(result).toBe('aube');
118+
});
111119
});

‎packages/angular/cli/src/package-managers/package-manager-descriptor.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,31 @@ export const SUPPORTED_PACKAGE_MANAGERS = {
281281
},
282282
isNotFound: isKnownNotFound,
283283
},
284+
aube: {
285+
binary: 'aube',
286+
lockfiles: ['aube-lock.yaml'],
287+
addCommand: 'add',
288+
installCommand: ['install'],
289+
forceFlag: '--force',
290+
saveExactFlag: '--save-exact',
291+
saveTildeFlag: '--save-tilde',
292+
saveDevFlag: '--save-dev',
293+
noLockfileFlag: '', // Aube does not have a flag for this.
294+
ignoreScriptsFlag: '--ignore-scripts',
295+
configFiles: ['.npmrc'],
296+
getRegistryOptions: (registry: string) => ({ args: ['--registry', registry] }),
297+
versionCommand: ['--version'],
298+
listDependenciesCommand: ['list', '--depth=0', '--json'],
299+
getManifestCommand: ['view', '--json'],
300+
viewCommandFieldArgFormatter: (fields) => [...fields],
301+
outputParsers: {
302+
listDependencies: parseNpmLikeDependencies,
303+
getRegistryManifest: parseNpmLikeManifest,
304+
getRegistryMetadata: parseNpmLikeMetadata,
305+
getError: parseNpmLikeError,
306+
},
307+
isNotFound: isKnownNotFound,
308+
},
284309
bun: {
285310
binary: 'bun',
286311
lockfiles: ['bun.lockb', 'bun.lock'],
@@ -347,6 +372,7 @@ export const SUPPORTED_PACKAGE_MANAGERS = {
347372
export const PACKAGE_MANAGER_PRECEDENCE: readonly PackageManagerName[] = [
348373
'pnpm',
349374
'yarn',
375+
'aube',
350376
'bun',
351377
'npm',
352378
];

‎packages/angular/create/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const hasPackageManagerArg = args.some((a) => a.startsWith('--package-manager'))
1717
if (!hasPackageManagerArg) {
1818
// Ex: yarn/1.22.18 npm/? node/v16.15.1 linux x64
1919
const packageManager = process.env['npm_config_user_agent']?.split('/')[0];
20-
if (packageManager && ['npm', 'pnpm', 'yarn', 'bun'].includes(packageManager)) {
20+
if (packageManager && ['npm', 'pnpm', 'yarn', 'bun', 'aube'].includes(packageManager)) {
2121
args.push('--package-manager', packageManager);
2222
}
2323
}

‎packages/schematics/angular/ng-new/schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"packageManager": {
133133
"description": "The package manager used to install dependencies.",
134134
"type": "string",
135-
"enum": ["npm", "yarn", "pnpm", "bun"]
135+
"enum": ["npm", "yarn", "pnpm", "bun", "aube"]
136136
},
137137
"standalone": {
138138
"description": "Creates an application based upon the standalone API, without NgModules.",

‎packages/schematics/angular/workspace/schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"packageManager": {
4141
"description": "The package manager to use for installing dependencies.",
4242
"type": "string",
43-
"enum": ["npm", "yarn", "pnpm", "bun"],
43+
"enum": ["npm", "yarn", "pnpm", "bun", "aube"],
4444
"$default": {
4545
"$source": "packageManager"
4646
}

‎tests/e2e/utils/packages.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { getGlobalVariable } from './env';
2-
import { ProcessOutput, silentBun, silentNpm, silentPnpm, silentYarn } from './process';
2+
import { ProcessOutput, silentAube, silentBun, silentNpm, silentPnpm, silentYarn } from './process';
33

44
export interface PkgInfo {
55
readonly name: string;
66
readonly version: string;
77
readonly path: string;
88
}
99

10-
export function getActivePackageManager(): 'npm' | 'yarn' | 'bun' | 'pnpm' {
10+
export function getActivePackageManager(): 'npm' | 'yarn' | 'bun' | 'pnpm' | 'aube' {
1111
return getGlobalVariable('package-manager');
1212
}
1313

@@ -29,6 +29,9 @@ export async function installWorkspacePackages(options?: { force?: boolean }): P
2929
case 'bun':
3030
await silentBun('install');
3131
break;
32+
case 'aube':
33+
await silentAube('install');
34+
break;
3235
}
3336
}
3437

@@ -43,6 +46,8 @@ export function installPackage(specifier: string, registry?: string): Promise<Pr
4346
return silentBun('add', specifier, ...registryOption);
4447
case 'pnpm':
4548
return silentPnpm('add', specifier, ...registryOption);
49+
case 'aube':
50+
return silentAube('add', specifier, ...registryOption);
4651
}
4752
}
4853

@@ -61,6 +66,9 @@ export async function uninstallPackage(name: string): Promise<void> {
6166
case 'pnpm':
6267
await silentPnpm('remove', name);
6368
break;
69+
case 'aube':
70+
await silentAube('remove', name);
71+
break;
6472
}
6573
} catch (e) {
6674
// Yarn throws an error when trying to remove a package that is not installed.

‎tests/e2e/utils/process.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ export function silentBun(...args: string[]) {
411411
return _exec({ silent: true }, 'bun', args);
412412
}
413413

414+
export function silentAube(...args: string[]) {
415+
return _exec({ silent: true }, 'aube', args);
416+
}
417+
414418
export function globalNpm(args: string[], env?: NodeJS.ProcessEnv) {
415419
if (!process.env.LEGACY_CLI_RUNNER) {
416420
throw new Error(

0 commit comments

Comments
 (0)