trigger.dev 0.0.0-v3-pnpm-fix-20240409125541 → 0.0.0-v3-pnpm-fix-20240409132306
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/dist/index.js
CHANGED
|
@@ -801,7 +801,7 @@ import invariant from "tiny-invariant";
|
|
|
801
801
|
import { z as z4 } from "zod";
|
|
802
802
|
|
|
803
803
|
// package.json
|
|
804
|
-
var version = "0.0.0-v3-pnpm-fix-
|
|
804
|
+
var version = "0.0.0-v3-pnpm-fix-20240409132306";
|
|
805
805
|
var dependencies = {
|
|
806
806
|
"@clack/prompts": "^0.7.0",
|
|
807
807
|
"@depot/cli": "0.0.1-cli.2.55.0",
|
|
@@ -817,7 +817,7 @@ var dependencies = {
|
|
|
817
817
|
"@opentelemetry/sdk-trace-base": "^1.22.0",
|
|
818
818
|
"@opentelemetry/sdk-trace-node": "^1.22.0",
|
|
819
819
|
"@opentelemetry/semantic-conventions": "^1.22.0",
|
|
820
|
-
"@trigger.dev/core": "workspace:0.0.0-v3-pnpm-fix-
|
|
820
|
+
"@trigger.dev/core": "workspace:0.0.0-v3-pnpm-fix-20240409132306",
|
|
821
821
|
"@types/degit": "^2.8.3",
|
|
822
822
|
chalk: "^5.2.0",
|
|
823
823
|
chokidar: "^3.5.3",
|
|
@@ -3076,11 +3076,94 @@ function safeJsonParse(json) {
|
|
|
3076
3076
|
// src/utilities/javascriptProject.ts
|
|
3077
3077
|
import { $ } from "execa";
|
|
3078
3078
|
import { join as join4 } from "node:path";
|
|
3079
|
+
|
|
3080
|
+
// src/utilities/getUserPackageManager.ts
|
|
3081
|
+
import { findUp as findUp2 } from "find-up";
|
|
3082
|
+
async function getUserPackageManager(path6) {
|
|
3083
|
+
try {
|
|
3084
|
+
return await detectPackageManagerFromArtifacts(path6);
|
|
3085
|
+
} catch (error) {
|
|
3086
|
+
return detectPackageManagerFromCurrentCommand();
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
function detectPackageManagerFromCurrentCommand() {
|
|
3090
|
+
const userAgent = process.env.npm_config_user_agent;
|
|
3091
|
+
if (userAgent) {
|
|
3092
|
+
if (userAgent.startsWith("yarn")) {
|
|
3093
|
+
return "yarn";
|
|
3094
|
+
} else if (userAgent.startsWith("pnpm")) {
|
|
3095
|
+
return "pnpm";
|
|
3096
|
+
} else {
|
|
3097
|
+
return "npm";
|
|
3098
|
+
}
|
|
3099
|
+
} else {
|
|
3100
|
+
return "npm";
|
|
3101
|
+
}
|
|
3102
|
+
}
|
|
3103
|
+
async function detectPackageManagerFromArtifacts(path6) {
|
|
3104
|
+
const packageFiles = [
|
|
3105
|
+
{ name: "yarn.lock", pm: "yarn" },
|
|
3106
|
+
{ name: "pnpm-lock.yaml", pm: "pnpm" },
|
|
3107
|
+
{ name: "package-lock.json", pm: "npm" },
|
|
3108
|
+
{ name: "npm-shrinkwrap.json", pm: "npm" }
|
|
3109
|
+
];
|
|
3110
|
+
for (const { name, pm } of packageFiles) {
|
|
3111
|
+
const foundPath = await findUp2(name, { cwd: path6 });
|
|
3112
|
+
if (typeof foundPath === "string") {
|
|
3113
|
+
return pm;
|
|
3114
|
+
}
|
|
3115
|
+
}
|
|
3116
|
+
throw new Error("Could not detect package manager from artifacts");
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
// src/utilities/javascriptProject.ts
|
|
3120
|
+
var BuiltInModules = /* @__PURE__ */ new Set([
|
|
3121
|
+
"assert",
|
|
3122
|
+
"async_hooks",
|
|
3123
|
+
"buffer",
|
|
3124
|
+
"child_process",
|
|
3125
|
+
"cluster",
|
|
3126
|
+
"console",
|
|
3127
|
+
"constants",
|
|
3128
|
+
"crypto",
|
|
3129
|
+
"dgram",
|
|
3130
|
+
"dns",
|
|
3131
|
+
"domain",
|
|
3132
|
+
"events",
|
|
3133
|
+
"fs",
|
|
3134
|
+
"http",
|
|
3135
|
+
"http2",
|
|
3136
|
+
"https",
|
|
3137
|
+
"inspector",
|
|
3138
|
+
"module",
|
|
3139
|
+
"net",
|
|
3140
|
+
"os",
|
|
3141
|
+
"path",
|
|
3142
|
+
"perf_hooks",
|
|
3143
|
+
"process",
|
|
3144
|
+
"punycode",
|
|
3145
|
+
"querystring",
|
|
3146
|
+
"readline",
|
|
3147
|
+
"repl",
|
|
3148
|
+
"stream",
|
|
3149
|
+
"string_decoder",
|
|
3150
|
+
"timers",
|
|
3151
|
+
"tls",
|
|
3152
|
+
"trace_events",
|
|
3153
|
+
"tty",
|
|
3154
|
+
"url",
|
|
3155
|
+
"util",
|
|
3156
|
+
"v8",
|
|
3157
|
+
"vm",
|
|
3158
|
+
"worker_threads",
|
|
3159
|
+
"zlib"
|
|
3160
|
+
]);
|
|
3079
3161
|
var JavascriptProject = class {
|
|
3080
3162
|
constructor(projectPath) {
|
|
3081
3163
|
this.projectPath = projectPath;
|
|
3082
3164
|
}
|
|
3083
3165
|
_packageJson;
|
|
3166
|
+
_packageManager;
|
|
3084
3167
|
get packageJson() {
|
|
3085
3168
|
if (!this._packageJson) {
|
|
3086
3169
|
this._packageJson = readJSONFileSync(join4(this.projectPath, "package.json"));
|
|
@@ -3093,6 +3176,13 @@ var JavascriptProject = class {
|
|
|
3093
3176
|
};
|
|
3094
3177
|
}
|
|
3095
3178
|
async resolve(packageName, options) {
|
|
3179
|
+
if (BuiltInModules.has(packageName)) {
|
|
3180
|
+
return void 0;
|
|
3181
|
+
}
|
|
3182
|
+
if (!this._packageManager) {
|
|
3183
|
+
this._packageManager = await getUserPackageManager(this.projectPath);
|
|
3184
|
+
}
|
|
3185
|
+
const packageManager = this._packageManager;
|
|
3096
3186
|
const opts = { allowDev: false, ...options };
|
|
3097
3187
|
const packageJsonVersion = this.packageJson.dependencies?.[packageName];
|
|
3098
3188
|
if (typeof packageJsonVersion === "string") {
|
|
@@ -3104,21 +3194,19 @@ var JavascriptProject = class {
|
|
|
3104
3194
|
return devPackageJsonVersion;
|
|
3105
3195
|
}
|
|
3106
3196
|
}
|
|
3107
|
-
const
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
return version2;
|
|
3115
|
-
}
|
|
3116
|
-
} catch (error) {
|
|
3117
|
-
logger.debug(`Failed to resolve dependency version using ${command.name}`, {
|
|
3118
|
-
packageName,
|
|
3119
|
-
error
|
|
3120
|
-
});
|
|
3197
|
+
const command = packageManager === "npm" ? new NPMCommands() : packageManager === "pnpm" ? new PNPMCommands() : new YarnCommands();
|
|
3198
|
+
try {
|
|
3199
|
+
const version2 = await command.resolveDependencyVersion(packageName, {
|
|
3200
|
+
cwd: this.projectPath
|
|
3201
|
+
});
|
|
3202
|
+
if (version2) {
|
|
3203
|
+
return version2;
|
|
3121
3204
|
}
|
|
3205
|
+
} catch (error) {
|
|
3206
|
+
logger.debug(`Failed to resolve dependency version using ${command.name}`, {
|
|
3207
|
+
packageName,
|
|
3208
|
+
error
|
|
3209
|
+
});
|
|
3122
3210
|
}
|
|
3123
3211
|
}
|
|
3124
3212
|
};
|
|
@@ -4887,7 +4975,7 @@ function runtimeCheck(minimumMajor, minimumMinor) {
|
|
|
4887
4975
|
}
|
|
4888
4976
|
|
|
4889
4977
|
// src/commands/dev.tsx
|
|
4890
|
-
import { findUp as
|
|
4978
|
+
import { findUp as findUp3, pathExists as pathExists2 } from "find-up";
|
|
4891
4979
|
var apiClient;
|
|
4892
4980
|
var DevCommandOptions = CommonCommandOptions.extend({
|
|
4893
4981
|
debugger: z5.boolean().default(false),
|
|
@@ -5471,7 +5559,7 @@ async function amendNodePathWithPnpmNodeModules(nodePath) {
|
|
|
5471
5559
|
return pnpmModulesPath;
|
|
5472
5560
|
}
|
|
5473
5561
|
async function findPnpmNodeModulesPath() {
|
|
5474
|
-
return await
|
|
5562
|
+
return await findUp3(
|
|
5475
5563
|
async (directory) => {
|
|
5476
5564
|
const pnpmModules = join6(directory, "node_modules", ".pnpm", "node_modules");
|
|
5477
5565
|
const hasPnpmNodeModules = await pathExists2(pnpmModules);
|
|
@@ -5539,45 +5627,6 @@ function replaceAll(input, replacements) {
|
|
|
5539
5627
|
return output;
|
|
5540
5628
|
}
|
|
5541
5629
|
|
|
5542
|
-
// src/utilities/getUserPackageManager.ts
|
|
5543
|
-
import pathModule2 from "path";
|
|
5544
|
-
async function getUserPackageManager(path6) {
|
|
5545
|
-
try {
|
|
5546
|
-
return await detectPackageManagerFromArtifacts(path6);
|
|
5547
|
-
} catch (error) {
|
|
5548
|
-
return detectPackageManagerFromCurrentCommand();
|
|
5549
|
-
}
|
|
5550
|
-
}
|
|
5551
|
-
function detectPackageManagerFromCurrentCommand() {
|
|
5552
|
-
const userAgent = process.env.npm_config_user_agent;
|
|
5553
|
-
if (userAgent) {
|
|
5554
|
-
if (userAgent.startsWith("yarn")) {
|
|
5555
|
-
return "yarn";
|
|
5556
|
-
} else if (userAgent.startsWith("pnpm")) {
|
|
5557
|
-
return "pnpm";
|
|
5558
|
-
} else {
|
|
5559
|
-
return "npm";
|
|
5560
|
-
}
|
|
5561
|
-
} else {
|
|
5562
|
-
return "npm";
|
|
5563
|
-
}
|
|
5564
|
-
}
|
|
5565
|
-
async function detectPackageManagerFromArtifacts(path6) {
|
|
5566
|
-
const packageFiles = [
|
|
5567
|
-
{ name: "yarn.lock", pm: "yarn" },
|
|
5568
|
-
{ name: "pnpm-lock.yaml", pm: "pnpm" },
|
|
5569
|
-
{ name: "package-lock.json", pm: "npm" },
|
|
5570
|
-
{ name: "npm-shrinkwrap.json", pm: "npm" }
|
|
5571
|
-
];
|
|
5572
|
-
for (const { name, pm } of packageFiles) {
|
|
5573
|
-
const exists = await pathExists(pathModule2.join(path6, name));
|
|
5574
|
-
if (exists) {
|
|
5575
|
-
return pm;
|
|
5576
|
-
}
|
|
5577
|
-
}
|
|
5578
|
-
throw new Error("Could not detect package manager from artifacts");
|
|
5579
|
-
}
|
|
5580
|
-
|
|
5581
5630
|
// src/utilities/resolveInternalFilePath.ts
|
|
5582
5631
|
import { resolve as importResolve3 } from "import-meta-resolve";
|
|
5583
5632
|
function resolveInternalFilePath(filePath) {
|