create-nx-workspace 19.1.0-beta.1 → 19.1.0-beta.3
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/package.json
CHANGED
|
@@ -108,6 +108,11 @@ async function recordStat(opts) {
|
|
|
108
108
|
exports.recordStat = recordStat;
|
|
109
109
|
function shouldRecordStats() {
|
|
110
110
|
const pmc = (0, package_manager_1.getPackageManagerCommand)();
|
|
111
|
+
if (!pmc.getRegistryUrl) {
|
|
112
|
+
// Fallback on true as Package management doesn't support reading config for registry.
|
|
113
|
+
// currently Bun doesn't support fetching config settings https://github.com/oven-sh/bun/issues/7140
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
111
116
|
try {
|
|
112
117
|
const stdout = (0, node_child_process_1.execSync)(pmc.getRegistryUrl, { encoding: 'utf-8' });
|
|
113
118
|
const url = new URL(stdout.trim());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const packageManagerList: readonly ["pnpm", "yarn", "npm"];
|
|
1
|
+
export declare const packageManagerList: readonly ["pnpm", "yarn", "npm", "bun"];
|
|
2
2
|
export type PackageManager = typeof packageManagerList[number];
|
|
3
3
|
export declare function detectPackageManager(dir?: string): PackageManager;
|
|
4
4
|
/**
|
|
@@ -18,7 +18,7 @@ export declare function getPackageManagerCommand(packageManager?: PackageManager
|
|
|
18
18
|
exec: string;
|
|
19
19
|
preInstall?: string;
|
|
20
20
|
globalAdd: string;
|
|
21
|
-
getRegistryUrl
|
|
21
|
+
getRegistryUrl?: string;
|
|
22
22
|
};
|
|
23
23
|
export declare function generatePackageManagerFiles(root: string, packageManager?: PackageManager): void;
|
|
24
24
|
export declare function getPackageManagerVersion(packageManager: PackageManager, cwd?: string): string;
|
|
@@ -8,13 +8,15 @@ const path_1 = require("path");
|
|
|
8
8
|
* Because we don't want to depend on @nx/workspace (to speed up the workspace creation)
|
|
9
9
|
* we duplicate the helper functions from @nx/workspace in this file.
|
|
10
10
|
*/
|
|
11
|
-
exports.packageManagerList = ['pnpm', 'yarn', 'npm'];
|
|
11
|
+
exports.packageManagerList = ['pnpm', 'yarn', 'npm', 'bun'];
|
|
12
12
|
function detectPackageManager(dir = '') {
|
|
13
|
-
return (0, fs_1.existsSync)((0, path_1.join)(dir, '
|
|
14
|
-
? '
|
|
15
|
-
: (0, fs_1.existsSync)((0, path_1.join)(dir, '
|
|
16
|
-
? '
|
|
17
|
-
: '
|
|
13
|
+
return (0, fs_1.existsSync)((0, path_1.join)(dir, 'bun.lockb'))
|
|
14
|
+
? 'bun'
|
|
15
|
+
: (0, fs_1.existsSync)((0, path_1.join)(dir, 'yarn.lock'))
|
|
16
|
+
? 'yarn'
|
|
17
|
+
: (0, fs_1.existsSync)((0, path_1.join)(dir, 'pnpm-lock.yaml'))
|
|
18
|
+
? 'pnpm'
|
|
19
|
+
: 'npm';
|
|
18
20
|
}
|
|
19
21
|
exports.detectPackageManager = detectPackageManager;
|
|
20
22
|
/**
|
|
@@ -66,6 +68,13 @@ function getPackageManagerCommand(packageManager = detectPackageManager()) {
|
|
|
66
68
|
globalAdd: 'npm i -g',
|
|
67
69
|
getRegistryUrl: 'npm config get registry',
|
|
68
70
|
};
|
|
71
|
+
case 'bun':
|
|
72
|
+
// bun doesn't current support programatically reading config https://github.com/oven-sh/bun/issues/7140
|
|
73
|
+
return {
|
|
74
|
+
install: 'bun install --silent --ignore-scripts',
|
|
75
|
+
exec: 'bunx',
|
|
76
|
+
globalAdd: 'bun install -g',
|
|
77
|
+
};
|
|
69
78
|
}
|
|
70
79
|
}
|
|
71
80
|
exports.getPackageManagerCommand = getPackageManagerCommand;
|