@yarnpkg/plugin-exec
Advanced tools
@@ -6,2 +6,3 @@ "use strict"; | ||
| const core_2 = require("@yarnpkg/core"); | ||
| const core_3 = require("@yarnpkg/core"); | ||
| const fslib_1 = require("@yarnpkg/fslib"); | ||
@@ -42,2 +43,5 @@ const constants_1 = require("./constants"); | ||
| async fetchFromDisk(locator, opts) { | ||
| const dependencyMeta = opts.project.getDependencyMeta(locator, null); | ||
| if (!opts.project.configuration.get(`enableScripts`) && !dependencyMeta.built) | ||
| throw new core_3.ReportError(core_3.MessageName.DISABLED_BUILD_SCRIPTS, `${core_1.structUtils.prettyLocator(opts.project.configuration, locator)} can't be built with the exec: protocol because all scripts have been disabled.`); | ||
| const generatorFile = await (0, execUtils_1.loadGeneratorFile)(locator.reference, constants_1.PROTOCOL, opts); | ||
@@ -44,0 +48,0 @@ return fslib_1.xfs.mktempPromise(async (generatorDir) => { |
@@ -8,2 +8,3 @@ "use strict"; | ||
| const core_3 = require("@yarnpkg/core"); | ||
| const core_4 = require("@yarnpkg/core"); | ||
| const constants_1 = require("./constants"); | ||
@@ -28,4 +29,6 @@ const execUtils = tslib_1.__importStar(require("./execUtils")); | ||
| bindDescriptor(descriptor, fromLocator, opts) { | ||
| return core_3.structUtils.bindDescriptor(descriptor, { | ||
| locator: core_3.structUtils.stringifyLocator(fromLocator), | ||
| if (opts.project.tryWorkspaceByLocator(fromLocator) === null) | ||
| throw new core_3.ReportError(core_3.MessageName.INVALID_MANIFEST, `${core_4.structUtils.prettyLocator(opts.project.configuration, fromLocator)} lists ${core_4.structUtils.prettyDescriptor(opts.project.configuration, descriptor)} as dependency, but only workspaces can depend on exec: packages.`); | ||
| return core_4.structUtils.bindDescriptor(descriptor, { | ||
| locator: core_4.structUtils.stringifyLocator(fromLocator), | ||
| }); | ||
@@ -42,3 +45,3 @@ } | ||
| throw new Error(`Assertion failed: The descriptor should have been bound`); | ||
| const generatorFile = await execUtils.loadGeneratorFile(core_3.structUtils.makeRange({ | ||
| const generatorFile = await execUtils.loadGeneratorFile(core_4.structUtils.makeRange({ | ||
| protocol: constants_1.PROTOCOL, | ||
@@ -48,6 +51,6 @@ source: path, | ||
| params: { | ||
| locator: core_3.structUtils.stringifyLocator(parentLocator), | ||
| locator: core_4.structUtils.stringifyLocator(parentLocator), | ||
| }, | ||
| }), constants_1.PROTOCOL, opts.fetchOptions); | ||
| const generatorHash = core_3.hashUtils.makeHash(`${CACHE_VERSION}`, generatorFile).slice(0, 6); | ||
| const generatorHash = core_4.hashUtils.makeHash(`${CACHE_VERSION}`, generatorFile).slice(0, 6); | ||
| return [execUtils.makeLocator(descriptor, { parentLocator, path, generatorHash, protocol: constants_1.PROTOCOL })]; | ||
@@ -66,3 +69,3 @@ } | ||
| const packageFetch = await opts.fetchOptions.fetcher.fetch(locator, opts.fetchOptions); | ||
| const manifest = await core_3.miscUtils.releaseAfterUseAsync(async () => { | ||
| const manifest = await core_4.miscUtils.releaseAfterUseAsync(async () => { | ||
| return await core_1.Manifest.find(packageFetch.prefixPath, { baseFs: packageFetch.packageFs }); | ||
@@ -69,0 +72,0 @@ }, packageFetch.releaseFs); |
+5
-5
| { | ||
| "name": "@yarnpkg/plugin-exec", | ||
| "version": "3.0.2", | ||
| "version": "3.1.0", | ||
| "license": "BSD-2-Clause", | ||
@@ -11,11 +11,11 @@ "main": "./lib/index.js", | ||
| "dependencies": { | ||
| "@yarnpkg/fslib": "^3.1.2", | ||
| "@yarnpkg/fslib": "^3.1.5", | ||
| "tslib": "^2.4.0" | ||
| }, | ||
| "peerDependencies": { | ||
| "@yarnpkg/core": "^4.4.2" | ||
| "@yarnpkg/core": "^4.7.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@yarnpkg/builder": "^4.2.2", | ||
| "@yarnpkg/core": "^4.4.2" | ||
| "@yarnpkg/builder": "^4.2.3", | ||
| "@yarnpkg/core": "^4.7.0" | ||
| }, | ||
@@ -22,0 +22,0 @@ "scripts": { |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
24514
3.66%374
2.19%0
-100%Updated